Put the full_palette_save and palette_restore calls in the game handler for tidiness; remove leftover redundant digi_resume_digi_sounds calls

This commit is contained in:
kreatordxx 2010-02-05 02:31:36 +00:00
parent 999a1b2949
commit b58c034350
4 changed files with 16 additions and 2 deletions

View file

@ -1,5 +1,9 @@
D1X-Rebirth Changelog
20100205
--------
main/game.c, main/gameseq.c, main/newdemo.c: Use palette_save and palette_restore for all windows displayed over Game_wind, not just for do_option
20100202
--------
arch/include/event.h, arch/sdl/window.c, main/automap.c, main/dumpmine.c, main/game.c, main/gamecntl.c, main/gamesave.c, main/gameseq.c, main/kconfig.c, main/net_ipx.c, main/net_udp.c, main/newmenu.c: Add EVENT_WINDOW_DEACTIVATED; move many game_flush_inputs, start_time and stop_time calls to game_handler as well as digi_pause_digi_sounds and digi_resume_digi_sounds

View file

@ -993,6 +993,9 @@ int game_handler(window *wind, d_event *event, void *data)
if ( Function_mode == FMODE_GAME && !((Game_mode & GM_MULTI) && (Newdemo_state != ND_STATE_PLAYBACK)))
digi_resume_digi_sounds();
if (!((Game_mode & GM_MULTI) && (Newdemo_state != ND_STATE_PLAYBACK)))
palette_restore();
break;
case EVENT_WINDOW_DEACTIVATED:
@ -1003,6 +1006,9 @@ int game_handler(window *wind, d_event *event, void *data)
if ( Function_mode == FMODE_GAME && !((Game_mode & GM_MULTI) && (Newdemo_state != ND_STATE_PLAYBACK)))
digi_pause_digi_sounds();
if (!((Game_mode & GM_MULTI) && (Newdemo_state != ND_STATE_PLAYBACK)))
palette_save();
break;
case EVENT_IDLE:
@ -1017,9 +1023,7 @@ int game_handler(window *wind, d_event *event, void *data)
RBACheckFinishedHook(); // Handle RedBook Audio Repeating.
if (Config_menu_flag) {
if (!(Game_mode&GM_MULTI)) palette_save();
do_options_menu();
if (!(Game_mode&GM_MULTI)) palette_restore();
}
if (!Game_wind)

View file

@ -1321,6 +1321,10 @@ void StartNewLevelSub(int level_num, int page_in_textures)
// Say player can use FLASH cheat to mark path to exit.
Last_level_path_created = -1;
// Initialise for palette_restore()
if (!((Game_mode & GM_MULTI) && (Newdemo_state != ND_STATE_PLAYBACK)))
palette_save();
}
//called when the player is starting a new level for normal game model

View file

@ -2559,6 +2559,8 @@ int newdemo_read_frame_information(int rewrite)
Newdemo_cntrlcen_destroyed = 0;
reset_palette_add(); // get palette back to normal
palette_save(); // initialise for palette_restore()
start_time();
break;
}