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
This commit is contained in:
Ozkan Sezer 2019-09-18 09:17:24 +00:00
parent 511d4bb908
commit 196f89a239

View file

@ -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
}