From b58c034350b3d37a7fa7c37b02652053787836c8 Mon Sep 17 00:00:00 2001 From: kreatordxx <> Date: Fri, 5 Feb 2010 02:31:36 +0000 Subject: [PATCH] Put the full_palette_save and palette_restore calls in the game handler for tidiness; remove leftover redundant digi_resume_digi_sounds calls --- CHANGELOG.txt | 4 ++++ main/game.c | 8 ++++++-- main/gameseq.c | 4 ++++ main/newdemo.c | 2 ++ 4 files changed, 16 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index f33e54771..293d41891 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -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 diff --git a/main/game.c b/main/game.c index 5c509d261..39e2581a9 100644 --- a/main/game.c +++ b/main/game.c @@ -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) diff --git a/main/gameseq.c b/main/gameseq.c index 07a4d58e8..aa4240478 100644 --- a/main/gameseq.c +++ b/main/gameseq.c @@ -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 diff --git a/main/newdemo.c b/main/newdemo.c index 97c96bfae..a213cf5d8 100644 --- a/main/newdemo.c +++ b/main/newdemo.c @@ -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; }