diff options
author | Mitchell Stokes <mogurijin@gmail.com> | 2013-08-26 12:14:52 +0400 |
---|---|---|
committer | Mitchell Stokes <mogurijin@gmail.com> | 2013-08-26 12:14:52 +0400 |
commit | f7388c1f2e7a0a23b40a4a2f8b1e2bfbca17e1b9 (patch) | |
tree | 941bca5e4ce53b59f758d944c9e2eb399c5f4278 | |
parent | c0d67d26aac0c1b5acccdbdd3111c3b76ad7b523 (diff) |
BGE: Cleaning up the vsync code a little.
-rw-r--r-- | source/gameengine/BlenderRoutines/BL_KetsjiEmbedStart.cpp | 2 | ||||
-rw-r--r-- | source/gameengine/GamePlayer/ghost/GPG_Application.cpp | 2 | ||||
-rw-r--r-- | source/gameengine/Ketsji/KX_PythonInit.cpp | 2 |
3 files changed, 3 insertions, 3 deletions
diff --git a/source/gameengine/BlenderRoutines/BL_KetsjiEmbedStart.cpp b/source/gameengine/BlenderRoutines/BL_KetsjiEmbedStart.cpp index c3bd93fec81..cab1cbde94f 100644 --- a/source/gameengine/BlenderRoutines/BL_KetsjiEmbedStart.cpp +++ b/source/gameengine/BlenderRoutines/BL_KetsjiEmbedStart.cpp @@ -290,7 +290,7 @@ extern "C" void StartKetsjiShell(struct bContext *C, struct ARegion *ar, rcti *c if (startscene->gm.vsync == VSYNC_ADAPTIVE) canvas->SetSwapInterval(-1); else - canvas->SetSwapInterval(!startscene->gm.vsync); // VSYNC_OFF == 1, VSYNC_ON == 0, so this works + canvas->SetSwapInterval((startscene->gm.vsync == VSYNC_ON) ? 1 : 0); RAS_IRenderTools* rendertools = new KX_BlenderRenderTools(); RAS_IRasterizer* rasterizer = NULL; diff --git a/source/gameengine/GamePlayer/ghost/GPG_Application.cpp b/source/gameengine/GamePlayer/ghost/GPG_Application.cpp index 88468ecc88a..ad6c8a38305 100644 --- a/source/gameengine/GamePlayer/ghost/GPG_Application.cpp +++ b/source/gameengine/GamePlayer/ghost/GPG_Application.cpp @@ -586,7 +586,7 @@ bool GPG_Application::initEngine(GHOST_IWindow* window, const int stereoMode) if (gm->vsync == VSYNC_ADAPTIVE) m_canvas->SetSwapInterval(-1); else - m_canvas->SetSwapInterval(!gm->vsync); // VSYNC_OFF == 1, VSYNC_ON == 0, so this works + m_canvas->SetSwapInterval((gm->vsync == VSYNC_ON) ? 1 : 0); m_canvas->Init(); if (gm->flag & GAME_SHOW_MOUSE) diff --git a/source/gameengine/Ketsji/KX_PythonInit.cpp b/source/gameengine/Ketsji/KX_PythonInit.cpp index 74816a5ad09..29f28b7cc24 100644 --- a/source/gameengine/Ketsji/KX_PythonInit.cpp +++ b/source/gameengine/Ketsji/KX_PythonInit.cpp @@ -1385,7 +1385,7 @@ static PyObject *gPySetVsync(PyObject *, PyObject *args) if (interval == VSYNC_ADAPTIVE) interval = -1; - gp_Canvas->SetSwapInterval(!interval); // VSYNC_OFF == 1, VSYNC_ON == 0, so this works + gp_Canvas->SetSwapInterval((interval == VSYNC_ON) ? 1 : 0); Py_RETURN_NONE; } |