Matthias Bentrup wrote:
> Instead of increasing the constant you should just remove the MAX_LIGHTMAPS
> constant altogether. The engine is perfectly capable of rendering any number
> of lightmaps until the texture memory is full and I think imposing an
> artificial limit makes no sense.

code/renderer/tr_local.c:

typedef struct {
        ...
        image_t *lightmaps[MAX_LIGHTMAPS];
        ...
} trGlobals_t;

exter ntrGlobals_t      tr;

code/renderer/tr_bsp.c:

len = l->filelen;
...
tr.numLightmaps = len / (LIGHTMAP_SIZE * LIGHTMAP_SIZE * 3);
...
for ( i = 0 ; i < tr.numLightmaps ; i++ ) {
        ...
        tr.lightmaps[i] = R_CreateImage(...

=> yes, there is a limit that needs to be checked

using more than MAX_LIGHTMAPS is a bug and ioq3 catches it. It leads
to undefined behavior in idq3 so you can't use it there either.
Without further studying the code I can't judge whether changing the
size of trGlobals_t is safe. I don't mind applying a patch if
someone creates one but someone sufficiently knowledgeable needs to
confirm it's harmless first.

cu
Ludwig

-- 
 (o_   Ludwig Nussel
 //\   
 V_/_  http://www.suse.de/
SUSE LINUX Products GmbH, GF: Markus Rex, HRB 16746 (AG Nuernberg)
_______________________________________________
ioquake3 mailing list
ioquake3@lists.ioquake.org
http://lists.ioquake.org/listinfo.cgi/ioquake3-ioquake.org
By sending this message I agree to love ioquake3 and libsdl.

Reply via email to