Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/space_view3d/view3d_view.c
| Show First 20 Lines • Show All 1,635 Lines • ▼ Show 20 Lines | static void game_set_commmandline_options(GameData *gm) | ||||
| } | } | ||||
| } | } | ||||
| #endif /* WITH_GAMEENGINE */ | #endif /* WITH_GAMEENGINE */ | ||||
| static int game_engine_poll(bContext *C) | static int game_engine_poll(bContext *C) | ||||
| { | { | ||||
| bScreen *screen; | const wmWindow *win = CTX_wm_window(C); | ||||
| const Scene *scene = WM_window_get_active_scene(win); | |||||
| /* we need a context and area to launch BGE | /* we need a context and area to launch BGE | ||||
| * it's a temporary solution to avoid crash at load time | * it's a temporary solution to avoid crash at load time | ||||
| * if we try to auto run the BGE. Ideally we want the | * if we try to auto run the BGE. Ideally we want the | ||||
| * context to be set as soon as we load the file. */ | * context to be set as soon as we load the file. */ | ||||
| if (CTX_wm_window(C) == NULL) return 0; | if (win == NULL) return 0; | ||||
| if ((screen = CTX_wm_screen(C)) == NULL) return 0; | if (CTX_wm_screen(C) == NULL) return 0; | ||||
| if (CTX_data_mode_enum(C) != CTX_MODE_OBJECT) | if (CTX_data_mode_enum(C) != CTX_MODE_OBJECT) | ||||
| return 0; | return 0; | ||||
| if (!BKE_scene_uses_blender_game(screen->scene)) | if (!BKE_scene_uses_blender_game(scene)) | ||||
| return 0; | return 0; | ||||
| return 1; | return 1; | ||||
| } | } | ||||
| bool ED_view3d_context_activate(bContext *C) | bool ED_view3d_context_activate(bContext *C) | ||||
| { | { | ||||
| bScreen *sc = CTX_wm_screen(C); | bScreen *sc = CTX_wm_screen(C); | ||||
| ▲ Show 20 Lines • Show All 279 Lines • Show Last 20 Lines | |||||