//called when the player is starting a new level for normal game model void StartNewLevel(int level_num) { GameTime = FrameTime; load_custom_data(get_level_file(level_num)); if (!(Game_mode & GM_MULTI)) { do_briefing_screens(level_num); } StartNewLevelSub(level_num, 1 ); }
//load a level off disk. level numbers start at 1. Secret levels are -1,-2,-3 void LoadLevel(int level_num,int page_in_textures) { char *level_name; player save_player; save_player = Players[Player_num]; Assert(level_num <= Last_level && level_num >= Last_secret_level && level_num != 0); level_name = get_level_file(level_num); if (!load_level(level_name)) Current_level_num=level_num; gr_use_palette_table( "palette.256" ); show_boxed_message(TXT_LOADING, 0); #ifdef RELEASE timer_delay(F1_0); #endif #ifdef NETWORK my_segments_checksum = netmisc_calc_checksum(); #endif load_endlevel_data(level_num); load_custom_data(level_name); #ifdef NETWORK reset_network_objects(); #endif Players[Player_num] = save_player; set_sound_sources(); songs_play_level_song( Current_level_num, 0 ); gr_palette_load(gr_palette); //actually load the palette if ( page_in_textures ) piggy_load_level_data(); }