0
0
Fork 0
mirror of https://github.com/ZDoom/Raze.git synced 2025-02-25 12:51:04 +00:00

Remove the ratio correction slider and replace it with a simple widescreen toggle

git-svn-id: https://svn.eduke32.com/eduke32@180 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
terminx 2006-05-22 07:11:30 +00:00
parent 76eb4ada1d
commit ce4b067e65
5 changed files with 42 additions and 58 deletions
polymer

View file

@ -124,7 +124,7 @@ long gltexmaxsize = 0; // 0 means autodetection on first run
long gltexmiplevel = 0; // discards this many mipmap levels long gltexmiplevel = 0; // discards this many mipmap levels
static long lastglpolygonmode = 0; //FUK static long lastglpolygonmode = 0; //FUK
long glpolygonmode = 0; // 0:GL_FILL,1:GL_LINE,2:GL_POINT //FUK long glpolygonmode = 0; // 0:GL_FILL,1:GL_LINE,2:GL_POINT //FUK
long glratiocorrection = 63; long glratiocorrection = 1;
long glhudcorrect = 0; long glhudcorrect = 0;
static GLuint polymosttext = 0; static GLuint polymosttext = 0;
extern char nofog; extern char nofog;
@ -593,7 +593,7 @@ void resizeglcheck ()
glox2 = windowx2; gloy2 = windowy2; glox2 = windowx2; gloy2 = windowy2;
ratioratio = 1.2; //1.6 / (((float)(windowx2-windowx1+1)) / (windowy2-windowy1)); // computes the ratio between 16/10 and current resolution ratio ratioratio = 1.2; //1.6 / (((float)(windowx2-windowx1+1)) / (windowy2-windowy1)); // computes the ratio between 16/10 and current resolution ratio
fovcorrect = (((windowx2-windowx1+1) * ratioratio) - (windowx2-windowx1+1)) * ((float)glratiocorrection / 63); fovcorrect = (((windowx2-windowx1+1) * ratioratio) - (windowx2-windowx1+1)) * ((float)glratiocorrection / 1);
bglViewport(windowx1 - (fovcorrect / 2), yres-(windowy2+1),windowx2-windowx1+1 + fovcorrect, windowy2-windowy1+1); bglViewport(windowx1 - (fovcorrect / 2), yres-(windowy2+1),windowx2-windowx1+1 + fovcorrect, windowy2-windowy1+1);

View file

