Browse Source

ref_gl: fix not restoring static lightmap after decals

pull/2/head
mittorn 1 year ago committed by Alibek Omarov
parent
commit
74946100f1
  1. 5
      ref/gl/gl_rsurf.c

5
ref/gl/gl_rsurf.c

@ -2284,7 +2284,7 @@ void R_SetupVBOArrayStatic( vboarray_t *vbo, qboolean drawlightmap, qboolean dra
pglEnableClientState( GL_VERTEX_ARRAY ); pglEnableClientState( GL_VERTEX_ARRAY );
pglVertexPointer( 3, GL_FLOAT, sizeof( vbovertex_t ), (void*)offsetof(vbovertex_t,pos) ); pglVertexPointer( 3, GL_FLOAT, sizeof( vbovertex_t ), (void*)offsetof(vbovertex_t,pos) );
} }
vboarray.astate = VBO_ARRAY_STATIC;
// setup multitexture // setup multitexture
if( drawtextures && vboarray.tstate != VBO_TEXTURE_MAIN ) 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; 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 // set lightmap texenv
if( mtst.lm ) if( mtst.lm )
@ -2309,6 +2309,7 @@ void R_SetupVBOArrayStatic( vboarray_t *vbo, qboolean drawlightmap, qboolean dra
R_SetLightmap(); R_SetLightmap();
vboarray.lstate = VBO_LIGHTMAP_STATIC; vboarray.lstate = VBO_LIGHTMAP_STATIC;
} }
vboarray.astate = VBO_ARRAY_STATIC;
R_SetDecalMode( false ); R_SetDecalMode( false );
} }
} }

Loading…
Cancel
Save