mirror of
https://gitlab.com/drummyfish/anarch.git
synced 2024-12-26 01:09:20 -05:00
Add save file path setting
This commit is contained in:
parent
6abe7d7b0b
commit
eaeafc6368
@ -157,7 +157,7 @@ void SFG_processEvent(uint8_t event, uint8_t data)
|
||||
|
||||
void SFG_save(uint8_t data[SFG_SAVE_SIZE])
|
||||
{
|
||||
FILE *f = fopen("anarch.sav","wb");
|
||||
FILE *f = fopen(SFG_SAVE_FILE_PATH,"wb");
|
||||
|
||||
if (f == NULL)
|
||||
return;
|
||||
@ -169,7 +169,7 @@ void SFG_save(uint8_t data[SFG_SAVE_SIZE])
|
||||
|
||||
uint8_t SFG_load(uint8_t data[SFG_SAVE_SIZE])
|
||||
{
|
||||
FILE *f = fopen("anarch.sav","rb");
|
||||
FILE *f = fopen(SFG_SAVE_FILE_PATH,"rb");
|
||||
|
||||
if (f != NULL)
|
||||
{
|
||||
|
@ -127,7 +127,7 @@ uint32_t SFG_getTimeMs()
|
||||
|
||||
void SFG_save(uint8_t data[SFG_SAVE_SIZE])
|
||||
{
|
||||
FILE *f = fopen("anarch.sav","wb");
|
||||
FILE *f = fopen(SFG_SAVE_FILE_PATH,"wb");
|
||||
|
||||
puts("SDL: opening and writing save file");
|
||||
|
||||
@ -145,7 +145,7 @@ void SFG_save(uint8_t data[SFG_SAVE_SIZE])
|
||||
uint8_t SFG_load(uint8_t data[SFG_SAVE_SIZE])
|
||||
{
|
||||
#ifndef __EMSCRIPTEN__
|
||||
FILE *f = fopen("anarch.sav","rb");
|
||||
FILE *f = fopen(SFG_SAVE_FILE_PATH,"rb");
|
||||
|
||||
puts("SDL: opening and reading save file");
|
||||
|
||||
|
@ -19,6 +19,14 @@
|
||||
#ifndef _SFG_SETTINGS_H
|
||||
#define _SFG_SETTINGS_H
|
||||
|
||||
/**
|
||||
Path to the save file. You may want to set this to some absolute path,
|
||||
depending on your system.
|
||||
*/
|
||||
#ifndef SFG_SAVE_FILE_PATH
|
||||
#define SFG_SAVE_FILE_PATH "anarch.sav"
|
||||
#endif
|
||||
|
||||
/**
|
||||
Time multiplier in SFG_Units (1.0 == 1024). This can be used to slow down or
|
||||
speed up the game. Note that this also changes the rendering FPS accordingly
|
||||
|
Loading…
Reference in New Issue
Block a user