mirror of
https://git.do.srb2.org/KartKrew/Kart-Public.git
synced 2025-01-28 04:00:41 +00:00
The player should be able to toggle shaders
This commit is contained in:
parent
fa7f627c88
commit
4ea1dd3525
11 changed files with 61 additions and 101 deletions
|
@ -140,7 +140,7 @@ enum EPolyFlags
|
||||||
PF_Modulated = 0x00001000, // Modulation (multiply output with constant ARGB)
|
PF_Modulated = 0x00001000, // Modulation (multiply output with constant ARGB)
|
||||||
// When set, pass the color constant into the FSurfaceInfo -> FlatColor
|
// When set, pass the color constant into the FSurfaceInfo -> FlatColor
|
||||||
PF_NoTexture = 0x00002000, // Use the small white texture
|
PF_NoTexture = 0x00002000, // Use the small white texture
|
||||||
PF_Ripple = 0x00004000, // jimita: water shader effect
|
PF_Ripple = 0x00004000, // Water shader effect
|
||||||
// 0x00008000
|
// 0x00008000
|
||||||
PF_RemoveYWrap = 0x00010000, // Force clamp texture on Y
|
PF_RemoveYWrap = 0x00010000, // Force clamp texture on Y
|
||||||
PF_ForceWrapX = 0x00020000, // Force repeat texture on X
|
PF_ForceWrapX = 0x00020000, // Force repeat texture on X
|
||||||
|
@ -181,6 +181,8 @@ typedef struct FSurfaceInfo FSurfaceInfo;
|
||||||
|
|
||||||
enum hwdsetspecialstate
|
enum hwdsetspecialstate
|
||||||
{
|
{
|
||||||
|
HWD_SET_SHADERS,
|
||||||
|
|
||||||
HWD_SET_FOG_MODE,
|
HWD_SET_FOG_MODE,
|
||||||
HWD_SET_FOG_DENSITY,
|
HWD_SET_FOG_DENSITY,
|
||||||
|
|
||||||
|
|
|
@ -188,6 +188,11 @@ void HWR_NoColormapLighting(FSurfaceInfo *Surface, INT32 light_level, UINT32 mix
|
||||||
|
|
||||||
// You see the problem is that darker light isn't actually as dark as it SHOULD be.
|
// You see the problem is that darker light isn't actually as dark as it SHOULD be.
|
||||||
lightmix = 255 - ((255 - light_level)*100/96);
|
lightmix = 255 - ((255 - light_level)*100/96);
|
||||||
|
// fml
|
||||||
|
if (lightmix < 0)
|
||||||
|
lightmix = 0;
|
||||||
|
if (lightmix > 255)
|
||||||
|
lightmix = 255;
|
||||||
|
|
||||||
mix_color.rgba = mixcolor;
|
mix_color.rgba = mixcolor;
|
||||||
fog_color.rgba = fadecolor;
|
fog_color.rgba = fadecolor;
|
||||||
|
@ -465,9 +470,11 @@ static void HWR_RenderPlane(sector_t *sector, extrasubsector_t *xsub, boolean is
|
||||||
else
|
else
|
||||||
PolyFlags |= PF_Masked|PF_Modulated;
|
PolyFlags |= PF_Masked|PF_Modulated;
|
||||||
|
|
||||||
HWD.pfnSetShader(1); // jimita: floor shader
|
|
||||||
if (PolyFlags & PF_Ripple)
|
if (PolyFlags & PF_Ripple)
|
||||||
HWD.pfnSetShader(5); // jimita: water shader
|
HWD.pfnSetShader(5); // water shader
|
||||||
|
else
|
||||||
|
HWD.pfnSetShader(1); // floor shader
|
||||||
|
|
||||||
HWD.pfnDrawPolygon(&Surf, planeVerts, nrPlaneVerts, PolyFlags);
|
HWD.pfnDrawPolygon(&Surf, planeVerts, nrPlaneVerts, PolyFlags);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -538,7 +545,7 @@ static void HWR_DrawSegsSplats(FSurfaceInfo * pSurf)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
HWD.pfnSetShader(2); // jimita: wall shader
|
HWD.pfnSetShader(2); // wall shader
|
||||||
HWD.pfnDrawPolygon(&pSurf, wallVerts, 4, i|PF_Modulated|PF_Decal);
|
HWD.pfnDrawPolygon(&pSurf, wallVerts, 4, i|PF_Modulated|PF_Decal);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -591,7 +598,7 @@ static void HWR_ProjectWall(FOutVector * wallVerts,
|
||||||
else
|
else
|
||||||
HWR_NoColormapLighting(pSurf, lightlevel, GL_NORMALFOG, GL_FADEFOG);
|
HWR_NoColormapLighting(pSurf, lightlevel, GL_NORMALFOG, GL_FADEFOG);
|
||||||
|
|
||||||
HWD.pfnSetShader(2); // jimita: wall shader
|
HWD.pfnSetShader(2); // wall shader
|
||||||
HWD.pfnDrawPolygon(pSurf, wallVerts, 4, blendmode|PF_Modulated|PF_Occlude);
|
HWD.pfnDrawPolygon(pSurf, wallVerts, 4, blendmode|PF_Modulated|PF_Occlude);
|
||||||
|
|
||||||
#ifdef WALLSPLATS
|
#ifdef WALLSPLATS
|
||||||
|
@ -2283,7 +2290,7 @@ static void HWR_RenderPolyObjectPlane(polyobj_t *polysector, boolean isceiling,
|
||||||
else
|
else
|
||||||
blendmode |= PF_Masked|PF_Modulated;
|
blendmode |= PF_Masked|PF_Modulated;
|
||||||
|
|
||||||
HWD.pfnSetShader(1); // jimita: floor shader
|
HWD.pfnSetShader(1); // floor shader
|
||||||
HWD.pfnDrawPolygon(&Surf, planeVerts, nrPlaneVerts, blendmode);
|
HWD.pfnDrawPolygon(&Surf, planeVerts, nrPlaneVerts, blendmode);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2980,7 +2987,7 @@ static void HWR_DrawSpriteShadow(gr_vissprite_t *spr, GLPatch_t *gpatch, float t
|
||||||
if (sSurf.PolyColor.s.alpha > floorheight/4)
|
if (sSurf.PolyColor.s.alpha > floorheight/4)
|
||||||
{
|
{
|
||||||
sSurf.PolyColor.s.alpha = (UINT8)(sSurf.PolyColor.s.alpha - floorheight/4);
|
sSurf.PolyColor.s.alpha = (UINT8)(sSurf.PolyColor.s.alpha - floorheight/4);
|
||||||
HWD.pfnSetShader(1); // jimita: floor shader
|
HWD.pfnSetShader(1); // floor shader
|
||||||
HWD.pfnDrawPolygon(&sSurf, swallVerts, 4, PF_Translucent|PF_Modulated);
|
HWD.pfnDrawPolygon(&sSurf, swallVerts, 4, PF_Translucent|PF_Modulated);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -3235,7 +3242,7 @@ static void HWR_SplitSprite(gr_vissprite_t *spr)
|
||||||
|
|
||||||
Surf.PolyColor.s.alpha = alpha;
|
Surf.PolyColor.s.alpha = alpha;
|
||||||
|
|
||||||
HWD.pfnSetShader(3); // jimita: sprite shader
|
HWD.pfnSetShader(3); // sprite shader
|
||||||
HWD.pfnDrawPolygon(&Surf, wallVerts, 4, blend|PF_Modulated);
|
HWD.pfnDrawPolygon(&Surf, wallVerts, 4, blend|PF_Modulated);
|
||||||
|
|
||||||
top = bot;
|
top = bot;
|
||||||
|
@ -3278,7 +3285,7 @@ static void HWR_SplitSprite(gr_vissprite_t *spr)
|
||||||
|
|
||||||
Surf.PolyColor.s.alpha = alpha;
|
Surf.PolyColor.s.alpha = alpha;
|
||||||
|
|
||||||
HWD.pfnSetShader(3); // jimita: sprite shader
|
HWD.pfnSetShader(3); // sprite shader
|
||||||
HWD.pfnDrawPolygon(&Surf, wallVerts, 4, blend|PF_Modulated);
|
HWD.pfnDrawPolygon(&Surf, wallVerts, 4, blend|PF_Modulated);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3429,7 +3436,7 @@ static void HWR_DrawSprite(gr_vissprite_t *spr)
|
||||||
blend = PF_Translucent|PF_Occlude;
|
blend = PF_Translucent|PF_Occlude;
|
||||||
}
|
}
|
||||||
|
|
||||||
HWD.pfnSetShader(3); // jimita: sprite shader
|
HWD.pfnSetShader(3); // sprite shader
|
||||||
HWD.pfnDrawPolygon(&Surf, wallVerts, 4, blend|PF_Modulated);
|
HWD.pfnDrawPolygon(&Surf, wallVerts, 4, blend|PF_Modulated);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -3528,7 +3535,7 @@ static inline void HWR_DrawPrecipitationSprite(gr_vissprite_t *spr)
|
||||||
blend = PF_Translucent|PF_Occlude;
|
blend = PF_Translucent|PF_Occlude;
|
||||||
}
|
}
|
||||||
|
|
||||||
HWD.pfnSetShader(3); // jimita: sprite shader
|
HWD.pfnSetShader(3); // sprite shader
|
||||||
HWD.pfnDrawPolygon(&Surf, wallVerts, 4, blend|PF_Modulated);
|
HWD.pfnDrawPolygon(&Surf, wallVerts, 4, blend|PF_Modulated);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3900,7 +3907,7 @@ static void HWR_RenderDrawNodes(void)
|
||||||
} // loop++
|
} // loop++
|
||||||
|
|
||||||
HWD.pfnSetTransform(&atransform);
|
HWD.pfnSetTransform(&atransform);
|
||||||
HWD.pfnSetShader(0); // jimita
|
HWD.pfnSetShader(0);
|
||||||
// Okay! Let's draw it all! Woo!
|
// Okay! Let's draw it all! Woo!
|
||||||
for (i = 0; i < p; i++)
|
for (i = 0; i < p; i++)
|
||||||
{
|
{
|
||||||
|
@ -4435,9 +4442,9 @@ static void HWR_DrawSkyBackground(void)
|
||||||
v[0].t = v[1].t -= ((float) angle / angleturn);
|
v[0].t = v[1].t -= ((float) angle / angleturn);
|
||||||
}
|
}
|
||||||
|
|
||||||
HWD.pfnSetShader(6); // jimita: sky shader
|
HWD.pfnSetShader(6); // sky shader
|
||||||
HWD.pfnDrawPolygon(NULL, v, 4, 0);
|
HWD.pfnDrawPolygon(NULL, v, 4, 0);
|
||||||
HWD.pfnSetShader(0); // jimita
|
HWD.pfnSetShader(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -4566,6 +4573,9 @@ static void HWR_RenderFrame(INT32 viewnumber, player_t *player, boolean skybox)
|
||||||
HWD.pfnSetTransform(&atransform);
|
HWD.pfnSetTransform(&atransform);
|
||||||
HWD.pfnSetShader(0);
|
HWD.pfnSetShader(0);
|
||||||
|
|
||||||
|
// Check for shaders
|
||||||
|
HWD.pfnSetSpecialState(HWD_SET_SHADERS, cv_grshaders.value);
|
||||||
|
|
||||||
// Check for fog (shader)
|
// Check for fog (shader)
|
||||||
if (cv_grfog.value)
|
if (cv_grfog.value)
|
||||||
HWR_FoggingOn(); // First of all, turn it on, set the default user settings too
|
HWR_FoggingOn(); // First of all, turn it on, set the default user settings too
|
||||||
|
@ -4754,7 +4764,7 @@ static void HWR_RenderWall(FOutVector *wallVerts, FSurfaceInfo *pSurf, FBITFIE
|
||||||
|
|
||||||
pSurf->PolyColor.s.alpha = alpha; // put the alpha back after lighting
|
pSurf->PolyColor.s.alpha = alpha; // put the alpha back after lighting
|
||||||
|
|
||||||
HWD.pfnSetShader(2); // jimita: wall shader
|
HWD.pfnSetShader(2); // wall shader
|
||||||
if (blend & PF_Environment)
|
if (blend & PF_Environment)
|
||||||
HWD.pfnDrawPolygon(pSurf, wallVerts, 4, blend|PF_Modulated|PF_Occlude); // PF_Occlude must be used for solid objects
|
HWD.pfnDrawPolygon(pSurf, wallVerts, 4, blend|PF_Modulated|PF_Occlude); // PF_Occlude must be used for solid objects
|
||||||
else
|
else
|
||||||
|
|
|
@ -67,6 +67,7 @@ void HWR_NoColormapLighting(FSurfaceInfo *Surface, INT32 light_level, UINT32 mix
|
||||||
|
|
||||||
extern CV_PossibleValue_t granisotropicmode_cons_t[];
|
extern CV_PossibleValue_t granisotropicmode_cons_t[];
|
||||||
|
|
||||||
|
extern consvar_t cv_grshaders;
|
||||||
extern consvar_t cv_grfov;
|
extern consvar_t cv_grfov;
|
||||||
extern consvar_t cv_grmd2;
|
extern consvar_t cv_grmd2;
|
||||||
extern consvar_t cv_grfog;
|
extern consvar_t cv_grfog;
|
||||||
|
|
|
@ -1092,7 +1092,7 @@ void HWR_DrawMD2(gr_vissprite_t *spr)
|
||||||
p.mirror = atransform.mirror; // from Kart
|
p.mirror = atransform.mirror; // from Kart
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
HWD.pfnSetShader(4); // jimita: model shader
|
HWD.pfnSetShader(4); // model shader
|
||||||
HWD.pfnDrawModel(md2->model, frame, durs, tics, nextFrame, &p, finalscale, flip, &Surf);
|
HWD.pfnDrawModel(md2->model, frame, durs, tics, nextFrame, &p, finalscale, flip, &Surf);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -492,10 +492,6 @@ boolean SetupGLfunc(void)
|
||||||
static INT32 glstate_fog_mode = 0;
|
static INT32 glstate_fog_mode = 0;
|
||||||
static float glstate_fog_density = 0;
|
static float glstate_fog_density = 0;
|
||||||
|
|
||||||
// glEXT
|
|
||||||
boolean GLEXT_legacy = false;
|
|
||||||
boolean GLEXT_shaders = false;
|
|
||||||
|
|
||||||
// hw_glob.h
|
// hw_glob.h
|
||||||
INT32 gl_leveltime = 0;
|
INT32 gl_leveltime = 0;
|
||||||
|
|
||||||
|
@ -510,6 +506,7 @@ INT32 gl_leveltime = 0;
|
||||||
static GLuint gl_shaders[MAXSHADERS];
|
static GLuint gl_shaders[MAXSHADERS];
|
||||||
static GLint gl_totalshaders = 0;
|
static GLint gl_totalshaders = 0;
|
||||||
|
|
||||||
|
static boolean gl_allowshaders = false;
|
||||||
static boolean gl_shadersenabled = false;
|
static boolean gl_shadersenabled = false;
|
||||||
static GLuint gl_currentshaderprogram = 0;
|
static GLuint gl_currentshaderprogram = 0;
|
||||||
static GLuint gl_shaderprograms[MAXSHADERPROGRAMS];
|
static GLuint gl_shaderprograms[MAXSHADERPROGRAMS];
|
||||||
|
@ -837,12 +834,14 @@ EXPORT void HWRAPI(InitCustomShaders) (void)
|
||||||
EXPORT void HWRAPI(SetShader) (int shader)
|
EXPORT void HWRAPI(SetShader) (int shader)
|
||||||
{
|
{
|
||||||
#ifdef USE_SHADERS
|
#ifdef USE_SHADERS
|
||||||
if (GLEXT_shaders)
|
if (gl_allowshaders)
|
||||||
{
|
{
|
||||||
gl_shadersenabled = true;
|
gl_shadersenabled = true;
|
||||||
gl_currentshaderprogram = shader;
|
gl_currentshaderprogram = shader;
|
||||||
}
|
}
|
||||||
|
else
|
||||||
#endif
|
#endif
|
||||||
|
gl_shadersenabled = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
EXPORT void HWRAPI(UnSetShader) (void)
|
EXPORT void HWRAPI(UnSetShader) (void)
|
||||||
|
@ -945,16 +944,11 @@ void SetModelView(GLint w, GLint h)
|
||||||
pglGetFloatv(GL_PROJECTION_MATRIX, projMatrix);
|
pglGetFloatv(GL_PROJECTION_MATRIX, projMatrix);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// -----------------+
|
// -----------------+
|
||||||
// SetStates : Set permanent states
|
// SetStates : Set permanent states
|
||||||
// -----------------+
|
// -----------------+
|
||||||
void SetStates(void)
|
void SetStates(void)
|
||||||
{
|
{
|
||||||
#ifdef GL_LIGHT_MODEL_AMBIENT
|
|
||||||
GLfloat LightDiffuse[] = {1.0f, 1.0f, 1.0f, 1.0f};
|
|
||||||
#endif
|
|
||||||
|
|
||||||
pglShadeModel(GL_SMOOTH); // iterate vertice colors
|
pglShadeModel(GL_SMOOTH); // iterate vertice colors
|
||||||
|
|
||||||
pglEnable(GL_TEXTURE_2D); // two-dimensional texturing
|
pglEnable(GL_TEXTURE_2D); // two-dimensional texturing
|
||||||
|
@ -980,12 +974,6 @@ void SetStates(void)
|
||||||
|
|
||||||
pglPolygonOffset(-1.0f, -1.0f);
|
pglPolygonOffset(-1.0f, -1.0f);
|
||||||
|
|
||||||
// Lighting for models
|
|
||||||
#ifdef GL_LIGHT_MODEL_AMBIENT
|
|
||||||
pglLightModelfv(GL_LIGHT_MODEL_AMBIENT, LightDiffuse);
|
|
||||||
pglEnable(GL_LIGHT0);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// bp : when no t&l :)
|
// bp : when no t&l :)
|
||||||
pglLoadIdentity();
|
pglLoadIdentity();
|
||||||
pglScalef(1.0f, 1.0f, -1.0f);
|
pglScalef(1.0f, 1.0f, -1.0f);
|
||||||
|
@ -1594,7 +1582,6 @@ EXPORT void HWRAPI(SetTexture) (FTextureInfo *pTexInfo)
|
||||||
}
|
}
|
||||||
|
|
||||||
// jimita
|
// jimita
|
||||||
|
|
||||||
static void load_shaders(FSurfaceInfo *Surface, GLRGBAFloat *mix, GLRGBAFloat *fade)
|
static void load_shaders(FSurfaceInfo *Surface, GLRGBAFloat *mix, GLRGBAFloat *fade)
|
||||||
{
|
{
|
||||||
#ifdef USE_SHADERS
|
#ifdef USE_SHADERS
|
||||||
|
@ -1653,7 +1640,9 @@ static void load_shaders(FSurfaceInfo *Surface, GLRGBAFloat *mix, GLRGBAFloat *f
|
||||||
else
|
else
|
||||||
pglUseProgram(0);
|
pglUseProgram(0);
|
||||||
}
|
}
|
||||||
|
else
|
||||||
#endif
|
#endif
|
||||||
|
pglUseProgram(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
// -----------------+
|
// -----------------+
|
||||||
|
@ -1716,6 +1705,18 @@ EXPORT void HWRAPI(SetSpecialState) (hwdspecialstate_t IdState, INT32 Value)
|
||||||
{
|
{
|
||||||
switch (IdState)
|
switch (IdState)
|
||||||
{
|
{
|
||||||
|
case HWD_SET_SHADERS:
|
||||||
|
switch (Value)
|
||||||
|
{
|
||||||
|
case 1:
|
||||||
|
gl_allowshaders = true;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
gl_allowshaders = false;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
case HWD_SET_FOG_MODE:
|
case HWD_SET_FOG_MODE:
|
||||||
glstate_fog_mode = Value;
|
glstate_fog_mode = Value;
|
||||||
break;
|
break;
|
||||||
|
@ -1975,11 +1976,6 @@ static void DrawModelEx(model_t *model, INT32 frameIndex, INT32 duration, INT32
|
||||||
static GLRGBAFloat mix = {0,0,0,0};
|
static GLRGBAFloat mix = {0,0,0,0};
|
||||||
static GLRGBAFloat fade = {0,0,0,0};
|
static GLRGBAFloat fade = {0,0,0,0};
|
||||||
|
|
||||||
#ifdef GL_LIGHT_MODEL_AMBIENT
|
|
||||||
GLfloat ambient[4];
|
|
||||||
GLfloat diffuse[4];
|
|
||||||
#endif
|
|
||||||
|
|
||||||
float pol = 0.0f;
|
float pol = 0.0f;
|
||||||
float scalex, scaley, scalez;
|
float scalex, scaley, scalez;
|
||||||
|
|
||||||
|
@ -1987,9 +1983,6 @@ static void DrawModelEx(model_t *model, INT32 frameIndex, INT32 duration, INT32
|
||||||
|
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
// Because Otherwise, scaling the screen negatively vertically breaks the lighting
|
|
||||||
GLfloat LightPos[] = {0.0f, 1.0f, 0.0f, 0.0f};
|
|
||||||
|
|
||||||
// Affect input model scaling
|
// Affect input model scaling
|
||||||
scale *= 0.5f;
|
scale *= 0.5f;
|
||||||
scalex = scale;
|
scalex = scale;
|
||||||
|
@ -2014,30 +2007,13 @@ static void DrawModelEx(model_t *model, INT32 frameIndex, INT32 duration, INT32
|
||||||
mix.blue = byte2float[Surface->PolyColor.s.blue];
|
mix.blue = byte2float[Surface->PolyColor.s.blue];
|
||||||
mix.alpha = byte2float[Surface->PolyColor.s.alpha];
|
mix.alpha = byte2float[Surface->PolyColor.s.alpha];
|
||||||
|
|
||||||
#ifdef GL_LIGHT_MODEL_AMBIENT
|
|
||||||
ambient[0] = (mix.red/255.0f);
|
|
||||||
ambient[1] = (mix.green/255.0f);
|
|
||||||
ambient[2] = (mix.blue/255.0f);
|
|
||||||
ambient[3] = (mix.alpha/255.0f);
|
|
||||||
|
|
||||||
diffuse[0] = (mix.red/255.0f);
|
|
||||||
diffuse[1] = (mix.green/255.0f);
|
|
||||||
diffuse[2] = (mix.blue/255.0f);
|
|
||||||
diffuse[3] = (mix.alpha/255.0f);
|
|
||||||
|
|
||||||
if (ambient[0] > 0.75f)
|
|
||||||
ambient[0] = 0.75f;
|
|
||||||
if (ambient[1] > 0.75f)
|
|
||||||
ambient[1] = 0.75f;
|
|
||||||
if (ambient[2] > 0.75f)
|
|
||||||
ambient[2] = 0.75f;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
if (mix.alpha < 1)
|
if (mix.alpha < 1)
|
||||||
SetBlend(PF_Translucent|PF_Modulated);
|
SetBlend(PF_Translucent|PF_Modulated);
|
||||||
else
|
else
|
||||||
SetBlend(PF_Masked|PF_Modulated|PF_Occlude);
|
SetBlend(PF_Masked|PF_Modulated|PF_Occlude);
|
||||||
|
|
||||||
|
pglColor4ubv((GLubyte*)&Surface->PolyColor.s);
|
||||||
|
|
||||||
fade.red = byte2float[Surface->FadeColor.s.red];
|
fade.red = byte2float[Surface->FadeColor.s.red];
|
||||||
fade.green = byte2float[Surface->FadeColor.s.green];
|
fade.green = byte2float[Surface->FadeColor.s.green];
|
||||||
fade.blue = byte2float[Surface->FadeColor.s.blue];
|
fade.blue = byte2float[Surface->FadeColor.s.blue];
|
||||||
|
@ -2069,14 +2045,6 @@ static void DrawModelEx(model_t *model, INT32 frameIndex, INT32 duration, INT32
|
||||||
pglCullFace(GL_BACK);
|
pglCullFace(GL_BACK);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
pglLightfv(GL_LIGHT0, GL_POSITION, LightPos);
|
|
||||||
pglShadeModel(GL_SMOOTH);
|
|
||||||
#ifdef GL_LIGHT_MODEL_AMBIENT
|
|
||||||
pglEnable(GL_LIGHTING);
|
|
||||||
pglMaterialfv(GL_FRONT_AND_BACK, GL_AMBIENT, ambient);
|
|
||||||
pglMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, diffuse);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
pglPushMatrix(); // should be the same as glLoadIdentity
|
pglPushMatrix(); // should be the same as glLoadIdentity
|
||||||
pglTranslatef(pos->x, pos->z, pos->y);
|
pglTranslatef(pos->x, pos->z, pos->y);
|
||||||
if (flipped)
|
if (flipped)
|
||||||
|
@ -2189,10 +2157,6 @@ static void DrawModelEx(model_t *model, INT32 frameIndex, INT32 duration, INT32
|
||||||
pglDisableClientState(GL_NORMAL_ARRAY);
|
pglDisableClientState(GL_NORMAL_ARRAY);
|
||||||
|
|
||||||
pglPopMatrix(); // should be the same as glLoadIdentity
|
pglPopMatrix(); // should be the same as glLoadIdentity
|
||||||
#ifdef GL_LIGHT_MODEL_AMBIENT
|
|
||||||
pglDisable(GL_LIGHTING);
|
|
||||||
#endif
|
|
||||||
pglShadeModel(GL_FLAT);
|
|
||||||
pglDisable(GL_CULL_FACE);
|
pglDisable(GL_CULL_FACE);
|
||||||
pglDisable(GL_NORMALIZE);
|
pglDisable(GL_NORMALIZE);
|
||||||
|
|
||||||
|
|
|
@ -119,10 +119,6 @@ extern GLint screen_height;
|
||||||
extern GLbyte screen_depth;
|
extern GLbyte screen_depth;
|
||||||
extern GLint maximumAnisotropy;
|
extern GLint maximumAnisotropy;
|
||||||
|
|
||||||
// jimita
|
|
||||||
extern boolean GLEXT_legacy;
|
|
||||||
extern boolean GLEXT_shaders;
|
|
||||||
|
|
||||||
/** \brief OpenGL flags for video driver
|
/** \brief OpenGL flags for video driver
|
||||||
*/
|
*/
|
||||||
extern INT32 oglflags;
|
extern INT32 oglflags;
|
||||||
|
|
15
src/m_menu.c
15
src/m_menu.c
|
@ -1206,15 +1206,16 @@ static menuitem_t OP_VideoModeMenu[] =
|
||||||
#ifdef HWRENDER
|
#ifdef HWRENDER
|
||||||
static menuitem_t OP_OpenGLOptionsMenu[] =
|
static menuitem_t OP_OpenGLOptionsMenu[] =
|
||||||
{
|
{
|
||||||
{IT_STRING|IT_CVAR, NULL, "Field of view", &cv_grfov, 10},
|
{IT_STRING|IT_CVAR, NULL, "Shaders", &cv_grshaders, 10},
|
||||||
{IT_STRING|IT_CVAR, NULL, "Quality", &cv_scr_depth, 20},
|
{IT_STRING|IT_CVAR, NULL, "Field of view", &cv_grfov, 20},
|
||||||
{IT_STRING|IT_CVAR, NULL, "Texture Filter", &cv_grfiltermode, 30},
|
{IT_STRING|IT_CVAR, NULL, "Quality", &cv_scr_depth, 30},
|
||||||
{IT_STRING|IT_CVAR, NULL, "Anisotropic", &cv_granisotropicmode,40},
|
{IT_STRING|IT_CVAR, NULL, "Texture Filter", &cv_grfiltermode, 40},
|
||||||
|
{IT_STRING|IT_CVAR, NULL, "Anisotropic", &cv_granisotropicmode,50},
|
||||||
#ifdef _WINDOWS
|
#ifdef _WINDOWS
|
||||||
{IT_STRING|IT_CVAR, NULL, "Fullscreen", &cv_fullscreen, 50},
|
{IT_STRING|IT_CVAR, NULL, "Fullscreen", &cv_fullscreen, 60},
|
||||||
#endif
|
#endif
|
||||||
{IT_SUBMENU|IT_STRING, NULL, "Fog...", &OP_OpenGLFogDef, 80},
|
{IT_SUBMENU|IT_STRING, NULL, "Fog...", &OP_OpenGLFogDef, 90},
|
||||||
{IT_SUBMENU|IT_STRING, NULL, "Gamma...", &OP_OpenGLColorDef, 90},
|
{IT_SUBMENU|IT_STRING, NULL, "Gamma...", &OP_OpenGLColorDef, 100},
|
||||||
};
|
};
|
||||||
|
|
||||||
static menuitem_t OP_OpenGLFogMenu[] =
|
static menuitem_t OP_OpenGLFogMenu[] =
|
||||||
|
|
|
@ -1395,6 +1395,7 @@ void R_RegisterEngineStuff(void)
|
||||||
CV_RegisterVar(&cv_grsoftwarefog);
|
CV_RegisterVar(&cv_grsoftwarefog);
|
||||||
CV_RegisterVar(&cv_grfogdensity);
|
CV_RegisterVar(&cv_grfogdensity);
|
||||||
CV_RegisterVar(&cv_grmd2);
|
CV_RegisterVar(&cv_grmd2);
|
||||||
|
CV_RegisterVar(&cv_grshaders);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef HWRENDER
|
#ifdef HWRENDER
|
||||||
|
|
|
@ -175,14 +175,6 @@ boolean OglSdlSurface(INT32 w, INT32 h)
|
||||||
|
|
||||||
SetupGLFunc4();
|
SetupGLFunc4();
|
||||||
|
|
||||||
// jimita
|
|
||||||
if (isExtAvailable("GL_ARB_compatibility", gl_extensions))
|
|
||||||
GLEXT_legacy = true;
|
|
||||||
|
|
||||||
if (isExtAvailable("GL_ARB_fragment_shader", gl_extensions)
|
|
||||||
&& isExtAvailable("GL_ARB_vertex_shader", gl_extensions))
|
|
||||||
GLEXT_shaders = true;
|
|
||||||
|
|
||||||
granisotropicmode_cons_t[1].value = maximumAnisotropy;
|
granisotropicmode_cons_t[1].value = maximumAnisotropy;
|
||||||
|
|
||||||
SDL_GL_SetSwapInterval(cv_vidwait.value ? 1 : 0);
|
SDL_GL_SetSwapInterval(cv_vidwait.value ? 1 : 0);
|
||||||
|
|
|
@ -605,15 +605,6 @@ static void ST_drawDebugInfo(void)
|
||||||
|
|
||||||
if (cv_debug & DBG_MEMORY)
|
if (cv_debug & DBG_MEMORY)
|
||||||
V_DrawRightAlignedString(320, height, V_MONOSPACE, va("Heap used: %7sKB", sizeu1(Z_TagsUsage(0, INT32_MAX)>>10)));
|
V_DrawRightAlignedString(320, height, V_MONOSPACE, va("Heap used: %7sKB", sizeu1(Z_TagsUsage(0, INT32_MAX)>>10)));
|
||||||
|
|
||||||
// jimita
|
|
||||||
if (cv_debug & DBG_RENDER)
|
|
||||||
{
|
|
||||||
height = 0;
|
|
||||||
#ifdef HWRENDER
|
|
||||||
V_DrawString(0, height, V_MONOSPACE|V_ALLOWLOWERCASE|V_NOSCALESTART, va("glstate_fog: %d", cv_grfog.value ? (cv_grsoftwarefog.value ? 2 : 1) : 0));
|
|
||||||
#endif // HWRENDER
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void ST_drawScore(void)
|
static void ST_drawScore(void)
|
||||||
|
|
|
@ -60,10 +60,11 @@ static void CV_Gammaxxx_ONChange(void);
|
||||||
static CV_PossibleValue_t grgamma_cons_t[] = {{1, "MIN"}, {255, "MAX"}, {0, NULL}};
|
static CV_PossibleValue_t grgamma_cons_t[] = {{1, "MIN"}, {255, "MAX"}, {0, NULL}};
|
||||||
static CV_PossibleValue_t grfogdensity_cons_t[] = {{FRACUNIT/2, "MIN"}, {FRACUNIT*2, "MAX"}, {0, NULL}};
|
static CV_PossibleValue_t grfogdensity_cons_t[] = {{FRACUNIT/2, "MIN"}, {FRACUNIT*2, "MAX"}, {0, NULL}};
|
||||||
|
|
||||||
consvar_t cv_grfovchange = {"gr_fovchange", "Off", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
|
consvar_t cv_grshaders = {"gr_shaders", "On", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||||
consvar_t cv_grfog = {"gr_fog", "On", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
|
consvar_t cv_grfog = {"gr_fog", "On", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||||
consvar_t cv_grsoftwarefog = {"gr_softwarefog", "On", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
|
consvar_t cv_grsoftwarefog = {"gr_softwarefog", "On", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||||
consvar_t cv_grfogdensity = {"gr_fogdensity", "1", CV_SAVE|CV_FLOAT, grfogdensity_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
|
consvar_t cv_grfogdensity = {"gr_fogdensity", "1", CV_SAVE|CV_FLOAT, grfogdensity_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||||
|
consvar_t cv_grfovchange = {"gr_fovchange", "Off", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||||
consvar_t cv_grgammared = {"gr_gammared", "127", CV_SAVE|CV_CALL, grgamma_cons_t,
|
consvar_t cv_grgammared = {"gr_gammared", "127", CV_SAVE|CV_CALL, grgamma_cons_t,
|
||||||
CV_Gammaxxx_ONChange, 0, NULL, NULL, 0, 0, NULL};
|
CV_Gammaxxx_ONChange, 0, NULL, NULL, 0, 0, NULL};
|
||||||
consvar_t cv_grgammagreen = {"gr_gammagreen", "127", CV_SAVE|CV_CALL, grgamma_cons_t,
|
consvar_t cv_grgammagreen = {"gr_gammagreen", "127", CV_SAVE|CV_CALL, grgamma_cons_t,
|
||||||
|
@ -71,6 +72,7 @@ consvar_t cv_grgammagreen = {"gr_gammagreen", "127", CV_SAVE|CV_CALL, grgamma_co
|
||||||
consvar_t cv_grgammablue = {"gr_gammablue", "127", CV_SAVE|CV_CALL, grgamma_cons_t,
|
consvar_t cv_grgammablue = {"gr_gammablue", "127", CV_SAVE|CV_CALL, grgamma_cons_t,
|
||||||
CV_Gammaxxx_ONChange, 0, NULL, NULL, 0, 0, NULL};
|
CV_Gammaxxx_ONChange, 0, NULL, NULL, 0, 0, NULL};
|
||||||
|
|
||||||
|
|
||||||
static CV_PossibleValue_t CV_MD2[] = {{0, "Off"}, {1, "On"}, {2, "Old"}, {0, NULL}};
|
static CV_PossibleValue_t CV_MD2[] = {{0, "Off"}, {1, "On"}, {2, "Old"}, {0, NULL}};
|
||||||
// console variables in development
|
// console variables in development
|
||||||
consvar_t cv_grmd2 = {"gr_md2", "Off", CV_SAVE, CV_MD2, NULL, 0, NULL, NULL, 0, 0, NULL};
|
consvar_t cv_grmd2 = {"gr_md2", "Off", CV_SAVE, CV_MD2, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||||
|
|
Loading…
Reference in a new issue