Allow disabling of the HOM correction hack

git-svn-id: https://svn.eduke32.com/eduke32@204 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
terminx 2006-07-02 21:25:33 +00:00
parent 8b8cb97b77
commit 450047627a
4 changed files with 9 additions and 4 deletions

View file

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

View file

@ -126,6 +126,7 @@ long gltexmiplevel = 0; // discards this many mipmap levels
static long lastglpolygonmode = 0; //FUK
long glpolygonmode = 0; // 0:GL_FILL,1:GL_LINE,2:GL_POINT //FUK
long glwidescreen = 0;
long glprojectionhacks = 1;
long glhudcorrect = 0;
static GLuint polymosttext = 0;
extern char nofog;
@ -592,15 +593,15 @@ void resizeglcheck ()
glox1 = windowx1; gloy1 = windowy1;
glox2 = windowx2; gloy2 = windowy2;
fovcorrect = glwidescreen?0:(((windowx2-windowx1+1) * 1.2) - (windowx2-windowx1+1));
fovcorrect = glprojectionhacks?(glwidescreen?0:(((windowx2-windowx1+1) * 1.2) - (windowx2-windowx1+1))):0;
bglViewport(windowx1 - (fovcorrect / 2), yres-(windowy2+1),windowx2-windowx1+1 + fovcorrect, windowy2-windowy1+1);
bglMatrixMode(GL_PROJECTION);
memset(m,0,sizeof(m));
m[0][0] = (float)ydimen / 1.2; m[0][2] = 1.0;
m[0][0] = (float)ydimen / (glprojectionhacks?1.2:1); 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 / 1.2;
m[2][2] = 1.0; m[2][3] = (float)ydimen / (glprojectionhacks?1.2:1);
m[3][2] =-1.0;
bglLoadMatrixf(&m[0][0]);
//bglLoadIdentity();

View file

@ -617,6 +617,7 @@ int32 CONFIG_ReadSetup( void )
SCRIPT_GetNumber( scripthandle, "Screen Setup", "GLTextureMode", &gltexfiltermode);
SCRIPT_GetNumber( scripthandle, "Screen Setup", "GLAnisotropy", &glanisotropy);
SCRIPT_GetNumber( scripthandle, "Screen Setup", "GLHUDCorrect", &glhudcorrect);
SCRIPT_GetNumber( scripthandle, "Screen Setup", "GLProjectionFix", &glprojectionhacks);
SCRIPT_GetNumber( scripthandle, "Screen Setup", "GLUseTextureCompr", &glusetexcompr);
SCRIPT_GetNumber( scripthandle, "Screen Setup", "GLWidescreen", &glwidescreen);
@ -762,6 +763,7 @@ void CONFIG_WriteSetup( void )
#if defined(POLYMOST) && defined(USE_OPENGL)
SCRIPT_PutNumber( scripthandle, "Screen Setup", "GLAnisotropy",glanisotropy,false,false);
SCRIPT_PutNumber( scripthandle, "Screen Setup", "GLHUDCorrect",glhudcorrect,false,false);
SCRIPT_PutNumber( scripthandle, "Screen Setup", "GLProjectionFix",glprojectionhacks,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", "GLUseTextureCacheCompression", glusetexcachecompression,false,false);

View file

@ -469,6 +469,7 @@ struct cvarmappings {
#if defined(POLYMOST) && defined(USE_OPENGL)
{ "r_anamorphic", "r_anamorphic: enable/disable widescreen mode", (void*)&glwidescreen, CVAR_BOOL, 0, 0, 1 },
{ "r_hudcorrect", "r_hudcorrect: enable/disable correct HUD weapon rendering", (void*)&glhudcorrect, CVAR_BOOL, 0, 0, 1 },
{ "r_projectionhack", "r_projectionhack: enable/disable projection hack", (void*)&glprojectionhacks, CVAR_BOOL, 0, 0, 1 },
#endif
{ "r_precache", "r_precache: enable/disable the pre-level caching routine", (void*)&useprecache, CVAR_BOOL, 0, 0, 1 }
};