@ -605,7 +605,7 @@ void CONFIG_ReadSetup( void )
SCRIPT_GetNumber( scripthandle, "Screen Setup", "GLAnisotropy", &glanisotropy); SCRIPT_GetNumber( scripthandle, "Screen Setup", "GLAnisotropy", &glanisotropy);
SCRIPT_GetNumber( scripthandle, "Screen Setup", "GLHUDCorrect", &glhudcorrect); SCRIPT_GetNumber( scripthandle, "Screen Setup", "GLHUDCorrect", &glhudcorrect);
SCRIPT_GetNumber( scripthandle, "Screen Setup", "GLUseTextureCompr", &glusetexcompr); SCRIPT_GetNumber( scripthandle, "Screen Setup", "GLUseTextureCompr", &glusetexcompr);
SCRIPT_GetNumber( scripthandle, "Screen Setup", "GLRatioCorrection", &glratiocorrection); SCRIPT_GetNumber( scripthandle, "Screen Setup", "GLWidescreen", &glratiocorrection);
glusetexcache = glusetexcachecompression = -1; glusetexcache = glusetexcachecompression = -1;
SCRIPT_GetNumber( scripthandle, "Screen Setup", "GLUseCompressedTextureCache", &glusetexcache); SCRIPT_GetNumber( scripthandle, "Screen Setup", "GLUseCompressedTextureCache", &glusetexcache);
@ -745,11 +745,11 @@ void CONFIG_WriteSetup( void )
#if defined(POLYMOST) && defined(USE_OPENGL) #if defined(POLYMOST) && defined(USE_OPENGL)
SCRIPT_PutNumber( scripthandle, "Screen Setup", "GLAnisotropy",glanisotropy,false,false); SCRIPT_PutNumber( scripthandle, "Screen Setup", "GLAnisotropy",glanisotropy,false,false);
SCRIPT_PutNumber( scripthandle, "Screen Setup", "GLHUDCorrect",glhudcorrect,false,false); SCRIPT_PutNumber( scripthandle, "Screen Setup", "GLHUDCorrect",glhudcorrect,false,false);
SCRIPT_PutNumber( scripthandle, "Screen Setup", "GLRatioCorrection",glratiocorrection,false,false);
SCRIPT_PutNumber( scripthandle, "Screen Setup", "GLTextureMode",gltexfiltermode,false,false); SCRIPT_PutNumber( scripthandle, "Screen Setup", "GLTextureMode",gltexfiltermode,false,false);
SCRIPT_PutNumber( scripthandle, "Screen Setup", "GLUseCompressedTextureCache", glusetexcache,false,false); SCRIPT_PutNumber( scripthandle, "Screen Setup", "GLUseCompressedTextureCache", glusetexcache,false,false);
SCRIPT_PutNumber( scripthandle, "Screen Setup", "GLUseTextureCacheCompression", glusetexcachecompression,false,false); SCRIPT_PutNumber( scripthandle, "Screen Setup", "GLUseTextureCacheCompression", glusetexcachecompression,false,false);
SCRIPT_PutNumber( scripthandle, "Screen Setup", "GLUseTextureCompr",glusetexcompr,false,false); SCRIPT_PutNumber( scripthandle, "Screen Setup", "GLUseTextureCompr",glusetexcompr,false,false);
SCRIPT_PutNumber( scripthandle, "Screen Setup", "GLWidescreen",glratiocorrection,false,false);
#endif #endif
#ifdef RENDERTYPEWIN #ifdef RENDERTYPEWIN
SCRIPT_PutNumber( scripthandle, "Screen Setup", "MaxRefreshFreq",maxrefreshfreq,false,false); SCRIPT_PutNumber( scripthandle, "Screen Setup", "MaxRefreshFreq",maxrefreshfreq,false,false);

View file

