added using extended game version
authorHolger Schemel <holger.schemel@virtion.de>
Wed, 27 Nov 2024 20:10:20 +0000 (21:10 +0100)
committerHolger Schemel <holger.schemel@virtion.de>
Wed, 27 Nov 2024 18:11:04 +0000 (19:11 +0100)
src/config.c
src/main.h

index 0639062e127fdac10bac7b1dc5023cd1efafe4c3..be3a6271f0597ba3fa3ecdf5d4157309a699dca2 100644 (file)
@@ -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)
index 0819dd51743707ed98123412a9336658c7b8fd4c..f5b99d4a78ad234ffc2a55f4ecd4f557c0fb7fe3 100644 (file)
@@ -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