From eb0458ba5f4a4e4fb0086f252d64e83f3f1b6277 Mon Sep 17 00:00:00 2001 From: kreatordxx <> Date: Sat, 3 Apr 2010 09:10:20 +0000 Subject: [PATCH] Remove calls to nm_draw_background1 to show newmenus stacked --- CHANGELOG.txt | 1 + main/kconfig.c | 6 ------ main/menu.h | 2 +- main/net_ipx.c | 5 ----- main/net_udp.c | 4 ---- main/newmenu.c | 7 ------- main/scores.c | 6 +++--- 7 files changed, 5 insertions(+), 26 deletions(-) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 93b1a84ed..8f800fd8c 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -4,6 +4,7 @@ D1X-Rebirth Changelog -------- arch/sdl/mouse.c, main/game.c, main/net_ipx.c, main/net_ipx.h, main/newmenu.c, main/newmenu.h, main/state.c: Make newmenu_do3 and newmenu_dotiny return as soon as the newmenu is created, which will allow the main menu (and others) to persist main/menu.c: Make main menu persist to streamline redrawing (later) +main/kconfig.c, main/menu.h, main/net_ipx.c, main/net_udp.c, main/newmenu.c, main/scores.c: Remove calls to nm_draw_background1 to show newmenus stacked 20100402 -------- diff --git a/main/kconfig.c b/main/kconfig.c index 3f0cd2552..162f264bf 100644 --- a/main/kconfig.c +++ b/main/kconfig.c @@ -427,7 +427,6 @@ int get_item_height(kc_item *item) return h; } -void nm_draw_background1(char * filename); void kc_drawquestion( kc_menu *menu, kc_item *item ); void kconfig_draw(kc_menu *menu) @@ -439,9 +438,6 @@ void kconfig_draw(kc_menu *menu) int w = FSPACX(290), h = FSPACY(170); gr_set_current_canvas(NULL); -#ifdef OGL - nm_draw_background1(NULL); -#endif nm_draw_background(((SWIDTH-w)/2)-BORDERX,((SHEIGHT-h)/2)-BORDERY,((SWIDTH-w)/2)+w+BORDERX,((SHEIGHT-h)/2)+h+BORDERY); gr_set_current_canvas(window_get_canvas(menu->wind)); @@ -888,8 +884,6 @@ void kconfig_sub(kc_item * items,int nitems, char *title) menu->changing = 0; menu->mouse_state = 0; - nm_draw_background1(NULL); - if (!(menu->wind = window_create(&grd_curscreen->sc_canvas, (SWIDTH - FSPACX(320))/2, (SHEIGHT - FSPACY(200))/2, FSPACX(320), FSPACY(200), (int (*)(window *, d_event *, void *))kconfig_handler, menu))) d_free(menu); diff --git a/main/menu.h b/main/menu.h index 6574c5b53..3793c6dc6 100644 --- a/main/menu.h +++ b/main/menu.h @@ -20,7 +20,7 @@ COPYRIGHT 1993-1998 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED. #ifndef _MENU_H #define _MENU_H -extern void hide_menus(void); +extern int hide_menus(void); extern void show_menus(void); // called once at program startup to get the player's name diff --git a/main/net_ipx.c b/main/net_ipx.c index f653e4da6..0349d5dae 100644 --- a/main/net_ipx.c +++ b/main/net_ipx.c @@ -3391,8 +3391,6 @@ net_ipx_level_sync(void) return(0); } -void nm_draw_background1(char * filename); - int net_ipx_do_join_game(int choice) { if (Active_ipx_games[choice].game_status == NETSTAT_ENDLEVEL) @@ -4020,9 +4018,6 @@ static int show_game_rules_handler(window *wind, d_event *event, netgame_info *n case EVENT_WINDOW_DRAW: gr_set_current_canvas(NULL); -#ifdef OGL - nm_draw_background1(NULL); -#endif nm_draw_background(((SWIDTH-w)/2)-BORDERX,((SHEIGHT-h)/2)-BORDERY,((SWIDTH-w)/2)+w+BORDERX,((SHEIGHT-h)/2)+h+BORDERY); gr_set_current_canvas(window_get_canvas(wind)); diff --git a/main/net_udp.c b/main/net_udp.c index e6e4db18e..55957c0fd 100644 --- a/main/net_udp.c +++ b/main/net_udp.c @@ -83,7 +83,6 @@ void net_udp_noloss_got_ack(ubyte *data, int data_len); void net_udp_noloss_init_mdata_queue(void); void net_udp_noloss_clear_mdata_got(ubyte player_num); void net_udp_noloss_process_queue(fix time); -extern void nm_draw_background1(char * filename); extern void game_disable_cheats(); // Variables @@ -4305,9 +4304,6 @@ static int show_game_rules_handler(window *wind, d_event *event, netgame_info *n case EVENT_WINDOW_DRAW: gr_set_current_canvas(NULL); -#ifdef OGL - nm_draw_background1(NULL); -#endif nm_draw_background(((SWIDTH-w)/2)-BORDERX,((SHEIGHT-h)/2)-BORDERY,((SWIDTH-w)/2)+w+BORDERX,((SHEIGHT-h)/2)+h+BORDERY); gr_set_current_canvas(window_get_canvas(wind)); diff --git a/main/newmenu.c b/main/newmenu.c index 747556677..d32b5c39e 100644 --- a/main/newmenu.c +++ b/main/newmenu.c @@ -129,12 +129,6 @@ void nm_draw_background1(char * filename) { int pcx_error; - if (filename == NULL) - filename = Menu_pcx_name; - - if (!strcmp(filename, Menu_pcx_name) && Function_mode != FMODE_MENU) - return; - if (filename != NULL) { if (nm_background1.bm_data == NULL) @@ -1895,7 +1889,6 @@ int listbox_draw(window *wind, listbox *lb) int i; gr_set_current_canvas(NULL); - nm_draw_background1(NULL); nm_draw_background( lb->box_x-BORDERX,lb->box_y-lb->title_height-BORDERY,lb->box_x+lb->box_w+BORDERX,lb->box_y+lb->height+BORDERY ); gr_set_curfont(MEDIUM3_FONT); gr_string( 0x8000, lb->box_y - lb->title_height, lb->title ); diff --git a/main/scores.c b/main/scores.c index 20cd4352e..47f3562a4 100644 --- a/main/scores.c +++ b/main/scores.c @@ -359,9 +359,9 @@ int scores_handler(window *wind, d_event *event, scores_menu *menu) case EVENT_WINDOW_DRAW: gr_set_current_canvas(NULL); -#ifdef OGL - nm_draw_background1(Menu_pcx_name); -#endif + + if (Game_wind) + nm_draw_background1(Menu_pcx_name); // haven't closed the game yet, need to draw menu pcx here nm_draw_background(((SWIDTH-w)/2)-BORDERX,((SHEIGHT-h)/2)-BORDERY,((SWIDTH-w)/2)+w+BORDERX,((SHEIGHT-h)/2)+h+BORDERY); gr_set_current_canvas(window_get_canvas(wind));