+{
+ if (r_vertexsurfaces.integer)
+ {
+ if (stage == 0)
+ {
+ c_brush_polys++;
+ RSurfShader_Wall_Pass_BaseVertex(s);
+ return false;
+ }
+ return true;
+ }
+ else if (r_multitexture.integer)
+ {
+ if (r_dlightmap.integer)
+ {
+ if (stage == 0)
+ {
+ c_brush_polys++;
+ RSurfShader_Wall_Pass_BaseMTex(s);
+ return false;
+ }
+ return true;
+ }
+ else
+ {
+ switch(stage)
+ {
+ case 0:
+ c_brush_polys++;
+ RSurfShader_Wall_Pass_BaseMTex(s);
+ return false;
+ case 1:
+ if (s->dlightframe == r_framecount)
+ RSurfShader_Wall_Pass_Light(s);
+ return false;
+ default:
+ return true;
+ }
+ }
+ }
+ else if (s->currenttexture->fogtexture != NULL || currentrenderentity->alpha != 1 || currentrenderentity->effects & EF_ADDITIVE)
+ {
+ if (stage == 0)
+ {
+ c_brush_polys++;
+ RSurfShader_Wall_Pass_BaseVertex(s);
+ return false;
+ }
+ return true;
+ }
+ else
+ {
+ if (r_dlightmap.integer)
+ {
+ switch(stage)
+ {
+ case 0:
+ c_brush_polys++;
+ RSurfShader_Wall_Pass_BaseTexture(s);
+ return false;
+ case 1:
+ RSurfShader_Wall_Pass_BaseLightmap(s);
+ return false;
+ default:
+ return true;
+ }
+ }
+ else
+ {
+ switch(stage)
+ {
+ case 0:
+ c_brush_polys++;
+ RSurfShader_Wall_Pass_BaseTexture(s);
+ return false;
+ case 1:
+ RSurfShader_Wall_Pass_BaseLightmap(s);
+ return false;
+ case 2:
+ if (s->dlightframe == r_framecount)
+ RSurfShader_Wall_Pass_Light(s);
+ return false;
+ default:
+ return true;
+ }
+ }
+ }
+}
+
+static int RSurfShader_Wall_Lightmap_Glow(int stage, msurface_t *s)