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
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2015-07-02 14:25:25 +0300
committerCampbell Barton <ideasman42@gmail.com>2015-07-02 14:31:39 +0300
commitfabc4fc720dd477f1b08fa996b3dd3426c2fd81b (patch)
treefeb9a7ae3ccb59565dde7eedfc7b4844e5584397
parente61ead7d4c0a0067fb55f6abb68f637a8fd21d1f (diff)
BGE: remove check for area in start-game operator
This prevented the BGE from being started from the command-line, the exec() function checked already. Also use API calls to find area, region.
-rw-r--r--source/blender/editors/space_view3d/view3d_view.c20
1 files changed, 9 insertions, 11 deletions
diff --git a/source/blender/editors/space_view3d/view3d_view.c b/source/blender/editors/space_view3d/view3d_view.c
index 529e5fcf756..9e16dc030b5 100644
--- a/source/blender/editors/space_view3d/view3d_view.c
+++ b/source/blender/editors/space_view3d/view3d_view.c
@@ -49,6 +49,7 @@
#include "BKE_main.h"
#include "BKE_report.h"
#include "BKE_scene.h"
+#include "BKE_screen.h"
#include "BIF_gl.h"
#include "BIF_glutil.h"
@@ -1568,7 +1569,6 @@ static int game_engine_poll(bContext *C)
if (CTX_wm_window(C) == NULL) return 0;
if ((screen = CTX_wm_screen(C)) == NULL) return 0;
- if (CTX_wm_area(C) == NULL) return 0;
if (CTX_data_mode_enum(C) != CTX_MODE_OBJECT)
return 0;
@@ -1586,20 +1586,18 @@ bool ED_view3d_context_activate(bContext *C)
ARegion *ar;
/* sa can be NULL when called from python */
- if (sa == NULL || sa->spacetype != SPACE_VIEW3D)
- for (sa = sc->areabase.first; sa; sa = sa->next)
- if (sa->spacetype == SPACE_VIEW3D)
- break;
+ if (sa == NULL || sa->spacetype != SPACE_VIEW3D) {
+ sa = BKE_screen_find_big_area(sc, SPACE_VIEW3D, 0);
+ }
- if (!sa)
+ if (sa == NULL) {
return false;
+ }
- for (ar = sa->regionbase.first; ar; ar = ar->next)
- if (ar->regiontype == RGN_TYPE_WINDOW)
- break;
-
- if (!ar)
+ ar = BKE_area_find_region_active_win(sa);
+ if (ar == NULL) {
return false;
+ }
/* bad context switch .. */
CTX_wm_area_set(C, sa);