Browse Source

ref_gl: temporarily fix water drawing on GLES

pull/2/head
Alibek Omarov 5 years ago
parent
commit
09203dc512
  1. 13
      ref_gl/gl_warp.c

13
ref_gl/gl_warp.c

@ -759,6 +759,11 @@ void EmitWaterPolys( msurface_t *warp, qboolean reverse )
float s, t, os, ot; float s, t, os, ot;
glpoly_t *p; glpoly_t *p;
int i; int i;
#ifndef XASH_GLES
const qboolean useQuads = FBitSet( warp->flags, SURF_DRAWTURB_QUADS );
#else
const qboolean useQuads = false; // TODO: figure out why
#endif
if( !warp->polys ) return; if( !warp->polys ) return;
@ -770,7 +775,7 @@ void EmitWaterPolys( msurface_t *warp, qboolean reverse )
// reset fog color for nonlightmapped water // reset fog color for nonlightmapped water
GL_ResetFogColor(); GL_ResetFogColor();
if( FBitSet( warp->flags, SURF_DRAWTURB_QUADS )) if( useQuads )
pglBegin( GL_QUADS ); pglBegin( GL_QUADS );
for( p = warp->polys; p; p = p->next ) for( p = warp->polys; p; p = p->next )
@ -779,7 +784,7 @@ void EmitWaterPolys( msurface_t *warp, qboolean reverse )
v = p->verts[0] + ( p->numverts - 1 ) * VERTEXSIZE; v = p->verts[0] + ( p->numverts - 1 ) * VERTEXSIZE;
else v = p->verts[0]; else v = p->verts[0];
if( !FBitSet( warp->flags, SURF_DRAWTURB_QUADS )) if( !useQuads )
pglBegin( GL_POLYGON ); pglBegin( GL_POLYGON );
for( i = 0; i < p->numverts; i++ ) for( i = 0; i < p->numverts; i++ )
@ -809,11 +814,11 @@ void EmitWaterPolys( msurface_t *warp, qboolean reverse )
else v += VERTEXSIZE; else v += VERTEXSIZE;
} }
if( !FBitSet( warp->flags, SURF_DRAWTURB_QUADS )) if( !useQuads )
pglEnd(); pglEnd();
} }
if( FBitSet( warp->flags, SURF_DRAWTURB_QUADS )) if( useQuads )
pglEnd(); pglEnd();
GL_SetupFogColorForSurfaces(); GL_SetupFogColorForSurfaces();

Loading…
Cancel
Save