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:
Diffstat (limited to 'source/blender/blenloader/intern/readfile.c')
-rw-r--r--source/blender/blenloader/intern/readfile.c44
1 files changed, 25 insertions, 19 deletions
diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c
index f37d24f9681..51d25b463a3 100644
--- a/source/blender/blenloader/intern/readfile.c
+++ b/source/blender/blenloader/intern/readfile.c
@@ -1920,6 +1920,25 @@ static void IDP_LibLinkProperty(IDProperty *UNUSED(prop), int UNUSED(switch_endi
{
}
+/* ************ READ IMAGE PREVIEW *************** */
+
+static PreviewImage *direct_link_preview_image(FileData *fd, PreviewImage *old_prv)
+{
+ PreviewImage *prv = newdataadr(fd, old_prv);
+
+ if (prv) {
+ int i;
+ for (i = 0; i < NUM_ICON_SIZES; ++i) {
+ if (prv->rect[i]) {
+ prv->rect[i] = newdataadr(fd, prv->rect[i]);
+ }
+ prv->gputexture[i] = NULL;
+ }
+ }
+
+ return prv;
+}
+
/* ************ READ ID *************** */
static void direct_link_id(FileData *fd, ID *id)
@@ -2042,25 +2061,6 @@ static PackedFile *direct_link_packedfile(FileData *fd, PackedFile *oldpf)
return pf;
}
-/* ************ READ IMAGE PREVIEW *************** */
-
-static PreviewImage *direct_link_preview_image(FileData *fd, PreviewImage *old_prv)
-{
- PreviewImage *prv = newdataadr(fd, old_prv);
-
- if (prv) {
- int i;
- for (i = 0; i < NUM_ICON_SIZES; ++i) {
- if (prv->rect[i]) {
- prv->rect[i] = newdataadr(fd, prv->rect[i]);
- }
- prv->gputexture[i] = NULL;
- }
- }
-
- return prv;
-}
-
/* ************ READ ANIMATION STUFF ***************** */
/* Legacy Data Support (for Version Patching) ----------------------------- */
@@ -5280,6 +5280,8 @@ static void direct_link_object(FileData *fd, Object *ob)
link_list(fd, &ob->lodlevels);
ob->currentlod = ob->lodlevels.first;
+
+ ob->preview = direct_link_preview_image(fd, ob->preview);
}
/* ************ READ SCENE ***************** */
@@ -5837,6 +5839,8 @@ static void direct_link_scene(FileData *fd, Scene *sce)
rbw->ltime = (float)rbw->pointcache->startframe;
}
}
+
+ sce->preview = direct_link_preview_image(fd, sce->preview);
}
/* ************ READ WM ***************** */
@@ -7083,6 +7087,8 @@ static void lib_link_sound(FileData *fd, Main *main)
static void direct_link_group(FileData *fd, Group *group)
{
link_list(fd, &group->gobject);
+
+ group->preview = direct_link_preview_image(fd, group->preview);
}
static void lib_link_group(FileData *fd, Main *main)