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:
authorTon Roosendaal <ton@blender.org>2006-10-26 14:13:16 +0400
committerTon Roosendaal <ton@blender.org>2006-10-26 14:13:16 +0400
commit9f77785d7c8362abfb1d712a403e687cbb3d8ac7 (patch)
treebc952e466000047bd8c379cff8697a44ccd1d05a /source/blender/src/interface_icons.c
parentf0dcd2db75b488be000a8be310e1c8a65e85227e (diff)
Coding work while on the trip to london (based on Plumiferos wishlist);
- Icon previews for Images were created always for old files, which made browsing (menus) incredible slow. Added a minor change in the flow, so icons only get created when the user invokes loading images. Andrea; you might check this, probably not al cases are covered yet? - Compositor: the 'File Output' node now has a min/max frame for which it writes files - Compositor: fixed a very bad bug (even in 2.42a release) that made the depsgraph for nodes not work... while editing, only the nodes that change should be recalculated, but accidentally all of them were done each time.
Diffstat (limited to 'source/blender/src/interface_icons.c')
-rw-r--r--source/blender/src/interface_icons.c13
1 files changed, 4 insertions, 9 deletions
diff --git a/source/blender/src/interface_icons.c b/source/blender/src/interface_icons.c
index 36c0e766bc6..65930a53417 100644
--- a/source/blender/src/interface_icons.c
+++ b/source/blender/src/interface_icons.c
@@ -671,7 +671,6 @@ static void icon_copy_rect(ImBuf *ibuf, RenderInfo *ri)
static void icon_from_image(Image *img, RenderInfo *ri)
{
unsigned int pr_size = ri->pr_rectx*ri->pr_recty*sizeof(unsigned int);
- short image_loaded = 0;
/* img->ok is zero when Image cannot load */
if (img==NULL || img->ok==0)
@@ -684,27 +683,23 @@ static void icon_from_image(Image *img, RenderInfo *ri)
/* we only load image if there's no preview saved already ...
always loading and reducing images is too expensive */
+ /* new rule: never read images, so icons get created while user works,
+ not always on first use of a menu */
if(!img->preview) {
if(img->ibuf==NULL || img->ibuf->rect==NULL) {
- load_image(img, IB_rect, G.sce, G.scene->r.cfra);
- if(img->ok==0)
- return;
- image_loaded = 1;
+ return;
}
icon_copy_rect(img->ibuf, ri);
/* now copy the created preview to the DNA struct to be saved in file */
img->preview = MEM_callocN(sizeof(PreviewImage), "img_prv");
if (img->preview) {
+ printf("created image prv\n");
img->preview->w = ri->pr_rectx;
img->preview->h = ri->pr_recty;
img->preview->rect = MEM_callocN(pr_size, "prv_rect");
memcpy(img->preview->rect, ri->rect, pr_size);
}
-
- /* if we only loaded image for preview, we don't want to keep it in memory -
- important for huge image files */
- if (image_loaded) free_image_buffers(img);
}
else {
unsigned int img_prv_size = img->preview->w*img->preview->h*sizeof(unsigned int);