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:
authorDalai Felinto <dfelinto@gmail.com>2010-03-05 13:37:55 +0300
committerDalai Felinto <dfelinto@gmail.com>2010-03-05 13:37:55 +0300
commit8f5c9f64e2de8a9d16a83855fdec3455c3e2670f (patch)
tree96d902c84bf0f6e7ac8844fa013421bc478520b6 /source/blender/windowmanager
parent4eeb6b5755c4a2f7aa1fe180cd438460c244852a (diff)
Bringing back "Auto Start" option in the Game Menu.
It's (still) not working since the pool in the operator will not allow this operator to run without context. For the window/area/screen has to be created somewhere (maybe in WM_init_game ). I have no idea on what should be done to initialize it here, so if anyone knows how to proceed, please help here. * side note: should we also have it as a command line option?
Diffstat (limited to 'source/blender/windowmanager')
-rw-r--r--source/blender/windowmanager/WM_api.h1
-rw-r--r--source/blender/windowmanager/intern/wm_files.c7
-rw-r--r--source/blender/windowmanager/intern/wm_init_exit.c14
3 files changed, 20 insertions, 2 deletions
diff --git a/source/blender/windowmanager/WM_api.h b/source/blender/windowmanager/WM_api.h
index 82788dc962b..7a1a14b645d 100644
--- a/source/blender/windowmanager/WM_api.h
+++ b/source/blender/windowmanager/WM_api.h
@@ -57,6 +57,7 @@ void WM_init (struct bContext *C, int argc, char **argv);
void WM_exit (struct bContext *C);
void WM_main (struct bContext *C);
+void WM_init_game (struct bContext *C);
void WM_init_splash (struct bContext *C);
diff --git a/source/blender/windowmanager/intern/wm_files.c b/source/blender/windowmanager/intern/wm_files.c
index 2ab6f78daa5..2a8091c1aa2 100644
--- a/source/blender/windowmanager/intern/wm_files.c
+++ b/source/blender/windowmanager/intern/wm_files.c
@@ -523,6 +523,9 @@ void WM_write_file(bContext *C, char *target, int fileflags, ReportList *reports
if(fileflags & G_FILE_COMPRESS) G.fileflags |= G_FILE_COMPRESS;
else G.fileflags &= ~G_FILE_COMPRESS;
+ if(fileflags & G_FILE_AUTOPLAY) G.fileflags |= G_FILE_AUTOPLAY;
+ else G.fileflags &= ~G_FILE_AUTOPLAY;
+
writeBlog();
}
@@ -544,7 +547,7 @@ int WM_write_homefile(bContext *C, wmOperator *op)
BLI_make_file_string("/", tstr, BLI_gethome(), ".B25.blend");
/* force save as regular blend file */
- fileflags = G.fileflags & ~(G_FILE_COMPRESS | G_FILE_LOCK | G_FILE_SIGN);
+ fileflags = G.fileflags & ~(G_FILE_COMPRESS | G_FILE_AUTOPLAY | G_FILE_LOCK | G_FILE_SIGN);
BLO_write_file(CTX_data_main(C), tstr, fileflags, op->reports);
@@ -612,7 +615,7 @@ void wm_autosave_timer(const bContext *C, wmWindowManager *wm, wmTimer *wt)
wm_autosave_location(filename);
/* force save as regular blend file */
- fileflags = G.fileflags & ~(G_FILE_COMPRESS|G_FILE_LOCK|G_FILE_SIGN);
+ fileflags = G.fileflags & ~(G_FILE_COMPRESS|G_FILE_AUTOPLAY |G_FILE_LOCK|G_FILE_SIGN);
/* no error reporting to console */
BLO_write_file(CTX_data_main(C), filename, fileflags, NULL);
diff --git a/source/blender/windowmanager/intern/wm_init_exit.c b/source/blender/windowmanager/intern/wm_init_exit.c
index dadc6b60616..449c586c178 100644
--- a/source/blender/windowmanager/intern/wm_init_exit.c
+++ b/source/blender/windowmanager/intern/wm_init_exit.c
@@ -181,6 +181,20 @@ void WM_init_splash(bContext *C)
}
}
+void WM_init_game(bContext *C)
+{
+ //XXX copied from WM_init_splash we may not even need those "window" related code
+ //XXX not working yet, it fails at the game_start_operator pool (it needs an area)
+ wmWindowManager *wm= CTX_wm_manager(C);
+ wmWindow *prevwin= CTX_wm_window(C);
+
+ if(wm->windows.first) {
+ CTX_wm_window_set(C, wm->windows.first);
+ WM_operator_name_call(C, "VIEW3D_OT_game_start", WM_OP_EXEC_DEFAULT, NULL);
+ CTX_wm_window_set(C, prevwin);
+ }
+}
+
/* free strings of open recent files */
static void free_openrecent(void)
{