From 6853f860f6c19d0c796a0050e52f80710f5b0d8c Mon Sep 17 00:00:00 2001 From: Linus_Probert Date: Wed, 24 Jan 2018 08:52:50 +0100 Subject: [PATCH] Fixed the scaling which was borked --- src/defines.h | 14 +++++++------- src/main.c | 3 +-- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/src/defines.h b/src/defines.h index 33d8ac8..28d5ced 100644 --- a/src/defines.h +++ b/src/defines.h @@ -14,17 +14,17 @@ #define SPRITE_DIMENSION 16 /* Display stuff */ -#define GAME_VIEW_WIDTH MAP_ROOM_WIDTH * TILE_DIMENSION -#define GAME_VIEW_HEIGHT MAP_ROOM_HEIGHT * TILE_DIMENSION +#define GAME_VIEW_WIDTH (MAP_ROOM_WIDTH * TILE_DIMENSION) +#define GAME_VIEW_HEIGHT (MAP_ROOM_HEIGHT * TILE_DIMENSION) -#define RIGHT_GUI_WIDTH 10 * SPRITE_DIMENSION +#define RIGHT_GUI_WIDTH (10 * SPRITE_DIMENSION) #define RIGHT_GUI_HEIGHT GAME_VIEW_HEIGHT -#define BOTTOM_GUI_HEIGHT 10 * SPRITE_DIMENSION -#define BOTTOM_GUI_WIDTH GAME_VIEW_WIDTH + RIGHT_GUI_WIDTH +#define BOTTOM_GUI_HEIGHT (10 * SPRITE_DIMENSION) +#define BOTTOM_GUI_WIDTH (GAME_VIEW_WIDTH + RIGHT_GUI_WIDTH) -#define SCREEN_WIDTH GAME_VIEW_WIDTH + RIGHT_GUI_WIDTH -#define SCREEN_HEIGHT GAME_VIEW_HEIGHT + BOTTOM_GUI_HEIGHT +#define SCREEN_WIDTH (GAME_VIEW_WIDTH + RIGHT_GUI_WIDTH) +#define SCREEN_HEIGHT (GAME_VIEW_HEIGHT + BOTTOM_GUI_HEIGHT) /* Windows and compile crap */ #ifdef _WIN32 diff --git a/src/main.c b/src/main.c index 09db776..5d6278b 100644 --- a/src/main.c +++ b/src/main.c @@ -40,8 +40,7 @@ bool initSDL(void) if (dim.height > 1080) { info("Hi resolution screen detected (%u x %u)", dim.width, dim.height); - //renderScale = ((double) dim.height)/1080; - renderScale = 4; + renderScale = ((double) dim.height)/1080; info("Scaling by %f", renderScale); }