diff options
author | Campbell Barton <ideasman42@gmail.com> | 2012-08-08 12:25:20 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2012-08-08 12:25:20 +0400 |
commit | 206b7a6d1b378ff97e86e9e800c2a71f69b22856 (patch) | |
tree | f6de1bf94b569536edbfd8eaca6bb29d2cefadf3 /source/blender | |
parent | 9ccb8b8c408707093fcfd888b0b1e92a83c79727 (diff) |
skip loading file selector icons when running in background mode.
Diffstat (limited to 'source/blender')
-rw-r--r-- | source/blender/editors/space_file/filelist.c | 16 | ||||
-rw-r--r-- | source/blender/editors/space_file/space_file.c | 11 |
2 files changed, 23 insertions, 4 deletions
diff --git a/source/blender/editors/space_file/filelist.c b/source/blender/editors/space_file/filelist.c index a23cb86bb76..2160e2eb3a0 100644 --- a/source/blender/editors/space_file/filelist.c +++ b/source/blender/editors/space_file/filelist.c @@ -383,6 +383,9 @@ void filelist_init_icons(void) short x, y, k; ImBuf *bbuf; ImBuf *ibuf; + + BLI_assert(G.background == FALSE); + #ifdef WITH_HEADLESS bbuf = NULL; #else @@ -408,6 +411,9 @@ void filelist_init_icons(void) void filelist_free_icons(void) { int i; + + BLI_assert(G.background == FALSE); + for (i = 0; i < SPECIAL_IMG_MAX; ++i) { IMB_freeImBuf(gSpecialFileImages[i]); gSpecialFileImages[i] = NULL; @@ -615,7 +621,10 @@ short filelist_changed(struct FileList *filelist) ImBuf *filelist_getimage(struct FileList *filelist, int index) { ImBuf *ibuf = NULL; - int fidx = 0; + int fidx = 0; + + BLI_assert(G.background == FALSE); + if ( (index < 0) || (index >= filelist->numfiltered) ) { return NULL; } @@ -629,7 +638,10 @@ ImBuf *filelist_geticon(struct FileList *filelist, int index) { ImBuf *ibuf = NULL; struct direntry *file = NULL; - int fidx = 0; + int fidx = 0; + + BLI_assert(G.background == FALSE); + if ( (index < 0) || (index >= filelist->numfiltered) ) { return NULL; } diff --git a/source/blender/editors/space_file/space_file.c b/source/blender/editors/space_file/space_file.c index 95d5483b42c..17669dfa8f9 100644 --- a/source/blender/editors/space_file/space_file.c +++ b/source/blender/editors/space_file/space_file.c @@ -48,6 +48,7 @@ #include "BKE_context.h" #include "BKE_screen.h" +#include "BKE_global.h" #include "ED_space_api.h" #include "ED_screen.h" @@ -624,12 +625,18 @@ void ED_file_init(void) fsmenu_read_bookmarks(fsmenu_get(), name); } - filelist_init_icons(); + if (G.background == FALSE) { + filelist_init_icons(); + } + IMB_thumb_makedirs(); } void ED_file_exit(void) { fsmenu_free(fsmenu_get()); - filelist_free_icons(); + + if (G.background == FALSE) { + filelist_free_icons(); + } } |