summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/refresh/gl/gl.h2
-rw-r--r--src/refresh/gl/main.c2
-rw-r--r--src/refresh/gl/tess.c7
-rw-r--r--src/refresh/gl/world.c5
4 files changed, 13 insertions, 3 deletions
diff --git a/src/refresh/gl/gl.h b/src/refresh/gl/gl.h
index c775266..bd7fe77 100644
--- a/src/refresh/gl/gl.h
+++ b/src/refresh/gl/gl.h
@@ -99,6 +99,8 @@ extern glStatic_t gl_static;
extern glConfig_t gl_config;
extern glRefdef_t glr;
+extern entity_t gl_world;
+
typedef struct {
int nodesVisible;
int nodesDrawn;
diff --git a/src/refresh/gl/main.c b/src/refresh/gl/main.c
index b41e038..2d02de5 100644
--- a/src/refresh/gl/main.c
+++ b/src/refresh/gl/main.c
@@ -28,6 +28,8 @@ glStatic_t gl_static;
glConfig_t gl_config;
statCounters_t c;
+entity_t gl_world;
+
refcfg_t r_config;
int registration_sequence;
diff --git a/src/refresh/gl/tess.c b/src/refresh/gl/tess.c
index deb339f..3a671a3 100644
--- a/src/refresh/gl/tess.c
+++ b/src/refresh/gl/tess.c
@@ -397,13 +397,12 @@ static int GL_CopyVerts(mface_t *surf)
static int GL_TextureAnimation(mtexinfo_t *tex)
{
- int frame, c;
+ int c;
if (!tex->next)
return tex->image->texnum;
- frame = (int)(glr.fd.time * 2);
- c = frame % tex->numframes;
+ c = glr.ent->frame % tex->numframes;
while (c) {
tex = tex->next;
c--;
@@ -503,6 +502,8 @@ void GL_DrawSolidFaces(void)
void GL_DrawAlphaFaces(void)
{
+ glr.ent = &gl_world;
+
GL_BindArrays();
GL_Bits(GLS_BLEND_BLEND | GLS_DEPTHMASK_FALSE);
diff --git a/src/refresh/gl/world.c b/src/refresh/gl/world.c
index f8e7d70..8c0a1b4 100644
--- a/src/refresh/gl/world.c
+++ b/src/refresh/gl/world.c
@@ -544,6 +544,11 @@ static void GL_WorldNode_r(mnode_t *node, int clipflags)
void GL_DrawWorld(void)
{
+ // auto cycle the world frame for texture animation
+ gl_world.frame = (int)(glr.fd.time * 2);
+
+ glr.ent = &gl_world;
+
GL_MarkLeaves();
#if USE_DLIGHTS