From 13836e5f4aa12dc7ee72ee63e1575ac552e8311c Mon Sep 17 00:00:00 2001 From: Thilo Schulz Date: Fri, 4 Feb 2011 15:21:15 +0000 Subject: [PATCH] Thanks for the patch, gimhael. (#4576) --- code/renderer/tr_bsp.c | 4 +--- code/renderer/tr_local.h | 3 +-- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/code/renderer/tr_bsp.c b/code/renderer/tr_bsp.c index 8e0031bb..45406a65 100644 --- a/code/renderer/tr_bsp.c +++ b/code/renderer/tr_bsp.c @@ -155,9 +155,6 @@ static void R_LoadLightmaps( lump_t *l ) { //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 @@ static void R_LoadLightmaps( lump_t *l ) { 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 --git a/code/renderer/tr_local.h b/code/renderer/tr_local.h index 067b039b..163dc33f 100644 --- a/code/renderer/tr_local.h +++ b/code/renderer/tr_local.h @@ -779,7 +779,6 @@ void R_Modellist_f (void); extern refimport_t ri; #define MAX_DRAWIMAGES 2048 -#define MAX_LIGHTMAPS 256 #define MAX_SKINS 1024 @@ -916,7 +915,7 @@ typedef struct { 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