From 196f89a239f39d4c6b22a4ceb91a12bff2327df3 Mon Sep 17 00:00:00 2001 From: Ozkan Sezer Date: Wed, 18 Sep 2019 09:17:24 +0000 Subject: [PATCH] GL_BuildLightmaps: minor warning fixes. more accurate developer warning. git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1637 af15c1b1-3010-417e-b628-4374ebc0bcbd --- Quake/r_brush.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/Quake/r_brush.c b/Quake/r_brush.c index be09a97b..991d2ab9 100644 --- a/Quake/r_brush.c +++ b/Quake/r_brush.c @@ -872,7 +872,7 @@ with all the surfaces from all brush models */ void GL_BuildLightmaps (void) { - char name[16]; + char name[24]; int i, j; struct lightmap_s *lm; qmodel_t *m; @@ -934,18 +934,18 @@ void GL_BuildLightmaps (void) lm->rectchange.h = 0; //johnfitz -- use texture manager - sprintf(name, "lightmap%03i",i); + sprintf(name, "lightmap%07i",i); lm->texture = TexMgr_LoadImage (cl.worldmodel, name, LMBLOCK_WIDTH, LMBLOCK_HEIGHT, SRC_LIGHTMAP, lm->data, "", (src_offset_t)lm->data, TEXPREF_LINEAR | TEXPREF_NOPICMIP); //johnfitz } //johnfitz -- warn about exceeding old limits - //Spike: note that this warning isn't accurate. - // I've doubled the lmblock dimensions, so the standard limit is more like 64/4 now. - // additionally, ericw already changed the allocation strategy, which results in false positives. - if (i >= 64) - Con_DWarning ("%i lightmaps exceeds standard limit of 64 (max = %d).\n", i, MAX_SANITY_LIGHTMAPS); + //GLQuake limit was 64 textures of 128x128. Estimate how many 128x128 textures we would need + //given that we are using lightmap_count of LMBLOCK_WIDTH x LMBLOCK_HEIGHT + i = lightmap_count * ((LMBLOCK_WIDTH / 128) * (LMBLOCK_HEIGHT / 128)); + if (i > 64) + Con_DWarning("%i lightmaps exceeds standard limit of 64.\n",i); //johnfitz }