Use different .cfg files depending on GUI API used

SDL1 => gfx2.cfg
SDL2 => gfx2-sdl2.cfg
Win32 => gfx2-win32.cfg
X11 => gfx2-x11.cfg

defaults to gfx2.cfg
This commit is contained in:
Thomas Bernard 2018-09-16 19:53:39 +02:00
parent b4005cbcb3
commit 5370670b10
No known key found for this signature in database
GPG Key ID: 0FF11B67A5C0863C
2 changed files with 11 additions and 2 deletions

View File

@ -2136,8 +2136,9 @@ int Load_CFG(int reload_all)
T_Config_video_mode cfg_video_mode;
int key_conversion = 0;
strcpy(filename,Config_directory);
strcat(filename,"gfx2.cfg");
snprintf(filename, sizeof(filename), "%s%s", Config_directory, CONFIG_FILENAME);
GFX2_Log(GFX2_DEBUG, "Load_CFG() trying to load %s\n", filename);
file_size=File_length(filename);

View File

@ -89,6 +89,14 @@ void Set_config_directory(const char * program_dir, char * config_dir);
/// Name of the binary file containing some configuration settings.
#if defined (__MINT__)
#define CONFIG_FILENAME "GFX2.CFG"
#elif defined(USE_SDL)
#define CONFIG_FILENAME "gfx2.cfg"
#elif defined(USE_SDL2)
#define CONFIG_FILENAME "gfx2-sdl2.cfg"
#elif defined(USE_X11)
#define CONFIG_FILENAME "gfx2-x11.cfg"
#elif defined(WIN32)
#define CONFIG_FILENAME "gfx2-win32.cfg"
#else
#define CONFIG_FILENAME "gfx2.cfg"
#endif