From 42fbe6358493f0cb7587745aa39b59921c565522 Mon Sep 17 00:00:00 2001 From: Rachael Alexanderson Date: Mon, 19 Dec 2016 05:02:44 -0500 Subject: [PATCH] - fixed: blood decals are now red. --- src/r_draw_pal.cpp | 6 +++--- src/r_drawt_pal.cpp | 12 ++++++------ 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/r_draw_pal.cpp b/src/r_draw_pal.cpp index b99f58f88..fe6c63b6d 100644 --- a/src/r_draw_pal.cpp +++ b/src/r_draw_pal.cpp @@ -1462,9 +1462,9 @@ namespace swrenderer { uint32_t val = source[frac >> FRACBITS]; - int r = (palette[*dest].r * (255-val)) >> 10; - int g = (palette[*dest].g * (255-val)) >> 10; - int b = (palette[*dest].b * (255-val)) >> 10; + int r = (palette[*dest].r * (255-val) + palette[_color].r * val) >> 10; + int g = (palette[*dest].g * (255-val) + palette[_color].g * val) >> 10; + int b = (palette[*dest].b * (255-val) + palette[_color].b * val) >> 10; *dest = RGB256k.RGB[clamp(r,0,63)][clamp(g,0,63)][clamp(b,0,63)]; dest += pitch; diff --git a/src/r_drawt_pal.cpp b/src/r_drawt_pal.cpp index 27c2a4294..26cb56221 100644 --- a/src/r_drawt_pal.cpp +++ b/src/r_drawt_pal.cpp @@ -516,9 +516,9 @@ namespace swrenderer do { uint32_t val = *source; - int r = (palette[*dest].r * (255-val)) >> 10; - int g = (palette[*dest].g * (255-val)) >> 10; - int b = (palette[*dest].b * (255-val)) >> 10; + int r = (palette[*dest].r * (255-val) + palette[_color].r * val) >> 10; + int g = (palette[*dest].g * (255-val) + palette[_color].g * val) >> 10; + int b = (palette[*dest].b * (255-val) + palette[_color].b * val) >> 10; *dest = RGB256k.RGB[clamp(r,0,63)][clamp(g,0,63)][clamp(b,0,63)]; source += 4; dest += pitch; @@ -550,9 +550,9 @@ namespace swrenderer for (int ks = 0; ks < 4; ks++) { val = source[ks]; - int r = (palette[dest[ks]].r * (255-val)) >> 10; - int g = (palette[dest[ks]].g * (255-val)) >> 10; - int b = (palette[dest[ks]].b * (255-val)) >> 10; + int r = (palette[dest[ks]].r * (255-val) + palette[_color].r * val) >> 10; + int g = (palette[dest[ks]].g * (255-val) + palette[_color].g * val) >> 10; + int b = (palette[dest[ks]].b * (255-val) + palette[_color].b * val) >> 10; dest[ks] = RGB256k.RGB[clamp(r,0,63)][clamp(g,0,63)][clamp(b,0,63)]; }