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:
authorCampbell Barton <ideasman42@gmail.com>2015-08-31 18:52:27 +0300
committerCampbell Barton <ideasman42@gmail.com>2015-08-31 18:52:27 +0300
commit929db33828fa86927da2996fa606ecfe522dd677 (patch)
tree0c2e6374fb71831b8441512afb779e602b098945 /source/blender/blenloader/intern/writefile.c
parent5f64b77ca5235465b52183d2ea519606253a354e (diff)
Write thumbnail directly
BlendThumbnail matches the on-disk format, so just write directly.
Diffstat (limited to 'source/blender/blenloader/intern/writefile.c')
-rw-r--r--source/blender/blenloader/intern/writefile.c9
1 files changed, 1 insertions, 8 deletions
diff --git a/source/blender/blenloader/intern/writefile.c b/source/blender/blenloader/intern/writefile.c
index 94f3237d919..6f7157e1a56 100644
--- a/source/blender/blenloader/intern/writefile.c
+++ b/source/blender/blenloader/intern/writefile.c
@@ -3691,14 +3691,7 @@ static void write_global(WriteData *wd, int fileflags, Main *mainvar)
static void write_thumb(WriteData *wd, const BlendThumbnail *thumb)
{
if (thumb) {
- size_t sz = BLEN_THUMB_MEMSIZE_FILE(thumb->width, thumb->height);
- int *img = alloca(sz);
-
- BLI_assert((sz - (sizeof(*img) * 2)) == (BLEN_THUMB_MEMSIZE(thumb->width, thumb->height) - sizeof(thumb)));
- img[0] = thumb->width;
- img[1] = thumb->height;
- memcpy(&img[2], thumb->rect, sz - (sizeof(*img) * 2));
- writedata(wd, TEST, sz, img);
+ writedata(wd, TEST, BLEN_THUMB_MEMSIZE_FILE(thumb->width, thumb->height), thumb);
}
}