[Bf-blender-cvs] [4e9d0af] gooseberry: Link main CacheLibrary pointers in readfile.

Lukas Tönne noreply at git.blender.org
Mon Mar 23 13:00:46 CET 2015


Commit: 4e9d0af4af0c36216c9e499589737c9473ed650c
Author: Lukas Tönne
Date:   Mon Feb 23 14:03:46 2015 +0100
Branches: gooseberry
https://developer.blender.org/rB4e9d0af4af0c36216c9e499589737c9473ed650c

Link main CacheLibrary pointers in readfile.

===================================================================

M	source/blender/blenloader/intern/readfile.c
M	source/blender/blenloader/intern/writefile.c

===================================================================

diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c
index abc04f7..6d6acc0 100644
--- a/source/blender/blenloader/intern/readfile.c
+++ b/source/blender/blenloader/intern/readfile.c
@@ -1980,16 +1980,22 @@ static void direct_link_script(FileData *UNUSED(fd), Script *script)
 
 /* ************ READ CacheLibrary *************** */
 
-static void lib_link_cache_library(FileData *UNUSED(fd), Main *main)
+static void lib_link_cache_library(FileData *fd, Main *main)
 {
 	CacheLibrary *cachelib;
 	for (cachelib = main->cache_library.first; cachelib; cachelib = cachelib->id.next) {
-		cachelib->id.us = 1;
+		if (cachelib->id.flag & LIB_NEED_LINK) {
+			cachelib->id.flag -= LIB_NEED_LINK;
+			
+			cachelib->group = newlibadr_us(fd, cachelib->id.lib, cachelib->group);
+		}
 	}
 }
 
-static void direct_link_cache_library(FileData *UNUSED(fd), CacheLibrary *UNUSED(cachelib))
+static void direct_link_cache_library(FileData *fd, CacheLibrary *cachelib)
 {
+	link_list(fd, &cachelib->items);
+	cachelib->items_hash = NULL;
 }
 
 
diff --git a/source/blender/blenloader/intern/writefile.c b/source/blender/blenloader/intern/writefile.c
index ca07a05..b5ed8a6 100644
--- a/source/blender/blenloader/intern/writefile.c
+++ b/source/blender/blenloader/intern/writefile.c
@@ -3491,12 +3491,17 @@ static void write_linestyles(WriteData *wd, ListBase *idbase)
 static void write_cachelibraries(WriteData *wd, ListBase *idbase)
 {
 	CacheLibrary *cachelib;
+	CacheItem *item;
 
 	for (cachelib = idbase->first; cachelib; cachelib = cachelib->id.next) {
 		if (cachelib->id.us > 0 || wd->current) {
 			writestruct(wd, ID_CL, "CacheLibrary", 1, cachelib);
 			if (cachelib->id.properties)
 				IDP_WriteProperty(cachelib->id.properties, wd);
+			
+			for (item = cachelib->items.first; item; item = item->next) {
+				writestruct(wd, DATA, "CacheItem", 1, item);
+			}
 		}
 	}
 }




More information about the Bf-blender-cvs mailing list