From 7c083d0834140c75d766a1dc0d99b50301335597 Mon Sep 17 00:00:00 2001 From: kreatordxx <> Date: Fri, 5 Feb 2010 08:53:20 +0000 Subject: [PATCH] No showing the main menu background between loading a level and playing it, fixing palette issue when autoplaying a demo --- CHANGELOG.txt | 1 + main/gameseq.c | 7 +++++++ main/newmenu.c | 5 ++++- 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 293d41891..2668e4b4f 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -3,6 +3,7 @@ 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 +main/gameseq.c, main/newmenu.c: No showing the main menu background between loading a level and playing it (syncing with D2X) 20100202 -------- diff --git a/main/gameseq.c b/main/gameseq.c index aa4240478..42b09fcbc 100644 --- a/main/gameseq.c +++ b/main/gameseq.c @@ -878,6 +878,7 @@ void DoEndLevelScoreGlitz(int network) int i,c; char title[128]; int is_last_level; + int fmode; gr_palette_load( gr_palette ); @@ -947,12 +948,15 @@ void DoEndLevelScoreGlitz(int network) Assert(c <= N_GLITZITEMS); + fmode = Function_mode; + Function_mode = FMODE_MENU; // hack to get Menu_pcx_name to actually show #ifdef NETWORK if ( network && (Game_mode & GM_NETWORK) ) newmenu_do2(NULL, title, c, m, multi_endlevel_poll1, NULL, 0, Menu_pcx_name); else #endif // Note link! newmenu_do2(NULL, title, c, m, NULL, NULL, 0, Menu_pcx_name); + Function_mode = fmode; } //called when the player has finished a level @@ -967,11 +971,14 @@ void PlayerFinishedLevel(int secret_flag) #ifndef SHAREWARE if (!(Game_mode & GM_MULTI) && (secret_flag)) { newmenu_item m[1]; + int fmode = Function_mode; m[0].type = NM_TYPE_TEXT; m[0].text = " "; //TXT_SECRET_EXIT; + Function_mode = FMODE_MENU; newmenu_do2(NULL, TXT_SECRET_EXIT, 1, m, NULL, NULL, 0, Menu_pcx_name); + Function_mode = fmode; } #endif diff --git a/main/newmenu.c b/main/newmenu.c index f03abd456..61b551ebf 100644 --- a/main/newmenu.c +++ b/main/newmenu.c @@ -128,8 +128,11 @@ void nm_draw_background1(char * filename) { int pcx_error; - if (filename == NULL && Function_mode == FMODE_MENU) + if (filename == NULL) filename = Menu_pcx_name; + + if (!strcmp(filename, Menu_pcx_name) && Function_mode != FMODE_MENU) + return; if (filename != NULL) {