shithub: cstory

Download patch

ref: 21d5ba34b0c1cda1b1fa20c620c5cfed96750af9
parent: 26af89d5bb140bc2ceef3c634e3852386d9966f9
author: Clownacy <[email protected]>
date: Thu Jun 27 14:01:55 EDT 2019

Shut up some Clang warnings in the Enhanced branch

Once again SDL2 using plain ints everywhere causes issues.

--- a/src/Draw.cpp
+++ b/src/Draw.cpp
@@ -388,7 +388,7 @@
 
 static SDL_Rect RectToSDLRect(RECT *rect)
 {
-	SDL_Rect SDLRect = {rect->left, rect->top, rect->right - rect->left, rect->bottom - rect->top};
+	SDL_Rect SDLRect = {(int)rect->left, (int)rect->top, (int)(rect->right - rect->left), (int)(rect->bottom - rect->top)};
 	if (SDLRect.w < 0)
 		SDLRect.w = 0;
 	if (SDLRect.h < 0)
@@ -468,7 +468,7 @@
 void Surface2Surface(int x, int y, RECT *rect, int to, int from)
 {
 	// Get rects
-	SDL_Rect rcSet = {x * magnification, y * magnification, (rect->right - rect->left) * magnification, (rect->bottom - rect->top) * magnification};
+	SDL_Rect rcSet = {x * magnification, y * magnification, (int)(rect->right - rect->left) * magnification, (int)(rect->bottom - rect->top) * magnification};
 	SDL_Rect frameRect = RectToSDLRectScaled(rect);
 
 	SDL_BlitSurface(surf[from].surface, &frameRect, surf[to].surface, &rcSet);