diff options
author | Andrea Weikert <elubie@gmx.net> | 2006-06-15 15:23:51 +0400 |
---|---|---|
committer | Andrea Weikert <elubie@gmx.net> | 2006-06-15 15:23:51 +0400 |
commit | ba5880aa7352e36effea7e3a16148245fbc84f0b (patch) | |
tree | b48a1404d2b13329756ff45d88068dbb382b3f51 /source | |
parent | 680eed3758b2ad8767d43361d0a024792bf2a6d7 (diff) |
=== preview icons ===
- changed preview type of halo materials
- halo materials are also shown with alpha=255 like in preview window
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/src/interface_icons.c | 23 | ||||
-rw-r--r-- | source/blender/src/previewrender.c | 7 |
2 files changed, 22 insertions, 8 deletions
diff --git a/source/blender/src/interface_icons.c b/source/blender/src/interface_icons.c index dd131a61011..9d759b7aa6d 100644 --- a/source/blender/src/interface_icons.c +++ b/source/blender/src/interface_icons.c @@ -716,6 +716,15 @@ static void icon_from_image(Image *img, RenderInfo *ri) } } +static void set_alpha(char* cp, int sizex, int sizey, char alpha) +{ + int x,y; + for(y=0; y<sizey; y++) { + for(x=0; x<sizex; x++, cp+=4) { + cp[3]= alpha; + } + } +} /* only called when icon has changed */ /* only call with valid pointer from BIF_icon_draw */ @@ -743,13 +752,13 @@ static void icon_set_image(ID *id, DrawInfo *di) /* world is rendered with alpha=0, so it wasn't displayed this could be render option for sky to, for later */ if (GS(id->name) == ID_WO) { - char* cp= (char *)(ri.rect); - int x,y; - for(y=0; y<ri.pr_recty; y++) { - for(x=0; x<ri.pr_rectx; x++, cp+=4) { - cp[3]= 255; - } - } + set_alpha( (char*) ri.rect, ri.pr_rectx, ri.pr_recty, 255); + } + else if (GS(id->name) == ID_MA) { + Material* mat = (Material*)id; + if (mat->mode & MA_HALO) { + set_alpha( (char*) ri.rect, ri.pr_rectx, ri.pr_recty, 255); + } } } diff --git a/source/blender/src/previewrender.c b/source/blender/src/previewrender.c index 44ce6b2333d..3cffc37d454 100644 --- a/source/blender/src/previewrender.c +++ b/source/blender/src/previewrender.c @@ -292,7 +292,12 @@ static Scene *preview_prepare_scene(RenderInfo *ri, int id_type, ID *id, int pr_ if(pr_method==PR_ICON_RENDER) { - sce->lay= 1<<MA_SPHERE_A; + if (mat->mode & MA_HALO) { + sce->lay= 1<<MA_FLAT; + } + else { + sce->lay= 1<<MA_SPHERE_A; + } } else { sce->lay= 1<<mat->pr_type; |