From 80228562b346934b201e54e916637182be361bbc Mon Sep 17 00:00:00 2001 From: Rachael Alexanderson Date: Mon, 26 Dec 2016 08:05:04 -0500 Subject: [PATCH] - Fixed problems with FillSub and FillRevSub drawers. --- src/r_draw_pal.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) 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;