From 13a4bcd148bd7a32af8af626f42f7793aca7b7fe Mon Sep 17 00:00:00 2001 From: Porteries Tristan Date: Tue, 27 Oct 2015 11:04:04 +0100 Subject: BGE: Fix T31357: wrong zoom when sets camera. This patch makes independant the override camera zoom and the default camera object zoom. The override zoom is 2.0f and the camera object zoom is computed with the RegionView3D camera zoom. These features are only used for the embedded BGE, so there's no compatibility issues with the blenderplayer. I let the override zoom with a setter to allow later to create an override camera in blenderplayer easily. Tested with the 3 framing modes in embedded and standalone. --- source/gameengine/BlenderRoutines/BL_KetsjiEmbedStart.cpp | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) (limited to 'source/gameengine/BlenderRoutines') diff --git a/source/gameengine/BlenderRoutines/BL_KetsjiEmbedStart.cpp b/source/gameengine/BlenderRoutines/BL_KetsjiEmbedStart.cpp index 91382669d5c..e3c8c894033 100644 --- a/source/gameengine/BlenderRoutines/BL_KetsjiEmbedStart.cpp +++ b/source/gameengine/BlenderRoutines/BL_KetsjiEmbedStart.cpp @@ -359,25 +359,22 @@ extern "C" void StartKetsjiShell(struct bContext *C, struct ARegion *ar, rcti *c } // some blender stuff - float camzoom; + float camzoom = 1.0f; int draw_letterbox = 0; - + if (rv3d->persp==RV3D_CAMOB) { if (startscene->gm.framing.type == SCE_GAMEFRAMING_BARS) { /* Letterbox */ - camzoom = 1.0f; draw_letterbox = 1; } else { camzoom = 1.0f / BKE_screen_view3d_zoom_to_fac(rv3d->camzoom); } } - else { - camzoom = 2.0; - } rasterizer->SetDrawingMode(drawtype); ketsjiengine->SetCameraZoom(camzoom); - + ketsjiengine->SetCameraOverrideZoom(2.0f); + // if we got an exitcode 3 (KX_EXIT_REQUEST_START_OTHER_GAME) load a different file if (exitrequested == KX_EXIT_REQUEST_START_OTHER_GAME || exitrequested == KX_EXIT_REQUEST_RESTART_GAME) { -- cgit v1.2.3