summaryrefslogtreecommitdiff
path: root/src/render/graphics.h
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2014-04-29 20:20:48 +0300
committerAndrei Karas <akaras@inbox.ru>2014-04-29 20:20:48 +0300
commitc24fefa91a1416a4dad7fd97d67cefa51f9eb97c (patch)
tree4a8d894f6932dfcb95268121bed3c433c2461bd0 /src/render/graphics.h
parent03418ce78766b062ce5af7aaf99f7f2c62152b6b (diff)
downloadmanaplus-c24fefa91a1416a4dad7fd97d67cefa51f9eb97c.tar.gz
manaplus-c24fefa91a1416a4dad7fd97d67cefa51f9eb97c.tar.bz2
manaplus-c24fefa91a1416a4dad7fd97d67cefa51f9eb97c.tar.xz
manaplus-c24fefa91a1416a4dad7fd97d67cefa51f9eb97c.zip
Add type defines for SDL_Rect based on SDL version.
Diffstat (limited to 'src/render/graphics.h')
-rw-r--r--src/render/graphics.h12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/render/graphics.h b/src/render/graphics.h
index 49080f4de..541bb789d 100644
--- a/src/render/graphics.h
+++ b/src/render/graphics.h
@@ -85,6 +85,14 @@
#include "localconsts.h"
+#ifdef USE_SDL2
+#define RectPos int32_t
+#define RectSize int32_t
+#else
+#define RectPos int16_t
+#define RectSize uint16_t
+#endif
+
class Image;
class ImageCollection;
class ImageVertexes;
@@ -165,8 +173,8 @@ class Graphics
const int width, const int height)
{
mWindow = window;
- mRect.w = width;
- mRect.h = height;
+ mRect.w = static_cast<RectSize>(width);
+ mRect.h = static_cast<RectSize>(height);
}
SDL_Window *getWindow() const