Add settings

This commit is contained in:
Miloslav Číž 2019-09-26 21:18:44 +02:00
parent d441dd9d9a
commit f18079cd00
3 changed files with 11 additions and 11 deletions

9
main.c
View File

@ -1,5 +1,6 @@
#include <stdint.h>
#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);

View File

@ -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

8
settings.h Normal file
View File

@ -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