diff options
author | Campbell Barton <ideasman42@gmail.com> | 2009-10-27 03:25:38 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2009-10-27 03:25:38 +0300 |
commit | 641072a769cc7bff4d69945c71f536c5b0394bc9 (patch) | |
tree | e6202ad7ca66dfc88bfb9b63cc4a47b71ceed2cb /source/gameengine/BlenderRoutines | |
parent | 491463c41659d791c09787ad5975c84a42ada74a (diff) |
BGE: when letterbox is enabled use the camera framing as a clipping area (good for avoiding the HUD showing outside the bounds), use the framing color too (from dalai and myself)
Diffstat (limited to 'source/gameengine/BlenderRoutines')
-rw-r--r-- | source/gameengine/BlenderRoutines/BL_KetsjiEmbedStart.cpp | 30 |
1 files changed, 20 insertions, 10 deletions
diff --git a/source/gameengine/BlenderRoutines/BL_KetsjiEmbedStart.cpp b/source/gameengine/BlenderRoutines/BL_KetsjiEmbedStart.cpp index 5c7e18b5304..d4421f9f3e1 100644 --- a/source/gameengine/BlenderRoutines/BL_KetsjiEmbedStart.cpp +++ b/source/gameengine/BlenderRoutines/BL_KetsjiEmbedStart.cpp @@ -120,19 +120,19 @@ static BlendFileData *load_game_data(char *filename) return bfd; } -extern "C" void StartKetsjiShell(struct bContext *C, struct ARegion *ar, int always_use_expand_framing) +extern "C" void StartKetsjiShell(struct bContext *C, struct ARegion *ar, rcti *cam_frame, int always_use_expand_framing) { /* context values */ struct wmWindow *win= CTX_wm_window(C); struct Scene *scene= CTX_data_scene(C); struct Main* maggie1= CTX_data_main(C); - + RAS_Rect area_rect; - area_rect.SetLeft(ar->winrct.xmin); - area_rect.SetBottom(ar->winrct.ymin); - area_rect.SetRight(ar->winrct.xmax); - area_rect.SetTop(ar->winrct.ymax); + area_rect.SetLeft(cam_frame->xmin); + area_rect.SetBottom(cam_frame->ymin); + area_rect.SetRight(cam_frame->xmax); + area_rect.SetTop(cam_frame->ymax); int exitrequested = KX_EXIT_REQUEST_NO_REQUEST; Main* blenderdata = maggie1; @@ -246,14 +246,21 @@ extern "C" void StartKetsjiShell(struct bContext *C, struct ARegion *ar, int alw } if(rv3d->persp==V3D_CAMOB) { - camzoom = (1.41421 + (rv3d->camzoom / 50.0)); - camzoom *= camzoom; + if(scene->gm.framing.type == SCE_GAMEFRAMING_BARS) { /* Letterbox */ + camzoom = 1.0f; + } + else { + camzoom = (1.41421 + (rv3d->camzoom / 50.0)); + camzoom *= camzoom; + camzoom = 4.0 / camzoom; + } } - else + else { camzoom = 2.0; + } - camzoom = 4.0 / camzoom; + ketsjiengine->SetDrawType(v3d->drawtype); ketsjiengine->SetCameraZoom(camzoom); @@ -336,6 +343,8 @@ extern "C" void StartKetsjiShell(struct bContext *C, struct ARegion *ar, int alw if (blscene->gm.stereomode != RAS_IRasterizer::RAS_STEREO_QUADBUFFERED) rasterizer->SetStereoMode((RAS_IRasterizer::StereoMode) blscene->gm.stereomode); } + + rasterizer->SetBackColor(blscene->gm.framing.col[0], blscene->gm.framing.col[1], blscene->gm.framing.col[2], 0.0f); } if (exitrequested != KX_EXIT_REQUEST_QUIT_GAME) @@ -688,6 +697,7 @@ extern "C" void StartKetsjiShellSimulation(struct wmWindow *win, if (blscene->gm.stereomode != RAS_IRasterizer::RAS_STEREO_QUADBUFFERED) rasterizer->SetStereoMode((RAS_IRasterizer::StereoMode) blscene->gm.stereomode); } + rasterizer->SetBackColor(blscene->gm.framing.col[0], blscene->gm.framing.col[1], blscene->gm.framing.col[2], 0.0f); if (exitrequested != KX_EXIT_REQUEST_QUIT_GAME) { |