Menus: make aspect ratio also control r_usenewaspect.

- RENDERER SETUP is now also accessible from classic, with only 2 options:
  'aspect ratio' and 'ambient light level'
- remove the latter option from the VIDEO SETUP menu
- When compiled with OpenGL, the aspect ratio option cycles between 3 states:
  r_usenewaspect=1 (the modern way), and r_usenewaspect=0 but r_widescreen=0/1.
  In non-GL builds, there are only 2 states.
- don't display black translucent overlay in COLOR CORRECTION menu

git-svn-id: https://svn.eduke32.com/eduke32@2358 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
helixhorned 2012-02-18 17:56:39 +00:00
parent e14b2808ef
commit 079056df67

View file

@ -377,6 +377,9 @@ int32_t menutext_(int32_t x,int32_t y,int32_t s,int32_t p,char *t,int32_t bits)
return (x); return (x);
} }
// This function depends on the 'onbar' variable which should be set to the
// 'probey' indices where there's a slider bar.
static void _bar(int32_t type, int32_t x,int32_t y,int32_t *p,int32_t dainc,int32_t damodify,int32_t s, int32_t pa, int32_t min, int32_t max) static void _bar(int32_t type, int32_t x,int32_t y,int32_t *p,int32_t dainc,int32_t damodify,int32_t s, int32_t pa, int32_t min, int32_t max)
{ {
int32_t xloc; int32_t xloc;
@ -681,7 +684,8 @@ void M_DisplayMenus(void)
// black translucent background // black translucent background
if ((g_player[myconnectindex].ps->gm&MODE_GAME) || ud.recstat==2) if ((g_player[myconnectindex].ps->gm&MODE_GAME) || ud.recstat==2)
fade_screen_black(1); if (g_currentMenu != 231 && g_currentMenu != 232) // not in 'color correction' menu
fade_screen_black(1);
if (!(g_currentMenu >= 1000 && g_currentMenu <= 2999 && g_currentMenu >= 300 && g_currentMenu <= 369)) if (!(g_currentMenu >= 1000 && g_currentMenu <= 2999 && g_currentMenu >= 300 && g_currentMenu <= 369))
G_UpdateScreenArea(); G_UpdateScreenArea();
@ -2450,7 +2454,6 @@ cheat_for_port_credits:
menutext(c,70+19+19+19,MENUHIGHLIGHT(3),PHX(-5),SkillNames[3]); menutext(c,70+19+19+19,MENUHIGHLIGHT(3),PHX(-5),SkillNames[3]);
break; break;
case 230: case 230:
#ifdef USE_OPENGL
rotatesprite_fs(320<<15,19<<16,65536L,0,MENUBAR,16,0,10); rotatesprite_fs(320<<15,19<<16,65536L,0,MENUBAR,16,0,10);
menutext(320>>1,24,0,0,"RENDERER SETUP"); menutext(320>>1,24,0,0,"RENDERER SETUP");
@ -2458,12 +2461,13 @@ cheat_for_port_credits:
{ {
int32_t io, ii, yy, d=c+160+40, enabled; int32_t io, ii, yy, d=c+160+40, enabled;
char *opts[] = static const char *const opts[] =
{ {
"Aspect ratio", "Aspect ratio",
"Ambient light level",
#ifdef USE_OPENGL
"Anisotropic filtering", "Anisotropic filtering",
"Use VSync", "Use VSync",
"Ambient light level",
"-", "-",
"Enable hires textures", "Enable hires textures",
"Hires texture quality", "Hires texture quality",
@ -2472,12 +2476,16 @@ cheat_for_port_credits:
"Use detail textures", "Use detail textures",
"-", "-",
"Use models", "Use models",
#endif
NULL NULL
}; };
yy = 37; yy = 37;
for (ii=io=0; opts[ii]; ii++) for (ii=io=0; opts[ii]; ii++)
{ {
if (getrendermode()==0 && io >= 2)
break;
if (opts[ii][0] == '-' && !opts[ii][1]) if (opts[ii][0] == '-' && !opts[ii][1])
{ {
if (io <= probey) yy += 4; if (io <= probey) yy += 4;
@ -2487,7 +2495,7 @@ cheat_for_port_credits:
io++; io++;
} }
onbar = (probey==3||probey==5); onbar = (probey==1||probey==5);
x = probesm(c,yy+5,0,io); x = probesm(c,yy+5,0,io);
if (x == -1) if (x == -1)
@ -2500,20 +2508,46 @@ cheat_for_port_credits:
yy = 37; yy = 37;
for (ii=io=0; opts[ii]; ii++) for (ii=io=0; opts[ii]; ii++)
{ {
if (getrendermode()==0 && io >= 2)
break;
if (opts[ii][0] == '-' && !opts[ii][1]) if (opts[ii][0] == '-' && !opts[ii][1])
{ {
yy += 4; yy += 4;
continue; continue;
} }
enabled = 1; enabled = 1;
switch (io) switch (io)
{ {
case 0: case 0:
if (getrendermode() == 3) if (getrendermode() <= 3)
{ {
if (x==io) glwidescreen = 1-glwidescreen; #ifdef USE_OPENGL
modval(0,1,(int32_t *)&glwidescreen,1,probey==io); int32_t tmp = r_usenewaspect ? 2 : glwidescreen;
mgametextpal(d,yy, glwidescreen ? "Wide" : "Regular", MENUHIGHLIGHT(io), 0);
if (x==io)
{
tmp = tmp+1;
if (tmp > 2)
tmp = 0;
}
modval(0,2,&tmp,1,probey==io);
r_usenewaspect = (tmp==2);
// with r_usenewaspect, glwidescreen has no effect...
glwidescreen = (tmp < 2) ? tmp : 0;
mgametextpal(d,yy, r_usenewaspect ? "Auto" :
(glwidescreen ? "Old wide" : "Old reg."),
MENUHIGHLIGHT(io), 0);
#else
if (x==io)
r_usenewaspect = !r_usenewaspect;
modval(0,1,&r_usenewaspect,1,probey==io);
mgametextpal(d,yy, r_usenewaspect ? "Auto" : "Old reg.",
MENUHIGHLIGHT(io), 0);
#endif
} }
#ifdef POLYMER #ifdef POLYMER
else else
@ -2549,6 +2583,22 @@ cheat_for_port_credits:
#endif #endif
break; break;
case 1: case 1:
{
int32_t i = (int32_t)(r_ambientlight*1024.f);
int32_t j = i;
_bar(1,d+8,yy+7, &i,128,x==io,MENUHIGHLIGHT(io),0,128,4096);
Bsprintf(tempbuf,"%.2f",r_ambientlight);
mgametextpal(d-35,yy, tempbuf, MENUHIGHLIGHT(io), 0);
if (i != j)
{
r_ambientlight = (float)i/1024.f;
r_ambientlightrecip = 1.f/r_ambientlight;
}
break;
}
#ifdef USE_OPENGL
case 2:
{ {
int32_t dummy = glanisotropy; int32_t dummy = glanisotropy;
modval(0,(int32_t)glinfo.maxanisotropy+1,(int32_t *)&dummy,1,probey==io); modval(0,(int32_t)glinfo.maxanisotropy+1,(int32_t *)&dummy,1,probey==io);
@ -2564,7 +2614,7 @@ cheat_for_port_credits:
mgametextpal(d,yy, tempbuf, MENUHIGHLIGHT(io), 0); mgametextpal(d,yy, tempbuf, MENUHIGHLIGHT(io), 0);
break; break;
} }
case 2: case 3:
{ {
int32_t ovsync = vsync; int32_t ovsync = vsync;
if (x==io) vsync = !vsync; if (x==io) vsync = !vsync;
@ -2574,20 +2624,6 @@ cheat_for_port_credits:
setvsync(vsync); setvsync(vsync);
break; break;
} }
case 3:
{
int32_t i = (int32_t)(r_ambientlight*1024.f);
int32_t j = i;
_bar(1,d+8,yy+7, &i,128,x==io,MENUHIGHLIGHT(io),0,128,4096);
Bsprintf(tempbuf,"%.2f",r_ambientlight);
mgametextpal(d-35,yy, tempbuf, MENUHIGHLIGHT(io), 0);
if (i != j)
{
r_ambientlight = (float)i/1024.f;
r_ambientlightrecip = 1.f/r_ambientlight;
}
break;
}
case 4: case 4:
if (x==io) usehightile = 1-usehightile; if (x==io) usehightile = 1-usehightile;
modval(0,1,(int32_t *)&usehightile,1,probey==io); modval(0,1,(int32_t *)&usehightile,1,probey==io);
@ -2640,6 +2676,7 @@ cheat_for_port_credits:
modval(0,1,(int32_t *)&usemodels,1,probey==io); modval(0,1,(int32_t *)&usemodels,1,probey==io);
mgametextpal(d,yy, usemodels ? "Yes" : "No", MENUHIGHLIGHT(io), 0); mgametextpal(d,yy, usemodels ? "Yes" : "No", MENUHIGHLIGHT(io), 0);
break; break;
#endif
default: default:
break; break;
} }
@ -2648,7 +2685,6 @@ cheat_for_port_credits:
yy += 8; yy += 8;
} }
} }
#endif
break; break;
case 231: case 231:
case 232: case 232:
@ -3419,31 +3455,16 @@ cheat_for_port_credits:
break; break;
} }
#ifdef USE_OPENGL #ifdef USE_OPENGL
/* switch (gltexfiltermode)
{
case 0:
gltexfiltermode = 3;
break;
case 3:
gltexfiltermode = 5;
break;
case 5:
gltexfiltermode = 0;
break;
default:
gltexfiltermode = 3;
break;
}*/
gltexfiltermode++; gltexfiltermode++;
if (gltexfiltermode > 5) if (gltexfiltermode > 5)
gltexfiltermode = 0; gltexfiltermode = 0;
gltexapplyprops(); gltexapplyprops();
break; break;
#endif
case 6: case 6:
if (!getrendermode()) break; // if (!getrendermode()) break;
ChangeToMenu(230); ChangeToMenu(230);
break; break;
#endif
} }
menutext(c,50,MENUHIGHLIGHT(0),0,"RESOLUTION"); menutext(c,50,MENUHIGHLIGHT(0),0,"RESOLUTION");
@ -3474,21 +3495,9 @@ cheat_for_port_credits:
*/ */
if (!getrendermode()) if (!getrendermode())
{ {
int32_t i = (int32_t)(r_ambientlight*1024.f);
int32_t j = i;
menutext(c,50+62+16+16,MENUHIGHLIGHT(5),0,"PIXEL DOUBLING"); menutext(c,50+62+16+16,MENUHIGHLIGHT(5),0,"PIXEL DOUBLING");
menutext(c+168,50+62+16+16,MENUHIGHLIGHT(5),0,ud.detail?"OFF":"ON"); menutext(c+168,50+62+16+16,MENUHIGHLIGHT(5),0,ud.detail?"OFF":"ON");
modval(0,1,(int32_t *)&ud.detail,1,probey==5); modval(0,1,(int32_t *)&ud.detail,1,probey==5);
menutext(c,50+62+16+16+16,MENUHIGHLIGHT(6),PHX(-6),"AMBIENT LIGHT");
_bar(0,c+185,50+62+16+16+16,&i,128,x==6,MENUHIGHLIGHT(6),g_netServer || numplayers>1,128,4096);
Bsprintf(tempbuf,"%.2f",r_ambientlight);
mgametextpal(c+185+9,50+62+16+16+16+4, tempbuf, MENUHIGHLIGHT(6), 0);
if (i != j)
{
r_ambientlight = (float)i/1024.f;
r_ambientlightrecip = 1.f/r_ambientlight;
}
} }
#ifdef USE_OPENGL #ifdef USE_OPENGL
else else
@ -3523,9 +3532,9 @@ cheat_for_port_credits:
if (gltexfiltermode != filter) if (gltexfiltermode != filter)
gltexapplyprops(); gltexapplyprops();
mgametextpal(c+168,50+62+16+16-8,tempbuf,MENUHIGHLIGHT(5),!getrendermode()); mgametextpal(c+168,50+62+16+16-8,tempbuf,MENUHIGHLIGHT(5),!getrendermode());
menutext(c,50+62+16+16+16,MENUHIGHLIGHT(6),bpp==8,"RENDERER SETUP");
} }
#endif #endif
menutext(c,50+62+16+16+16,MENUHIGHLIGHT(6),0 /*bpp==8*/,"RENDERER SETUP");
break; break;
case 204: case 204: