diff options
Diffstat (limited to 'source/blender/blenloader/intern/readfile.c')
-rw-r--r-- | source/blender/blenloader/intern/readfile.c | 38 |
1 files changed, 26 insertions, 12 deletions
diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index e7a2390b2c4..2a51a57f887 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -1909,9 +1909,11 @@ void blo_make_image_pointer_map(FileData *fd, Main *oldmain) if (ima->cache) { oldnewmap_insert(fd->imamap, ima->cache, ima->cache, 0); } - for (a = 0; a < TEXTARGET_COUNT; a++) { - if (ima->gputexture[a]) { - oldnewmap_insert(fd->imamap, ima->gputexture[a], ima->gputexture[a], 0); + LISTBASE_FOREACH (ImageTile *, tile, &ima->tiles) { + for (a = 0; a < TEXTARGET_COUNT; a++) { + if (tile->gputexture[a] != NULL) { + oldnewmap_insert(fd->imamap, tile->gputexture[a], tile->gputexture[a], 0); + } } } if (ima->rr) { @@ -1955,8 +1957,10 @@ void blo_end_image_pointer_map(FileData *fd, Main *oldmain) if (ima->cache == NULL) { ima->gpuflag = 0; ima->gpuframenr = INT_MAX; - for (i = 0; i < TEXTARGET_COUNT; i++) { - ima->gputexture[i] = NULL; + LISTBASE_FOREACH (ImageTile *, tile, &ima->tiles) { + for (i = 0; i < TEXTARGET_COUNT; i++) { + tile->gputexture[i] = NULL; + } } ima->rr = NULL; } @@ -1964,8 +1968,10 @@ void blo_end_image_pointer_map(FileData *fd, Main *oldmain) slot->render = newimaadr(fd, slot->render); } - for (i = 0; i < TEXTARGET_COUNT; i++) { - ima->gputexture[i] = newimaadr(fd, ima->gputexture[i]); + LISTBASE_FOREACH (ImageTile *, tile, &ima->tiles) { + for (i = 0; i < TEXTARGET_COUNT; i++) { + tile->gputexture[i] = newimaadr(fd, tile->gputexture[i]); + } } ima->rr = newimaadr(fd, ima->rr); } @@ -4256,18 +4262,24 @@ static void direct_link_image(FileData *fd, Image *ima) ima->cache = NULL; } + link_list(fd, &ima->tiles); + /* if not restored, we keep the binded opengl index */ if (!ima->cache) { ima->gpuflag = 0; ima->gpuframenr = INT_MAX; - for (int i = 0; i < TEXTARGET_COUNT; i++) { - ima->gputexture[i] = NULL; + LISTBASE_FOREACH (ImageTile *, tile, &ima->tiles) { + for (int i = 0; i < TEXTARGET_COUNT; i++) { + tile->gputexture[i] = NULL; + } } ima->rr = NULL; } else { - for (int i = 0; i < TEXTARGET_COUNT; i++) { - ima->gputexture[i] = newimaadr(fd, ima->gputexture[i]); + LISTBASE_FOREACH (ImageTile *, tile, &ima->tiles) { + for (int i = 0; i < TEXTARGET_COUNT; i++) { + tile->gputexture[i] = newimaadr(fd, tile->gputexture[i]); + } } ima->rr = newimaadr(fd, ima->rr); } @@ -4302,7 +4314,9 @@ static void direct_link_image(FileData *fd, Image *ima) BLI_listbase_clear(&ima->anims); ima->preview = direct_link_preview_image(fd, ima->preview); ima->stereo3d_format = newdataadr(fd, ima->stereo3d_format); - ima->ok = 1; + LISTBASE_FOREACH (ImageTile *, tile, &ima->tiles) { + tile->ok = 1; + } } /** \} */ |