X-Git-Url: https://git.artsoft.org/?a=blobdiff_plain;f=src%2Finit.c;h=88ffc38bfca24941a3a051b2381723b2567f1078;hb=c5f483ea6c651aba3f9834ee47ba94e2c1bf9055;hp=eeb8af52d01dff918c67ccd82e3ad084cc4812bd;hpb=c6edf400f39aca3fa8e75907bbeb4b8a488485ad;p=rocksndiamonds.git diff --git a/src/init.c b/src/init.c index eeb8af52..88ffc38b 100644 --- a/src/init.c +++ b/src/init.c @@ -551,6 +551,11 @@ void InitFontGraphicInfo() font_bitmap_info[font_bitmap_id].width = graphic_info[graphic].width; font_bitmap_info[font_bitmap_id].height = graphic_info[graphic].height; + font_bitmap_info[font_bitmap_id].offset_x = + graphic_info[graphic].offset_x; + font_bitmap_info[font_bitmap_id].offset_y = + graphic_info[graphic].offset_y; + font_bitmap_info[font_bitmap_id].draw_xoffset = graphic_info[graphic].draw_xoffset; font_bitmap_info[font_bitmap_id].draw_yoffset = @@ -1284,6 +1289,8 @@ static void set_graphic_parameters_ext(int graphic, int *parameter, g->post_delay_random = 0; g->init_event = ANIM_EVENT_DEFAULT; g->anim_event = ANIM_EVENT_DEFAULT; + g->init_event_action = -1; + g->anim_event_action = -1; g->draw_masked = FALSE; g->draw_order = 0; g->fade_mode = FADE_MODE_DEFAULT; @@ -1506,6 +1513,10 @@ static void set_graphic_parameters_ext(int graphic, int *parameter, g->init_event = parameter[GFX_ARG_INIT_EVENT]; if (parameter[GFX_ARG_ANIM_EVENT] != ARG_UNDEFINED_VALUE) g->anim_event = parameter[GFX_ARG_ANIM_EVENT]; + if (parameter[GFX_ARG_INIT_EVENT_ACTION] != ARG_UNDEFINED_VALUE) + g->init_event_action = parameter[GFX_ARG_INIT_EVENT_ACTION]; + if (parameter[GFX_ARG_ANIM_EVENT_ACTION] != ARG_UNDEFINED_VALUE) + g->anim_event_action = parameter[GFX_ARG_ANIM_EVENT_ACTION]; /* used for toon animations and global animations */ g->step_offset = parameter[GFX_ARG_STEP_OFFSET]; @@ -5059,6 +5070,7 @@ static void InitSetup() static void InitGameInfo() { game.restart_level = FALSE; + game.restart_game_message = NULL; } static void InitPlayerInfo() @@ -5069,9 +5081,13 @@ static void InitPlayerInfo() local_player = &stored_player[0]; for (i = 0; i < MAX_PLAYERS; i++) - stored_player[i].connected = FALSE; + { + stored_player[i].connected_locally = FALSE; + stored_player[i].connected_network = FALSE; + } - local_player->connected = TRUE; + local_player->connected_locally = TRUE; + local_player->connected_network = TRUE; } static void InitArtworkInfo() @@ -5118,6 +5134,10 @@ static void InitArtworkConfig() { "name", "sort_priority", + "program_title", + "program_copyright", + "program_company", + NULL }; static char **ignore_image_tokens; @@ -5223,6 +5243,17 @@ static void InitMixer() StartMixer(); } +static void InitVideoOverlay() +{ + // if virtual buttons are not loaded from setup file, repeat initializing + // virtual buttons grid with default values now that video is initialized + if (!setup.touch.grid_initialized) + InitSetup(); + + InitTileCursorInfo(); + InitOverlayInfo(); +} + void InitGfxBuffers() { static int win_xsize_last = -1; @@ -5422,6 +5453,7 @@ void InitGfx() InitGfxDrawBusyAnimFunction(DrawInitAnim); InitGfxDrawGlobalAnimFunction(DrawGlobalAnimations); InitGfxDrawGlobalBorderFunction(DrawMaskedBorderToTarget); + InitGfxDrawTileCursorFunction(DrawTileCursor); gfx.fade_border_source_status = global.border_status; gfx.fade_border_target_status = global.border_status; @@ -5575,24 +5607,19 @@ static void InitArtworkDone() void InitNetworkServer() { -#if defined(NETWORK_AVALIABLE) - int nr_wanted; -#endif + if (setup.network_mode) + options.network = TRUE; if (!options.network) return; #if defined(NETWORK_AVALIABLE) - nr_wanted = Request("Choose player", REQ_PLAYER | REQ_STAY_CLOSED); - if (!ConnectToServer(options.server_host, options.server_port)) Error(ERR_EXIT, "cannot connect to network game server"); SendToServer_PlayerName(setup.player_name); SendToServer_ProtocolVersion(); - - if (nr_wanted) - SendToServer_NrWanted(nr_wanted); + SendToServer_NrWanted(setup.network_player_nr + 1); #endif } @@ -5998,8 +6025,7 @@ void OpenAll() InitVideoDefaults(); InitVideoDisplay(); InitVideoBuffer(WIN_XSIZE, WIN_YSIZE, DEFAULT_DEPTH, setup.fullscreen); - - InitOverlayInfo(); + InitVideoOverlay(); print_timestamp_time("[init video stuff]");