From 33545ae73f4dcbe22a193bfe501f2da4b648094e 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 | 7 ------- main/net_ipx.c | 4 ---- main/net_udp.c | 4 ---- main/newmenu.c | 7 ------- main/scores.c | 6 +++--- 6 files changed, 4 insertions(+), 25 deletions(-) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 8776ee1cc..0ab2f12b9 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -4,6 +4,7 @@ D2X-Rebirth Changelog -------- arch/sdl/mouse.c, main/game.c, main/net_ipx.c, 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/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 1394113aa..95a2132b4 100644 --- a/main/kconfig.c +++ b/main/kconfig.c @@ -90,7 +90,6 @@ ubyte system_keys[] = { KEY_ESC, KEY_F1, KEY_F2, KEY_F3, KEY_F4, KEY_F5, KEY_F6, extern void transfer_energy_to_shield(fix); extern void CyclePrimary(),CycleSecondary(),InitMarkerInput(); extern ubyte DefiningMarkerMessage; -extern void nm_draw_background1(char * filename); control_info Controls; @@ -466,7 +465,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) @@ -478,9 +476,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)); @@ -938,8 +933,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/net_ipx.c b/main/net_ipx.c index 9e95d4c03..916ca62cd 100644 --- a/main/net_ipx.c +++ b/main/net_ipx.c @@ -4147,7 +4147,6 @@ int net_ipx_do_join_game(int choice) } -void nm_draw_background1(char * filename); int net_ipx_show_game_stats(int choice); int net_ipx_do_join_game(int choice); @@ -5687,9 +5686,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 104748e5c..b4933ef6b 100644 --- a/main/net_udp.c +++ b/main/net_udp.c @@ -102,7 +102,6 @@ extern void multi_send_door_open_specific(int pnum,int segnum, int side,ubyte fl extern void multi_send_wall_status_specific (int pnum,int wallnum,ubyte type,ubyte flags,ubyte state); extern void multi_send_light_specific (int pnum,int segnum,ubyte val); extern void multi_send_trigger_specific (char pnum,char trig); -extern void nm_draw_background1(char * filename); extern void game_disable_cheats(); // Variables @@ -4736,9 +4735,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 9e093ecf5..78cbf7a9c 100644 --- a/main/newmenu.c +++ b/main/newmenu.c @@ -138,12 +138,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) @@ -1904,7 +1898,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 5bf9c42ff..a595205a0 100644 --- a/main/scores.c +++ b/main/scores.c @@ -365,9 +365,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));