New filename (without version string) for the new save files

This commit was merged in pull request #275.
This commit is contained in:
ahnada
2024-01-31 21:40:22 +01:00
committed by icex2
parent d1525a98dd
commit 1379c1e11b
2 changed files with 15 additions and 5 deletions
+12 -2
View File
@@ -25,10 +25,20 @@ static volatile long input_init_count;
static FILE *mapper_config_open(const char *game_type, const char *mode)
{
char path[MAX_PATH];
FILE *f;
str_format(path, sizeof(path), "%s_v5_00a07.bin", game_type);
str_format(path, sizeof(path), "%s.bin", game_type);
f = fopen_appdata("DJHACKERS", path, mode);
return fopen_appdata("DJHACKERS", path, mode);
// Try to load the old save file only if we're loading
if (f == NULL) {
if (strchr(mode, 'r') != NULL) {
str_format(path, sizeof(path), "%s_v5_00a07.bin", game_type);
f = fopen_appdata("DJHACKERS", path, mode);
}
}
return f;
}
void input_set_loggers(
+3 -3
View File
@@ -7,7 +7,7 @@
#include "util/mem.h"
enum mapper_config_version {
MAPPER_VERSION_BEFORE_VERSIONING,
MAPPER_VERSION_BEFORE_VERSIONING = 0,
MAPPER_VERSION_INVERT_AXIS,
// --- Add new versions above this line --- //
@@ -32,7 +32,7 @@ static void mapper_impl_config_save_lights(struct mapper *m, FILE *f);
struct mapper *mapper_impl_config_load(FILE *f)
{
struct mapper *m;
uint32_t version = 0;
uint32_t version = MAPPER_VERSION_BEFORE_VERSIONING;
hid_mgr_lock(); /* Need to convert from HID objects to /dev nodes */
@@ -55,7 +55,7 @@ struct mapper *mapper_impl_config_load(FILE *f)
static uint32_t mapper_impl_config_load_version(FILE *f)
{
uint32_t fourcc = 0;
uint32_t version = 0;
uint32_t version = MAPPER_VERSION_BEFORE_VERSIONING;
if (!read_u32(f, &fourcc)) {
return 0;