DrawBuffer *drawto_field;
int game_status = -1;
+boolean game_status_last_screen = -1;
boolean level_editor_test_game = FALSE;
boolean network_playing = FALSE;
int SXSIZE = SXSIZE_DEFAULT;
int SYSIZE = SYSIZE_DEFAULT;
+int FADE_SX = 6, FADE_SY = 6;
+int FADE_SXSIZE = 2 + SXSIZE_DEFAULT + 2;
+int FADE_SYSIZE = 2 + SXSIZE_DEFAULT + 2;
+
int DXSIZE = 100;
int DYSIZE = 280;
int VXSIZE = 100;
struct TitleFadingInfo fading;
struct TitleFadingInfo title_initial_default;
struct TitleFadingInfo title_default;
+struct TitleMessageInfo titlescreen_initial_default;
+struct TitleMessageInfo titlescreen_initial_first[MAX_NUM_TITLE_IMAGES];
+struct TitleMessageInfo titlescreen_initial[MAX_NUM_TITLE_IMAGES];
+struct TitleMessageInfo titlescreen_default;
+struct TitleMessageInfo titlescreen_first[MAX_NUM_TITLE_IMAGES];
+struct TitleMessageInfo titlescreen[MAX_NUM_TITLE_IMAGES];
struct TitleMessageInfo titlemessage_initial_default;
+struct TitleMessageInfo titlemessage_initial_first[MAX_NUM_TITLE_MESSAGES];
struct TitleMessageInfo titlemessage_initial[MAX_NUM_TITLE_MESSAGES];
struct TitleMessageInfo titlemessage_default;
+struct TitleMessageInfo titlemessage_first[MAX_NUM_TITLE_MESSAGES];
struct TitleMessageInfo titlemessage[MAX_NUM_TITLE_MESSAGES];
struct TitleMessageInfo readme;
struct InitInfo init, init_last;
{ ".page[30]", ACTION_PAGE_30, FALSE },
{ ".page[31]", ACTION_PAGE_31, FALSE },
{ ".page[32]", ACTION_PAGE_32, FALSE },
+ { ".part_1", ACTION_PART_1, FALSE },
+ { ".part_2", ACTION_PART_2, FALSE },
+ { ".part_3", ACTION_PART_3, FALSE },
+ { ".part_4", ACTION_PART_4, FALSE },
+ { ".part_5", ACTION_PART_5, FALSE },
+ { ".part_6", ACTION_PART_6, FALSE },
+ { ".part_7", ACTION_PART_7, FALSE },
+ { ".part_8", ACTION_PART_8, FALSE },
{ ".other", ACTION_OTHER, FALSE },
/* empty suffix always matches -- check as last entry in InitSoundInfo() */
{ ".PANEL", GFX_SPECIAL_ARG_PANEL, },
{ ".PREVIEW", GFX_SPECIAL_ARG_PREVIEW, },
{ ".CRUMBLED", GFX_SPECIAL_ARG_CRUMBLED, },
+ { ".TYPENAME", GFX_SPECIAL_ARG_TYPENAME, },
+ { ".SUBMENU", GFX_SPECIAL_ARG_SUBMENU, },
+ { ".MENU", GFX_SPECIAL_ARG_MENU, },
+ { ".TOONS", GFX_SPECIAL_ARG_TOONS, },
+ { ".FADING", GFX_SPECIAL_ARG_FADING, },
+ { ".QUIT", GFX_SPECIAL_ARG_QUIT, },
/* empty suffix always matches -- check as last entry in InitMusicInfo() */
{ "", GFX_SPECIAL_ARG_DEFAULT, },
{ NULL }
};
+struct GlobalAnimInfo global_anim_info[NUM_GLOBAL_ANIM_TOKENS + 1] =
+{
+ /* (real) graphic definitions used to define animation graphics */
+ { "global.anim_1.gfx", },
+ { "global.anim_2.gfx", },
+ { "global.anim_3.gfx", },
+ { "global.anim_4.gfx", },
+ { "global.anim_5.gfx", },
+ { "global.anim_6.gfx", },
+ { "global.anim_7.gfx", },
+ { "global.anim_8.gfx", },
+
+ /* (dummy) graphic definitions used to define animation controls */
+ { "global.anim_1", },
+ { "global.anim_2", },
+ { "global.anim_3", },
+ { "global.anim_4", },
+ { "global.anim_5", },
+ { "global.anim_6", },
+ { "global.anim_7", },
+ { "global.anim_8", },
+
+ { NULL }
+};
+
/* ------------------------------------------------------------------------- */
/* music token prefix definitions */
" \"print helptext.conf\" print default helptext config\n"
" \"dump level FILE\" dump level data from FILE\n"
" \"dump tape FILE\" dump tape data from FILE\n"
+ " \"autotest LEVELDIR [NR ...]\" test level tapes for LEVELDIR\n"
" \"autoplay LEVELDIR [NR ...]\" play level tapes for LEVELDIR\n"
+ " \"autoffwd LEVELDIR [NR ...]\" ffwd level tapes for LEVELDIR\n"
" \"convert LEVELDIR [NR]\" convert levels in LEVELDIR\n"
" \"create images DIRECTORY\" write BMP images to DIRECTORY\n"
" \"create CE image DIRECTORY\" write BMP image to DIRECTORY\n"
static void InitProgramConfig(char *command_filename)
{
- 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 *config_filename = getProgramConfigFilename(command_filename);
+ char *userdata_basename = getBaseNameNoSuffix(command_filename);
char *userdata_subdir;
char *userdata_subdir_unix;
// read default program config, if existing
if (fileExists(config_filename))
+ {
+ // if program config file exists, derive Unix user data directory from it
+ userdata_basename = getBaseName(config_filename);
+
+ if (strSuffix(userdata_basename, ".conf"))
+ userdata_basename[strlen(userdata_basename) - 5] = '\0';
+
LoadSetupFromFilename(config_filename);
+ }
+
+ // set user data directory for Linux/Unix (but not Mac OS X)
+ userdata_subdir_unix = getStringCat2(".", userdata_basename);
// set program title from potentially redefined program title
if (setup.internal.program_title != 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 = getStringCat2(".", command_basename);
-
#if defined(PLATFORM_WIN32) || defined(PLATFORM_MACOSX)
userdata_subdir = program_title;
#elif defined(PLATFORM_UNIX)
userdata_subdir = USERDATA_DIRECTORY_OTHER;
#endif
+ // set default window size (only relevant on program startup)
+ if (setup.internal.default_window_width != 0 &&
+ setup.internal.default_window_height != 0)
+ {
+ WIN_XSIZE = setup.internal.default_window_width;
+ WIN_YSIZE = setup.internal.default_window_height;
+ }
+
InitProgramInfo(command_filename,
config_filename,
userdata_subdir,
- userdata_subdir_unix,
program_title,
program_title,
program_icon_file,
InitExitFunction(CloseAllAndExit);
InitPlatformDependentStuff();
- GetOptions(argv, print_usage, print_version);
+ GetOptions(argc, argv, print_usage, print_version);
OpenAll();
EventLoop();