@ -5004,7 +5004,6 @@ SKIPJIBS:
screencapt = 1; screencapt = 1;
displayrooms(myconnectindex,65536); displayrooms(myconnectindex,65536);
//savetemp("duke3d.tmp",waloff[TILE_SAVESHOT],160*100);
screencapt = 0; screencapt = 0;
if(ud.multimode > 1) if(ud.multimode > 1)
saveplayer(-1-(lastsavedpos)); saveplayer(-1-(lastsavedpos));
@ -5254,9 +5253,6 @@ SKIPJIBS:
case CON_IFSPAWNEDBY: case CON_IFSPAWNEDBY:
insptr++; insptr++;
// if(g_sp->owner >= 0 && sprite[g_sp->owner].picnum == *insptr)
// parseifelse(1);
// else
parseifelse( hittype[g_i].picnum == *insptr); parseifelse( hittype[g_i].picnum == *insptr);
break; break;
@ -5349,13 +5345,11 @@ SKIPJIBS:
case CON_IFFLOORDISTL: case CON_IFFLOORDISTL:
insptr++; insptr++;
// getglobalz(g_i);
parseifelse( (hittype[g_i].floorz - g_sp->z) <= ((*insptr)<<8)); parseifelse( (hittype[g_i].floorz - g_sp->z) <= ((*insptr)<<8));
break; break;
case CON_IFCEILINGDISTL: case CON_IFCEILINGDISTL:
insptr++; insptr++;
// getglobalz(g_i);
parseifelse( ( g_sp->z - hittype[g_i].ceilingz ) <= ((*insptr)<<8)); parseifelse( ( g_sp->z - hittype[g_i].ceilingz ) <= ((*insptr)<<8));
break; break;
@ -5386,13 +5380,6 @@ SKIPJIBS:
break; break;
} }
/* case 74:
insptr++;
getglobalz(g_i);
parseifelse( (( hittype[g_i].floorz - hittype[g_i].ceilingz ) >> 8 ) >= *insptr);
break;
*/
case CON_ADDLOG: case CON_ADDLOG:
{ {
long l; long l;
@ -5545,18 +5532,16 @@ good:
// that is of <type> into <getvar> // that is of <type> into <getvar>
// -1 for none found // -1 for none found
// <type> <maxdistvarid> <varid> // <type> <maxdistvarid> <varid>
long lType, lMaxDistVar, lMaxDist; long lType, lMaxDist;
long lVarID, lTemp, lFound, lDist; long lVarID, lTemp, lFound;
short j, k; short j, k;
insptr++; insptr++;
lType=*insptr++; lType=*insptr++;
lMaxDistVar=*insptr++; lMaxDist=GetGameVarID(*insptr++, g_i, g_p);
lVarID=*insptr++; lVarID=*insptr++;
lMaxDist=GetGameVarID(lMaxDistVar, g_i, g_p);
lFound=-1; lFound=-1;
lDist=32767; // big number
for (k=0;k<MAXSTATUS;k++) for (k=0;k<MAXSTATUS;k++)
{ {
@ -5568,7 +5553,7 @@ good:
if(tw==CON_FINDNEARACTOR3DVAR || tw==CON_FINDNEARSPRITE3DVAR) if(tw==CON_FINDNEARACTOR3DVAR || tw==CON_FINDNEARSPRITE3DVAR)
lTemp=dist(&sprite[g_i], &sprite[j]); lTemp=dist(&sprite[g_i], &sprite[j]);
else lTemp=ldist(&sprite[g_i], &sprite[j]); else lTemp=ldist(&sprite[g_i], &sprite[j]);
if( lTemp < lMaxDist && lTemp < lDist) if( lTemp < lMaxDist)
{ {
lFound=j; lFound=j;
j = MAXSPRITES; j = MAXSPRITES;
@ -5584,29 +5569,6 @@ good:
break; break;
} }
case CON_FINDPLAYER:
case CON_FINDOTHERPLAYER:
{
// syntax findnearactorvar <type> <maxdistvar> <getvar>
// gets the sprite ID of the nearest actor within max dist
// that is of <type> into <getvar>
// -1 for none found
// <type> <maxdistvarid> <varid>
short j=0;
long var1, d;
insptr++;
var1 = *insptr++;
if (tw == CON_FINDPLAYER) j=findplayer(&sprite[g_i],&d);
else if (tw == CON_FINDOTHERPLAYER) j=findotherplayer(g_i,&d);
SetGameVarID(g_iReturnVarID, j, g_i, g_p);
SetGameVarID(var1, d, g_i, g_p);
break;
}
case CON_FINDNEARACTORZVAR: case CON_FINDNEARACTORZVAR:
case CON_FINDNEARSPRITEZVAR: case CON_FINDNEARSPRITEZVAR:
{ {
@ -5615,18 +5577,16 @@ good:
// that is of <type> into <getvar> // that is of <type> into <getvar>
// -1 for none found // -1 for none found
// <type> <maxdistvarid> <varid> // <type> <maxdistvarid> <varid>
long lType, lMaxDistVar, lMaxZDistVar, lMaxDist, lMaxZDist; long lType, lMaxDist, lMaxZDist;
long lVarID, lTemp, lTemp2, lFound; long lVarID, lTemp, lTemp2, lFound;
short j, k; short j, k;
insptr++; insptr++;
lType=*insptr++; lType=*insptr++;
lMaxDistVar=*insptr++; lMaxDist=GetGameVarID(*insptr++, g_i, g_p);
lMaxZDistVar=*insptr++; lMaxZDist=GetGameVarID(*insptr++, g_i, g_p);
lVarID=*insptr++; lVarID=*insptr++;
lMaxDist=GetGameVarID(lMaxDistVar, g_i, g_p);
lMaxZDist=GetGameVarID(lMaxZDistVar, g_i, g_p);
lFound=-1; lFound=-1;
for (k=0;k<MAXSTATUS;k++) for (k=0;k<MAXSTATUS;k++)
@ -5707,6 +5667,29 @@ good:
break; break;
} }
case CON_FINDPLAYER:
case CON_FINDOTHERPLAYER:
{
// syntax findnearactorvar <type> <maxdistvar> <getvar>
// gets the sprite ID of the nearest actor within max dist
// that is of <type> into <getvar>
// -1 for none found
// <type> <maxdistvarid> <varid>
short j=0;
long var1, d;
insptr++;
var1 = *insptr++;
if (tw == CON_FINDPLAYER) j=findplayer(&sprite[g_i],&d);
else if (tw == CON_FINDOTHERPLAYER) j=findotherplayer(g_i,&d);
SetGameVarID(g_iReturnVarID, j, g_i, g_p);
SetGameVarID(var1, d, g_i, g_p);
break;
}
case CON_SETPLAYER: case CON_SETPLAYER:
case CON_GETPLAYER: case CON_GETPLAYER:
{ {

View file

@ -2100,7 +2100,7 @@ cheat_for_port_credits:
{ {
int io, ii, yy, d=c+160+40, enabled; int io, ii, yy, d=c+160+40, enabled;
char *opts[] = { char *opts[] = {
"Aspect ratio correction", "Widescreen",
"-", "-",
"Hightile textures", "Hightile textures",
"Precache textures", "Precache textures",
@ -2131,7 +2131,7 @@ cheat_for_port_credits:
io++; io++;
} }
onbar = (probey == 0); onbar = 0;
x = probesm(c,yy+5,0,io); x = probesm(c,yy+5,0,io);
if (x == -1) { cmenu(203); probey = 7; break; } if (x == -1) { cmenu(203); probey = 7; break; }
@ -2144,9 +2144,9 @@ cheat_for_port_credits:
} }
enabled = 1; enabled = 1;
switch (io) { switch (io) {
case 0: case 0: if (x==io) glratiocorrection = 1-glratiocorrection;
barsm(d+8,yy+7, (short *)&glratiocorrection,8,x==io,MENUHIGHLIGHT(io),PHX(-5)); modval(0,1,(int *)&glratiocorrection,1,probey==io);
break; gametextpal(d,yy, glratiocorrection ? "Off" : "On", MENUHIGHLIGHT(io), 0); break;
case 1: if (x==io) usehightile = 1-usehightile; case 1: if (x==io) usehightile = 1-usehightile;
modval(0,1,(int *)&usehightile,1,probey==io); modval(0,1,(int *)&usehightile,1,probey==io);
gametextpal(d,yy, usehightile ? "On" : "Off", MENUHIGHLIGHT(io), 0); break; gametextpal(d,yy, usehightile ? "On" : "Off", MENUHIGHLIGHT(io), 0); break;

View file

@ -454,9 +454,10 @@ struct cvarmappings {
{ "cl_smoothinput", "cl_smoothinput: enable/disable input smoothing\n", (void*)&SmoothInput, CVAR_BOOL, 0, 0, 1 }, { "cl_smoothinput", "cl_smoothinput: enable/disable input smoothing\n", (void*)&SmoothInput, CVAR_BOOL, 0, 0, 1 },
{ "cl_weaponswitch", "cl_weaponswitch: enable/disable auto weapon switching", (void*)&ud.weaponswitch, CVAR_INT|256, 0, 0, 3 }, { "cl_weaponswitch", "cl_weaponswitch: enable/disable auto weapon switching", (void*)&ud.weaponswitch, CVAR_INT|256, 0, 0, 3 },
#if defined(POLYMOST) && defined(USE_OPENGL)
{ "r_arcorrection", "r_arcorrection: sets amount of aspect ratio correction", (void*)&glratiocorrection, CVAR_INT, 0, 0, 63 }, { "r_anamorphic", "r_anamorphic: enable/disable widescreen mode", (void*)&glratiocorrection, CVAR_BOOL, 0, 0, 1 },
{ "r_hudcorrect", "r_hudcorrect: enable/disable correct HUD weapon rendering", (void*)&glhudcorrect, CVAR_BOOL, 0, 0, 1 }, { "r_hudcorrect", "r_hudcorrect: enable/disable correct HUD weapon rendering", (void*)&glhudcorrect, CVAR_BOOL, 0, 0, 1 },
#endif
{ "r_precache", "r_precache: enable/disable the pre-level caching routine", (void*)&useprecache, CVAR_BOOL, 0, 0, 1 } { "r_precache", "r_precache: enable/disable the pre-level caching routine", (void*)&useprecache, CVAR_BOOL, 0, 0, 1 }
}; };