Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/source
diff options
context:
space:
mode:
authorBrecht Van Lommel <brechtvanlommel@pandora.be>2011-05-27 20:20:49 +0400
committerBrecht Van Lommel <brechtvanlommel@pandora.be>2011-05-27 20:20:49 +0400
commit18ff3d5200842ac87d783442580d42e00b0ab8f6 (patch)
treed3194d2477913fa46a37e466ddcaece3a7ad2d5a /source
parentd369a6aaaf3d3c44bb2c3cde34fde053633ec799 (diff)
Attempted fix for #27482: game engine running slow due to revision 36698 which
fixed frame colors for letterbox drawing (happens when in camera view). Cause is unclear, seems some sort of strange graphics driver thing on 32 bit. Changes are a fix for the incorrect usage of glViewport, and avoiding the extra clear if it's not needed.
Diffstat (limited to 'source')
-rw-r--r--source/gameengine/BlenderRoutines/BL_KetsjiEmbedStart.cpp17
1 files changed, 11 insertions, 6 deletions
diff --git a/source/gameengine/BlenderRoutines/BL_KetsjiEmbedStart.cpp b/source/gameengine/BlenderRoutines/BL_KetsjiEmbedStart.cpp
index 59c5888ff35..d9017c6a4ca 100644
--- a/source/gameengine/BlenderRoutines/BL_KetsjiEmbedStart.cpp
+++ b/source/gameengine/BlenderRoutines/BL_KetsjiEmbedStart.cpp
@@ -250,10 +250,12 @@ extern "C" void StartKetsjiShell(struct bContext *C, struct ARegion *ar, rcti *c
// some blender stuff
float camzoom;
+ 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 = BKE_screen_view3d_zoom_to_fac(rv3d->camzoom);
@@ -428,12 +430,15 @@ extern "C" void StartKetsjiShell(struct bContext *C, struct ARegion *ar, rcti *c
// first check if we want to exit
exitrequested = ketsjiengine->GetExitCode();
- // Clear screen to border color
- // We do this here since we set the canvas to be within the frames. This means the engine
- // itself is unaware of the extra space, so we clear the whole region for it.
- glClearColor(scene->gm.framing.col[0], scene->gm.framing.col[1], scene->gm.framing.col[2], 1.0f);
- glViewport(ar->winrct.xmin, ar->winrct.ymin, ar->winrct.xmax, ar->winrct.ymax);
- glClear(GL_COLOR_BUFFER_BIT);
+ if(draw_letterbox) {
+ // Clear screen to border color
+ // We do this here since we set the canvas to be within the frames. This means the engine
+ // itself is unaware of the extra space, so we clear the whole region for it.
+ glClearColor(scene->gm.framing.col[0], scene->gm.framing.col[1], scene->gm.framing.col[2], 1.0f);
+ glViewport(ar->winrct.xmin, ar->winrct.ymin,
+ ar->winrct.xmax - ar->winrct.xmin, ar->winrct.ymax - ar->winrct.ymin);
+ glClear(GL_COLOR_BUFFER_BIT);
+ }
// kick the engine
bool render = ketsjiengine->NextFrame();