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:
authorAndrea Weikert <elubie@gmx.net>2006-06-15 15:23:51 +0400
committerAndrea Weikert <elubie@gmx.net>2006-06-15 15:23:51 +0400
commitba5880aa7352e36effea7e3a16148245fbc84f0b (patch)
treeb48a1404d2b13329756ff45d88068dbb382b3f51 /source/blender/src/interface_icons.c
parent680eed3758b2ad8767d43361d0a024792bf2a6d7 (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/blender/src/interface_icons.c')
-rw-r--r--source/blender/src/interface_icons.c23
1 files changed, 16 insertions, 7 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);
+ }
}
}