1 // ============================================================================
2 // Rocks'n'Diamonds - McDuffin Strikes Back!
3 // ----------------------------------------------------------------------------
4 // (c) 1995-2014 by Artsoft Entertainment
7 // http://www.artsoft.org/
8 // ----------------------------------------------------------------------------
10 // ============================================================================
12 #include "libgame/libgame.h"
18 char *getSourceDateString()
20 return SOURCE_DATE_STRING;
23 char *getProgramTitleString()
25 return program.program_title;
28 char *getProgramRealVersionString()
30 static char program_version_string[32];
32 sprintf(program_version_string, "%d.%d.%d.%d%s",
33 PROGRAM_VERSION_SUPER, PROGRAM_VERSION_MAJOR, PROGRAM_VERSION_MINOR,
34 PROGRAM_VERSION_PATCH, PROGRAM_VERSION_EXTRA);
36 return program_version_string;
39 char *getProgramVersionString()
41 return program.version_string;
44 char *getProgramInitString()
46 static char *program_init_string = NULL;
48 if (program_init_string == NULL)
50 program_init_string = checked_malloc(strlen(getProgramTitleString()) + 1 +
51 strlen(getProgramVersionString()) + 1);
53 sprintf(program_init_string, "%s %s",
54 getProgramTitleString(), getProgramVersionString());
57 return program_init_string;
60 char *getConfigProgramTitleString()
62 TreeInfo *graphics_current =
63 getArtworkTreeInfoForUserLevelSet(ARTWORK_TYPE_GRAPHICS);
65 return (leveldir_current->program_title ?
66 leveldir_current->program_title :
67 graphics_current->program_title ?
68 graphics_current->program_title :
69 setup.internal.program_title);
72 char *getConfigProgramCopyrightString()
74 TreeInfo *graphics_current =
75 getArtworkTreeInfoForUserLevelSet(ARTWORK_TYPE_GRAPHICS);
77 return (leveldir_current->program_copyright ?
78 leveldir_current->program_copyright :
79 graphics_current->program_copyright ?
80 graphics_current->program_copyright :
81 setup.internal.program_copyright);
84 char *getConfigProgramCompanyString()
86 TreeInfo *graphics_current =
87 getArtworkTreeInfoForUserLevelSet(ARTWORK_TYPE_GRAPHICS);
89 return (leveldir_current->program_company ?
90 leveldir_current->program_company :
91 graphics_current->program_company ?
92 graphics_current->program_company :
93 setup.internal.program_company);
96 char *getWindowTitleString()
98 static char *window_title_string = NULL;
100 checked_free(window_title_string);
102 #if defined(TARGET_SDL2)
105 window_title_string = checked_malloc(strlen(getProgramInitString()) + 20 +
106 strlen(getSourceDateString()) + 2 + 1);
108 if (setup.internal.show_scaling_in_title)
109 sprintf(window_title_string, "%s (%d %%) [%s]",
110 getProgramInitString(), video.window_scaling_percent,
111 getSourceDateString());
113 sprintf(window_title_string, "%s [%s]",
114 getProgramInitString(),
115 getSourceDateString());
117 window_title_string = checked_malloc(strlen(getProgramInitString()) + 20);
119 if (setup.internal.show_scaling_in_title)
120 sprintf(window_title_string, "%s (%d %%)",
121 getProgramInitString(), video.window_scaling_percent);
123 sprintf(window_title_string, "%s",
124 getProgramInitString());
130 window_title_string = checked_malloc(strlen(getProgramInitString()) + 1 +
131 strlen(getSourceDateString()) + 2 + 1);
133 sprintf(window_title_string, "%s [%s]",
134 getProgramInitString(), getSourceDateString());
136 window_title_string = checked_malloc(strlen(getProgramInitString()) + 1);
138 sprintf(window_title_string, "%s",
139 getProgramInitString());
144 return window_title_string;