Page MenuHome

draw_alpha_patch.txt

draw_alpha_patch.txt

? user-config.py
? obj/linux-glibc2.4-x86_64
? source/blender/python/api2_2x/BGL.cp
? tools/Blender.pyc
? tools/__init__.pyc
? tools/bcolors.pyc
? tools/btools.pyc
Index: source/blender/src/drawimage.c
===================================================================
RCS file: /cvsroot/bf-blender/blender/source/blender/src/drawimage.c,v
retrieving revision 1.59
diff -u -r1.59 drawimage.c
--- source/blender/src/drawimage.c 13 Jun 2006 15:50:05 -0000 1.59
+++ source/blender/src/drawimage.c 14 Jun 2006 00:49:12 -0000
@@ -1300,11 +1300,24 @@
static void sima_draw_alpha_pixels(float x1, float y1, int rectx, int recty, unsigned int *recti)
{
-
- /* swap bytes, so alpha is most significant one, then just draw it as luminance int */
- glPixelStorei(GL_UNPACK_SWAP_BYTES, 1);
- glaDrawPixelsSafe(x1, y1, rectx, recty, rectx, GL_LUMINANCE, GL_UNSIGNED_INT, recti);
- glPixelStorei(GL_UNPACK_SWAP_BYTES, 0);
+ /* Since byte-swapping is endian-dependent, draw a black background, enable blending, and
+ * then draw a white foreground blended with the alpha.*/
+ glPixelTransferi(GL_RED_SCALE,0);
+ glPixelTransferi(GL_GREEN_SCALE,0);
+ glPixelTransferi(GL_BLUE_SCALE,0);
+ glaDrawPixelsSafe(x1, y1, rectx, recty, rectx, GL_RGBA, GL_UNSIGNED_BYTE, recti);
+ glPixelTransferi(GL_RED_BIAS,1);
+ glPixelTransferi(GL_GREEN_BIAS,1);
+ glPixelTransferi(GL_BLUE_BIAS,1);
+ glEnable(GL_BLEND);
+ glaDrawPixelsSafe(x1, y1, rectx, recty, rectx, GL_RGBA,GL_UNSIGNED_BYTE, recti);
+ glDisable(GL_BLEND);
+ glPixelTransferi(GL_RED_BIAS,0);
+ glPixelTransferi(GL_GREEN_BIAS,0);
+ glPixelTransferi(GL_BLUE_BIAS,0);
+ glPixelTransferi(GL_RED_SCALE,1);
+ glPixelTransferi(GL_GREEN_SCALE,1);
+ glPixelTransferi(GL_BLUE_SCALE,1);
}
static void sima_draw_alpha_pixelsf(float x1, float y1, int rectx, int recty, float *rectf)

File Metadata

Mime Type
text/x-diff
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
e6/a0/62303429396f6a2d9be6d4361de6

Event Timeline