changed/fixed alpha blending in copyToXYFromRect
authorsheepluva
Wed, 18 Mar 2015 21:03:53 +0100
changeset 10860 891bf0aca23e
parent 10859 d7e3abe3d5c2
child 10861 d84c725fe332
changed/fixed alpha blending in copyToXYFromRect
hedgewars/uRenderUtils.pas
--- a/hedgewars/uRenderUtils.pas	Wed Mar 18 22:57:29 2015 +0300
+++ b/hedgewars/uRenderUtils.pas	Wed Mar 18 21:03:53 2015 +0100
@@ -171,7 +171,7 @@
             r0:= (r0 * (255 - LongInt(a1)) + r1 * LongInt(a1)) div 255;
             g0:= (g0 * (255 - LongInt(a1)) + g1 * LongInt(a1)) div 255;
             b0:= (b0 * (255 - LongInt(a1)) + b1 * LongInt(a1)) div 255;
-            a0:= (a0 * (255 - LongInt(a1)) + a1 * LongInt(a1)) div 255;
+            a0:= a0 + ((255 - LongInt(a0)) * a1 div 255);
             destPixels^[i]:= SDL_MapRGBA(dest^.format, r0, g0, b0, a0);
             end;
         end;