diff -r f02c7f3a515a code/renderer/tr_bsp.c --- a/code/renderer/tr_bsp.c Sun May 30 04:35:45 2010 +0000 +++ b/code/renderer/tr_bsp.c Thu Oct 14 08:01:33 2010 +0200 @@ -155,9 +155,6 @@ //FIXME: HACK: maps with only one lightmap turn up fullbright for some reason. //this avoids this, but isn't the correct solution. tr.numLightmaps++; - } else if ( tr.numLightmaps >= MAX_LIGHTMAPS ) { // 20051020 misantropia - ri.Printf( PRINT_WARNING, "WARNING: number of lightmaps > MAX_LIGHTMAPS\n" ); - tr.numLightmaps = MAX_LIGHTMAPS; } // if we are in r_vertexLight mode, we don't need the lightmaps at all @@ -165,6 +162,7 @@ return; } + tr.lightmaps = ri.Hunk_Alloc( tr.numLightmaps * sizeof(image_t *), h_low ); for ( i = 0 ; i < tr.numLightmaps ; i++ ) { // expand the 24 bit on-disk to 32 bit buf_p = buf + i * LIGHTMAP_SIZE*LIGHTMAP_SIZE * 3; diff -r f02c7f3a515a code/renderer/tr_local.h --- a/code/renderer/tr_local.h Sun May 30 04:35:45 2010 +0000 +++ b/code/renderer/tr_local.h Thu Oct 14 08:01:33 2010 +0200 @@ -779,7 +779,6 @@ extern refimport_t ri; #define MAX_DRAWIMAGES 2048 -#define MAX_LIGHTMAPS 256 #define MAX_SKINS 1024 @@ -916,7 +915,7 @@ shader_t *sunShader; int numLightmaps; - image_t *lightmaps[MAX_LIGHTMAPS]; + image_t **lightmaps; trRefEntity_t *currentEntity; trRefEntity_t worldEntity; // point currentEntity at this when rendering world