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:
Diffstat (limited to 'source/blender/blenkernel/intern/blender.c')
-rw-r--r--source/blender/blenkernel/intern/blender.c52
1 files changed, 26 insertions, 26 deletions
diff --git a/source/blender/blenkernel/intern/blender.c b/source/blender/blenkernel/intern/blender.c
index 81f3aeeffb6..590b9f7e476 100644
--- a/source/blender/blenkernel/intern/blender.c
+++ b/source/blender/blenkernel/intern/blender.c
@@ -48,45 +48,32 @@
#include "MEM_guardedalloc.h"
-#include "DNA_curve_types.h"
-#include "DNA_listBase.h"
-#include "DNA_sdna_types.h"
#include "DNA_userdef_types.h"
-#include "DNA_object_types.h"
-#include "DNA_mesh_types.h"
#include "DNA_scene_types.h"
#include "DNA_screen_types.h"
-#include "DNA_sound_types.h"
#include "DNA_sequence_types.h"
#include "BLI_blenlib.h"
#include "BLI_dynstr.h"
+#include "BLI_path_util.h"
-#include "IMB_imbuf_types.h"
#include "IMB_imbuf.h"
-#include "BKE_animsys.h"
-#include "BKE_action.h"
#include "BKE_blender.h"
#include "BKE_context.h"
-#include "BKE_curve.h"
#include "BKE_depsgraph.h"
#include "BKE_displist.h"
-#include "BKE_font.h"
#include "BKE_global.h"
#include "BKE_idprop.h"
-#include "BKE_library.h"
#include "BKE_ipo.h"
+#include "BKE_library.h"
#include "BKE_main.h"
#include "BKE_node.h"
-#include "BKE_object.h"
#include "BKE_report.h"
#include "BKE_scene.h"
#include "BKE_screen.h"
#include "BKE_sequencer.h"
-#include "BKE_sound.h"
-#include "BLI_editVert.h"
#include "BLO_undofile.h"
#include "BLO_readfile.h"
@@ -114,7 +101,7 @@ void free_blender(void)
BKE_spacetypes_free(); /* after free main, it uses space callbacks */
- IMB_freeImBufdata(); /* imbuf lib */
+ IMB_exit();
free_nodesystem();
}
@@ -144,6 +131,8 @@ void initglobals(void)
G.charstart = 0x0000;
G.charmin = 0x0000;
G.charmax = 0xffff;
+
+ G.f |= G_SCRIPT_AUTOEXEC;
}
/***/
@@ -290,6 +279,8 @@ static void setup_app_data(bContext *C, BlendFileData *bfd, char *filename)
else bfd->globalf &= ~G_DEBUG;
if (G.f & G_SWAP_EXCHANGE) bfd->globalf |= G_SWAP_EXCHANGE;
else bfd->globalf &= ~G_SWAP_EXCHANGE;
+ if (G.f & G_SCRIPT_AUTOEXEC) bfd->globalf |= G_SCRIPT_AUTOEXEC;
+ else bfd->globalf &= ~G_SCRIPT_AUTOEXEC;
G.f= bfd->globalf;
@@ -297,14 +288,22 @@ static void setup_app_data(bContext *C, BlendFileData *bfd, char *filename)
//setscreen(G.curscreen);
}
- // XXX temporarily here
- if(G.main->versionfile < 250)
- do_versions_ipos_to_animato(G.main); // XXX fixme... complicated versionpatching
+ // FIXME: this version patching should really be part of the file-reading code,
+ // but we still get too many unrelated data-corruption crashes otherwise...
+ if (G.main->versionfile < 250)
+ do_versions_ipos_to_animato(G.main);
- /* in case of autosave or quit.blend, use original filename instead
- * use relbase_valid to make sure the file is saved, else we get <memory2> in the filename */
- if(recover && bfd->filename[0] && G.relbase_valid)
+ if(recover && bfd->filename[0] && G.relbase_valid) {
+ /* in case of autosave or quit.blend, use original filename instead
+ * use relbase_valid to make sure the file is saved, else we get <memory2> in the filename */
filename= bfd->filename;
+ }
+#if 0
+ else if (!G.relbase_valid) {
+ /* otherwise, use an empty string as filename, rather than <memory2> */
+ filename="";
+ }
+#endif
/* these are the same at times, should never copy to the same location */
if(G.sce != filename)
@@ -314,8 +313,6 @@ static void setup_app_data(bContext *C, BlendFileData *bfd, char *filename)
/* baseflags, groups, make depsgraph, etc */
set_scene_bg(CTX_data_scene(C));
-
- DAG_on_load_update();
MEM_freeN(bfd);
}
@@ -370,7 +367,7 @@ int BKE_read_file(bContext *C, char *dir, void *unused, ReportList *reports)
BlendFileData *bfd;
int retval= 1;
- if(strstr(dir, ".B25.blend")==0) /* dont print user-pref loading */
+ if(strstr(dir, BLENDER_STARTUP_FILE)==0) /* dont print user-pref loading */
printf("read blend: %s\n", dir);
bfd= BLO_read_from_file(dir, reports);
@@ -479,6 +476,9 @@ static int read_undosave(bContext *C, UndoElem *uel)
strcpy(G.sce, scestr);
G.fileflags= fileflags;
+ if(success)
+ DAG_on_load_update();
+
return success;
}
@@ -537,7 +537,7 @@ void BKE_write_undo(bContext *C, char *name)
sprintf(numstr, "%d.blend", counter);
BLI_make_file_string("/", tstr, btempdir, numstr);
- success= BLO_write_file(CTX_data_main(C), tstr, G.fileflags, NULL);
+ success= BLO_write_file(CTX_data_main(C), tstr, G.fileflags, NULL, NULL);
strcpy(curundo->str, tstr);
}