Changeset View
Changeset View
Standalone View
Standalone View
source/blender/blenloader/intern/readfile.c
- This file is larger than 256 KB, so syntax highlighting is disabled by default.
| Show First 20 Lines • Show All 1,885 Lines • ▼ Show 20 Lines | void blo_make_image_pointer_map(FileData *fd, Main *oldmain) | ||||
| int a; | int a; | ||||
| fd->imamap = oldnewmap_new(); | fd->imamap = oldnewmap_new(); | ||||
| for (; ima; ima = ima->id.next) { | for (; ima; ima = ima->id.next) { | ||||
| if (ima->cache) { | if (ima->cache) { | ||||
| oldnewmap_insert(fd->imamap, ima->cache, ima->cache, 0); | oldnewmap_insert(fd->imamap, ima->cache, ima->cache, 0); | ||||
| } | } | ||||
| for (int eye = 0; eye < 2; eye++) { | |||||
| for (a = 0; a < TEXTARGET_COUNT; a++) { | for (a = 0; a < TEXTARGET_COUNT; a++) { | ||||
| if (ima->gputexture[a] != NULL) { | if (ima->gputexture[a][eye] != NULL) { | ||||
| oldnewmap_insert(fd->imamap, ima->gputexture[a], ima->gputexture[a], 0); | oldnewmap_insert(fd->imamap, ima->gputexture[a][eye], ima->gputexture[a][eye], 0); | ||||
| } | |||||
| } | } | ||||
| } | } | ||||
| if (ima->rr) { | if (ima->rr) { | ||||
| oldnewmap_insert(fd->imamap, ima->rr, ima->rr, 0); | oldnewmap_insert(fd->imamap, ima->rr, ima->rr, 0); | ||||
| } | } | ||||
| LISTBASE_FOREACH (RenderSlot *, slot, &ima->renderslots) { | LISTBASE_FOREACH (RenderSlot *, slot, &ima->renderslots) { | ||||
| if (slot->render) { | if (slot->render) { | ||||
| oldnewmap_insert(fd->imamap, slot->render, slot->render, 0); | oldnewmap_insert(fd->imamap, slot->render, slot->render, 0); | ||||
| Show All 27 Lines | for (i = 0; i < fd->imamap->nentries; i++, entry++) { | ||||
| } | } | ||||
| } | } | ||||
| for (; ima; ima = ima->id.next) { | for (; ima; ima = ima->id.next) { | ||||
| ima->cache = newimaadr(fd, ima->cache); | ima->cache = newimaadr(fd, ima->cache); | ||||
| if (ima->cache == NULL) { | if (ima->cache == NULL) { | ||||
| ima->gpuflag = 0; | ima->gpuflag = 0; | ||||
| ima->gpuframenr = INT_MAX; | ima->gpuframenr = INT_MAX; | ||||
| for (int eye = 0; eye < 2; eye++) { | |||||
| for (i = 0; i < TEXTARGET_COUNT; i++) { | for (i = 0; i < TEXTARGET_COUNT; i++) { | ||||
| ima->gputexture[i] = NULL; | ima->gputexture[i][eye] = NULL; | ||||
| } | |||||
| } | } | ||||
| ima->rr = NULL; | ima->rr = NULL; | ||||
| } | } | ||||
| LISTBASE_FOREACH (RenderSlot *, slot, &ima->renderslots) { | LISTBASE_FOREACH (RenderSlot *, slot, &ima->renderslots) { | ||||
| slot->render = newimaadr(fd, slot->render); | slot->render = newimaadr(fd, slot->render); | ||||
| } | } | ||||
| for (int eye = 0; eye < 2; eye++) { | |||||
| for (i = 0; i < TEXTARGET_COUNT; i++) { | for (i = 0; i < TEXTARGET_COUNT; i++) { | ||||
| ima->gputexture[i] = newimaadr(fd, ima->gputexture[i]); | ima->gputexture[i][eye] = newimaadr(fd, ima->gputexture[i][eye]); | ||||
| } | |||||
| } | } | ||||
| ima->rr = newimaadr(fd, ima->rr); | ima->rr = newimaadr(fd, ima->rr); | ||||
| } | } | ||||
| for (; sce; sce = sce->id.next) { | for (; sce; sce = sce->id.next) { | ||||
| if (sce->nodetree && sce->nodetree->previews) { | if (sce->nodetree && sce->nodetree->previews) { | ||||
| bNodeInstanceHash *new_previews = BKE_node_instance_hash_new("node previews"); | bNodeInstanceHash *new_previews = BKE_node_instance_hash_new("node previews"); | ||||
| bNodeInstanceHashIterator iter; | bNodeInstanceHashIterator iter; | ||||
| ▲ Show 20 Lines • Show All 2,176 Lines • ▼ Show 20 Lines | static void direct_link_image(FileData *fd, Image *ima) | ||||
| } | } | ||||
| link_list(fd, &ima->tiles); | link_list(fd, &ima->tiles); | ||||
| /* if not restored, we keep the binded opengl index */ | /* if not restored, we keep the binded opengl index */ | ||||
| if (!ima->cache) { | if (!ima->cache) { | ||||
| ima->gpuflag = 0; | ima->gpuflag = 0; | ||||
| ima->gpuframenr = INT_MAX; | ima->gpuframenr = INT_MAX; | ||||
| for (int eye = 0; eye < 2; eye++) { | |||||
| for (int i = 0; i < TEXTARGET_COUNT; i++) { | for (int i = 0; i < TEXTARGET_COUNT; i++) { | ||||
| ima->gputexture[i] = NULL; | ima->gputexture[i][eye] = NULL; | ||||
| } | |||||
| } | } | ||||
| ima->rr = NULL; | ima->rr = NULL; | ||||
| } | } | ||||
| else { | else { | ||||
| for (int eye = 0; eye < 2; eye++) { | |||||
| for (int i = 0; i < TEXTARGET_COUNT; i++) { | for (int i = 0; i < TEXTARGET_COUNT; i++) { | ||||
| ima->gputexture[i] = newimaadr(fd, ima->gputexture[i]); | ima->gputexture[i][eye] = newimaadr(fd, ima->gputexture[i][eye]); | ||||
| } | |||||
| } | } | ||||
| ima->rr = newimaadr(fd, ima->rr); | ima->rr = newimaadr(fd, ima->rr); | ||||
| } | } | ||||
| /* undo system, try to restore render buffers */ | /* undo system, try to restore render buffers */ | ||||
| link_list(fd, &(ima->renderslots)); | link_list(fd, &(ima->renderslots)); | ||||
| if (fd->imamap) { | if (fd->imamap) { | ||||
| LISTBASE_FOREACH (RenderSlot *, slot, &ima->renderslots) { | LISTBASE_FOREACH (RenderSlot *, slot, &ima->renderslots) { | ||||
| ▲ Show 20 Lines • Show All 7,775 Lines • Show Last 20 Lines | |||||