Thanks for the patch, gimhael. (#4576)

This commit is contained in:
Thilo Schulz 2011-02-04 15:21:15 +00:00
parent ecbe1ab9fd
commit 13836e5f4a
2 changed files with 2 additions and 5 deletions

View file

@ -155,9 +155,6 @@ static void R_LoadLightmaps( lump_t *l ) {
//FIXME: HACK: maps with only one lightmap turn up fullbright for some reason. //FIXME: HACK: maps with only one lightmap turn up fullbright for some reason.
//this avoids this, but isn't the correct solution. //this avoids this, but isn't the correct solution.
tr.numLightmaps++; 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 // 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; return;
} }
tr.lightmaps = ri.Hunk_Alloc( tr.numLightmaps * sizeof(image_t *), h_low );
for ( i = 0 ; i < tr.numLightmaps ; i++ ) { for ( i = 0 ; i < tr.numLightmaps ; i++ ) {
// expand the 24 bit on-disk to 32 bit // expand the 24 bit on-disk to 32 bit
buf_p = buf + i * LIGHTMAP_SIZE*LIGHTMAP_SIZE * 3; buf_p = buf + i * LIGHTMAP_SIZE*LIGHTMAP_SIZE * 3;

View file

@ -779,7 +779,6 @@ void R_Modellist_f (void);
extern refimport_t ri; extern refimport_t ri;
#define MAX_DRAWIMAGES 2048 #define MAX_DRAWIMAGES 2048
#define MAX_LIGHTMAPS 256
#define MAX_SKINS 1024 #define MAX_SKINS 1024
@ -916,7 +915,7 @@ typedef struct {
shader_t *sunShader; shader_t *sunShader;
int numLightmaps; int numLightmaps;
image_t *lightmaps[MAX_LIGHTMAPS]; image_t **lightmaps;
trRefEntity_t *currentEntity; trRefEntity_t *currentEntity;
trRefEntity_t worldEntity; // point currentEntity at this when rendering world trRefEntity_t worldEntity; // point currentEntity at this when rendering world