removed unused code
[rocksndiamonds.git] / src / config.c
1 // ============================================================================
2 // Rocks'n'Diamonds - McDuffin Strikes Back!
3 // ----------------------------------------------------------------------------
4 // (c) 1995-2014 by Artsoft Entertainment
5 //                  Holger Schemel
6 //                  info@artsoft.org
7 //                  http://www.artsoft.org/
8 // ----------------------------------------------------------------------------
9 // config.c
10 // ============================================================================
11
12 #include "libgame/libgame.h"
13
14 #include "config.h"
15 #include "conftime.h"
16
17
18 char *getSourceDateString(void)
19 {
20   return SOURCE_DATE_STRING;
21 }
22
23 char *getProgramTitleString(void)
24 {
25   return program.program_title;
26 }
27
28 char *getProgramRealVersionString(void)
29 {
30   static char program_version_string[32];
31
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);
35
36   return program_version_string;
37 }
38
39 char *getProgramVersionString(void)
40 {
41   return program.version_string;
42 }
43
44 char *getProgramInitString(void)
45 {
46   static char *program_init_string = NULL;
47
48   if (program_init_string == NULL)
49   {
50     program_init_string = checked_malloc(strlen(getProgramTitleString()) + 1 +
51                                          strlen(getProgramVersionString()) + 1);
52
53     sprintf(program_init_string, "%s %s",
54             getProgramTitleString(), getProgramVersionString());
55   }
56
57   return program_init_string;
58 }
59
60 char *getConfigProgramTitleString(void)
61 {
62   TreeInfo *graphics_current =
63     getArtworkTreeInfoForUserLevelSet(ARTWORK_TYPE_GRAPHICS);
64
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);
70 }
71
72 char *getConfigProgramCopyrightString(void)
73 {
74   TreeInfo *graphics_current =
75     getArtworkTreeInfoForUserLevelSet(ARTWORK_TYPE_GRAPHICS);
76
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);
82 }
83
84 char *getConfigProgramCompanyString(void)
85 {
86   TreeInfo *graphics_current =
87     getArtworkTreeInfoForUserLevelSet(ARTWORK_TYPE_GRAPHICS);
88
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);
94 }
95
96 char *getWindowTitleString(void)
97 {
98   static char *window_title_string = NULL;
99
100   checked_free(window_title_string);
101
102 #ifdef DEBUG
103   window_title_string = checked_malloc(strlen(getProgramInitString()) + 20 +
104                                        strlen(getSourceDateString()) + 2 + 1);
105
106   if (setup.internal.show_scaling_in_title)
107     sprintf(window_title_string, "%s (%d %%) [%s]",
108             getProgramInitString(), video.window_scaling_percent,
109             getSourceDateString());
110   else
111     sprintf(window_title_string, "%s [%s]",
112             getProgramInitString(),
113             getSourceDateString());
114 #else
115   window_title_string = checked_malloc(strlen(getProgramInitString()) + 20);
116
117   if (setup.internal.show_scaling_in_title)
118     sprintf(window_title_string, "%s (%d %%)",
119             getProgramInitString(), video.window_scaling_percent);
120   else
121     sprintf(window_title_string, "%s",
122             getProgramInitString());
123 #endif
124
125   return window_title_string;
126 }