Cast X_TO_UNITS and UNITS_TO_X values to int

This shuts up some MSVC warnings about implicitly casting doubles to
ints when the macros' results are assigned to variables.
This commit is contained in:
Clownacy 2019-09-25 17:29:22 +01:00
parent d2df9d9104
commit 7bf3109019

View file

@ -3,15 +3,15 @@
#define WINDOW_WIDTH 320 #define WINDOW_WIDTH 320
#define WINDOW_HEIGHT 240 #define WINDOW_HEIGHT 240
#define TILES_TO_PIXELS(x) ((x) * 0x10) #define TILES_TO_PIXELS(x) ((int)((x) * 0x10))
#define PIXELS_TO_TILES(x) ((x) / 0x10) #define PIXELS_TO_TILES(x) ((int)((x) / 0x10))
#define PIXELS_TO_UNITS(x) ((x) * 0x200) #define PIXELS_TO_UNITS(x) ((int)((x) * 0x200))
#define UNITS_TO_PIXELS(x) ((x) / 0x200) #define UNITS_TO_PIXELS(x) ((int)((x) / 0x200))
#define TILES_TO_UNITS(x) ((x) * (0x200 * 0x10)) #define TILES_TO_UNITS(x) ((int)((x) * (0x200 * 0x10)))
#define UNITS_TO_TILES(x) ((x) / (0x200 * 0x10)) #define UNITS_TO_TILES(x) ((int)((x) / (0x200 * 0x10)))
#define SECONDS_TO_FRAMES(x) ((x) * 50) #define SECONDS_TO_FRAMES(x) ((int)((x) * 50))
#define FRAMES_TO_SECONDS(x) ((x) / 50) #define FRAMES_TO_SECONDS(x) ((int)((x) / 50))
enum Collisions enum Collisions
{ {