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:
authorJoerg Mueller <nexyon@gmail.com>2009-08-27 13:52:41 +0400
committerJoerg Mueller <nexyon@gmail.com>2009-08-27 13:52:41 +0400
commit12a0f2c0987688b2fcf8daf44d9462b524fe139a (patch)
tree82c26e40758920d76efad3a8c88f842e871f609b
parent55f82852ca4a88080bf9928445e52d24330a4889 (diff)
Fix for sounds with relative paths not being loaded correctly.
-rw-r--r--source/blender/blenloader/intern/readblenentry.c18
-rw-r--r--source/blender/blenloader/intern/readfile.c7
-rw-r--r--source/blender/blenloader/intern/readfile.h2
3 files changed, 9 insertions, 18 deletions
diff --git a/source/blender/blenloader/intern/readblenentry.c b/source/blender/blenloader/intern/readblenentry.c
index 1f276913ea8..ac561eb6186 100644
--- a/source/blender/blenloader/intern/readblenentry.c
+++ b/source/blender/blenloader/intern/readblenentry.c
@@ -331,11 +331,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 +346,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 +375,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);
diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c
index 6771135a772..5d61e3d305e 100644
--- a/source/blender/blenloader/intern/readfile.c
+++ b/source/blender/blenloader/intern/readfile.c
@@ -9700,7 +9700,7 @@ static BHead *read_userdef(BlendFileData *bfd, FileData *fd, BHead *bhead)
return bhead;
}
-BlendFileData *blo_read_file_internal(FileData *fd)
+BlendFileData *blo_read_file_internal(FileData *fd, char *file)
{
BHead *bhead= blo_firstbhead(fd);
BlendFileData *bfd;
@@ -9711,6 +9711,9 @@ BlendFileData *blo_read_file_internal(FileData *fd)
bfd->main->versionfile= fd->fileversion;
+ bfd->type= BLENFILETYPE_BLEND;
+ strncpy(bfd->main->name, file, sizeof(bfd->main->name)-1);
+
while(bhead) {
switch(bhead->code) {
case DATA:
@@ -11131,7 +11134,7 @@ BlendFileData *blo_read_blendafterruntime(int file, char *name, int actualsize,
return NULL;
fd->reports= reports;
- bfd= blo_read_file_internal(fd);
+ bfd= blo_read_file_internal(fd, "");
blo_freefiledata(fd);
return bfd;
diff --git a/source/blender/blenloader/intern/readfile.h b/source/blender/blenloader/intern/readfile.h
index e39fefa8205..2a0b6c327d3 100644
--- a/source/blender/blenloader/intern/readfile.h
+++ b/source/blender/blenloader/intern/readfile.h
@@ -108,7 +108,7 @@ struct Main;
void blo_join_main(ListBase *mainlist);
void blo_split_main(ListBase *mainlist, struct Main *main);
-BlendFileData *blo_read_file_internal(FileData *fd);
+BlendFileData *blo_read_file_internal(FileData *fd, char *file);
FileData *blo_openblenderfile(char *name, struct ReportList *reports);
FileData *blo_openblendermemory(void *buffer, int buffersize, struct ReportList *reports);