1 // ============================================================================
2 // Rocks'n'Diamonds - McDuffin Strikes Back!
3 // ----------------------------------------------------------------------------
4 // (c) 1995-2014 by Artsoft Entertainment
7 // https://www.artsoft.org/
8 // ----------------------------------------------------------------------------
10 // ============================================================================
12 #include "libgame/libgame.h"
19 char *getSourceDateString(void)
21 return SOURCE_DATE_STRING;
24 char *getSourceHashString(void)
26 return SOURCE_HASH_STRING;
29 char *getProgramTitleString(void)
31 return program.program_title;
34 char *getProgramRealVersionString(void)
36 static char program_version_string[32];
38 sprintf(program_version_string, "%d.%d.%d.%d%s",
39 PROGRAM_VERSION_SUPER, PROGRAM_VERSION_MAJOR, PROGRAM_VERSION_MINOR,
40 PROGRAM_VERSION_PATCH, PROGRAM_VERSION_EXTRA);
42 return program_version_string;
45 char *getProgramVersionString(void)
47 return program.version_string;
50 char *getProgramPlatformString(void)
52 return PLATFORM_STRING;
55 char *getProgramInitString(void)
57 static char *program_init_string = NULL;
59 if (program_init_string == NULL)
61 program_init_string = checked_malloc(strlen(getProgramTitleString()) + 1 +
62 strlen(getProgramVersionString()) + 1);
64 sprintf(program_init_string, "%s %s",
65 getProgramTitleString(), getProgramVersionString());
68 return program_init_string;
71 char *getConfigProgramTitleString(void)
73 TreeInfo *graphics_current =
74 getArtworkTreeInfoForUserLevelSet(ARTWORK_TYPE_GRAPHICS);
76 return (leveldir_current->program_title ?
77 leveldir_current->program_title :
78 graphics_current->program_title ?
79 graphics_current->program_title :
80 setup.internal.program_title);
83 char *getConfigProgramCopyrightString(void)
85 TreeInfo *graphics_current =
86 getArtworkTreeInfoForUserLevelSet(ARTWORK_TYPE_GRAPHICS);
88 return (leveldir_current->program_copyright ?
89 leveldir_current->program_copyright :
90 graphics_current->program_copyright ?
91 graphics_current->program_copyright :
92 setup.internal.program_copyright);
95 char *getConfigProgramCompanyString(void)
97 TreeInfo *graphics_current =
98 getArtworkTreeInfoForUserLevelSet(ARTWORK_TYPE_GRAPHICS);
100 return (leveldir_current->program_company ?
101 leveldir_current->program_company :
102 graphics_current->program_company ?
103 graphics_current->program_company :
104 setup.internal.program_company);
107 char *getWindowTitleString(void)
109 static char *window_title_string = NULL;
111 checked_free(window_title_string);
114 window_title_string = checked_malloc(strlen(getProgramInitString()) + 20 +
115 strlen(getSourceDateString()) + 2 + 1);
117 if (setup.internal.show_scaling_in_title)
118 sprintf(window_title_string, "%s (%d %%) [%s]",
119 getProgramInitString(), video.window_scaling_percent,
120 getSourceDateString());
122 sprintf(window_title_string, "%s [%s]",
123 getProgramInitString(),
124 getSourceDateString());
126 window_title_string = checked_malloc(strlen(getProgramInitString()) + 20);
128 if (setup.internal.show_scaling_in_title)
129 sprintf(window_title_string, "%s (%d %%)",
130 getProgramInitString(), video.window_scaling_percent);
132 sprintf(window_title_string, "%s",
133 getProgramInitString());
136 return window_title_string;