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)
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.
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.
About the author
Associate Kyle Carter