HUD model correction stuff

git-svn-id: https://svn.eduke32.com/eduke32@174 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
terminx 2006-05-20 20:57:09 +00:00
parent d0c70afa85
commit 544bdae42a
4 changed files with 29 additions and 11 deletions

View file

@ -472,7 +472,7 @@ extern long glusetexcompr;
extern long gltexfiltermode; extern long gltexfiltermode;
extern long glredbluemode; extern long glredbluemode;
extern long glusetexcache, glusetexcachecompression; extern long glusetexcache, glusetexcachecompression;
extern long glmultisample, glnvmultisamplehint, glratiocorrection; extern long glmultisample, glnvmultisamplehint, glratiocorrection, glhudcorrect;
void gltexapplyprops (void); void gltexapplyprops (void);
#endif #endif

View file

@ -125,6 +125,7 @@ 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 = 63;
long glhudcorrect = 0;
static GLuint polymosttext = 0; static GLuint polymosttext = 0;
extern char nofog; extern char nofog;
#endif #endif
@ -4043,10 +4044,12 @@ void polymost_dorotatesprite (long sx, long sy, long z, short a, short picnum,
if ((dastat&10) == 2) if ((dastat&10) == 2)
{ {
// ratioratio = 1.6 / (((float)(windowx2-windowx1+1)) / (windowy2-windowy1)); // computes the ratio between 16/10 and current resolution ratio if(glhudcorrect)
// fovcorrect = (ratioratio > 1) ? (((windowx2-windowx1+1) * ratioratio) - windowx2-windowx1+1) * ((float)glratiocorrection / 63) * 2 : 0; {
// bglViewport(windowx1 - (fovcorrect / 2),yres-(windowy2+1),windowx2-windowx1+1 + fovcorrect,windowy2-windowy1+1); ratioratio = 1.2;
bglViewport(windowx1,yres-(windowy2+1),windowx2-windowx1+1,windowy2-windowy1+1); fovcorrect = ((xdimen*ratioratio)-(xdimen+1)) * 2;
bglViewport(windowx1 - (fovcorrect / 2),yres-(windowy2+1),windowx2-windowx1+1 + fovcorrect,windowy2-windowy1+1);
} else bglViewport(windowx1,yres-(windowy2+1),windowx2-windowx1+1,windowy2-windowy1+1);
} }
else else
{ {
@ -4058,11 +4061,22 @@ void polymost_dorotatesprite (long sx, long sy, long z, short a, short picnum,
memset(m,0,sizeof(m)); memset(m,0,sizeof(m));
if ((dastat&10) == 2) if ((dastat&10) == 2)
{ {
m[0][0] = (float)ydimen/* / ((ratioratio > 1)?1.2:1)*/; m[0][2] = 1.0; if(glhudcorrect)
{
ratioratio = (float)xdimen/ydimen;
m[0][0] = (float)ydimen*(ratioratio >= 1.6?1.2:1); m[0][2] = 1.0;
m[1][1] = (float)xdimen; m[1][2] = 1.0; m[1][1] = (float)xdimen; m[1][2] = 1.0;
m[2][2] = 1.0; m[2][3] = (float)ydimen/* / ((ratioratio > 1)?1.2:1)*/; m[2][2] = 1.0; m[2][3] = (float)ydimen*(ratioratio >= 1.6?1.2:1);
m[3][2] =-1.0; m[3][2] =-1.0;
} }
else
{
m[0][0] = (float)ydimen; m[0][2] = 1.0;
m[1][1] = (float)xdimen; m[1][2] = 1.0;
m[2][2] = 1.0; m[2][3] = (float)ydimen;
m[3][2] =-1.0;
}
}
else { m[0][0] = m[2][3] = 1.0; m[1][1] = ((float)xdim)/((float)ydim); m[2][2] = 1.0001; m[3][2] = 1-m[2][2]; } else { m[0][0] = m[2][3] = 1.0; m[1][1] = ((float)xdim)/((float)ydim); m[2][2] = 1.0001; m[3][2] = 1-m[2][2]; }
bglLoadMatrixf(&m[0][0]); bglLoadMatrixf(&m[0][0]);
bglMatrixMode(GL_MODELVIEW); bglMatrixMode(GL_MODELVIEW);

View file

@ -603,6 +603,7 @@ void CONFIG_ReadSetup( void )
#if defined(POLYMOST) && defined(USE_OPENGL) #if defined(POLYMOST) && defined(USE_OPENGL)
SCRIPT_GetNumber( scripthandle, "Screen Setup", "GLTextureMode", &gltexfiltermode); SCRIPT_GetNumber( scripthandle, "Screen Setup", "GLTextureMode", &gltexfiltermode);
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", "GLUseTextureCompr", &glusetexcompr); SCRIPT_GetNumber( scripthandle, "Screen Setup", "GLUseTextureCompr", &glusetexcompr);
SCRIPT_GetNumber( scripthandle, "Screen Setup", "GLRatioCorrection", &glratiocorrection); SCRIPT_GetNumber( scripthandle, "Screen Setup", "GLRatioCorrection", &glratiocorrection);
@ -743,6 +744,7 @@ void CONFIG_WriteSetup( void )
SCRIPT_PutNumber( scripthandle, "Screen Setup", "Detail",ud.detail,false,false); SCRIPT_PutNumber( scripthandle, "Screen Setup", "Detail",ud.detail,false,false);
#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", "GLRatioCorrection",glratiocorrection,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);

View file

@ -2110,8 +2110,7 @@ cheat_for_port_credits:
"-", "-",
"Models", "Models",
"-", "-",
"-", "HUD model perspective",
"-",
"-", "-",
"-", "-",
"-", "-",
@ -2170,6 +2169,9 @@ cheat_for_port_credits:
case 6: if (x==io) usemodels = 1-usemodels; case 6: if (x==io) usemodels = 1-usemodels;
modval(0,1,(int *)&usemodels,1,probey==io); modval(0,1,(int *)&usemodels,1,probey==io);
gametextpal(d,yy, usemodels ? "On" : "Off", MENUHIGHLIGHT(io), 0); break; gametextpal(d,yy, usemodels ? "On" : "Off", MENUHIGHLIGHT(io), 0); break;
case 7: if (x==io) glhudcorrect = 1-glhudcorrect;
modval(0,1,(int *)&glhudcorrect,1,probey==io);
gametextpal(d,yy, glhudcorrect ? "Correct" : "Old", MENUHIGHLIGHT(io), 0); break;
default: break; default: break;
} }
gametextpal(c,yy, opts[ii], enabled?MENUHIGHLIGHT(io):15, 2); gametextpal(c,yy, opts[ii], enabled?MENUHIGHLIGHT(io):15, 2);