From f18079cd00f3bee0f4b4be601efa1c5ff01967cd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miloslav=20=C4=8C=C3=AD=C5=BE?= Date: Thu, 26 Sep 2019 21:18:44 +0200 Subject: [PATCH] Add settings --- main.c | 9 +++------ platform_sdl.h | 5 ----- settings.h | 8 ++++++++ 3 files changed, 11 insertions(+), 11 deletions(-) create mode 100644 settings.h diff --git a/main.c b/main.c index 4deacf6..af658b5 100755 --- a/main.c +++ b/main.c @@ -1,5 +1,6 @@ #include #include "constants.h" +#include "settings.h" #include "levels.h" #include "assets.h" @@ -15,11 +16,7 @@ /* When porting, define the following in your specific platform_*.h. Also you have to call SFG_mainLoopBody() in the platform's main loop and SFG_init() - in the platform initialization. */ - -// SFG_RESOLUTION_X #define this to screen width in pixels -// SFG_RESOLUTION_Y #define this to screen height in pixels -// SFG_FPS #define this to desired FPS + in the platform initialization. Also set specific settings in settings.h */ /** Return 1 (0) if given key is pressed (not pressed). */ int8_t SFG_keyPressed(uint8_t key); @@ -73,7 +70,7 @@ struct const uint8_t* textures[7]; } SFG_currentLevel; -void SFG_setLevel(SFG_Level *level) +void SFG_setLevel(const SFG_Level *level) { SFG_currentLevel.levelPointer = level; SFG_currentLevel.mapPointer = &(level->map); diff --git a/platform_sdl.h b/platform_sdl.h index 6777405..fd70e8f 100644 --- a/platform_sdl.h +++ b/platform_sdl.h @@ -8,11 +8,6 @@ #include "palette.h" -#define SFG_RESOLUTION_X 800 -#define SFG_RESOLUTION_Y 600 - -#define SFG_FPS 60 - const uint8_t *sdlKeyboardState; uint16_t screen[SFG_RESOLUTION_X * SFG_RESOLUTION_Y]; // RGB565 format diff --git a/settings.h b/settings.h new file mode 100644 index 0000000..0ca5c9d --- /dev/null +++ b/settings.h @@ -0,0 +1,8 @@ +#ifndef _SFG_SETTINGS_H +#define _SFG_SETTINGS_H + +#define SFG_FPS 60 +#define SFG_RESOLUTION_X 1024 +#define SFG_RESOLUTION_Y 768 + +#endif // guard