From 74946100f1d66f6dfe4188a17a601d7e03ec7887 Mon Sep 17 00:00:00 2001 From: mittorn Date: Fri, 20 Oct 2023 22:48:35 +0300 Subject: [PATCH] ref_gl: fix not restoring static lightmap after decals --- ref/gl/gl_rsurf.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/ref/gl/gl_rsurf.c b/ref/gl/gl_rsurf.c index 3344580c..55182b5a 100644 --- a/ref/gl/gl_rsurf.c +++ b/ref/gl/gl_rsurf.c @@ -2284,7 +2284,7 @@ void R_SetupVBOArrayStatic( vboarray_t *vbo, qboolean drawlightmap, qboolean dra pglEnableClientState( GL_VERTEX_ARRAY ); pglVertexPointer( 3, GL_FLOAT, sizeof( vbovertex_t ), (void*)offsetof(vbovertex_t,pos) ); } - vboarray.astate = VBO_ARRAY_STATIC; + // setup multitexture if( drawtextures && vboarray.tstate != VBO_TEXTURE_MAIN ) @@ -2297,7 +2297,7 @@ void R_SetupVBOArrayStatic( vboarray_t *vbo, qboolean drawlightmap, qboolean dra vboarray.tstate = VBO_TEXTURE_MAIN; } - if( drawlightmap && vboarray.lstate != VBO_LIGHTMAP_STATIC ) + if( drawlightmap && (vboarray.lstate != VBO_LIGHTMAP_STATIC || vboarray.astate == VBO_ARRAY_DECAL ) ) { // set lightmap texenv if( mtst.lm ) @@ -2309,6 +2309,7 @@ void R_SetupVBOArrayStatic( vboarray_t *vbo, qboolean drawlightmap, qboolean dra R_SetLightmap(); vboarray.lstate = VBO_LIGHTMAP_STATIC; } + vboarray.astate = VBO_ARRAY_STATIC; R_SetDecalMode( false ); } }