From 42c8a2cafa1fe230ab71dce09fafe14e68224fea Mon Sep 17 00:00:00 2001 From: cholleme <> Date: Sun, 2 Nov 2003 19:50:44 +0000 Subject: [PATCH] Added time variable from cl.time to realtime to support shaders when no game is running (menus) --- gl_bumparb.c | 4 ++-- gl_bumpgf.c | 10 +++++----- gl_bumpnv3x.c | 4 ++-- gl_bumpparhelia.c | 4 ++-- gl_bumpradeon.c | 4 ++-- 5 files changed, 13 insertions(+), 13 deletions(-) diff --git a/gl_bumparb.c b/gl_bumparb.c index 93ce25c..79f35d9 100644 --- a/gl_bumparb.c +++ b/gl_bumparb.c @@ -937,11 +937,11 @@ void ARB_SetupTcMod(tcmod_t *tc) { case TCMOD_ROTATE: glTranslatef(0.5,0.5,0.0); - glRotatef(cl.time * tc->params[0],0,0,1); + glRotatef(realtime * tc->params[0],0,0,1); glTranslatef(-0.5, -0.5, 0.0); break; case TCMOD_SCROLL: - glTranslatef(cl.time * tc->params[0], cl.time * tc->params[1], 0.0); + glTranslatef(realtime * tc->params[0], realtime * tc->params[1], 0.0); break; case TCMOD_SCALE: glScalef(tc->params[0],tc->params[1],1.0); diff --git a/gl_bumpgf.c b/gl_bumpgf.c index 9eb9f7b..45d3550 100644 --- a/gl_bumpgf.c +++ b/gl_bumpgf.c @@ -75,7 +75,7 @@ void GL_EnableDiffuseShaderGF3(const transform_t *tr, const lightobject_t *lo, i glPushMatrix(); glLoadIdentity(); if (currentshadowlight->shader->numstages) { - if (currentshadowlight->shader->stages[stageIndex].texture[0]->type == GL_TEXTURE_CUBE_MAP_ARB) { + if (currentshadowlight->shader->stages[stageIndex].texture[0]->gltype == GL_TEXTURE_CUBE_MAP_ARB) { glEnable(GL_TEXTURE_CUBE_MAP_ARB); glBindTexture(GL_TEXTURE_CUBE_MAP_ARB, currentshadowlight->shader->stages[stageIndex].texture[0]->texnum); } else { @@ -199,7 +199,7 @@ void GL_DisableDiffuseShaderGF3(int stageIndex) { GL_SelectTexture(GL_TEXTURE3_ARB); if (currentshadowlight->shader->numstages) { - if (currentshadowlight->shader->stages[stageIndex].texture[0]->type == GL_TEXTURE_CUBE_MAP_ARB) + if (currentshadowlight->shader->stages[stageIndex].texture[0]->gltype == GL_TEXTURE_CUBE_MAP_ARB) glDisable(GL_TEXTURE_CUBE_MAP_ARB); else glDisable(GL_TEXTURE_2D); @@ -240,7 +240,7 @@ void GL_EnableSpecularShaderGF3(const transform_t *tr, const lightobject_t *lo, glPushMatrix(); glLoadIdentity(); if (currentshadowlight->shader->numstages) { - if (currentshadowlight->shader->stages[stageIndex].texture[0]->type == GL_TEXTURE_CUBE_MAP_ARB) { + if (currentshadowlight->shader->stages[stageIndex].texture[0]->gltype == GL_TEXTURE_CUBE_MAP_ARB) { glEnable(GL_TEXTURE_CUBE_MAP_ARB); glBindTexture(GL_TEXTURE_CUBE_MAP_ARB, currentshadowlight->shader->stages[stageIndex].texture[0]->texnum); } else { @@ -453,11 +453,11 @@ void GF3_SetupTcMod(tcmod_t *tc) { switch (tc->type) { case TCMOD_ROTATE: glTranslatef(0.5,0.5,0.0); - glRotatef(cl.time * tc->params[0],0,0,1); + glRotatef(realtime * tc->params[0],0,0,1); glTranslatef(-0.5, -0.5, 0.0); break; case TCMOD_SCROLL: - glTranslatef(cl.time * tc->params[0], cl.time * tc->params[1], 0.0); + glTranslatef(realtime * tc->params[0], realtime * tc->params[1], 0.0); break; case TCMOD_SCALE: glScalef(tc->params[0],tc->params[1],1.0); diff --git a/gl_bumpnv3x.c b/gl_bumpnv3x.c index e821468..5943ed8 100644 --- a/gl_bumpnv3x.c +++ b/gl_bumpnv3x.c @@ -570,11 +570,11 @@ void NV3x_SetupTcMod(tcmod_t *tc) { case TCMOD_ROTATE: glTranslatef(0.5,0.5,0.0); - glRotatef(cl.time * tc->params[0],0,0,1); + glRotatef(realtime * tc->params[0],0,0,1); glTranslatef(-0.5, -0.5, 0.0); break; case TCMOD_SCROLL: - glTranslatef(cl.time * tc->params[0], cl.time * tc->params[1], 0.0); + glTranslatef(realtime * tc->params[0], realtime * tc->params[1], 0.0); break; case TCMOD_SCALE: glScalef(tc->params[0],tc->params[1],1.0); diff --git a/gl_bumpparhelia.c b/gl_bumpparhelia.c index e092cb5..154af61 100644 --- a/gl_bumpparhelia.c +++ b/gl_bumpparhelia.c @@ -1105,11 +1105,11 @@ void Parhelia_SetupTcMod(tcmod_t *tc) { case TCMOD_ROTATE: glTranslatef(0.5,0.5,0.0); - glRotatef(cl.time * tc->params[0],0,0,1); + glRotatef(realtime * tc->params[0],0,0,1); glTranslatef(-0.5, -0.5, 0.0); break; case TCMOD_SCROLL: - glTranslatef(cl.time * tc->params[0], cl.time * tc->params[1], 0.0); + glTranslatef(realtime * tc->params[0], realtime * tc->params[1], 0.0); break; case TCMOD_SCALE: glScalef(tc->params[0],tc->params[1],1.0); diff --git a/gl_bumpradeon.c b/gl_bumpradeon.c index b8aacaf..eb1e75d 100644 --- a/gl_bumpradeon.c +++ b/gl_bumpradeon.c @@ -978,11 +978,11 @@ void Radeon_SetupTcMod(tcmod_t *tc) { case TCMOD_ROTATE: glTranslatef(0.5,0.5,0.0); - glRotatef(cl.time * tc->params[0],0,0,1); + glRotatef(realtime * tc->params[0],0,0,1); glTranslatef(-0.5, -0.5, 0.0); break; case TCMOD_SCROLL: - glTranslatef(cl.time * tc->params[0], cl.time * tc->params[1], 0.0); + glTranslatef(realtime * tc->params[0], realtime * tc->params[1], 0.0); break; case TCMOD_SCALE: glScalef(tc->params[0],tc->params[1],1.0);