diff --git a/RetroFE/Source/Graphics/Component/Image.cpp b/RetroFE/Source/Graphics/Component/Image.cpp index 2bf0f9a..fe4982b 100644 --- a/RetroFE/Source/Graphics/Component/Image.cpp +++ b/RetroFE/Source/Graphics/Component/Image.cpp @@ -64,8 +64,8 @@ void Image::allocateGraphicsMemory() { SDL_SetTextureBlendMode(texture_, SDL_BLENDMODE_BLEND); SDL_QueryTexture(texture_, NULL, NULL, &width, &height); - baseViewInfo.ImageWidth = width; - baseViewInfo.ImageHeight = height; + baseViewInfo.ImageWidth = (float)width; + baseViewInfo.ImageHeight = (float)height; } SDL_UnlockMutex(SDL::getMutex()); diff --git a/RetroFE/Source/SDL.cpp b/RetroFE/Source/SDL.cpp index 1e92a2d..35e68e8 100644 --- a/RetroFE/Source/SDL.cpp +++ b/RetroFE/Source/SDL.cpp @@ -374,10 +374,10 @@ bool SDL::renderCopy( SDL_Texture *texture, float alpha, SDL_Rect *src, SDL_Rect dstRectCopy.w = dstRect.w; dstRectCopy.h = dstRect.h; - dstRect.x *= scaleX; - dstRect.y *= scaleY; - dstRect.w *= scaleX; - dstRect.h *= scaleY; + dstRect.x = (int)(dstRect.x*scaleX); + dstRect.y = (int)(dstRect.y*scaleY); + dstRect.w = (int)(dstRect.w*scaleX); + dstRect.h = (int)(dstRect.h*scaleY); SDL_SetTextureAlphaMod( texture, static_cast( alpha * 255 ) ); SDL_RenderCopyEx( getRenderer( ), texture, &srcRect, &dstRect, viewInfo.Angle, NULL, SDL_FLIP_NONE ); @@ -391,10 +391,10 @@ bool SDL::renderCopy( SDL_Texture *texture, float alpha, SDL_Rect *src, SDL_Rect { dstRect.h = static_cast( static_cast(dstRect.h ) * viewInfo.ReflectionScale); dstRect.y = dstRect.y - dstRect.h - viewInfo.ReflectionDistance; - dstRect.x *= scaleX; - dstRect.y *= scaleY; - dstRect.w *= scaleX; - dstRect.h *= scaleY; + dstRect.x = (int)(dstRect.x*scaleX); + dstRect.y = (int)(dstRect.y*scaleY); + dstRect.w = (int)(dstRect.w*scaleX); + dstRect.h = (int)(dstRect.h*scaleY); SDL_SetTextureAlphaMod( texture, static_cast( viewInfo.ReflectionAlpha * alpha * 255 ) ); SDL_RenderCopyEx( getRenderer( ), texture, src, &dstRect, viewInfo.Angle, NULL, SDL_FLIP_VERTICAL ); } @@ -403,10 +403,10 @@ bool SDL::renderCopy( SDL_Texture *texture, float alpha, SDL_Rect *src, SDL_Rect { dstRect.y = dstRect.y + dstRect.h + viewInfo.ReflectionDistance; dstRect.h = static_cast( static_cast(dstRect.h ) * viewInfo.ReflectionScale); - dstRect.x *= scaleX; - dstRect.y *= scaleY; - dstRect.w *= scaleX; - dstRect.h *= scaleY; + dstRect.x = (int)(dstRect.x*scaleX); + dstRect.y = (int)(dstRect.y*scaleY); + dstRect.w = (int)(dstRect.w*scaleX); + dstRect.h = (int)(dstRect.h*scaleY); SDL_SetTextureAlphaMod( texture, static_cast( viewInfo.ReflectionAlpha * alpha * 255 ) ); SDL_RenderCopyEx( getRenderer( ), texture, src, &dstRect, viewInfo.Angle, NULL, SDL_FLIP_VERTICAL ); } @@ -415,10 +415,10 @@ bool SDL::renderCopy( SDL_Texture *texture, float alpha, SDL_Rect *src, SDL_Rect { dstRect.w = static_cast( static_cast(dstRect.w ) * viewInfo.ReflectionScale); dstRect.x = dstRect.x - dstRect.w - viewInfo.ReflectionDistance; - dstRect.x *= scaleX; - dstRect.y *= scaleY; - dstRect.w *= scaleX; - dstRect.h *= scaleY; + dstRect.x = (int)(dstRect.x*scaleX); + dstRect.y = (int)(dstRect.y*scaleY); + dstRect.w = (int)(dstRect.w*scaleX); + dstRect.h = (int)(dstRect.h*scaleY); SDL_SetTextureAlphaMod( texture, static_cast( viewInfo.ReflectionAlpha * alpha * 255 ) ); SDL_RenderCopyEx( getRenderer( ), texture, src, &dstRect, viewInfo.Angle, NULL, SDL_FLIP_HORIZONTAL ); } @@ -427,10 +427,10 @@ bool SDL::renderCopy( SDL_Texture *texture, float alpha, SDL_Rect *src, SDL_Rect { dstRect.x = dstRect.x + dstRect.w + viewInfo.ReflectionDistance; dstRect.w = static_cast( static_cast(dstRect.w ) * viewInfo.ReflectionScale); - dstRect.x *= scaleX; - dstRect.y *= scaleY; - dstRect.w *= scaleX; - dstRect.h *= scaleY; + dstRect.x = (int)(dstRect.x*scaleX); + dstRect.y = (int)(dstRect.y*scaleY); + dstRect.w = (int)(dstRect.w*scaleX); + dstRect.h = (int)(dstRect.h*scaleY); SDL_SetTextureAlphaMod( texture, static_cast( viewInfo.ReflectionAlpha * alpha * 255 ) ); SDL_RenderCopyEx( getRenderer( ), texture, src, &dstRect, viewInfo.Angle, NULL, SDL_FLIP_HORIZONTAL ); }