From: havoc Date: Thu, 2 Apr 2009 09:11:15 +0000 (+0000) Subject: reset rsurface.entity in a couple more cases X-Git-Tag: xonotic-v0.1.0preview~1762 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=958bde12e71a62b2679a78bfa497ab4099129adc;p=xonotic%2Fdarkplaces.git reset rsurface.entity in a couple more cases fixed entity count on r_speeds - don't count models twice git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@8845 d7cf8633-e32d-0410-b094-e92efae38249 --- diff --git a/gl_rmain.c b/gl_rmain.c index 917f6266..d796ec5f 100644 --- a/gl_rmain.c +++ b/gl_rmain.c @@ -7178,7 +7178,10 @@ void R_DrawWorldSurfaces(qboolean skysurfaces, qboolean writedepth, qboolean dep R_BuildLightMap(r_refdef.scene.worldentity, surfaces + j); // don't do anything if there were no surfaces if (!numsurfacelist) + { + rsurface.entity = NULL; // used only by R_GetCurrentTexture and RSurf_ActiveWorldEntity/RSurf_ActiveModelEntity return; + } R_QueueWorldSurfaceList(numsurfacelist, r_surfacelist, flagsmask, writedepth, depthonly); GL_AlphaTest(false); @@ -7260,7 +7263,10 @@ void R_DrawModelSurfaces(entity_render_t *ent, qboolean skysurfaces, qboolean wr r_surfacelist[numsurfacelist++] = surfaces + model->sortedmodelsurfaces[i]; // don't do anything if there were no surfaces if (!numsurfacelist) + { + rsurface.entity = NULL; // used only by R_GetCurrentTexture and RSurf_ActiveWorldEntity/RSurf_ActiveModelEntity return; + } // update lightmaps if needed if (update) for (j = model->firstmodelsurface, endj = model->firstmodelsurface + model->nummodelsurfaces;j < endj;j++) @@ -7272,7 +7278,6 @@ void R_DrawModelSurfaces(entity_render_t *ent, qboolean skysurfaces, qboolean wr // add to stats if desired if (r_speeds.integer && !skysurfaces && !depthonly) { - r_refdef.stats.entities++; r_refdef.stats.entities_surfaces += numsurfacelist; for (j = 0;j < numsurfacelist;j++) r_refdef.stats.entities_triangles += r_surfacelist[j]->num_triangles;