diff options
Diffstat (limited to 'source/blender/blenloader/intern/readblenentry.c')
-rw-r--r-- | source/blender/blenloader/intern/readblenentry.c | 26 |
1 files changed, 8 insertions, 18 deletions
diff --git a/source/blender/blenloader/intern/readblenentry.c b/source/blender/blenloader/intern/readblenentry.c index 1f276913ea8..3d21bb54e2b 100644 --- a/source/blender/blenloader/intern/readblenentry.c +++ b/source/blender/blenloader/intern/readblenentry.c @@ -67,6 +67,10 @@ #include "BLO_sys_types.h" // needed for intptr_t +#ifdef _WIN32 +#include "BLI_winstuff.h" +#endif + /** * IDType stuff, I plan to move this * out into its own file + prefix, and @@ -95,7 +99,6 @@ static IDType idtypes[]= { { ID_IP, "Ipo", IDTYPE_FLAGS_ISLINKABLE}, { ID_KE, "Key", 0}, { ID_LA, "Lamp", IDTYPE_FLAGS_ISLINKABLE}, - { ID_LF, "Life", 0}, { ID_LI, "Library", 0}, { ID_LT, "Lattice", IDTYPE_FLAGS_ISLINKABLE}, { ID_MA, "Material", IDTYPE_FLAGS_ISLINKABLE}, @@ -106,7 +109,6 @@ static IDType idtypes[]= { { ID_SCE, "Scene", IDTYPE_FLAGS_ISLINKABLE}, { ID_SCR, "Screen", 0}, { ID_SEQ, "Sequence", 0}, - { ID_SE, "Sector", 0}, { ID_SO, "Sound", IDTYPE_FLAGS_ISLINKABLE}, { ID_TE, "Texture", IDTYPE_FLAGS_ISLINKABLE}, { ID_TXT, "Text", IDTYPE_FLAGS_ISLINKABLE}, @@ -200,7 +202,7 @@ void BLO_blendhandle_print_sizes(BlendHandle *bh, void *fp) buf[2]= buf[2]?buf[2]:' '; buf[3]= buf[3]?buf[3]:' '; - fprintf(fp, "['%.4s', '%s', %d, %ld ], \n", buf, name, bhead->nr, (intptr_t)bhead->len+sizeof(BHead)); + fprintf(fp, "['%.4s', '%s', %d, %ld ], \n", buf, name, bhead->nr, (long int)bhead->len+sizeof(BHead)); } } fprintf(fp, "]\n"); @@ -331,11 +333,7 @@ BlendFileData *BLO_read_from_file(char *file, ReportList *reports) fd = blo_openblenderfile(file, reports); if (fd) { fd->reports= reports; - bfd= blo_read_file_internal(fd); - if (bfd) { - bfd->type= BLENFILETYPE_BLEND; - strncpy(bfd->main->name, file, sizeof(bfd->main->name)-1); - } + bfd= blo_read_file_internal(fd, file); blo_freefiledata(fd); } @@ -350,11 +348,7 @@ BlendFileData *BLO_read_from_memory(void *mem, int memsize, ReportList *reports) fd = blo_openblendermemory(mem, memsize, reports); if (fd) { fd->reports= reports; - bfd= blo_read_file_internal(fd); - if (bfd) { - bfd->type= BLENFILETYPE_BLEND; - strcpy(bfd->main->name, ""); - } + bfd= blo_read_file_internal(fd, ""); blo_freefiledata(fd); } @@ -383,11 +377,7 @@ BlendFileData *BLO_read_from_memfile(Main *oldmain, const char *filename, MemFil /* makes lookup of existing images in old main */ blo_make_image_pointer_map(fd, oldmain); - bfd= blo_read_file_internal(fd); - if (bfd) { - bfd->type= BLENFILETYPE_BLEND; - strcpy(bfd->main->name, ""); - } + bfd= blo_read_file_internal(fd, ""); /* ensures relinked images are not freed */ blo_end_image_pointer_map(fd, oldmain); |