]> git.xonotic.org Git - xonotic/darkplaces.git/commitdiff
fix the alpha bug in dpsoftrast.c
authordivverent <divverent@d7cf8633-e32d-0410-b094-e92efae38249>
Wed, 30 Mar 2011 21:27:16 +0000 (21:27 +0000)
committerRudolf Polzer <divverent@alientrap.org>
Fri, 1 Apr 2011 21:21:08 +0000 (23:21 +0200)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@10988 d7cf8633-e32d-0410-b094-e92efae38249
::stable-branch::merge=8e5d45706acaadb26c87ed55a25367e6b7ae24c3

dpsoftrast.c

index 9b45432de0416f466e06aff12c687611f0febe9a..fc703c65cff27593412d35587f4b206806fede4f 100644 (file)
@@ -4469,8 +4469,7 @@ void DPSOFTRAST_PixelShader_Refraction(DPSOFTRAST_State_Thread *thread, const DP
                buffer_FragColorbgra8[x*4+0] = c[0] * RefractColor[0];
                buffer_FragColorbgra8[x*4+1] = c[1] * RefractColor[1];
                buffer_FragColorbgra8[x*4+2] = c[2] * RefractColor[2];
-               buffer_FragColorbgra8[x*4+3] =                                         RefractColor[3] * 256; if(buffer_FragColorbgra8[x*4+3] > 255) buffer_FragColorbgra8[x*4+3] = 255;
-               buffer_FragColorbgra8[x*4+3] = 255; // WHY?!?!?!?!??!?!? is RefractColor[3] apparently 0?
+               buffer_FragColorbgra8[x*4+3] = min(RefractColor[3] * 256, 255);
        }
 
        DPSOFTRAST_Draw_Span_FinishBGRA8(thread, triangle, span, buffer_FragColorbgra8);