From 32470fe65ccbb079435a861622f2f334c084a414 Mon Sep 17 00:00:00 2001 From: terminx Date: Tue, 13 Feb 2007 02:22:17 +0000 Subject: [PATCH] Added EVENT_DISPLAYSTATUSBAR and moved the "detail" option out of game options and into the video setup menu (but only while classic mode is enabled). git-svn-id: https://svn.eduke32.com/eduke32@492 1a8010ca-5511-0410-912e-c29ae57300e0 --- polymer/eduke32/source/duke3d.h | 1 + polymer/eduke32/source/game.c | 14 ++-- polymer/eduke32/source/gamedef.c | 2 + polymer/eduke32/source/menus.c | 108 +++++++++++++++++-------------- 4 files changed, 71 insertions(+), 54 deletions(-) diff --git a/polymer/eduke32/source/duke3d.h b/polymer/eduke32/source/duke3d.h index 55f23af04..fa8d113d0 100644 --- a/polymer/eduke32/source/duke3d.h +++ b/polymer/eduke32/source/duke3d.h @@ -701,6 +701,7 @@ enum events { EVENT_DRAWWEAPON, EVENT_DISPLAYCROSSHAIR, EVENT_DISPLAYREST, + EVENT_DISPLAYSBAR, EVENT_RESETPLAYER, EVENT_INCURDAMAGE, EVENT_AIMDOWN, diff --git a/polymer/eduke32/source/game.c b/polymer/eduke32/source/game.c index b37827dd2..beef89580 100644 --- a/polymer/eduke32/source/game.c +++ b/polymer/eduke32/source/game.c @@ -1893,8 +1893,6 @@ static void coolgaugetext(int snum) long i, j, o, ss, u; int permbit; - if (p->invdisptime > 0) displayinventory(p); - if (ps[snum].gm&MODE_MENU) if ((current_menu >= 400 && current_menu <= 405)) return; @@ -3362,7 +3360,13 @@ void displayrest(long smoothratio) } } - coolgaugetext(screenpeek); + if (pp->invdisptime > 0) displayinventory(pp); + + SetGameVarID(g_iReturnVarID,0,ps[screenpeek].i,screenpeek); + OnEvent(EVENT_DISPLAYSBAR, ps[screenpeek].i, screenpeek, -1); + if (GetGameVarID(g_iReturnVarID,ps[screenpeek].i,screenpeek) == 0) + coolgaugetext(screenpeek); + operatefta(); if (KB_KeyPressed(sc_Escape) && ud.overhead_on == 0 @@ -3954,7 +3958,7 @@ void displayrooms(int snum,long smoothratio) i = sintable[i+512]*8 + sintable[i]*5L; setaspect(i>>1,yxaspect); } - else if (getrendermode() > 0 /*&& (p->rotscrnang || p->orotscrnang)*/) + else if (getrendermode() > 0 && ud.screen_tilting /*&& (p->rotscrnang || p->orotscrnang)*/) { setrollangle(p->orotscrnang + mulscale16(((p->rotscrnang - p->orotscrnang + 1024)&2047)-1024,smoothratio)); p->orotscrnang = p->rotscrnang; // JBF: save it for next time @@ -10193,7 +10197,7 @@ MAIN_LOOP_RESTART: else i = 65536; - if (ud.statusbarmode == 1 && ud.statusbarscale == 100) + if (ud.statusbarmode == 1 && (ud.statusbarscale == 100 || bpp == 8)) { ud.statusbarmode = 0; vscrn(); diff --git a/polymer/eduke32/source/gamedef.c b/polymer/eduke32/source/gamedef.c index b0ba560fc..30f82a647 100644 --- a/polymer/eduke32/source/gamedef.c +++ b/polymer/eduke32/source/gamedef.c @@ -1047,6 +1047,7 @@ char CheckEventSync(int iEventID) case EVENT_DISPLAYCROSSHAIR: case EVENT_DISPLAYREST: case EVENT_DISPLAYROOMS: + case EVENT_DISPLAYSBAR: case EVENT_DISPLAYWEAPON: case EVENT_DRAWWEAPON: case EVENT_ENTERLEVEL: @@ -4547,6 +4548,7 @@ static void AddDefaultDefinitions(void) AddDefinition("EVENT_DISPLAYCROSSHAIR",EVENT_DISPLAYCROSSHAIR,LABEL_DEFINE); AddDefinition("EVENT_DISPLAYREST",EVENT_DISPLAYREST,LABEL_DEFINE); AddDefinition("EVENT_DISPLAYROOMS",EVENT_DISPLAYROOMS,LABEL_DEFINE); + AddDefinition("EVENT_DISPLAYSBAR",EVENT_DISPLAYSBAR,LABEL_DEFINE); AddDefinition("EVENT_DISPLAYWEAPON",EVENT_DISPLAYWEAPON,LABEL_DEFINE); AddDefinition("EVENT_DOFIRE",EVENT_DOFIRE,LABEL_DEFINE); AddDefinition("EVENT_DRAWWEAPON",EVENT_DRAWWEAPON,LABEL_DEFINE); diff --git a/polymer/eduke32/source/menus.c b/polymer/eduke32/source/menus.c index ea0545c05..97c1e515b 100644 --- a/polymer/eduke32/source/menus.c +++ b/polymer/eduke32/source/menus.c @@ -2519,7 +2519,6 @@ cheat_for_port_credits: "-", "Run key style", "-", - "Detail", "Shadows", "Screen tilting", "-", @@ -2529,6 +2528,8 @@ cheat_for_port_credits: "-", "-", "-", + "-", + "-", "More...", NULL }; @@ -2617,32 +2618,27 @@ cheat_for_port_credits: gametextpal(d,yy, ud.runkey_mode ? "Classic" : "Modern", MENUHIGHLIGHT(io), 0); break; case 5: - if (x==io) ud.detail = 1-ud.detail; - modval(0,1,(int *)&ud.detail,1,probey==io); - gametextpal(d,yy, ud.detail ? "High" : "Low", MENUHIGHLIGHT(io), 0); - break; - case 6: if (x==io) ud.shadows = 1-ud.shadows; modval(0,1,(int *)&ud.shadows,1,probey==io); gametextpal(d,yy, ud.shadows ? "On" : "Off", MENUHIGHLIGHT(io), 0); break; - case 7: + case 6: if (x==io) ud.screen_tilting = 1-ud.screen_tilting; modval(0,1,(int *)&ud.screen_tilting,1,probey==io); gametextpal(d,yy, ud.screen_tilting ? "On" : "Off", MENUHIGHLIGHT(io), 0); break; // original had a 'full' option - case 8: + case 7: if (x==io) ud.showweapons = 1-ud.showweapons; modval(0,1,(int *)&ud.showweapons,1,probey==io); ShowOpponentWeapons = ud.showweapons; gametextpal(d,yy, ShowOpponentWeapons ? "On" : "Off", MENUHIGHLIGHT(io), 0); break; - case 9: + case 8: if (x==io) ud.democams = 1-ud.democams; modval(0,1,(int *)&ud.democams,1,probey==io); gametextpal(d,yy, ud.democams ? "On" : "Off", MENUHIGHLIGHT(io), 0); break; - case 10: + case 9: if (x==io) { enabled = !((ps[myconnectindex].gm&MODE_GAME) && ud.m_recstat != 1); @@ -2653,7 +2649,7 @@ cheat_for_port_credits: enabled = 0; gametextpal(d,yy,ud.m_recstat?((ud.m_recstat && enabled && ps[myconnectindex].gm&MODE_GAME)?"Running":"On"):"Off",enabled?MENUHIGHLIGHT(io):DISABLEDMENUSHADE,enabled?0:1); break; - case 11: + case 10: if (x==io) cmenu(201); break; default: @@ -2722,7 +2718,7 @@ cheat_for_port_credits: if (x == -1) { cmenu(200); - probey = 11; + probey = 10; break; } @@ -2806,6 +2802,7 @@ cheat_for_port_credits: case 8: #endif if (x==io) cmenu(200); + probey = 10; break; default: break; @@ -2906,9 +2903,9 @@ cheat_for_port_credits: c = (320>>1)-120; #if defined(POLYMOST) && defined(USE_OPENGL) - x = 8; + x = (bpp>8?8:6); #else - x = 5; + x = 6; #endif onbar = (probey == 4); if (probey == 0 || probey == 1 || probey == 2) @@ -3133,10 +3130,14 @@ cheat_for_port_credits: case 4: break; - -#if defined(POLYMOST) && defined(USE_OPENGL) + case 5: - if (bpp==8) break; + if (bpp==8) + { + ud.detail = 1-ud.detail; + break; + } +#if defined(POLYMOST) && defined(USE_OPENGL) /* switch (gltexfiltermode) { case 0: @@ -3157,7 +3158,6 @@ cheat_for_port_credits: gltexfiltermode = 0; gltexapplyprops(); break; - case 6: if (bpp==8) break; glanisotropy *= 2; @@ -3197,40 +3197,50 @@ cheat_for_port_credits: } } -#if defined(POLYMOST) && defined(USE_OPENGL) - menutext(c,50+62+16+16,MENUHIGHLIGHT(5),bpp==8,"FILTERING"); - switch (gltexfiltermode) + if (bpp == 8) { - case 0: - strcpy(tempbuf,"NEAREST"); - break; - case 1: - strcpy(tempbuf,"LINEAR"); - break; - case 2: - strcpy(tempbuf,"NEAREST_MM_N"); - break; - case 3: - strcpy(tempbuf,"BILINEAR"); - break; - case 4: - strcpy(tempbuf,"NEAREST_MM_L"); - break; - case 5: - strcpy(tempbuf,"TRILINEAR"); - break; - default: - strcpy(tempbuf,"OTHER"); - break; + menutext(c,50+62+16+16,MENUHIGHLIGHT(5),0,"DETAIL"); + menutext(c+154,50+62+16+16,MENUHIGHLIGHT(5),0,ud.detail?"HIGH":"LOW"); + modval(0,1,(int *)&ud.detail,1,probey==5); } -// menutext(c+154,50+62+16+16,MENUHIGHLIGHT(5),bpp==8,tempbuf); - gametextpal(c+154,50+62+16+16-8,tempbuf,MENUHIGHLIGHT(5),bpp==8); - menutext(c,50+62+16+16+16,MENUHIGHLIGHT(6),bpp==8,"ANISOTROPY"); - if (glanisotropy == 1) strcpy(tempbuf,"NONE"); - else sprintf(tempbuf,"%ld-tap",glanisotropy); - menutext(c+154,50+62+16+16+16,MENUHIGHLIGHT(6),bpp==8,tempbuf); - menutext(c,50+62+16+16+16+16,MENUHIGHLIGHT(7),bpp==8,"ADVANCED VIDEO"); +#if defined(POLYMOST) && defined(USE_OPENGL) + if (bpp > 8) + { + menutext(c,50+62+16+16,MENUHIGHLIGHT(5),bpp==8,"FILTERING"); + switch (gltexfiltermode) + { + case 0: + strcpy(tempbuf,"NEAREST"); + break; + case 1: + strcpy(tempbuf,"LINEAR"); + break; + case 2: + strcpy(tempbuf,"NEAR_MM_NEAR"); + break; + case 3: + strcpy(tempbuf,"BILINEAR"); + break; + case 4: + strcpy(tempbuf,"NEAR_MM_LIN"); + break; + case 5: + strcpy(tempbuf,"TRILINEAR"); + break; + default: + strcpy(tempbuf,"OTHER"); + break; + } + // menutext(c+154,50+62+16+16,MENUHIGHLIGHT(5),bpp==8,tempbuf); + gametextpal(c+154,50+62+16+16-8,tempbuf,MENUHIGHLIGHT(5),bpp==8); + + menutext(c,50+62+16+16+16,MENUHIGHLIGHT(6),bpp==8,"ANISOTROPY"); + if (glanisotropy == 1) strcpy(tempbuf,"NONE"); + else sprintf(tempbuf,"%ld-tap",glanisotropy); + menutext(c+154,50+62+16+16+16,MENUHIGHLIGHT(6),bpp==8,tempbuf); + menutext(c,50+62+16+16+16+16,MENUHIGHLIGHT(7),bpp==8,"ADVANCED VIDEO"); + } #endif break;