mirror of https://gitlab.com/drummyfish/anarch.git
Add settings
This commit is contained in:
parent
d441dd9d9a
commit
f18079cd00
9
main.c
9
main.c
|
@ -1,5 +1,6 @@
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include "constants.h"
|
#include "constants.h"
|
||||||
|
#include "settings.h"
|
||||||
#include "levels.h"
|
#include "levels.h"
|
||||||
#include "assets.h"
|
#include "assets.h"
|
||||||
|
|
||||||
|
@ -15,11 +16,7 @@
|
||||||
|
|
||||||
/* When porting, define the following in your specific platform_*.h. Also you
|
/* 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()
|
have to call SFG_mainLoopBody() in the platform's main loop and SFG_init()
|
||||||
in the platform initialization. */
|
in the platform initialization. Also set specific settings in settings.h */
|
||||||
|
|
||||||
// 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
|
|
||||||
|
|
||||||
/** Return 1 (0) if given key is pressed (not pressed). */
|
/** Return 1 (0) if given key is pressed (not pressed). */
|
||||||
int8_t SFG_keyPressed(uint8_t key);
|
int8_t SFG_keyPressed(uint8_t key);
|
||||||
|
@ -73,7 +70,7 @@ struct
|
||||||
const uint8_t* textures[7];
|
const uint8_t* textures[7];
|
||||||
} SFG_currentLevel;
|
} SFG_currentLevel;
|
||||||
|
|
||||||
void SFG_setLevel(SFG_Level *level)
|
void SFG_setLevel(const SFG_Level *level)
|
||||||
{
|
{
|
||||||
SFG_currentLevel.levelPointer = level;
|
SFG_currentLevel.levelPointer = level;
|
||||||
SFG_currentLevel.mapPointer = &(level->map);
|
SFG_currentLevel.mapPointer = &(level->map);
|
||||||
|
|
|
@ -8,11 +8,6 @@
|
||||||
|
|
||||||
#include "palette.h"
|
#include "palette.h"
|
||||||
|
|
||||||
#define SFG_RESOLUTION_X 800
|
|
||||||
#define SFG_RESOLUTION_Y 600
|
|
||||||
|
|
||||||
#define SFG_FPS 60
|
|
||||||
|
|
||||||
const uint8_t *sdlKeyboardState;
|
const uint8_t *sdlKeyboardState;
|
||||||
|
|
||||||
uint16_t screen[SFG_RESOLUTION_X * SFG_RESOLUTION_Y]; // RGB565 format
|
uint16_t screen[SFG_RESOLUTION_X * SFG_RESOLUTION_Y]; // RGB565 format
|
||||||
|
|
|
@ -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
|
Loading…
Reference in New Issue