diff options
author | Ton Roosendaal <ton@blender.org> | 2006-01-11 17:20:35 +0300 |
---|---|---|
committer | Ton Roosendaal <ton@blender.org> | 2006-01-11 17:20:35 +0300 |
commit | 1eee258449cd446aa0d9a503e45e3602ee4bc17c (patch) | |
tree | d81cb11205b88dd7fadc130171fd2fc9ea77b4ad /source/blender/src/header_image.c | |
parent | 305fdec0eb3cfb166d2a5fd56382af5372b657e3 (diff) |
Orange: ImageWindow goodies
- options to show with alpha-over (checkered backdrop), only alpha (BW) and
when available: the zbuffer.
Note: it's icons in the header, I just re-used existing ones, no time now
for fancy design. :)
Also: recoded the way alpha-only draws, also in renderwindow. Mucho faster!
Oh, and sampling the buffer with LMB now displays z values in float range
of 0.0 to 1.0. Note that we still save signed int in files for Z...
Diffstat (limited to 'source/blender/src/header_image.c')
-rw-r--r-- | source/blender/src/header_image.c | 30 |
1 files changed, 28 insertions, 2 deletions
diff --git a/source/blender/src/header_image.c b/source/blender/src/header_image.c index 7bb7787d40a..29546276fd8 100644 --- a/source/blender/src/header_image.c +++ b/source/blender/src/header_image.c @@ -332,6 +332,21 @@ void do_image_buttons(unsigned short event) } } break; + case B_SIMA_USE_ALPHA: + G.sima->flag &= ~(SI_SHOW_ALPHA|SI_SHOW_ZBUF); + scrarea_queue_winredraw(curarea); + scrarea_queue_headredraw(curarea); + break; + case B_SIMA_SHOW_ALPHA: + G.sima->flag &= ~(SI_USE_ALPHA|SI_SHOW_ZBUF); + scrarea_queue_winredraw(curarea); + scrarea_queue_headredraw(curarea); + break; + case B_SIMA_SHOW_ZBUF: + G.sima->flag &= ~(SI_SHOW_ALPHA|SI_USE_ALPHA); + scrarea_queue_winredraw(curarea); + scrarea_queue_headredraw(curarea); + break; } } @@ -1166,8 +1181,19 @@ void image_buttons(void) uiDefIconButBitS(block, TOG, SI_DRAWTOOL, B_SIMAGEPAINTTOOL, ICON_TPAINT_HLT, xco,0,XIC,YIC, &G.sima->flag, 0, 0, 0, 0, "Enables painting textures on the image with left mouse button"); xco+= XIC+8; - uiDefIconButBitS(block, TOG, SI_USE_ALPHA, B_REDR, ICON_TRANSP_HLT, xco,0,XIC,YIC, &G.sima->flag, 0, 0, 0, 0, "Draws image with alpha"); - xco+= XIC+8; + uiBlockBeginAlign(block); + uiDefIconButBitS(block, TOG, SI_USE_ALPHA, B_SIMA_USE_ALPHA, ICON_TRANSP_HLT, xco,0,XIC,YIC, &G.sima->flag, 0, 0, 0, 0, "Draws image with alpha"); + xco+= XIC; + uiDefIconButBitS(block, TOG, SI_SHOW_ALPHA, B_SIMA_SHOW_ALPHA, ICON_DOT, xco,0,XIC,YIC, &G.sima->flag, 0, 0, 0, 0, "Draws only alpha"); + xco+= XIC; + if(G.sima->image->ibuf && G.sima->image->ibuf->zbuf) { + uiDefIconButBitS(block, TOG, SI_SHOW_ZBUF, B_SIMA_SHOW_ZBUF, ICON_SOLID, xco,0,XIC,YIC, &G.sima->flag, 0, 0, 0, 0, "Draws zbuffer values"); + xco+= XIC; + } + else G.sima->flag &= ~SI_SHOW_ZBUF; /* no confusing display for non-zbuf images */ + + uiBlockEndAlign(block); + xco+= 8; } /* draw LOCK */ |