From: Holger Schemel Date: Wed, 27 Nov 2024 19:50:17 +0000 (+0100) Subject: moved function to different source file X-Git-Tag: 4.4.0.0-test-4~22 X-Git-Url: https://git.artsoft.org/?a=commitdiff_plain;h=7c76580355a11231a9cddf9c7ee29fafa2c7b974;p=rocksndiamonds.git moved function to different source file --- diff --git a/src/config.c b/src/config.c index 8a7a5c5b..049d7a89 100644 --- a/src/config.c +++ b/src/config.c @@ -31,6 +31,24 @@ char *getProgramTitleString(void) return program.program_title; } +char *getVersionString(VersionType version) +{ + // this function can be called up to ten times before version string gets overwritten + static char version_string_array[10][32]; + static int version_string_nr = 0; + char *version_string = version_string_array[version_string_nr]; + + version_string_nr = (version_string_nr + 1) % 10; + + sprintf(version_string, "%d.%d.%d.%d", + VERSION_PART_1(version), + VERSION_PART_2(version), + VERSION_PART_3(version), + VERSION_PART_4(version)); + + return version_string; +} + char *getProgramRealVersionString(void) { static char program_version_string[32]; diff --git a/src/config.h b/src/config.h index 31e86b87..714993a8 100644 --- a/src/config.h +++ b/src/config.h @@ -17,6 +17,7 @@ char *getSourceDateString(void); char *getSourceHashString(void); char *getProgramTitleString(void); +char *getVersionString(VersionType); char *getProgramRealVersionString(void); char *getProgramVersionString(void); char *getProgramPlatformString(void); diff --git a/src/events.c b/src/events.c index b6e4bc94..3117dc88 100644 --- a/src/events.c +++ b/src/events.c @@ -21,6 +21,7 @@ #include "tape.h" #include "anim.h" #include "network.h" +#include "config.h" #define DEBUG_EVENTS 0 diff --git a/src/libgame/system.c b/src/libgame/system.c index 7a18fcf6..ae76f6f0 100644 --- a/src/libgame/system.c +++ b/src/libgame/system.c @@ -1925,28 +1925,6 @@ void ClearJoystickState(void) } -// ============================================================================ -// version functions -// ============================================================================ - -char *getVersionString(VersionType version) -{ - // this function can be called up to ten times before version string gets overwritten - static char version_string_array[10][32]; - static int version_string_nr = 0; - char *version_string = version_string_array[version_string_nr]; - - version_string_nr = (version_string_nr + 1) % 10; - - sprintf(version_string, "%d.%d.%d.%d", - VERSION_PART_1(version), - VERSION_PART_2(version), - VERSION_PART_3(version), - VERSION_PART_4(version)); - - return version_string; -} - // ============================================================================ // Emscripten functions // ============================================================================ diff --git a/src/libgame/system.h b/src/libgame/system.h index 7b25e15e..1b9efd6e 100644 --- a/src/libgame/system.h +++ b/src/libgame/system.h @@ -2107,8 +2107,6 @@ boolean ReadJoystick(int, int *, int *, boolean *, boolean *); boolean CheckJoystickOpened(int); void ClearJoystickState(void); -char *getVersionString(VersionType); - void InitEmscriptenFilesystem(void); void SyncEmscriptenFilesystem(void);