Fix for bug #17589: removing a lamp in the game engine with glsl
authorBrecht Van Lommel <brechtvanlommel@pandora.be>
Wed, 10 Sep 2008 09:51:06 +0000 (09:51 +0000)
committerBrecht Van Lommel <brechtvanlommel@pandora.be>
Wed, 10 Sep 2008 09:51:06 +0000 (09:51 +0000)
materials did not work correct.

source/gameengine/Ketsji/KX_Light.cpp

index 979015532e3f93060096f5be34b785a0634f8083..e0f171e78e0f0d5c836d5709c51ef72542d419dd 100644 (file)
@@ -65,6 +65,13 @@ KX_LightObject::KX_LightObject(void* sgReplicationInfo,SG_Callbacks callbacks,
 
 KX_LightObject::~KX_LightObject()
 {
+       GPULamp *lamp;
+
+       if((lamp = GetGPULamp())) {
+               float obmat[4][4] = {{0}};
+               GPU_lamp_update(lamp, 0, obmat);
+       }
+
        m_rendertools->RemoveLight(&m_lightobj);
 }