diff options
author | Dalai Felinto <dfelinto@gmail.com> | 2011-01-23 20:25:27 +0300 |
---|---|---|
committer | Dalai Felinto <dfelinto@gmail.com> | 2011-01-23 20:25:27 +0300 |
commit | d58c31704b7984687f001ea617af4d3ff85fd591 (patch) | |
tree | 2ba49c71ba4ed270ac14d6f70a4c5edc6e0a9bcd /source/gameengine | |
parent | fc66b3f2efcb5b7579f06c1966900b2ecf3c1310 (diff) |
BGE: option in the UI to start with the mouse cursor visible. Patch by Vitor Balbio, changes by me.
----------------------------------
While we are more and more moving towards enabling features in the Python API, it's also important to have Logic Bricks working with no scripts.
This option allows you to start the game with the mouse cursor on (it's on Render Buttons). The defalt is still off (no do_version needed here).
Diffstat (limited to 'source/gameengine')
-rw-r--r-- | source/gameengine/BlenderRoutines/BL_KetsjiEmbedStart.cpp | 9 | ||||
-rw-r--r-- | source/gameengine/GamePlayer/ghost/GPG_Application.cpp | 5 |
2 files changed, 12 insertions, 2 deletions
diff --git a/source/gameengine/BlenderRoutines/BL_KetsjiEmbedStart.cpp b/source/gameengine/BlenderRoutines/BL_KetsjiEmbedStart.cpp index e5179e8926f..f6e29fe0dbb 100644 --- a/source/gameengine/BlenderRoutines/BL_KetsjiEmbedStart.cpp +++ b/source/gameengine/BlenderRoutines/BL_KetsjiEmbedStart.cpp @@ -176,11 +176,18 @@ extern "C" void StartKetsjiShell(struct bContext *C, struct ARegion *ar, rcti *c bool nodepwarnings = (SYS_GetCommandLineInt(syshandle, "ignore_deprecation_warnings", 0) != 0); #endif bool novertexarrays = (SYS_GetCommandLineInt(syshandle, "novertexarrays", 0) != 0); + bool mouse_state = startscene->gm.flag & GAME_SHOW_MOUSE; + if(animation_record) usefixed= true; /* override since you's always want fixed time for sim recording */ // create the canvas, rasterizer and rendertools RAS_ICanvas* canvas = new KX_BlenderCanvas(win, area_rect, ar); - canvas->SetMouseState(RAS_ICanvas::MOUSE_INVISIBLE); + + // default mouse state set on render panel + if (mouse_state) + canvas->SetMouseState(RAS_ICanvas::MOUSE_NORMAL); + else + canvas->SetMouseState(RAS_ICanvas::MOUSE_INVISIBLE); 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 d1dee052173..060f2f6c3c4 100644 --- a/source/gameengine/GamePlayer/ghost/GPG_Application.cpp +++ b/source/gameengine/GamePlayer/ghost/GPG_Application.cpp @@ -546,7 +546,10 @@ bool GPG_Application::initEngine(GHOST_IWindow* window, const int stereoMode) if (!m_canvas) return false; - m_canvas->Init(); + m_canvas->Init(); + if (gm->flag & GAME_SHOW_MOUSE) + m_canvas->SetMouseState(RAS_ICanvas::MOUSE_NORMAL); + m_rendertools = new GPC_RenderTools(); if (!m_rendertools) goto initFailed; |