return program.program_title;
}
-char *getProgramVersionString()
+char *getProgramRealVersionString()
{
static char program_version_string[32];
return program_version_string;
}
+char *getProgramVersionString()
+{
+ return program.version_string;
+}
+
char *getProgramInitString()
{
static char *program_init_string = NULL;
char *getSourceDateString(void);
char *getProgramTitleString(void);
+char *getProgramRealVersionString(void);
char *getProgramVersionString(void);
char *getProgramInitString(void);
char *getWindowTitleString(void);
#include "init.h"
#include "tools.h"
#include "tape.h"
+#include "config.h"
#define ENABLE_UNUSED_CODE 0 /* currently unused functions */
#define ENABLE_HISTORIC_CHUNKS 0 /* only for historic reference */
/* internal setup */
#define SETUP_TOKEN_INT_PROGRAM_TITLE 0
-#define SETUP_TOKEN_INT_PROGRAM_AUTHOR 1
-#define SETUP_TOKEN_INT_PROGRAM_EMAIL 2
-#define SETUP_TOKEN_INT_PROGRAM_WEBSITE 3
-#define SETUP_TOKEN_INT_PROGRAM_COPYRIGHT 4
-#define SETUP_TOKEN_INT_PROGRAM_COMPANY 5
-#define SETUP_TOKEN_INT_PROGRAM_ICON_FILE 6
-#define SETUP_TOKEN_INT_DEFAULT_GRAPHICS_SET 7
-#define SETUP_TOKEN_INT_DEFAULT_SOUNDS_SET 8
-#define SETUP_TOKEN_INT_DEFAULT_MUSIC_SET 9
-#define SETUP_TOKEN_INT_FALLBACK_GRAPHICS_FILE 10
-#define SETUP_TOKEN_INT_FALLBACK_SOUNDS_FILE 11
-#define SETUP_TOKEN_INT_FALLBACK_MUSIC_FILE 12
-#define SETUP_TOKEN_INT_DEFAULT_LEVEL_SERIES 13
-#define SETUP_TOKEN_INT_CHOOSE_FROM_TOP_LEVELDIR 14
-#define SETUP_TOKEN_INT_DEFAULT_WINDOW_WIDTH 15
-#define SETUP_TOKEN_INT_DEFAULT_WINDOW_HEIGHT 16
-
-#define NUM_INTERNAL_SETUP_TOKENS 17
+#define SETUP_TOKEN_INT_PROGRAM_VERSION 1
+#define SETUP_TOKEN_INT_PROGRAM_AUTHOR 2
+#define SETUP_TOKEN_INT_PROGRAM_EMAIL 3
+#define SETUP_TOKEN_INT_PROGRAM_WEBSITE 4
+#define SETUP_TOKEN_INT_PROGRAM_COPYRIGHT 5
+#define SETUP_TOKEN_INT_PROGRAM_COMPANY 6
+#define SETUP_TOKEN_INT_PROGRAM_ICON_FILE 7
+#define SETUP_TOKEN_INT_DEFAULT_GRAPHICS_SET 8
+#define SETUP_TOKEN_INT_DEFAULT_SOUNDS_SET 9
+#define SETUP_TOKEN_INT_DEFAULT_MUSIC_SET 10
+#define SETUP_TOKEN_INT_FALLBACK_GRAPHICS_FILE 11
+#define SETUP_TOKEN_INT_FALLBACK_SOUNDS_FILE 12
+#define SETUP_TOKEN_INT_FALLBACK_MUSIC_FILE 13
+#define SETUP_TOKEN_INT_DEFAULT_LEVEL_SERIES 14
+#define SETUP_TOKEN_INT_CHOOSE_FROM_TOP_LEVELDIR 15
+#define SETUP_TOKEN_INT_DEFAULT_WINDOW_WIDTH 16
+#define SETUP_TOKEN_INT_DEFAULT_WINDOW_HEIGHT 17
+
+#define NUM_INTERNAL_SETUP_TOKENS 18
/* debug setup */
#define SETUP_TOKEN_DEBUG_FRAME_DELAY_0 0
static struct TokenInfo internal_setup_tokens[] =
{
{ TYPE_STRING, &sxi.program_title, "program_title" },
+ { TYPE_STRING, &sxi.program_version, "program_version" },
{ TYPE_STRING, &sxi.program_author, "program_author" },
{ TYPE_STRING, &sxi.program_email, "program_email" },
{ TYPE_STRING, &sxi.program_website, "program_website" },
si->system.audio_fragment_size = DEFAULT_AUDIO_FRAGMENT_SIZE;
si->internal.program_title = getStringCopy(PROGRAM_TITLE_STRING);
+ si->internal.program_version = getStringCopy(getProgramRealVersionString());
si->internal.program_author = getStringCopy(PROGRAM_AUTHOR_STRING);
si->internal.program_email = getStringCopy(PROGRAM_EMAIL_STRING);
si->internal.program_website = getStringCopy(PROGRAM_WEBSITE_STRING);
void InitProgramInfo(char *argv0, char *config_filename, char *userdata_subdir,
char *program_title, char *icon_title,
char *icon_filename, char *cookie_prefix,
- int program_version)
+ char *program_version_string, int program_version)
{
program.command_basepath = getBasePath(argv0);
program.command_basename = getBaseName(argv0);
program.version_build = VERSION_BUILD(program_version);
program.version_ident = program_version;
+ program.version_string = program_version_string;
+
program.log_filename[LOG_OUT_ID] = getLogFilename(LOG_OUT_BASENAME);
program.log_filename[LOG_ERR_ID] = getLogFilename(LOG_ERR_BASENAME);
program.log_file[LOG_OUT_ID] = program.log_file_default[LOG_OUT_ID] = stdout;
int version_build;
int version_ident;
+ char *version_string;
+
char *(*window_title_function)(void);
void (*exit_message_function)(char *, va_list);
void (*exit_function)(int);
struct SetupInternalInfo
{
char *program_title;
+ char *program_version;
char *program_author;
char *program_email;
char *program_website;
/* function definitions */
void InitProgramInfo(char *, char *, char *, char *, char *, char *, char *,
- int);
+ char *, int);
void InitScoresInfo();
void SetWindowTitle();
static void print_version()
{
- Print("%s %d.%d.%d.%d%s\n",
- PROGRAM_TITLE_STRING,
- PROGRAM_VERSION_MAJOR,
- PROGRAM_VERSION_MINOR,
- PROGRAM_VERSION_PATCH,
- PROGRAM_VERSION_BUILD,
- PROGRAM_VERSION_EXTRA);
+ Print("%s", getProgramInitString());
+
+ if (!strEqual(getProgramVersionString(), getProgramRealVersionString()))
+ {
+ Print(" (%s %d.%d.%d.%d%s)",
+ PROGRAM_TITLE_STRING,
+ PROGRAM_VERSION_MAJOR,
+ PROGRAM_VERSION_MINOR,
+ PROGRAM_VERSION_PATCH,
+ PROGRAM_VERSION_BUILD,
+ PROGRAM_VERSION_EXTRA);
+ }
+
+ Print("\n");
if (options.debug)
{
{
char *program_title = PROGRAM_TITLE_STRING;
char *program_icon_file = PROGRAM_ICON_FILENAME;
+ char *program_version = getProgramRealVersionString();
char *config_filename = getProgramConfigFilename(command_filename);
char *userdata_basename = getBaseNameNoSuffix(command_filename);
char *userdata_subdir;
strlen(setup.internal.program_title) > 0)
program_title = getStringCopy(setup.internal.program_title);
+ // set program version from potentially redefined program version
+ if (setup.internal.program_version != NULL &&
+ strlen(setup.internal.program_version) > 0)
+ program_version = getStringCopy(setup.internal.program_version);
+
// set program icon file from potentially redefined program icon file
if (setup.internal.program_icon_file != NULL &&
strlen(setup.internal.program_icon_file) > 0)
program_title,
program_icon_file,
COOKIE_PREFIX,
+ program_version,
GAME_VERSION_ACTUAL);
}
DrawTextF(xstart1, ystart2, font_header, "Version");
DrawTextF(xstart2, ystart2, font_text, getProgramVersionString());
+ if (!strEqual(getProgramVersionString(), getProgramRealVersionString()))
+ {
+ ystart2 += ystep;
+ DrawTextF(xstart1, ystart2, font_header, "Version (real)");
+ DrawTextF(xstart2, ystart2, font_text, getProgramRealVersionString());
+ }
+
ystart2 += ystep;
DrawTextF(xstart1, ystart2, font_header, "Platform");
DrawTextF(xstart2, ystart2, font_text, PLATFORM_STRING);