From c66570f519fb24e0c3fb724d7b6d38f4b6fd7ffc Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Thu, 22 Nov 2018 14:57:41 +1100 Subject: Fix T57989: File loaded as startup The file contents was used to check if the file was a startup file. Now pass in an argument from startup loading code instead. --- source/blender/blenloader/BLO_readfile.h | 14 +++++++++++--- source/blender/blenloader/intern/readblenentry.c | 9 ++++++--- source/blender/blenloader/intern/undofile.c | 2 +- 3 files changed, 18 insertions(+), 7 deletions(-) (limited to 'source/blender/blenloader') diff --git a/source/blender/blenloader/BLO_readfile.h b/source/blender/blenloader/BLO_readfile.h index 11f34732cfc..5a1c479f450 100644 --- a/source/blender/blenloader/BLO_readfile.h +++ b/source/blender/blenloader/BLO_readfile.h @@ -48,6 +48,7 @@ struct View3D; struct bContext; struct BHead; struct FileData; +struct BlendFileReadParams; typedef struct BlendHandle BlendHandle; @@ -71,6 +72,10 @@ typedef struct BlendFileData { eBlenFileType type; } BlendFileData; +struct BlendFileReadParams { + uint skip_flags : 2; /* eBLOReadSkip */ + uint is_startup : 1; +}; /* skip reading some data-block types (may want to skip screen data too). */ typedef enum eBLOReadSkip { @@ -83,13 +88,16 @@ typedef enum eBLOReadSkip { BlendFileData *BLO_read_from_file( const char *filepath, - struct ReportList *reports, eBLOReadSkip skip_flag); + eBLOReadSkip skip_flags, + struct ReportList *reports); BlendFileData *BLO_read_from_memory( const void *mem, int memsize, - struct ReportList *reports, eBLOReadSkip skip_flag); + eBLOReadSkip skip_flags, + struct ReportList *reports); BlendFileData *BLO_read_from_memfile( struct Main *oldmain, const char *filename, struct MemFile *memfile, - struct ReportList *reports, eBLOReadSkip skip_flag); + eBLOReadSkip skip_flags, + struct ReportList *reports); void BLO_blendfiledata_free(BlendFileData *bfd); diff --git a/source/blender/blenloader/intern/readblenentry.c b/source/blender/blenloader/intern/readblenentry.c index 7488d62bb3c..b2bcf745eac 100644 --- a/source/blender/blenloader/intern/readblenentry.c +++ b/source/blender/blenloader/intern/readblenentry.c @@ -319,7 +319,8 @@ void BLO_blendhandle_close(BlendHandle *bh) */ BlendFileData *BLO_read_from_file( const char *filepath, - ReportList *reports, eBLOReadSkip skip_flags) + eBLOReadSkip skip_flags, + ReportList *reports) { BlendFileData *bfd = NULL; FileData *fd; @@ -346,7 +347,8 @@ BlendFileData *BLO_read_from_file( */ BlendFileData *BLO_read_from_memory( const void *mem, int memsize, - ReportList *reports, eBLOReadSkip skip_flags) + eBLOReadSkip skip_flags, + ReportList *reports) { BlendFileData *bfd = NULL; FileData *fd; @@ -370,7 +372,8 @@ BlendFileData *BLO_read_from_memory( */ BlendFileData *BLO_read_from_memfile( Main *oldmain, const char *filename, MemFile *memfile, - ReportList *reports, eBLOReadSkip skip_flags) + eBLOReadSkip skip_flags, + ReportList *reports) { BlendFileData *bfd = NULL; FileData *fd; diff --git a/source/blender/blenloader/intern/undofile.c b/source/blender/blenloader/intern/undofile.c index 614a3be559b..37cd69b72f2 100644 --- a/source/blender/blenloader/intern/undofile.c +++ b/source/blender/blenloader/intern/undofile.c @@ -130,7 +130,7 @@ void memfile_chunk_add( struct Main *BLO_memfile_main_get(struct MemFile *memfile, struct Main *oldmain, struct Scene **r_scene) { struct Main *bmain_undo = NULL; - BlendFileData *bfd = BLO_read_from_memfile(oldmain, BKE_main_blendfile_path(oldmain), memfile, NULL, BLO_READ_SKIP_NONE); + BlendFileData *bfd = BLO_read_from_memfile(oldmain, BKE_main_blendfile_path(oldmain), memfile, BLO_READ_SKIP_NONE, NULL); if (bfd) { bmain_undo = bfd->main; -- cgit v1.2.3