diff options
author | Benoit Bolsee <benoit.bolsee@online.be> | 2008-10-10 11:20:42 +0400 |
---|---|---|
committer | Benoit Bolsee <benoit.bolsee@online.be> | 2008-10-10 11:20:42 +0400 |
commit | 3fd204312f64a405e068cb68338dd929682d6297 (patch) | |
tree | 952b9916c92beac059248fe6d237792f7f388b4b | |
parent | 7995395fd2a6ad503c70cf3bd463b579b2fd9386 (diff) |
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.
-rw-r--r-- | source/gameengine/BlenderRoutines/BL_KetsjiEmbedStart.cpp | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/source/gameengine/BlenderRoutines/BL_KetsjiEmbedStart.cpp b/source/gameengine/BlenderRoutines/BL_KetsjiEmbedStart.cpp index 1110c4e0b48..ffc32a3ad97 100644 --- a/source/gameengine/BlenderRoutines/BL_KetsjiEmbedStart.cpp +++ b/source/gameengine/BlenderRoutines/BL_KetsjiEmbedStart.cpp @@ -191,7 +191,16 @@ extern "C" void StartKetsjiShell(struct ScrArea *area, 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 @@ extern "C" void StartKetsjiShell(struct ScrArea *area, } printf("\nBlender Game Engine Finished\n\n"); exitstring = ketsjiengine->GetExitString(); - + + // when exiting the mainloop // Clears the dictionary by hand: @@ -439,6 +449,12 @@ extern "C" void StartKetsjiShell(struct ScrArea *area, 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); |