[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [39202] branches/soc-2011-cucumber/source/ gameengine/Ketsji/KX_Light.cpp: Fixed a crash caused by libload when no dynamic lights were allocated.
Daniel Stokes
kupomail at gmail.com
Tue Aug 9 06:11:09 CEST 2011
Revision: 39202
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=39202
Author: kupoman
Date: 2011-08-09 04:11:07 +0000 (Tue, 09 Aug 2011)
Log Message:
-----------
Fixed a crash caused by libload when no dynamic lights were allocated. Thanks to jplur for pointing it out to me on the IRC.
Modified Paths:
--------------
branches/soc-2011-cucumber/source/gameengine/Ketsji/KX_Light.cpp
Modified: branches/soc-2011-cucumber/source/gameengine/Ketsji/KX_Light.cpp
===================================================================
--- branches/soc-2011-cucumber/source/gameengine/Ketsji/KX_Light.cpp 2011-08-09 03:27:05 UTC (rev 39201)
+++ branches/soc-2011-cucumber/source/gameengine/Ketsji/KX_Light.cpp 2011-08-09 04:11:07 UTC (rev 39202)
@@ -326,13 +326,20 @@
{
Lamp* la;
- //If the light pool is already built, there is no need to rebuild it.
+ //If the light pool is already built, there is no need to rebuild it,
+ //we don't want libload trying to reinitialize the light pool
if (m_blenderlight_count != 0)
return;
m_blenderlight_scene = scene;
m_blenderlight_count = point_count + spot_count + sun_count + hemi_count + area_count;
+ //Don't bother finishing setup if there are no lights in the pools
+ //Also if no Dynamic lights are allocated, sometimes libload will get passed the count
+ //check and screw things up
+ if (m_blenderlight_count == 0 && false)
+ return;
+
init_subpool(scene, &m_blenderlight_points, point_count, LA_LOCAL);
init_subpool(scene, &m_blenderlight_spots, spot_count, LA_SPOT);
init_subpool(scene, &m_blenderlight_suns, sun_count, LA_SUN);
More information about the Bf-blender-cvs
mailing list