svn merge -r 16320:16369 https://svn.blender.org/svnroot/bf-blender/trunk/blender
[blender-staging.git] / source / blender / blenloader / intern / readfile.c
index ea226d9c2203e904946e1b50d7100c5c7339a3dc..b96ca9f3739127b042fb63468520c428dd4e5beb 100644 (file)
@@ -1141,6 +1141,8 @@ void blo_make_image_pointer_map(FileData *fd)
                Link *ibuf= ima->ibufs.first;
                for(; ibuf; ibuf= ibuf->next) 
                        oldnewmap_insert(fd->imamap, ibuf, ibuf, 0);
+               if(ima->gputexture)
+                       oldnewmap_insert(fd->imamap, ima->gputexture, ima->gputexture, 0);
        }
        for(; sce; sce= sce->id.next) {
                if(sce->nodetree) {
@@ -1175,8 +1177,11 @@ void blo_end_image_pointer_map(FileData *fd)
                        if(NULL==newimaadr(fd, ibuf)) { /* so was restored */
                                BLI_remlink(&ima->ibufs, ibuf);
                                ima->bindcode= 0;
+                               ima->gputexture= NULL;
                        }
                }
+
+               ima->gputexture= newimaadr(fd, ima->gputexture);
        }
        for(; sce; sce= sce->id.next) {
                if(sce->nodetree) {
@@ -2276,6 +2281,7 @@ static void direct_link_text(FileData *fd, Text *text)
 */
 
        link_list(fd, &text->lines);
+       link_list(fd, &text->markers);
 
        text->curl= newdataadr(fd, text->curl);
        text->sell= newdataadr(fd, text->sell);
@@ -2342,8 +2348,10 @@ static void direct_link_image(FileData *fd, Image *ima)
                ima->ibufs.first= ima->ibufs.last= NULL;
        
        /* if not restored, we keep the binded opengl index */
-       if(ima->ibufs.first==NULL)
+       if(ima->ibufs.first==NULL) {
                ima->bindcode= 0;
+               ima->gputexture= NULL;
+       }
        
        ima->anim= NULL;
        ima->rr= NULL;
@@ -2554,6 +2562,7 @@ static void direct_link_material(FileData *fd, Material *ma)
                direct_link_nodetree(fd, ma->nodetree);
 
        ma->preview = direct_link_preview_image(fd, ma->preview);
+       ma->gpumaterial.first = ma->gpumaterial.last = NULL;
 }
 
 /* ************ READ PARTICLE SETTINGS ***************** */
@@ -3393,6 +3402,7 @@ static void direct_link_object(FileData *fd, Object *ob)
        ob->bb= NULL;
        ob->derivedDeform= NULL;
        ob->derivedFinal= NULL;
+       ob->gpulamp.first= ob->gpulamp.last= NULL;
 }
 
 /* ************ READ SCENE ***************** */