diff --git a/src/r_draw_pal.cpp b/src/r_draw_pal.cpp index 15846977de..90dcc9c3b3 100644 --- a/src/r_draw_pal.cpp +++ b/src/r_draw_pal.cpp @@ -1610,9 +1610,9 @@ namespace swrenderer int src_g = ((_srccolor >> 0) & 0xff) * _srcalpha; int src_b = ((_srccolor >> 8) & 0xff) * _srcalpha; int bg = *dest; - int r = MAX((src_r * _srcalpha - palette[bg].r * _destalpha)>>18, 0); - int g = MAX((src_g * _srcalpha - palette[bg].g * _destalpha)>>18, 0); - int b = MAX((src_b * _srcalpha - palette[bg].b * _destalpha)>>18, 0); + int r = MAX((-src_r + palette[bg].r * _destalpha)>>18, 0); + int g = MAX((-src_g + palette[bg].g * _destalpha)>>18, 0); + int b = MAX((-src_b + palette[bg].b * _destalpha)>>18, 0); *dest = RGB256k.RGB[r][g][b]; dest += pitch; @@ -1667,9 +1667,9 @@ namespace swrenderer int src_g = ((_srccolor >> 0) & 0xff) * _srcalpha; int src_b = ((_srccolor >> 8) & 0xff) * _srcalpha; int bg = *dest; - int r = MAX((src_r * _srcalpha - palette[bg].r * _destalpha)>>18, 0); - int g = MAX((src_g * _srcalpha - palette[bg].g * _destalpha)>>18, 0); - int b = MAX((src_b * _srcalpha - palette[bg].b * _destalpha)>>18, 0); + int r = MAX((src_r - palette[bg].r * _destalpha)>>18, 0); + int g = MAX((src_g - palette[bg].g * _destalpha)>>18, 0); + int b = MAX((src_b - palette[bg].b * _destalpha)>>18, 0); *dest = RGB256k.RGB[r][g][b]; dest += pitch;