static int get_graphic_parameter_value(char *, char *, int);
-void DrawInitAnim()
+static void DrawInitAnim(void)
{
struct GraphicInfo *graphic_info_last = graphic_info;
int graphic = 0;
FrameCounter++;
}
-void FreeGadgets()
+static void DrawProgramInfo(void)
+{
+ int font1_nr = FC_YELLOW;
+ int font2_nr = FC_RED;
+ int font2_height = getFontHeight(font2_nr);
+ int ypos1 = 20;
+ int ypos2 = 50;
+ int ypos3 = WIN_YSIZE - 20 - font2_height;
+
+ DrawInitText(getProgramInitString(), ypos1, font1_nr);
+ DrawInitText(setup.internal.program_copyright, ypos2, font2_nr);
+ DrawInitText(setup.internal.program_website, ypos3, font2_nr);
+}
+
+static void FreeGadgets(void)
{
FreeLevelEditorGadgets();
FreeGameButtons();
FreeScreenGadgets();
}
-void InitGadgets()
+void InitGadgets(void)
{
static boolean gadgets_initialized = FALSE;
CreateImageWithSmallImages(graphic, g->scale_up_factor, g->tile_size);
}
-void InitElementSmallImages()
+static void InitElementSmallImages(void)
{
print_timestamp_init("InitElementSmallImages");
ScaleImage(graphic, g->scale_up_factor);
}
-void InitScaledImages()
+static void InitScaledImages(void)
{
struct PropertyMapping *property_mapping = getImageListPropertyMapping();
int num_property_mappings = getImageListPropertyMappingSize();
InitScaledImagesScaledUp(property_mapping[i].artwork_index);
}
-void InitBitmapPointers()
+static void InitBitmapPointers(void)
{
int num_images = getImageListSize();
int i;
graphic_info[i].bitmap = graphic_info[i].bitmaps[IMG_BITMAP_STANDARD];
}
-void InitImageTextures()
+void InitImageTextures(void)
{
int i, j, k;
return FONT_INITIAL_1;
}
-void InitFontGraphicInfo()
+static void InitFontGraphicInfo(void)
{
static struct FontBitmapInfo *font_bitmap_info = NULL;
struct PropertyMapping *property_mapping = getImageListPropertyMapping();
getFontBitmapID, getFontFromToken);
}
-void InitGlobalAnimGraphicInfo()
+static void InitGlobalAnimGraphicInfo(void)
{
struct PropertyMapping *property_mapping = getImageListPropertyMapping();
int num_property_mappings = getImageListPropertyMappingSize();
#endif
}
-void InitGlobalAnimSoundInfo()
+static void InitGlobalAnimSoundInfo(void)
{
struct PropertyMapping *property_mapping = getSoundListPropertyMapping();
int num_property_mappings = getSoundListPropertyMappingSize();
#endif
}
-void InitGlobalAnimMusicInfo()
+static void InitGlobalAnimMusicInfo(void)
{
struct PropertyMapping *property_mapping = getMusicListPropertyMapping();
int num_property_mappings = getMusicListPropertyMappingSize();
#endif
}
-void InitElementGraphicInfo()
+static void InitElementGraphicInfo(void)
{
struct PropertyMapping *property_mapping = getImageListPropertyMapping();
int num_property_mappings = getImageListPropertyMappingSize();
UPDATE_BUSY_STATE();
}
-void InitElementSpecialGraphicInfo()
+static void InitElementSpecialGraphicInfo(void)
{
struct PropertyMapping *property_mapping = getImageListPropertyMapping();
int num_property_mappings = getImageListPropertyMappingSize();
}
}
-static void InitGraphicInfo()
+static void InitGraphicInfo(void)
{
int fallback_graphic = IMG_CHAR_EXCLAM;
int num_images = getImageListSize();
}
}
-static void InitGraphicCompatibilityInfo()
+static void InitGraphicCompatibilityInfo(void)
{
struct FileInfo *fi_global_door =
getImageListEntryFromImageID(IMG_GLOBAL_DOOR);
InitGraphicCompatibilityInfo_Doors();
}
-static void InitElementSoundInfo()
+static void InitElementSoundInfo(void)
{
struct PropertyMapping *property_mapping = getSoundListPropertyMapping();
int num_property_mappings = getSoundListPropertyMappingSize();
element_info[copy_properties[i][0]].sound[act];
}
-static void InitGameModeSoundInfo()
+static void InitGameModeSoundInfo(void)
{
int i;
sound_info[sound].priority = parameter[SND_ARG_PRIORITY];
}
-static void InitSoundInfo()
+static void InitSoundInfo(void)
{
int *sound_effect_properties;
int num_sounds = getSoundListSize();
free(sound_effect_properties);
}
-static void InitGameModeMusicInfo()
+static void InitGameModeMusicInfo(void)
{
struct PropertyMapping *property_mapping = getMusicListPropertyMapping();
int num_property_mappings = getMusicListPropertyMappingSize();
music_info[music].loop = parameter[MUS_ARG_MODE_LOOP];
}
-static void InitMusicInfo()
+static void InitMusicInfo(void)
{
int num_music = getMusicListSize();
int i, j;
}
}
-static void ReinitializeGraphics()
+static void ReinitializeGraphics(void)
{
print_timestamp_init("ReinitializeGraphics");
print_timestamp_done("ReinitializeGraphics");
}
-static void ReinitializeSounds()
+static void ReinitializeSounds(void)
{
InitSoundInfo(); /* sound properties mapping */
InitElementSoundInfo(); /* element game sound mapping */
InitPlayLevelSound(); /* internal game sound settings */
}
-static void ReinitializeMusic()
+static void ReinitializeMusic(void)
{
InitMusicInfo(); /* music properties mapping */
InitGameModeMusicInfo(); /* game mode music mapping */
ResolveGroupElementExt(group_element, 0);
}
-void InitElementPropertiesStatic()
+void InitElementPropertiesStatic(void)
{
static boolean clipboard_elements_initialized = FALSE;
EL_INVISIBLE_WALL_ACTIVE,
EL_SWITCHGATE_SWITCH_UP,
EL_SWITCHGATE_SWITCH_DOWN,
- EL_DC_SWITCHGATE_SWITCH_UP,
- EL_DC_SWITCHGATE_SWITCH_DOWN,
EL_TIMEGATE_SWITCH,
EL_TIMEGATE_SWITCH_ACTIVE,
- EL_DC_TIMEGATE_SWITCH,
- EL_DC_TIMEGATE_SWITCH_ACTIVE,
EL_EMC_WALL_1,
EL_EMC_WALL_2,
EL_EMC_WALL_3,
EL_SIGN_FRANKIE,
EL_STEEL_EXIT_CLOSED,
EL_STEEL_EXIT_OPEN,
+ EL_STEEL_EXIT_OPENING,
+ EL_STEEL_EXIT_CLOSING,
+ EL_EM_STEEL_EXIT_CLOSED,
+ EL_EM_STEEL_EXIT_OPEN,
+ EL_EM_STEEL_EXIT_OPENING,
+ EL_EM_STEEL_EXIT_CLOSING,
EL_DC_STEELWALL_1_LEFT,
EL_DC_STEELWALL_1_RIGHT,
EL_DC_STEELWALL_1_TOP,
EL_EM_GATE_2_GRAY_ACTIVE,
EL_EM_GATE_3_GRAY_ACTIVE,
EL_EM_GATE_4_GRAY_ACTIVE,
+ EL_EMC_GATE_5,
+ EL_EMC_GATE_6,
+ EL_EMC_GATE_7,
+ EL_EMC_GATE_8,
+ EL_EMC_GATE_5_GRAY,
+ EL_EMC_GATE_6_GRAY,
+ EL_EMC_GATE_7_GRAY,
+ EL_EMC_GATE_8_GRAY,
+ EL_EMC_GATE_5_GRAY_ACTIVE,
+ EL_EMC_GATE_6_GRAY_ACTIVE,
+ EL_EMC_GATE_7_GRAY_ACTIVE,
+ EL_EMC_GATE_8_GRAY_ACTIVE,
+ EL_DC_GATE_WHITE,
+ EL_DC_GATE_WHITE_GRAY,
+ EL_DC_GATE_WHITE_GRAY_ACTIVE,
+ EL_DC_GATE_FAKE_GRAY,
EL_SWITCHGATE_OPEN,
EL_SWITCHGATE_OPENING,
EL_SWITCHGATE_CLOSED,
EL_SWITCHGATE_CLOSING,
+ EL_DC_SWITCHGATE_SWITCH_UP,
+ EL_DC_SWITCHGATE_SWITCH_DOWN,
EL_TIMEGATE_OPEN,
EL_TIMEGATE_OPENING,
EL_TIMEGATE_CLOSED,
EL_TIMEGATE_CLOSING,
+ EL_DC_TIMEGATE_SWITCH,
+ EL_DC_TIMEGATE_SWITCH_ACTIVE,
EL_TUBE_ANY,
EL_TUBE_VERTICAL,
EL_TUBE_HORIZONTAL,
EL_TUBE_LEFT_DOWN,
EL_TUBE_RIGHT_UP,
EL_TUBE_RIGHT_DOWN,
+ EL_EXPANDABLE_STEELWALL_HORIZONTAL,
+ EL_EXPANDABLE_STEELWALL_VERTICAL,
+ EL_EXPANDABLE_STEELWALL_ANY,
-1
};
if (IS_HISTORIC_SOLID(i) || i == EL_EXPLOSION)
SET_PROPERTY(i, EP_DRAGONFIRE_PROOF, TRUE);
else
- SET_PROPERTY(i, EP_DRAGONFIRE_PROOF, (IS_CUSTOM_ELEMENT(i) &&
- IS_INDESTRUCTIBLE(i)));
+ SET_PROPERTY(i, EP_DRAGONFIRE_PROOF, (IS_INDESTRUCTIBLE(i) &&
+ i != EL_ACID));
/* ---------- EXPLOSION_PROOF ------------------------------------------ */
if (i == EL_FLAMES)
InitElementGraphicInfo();
}
-void InitElementPropertiesGfxElement()
+void InitElementPropertiesGfxElement(void)
{
int i;
}
}
-static void InitGlobal()
+static void InitGlobal(void)
{
int graphic;
int i;
global.use_envelope_request = FALSE;
}
-void Execute_Command(char *command)
+static void Execute_Command(char *command)
{
int i;
{
Error(ERR_EXIT_HELP, "unrecognized command '%s'", command);
}
+
+ /* disable networking if any valid command was recognized */
+ options.network = setup.network_mode = FALSE;
}
-static void InitSetup()
+static void InitSetup(void)
{
LoadSetup(); /* global setup info */
LoadSetup_AutoSetup(); /* global auto setup info */
global.show_frames_per_second = TRUE;
}
-static void InitGameInfo()
+static void InitGameInfo(void)
{
game.restart_level = FALSE;
game.restart_game_message = NULL;
}
-static void InitPlayerInfo()
+static void InitPlayerInfo(void)
{
int i;
}
local_player->connected_locally = TRUE;
- local_player->connected_network = TRUE;
}
-static void InitArtworkInfo()
+static void InitArtworkInfo(void)
{
LoadArtworkInfo();
}
return id_suffix;
}
-static void InitArtworkConfig()
+static void InitArtworkConfig(void)
{
static char *image_id_prefix[MAX_NUM_ELEMENTS +
NUM_FONTS +
level_id_suffix, ignore_music_tokens);
}
-static void InitMixer()
+static void InitMixer(void)
{
OpenAudio();
StartMixer();
}
-static void InitVideoOverlay()
+static void InitVideoOverlay(void)
{
// if virtual buttons are not loaded from setup file, repeat initializing
// virtual buttons grid with default values now that video is initialized
InitOverlayInfo();
}
-void InitGfxBuffers()
+void InitGfxBuffers(void)
{
static int win_xsize_last = -1;
static int win_ysize_last = -1;
InitGfxBuffers_SP();
}
-void InitGfx()
+static void InitGfx(void)
{
struct GraphicInfo *graphic_info_last = graphic_info;
char *filename_font_initial = NULL;
char *filename_anim_initial = NULL;
Bitmap *bitmap_font_initial = NULL;
- int font_height;
int i, j;
/* determine settings for initial font (for displaying startup messages) */
InitFontGraphicInfo();
- font_height = getFontHeight(FC_RED);
-
- DrawInitText(getProgramInitString(), 20, FC_YELLOW);
- DrawInitText(setup.internal.program_copyright, 50, FC_RED);
- DrawInitText(setup.internal.program_website, WIN_YSIZE - 20 - font_height,
- FC_RED);
+ DrawProgramInfo();
DrawInitText("Loading graphics", 120, FC_GREEN);
init_last = init;
}
-void InitGfxBackground()
+static void InitGfxBackground(void)
{
fieldbuffer = bitmap_db_field;
SetDrawtoField(DRAW_TO_BACKBUFFER);
redraw_mask = REDRAW_ALL;
}
-static void InitLevelInfo()
+static void InitLevelInfo(void)
{
LoadLevelInfo(); /* global level info */
LoadLevelSetup_LastSeries(); /* last played series info */
if (leveldir_current == NULL)
leveldir_current = getFirstValidTreeInfoEntry(leveldir_first);
}
+
+ SetLevelSetInfo(leveldir_current->identifier, level_nr);
}
-static void InitLevelArtworkInfo()
+static void InitLevelArtworkInfo(void)
{
LoadLevelArtworkInfo();
}
-static void InitImages()
+static void InitImages(void)
{
print_timestamp_init("InitImages");
print_timestamp_done("InitMusic");
}
-static void InitArtworkDone()
+static void InitArtworkDone(void)
{
if (program.headless)
return;
InitGlobalAnimations();
}
-void InitNetworkSettings()
+static void InitNetworkSettings(void)
{
- InitNetworkInfo(options.network || setup.network_mode,
+ boolean network_enabled = (options.network || setup.network_mode);
+ char *network_server = (options.server_host != NULL ? options.server_host :
+ setup.network_server_hostname);
+
+ if (strEqual(network_server, STR_NETWORK_AUTO_DETECT))
+ network_server = NULL;
+
+ InitNetworkInfo(network_enabled,
FALSE,
options.serveronly,
- options.server_host,
+ network_server,
options.server_port);
}
-void InitNetworkServer()
+void InitNetworkServer(void)
{
- if (!network.enabled)
+ if (!network.enabled || network.connected)
return;
-#if defined(NETWORK_AVALIABLE)
+ LimitScreenUpdates(FALSE);
+
+ if (game_status == GAME_MODE_LOADING)
+ DrawProgramInfo();
+
if (!ConnectToServer(network.server_host, network.server_port))
- Error(ERR_EXIT, "cannot connect to network game server");
+ {
+ network.enabled = FALSE;
- SendToServer_PlayerName(setup.player_name);
- SendToServer_ProtocolVersion();
- SendToServer_NrWanted(setup.network_player_nr + 1);
-#endif
+ setup.network_mode = FALSE;
+ }
+ else
+ {
+ SendToServer_ProtocolVersion();
+ SendToServer_PlayerName(setup.player_name);
+ SendToServer_NrWanted(setup.network_player_nr + 1);
+
+ network.connected = TRUE;
+ }
+
+ /* short time to recognize result of network initialization */
+ if (game_status == GAME_MODE_LOADING)
+ Delay_WithScreenUpdates(1000);
}
static boolean CheckArtworkConfigForCustomElements(char *filename)
return redefined_ce_found;
}
-static void InitOverrideArtwork()
+static void InitOverrideArtwork(void)
{
boolean redefined_ce_found = FALSE;
LimitScreenUpdates(FALSE);
}
-void KeyboardAutoRepeatOffUnlessAutoplay()
+void KeyboardAutoRepeatOffUnlessAutoplay(void)
{
if (global.autoplay_leveldir == NULL)
KeyboardAutoRepeatOff();
/* OpenAll() */
/* ========================================================================= */
-void OpenAll()
+void OpenAll(void)
{
print_timestamp_init("OpenAll");
return;
}
+ InitNetworkServer();
+
SetGameStatus(GAME_MODE_MAIN);
FadeSetEnterScreen();
DrawMainMenu();
- InitNetworkServer();
-
#if 0
Error(ERR_DEBUG, "::: SDL_GetBasePath() == '%s'",
SDL_GetBasePath());