diff options
author | Campbell Barton <ideasman42@gmail.com> | 2010-12-01 00:51:03 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2010-12-01 00:51:03 +0300 |
commit | df6169dada1bd6ad9617ef9e2adb17688f786314 (patch) | |
tree | bace5ff9cf42e703695bcd867a4afae9474a1ab6 /source/gameengine/BlenderRoutines | |
parent | 17cd5811e767df5bc7247648e3cbe52e39575f56 (diff) |
bugfix [#23423] Multi-window : closing game windows cause blender crash
detect closing window while the BGE runs and exit without crashing, as if Esc was pressed.
Diffstat (limited to 'source/gameengine/BlenderRoutines')
-rw-r--r-- | source/gameengine/BlenderRoutines/BL_KetsjiEmbedStart.cpp | 12 | ||||
-rw-r--r-- | source/gameengine/BlenderRoutines/KX_BlenderGL.cpp | 9 |
2 files changed, 9 insertions, 12 deletions
diff --git a/source/gameengine/BlenderRoutines/BL_KetsjiEmbedStart.cpp b/source/gameengine/BlenderRoutines/BL_KetsjiEmbedStart.cpp index c672d07a3cc..c9d85e6b48f 100644 --- a/source/gameengine/BlenderRoutines/BL_KetsjiEmbedStart.cpp +++ b/source/gameengine/BlenderRoutines/BL_KetsjiEmbedStart.cpp @@ -417,7 +417,7 @@ extern "C" void StartKetsjiShell(struct bContext *C, struct ARegion *ar, rcti *c exitrequested = ketsjiengine->GetExitCode(); // kick the engine - bool render = ketsjiengine->NextFrame(); // XXX 2.5 Bug, This is never true! FIXME- Campbell + bool render = ketsjiengine->NextFrame(); if (render) { @@ -456,6 +456,9 @@ extern "C" void StartKetsjiShell(struct bContext *C, struct ARegion *ar, rcti *c wm_event_free(event); } + if(win != CTX_wm_window(C)) { + exitrequested= KX_EXIT_REQUEST_OUTSIDE; /* window closed while bge runs */ + } } printf("Blender Game Engine Finished\n"); exitstring = ketsjiengine->GetExitString(); @@ -506,8 +509,11 @@ extern "C" void StartKetsjiShell(struct bContext *C, struct ARegion *ar, rcti *c startscene->camera= tmp_camera; } - // set the cursor back to normal - canvas->SetMouseState(RAS_ICanvas::MOUSE_NORMAL); + if(exitrequested != KX_EXIT_REQUEST_OUTSIDE) + { + // set the cursor back to normal + canvas->SetMouseState(RAS_ICanvas::MOUSE_NORMAL); + } // clean up some stuff if (ketsjiengine) diff --git a/source/gameengine/BlenderRoutines/KX_BlenderGL.cpp b/source/gameengine/BlenderRoutines/KX_BlenderGL.cpp index df3536424f6..2515c1738d7 100644 --- a/source/gameengine/BlenderRoutines/KX_BlenderGL.cpp +++ b/source/gameengine/BlenderRoutines/KX_BlenderGL.cpp @@ -77,15 +77,6 @@ extern "C" { } /* end of blender block */ - -/* was in drawmesh.c */ -void spack(unsigned int ucol) -{ - char *cp= (char *)&ucol; - - glColor3ub(cp[3], cp[2], cp[1]); -} - void BL_warp_pointer(wmWindow *win, int x,int y) { WM_cursor_warp(win, x, y); |