- finally decoded _srccolor in the fill drawers. still need to figure out how to get _srcalpha and _destalpha in there.

This commit is contained in:
Rachael Alexanderson 2016-12-18 09:05:14 -05:00
parent e4e0f0bcd9
commit 1b50620a87
2 changed files with 14 additions and 7 deletions

View file

@ -1187,9 +1187,9 @@ namespace swrenderer
int _srcalpha = 32768, _destalpha = 32768;
do
{
int src_r = ((_srccolor << 3) & 0x78) * _srcalpha;
int src_g = ((_srccolor >> 17) & 0x78) * _srcalpha;
int src_b = ((_srccolor >> 7) & 0x78) * _srcalpha;
int src_r = ((_srccolor >> 16) & 0xff) * _srcalpha;
int src_g = ((_srccolor >> 0) & 0xff) * _srcalpha;
int src_b = ((_srccolor >> 8) & 0xff) * _srcalpha;
int r = clamp((src_r + pal[*dest].r * _destalpha)>>18, 0, 255);
int g = clamp((src_g + pal[*dest].g * _destalpha)>>18, 0, 255);
int b = clamp((src_b + pal[*dest].b * _destalpha)>>18, 0, 255);
@ -1221,12 +1221,17 @@ namespace swrenderer
dest = thread->dest_for_thread(_dest_y, pitch, dest);
pitch *= thread->num_cores;
const PalEntry* pal = GPalette.BaseColors;
int _srcalpha = 32768, _destalpha = 32768;
do
{
const PalEntry* pal = GPalette.BaseColors;
int r = clamp(pal[*dest].r + pal[fg].r, 0, 255) >> 2;
int g = clamp(pal[*dest].g + pal[fg].g, 0, 255) >> 2;
int b = clamp(pal[*dest].b + pal[fg].b, 0, 255) >> 2;
int src_r = ((_srccolor >> 16) & 0xff) * _srcalpha;
int src_g = ((_srccolor >> 0) & 0xff) * _srcalpha;
int src_b = ((_srccolor >> 8) & 0xff) * _srcalpha;
int r = clamp((src_r + pal[*dest].r * _destalpha)>>18, 0, 255);
int g = clamp((src_g + pal[*dest].g * _destalpha)>>18, 0, 255);
int b = clamp((src_b + pal[*dest].b * _destalpha)>>18, 0, 255);
*dest = RGB256k.RGB[r][g][b];
dest += pitch;
} while (--count);

View file

@ -106,6 +106,8 @@ namespace swrenderer
uint32_t *_srcblend;
uint32_t *_destblend;
uint32_t _srccolor;
fixed_t _srcalpha;
fixed_t _destalpha;
};
class DrawColumnPalCommand : public PalColumnCommand { public: void Execute(DrawerThread *thread) override; };