+2015-04-15
+ * added option "program_icon_file" to run-time "special edition" support
+
2015-04-14
* added run-time "special edition" support;
this change is especially targeted to the "R'n'D jue" special edition
#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_DEFAULT_GRAPHICS_SET 6
-#define SETUP_TOKEN_INT_DEFAULT_SOUNDS_SET 7
-#define SETUP_TOKEN_INT_DEFAULT_MUSIC_SET 8
-#define SETUP_TOKEN_INT_FALLBACK_GRAPHICS_FILE 9
-#define SETUP_TOKEN_INT_FALLBACK_SOUNDS_FILE 10
-#define SETUP_TOKEN_INT_FALLBACK_MUSIC_FILE 11
-#define SETUP_TOKEN_INT_DEFAULT_LEVEL_SERIES 12
-#define SETUP_TOKEN_INT_CHOOSE_FROM_TOP_LEVELDIR 13
-
-#define NUM_INTERNAL_SETUP_TOKENS 14
+#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 NUM_INTERNAL_SETUP_TOKENS 15
/* options setup */
#define SETUP_TOKEN_OPTIONS_VERBOSE 0
{ TYPE_STRING, &sxi.program_website, "program_website" },
{ TYPE_STRING, &sxi.program_copyright, "program_copyright" },
{ TYPE_STRING, &sxi.program_company, "program_company" },
+ { TYPE_STRING, &sxi.program_icon_file, "program_icon_file" },
{ TYPE_STRING, &sxi.default_graphics_set, "default_graphics_set" },
{ TYPE_STRING, &sxi.default_sounds_set, "default_sounds_set" },
{ TYPE_STRING, &sxi.default_music_set, "default_music_set" },
si->internal.program_copyright = getStringCopy(PROGRAM_COPYRIGHT_STRING);
si->internal.program_company = getStringCopy(PROGRAM_COMPANY_STRING);
+ si->internal.program_icon_file = getStringCopy(PROGRAM_ICON_FILENAME);
+
si->internal.default_graphics_set = getStringCopy(GFX_CLASSIC_SUBDIR);
si->internal.default_sounds_set = getStringCopy(SND_CLASSIC_SUBDIR);
si->internal.default_music_set = getStringCopy(MUS_CLASSIC_SUBDIR);
/* !!! SDL2 can only set the window icon if the window already exists !!! */
/* set window icon */
- SDLSetWindowIcon(program.sdl_icon_filename);
+ SDLSetWindowIcon(program.icon_filename);
/* set window and icon title */
#if defined(TARGET_SDL2)
void InitProgramInfo(char *argv0, char *config_filename,
char *userdata_subdir, char *userdata_subdir_unix,
char *program_title, char *icon_title,
- char *sdl_icon_filename, char *cookie_prefix,
+ char *icon_filename, char *cookie_prefix,
int program_version)
{
program.command_basepath = getBasePath(argv0);
program.window_title = "(undefined)";
program.icon_title = icon_title;
- program.sdl_icon_filename = sdl_icon_filename;
+ program.icon_filename = icon_filename;
program.cookie_prefix = cookie_prefix;
char *window_title;
char *icon_title;
- char *sdl_icon_filename;
+ char *icon_filename;
char *cookie_prefix;
char *program_copyright;
char *program_company;
+ char *program_icon_file;
+
char *default_graphics_set;
char *default_sounds_set;
char *default_music_set;
char *command_basename = getBaseName(command_filename);
char *config_filename = getProgramConfigFilename(command_filename);
char *program_title = PROGRAM_TITLE_STRING;
+ char *program_icon_file = PROGRAM_ICON_FILENAME;
char *userdata_subdir;
char *userdata_subdir_unix;
strlen(setup.internal.program_title) > 0)
program_title = getStringCopy(setup.internal.program_title);
+ // 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_icon_file = getStringCopy(setup.internal.program_icon_file);
+
// strip trailing executable suffix from command basename
if (strSuffix(command_basename, ".exe"))
command_basename[strlen(command_basename) - 4] = '\0';
userdata_subdir_unix,
program_title,
program_title,
- SDL_ICON_FILENAME,
+ program_icon_file,
COOKIE_PREFIX,
GAME_VERSION_ACTUAL);
}
#define PROGRAM_COPYRIGHT_STRING "Copyright \xa9""1995-2015 by Holger Schemel"
#define PROGRAM_COMPANY_STRING "A Game by Artsoft Entertainment"
+#define PROGRAM_ICON_FILENAME "RocksIcon32x32.png"
+
#define COOKIE_PREFIX "ROCKSNDIAMONDS"
#define USERDATA_DIRECTORY_OTHER "userdata"
-#define SDL_ICON_FILENAME "RocksIcon32x32.png"
-
/* file version numbers for resource files (levels, tapes, score, setup, etc.)
** currently supported/known file version numbers:
** 1.0 (old)