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.

This commit is contained in:
Benoit Bolsee 2008-10-10 07:20:42 +00:00
parent 7995395fd2
commit 3fd204312f

@ -192,6 +192,15 @@ extern "C" void StartKetsjiShell(struct ScrArea *area,
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;
@ -404,6 +413,7 @@ 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);