From 24d92fc5ce06f96e75b6148b128916062c82e85f Mon Sep 17 00:00:00 2001 From: Holger Schemel Date: Wed, 27 Nov 2024 21:10:20 +0100 Subject: [PATCH] added using extended game version --- src/config.c | 18 +++++++++++------- src/main.h | 18 +++++++++++++----- 2 files changed, 24 insertions(+), 12 deletions(-) diff --git a/src/config.c b/src/config.c index 0639062e..be3a6271 100644 --- a/src/config.c +++ b/src/config.c @@ -46,18 +46,22 @@ char *getVersionString(VersionType version) VERSION_MINOR(version), VERSION_PATCH(version)); + if (!VERSION_STABLE(version)) + { + if (VERSION_EXTRA(version)) + sprintf(&version_string[strlen(version_string)], "-%s-%d", + PROGRAM_VERSION_EXTRA_TEXT, VERSION_EXTRA(version)); + else if (VERSION_BUILD(version)) + sprintf(&version_string[strlen(version_string)], "-%s-%d", + PROGRAM_VERSION_BUILD_TEXT, VERSION_BUILD(version)); + } + return version_string; } char *getProgramRealVersionString(void) { - static char program_version_string[32]; - - sprintf(program_version_string, "%d.%d.%d.%d%s", - PROGRAM_VERSION_SUPER, PROGRAM_VERSION_MAJOR, PROGRAM_VERSION_MINOR, - PROGRAM_VERSION_PATCH, PROGRAM_VERSION_EXTRA); - - return program_version_string; + return getVersionString(GAME_VERSION_ACTUAL); } char *getProgramVersionString(void) diff --git a/src/main.h b/src/main.h index 0819dd51..f5b99d4a 100644 --- a/src/main.h +++ b/src/main.h @@ -3130,7 +3130,12 @@ enum #define PROGRAM_VERSION_MAJOR 4 #define PROGRAM_VERSION_MINOR 0 #define PROGRAM_VERSION_PATCH 0 -#define PROGRAM_VERSION_EXTRA "-test-3" + +#define PROGRAM_VERSION_STABLE 0 +#define PROGRAM_VERSION_EXTRA 3 +#define PROGRAM_VERSION_BUILD 0 +#define PROGRAM_VERSION_EXTRA_TEXT "test" +#define PROGRAM_VERSION_BUILD_TEXT "build" #define PROGRAM_TITLE_STRING "Rocks'n'Diamonds" #define PROGRAM_AUTHOR_STRING "Holger Schemel" @@ -3169,10 +3174,13 @@ enum #define GAME_VERSION_2_0 FILE_VERSION_2_0 #define GAME_VERSION_3_0 FILE_VERSION_3_0 -#define GAME_VERSION_ACTUAL VERSION_IDENT(PROGRAM_VERSION_SUPER, \ - PROGRAM_VERSION_MAJOR, \ - PROGRAM_VERSION_MINOR, \ - PROGRAM_VERSION_PATCH) +#define GAME_VERSION_ACTUAL VERSION_IDENT_FULL(PROGRAM_VERSION_SUPER, \ + PROGRAM_VERSION_MAJOR, \ + PROGRAM_VERSION_MINOR, \ + PROGRAM_VERSION_PATCH, \ + PROGRAM_VERSION_STABLE, \ + PROGRAM_VERSION_EXTRA, \ + PROGRAM_VERSION_BUILD) // values for game_emulation #define EMU_NONE 0 -- 2.34.1