mirror of
https://github.com/gnif/LookingGlass.git
synced 2024-11-22 13:37:22 +00:00
[client] switched srcRect to srcSize and type to SDL_Point
This commit is contained in:
parent
7f3657e5f0
commit
59a894ae04
@ -52,7 +52,7 @@ struct AppState
|
|||||||
bool started;
|
bool started;
|
||||||
|
|
||||||
TTF_Font *font;
|
TTF_Font *font;
|
||||||
SDL_Rect srcRect;
|
SDL_Point srcSize;
|
||||||
LG_RendererRect dstRect;
|
LG_RendererRect dstRect;
|
||||||
float scaleX, scaleY;
|
float scaleX, scaleY;
|
||||||
|
|
||||||
@ -112,7 +112,7 @@ inline void updatePositionInfo()
|
|||||||
|
|
||||||
if (params.keepAspect)
|
if (params.keepAspect)
|
||||||
{
|
{
|
||||||
const float srcAspect = (float)state.srcRect.h / (float)state.srcRect.w;
|
const float srcAspect = (float)state.srcSize.y / (float)state.srcSize.x;
|
||||||
const float wndAspect = (float)h / (float)w;
|
const float wndAspect = (float)h / (float)w;
|
||||||
if (wndAspect < srcAspect)
|
if (wndAspect < srcAspect)
|
||||||
{
|
{
|
||||||
@ -137,19 +137,8 @@ inline void updatePositionInfo()
|
|||||||
state.dstRect.h = h;
|
state.dstRect.h = h;
|
||||||
}
|
}
|
||||||
|
|
||||||
state.scaleX = (float)state.srcRect.h / (float)state.dstRect.h;
|
state.scaleX = (float)state.srcSize.y / (float)state.dstRect.h;
|
||||||
state.scaleY = (float)state.srcRect.w / (float)state.dstRect.w;
|
state.scaleY = (float)state.srcSize.x / (float)state.dstRect.w;
|
||||||
}
|
|
||||||
|
|
||||||
inline bool areFormatsSame(const struct KVMFRHeader s1, const struct KVMFRHeader s2)
|
|
||||||
{
|
|
||||||
return
|
|
||||||
(s1.frameType != FRAME_TYPE_INVALID) &&
|
|
||||||
(s2.frameType != FRAME_TYPE_INVALID) &&
|
|
||||||
(s1.version == s2.version ) &&
|
|
||||||
(s1.frameType == s2.frameType) &&
|
|
||||||
(s1.width == s2.width ) &&
|
|
||||||
(s1.height == s2.height );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
inline uint64_t microtime()
|
inline uint64_t microtime()
|
||||||
@ -332,10 +321,8 @@ int renderThread(void * unused)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
state.srcRect.x = 0;
|
state.srcSize.x = header.width;
|
||||||
state.srcRect.y = 0;
|
state.srcSize.y = header.height;
|
||||||
state.srcRect.w = header.width;
|
|
||||||
state.srcRect.h = header.height;
|
|
||||||
updatePositionInfo();
|
updatePositionInfo();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user