Revision: 17005
          
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=17005
Author:   ben2610
Date:     2008-10-10 09:20:42 +0200 (Fri, 10 Oct 2008)

Log Message:
-----------
BGE bug #17789 fixed: Lock Active Camera and Layer to Scene doesn't work in 
BGE. This bug fix applies only to games started from the 3D view. Now the BGE 
will use the layer and camera selected in the 3d viewport under the mouse when 
the user presses P. Note that there is still a problem with the restart game 
actuator but that's another bug.

Modified Paths:
--------------
    trunk/blender/source/gameengine/BlenderRoutines/BL_KetsjiEmbedStart.cpp

Modified: 
trunk/blender/source/gameengine/BlenderRoutines/BL_KetsjiEmbedStart.cpp
===================================================================
--- trunk/blender/source/gameengine/BlenderRoutines/BL_KetsjiEmbedStart.cpp     
2008-10-10 05:32:04 UTC (rev 17004)
+++ trunk/blender/source/gameengine/BlenderRoutines/BL_KetsjiEmbedStart.cpp     
2008-10-10 07:20:42 UTC (rev 17005)
@@ -191,7 +191,16 @@
                ketsjiengine->SetUseFixedTime(usefixed);
                ketsjiengine->SetTimingDisplay(frameRate, profile, properties);
 
-               
+
+               //lock frame and camera enabled - storing global values
+               int tmp_lay= G.scene->lay;
+               Object *tmp_camera = G.scene->camera;
+
+               if (G.vd->scenelock==0){
+                       G.scene->lay= v3d->lay;
+                       G.scene->camera= v3d->camera;
+               }
+
        
                // some blender stuff
                MT_CmMatrix4x4 projmat;
@@ -403,7 +412,8 @@
                                }
                                printf("\nBlender Game Engine Finished\n\n");
                                exitstring = ketsjiengine->GetExitString();
-                               
+
+
                                // when exiting the mainloop
                                
                                // Clears the dictionary by hand:
@@ -439,6 +449,12 @@
                        Py_DECREF(gameLogic_keys);
                        gameLogic_keys = NULL;
                }
+               //lock frame and camera enabled - restoring global values
+               if (G.vd->scenelock==0){
+                       G.scene->lay= tmp_lay;
+                       G.scene->camera= tmp_camera;
+               }
+
                // set the cursor back to normal
                canvas->SetMouseState(RAS_ICanvas::MOUSE_NORMAL);
                


_______________________________________________
Bf-blender-cvs mailing list
[email protected]
http://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to