From dcdcaf25ba176b826f0a39958e0d3c2b5baff42d Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Tue, 3 Jan 2012 02:26:32 +0000 Subject: fix [#29761] Texture painting with interpolation ignores use alpha reporter - Shawn Zilbert (enigmatic) included patch. --- source/blender/render/intern/source/imagetexture.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'source/blender/render') diff --git a/source/blender/render/intern/source/imagetexture.c b/source/blender/render/intern/source/imagetexture.c index 785d9ac69d8..0b6e1b8ee01 100644 --- a/source/blender/render/intern/source/imagetexture.c +++ b/source/blender/render/intern/source/imagetexture.c @@ -203,6 +203,13 @@ int imagewrap(Tex *tex, Image *ima, ImBuf *ibuf, const float texvec[3], TexResul ibuf->rect+= (ibuf->x*ibuf->y); } + /* keep this before interpolation [#29761] */ + if (tex->imaflag & TEX_USEALPHA) { + if ((tex->imaflag & TEX_CALCALPHA) == 0) { + texres->talpha = TRUE; + } + } + /* interpolate */ if (tex->imaflag & TEX_INTERPOL) { float filterx, filtery; @@ -225,11 +232,6 @@ int imagewrap(Tex *tex, Image *ima, ImBuf *ibuf, const float texvec[3], TexResul ibuf->rect-= (ibuf->x*ibuf->y); } - if(tex->imaflag & TEX_USEALPHA) { - if(tex->imaflag & TEX_CALCALPHA); - else texres->talpha= 1; - } - if(texres->nor) { if(tex->imaflag & TEX_NORMALMAP) { // qdn: normal from color -- cgit v1.2.3