Game Development Community

Lightmanager crash

by Xavier "eXoDuS" Amado · in Torque Game Engine · 09/21/2004 (2:20 pm) · 4 replies

This is a little bug that was introduced with the light map border changes from John Kabus, took me a while to figure it out. But the lightmap border has no initialization value, so I'm guessing that if the .dif wasn't re-exported with the new map2dif this happens, although I'm not sure. Also note that this only happens if the Memory Manager was disabled.

So the problem is that mLightMapBorderSize is never initialized and can return very big funky numbers if the code doesn't set it. So the fix is really simple, let's initialize it!

Interior.cc:248 Interior::Interior()

Add somewhere (I added it before the VECTOR macros)
mLightMapBorderSize = 0;
Recompile and voila, one less bug.

Now, can someone please explain me why this doesn't happen using Torque's memory manager??? It really puzzles me.

EDIT: Also, how the hell is that value set? The only call to setLightmapbordersize i see is in map2dif/main.cc, but I can't see it getting called anywhere when loading the dif.

#1
09/21/2004 (2:27 pm)
I believe it's stored in the DIF and loaded directly, not via the accessor. I actually fixed this bug recently in Lore... I have it filed away, just waiting for 1.4 dev to get rolling before checking it in.
#2
09/21/2004 (2:29 pm)
Awww, you always beat me :(
I'll be calling my lawyer.
#3
10/22/2004 (9:50 am)
Ok, it's fixed. (In the local 1.4 dev repo.)