diff --git a/src/r_draw_rgba.cpp b/src/r_draw_rgba.cpp index 2062609b41..722fbb8cd7 100644 --- a/src/r_draw_rgba.cpp +++ b/src/r_draw_rgba.cpp @@ -56,6 +56,8 @@ extern float rw_light; extern float rw_lightstep; extern int wallshade; +CVAR(Bool, r_multithreaded, true, 0) + ///////////////////////////////////////////////////////////////////////////// DrawerCommandQueue *DrawerCommandQueue::Instance() @@ -227,28 +229,28 @@ void DrawerCommandQueue::StopThreads() class DrawColumnRGBACommand : public DrawerCommand { - int dc_count; - BYTE *dc_dest; - DWORD dc_texturefrac; - DWORD dc_iscale; - fixed_t dc_light; - const BYTE *dc_source; - int dc_pitch; - ShadeConstants dc_shade_constants; - BYTE *dc_colormap; + int _count; + BYTE *_dest; + DWORD _texturefrac; + DWORD _iscale; + fixed_t _light; + const BYTE *_source; + int _pitch; + ShadeConstants _shade_constants; + BYTE *_colormap; public: DrawColumnRGBACommand() { - dc_count = ::dc_count; - dc_dest = ::dc_dest; - dc_texturefrac = ::dc_texturefrac; - dc_iscale = ::dc_iscale; - dc_light = ::dc_light; - dc_source = ::dc_source; - dc_pitch = ::dc_pitch; - dc_shade_constants = ::dc_shade_constants; - dc_colormap = ::dc_colormap; + _count = dc_count; + _dest = dc_dest; + _texturefrac = dc_texturefrac; + _iscale = dc_iscale; + _light = dc_light; + _source = dc_source; + _pitch = dc_pitch; + _shade_constants = dc_shade_constants; + _colormap = dc_colormap; } void Execute(DrawerThread *thread) override @@ -258,28 +260,28 @@ public: fixed_t frac; fixed_t fracstep; - count = thread->count_for_thread(dc_dest_y, dc_count); + count = thread->count_for_thread(_dest_y, _count); // Zero length, column does not exceed a pixel. if (count <= 0) return; // Framebuffer destination address. - dest = thread->dest_for_thread(dc_dest_y, dc_pitch, (uint32_t*)dc_dest); + dest = thread->dest_for_thread(_dest_y, _pitch, (uint32_t*)_dest); - uint32_t light = calc_light_multiplier(dc_light); - ShadeConstants shade_constants = dc_shade_constants; + uint32_t light = calc_light_multiplier(_light); + ShadeConstants shade_constants = _shade_constants; // Determine scaling, // which is the only mapping to be done. - fracstep = dc_iscale * thread->num_cores; - frac = dc_texturefrac + dc_iscale * thread->skipped_by_thread(dc_dest_y); + fracstep = _iscale * thread->num_cores; + frac = _texturefrac + _iscale * thread->skipped_by_thread(_dest_y); // [RH] Get local copies of these variables so that the compiler // has a better chance of optimizing this well. - const BYTE *source = dc_source; - int pitch = dc_pitch * thread->num_cores; - BYTE *colormap = dc_colormap; + const BYTE *source = _source; + int pitch = _pitch * thread->num_cores; + BYTE *colormap = _colormap; do { @@ -294,20 +296,20 @@ public: class FillColumnRGBACommand : public DrawerCommand { - int dc_count; - BYTE *dc_dest; - fixed_t dc_light; - int dc_pitch; - int dc_color; + int _count; + BYTE *_dest; + fixed_t _light; + int _pitch; + int _color; public: FillColumnRGBACommand() { - dc_count = ::dc_count; - dc_dest = ::dc_dest; - dc_light = ::dc_light; - dc_pitch = ::dc_pitch; - dc_color = ::dc_color; + _count = dc_count; + _dest = dc_dest; + _light = dc_light; + _pitch = dc_pitch; + _color = dc_color; } void Execute(DrawerThread *thread) override @@ -315,18 +317,18 @@ public: int count; uint32_t* dest; - count = thread->count_for_thread(dc_dest_y, dc_count); + count = thread->count_for_thread(_dest_y, _count); if (count <= 0) return; - dest = thread->dest_for_thread(dc_dest_y, dc_pitch, (uint32_t*)dc_dest); + dest = thread->dest_for_thread(_dest_y, _pitch, (uint32_t*)_dest); - uint32_t light = calc_light_multiplier(dc_light); + uint32_t light = calc_light_multiplier(_light); { - int pitch = dc_pitch * thread->num_cores; - uint32_t color = shade_pal_index_simple(dc_color, light); + int pitch = _pitch * thread->num_cores; + uint32_t color = shade_pal_index_simple(_color, light); do { @@ -339,20 +341,20 @@ public: class FillAddColumnRGBACommand : public DrawerCommand { - int dc_count; - BYTE *dc_dest; - int dc_pitch; - fixed_t dc_light; - int dc_color; + int _count; + BYTE *_dest; + int _pitch; + fixed_t _light; + int _color; public: FillAddColumnRGBACommand() { - dc_count = ::dc_count; - dc_dest = ::dc_dest; - dc_pitch = ::dc_pitch; - dc_light = ::dc_light; - dc_color = ::dc_color; + _count = dc_count; + _dest = dc_dest; + _pitch = dc_pitch; + _light = dc_light; + _color = dc_color; } void Execute(DrawerThread *thread) override @@ -360,14 +362,14 @@ public: int count; uint32_t *dest; - count = thread->count_for_thread(dc_dest_y, dc_count); + count = thread->count_for_thread(_dest_y, _count); if (count <= 0) return; - dest = thread->dest_for_thread(dc_dest_y, dc_pitch, (uint32_t*)dc_dest); - int pitch = dc_pitch * thread->num_cores; + dest = thread->dest_for_thread(_dest_y, _pitch, (uint32_t*)_dest); + int pitch = _pitch * thread->num_cores; - uint32_t fg = shade_pal_index_simple(dc_color, calc_light_multiplier(dc_light)); + uint32_t fg = shade_pal_index_simple(_color, calc_light_multiplier(_light)); uint32_t fg_red = (fg >> 24) & 0xff; uint32_t fg_green = (fg >> 16) & 0xff; uint32_t fg_blue = fg & 0xff; @@ -390,20 +392,20 @@ public: class FillAddClampColumnRGBACommand : public DrawerCommand { - int dc_count; - BYTE *dc_dest; - int dc_pitch; - fixed_t dc_light; - int dc_color; + int _count; + BYTE *_dest; + int _pitch; + fixed_t _light; + int _color; public: FillAddClampColumnRGBACommand() { - dc_count = ::dc_count; - dc_dest = ::dc_dest; - dc_pitch = ::dc_pitch; - dc_light = ::dc_light; - dc_color = ::dc_color; + _count = dc_count; + _dest = dc_dest; + _pitch = dc_pitch; + _light = dc_light; + _color = dc_color; } void Execute(DrawerThread *thread) override @@ -411,14 +413,14 @@ public: int count; uint32_t *dest; - count = thread->count_for_thread(dc_dest_y, dc_count); + count = thread->count_for_thread(_dest_y, _count); if (count <= 0) return; - dest = thread->dest_for_thread(dc_dest_y, dc_pitch, (uint32_t*)dc_dest); - int pitch = dc_pitch * thread->num_cores; + dest = thread->dest_for_thread(_dest_y, _pitch, (uint32_t*)_dest); + int pitch = _pitch * thread->num_cores; - uint32_t fg = shade_pal_index_simple(dc_color, calc_light_multiplier(dc_light)); + uint32_t fg = shade_pal_index_simple(_color, calc_light_multiplier(_light)); uint32_t fg_red = (fg >> 24) & 0xff; uint32_t fg_green = (fg >> 16) & 0xff; uint32_t fg_blue = fg & 0xff; @@ -441,20 +443,20 @@ public: class FillSubClampColumnRGBACommand : public DrawerCommand { - int dc_count; - BYTE *dc_dest; - int dc_pitch; - int dc_color; - fixed_t dc_light; + int _count; + BYTE *_dest; + int _pitch; + int _color; + fixed_t _light; public: FillSubClampColumnRGBACommand() { - dc_count = ::dc_count; - dc_dest = ::dc_dest; - dc_pitch = ::dc_pitch; - dc_color = ::dc_color; - dc_light = ::dc_light; + _count = dc_count; + _dest = dc_dest; + _pitch = dc_pitch; + _color = dc_color; + _light = dc_light; } void Execute(DrawerThread *thread) override @@ -462,14 +464,14 @@ public: int count; uint32_t *dest; - count = thread->count_for_thread(dc_dest_y, dc_count); + count = thread->count_for_thread(_dest_y, _count); if (count <= 0) return; - dest = thread->dest_for_thread(dc_dest_y, dc_pitch, (uint32_t*)dc_dest); - int pitch = dc_pitch * thread->num_cores; + dest = thread->dest_for_thread(_dest_y, _pitch, (uint32_t*)_dest); + int pitch = _pitch * thread->num_cores; - uint32_t fg = shade_pal_index_simple(dc_color, calc_light_multiplier(dc_light)); + uint32_t fg = shade_pal_index_simple(_color, calc_light_multiplier(_light)); uint32_t fg_red = (fg >> 24) & 0xff; uint32_t fg_green = (fg >> 16) & 0xff; uint32_t fg_blue = fg & 0xff; @@ -492,20 +494,20 @@ public: class FillRevSubClampColumnRGBACommand : public DrawerCommand { - int dc_count; - BYTE *dc_dest; - int dc_pitch; - int dc_color; - fixed_t dc_light; + int _count; + BYTE *_dest; + int _pitch; + int _color; + fixed_t _light; public: FillRevSubClampColumnRGBACommand() { - dc_count = ::dc_count; - dc_dest = ::dc_dest; - dc_pitch = ::dc_pitch; - dc_color = ::dc_color; - dc_light = ::dc_light; + _count = dc_count; + _dest = dc_dest; + _pitch = dc_pitch; + _color = dc_color; + _light = dc_light; } void Execute(DrawerThread *thread) override @@ -513,14 +515,14 @@ public: int count; uint32_t *dest; - count = thread->count_for_thread(dc_dest_y, dc_count); + count = thread->count_for_thread(_dest_y, _count); if (count <= 0) return; - dest = thread->dest_for_thread(dc_dest_y, dc_pitch, (uint32_t*)dc_dest); - int pitch = dc_pitch * thread->num_cores; + dest = thread->dest_for_thread(_dest_y, _pitch, (uint32_t*)_dest); + int pitch = _pitch * thread->num_cores; - uint32_t fg = shade_pal_index_simple(dc_color, calc_light_multiplier(dc_light)); + uint32_t fg = shade_pal_index_simple(_color, calc_light_multiplier(_light)); uint32_t fg_red = (fg >> 24) & 0xff; uint32_t fg_green = (fg >> 16) & 0xff; uint32_t fg_blue = fg & 0xff; @@ -543,22 +545,22 @@ public: class DrawFuzzColumnRGBACommand : public DrawerCommand { - int dc_x; - int dc_yl; - int dc_yh; - BYTE *dc_destorg; - int dc_pitch; + int _x; + int _yl; + int _yh; + BYTE *_destorg; + int _pitch; int fuzzpos; int fuzzviewheight; public: DrawFuzzColumnRGBACommand() { - dc_x = ::dc_x; - dc_yl = ::dc_yl; - dc_yh = ::dc_yh; - dc_destorg = ::dc_destorg; - dc_pitch = ::dc_pitch; + _x = dc_x; + _yl = dc_yl; + _yh = dc_yh; + _destorg = dc_destorg; + _pitch = dc_pitch; fuzzpos = ::fuzzpos; fuzzviewheight = ::fuzzviewheight; } @@ -569,24 +571,24 @@ public: uint32_t *dest; // Adjust borders. Low... - if (dc_yl == 0) - dc_yl = 1; + if (_yl == 0) + _yl = 1; // .. and high. - if (dc_yh > fuzzviewheight) - dc_yh = fuzzviewheight; + if (_yh > fuzzviewheight) + _yh = fuzzviewheight; - count = thread->count_for_thread(dc_yl, dc_yh - dc_yl + 1); + count = thread->count_for_thread(_yl, _yh - _yl + 1); // Zero length. if (count <= 0) return; - dest = thread->dest_for_thread(dc_yl, dc_pitch, ylookup[dc_yl] + dc_x + (uint32_t*)dc_destorg); + dest = thread->dest_for_thread(_yl, _pitch, ylookup[_yl] + _x + (uint32_t*)_destorg); - int pitch = dc_pitch * thread->num_cores; + int pitch = _pitch * thread->num_cores; int fuzzstep = thread->num_cores; - int fuzz = (fuzzpos + thread->skipped_by_thread(dc_yl)) % FUZZTABLE; + int fuzz = (fuzzpos + thread->skipped_by_thread(_yl)) % FUZZTABLE; while (count > 0) { @@ -620,32 +622,32 @@ public: class DrawAddColumnRGBACommand : public DrawerCommand { - int dc_count; - BYTE *dc_dest; - DWORD dc_iscale; - DWORD dc_texturefrac; - const BYTE *dc_source; - int dc_pitch; - fixed_t dc_light; - ShadeConstants dc_shade_constants; - fixed_t dc_srcalpha; - fixed_t dc_destalpha; - BYTE *dc_colormap; + int _count; + BYTE *_dest; + DWORD _iscale; + DWORD _texturefrac; + const BYTE *_source; + int _pitch; + fixed_t _light; + ShadeConstants _shade_constants; + fixed_t _srcalpha; + fixed_t _destalpha; + BYTE *_colormap; public: DrawAddColumnRGBACommand() { - dc_count = ::dc_count; - dc_dest = ::dc_dest; - dc_iscale = ::dc_iscale; - dc_texturefrac = ::dc_texturefrac; - dc_source = ::dc_source; - dc_pitch = ::dc_pitch; - dc_light = ::dc_light; - dc_shade_constants = ::dc_shade_constants; - dc_srcalpha = ::dc_srcalpha; - dc_destalpha = ::dc_destalpha; - dc_colormap = ::dc_colormap; + _count = dc_count; + _dest = dc_dest; + _iscale = dc_iscale; + _texturefrac = dc_texturefrac; + _source = dc_source; + _pitch = dc_pitch; + _light = dc_light; + _shade_constants = dc_shade_constants; + _srcalpha = dc_srcalpha; + _destalpha = dc_destalpha; + _colormap = dc_colormap; } void Execute(DrawerThread *thread) override @@ -655,25 +657,25 @@ public: fixed_t frac; fixed_t fracstep; - count = thread->count_for_thread(dc_dest_y, dc_count); + count = thread->count_for_thread(_dest_y, _count); if (count <= 0) return; - dest = thread->dest_for_thread(dc_dest_y, dc_pitch, (uint32_t*)dc_dest); + dest = thread->dest_for_thread(_dest_y, _pitch, (uint32_t*)_dest); - fracstep = dc_iscale * thread->num_cores; - frac = dc_texturefrac + dc_iscale * thread->skipped_by_thread(dc_dest_y); + fracstep = _iscale * thread->num_cores; + frac = _texturefrac + _iscale * thread->skipped_by_thread(_dest_y); { - const BYTE *source = dc_source; - int pitch = dc_pitch * thread->num_cores; + const BYTE *source = _source; + int pitch = _pitch * thread->num_cores; - uint32_t light = calc_light_multiplier(dc_light); - ShadeConstants shade_constants = dc_shade_constants; - BYTE *colormap = dc_colormap; + uint32_t light = calc_light_multiplier(_light); + ShadeConstants shade_constants = _shade_constants; + BYTE *colormap = _colormap; - uint32_t fg_alpha = dc_srcalpha >> (FRACBITS - 8); - uint32_t bg_alpha = dc_destalpha >> (FRACBITS - 8); + uint32_t fg_alpha = _srcalpha >> (FRACBITS - 8); + uint32_t bg_alpha = _destalpha >> (FRACBITS - 8); do { @@ -701,28 +703,28 @@ public: class DrawTranslatedColumnRGBACommand : public DrawerCommand { - int dc_count; - fixed_t dc_light; - ShadeConstants dc_shade_constants; - BYTE *dc_dest; - DWORD dc_iscale; - DWORD dc_texturefrac; - BYTE *dc_translation; - const BYTE *dc_source; - int dc_pitch; + int _count; + fixed_t _light; + ShadeConstants _shade_constants; + BYTE *_dest; + DWORD _iscale; + DWORD _texturefrac; + BYTE *_translation; + const BYTE *_source; + int _pitch; public: DrawTranslatedColumnRGBACommand() { - dc_count = ::dc_count; - dc_light = ::dc_light; - dc_shade_constants = ::dc_shade_constants; - dc_dest = ::dc_dest; - dc_iscale = ::dc_iscale; - dc_texturefrac = ::dc_texturefrac; - dc_translation = ::dc_translation; - dc_source = ::dc_source; - dc_pitch = ::dc_pitch; + _count = dc_count; + _light = dc_light; + _shade_constants = dc_shade_constants; + _dest = dc_dest; + _iscale = dc_iscale; + _texturefrac = dc_texturefrac; + _translation = dc_translation; + _source = dc_source; + _pitch = dc_pitch; } void Execute(DrawerThread *thread) override @@ -732,23 +734,23 @@ public: fixed_t frac; fixed_t fracstep; - count = thread->count_for_thread(dc_dest_y, dc_count); + count = thread->count_for_thread(_dest_y, _count); if (count <= 0) return; - uint32_t light = calc_light_multiplier(dc_light); - ShadeConstants shade_constants = dc_shade_constants; + uint32_t light = calc_light_multiplier(_light); + ShadeConstants shade_constants = _shade_constants; - dest = thread->dest_for_thread(dc_dest_y, dc_pitch, (uint32_t*)dc_dest); + dest = thread->dest_for_thread(_dest_y, _pitch, (uint32_t*)_dest); - fracstep = dc_iscale * thread->num_cores; - frac = dc_texturefrac + dc_iscale * thread->skipped_by_thread(dc_dest_y); + fracstep = _iscale * thread->num_cores; + frac = _texturefrac + _iscale * thread->skipped_by_thread(_dest_y); { // [RH] Local copies of global vars to improve compiler optimizations - BYTE *translation = dc_translation; - const BYTE *source = dc_source; - int pitch = dc_pitch * thread->num_cores; + BYTE *translation = _translation; + const BYTE *source = _source; + int pitch = _pitch * thread->num_cores; do { @@ -762,28 +764,32 @@ public: class DrawTlatedAddColumnRGBACommand : public DrawerCommand { - int dc_count; - fixed_t dc_light; - ShadeConstants dc_shade_constants; - BYTE *dc_dest; - DWORD dc_iscale; - DWORD dc_texturefrac; - BYTE *dc_translation; - const BYTE *dc_source; - int dc_pitch; + int _count; + fixed_t _light; + ShadeConstants _shade_constants; + BYTE *_dest; + DWORD _iscale; + DWORD _texturefrac; + BYTE *_translation; + const BYTE *_source; + int _pitch; + fixed_t _srcalpha; + fixed_t _destalpha; public: DrawTlatedAddColumnRGBACommand() { - dc_count = ::dc_count; - dc_light = ::dc_light; - dc_shade_constants = ::dc_shade_constants; - dc_dest = ::dc_dest; - dc_iscale = ::dc_iscale; - dc_texturefrac = ::dc_texturefrac; - dc_translation = ::dc_translation; - dc_source = ::dc_source; - dc_pitch = ::dc_pitch; + _count = dc_count; + _light = dc_light; + _shade_constants = dc_shade_constants; + _dest = dc_dest; + _iscale = dc_iscale; + _texturefrac = dc_texturefrac; + _translation = dc_translation; + _source = dc_source; + _pitch = dc_pitch; + _srcalpha = dc_srcalpha; + _destalpha = dc_destalpha; } void Execute(DrawerThread *thread) override @@ -793,25 +799,25 @@ public: fixed_t frac; fixed_t fracstep; - count = thread->count_for_thread(dc_dest_y, dc_count); + count = thread->count_for_thread(_dest_y, _count); if (count <= 0) return; - uint32_t light = calc_light_multiplier(dc_light); - ShadeConstants shade_constants = dc_shade_constants; + uint32_t light = calc_light_multiplier(_light); + ShadeConstants shade_constants = _shade_constants; - dest = thread->dest_for_thread(dc_dest_y, dc_pitch, (uint32_t*)dc_dest); + dest = thread->dest_for_thread(_dest_y, _pitch, (uint32_t*)_dest); - fracstep = dc_iscale * thread->num_cores; - frac = dc_texturefrac + dc_iscale * thread->skipped_by_thread(dc_dest_y); + fracstep = _iscale * thread->num_cores; + frac = _texturefrac + _iscale * thread->skipped_by_thread(_dest_y); { - BYTE *translation = dc_translation; - const BYTE *source = dc_source; - int pitch = dc_pitch * thread->num_cores; + BYTE *translation = _translation; + const BYTE *source = _source; + int pitch = _pitch * thread->num_cores; - uint32_t fg_alpha = dc_srcalpha >> (FRACBITS - 8); - uint32_t bg_alpha = dc_destalpha >> (FRACBITS - 8); + uint32_t fg_alpha = _srcalpha >> (FRACBITS - 8); + uint32_t bg_alpha = _destalpha >> (FRACBITS - 8); do { @@ -840,28 +846,28 @@ public: class DrawShadedColumnRGBACommand : public DrawerCommand { private: - int dc_count; - BYTE *dc_dest; - DWORD dc_iscale; - DWORD dc_texturefrac; - fixed_t dc_light; - const BYTE *dc_source; - lighttable_t *dc_colormap; - int dc_color; - int dc_pitch; + int _count; + BYTE *_dest; + DWORD _iscale; + DWORD _texturefrac; + fixed_t _light; + const BYTE *_source; + lighttable_t *_colormap; + int _color; + int _pitch; public: DrawShadedColumnRGBACommand() { - dc_count = ::dc_count; - dc_dest = ::dc_dest; - dc_iscale = ::dc_iscale; - dc_texturefrac = ::dc_texturefrac; - dc_light = ::dc_light; - dc_source = ::dc_source; - dc_colormap = ::dc_colormap; - dc_color = ::dc_color; - dc_pitch = ::dc_pitch; + _count = dc_count; + _dest = dc_dest; + _iscale = dc_iscale; + _texturefrac = dc_texturefrac; + _light = dc_light; + _source = dc_source; + _colormap = dc_colormap; + _color = dc_color; + _pitch = dc_pitch; } void Execute(DrawerThread *thread) override @@ -870,25 +876,25 @@ public: uint32_t *dest; fixed_t frac, fracstep; - count = thread->count_for_thread(dc_dest_y, dc_count); + count = thread->count_for_thread(_dest_y, _count); if (count <= 0) return; - dest = thread->dest_for_thread(dc_dest_y, dc_pitch, (uint32_t*)dc_dest); + dest = thread->dest_for_thread(_dest_y, _pitch, (uint32_t*)_dest); - fracstep = dc_iscale * thread->num_cores; - frac = dc_texturefrac + dc_iscale * thread->skipped_by_thread(dc_dest_y); + fracstep = _iscale * thread->num_cores; + frac = _texturefrac + _iscale * thread->skipped_by_thread(_dest_y); - uint32_t fg = shade_pal_index_simple(dc_color, calc_light_multiplier(dc_light)); + uint32_t fg = shade_pal_index_simple(_color, calc_light_multiplier(_light)); uint32_t fg_red = (fg >> 16) & 0xff; uint32_t fg_green = (fg >> 8) & 0xff; uint32_t fg_blue = fg & 0xff; { - const BYTE *source = dc_source; - BYTE *colormap = dc_colormap; - int pitch = dc_pitch * thread->num_cores; + const BYTE *source = _source; + BYTE *colormap = _colormap; + int pitch = _pitch * thread->num_cores; do { @@ -913,30 +919,30 @@ public: class DrawAddClampColumnRGBACommand : public DrawerCommand { - int dc_count; - BYTE *dc_dest; - DWORD dc_iscale; - DWORD dc_texturefrac; - const BYTE *dc_source; - int dc_pitch; - fixed_t dc_light; - ShadeConstants dc_shade_constants; - fixed_t dc_srcalpha; - fixed_t dc_destalpha; + int _count; + BYTE *_dest; + DWORD _iscale; + DWORD _texturefrac; + const BYTE *_source; + int _pitch; + fixed_t _light; + ShadeConstants _shade_constants; + fixed_t _srcalpha; + fixed_t _destalpha; public: DrawAddClampColumnRGBACommand() { - dc_count = ::dc_count; - dc_dest = ::dc_dest; - dc_iscale = ::dc_iscale; - dc_texturefrac = ::dc_texturefrac; - dc_source = ::dc_source; - dc_pitch = ::dc_pitch; - dc_light = ::dc_light; - dc_shade_constants = ::dc_shade_constants; - dc_srcalpha = ::dc_srcalpha; - dc_destalpha = ::dc_destalpha; + _count = dc_count; + _dest = dc_dest; + _iscale = dc_iscale; + _texturefrac = dc_texturefrac; + _source = dc_source; + _pitch = dc_pitch; + _light = dc_light; + _shade_constants = dc_shade_constants; + _srcalpha = dc_srcalpha; + _destalpha = dc_destalpha; } void Execute(DrawerThread *thread) override @@ -946,23 +952,23 @@ public: fixed_t frac; fixed_t fracstep; - count = thread->count_for_thread(dc_dest_y, dc_count); + count = thread->count_for_thread(_dest_y, _count); if (count <= 0) return; - dest = thread->dest_for_thread(dc_dest_y, dc_pitch, (uint32_t*)dc_dest); + dest = thread->dest_for_thread(_dest_y, _pitch, (uint32_t*)_dest); - fracstep = dc_iscale * thread->num_cores; - frac = dc_texturefrac + dc_iscale * thread->skipped_by_thread(dc_dest_y); + fracstep = _iscale * thread->num_cores; + frac = _texturefrac + _iscale * thread->skipped_by_thread(_dest_y); { - const BYTE *source = dc_source; - int pitch = dc_pitch * thread->num_cores; - uint32_t light = calc_light_multiplier(dc_light); - ShadeConstants shade_constants = dc_shade_constants; + const BYTE *source = _source; + int pitch = _pitch * thread->num_cores; + uint32_t light = calc_light_multiplier(_light); + ShadeConstants shade_constants = _shade_constants; - uint32_t fg_alpha = dc_srcalpha >> (FRACBITS - 8); - uint32_t bg_alpha = dc_destalpha >> (FRACBITS - 8); + uint32_t fg_alpha = _srcalpha >> (FRACBITS - 8); + uint32_t bg_alpha = _destalpha >> (FRACBITS - 8); do { @@ -989,32 +995,32 @@ public: class DrawAddClampTranslatedColumnRGBACommand : public DrawerCommand { - int dc_count; - BYTE *dc_dest; - DWORD dc_iscale; - DWORD dc_texturefrac; - BYTE *dc_translation; - const BYTE *dc_source; - int dc_pitch; - fixed_t dc_light; - ShadeConstants dc_shade_constants; - fixed_t dc_srcalpha; - fixed_t dc_destalpha; + int _count; + BYTE *_dest; + DWORD _iscale; + DWORD _texturefrac; + BYTE *_translation; + const BYTE *_source; + int _pitch; + fixed_t _light; + ShadeConstants _shade_constants; + fixed_t _srcalpha; + fixed_t _destalpha; public: DrawAddClampTranslatedColumnRGBACommand() { - dc_count = ::dc_count; - dc_dest = ::dc_dest; - dc_iscale = ::dc_iscale; - dc_texturefrac = ::dc_texturefrac; - dc_translation = ::dc_translation; - dc_source = ::dc_source; - dc_pitch = ::dc_pitch; - dc_light = ::dc_light; - dc_shade_constants = ::dc_shade_constants; - dc_srcalpha = ::dc_srcalpha; - dc_destalpha = ::dc_destalpha; + _count = dc_count; + _dest = dc_dest; + _iscale = dc_iscale; + _texturefrac = dc_texturefrac; + _translation = dc_translation; + _source = dc_source; + _pitch = dc_pitch; + _light = dc_light; + _shade_constants = dc_shade_constants; + _srcalpha = dc_srcalpha; + _destalpha = dc_destalpha; } void Execute(DrawerThread *thread) override @@ -1024,24 +1030,24 @@ public: fixed_t frac; fixed_t fracstep; - count = thread->count_for_thread(dc_dest_y, dc_count); + count = thread->count_for_thread(_dest_y, _count); if (count <= 0) return; - dest = thread->dest_for_thread(dc_dest_y, dc_pitch, (uint32_t*)dc_dest); + dest = thread->dest_for_thread(_dest_y, _pitch, (uint32_t*)_dest); - fracstep = dc_iscale * thread->num_cores; - frac = dc_texturefrac + dc_iscale * thread->skipped_by_thread(dc_dest_y); + fracstep = _iscale * thread->num_cores; + frac = _texturefrac + _iscale * thread->skipped_by_thread(_dest_y); { - BYTE *translation = dc_translation; - const BYTE *source = dc_source; - int pitch = dc_pitch * thread->num_cores; - uint32_t light = calc_light_multiplier(dc_light); - ShadeConstants shade_constants = dc_shade_constants; + BYTE *translation = _translation; + const BYTE *source = _source; + int pitch = _pitch * thread->num_cores; + uint32_t light = calc_light_multiplier(_light); + ShadeConstants shade_constants = _shade_constants; - uint32_t fg_alpha = dc_srcalpha >> (FRACBITS - 8); - uint32_t bg_alpha = dc_destalpha >> (FRACBITS - 8); + uint32_t fg_alpha = _srcalpha >> (FRACBITS - 8); + uint32_t bg_alpha = _destalpha >> (FRACBITS - 8); do { @@ -1068,30 +1074,30 @@ public: class DrawSubClampColumnRGBACommand : public DrawerCommand { - int dc_count; - BYTE *dc_dest; - DWORD dc_iscale; - DWORD dc_texturefrac; - const BYTE *dc_source; - int dc_pitch; - fixed_t dc_light; - ShadeConstants dc_shade_constants; - fixed_t dc_srcalpha; - fixed_t dc_destalpha; + int _count; + BYTE *_dest; + DWORD _iscale; + DWORD _texturefrac; + const BYTE *_source; + int _pitch; + fixed_t _light; + ShadeConstants _shade_constants; + fixed_t _srcalpha; + fixed_t _destalpha; public: DrawSubClampColumnRGBACommand() { - dc_count = ::dc_count; - dc_dest = ::dc_dest; - dc_iscale = ::dc_iscale; - dc_texturefrac = ::dc_texturefrac; - dc_source = ::dc_source; - dc_pitch = ::dc_pitch; - dc_light = ::dc_light; - dc_shade_constants = ::dc_shade_constants; - dc_srcalpha = ::dc_srcalpha; - dc_destalpha = ::dc_destalpha; + _count = dc_count; + _dest = dc_dest; + _iscale = dc_iscale; + _texturefrac = dc_texturefrac; + _source = dc_source; + _pitch = dc_pitch; + _light = dc_light; + _shade_constants = dc_shade_constants; + _srcalpha = dc_srcalpha; + _destalpha = dc_destalpha; } void Execute(DrawerThread *thread) override @@ -1101,23 +1107,23 @@ public: fixed_t frac; fixed_t fracstep; - count = thread->count_for_thread(dc_dest_y, dc_count); + count = thread->count_for_thread(_dest_y, _count); if (count <= 0) return; - dest = thread->dest_for_thread(dc_dest_y, dc_pitch, (uint32_t*)dc_dest); + dest = thread->dest_for_thread(_dest_y, _pitch, (uint32_t*)_dest); - fracstep = dc_iscale * thread->num_cores; - frac = dc_texturefrac + dc_iscale * thread->skipped_by_thread(dc_dest_y); + fracstep = _iscale * thread->num_cores; + frac = _texturefrac + _iscale * thread->skipped_by_thread(_dest_y); { - const BYTE *source = dc_source; - int pitch = dc_pitch * thread->num_cores; - uint32_t light = calc_light_multiplier(dc_light); - ShadeConstants shade_constants = dc_shade_constants; + const BYTE *source = _source; + int pitch = _pitch * thread->num_cores; + uint32_t light = calc_light_multiplier(_light); + ShadeConstants shade_constants = _shade_constants; - uint32_t fg_alpha = dc_srcalpha >> (FRACBITS - 8); - uint32_t bg_alpha = dc_destalpha >> (FRACBITS - 8); + uint32_t fg_alpha = _srcalpha >> (FRACBITS - 8); + uint32_t bg_alpha = _destalpha >> (FRACBITS - 8); do { @@ -1144,32 +1150,32 @@ public: class DrawSubClampTranslatedColumnRGBACommand : public DrawerCommand { - int dc_count; - BYTE *dc_dest; - DWORD dc_iscale; - DWORD dc_texturefrac; - const BYTE *dc_source; - int dc_pitch; - fixed_t dc_light; - ShadeConstants dc_shade_constants; - fixed_t dc_srcalpha; - fixed_t dc_destalpha; - BYTE *dc_translation; + int _count; + BYTE *_dest; + DWORD _iscale; + DWORD _texturefrac; + const BYTE *_source; + int _pitch; + fixed_t _light; + ShadeConstants _shade_constants; + fixed_t _srcalpha; + fixed_t _destalpha; + BYTE *_translation; public: DrawSubClampTranslatedColumnRGBACommand() { - dc_count = ::dc_count; - dc_dest = ::dc_dest; - dc_iscale = ::dc_iscale; - dc_texturefrac = ::dc_texturefrac; - dc_source = ::dc_source; - dc_pitch = ::dc_pitch; - dc_light = ::dc_light; - dc_shade_constants = ::dc_shade_constants; - dc_srcalpha = ::dc_srcalpha; - dc_destalpha = ::dc_destalpha; - dc_translation = ::dc_translation; + _count = dc_count; + _dest = dc_dest; + _iscale = dc_iscale; + _texturefrac = dc_texturefrac; + _source = dc_source; + _pitch = dc_pitch; + _light = dc_light; + _shade_constants = dc_shade_constants; + _srcalpha = dc_srcalpha; + _destalpha = dc_destalpha; + _translation = dc_translation; } void Execute(DrawerThread *thread) override @@ -1179,24 +1185,24 @@ public: fixed_t frac; fixed_t fracstep; - count = thread->count_for_thread(dc_dest_y, dc_count); + count = thread->count_for_thread(_dest_y, _count); if (count <= 0) return; - dest = thread->dest_for_thread(dc_dest_y, dc_pitch, (uint32_t*)dc_dest); + dest = thread->dest_for_thread(_dest_y, _pitch, (uint32_t*)_dest); - fracstep = dc_iscale * thread->num_cores; - frac = dc_texturefrac + dc_iscale * thread->skipped_by_thread(dc_dest_y); + fracstep = _iscale * thread->num_cores; + frac = _texturefrac + _iscale * thread->skipped_by_thread(_dest_y); { - BYTE *translation = dc_translation; - const BYTE *source = dc_source; - int pitch = dc_pitch * thread->num_cores; - uint32_t light = calc_light_multiplier(dc_light); - ShadeConstants shade_constants = dc_shade_constants; + BYTE *translation = _translation; + const BYTE *source = _source; + int pitch = _pitch * thread->num_cores; + uint32_t light = calc_light_multiplier(_light); + ShadeConstants shade_constants = _shade_constants; - uint32_t fg_alpha = dc_srcalpha >> (FRACBITS - 8); - uint32_t bg_alpha = dc_destalpha >> (FRACBITS - 8); + uint32_t fg_alpha = _srcalpha >> (FRACBITS - 8); + uint32_t bg_alpha = _destalpha >> (FRACBITS - 8); do { @@ -1223,30 +1229,30 @@ public: class DrawRevSubClampColumnRGBACommand : public DrawerCommand { - int dc_count; - BYTE *dc_dest; - DWORD dc_iscale; - DWORD dc_texturefrac; - const BYTE *dc_source; - int dc_pitch; - fixed_t dc_light; - ShadeConstants dc_shade_constants; - fixed_t dc_srcalpha; - fixed_t dc_destalpha; + int _count; + BYTE *_dest; + DWORD _iscale; + DWORD _texturefrac; + const BYTE *_source; + int _pitch; + fixed_t _light; + ShadeConstants _shade_constants; + fixed_t _srcalpha; + fixed_t _destalpha; public: DrawRevSubClampColumnRGBACommand() { - dc_count = ::dc_count; - dc_dest = ::dc_dest; - dc_iscale = ::dc_iscale; - dc_texturefrac = ::dc_texturefrac; - dc_source = ::dc_source; - dc_pitch = ::dc_pitch; - dc_light = ::dc_light; - dc_shade_constants = ::dc_shade_constants; - dc_srcalpha = ::dc_srcalpha; - dc_destalpha = ::dc_destalpha; + _count = dc_count; + _dest = dc_dest; + _iscale = dc_iscale; + _texturefrac = dc_texturefrac; + _source = dc_source; + _pitch = dc_pitch; + _light = dc_light; + _shade_constants = dc_shade_constants; + _srcalpha = dc_srcalpha; + _destalpha = dc_destalpha; } void Execute(DrawerThread *thread) override @@ -1256,22 +1262,22 @@ public: fixed_t frac; fixed_t fracstep; - count = thread->count_for_thread(dc_dest_y, dc_count); + count = thread->count_for_thread(_dest_y, _count); if (count <= 0) return; - dest = thread->dest_for_thread(dc_dest_y, dc_pitch, (uint32_t*)dc_dest); + dest = thread->dest_for_thread(_dest_y, _pitch, (uint32_t*)_dest); - fracstep = dc_iscale * thread->num_cores; - frac = dc_texturefrac + dc_iscale * thread->skipped_by_thread(dc_dest_y); + fracstep = _iscale * thread->num_cores; + frac = _texturefrac + _iscale * thread->skipped_by_thread(_dest_y); { - const BYTE *source = dc_source; - int pitch = dc_pitch * thread->num_cores; - uint32_t light = calc_light_multiplier(dc_light); - ShadeConstants shade_constants = dc_shade_constants; - uint32_t fg_alpha = dc_srcalpha >> (FRACBITS - 8); - uint32_t bg_alpha = dc_destalpha >> (FRACBITS - 8); + const BYTE *source = _source; + int pitch = _pitch * thread->num_cores; + uint32_t light = calc_light_multiplier(_light); + ShadeConstants shade_constants = _shade_constants; + uint32_t fg_alpha = _srcalpha >> (FRACBITS - 8); + uint32_t bg_alpha = _destalpha >> (FRACBITS - 8); do { @@ -1298,32 +1304,32 @@ public: class DrawRevSubClampTranslatedColumnRGBACommand : public DrawerCommand { - int dc_count; - BYTE *dc_dest; - DWORD dc_iscale; - DWORD dc_texturefrac; - const BYTE *dc_source; - int dc_pitch; - fixed_t dc_light; - ShadeConstants dc_shade_constants; - fixed_t dc_srcalpha; - fixed_t dc_destalpha; - BYTE *dc_translation; + int _count; + BYTE *_dest; + DWORD _iscale; + DWORD _texturefrac; + const BYTE *_source; + int _pitch; + fixed_t _light; + ShadeConstants _shade_constants; + fixed_t _srcalpha; + fixed_t _destalpha; + BYTE *_translation; public: DrawRevSubClampTranslatedColumnRGBACommand() { - dc_count = ::dc_count; - dc_dest = ::dc_dest; - dc_iscale = ::dc_iscale; - dc_texturefrac = ::dc_texturefrac; - dc_source = ::dc_source; - dc_pitch = ::dc_pitch; - dc_light = ::dc_light; - dc_shade_constants = ::dc_shade_constants; - dc_srcalpha = ::dc_srcalpha; - dc_destalpha = ::dc_destalpha; - dc_translation = ::dc_translation; + _count = dc_count; + _dest = dc_dest; + _iscale = dc_iscale; + _texturefrac = dc_texturefrac; + _source = dc_source; + _pitch = dc_pitch; + _light = dc_light; + _shade_constants = dc_shade_constants; + _srcalpha = dc_srcalpha; + _destalpha = dc_destalpha; + _translation = dc_translation; } void Execute(DrawerThread *thread) override @@ -1333,24 +1339,24 @@ public: fixed_t frac; fixed_t fracstep; - count = thread->count_for_thread(dc_dest_y, dc_count); + count = thread->count_for_thread(_dest_y, _count); if (count <= 0) return; - dest = thread->dest_for_thread(dc_dest_y, dc_pitch, (uint32_t*)dc_dest); + dest = thread->dest_for_thread(_dest_y, _pitch, (uint32_t*)_dest); - fracstep = dc_iscale * thread->num_cores; - frac = dc_texturefrac + dc_iscale * thread->skipped_by_thread(dc_dest_y); + fracstep = _iscale * thread->num_cores; + frac = _texturefrac + _iscale * thread->skipped_by_thread(_dest_y); { - BYTE *translation = dc_translation; - const BYTE *source = dc_source; - int pitch = dc_pitch * thread->num_cores; - uint32_t light = calc_light_multiplier(dc_light); - ShadeConstants shade_constants = dc_shade_constants; + BYTE *translation = _translation; + const BYTE *source = _source; + int pitch = _pitch * thread->num_cores; + uint32_t light = calc_light_multiplier(_light); + ShadeConstants shade_constants = _shade_constants; - uint32_t fg_alpha = dc_srcalpha >> (FRACBITS - 8); - uint32_t bg_alpha = dc_destalpha >> (FRACBITS - 8); + uint32_t fg_alpha = _srcalpha >> (FRACBITS - 8); + uint32_t bg_alpha = _destalpha >> (FRACBITS - 8); do { @@ -1377,42 +1383,42 @@ public: class DrawSpanRGBACommand : public DrawerCommand { - const uint32_t *ds_source; - fixed_t ds_xfrac; - fixed_t ds_yfrac; - fixed_t ds_xstep; - fixed_t ds_ystep; - int ds_x1; - int ds_x2; - int ds_y; - int ds_xbits; - int ds_ybits; - BYTE *dc_destorg; - fixed_t ds_light; - ShadeConstants ds_shade_constants; + const uint32_t *_source; + fixed_t _xfrac; + fixed_t _yfrac; + fixed_t _xstep; + fixed_t _ystep; + int _x1; + int _x2; + int _y; + int _xbits; + int _ybits; + BYTE *_destorg; + fixed_t _light; + ShadeConstants _shade_constants; public: DrawSpanRGBACommand() { - ds_source = (const uint32_t*)::ds_source; - ds_xfrac = ::ds_xfrac; - ds_yfrac = ::ds_yfrac; - ds_xstep = ::ds_xstep; - ds_ystep = ::ds_ystep; - ds_x1 = ::ds_x1; - ds_x2 = ::ds_x2; - ds_y = ::ds_y; - ds_xbits = ::ds_xbits; - ds_ybits = ::ds_ybits; - dc_destorg = ::dc_destorg; - ds_light = ::ds_light; - ds_shade_constants = ::ds_shade_constants; + _source = (const uint32_t*)ds_source; + _xfrac = ds_xfrac; + _yfrac = ds_yfrac; + _xstep = ds_xstep; + _ystep = ds_ystep; + _x1 = ds_x1; + _x2 = ds_x2; + _y = ds_y; + _xbits = ds_xbits; + _ybits = ds_ybits; + _destorg = dc_destorg; + _light = ds_light; + _shade_constants = ds_shade_constants; } #ifdef NO_SSE void Execute(DrawerThread *thread) override { - if (thread->line_skipped_by_thread(ds_y)) + if (thread->line_skipped_by_thread(_y)) return; dsfixed_t xfrac; @@ -1420,24 +1426,24 @@ public: dsfixed_t xstep; dsfixed_t ystep; uint32_t* dest; - const uint32_t* source = ds_source; + const uint32_t* source = _source; int count; int spot; - xfrac = ds_xfrac; - yfrac = ds_yfrac; + xfrac = _xfrac; + yfrac = _yfrac; - dest = ylookup[ds_y] + ds_x1 + (uint32_t*)dc_destorg; + dest = ylookup[_y] + _x1 + (uint32_t*)_destorg; - count = ds_x2 - ds_x1 + 1; + count = _x2 - _x1 + 1; - xstep = ds_xstep; - ystep = ds_ystep; + xstep = _xstep; + ystep = _ystep; - uint32_t light = calc_light_multiplier(ds_light); - ShadeConstants shade_constants = ds_shade_constants; + uint32_t light = calc_light_multiplier(_light); + ShadeConstants shade_constants = _shade_constants; - if (ds_xbits == 6 && ds_ybits == 6) + if (_xbits == 6 && _ybits == 6) { // 64x64 is the most common case by far, so special case it. @@ -1456,9 +1462,9 @@ public: } else { - BYTE yshift = 32 - ds_ybits; - BYTE xshift = yshift - ds_xbits; - int xmask = ((1 << ds_xbits) - 1) << ds_ybits; + BYTE yshift = 32 - _ybits; + BYTE xshift = yshift - _xbits; + int xmask = ((1 << _xbits) - 1) << _ybits; do { @@ -1477,7 +1483,7 @@ public: #else void Execute(DrawerThread *thread) override { - if (thread->line_skipped_by_thread(ds_y)) + if (thread->line_skipped_by_thread(_y)) return; dsfixed_t xfrac; @@ -1485,24 +1491,24 @@ public: dsfixed_t xstep; dsfixed_t ystep; uint32_t* dest; - const uint32_t* source = ds_source; + const uint32_t* source = _source; int count; int spot; - xfrac = ds_xfrac; - yfrac = ds_yfrac; + xfrac = _xfrac; + yfrac = _yfrac; - dest = ylookup[ds_y] + ds_x1 + (uint32_t*)dc_destorg; + dest = ylookup[_y] + _x1 + (uint32_t*)_destorg; - count = ds_x2 - ds_x1 + 1; + count = _x2 - _x1 + 1; - xstep = ds_xstep; - ystep = ds_ystep; + xstep = _xstep; + ystep = _ystep; - uint32_t light = calc_light_multiplier(ds_light); - ShadeConstants shade_constants = ds_shade_constants; + uint32_t light = calc_light_multiplier(_light); + ShadeConstants shade_constants = _shade_constants; - if (ds_xbits == 6 && ds_ybits == 6) + if (_xbits == 6 && _ybits == 6) { // 64x64 is the most common case by far, so special case it. @@ -1602,9 +1608,9 @@ public: } else { - BYTE yshift = 32 - ds_ybits; - BYTE xshift = yshift - ds_xbits; - int xmask = ((1 << ds_xbits) - 1) << ds_ybits; + BYTE yshift = 32 - _ybits; + BYTE xshift = yshift - _xbits; + int xmask = ((1 << _xbits) - 1) << _ybits; int sse_count = count / 4; count -= sse_count * 4; @@ -1698,42 +1704,42 @@ public: class DrawSpanMaskedRGBACommand : public DrawerCommand { - const uint32_t *ds_source; - fixed_t ds_light; - ShadeConstants ds_shade_constants; - fixed_t ds_xfrac; - fixed_t ds_yfrac; - BYTE *dc_destorg; - int ds_x1; - int ds_x2; - int ds_y1; - int ds_y; - fixed_t ds_xstep; - fixed_t ds_ystep; - int ds_xbits; - int ds_ybits; + const uint32_t *_source; + fixed_t _light; + ShadeConstants _shade_constants; + fixed_t _xfrac; + fixed_t _yfrac; + BYTE *_destorg; + int _x1; + int _x2; + int _y1; + int _y; + fixed_t _xstep; + fixed_t _ystep; + int _xbits; + int _ybits; public: DrawSpanMaskedRGBACommand() { - ds_source = (const uint32_t*)::ds_source; - ds_light = ::ds_light; - ds_shade_constants = ::ds_shade_constants; - ds_xfrac = ::ds_xfrac; - ds_yfrac = ::ds_yfrac; - dc_destorg = ::dc_destorg; - ds_x1 = ::ds_x1; - ds_x2 = ::ds_x2; - ds_y = ::ds_y; - ds_xstep = ::ds_xstep; - ds_ystep = ::ds_ystep; - ds_xbits = ::ds_xbits; - ds_ybits = ::ds_ybits; + _source = (const uint32_t*)ds_source; + _light = ds_light; + _shade_constants = ds_shade_constants; + _xfrac = ds_xfrac; + _yfrac = ds_yfrac; + _destorg = dc_destorg; + _x1 = ds_x1; + _x2 = ds_x2; + _y = ds_y; + _xstep = ds_xstep; + _ystep = ds_ystep; + _xbits = ds_xbits; + _ybits = ds_ybits; } void Execute(DrawerThread *thread) override { - if (thread->line_skipped_by_thread(ds_y)) + if (thread->line_skipped_by_thread(_y)) return; dsfixed_t xfrac; @@ -1741,24 +1747,24 @@ public: dsfixed_t xstep; dsfixed_t ystep; uint32_t* dest; - const uint32_t* source = ds_source; + const uint32_t* source = _source; int count; int spot; - uint32_t light = calc_light_multiplier(ds_light); - ShadeConstants shade_constants = ds_shade_constants; + uint32_t light = calc_light_multiplier(_light); + ShadeConstants shade_constants = _shade_constants; - xfrac = ds_xfrac; - yfrac = ds_yfrac; + xfrac = _xfrac; + yfrac = _yfrac; - dest = ylookup[ds_y] + ds_x1 + (uint32_t*)dc_destorg; + dest = ylookup[_y] + _x1 + (uint32_t*)_destorg; - count = ds_x2 - ds_x1 + 1; + count = _x2 - _x1 + 1; - xstep = ds_xstep; - ystep = ds_ystep; + xstep = _xstep; + ystep = _ystep; - if (ds_xbits == 6 && ds_ybits == 6) + if (_xbits == 6 && _ybits == 6) { // 64x64 is the most common case by far, so special case it. do @@ -1778,9 +1784,9 @@ public: } else { - BYTE yshift = 32 - ds_ybits; - BYTE xshift = yshift - ds_xbits; - int xmask = ((1 << ds_xbits) - 1) << ds_ybits; + BYTE yshift = 32 - _ybits; + BYTE xshift = yshift - _xbits; + int xmask = ((1 << _xbits) - 1) << _ybits; do { uint32_t texdata; @@ -1801,42 +1807,46 @@ public: class DrawSpanTranslucentRGBACommand : public DrawerCommand { - const uint32_t *ds_source; - fixed_t ds_light; - ShadeConstants ds_shade_constants; - fixed_t ds_xfrac; - fixed_t ds_yfrac; - BYTE *dc_destorg; - int ds_x1; - int ds_x2; - int ds_y1; - int ds_y; - fixed_t ds_xstep; - fixed_t ds_ystep; - int ds_xbits; - int ds_ybits; + const uint32_t *_source; + fixed_t _light; + ShadeConstants _shade_constants; + fixed_t _xfrac; + fixed_t _yfrac; + BYTE *_destorg; + int _x1; + int _x2; + int _y1; + int _y; + fixed_t _xstep; + fixed_t _ystep; + int _xbits; + int _ybits; + fixed_t _srcalpha; + fixed_t _destalpha; public: DrawSpanTranslucentRGBACommand() { - ds_source = (const uint32_t *)::ds_source; - ds_light = ::ds_light; - ds_shade_constants = ::ds_shade_constants; - ds_xfrac = ::ds_xfrac; - ds_yfrac = ::ds_yfrac; - dc_destorg = ::dc_destorg; - ds_x1 = ::ds_x1; - ds_x2 = ::ds_x2; - ds_y = ::ds_y; - ds_xstep = ::ds_xstep; - ds_ystep = ::ds_ystep; - ds_xbits = ::ds_xbits; - ds_ybits = ::ds_ybits; + _source = (const uint32_t *)ds_source; + _light = ds_light; + _shade_constants = ds_shade_constants; + _xfrac = ds_xfrac; + _yfrac = ds_yfrac; + _destorg = dc_destorg; + _x1 = ds_x1; + _x2 = ds_x2; + _y = ds_y; + _xstep = ds_xstep; + _ystep = ds_ystep; + _xbits = ds_xbits; + _ybits = ds_ybits; + _srcalpha = dc_srcalpha; + _destalpha = dc_destalpha; } void Execute(DrawerThread *thread) override { - if (thread->line_skipped_by_thread(ds_y)) + if (thread->line_skipped_by_thread(_y)) return; dsfixed_t xfrac; @@ -1844,27 +1854,27 @@ public: dsfixed_t xstep; dsfixed_t ystep; uint32_t* dest; - const uint32_t* source = ds_source; + const uint32_t* source = _source; int count; int spot; - xfrac = ds_xfrac; - yfrac = ds_yfrac; + xfrac = _xfrac; + yfrac = _yfrac; - dest = ylookup[ds_y] + ds_x1 + (uint32_t*)dc_destorg; + dest = ylookup[_y] + _x1 + (uint32_t*)_destorg; - count = ds_x2 - ds_x1 + 1; + count = _x2 - _x1 + 1; - xstep = ds_xstep; - ystep = ds_ystep; + xstep = _xstep; + ystep = _ystep; - uint32_t light = calc_light_multiplier(ds_light); - ShadeConstants shade_constants = ds_shade_constants; + uint32_t light = calc_light_multiplier(_light); + ShadeConstants shade_constants = _shade_constants; - uint32_t fg_alpha = dc_srcalpha >> (FRACBITS - 8); - uint32_t bg_alpha = dc_destalpha >> (FRACBITS - 8); + uint32_t fg_alpha = _srcalpha >> (FRACBITS - 8); + uint32_t bg_alpha = _destalpha >> (FRACBITS - 8); - if (ds_xbits == 6 && ds_ybits == 6) + if (_xbits == 6 && _ybits == 6) { // 64x64 is the most common case by far, so special case it. do @@ -1892,9 +1902,9 @@ public: } else { - BYTE yshift = 32 - ds_ybits; - BYTE xshift = yshift - ds_xbits; - int xmask = ((1 << ds_xbits) - 1) << ds_ybits; + BYTE yshift = 32 - _ybits; + BYTE xshift = yshift - _xbits; + int xmask = ((1 << _xbits) - 1) << _ybits; do { spot = ((xfrac >> xshift) & xmask) + (yfrac >> yshift); @@ -1923,42 +1933,46 @@ public: class DrawSpanMaskedTranslucentRGBACommand : public DrawerCommand { - const uint32_t *ds_source; - fixed_t ds_light; - ShadeConstants ds_shade_constants; - fixed_t ds_xfrac; - fixed_t ds_yfrac; - BYTE *dc_destorg; - int ds_x1; - int ds_x2; - int ds_y1; - int ds_y; - fixed_t ds_xstep; - fixed_t ds_ystep; - int ds_xbits; - int ds_ybits; + const uint32_t *_source; + fixed_t _light; + ShadeConstants _shade_constants; + fixed_t _xfrac; + fixed_t _yfrac; + BYTE *_destorg; + int _x1; + int _x2; + int _y1; + int _y; + fixed_t _xstep; + fixed_t _ystep; + int _xbits; + int _ybits; + fixed_t _srcalpha; + fixed_t _destalpha; public: DrawSpanMaskedTranslucentRGBACommand() { - ds_source = (const uint32_t*)::ds_source; - ds_light = ::ds_light; - ds_shade_constants = ::ds_shade_constants; - ds_xfrac = ::ds_xfrac; - ds_yfrac = ::ds_yfrac; - dc_destorg = ::dc_destorg; - ds_x1 = ::ds_x1; - ds_x2 = ::ds_x2; - ds_y = ::ds_y; - ds_xstep = ::ds_xstep; - ds_ystep = ::ds_ystep; - ds_xbits = ::ds_xbits; - ds_ybits = ::ds_ybits; + _source = (const uint32_t*)ds_source; + _light = ds_light; + _shade_constants = ds_shade_constants; + _xfrac = ds_xfrac; + _yfrac = ds_yfrac; + _destorg = dc_destorg; + _x1 = ds_x1; + _x2 = ds_x2; + _y = ds_y; + _xstep = ds_xstep; + _ystep = ds_ystep; + _xbits = ds_xbits; + _ybits = ds_ybits; + _srcalpha = dc_srcalpha; + _destalpha = dc_destalpha; } void Execute(DrawerThread *thread) override { - if (thread->line_skipped_by_thread(ds_y)) + if (thread->line_skipped_by_thread(_y)) return; dsfixed_t xfrac; @@ -1966,27 +1980,27 @@ public: dsfixed_t xstep; dsfixed_t ystep; uint32_t* dest; - const uint32_t* source = ds_source; + const uint32_t* source = _source; int count; int spot; - uint32_t light = calc_light_multiplier(ds_light); - ShadeConstants shade_constants = ds_shade_constants; + uint32_t light = calc_light_multiplier(_light); + ShadeConstants shade_constants = _shade_constants; - uint32_t fg_alpha = dc_srcalpha >> (FRACBITS - 8); - uint32_t bg_alpha = dc_destalpha >> (FRACBITS - 8); + uint32_t fg_alpha = _srcalpha >> (FRACBITS - 8); + uint32_t bg_alpha = _destalpha >> (FRACBITS - 8); - xfrac = ds_xfrac; - yfrac = ds_yfrac; + xfrac = _xfrac; + yfrac = _yfrac; - dest = ylookup[ds_y] + ds_x1 + (uint32_t*)dc_destorg; + dest = ylookup[_y] + _x1 + (uint32_t*)_destorg; - count = ds_x2 - ds_x1 + 1; + count = _x2 - _x1 + 1; - xstep = ds_xstep; - ystep = ds_ystep; + xstep = _xstep; + ystep = _ystep; - if (ds_xbits == 6 && ds_ybits == 6) + if (_xbits == 6 && _ybits == 6) { // 64x64 is the most common case by far, so special case it. do @@ -2019,9 +2033,9 @@ public: } else { - BYTE yshift = 32 - ds_ybits; - BYTE xshift = yshift - ds_xbits; - int xmask = ((1 << ds_xbits) - 1) << ds_ybits; + BYTE yshift = 32 - _ybits; + BYTE xshift = yshift - _xbits; + int xmask = ((1 << _xbits) - 1) << _ybits; do { uint32_t texdata; @@ -2055,42 +2069,46 @@ public: class DrawSpanAddClampRGBACommand : public DrawerCommand { - const uint32_t *ds_source; - fixed_t ds_light; - ShadeConstants ds_shade_constants; - fixed_t ds_xfrac; - fixed_t ds_yfrac; - BYTE *dc_destorg; - int ds_x1; - int ds_x2; - int ds_y1; - int ds_y; - fixed_t ds_xstep; - fixed_t ds_ystep; - int ds_xbits; - int ds_ybits; + const uint32_t *_source; + fixed_t _light; + ShadeConstants _shade_constants; + fixed_t _xfrac; + fixed_t _yfrac; + BYTE *_destorg; + int _x1; + int _x2; + int _y1; + int _y; + fixed_t _xstep; + fixed_t _ystep; + int _xbits; + int _ybits; + fixed_t _srcalpha; + fixed_t _destalpha; public: DrawSpanAddClampRGBACommand() { - ds_source = (const uint32_t*)::ds_source; - ds_light = ::ds_light; - ds_shade_constants = ::ds_shade_constants; - ds_xfrac = ::ds_xfrac; - ds_yfrac = ::ds_yfrac; - dc_destorg = ::dc_destorg; - ds_x1 = ::ds_x1; - ds_x2 = ::ds_x2; - ds_y = ::ds_y; - ds_xstep = ::ds_xstep; - ds_ystep = ::ds_ystep; - ds_xbits = ::ds_xbits; - ds_ybits = ::ds_ybits; + _source = (const uint32_t*)ds_source; + _light = ds_light; + _shade_constants = ds_shade_constants; + _xfrac = ds_xfrac; + _yfrac = ds_yfrac; + _destorg = dc_destorg; + _x1 = ds_x1; + _x2 = ds_x2; + _y = ds_y; + _xstep = ds_xstep; + _ystep = ds_ystep; + _xbits = ds_xbits; + _ybits = ds_ybits; + _srcalpha = dc_srcalpha; + _destalpha = dc_destalpha; } void Execute(DrawerThread *thread) override { - if (thread->line_skipped_by_thread(ds_y)) + if (thread->line_skipped_by_thread(_y)) return; dsfixed_t xfrac; @@ -2098,27 +2116,27 @@ public: dsfixed_t xstep; dsfixed_t ystep; uint32_t* dest; - const uint32_t* source = ds_source; + const uint32_t* source = _source; int count; int spot; - uint32_t light = calc_light_multiplier(ds_light); - ShadeConstants shade_constants = ds_shade_constants; + uint32_t light = calc_light_multiplier(_light); + ShadeConstants shade_constants = _shade_constants; - uint32_t fg_alpha = dc_srcalpha >> (FRACBITS - 8); - uint32_t bg_alpha = dc_destalpha >> (FRACBITS - 8); + uint32_t fg_alpha = _srcalpha >> (FRACBITS - 8); + uint32_t bg_alpha = _destalpha >> (FRACBITS - 8); - xfrac = ds_xfrac; - yfrac = ds_yfrac; + xfrac = _xfrac; + yfrac = _yfrac; - dest = ylookup[ds_y] + ds_x1 + (uint32_t*)dc_destorg; + dest = ylookup[_y] + _x1 + (uint32_t*)_destorg; - count = ds_x2 - ds_x1 + 1; + count = _x2 - _x1 + 1; - xstep = ds_xstep; - ystep = ds_ystep; + xstep = _xstep; + ystep = _ystep; - if (ds_xbits == 6 && ds_ybits == 6) + if (_xbits == 6 && _ybits == 6) { // 64x64 is the most common case by far, so special case it. do @@ -2146,9 +2164,9 @@ public: } else { - BYTE yshift = 32 - ds_ybits; - BYTE xshift = yshift - ds_xbits; - int xmask = ((1 << ds_xbits) - 1) << ds_ybits; + BYTE yshift = 32 - _ybits; + BYTE xshift = yshift - _xbits; + int xmask = ((1 << _xbits) - 1) << _ybits; do { spot = ((xfrac >> xshift) & xmask) + (yfrac >> yshift); @@ -2177,42 +2195,46 @@ public: class DrawSpanMaskedAddClampRGBACommand : public DrawerCommand { - const uint32_t *ds_source; - fixed_t ds_light; - ShadeConstants ds_shade_constants; - fixed_t ds_xfrac; - fixed_t ds_yfrac; - BYTE *dc_destorg; - int ds_x1; - int ds_x2; - int ds_y1; - int ds_y; - fixed_t ds_xstep; - fixed_t ds_ystep; - int ds_xbits; - int ds_ybits; + const uint32_t *_source; + fixed_t _light; + ShadeConstants _shade_constants; + fixed_t _xfrac; + fixed_t _yfrac; + BYTE *_destorg; + int _x1; + int _x2; + int _y1; + int _y; + fixed_t _xstep; + fixed_t _ystep; + int _xbits; + int _ybits; + fixed_t _srcalpha; + fixed_t _destalpha; public: DrawSpanMaskedAddClampRGBACommand() { - ds_source = (const uint32_t*)::ds_source; - ds_light = ::ds_light; - ds_shade_constants = ::ds_shade_constants; - ds_xfrac = ::ds_xfrac; - ds_yfrac = ::ds_yfrac; - dc_destorg = ::dc_destorg; - ds_x1 = ::ds_x1; - ds_x2 = ::ds_x2; - ds_y = ::ds_y; - ds_xstep = ::ds_xstep; - ds_ystep = ::ds_ystep; - ds_xbits = ::ds_xbits; - ds_ybits = ::ds_ybits; + _source = (const uint32_t*)ds_source; + _light = ds_light; + _shade_constants = ds_shade_constants; + _xfrac = ds_xfrac; + _yfrac = ds_yfrac; + _destorg = dc_destorg; + _x1 = ds_x1; + _x2 = ds_x2; + _y = ds_y; + _xstep = ds_xstep; + _ystep = ds_ystep; + _xbits = ds_xbits; + _ybits = ds_ybits; + _srcalpha = dc_srcalpha; + _destalpha = dc_destalpha; } void Execute(DrawerThread *thread) override { - if (thread->line_skipped_by_thread(ds_y)) + if (thread->line_skipped_by_thread(_y)) return; dsfixed_t xfrac; @@ -2220,27 +2242,27 @@ public: dsfixed_t xstep; dsfixed_t ystep; uint32_t* dest; - const uint32_t* source = ds_source; + const uint32_t* source = _source; int count; int spot; - uint32_t light = calc_light_multiplier(ds_light); - ShadeConstants shade_constants = ds_shade_constants; + uint32_t light = calc_light_multiplier(_light); + ShadeConstants shade_constants = _shade_constants; - uint32_t fg_alpha = dc_srcalpha >> (FRACBITS - 8); - uint32_t bg_alpha = dc_destalpha >> (FRACBITS - 8); + uint32_t fg_alpha = _srcalpha >> (FRACBITS - 8); + uint32_t bg_alpha = _destalpha >> (FRACBITS - 8); - xfrac = ds_xfrac; - yfrac = ds_yfrac; + xfrac = _xfrac; + yfrac = _yfrac; - dest = ylookup[ds_y] + ds_x1 + (uint32_t*)dc_destorg; + dest = ylookup[_y] + _x1 + (uint32_t*)_destorg; - count = ds_x2 - ds_x1 + 1; + count = _x2 - _x1 + 1; - xstep = ds_xstep; - ystep = ds_ystep; + xstep = _xstep; + ystep = _ystep; - if (ds_xbits == 6 && ds_ybits == 6) + if (_xbits == 6 && _ybits == 6) { // 64x64 is the most common case by far, so special case it. do @@ -2273,9 +2295,9 @@ public: } else { - BYTE yshift = 32 - ds_ybits; - BYTE xshift = yshift - ds_xbits; - int xmask = ((1 << ds_xbits) - 1) << ds_ybits; + BYTE yshift = 32 - _ybits; + BYTE xshift = yshift - _xbits; + int xmask = ((1 << _xbits) - 1) << _ybits; do { uint32_t texdata; @@ -2309,33 +2331,33 @@ public: class FillSpanRGBACommand : public DrawerCommand { - int ds_x1; - int ds_x2; - int ds_y; - BYTE *dc_destorg; - fixed_t ds_light; - int ds_color; + int _x1; + int _x2; + int _y; + BYTE *_destorg; + fixed_t _light; + int _color; public: FillSpanRGBACommand() { - ds_x1 = ::ds_x1; - ds_x2 = ::ds_x2; - ds_y = ::ds_y; - dc_destorg = ::dc_destorg; - ds_light = ::ds_light; - ds_color = ::ds_color; + _x1 = ds_x1; + _x2 = ds_x2; + _y = ds_y; + _destorg = dc_destorg; + _light = ds_light; + _color = ds_color; } void Execute(DrawerThread *thread) override { - if (thread->line_skipped_by_thread(ds_y)) + if (thread->line_skipped_by_thread(_y)) return; - uint32_t *dest = ylookup[ds_y] + ds_x1 + (uint32_t*)dc_destorg; - int count = (ds_x2 - ds_x1 + 1); - uint32_t light = calc_light_multiplier(ds_light); - uint32_t color = shade_pal_index_simple(ds_color, light); + uint32_t *dest = ylookup[_y] + _x1 + (uint32_t*)_destorg; + int count = (_x2 - _x1 + 1); + uint32_t light = calc_light_multiplier(_light); + uint32_t color = shade_pal_index_simple(_color, light); for (int i = 0; i < count; i++) dest[i] = color; } @@ -2343,45 +2365,45 @@ public: class Vlinec1RGBACommand : public DrawerCommand { - DWORD dc_iscale; - DWORD dc_texturefrac; - int dc_count; - const BYTE *dc_source; - BYTE *dc_dest; + DWORD _iscale; + DWORD _texturefrac; + int _count; + const BYTE *_source; + BYTE *_dest; int vlinebits; - int dc_pitch; - fixed_t dc_light; - ShadeConstants dc_shade_constants; + int _pitch; + fixed_t _light; + ShadeConstants _shade_constants; public: Vlinec1RGBACommand() { - dc_iscale = ::dc_iscale; - dc_texturefrac = ::dc_texturefrac; - dc_count = ::dc_count; - dc_source = ::dc_source; - dc_dest = ::dc_dest; + _iscale = dc_iscale; + _texturefrac = dc_texturefrac; + _count = dc_count; + _source = dc_source; + _dest = dc_dest; vlinebits = ::vlinebits; - dc_pitch = ::dc_pitch; - dc_light = ::dc_light; - dc_shade_constants = ::dc_shade_constants; + _pitch = dc_pitch; + _light = dc_light; + _shade_constants = dc_shade_constants; } void Execute(DrawerThread *thread) override { - int count = thread->count_for_thread(dc_dest_y, dc_count); + int count = thread->count_for_thread(_dest_y, _count); if (count <= 0) return; - DWORD fracstep = dc_iscale * thread->num_cores; - DWORD frac = dc_texturefrac + dc_iscale * thread->skipped_by_thread(dc_dest_y); - const uint32 *source = (const uint32 *)dc_source; - uint32_t *dest = thread->dest_for_thread(dc_dest_y, dc_pitch, (uint32_t*)dc_dest); + DWORD fracstep = _iscale * thread->num_cores; + DWORD frac = _texturefrac + _iscale * thread->skipped_by_thread(_dest_y); + const uint32 *source = (const uint32 *)_source; + uint32_t *dest = thread->dest_for_thread(_dest_y, _pitch, (uint32_t*)_dest); int bits = vlinebits; - int pitch = dc_pitch * thread->num_cores; + int pitch = _pitch * thread->num_cores; - uint32_t light = calc_light_multiplier(dc_light); - ShadeConstants shade_constants = dc_shade_constants; + uint32_t light = calc_light_multiplier(_light); + ShadeConstants shade_constants = _shade_constants; do { @@ -2394,10 +2416,10 @@ public: class Vlinec4RGBACommand : public DrawerCommand { - BYTE *dc_dest; - int dc_count; - int dc_pitch; - ShadeConstants dc_shade_constants; + BYTE *_dest; + int _count; + int _pitch; + ShadeConstants _shade_constants; int vlinebits; fixed_t palookuplight[4]; DWORD vplce[4]; @@ -2407,10 +2429,10 @@ class Vlinec4RGBACommand : public DrawerCommand public: Vlinec4RGBACommand() { - dc_dest = ::dc_dest; - dc_count = ::dc_count; - dc_pitch = ::dc_pitch; - dc_shade_constants = ::dc_shade_constants; + _dest = dc_dest; + _count = dc_count; + _pitch = dc_pitch; + _shade_constants = dc_shade_constants; vlinebits = ::vlinebits; for (int i = 0; i < 4; i++) { @@ -2424,12 +2446,12 @@ public: #ifdef NO_SSE void Execute(DrawerThread *thread) override { - int count = thread->count_for_thread(dc_dest_y, dc_count); + int count = thread->count_for_thread(_dest_y, _count); if (count <= 0) return; - uint32_t *dest = thread->dest_for_thread(dc_dest_y, dc_pitch, (uint32_t*)dc_dest); - int pitch = dc_pitch * thread->num_cores; + uint32_t *dest = thread->dest_for_thread(_dest_y, _pitch, (uint32_t*)_dest); + int pitch = _pitch * thread->num_cores; int bits = vlinebits; DWORD place; @@ -2438,11 +2460,11 @@ public: uint32_t light2 = calc_light_multiplier(palookuplight[2]); uint32_t light3 = calc_light_multiplier(palookuplight[3]); - ShadeConstants shade_constants = dc_shade_constants; + ShadeConstants shade_constants = _shade_constants; DWORD local_vplce[4] = { vplce[0], vplce[1], vplce[2], vplce[3] }; DWORD local_vince[4] = { vince[0], vince[1], vince[2], vince[3] }; - int skipped = thread->skipped_by_thread(dc_dest_y); + int skipped = thread->skipped_by_thread(_dest_y); for (int i = 0; i < 4; i++) { local_vplce[i] += local_vince[i] * skipped; @@ -2461,24 +2483,24 @@ public: #else void Execute(DrawerThread *thread) override { - int count = thread->count_for_thread(dc_dest_y, dc_count); + int count = thread->count_for_thread(_dest_y, _count); if (count <= 0) return; - uint32_t *dest = thread->dest_for_thread(dc_dest_y, dc_pitch, (uint32_t*)dc_dest); + uint32_t *dest = thread->dest_for_thread(_dest_y, _pitch, (uint32_t*)_dest); int bits = vlinebits; - int pitch = dc_pitch * thread->num_cores; + int pitch = _pitch * thread->num_cores; uint32_t light0 = calc_light_multiplier(palookuplight[0]); uint32_t light1 = calc_light_multiplier(palookuplight[1]); uint32_t light2 = calc_light_multiplier(palookuplight[2]); uint32_t light3 = calc_light_multiplier(palookuplight[3]); - ShadeConstants shade_constants = dc_shade_constants; + ShadeConstants shade_constants = _shade_constants; DWORD local_vplce[4] = { vplce[0], vplce[1], vplce[2], vplce[3] }; DWORD local_vince[4] = { vince[0], vince[1], vince[2], vince[3] }; - int skipped = thread->skipped_by_thread(dc_dest_y); + int skipped = thread->skipped_by_thread(_dest_y); for (int i = 0; i < 4; i++) { local_vplce[i] += local_vince[i] * skipped; @@ -2543,45 +2565,45 @@ public: class Mvlinec1RGBACommand : public DrawerCommand { - DWORD dc_iscale; - DWORD dc_texturefrac; - int dc_count; - const BYTE *dc_source; - BYTE *dc_dest; + DWORD _iscale; + DWORD _texturefrac; + int _count; + const BYTE *_source; + BYTE *_dest; int mvlinebits; - int dc_pitch; - fixed_t dc_light; - ShadeConstants dc_shade_constants; + int _pitch; + fixed_t _light; + ShadeConstants _shade_constants; public: Mvlinec1RGBACommand() { - dc_iscale = ::dc_iscale; - dc_texturefrac = ::dc_texturefrac; - dc_count = ::dc_count; - dc_source = ::dc_source; - dc_dest = ::dc_dest; + _iscale = dc_iscale; + _texturefrac = dc_texturefrac; + _count = dc_count; + _source = dc_source; + _dest = dc_dest; mvlinebits = ::mvlinebits; - dc_pitch = ::dc_pitch; - dc_light = ::dc_light; - dc_shade_constants = ::dc_shade_constants; + _pitch = dc_pitch; + _light = dc_light; + _shade_constants = dc_shade_constants; } void Execute(DrawerThread *thread) override { - int count = thread->count_for_thread(dc_dest_y, dc_count); + int count = thread->count_for_thread(_dest_y, _count); if (count <= 0) return; - DWORD fracstep = dc_iscale * thread->num_cores; - DWORD frac = dc_texturefrac + dc_iscale * thread->skipped_by_thread(dc_dest_y); - const uint32 *source = (const uint32 *)dc_source; - uint32_t *dest = thread->dest_for_thread(dc_dest_y, dc_pitch, (uint32_t*)dc_dest); + DWORD fracstep = _iscale * thread->num_cores; + DWORD frac = _texturefrac + _iscale * thread->skipped_by_thread(_dest_y); + const uint32 *source = (const uint32 *)_source; + uint32_t *dest = thread->dest_for_thread(_dest_y, _pitch, (uint32_t*)_dest); int bits = mvlinebits; - int pitch = dc_pitch * thread->num_cores; + int pitch = _pitch * thread->num_cores; - uint32_t light = calc_light_multiplier(dc_light); - ShadeConstants shade_constants = dc_shade_constants; + uint32_t light = calc_light_multiplier(_light); + ShadeConstants shade_constants = _shade_constants; do { @@ -2598,10 +2620,10 @@ public: class Mvlinec4RGBACommand : public DrawerCommand { - BYTE *dc_dest; - int dc_count; - int dc_pitch; - ShadeConstants dc_shade_constants; + BYTE *_dest; + int _count; + int _pitch; + ShadeConstants _shade_constants; int mvlinebits; fixed_t palookuplight[4]; DWORD vplce[4]; @@ -2611,10 +2633,10 @@ class Mvlinec4RGBACommand : public DrawerCommand public: Mvlinec4RGBACommand() { - dc_dest = ::dc_dest; - dc_count = ::dc_count; - dc_pitch = ::dc_pitch; - dc_shade_constants = ::dc_shade_constants; + _dest = dc_dest; + _count = dc_count; + _pitch = dc_pitch; + _shade_constants = dc_shade_constants; mvlinebits = ::mvlinebits; for (int i = 0; i < 4; i++) { @@ -2628,12 +2650,12 @@ public: #ifdef NO_SSE void Execute(DrawerThread *thread) override { - int count = thread->count_for_thread(dc_dest_y, dc_count); + int count = thread->count_for_thread(_dest_y, _count); if (count <= 0) return; - uint32_t *dest = thread->dest_for_thread(dc_dest_y, dc_pitch, (uint32_t*)dc_dest); - int pitch = dc_pitch * thread->num_cores; + uint32_t *dest = thread->dest_for_thread(_dest_y, _pitch, (uint32_t*)_dest); + int pitch = _pitch * thread->num_cores; int bits = mvlinebits; DWORD place; @@ -2642,11 +2664,11 @@ public: uint32_t light2 = calc_light_multiplier(palookuplight[2]); uint32_t light3 = calc_light_multiplier(palookuplight[3]); - ShadeConstants shade_constants = dc_shade_constants; + ShadeConstants shade_constants = _shade_constants; DWORD local_vplce[4] = { vplce[0], vplce[1], vplce[2], vplce[3] }; DWORD local_vince[4] = { vince[0], vince[1], vince[2], vince[3] }; - int skipped = thread->skipped_by_thread(dc_dest_y); + int skipped = thread->skipped_by_thread(_dest_y); for (int i = 0; i < 4; i++) { local_vplce[i] += local_vince[i] * skipped; @@ -2666,12 +2688,12 @@ public: #else void Execute(DrawerThread *thread) override { - int count = thread->count_for_thread(dc_dest_y, dc_count); + int count = thread->count_for_thread(_dest_y, _count); if (count <= 0) return; - uint32_t *dest = thread->dest_for_thread(dc_dest_y, dc_pitch, (uint32_t*)dc_dest); - int pitch = dc_pitch * thread->num_cores; + uint32_t *dest = thread->dest_for_thread(_dest_y, _pitch, (uint32_t*)_dest); + int pitch = _pitch * thread->num_cores; int bits = mvlinebits; uint32_t light0 = calc_light_multiplier(palookuplight[0]); @@ -2679,11 +2701,11 @@ public: uint32_t light2 = calc_light_multiplier(palookuplight[2]); uint32_t light3 = calc_light_multiplier(palookuplight[3]); - ShadeConstants shade_constants = dc_shade_constants; + ShadeConstants shade_constants = _shade_constants; DWORD local_vplce[4] = { vplce[0], vplce[1], vplce[2], vplce[3] }; DWORD local_vince[4] = { vince[0], vince[1], vince[2], vince[3] }; - int skipped = thread->skipped_by_thread(dc_dest_y); + int skipped = thread->skipped_by_thread(_dest_y); for (int i = 0; i < 4; i++) { local_vplce[i] += local_vince[i] * skipped; @@ -2754,52 +2776,52 @@ public: class Tmvline1AddRGBACommand : public DrawerCommand { - DWORD dc_iscale; - DWORD dc_texturefrac; - int dc_count; - const BYTE *dc_source; - BYTE *dc_dest; + DWORD _iscale; + DWORD _texturefrac; + int _count; + const BYTE *_source; + BYTE *_dest; int tmvlinebits; - int dc_pitch; - fixed_t dc_light; - ShadeConstants dc_shade_constants; - fixed_t dc_srcalpha; - fixed_t dc_destalpha; + int _pitch; + fixed_t _light; + ShadeConstants _shade_constants; + fixed_t _srcalpha; + fixed_t _destalpha; public: Tmvline1AddRGBACommand() { - dc_iscale = ::dc_iscale; - dc_texturefrac = ::dc_texturefrac; - dc_count = ::dc_count; - dc_source = ::dc_source; - dc_dest = ::dc_dest; + _iscale = dc_iscale; + _texturefrac = dc_texturefrac; + _count = dc_count; + _source = dc_source; + _dest = dc_dest; tmvlinebits = ::tmvlinebits; - dc_pitch = ::dc_pitch; - dc_light = ::dc_light; - dc_shade_constants = ::dc_shade_constants; - dc_srcalpha = ::dc_srcalpha; - dc_destalpha = ::dc_destalpha; + _pitch = dc_pitch; + _light = dc_light; + _shade_constants = dc_shade_constants; + _srcalpha = dc_srcalpha; + _destalpha = dc_destalpha; } void Execute(DrawerThread *thread) override { - int count = thread->count_for_thread(dc_dest_y, dc_count); + int count = thread->count_for_thread(_dest_y, _count); if (count <= 0) return; - DWORD fracstep = dc_iscale * thread->num_cores; - DWORD frac = dc_texturefrac + dc_iscale * thread->skipped_by_thread(dc_dest_y); - const uint32 *source = (const uint32 *)dc_source; - uint32_t *dest = thread->dest_for_thread(dc_dest_y, dc_pitch, (uint32_t*)dc_dest); + DWORD fracstep = _iscale * thread->num_cores; + DWORD frac = _texturefrac + _iscale * thread->skipped_by_thread(_dest_y); + const uint32 *source = (const uint32 *)_source; + uint32_t *dest = thread->dest_for_thread(_dest_y, _pitch, (uint32_t*)_dest); int bits = tmvlinebits; - int pitch = dc_pitch * thread->num_cores; + int pitch = _pitch * thread->num_cores; - uint32_t light = calc_light_multiplier(dc_light); - ShadeConstants shade_constants = dc_shade_constants; + uint32_t light = calc_light_multiplier(_light); + ShadeConstants shade_constants = _shade_constants; - uint32_t fg_alpha = dc_srcalpha >> (FRACBITS - 8); - uint32_t bg_alpha = dc_destalpha >> (FRACBITS - 8); + uint32_t fg_alpha = _srcalpha >> (FRACBITS - 8); + uint32_t bg_alpha = _destalpha >> (FRACBITS - 8); do { @@ -2829,12 +2851,12 @@ public: class Tmvline4AddRGBACommand : public DrawerCommand { - BYTE *dc_dest; - int dc_count; - int dc_pitch; - ShadeConstants dc_shade_constants; - fixed_t dc_srcalpha; - fixed_t dc_destalpha; + BYTE *_dest; + int _count; + int _pitch; + ShadeConstants _shade_constants; + fixed_t _srcalpha; + fixed_t _destalpha; int tmvlinebits; fixed_t palookuplight[4]; DWORD vplce[4]; @@ -2844,12 +2866,12 @@ class Tmvline4AddRGBACommand : public DrawerCommand public: Tmvline4AddRGBACommand() { - dc_dest = ::dc_dest; - dc_count = ::dc_count; - dc_pitch = ::dc_pitch; - dc_shade_constants = ::dc_shade_constants; - dc_srcalpha = ::dc_srcalpha; - dc_destalpha = ::dc_destalpha; + _dest = dc_dest; + _count = dc_count; + _pitch = dc_pitch; + _shade_constants = dc_shade_constants; + _srcalpha = dc_srcalpha; + _destalpha = dc_destalpha; tmvlinebits = ::tmvlinebits; for (int i = 0; i < 4; i++) { @@ -2862,12 +2884,12 @@ public: void Execute(DrawerThread *thread) override { - int count = thread->count_for_thread(dc_dest_y, dc_count); + int count = thread->count_for_thread(_dest_y, _count); if (count <= 0) return; - uint32_t *dest = thread->dest_for_thread(dc_dest_y, dc_pitch, (uint32_t*)dc_dest); - int pitch = dc_pitch * thread->num_cores; + uint32_t *dest = thread->dest_for_thread(_dest_y, _pitch, (uint32_t*)_dest); + int pitch = _pitch * thread->num_cores; int bits = tmvlinebits; uint32_t light[4]; @@ -2876,14 +2898,14 @@ public: light[2] = calc_light_multiplier(palookuplight[2]); light[3] = calc_light_multiplier(palookuplight[3]); - ShadeConstants shade_constants = dc_shade_constants; + ShadeConstants shade_constants = _shade_constants; - uint32_t fg_alpha = dc_srcalpha >> (FRACBITS - 8); - uint32_t bg_alpha = dc_destalpha >> (FRACBITS - 8); + uint32_t fg_alpha = _srcalpha >> (FRACBITS - 8); + uint32_t bg_alpha = _destalpha >> (FRACBITS - 8); DWORD local_vplce[4] = { vplce[0], vplce[1], vplce[2], vplce[3] }; DWORD local_vince[4] = { vince[0], vince[1], vince[2], vince[3] }; - int skipped = thread->skipped_by_thread(dc_dest_y); + int skipped = thread->skipped_by_thread(_dest_y); for (int i = 0; i < 4; i++) { local_vplce[i] += local_vince[i] * skipped; @@ -2921,52 +2943,52 @@ public: class Tmvline1AddClampRGBACommand : public DrawerCommand { - DWORD dc_iscale; - DWORD dc_texturefrac; - int dc_count; - const BYTE *dc_source; - BYTE *dc_dest; + DWORD _iscale; + DWORD _texturefrac; + int _count; + const BYTE *_source; + BYTE *_dest; int tmvlinebits; - int dc_pitch; - fixed_t dc_light; - ShadeConstants dc_shade_constants; - fixed_t dc_srcalpha; - fixed_t dc_destalpha; + int _pitch; + fixed_t _light; + ShadeConstants _shade_constants; + fixed_t _srcalpha; + fixed_t _destalpha; public: Tmvline1AddClampRGBACommand() { - dc_iscale = ::dc_iscale; - dc_texturefrac = ::dc_texturefrac; - dc_count = ::dc_count; - dc_source = ::dc_source; - dc_dest = ::dc_dest; + _iscale = dc_iscale; + _texturefrac = dc_texturefrac; + _count = dc_count; + _source = dc_source; + _dest = dc_dest; tmvlinebits = ::tmvlinebits; - dc_pitch = ::dc_pitch; - dc_light = ::dc_light; - dc_shade_constants = ::dc_shade_constants; - dc_srcalpha = ::dc_srcalpha; - dc_destalpha = ::dc_destalpha; + _pitch = dc_pitch; + _light = dc_light; + _shade_constants = dc_shade_constants; + _srcalpha = dc_srcalpha; + _destalpha = dc_destalpha; } void Execute(DrawerThread *thread) override { - int count = thread->count_for_thread(dc_dest_y, dc_count); + int count = thread->count_for_thread(_dest_y, _count); if (count <= 0) return; - DWORD fracstep = dc_iscale * thread->num_cores; - DWORD frac = dc_texturefrac + dc_iscale * thread->skipped_by_thread(dc_dest_y); - const uint32 *source = (const uint32 *)dc_source; - uint32_t *dest = thread->dest_for_thread(dc_dest_y, dc_pitch, (uint32_t*)dc_dest); + DWORD fracstep = _iscale * thread->num_cores; + DWORD frac = _texturefrac + _iscale * thread->skipped_by_thread(_dest_y); + const uint32 *source = (const uint32 *)_source; + uint32_t *dest = thread->dest_for_thread(_dest_y, _pitch, (uint32_t*)_dest); int bits = tmvlinebits; - int pitch = dc_pitch * thread->num_cores; + int pitch = _pitch * thread->num_cores; - uint32_t light = calc_light_multiplier(dc_light); - ShadeConstants shade_constants = dc_shade_constants; + uint32_t light = calc_light_multiplier(_light); + ShadeConstants shade_constants = _shade_constants; - uint32_t fg_alpha = dc_srcalpha >> (FRACBITS - 8); - uint32_t bg_alpha = dc_destalpha >> (FRACBITS - 8); + uint32_t fg_alpha = _srcalpha >> (FRACBITS - 8); + uint32_t bg_alpha = _destalpha >> (FRACBITS - 8); do { @@ -2996,12 +3018,12 @@ public: class Tmvline4AddClampRGBACommand : public DrawerCommand { - BYTE *dc_dest; - int dc_count; - int dc_pitch; - ShadeConstants dc_shade_constants; - fixed_t dc_srcalpha; - fixed_t dc_destalpha; + BYTE *_dest; + int _count; + int _pitch; + ShadeConstants _shade_constants; + fixed_t _srcalpha; + fixed_t _destalpha; int tmvlinebits; fixed_t palookuplight[4]; DWORD vplce[4]; @@ -3011,12 +3033,12 @@ class Tmvline4AddClampRGBACommand : public DrawerCommand public: Tmvline4AddClampRGBACommand() { - dc_dest = ::dc_dest; - dc_count = ::dc_count; - dc_pitch = ::dc_pitch; - dc_shade_constants = ::dc_shade_constants; - dc_srcalpha = ::dc_srcalpha; - dc_destalpha = ::dc_destalpha; + _dest = dc_dest; + _count = dc_count; + _pitch = dc_pitch; + _shade_constants = dc_shade_constants; + _srcalpha = dc_srcalpha; + _destalpha = dc_destalpha; tmvlinebits = ::tmvlinebits; for (int i = 0; i < 4; i++) { @@ -3029,12 +3051,12 @@ public: void Execute(DrawerThread *thread) override { - int count = thread->count_for_thread(dc_dest_y, dc_count); + int count = thread->count_for_thread(_dest_y, _count); if (count <= 0) return; - uint32_t *dest = thread->dest_for_thread(dc_dest_y, dc_pitch, (uint32_t*)dc_dest); - int pitch = dc_pitch * thread->num_cores; + uint32_t *dest = thread->dest_for_thread(_dest_y, _pitch, (uint32_t*)_dest); + int pitch = _pitch * thread->num_cores; int bits = tmvlinebits; uint32_t light[4]; @@ -3043,14 +3065,14 @@ public: light[2] = calc_light_multiplier(palookuplight[2]); light[3] = calc_light_multiplier(palookuplight[3]); - ShadeConstants shade_constants = dc_shade_constants; + ShadeConstants shade_constants = _shade_constants; - uint32_t fg_alpha = dc_srcalpha >> (FRACBITS - 8); - uint32_t bg_alpha = dc_destalpha >> (FRACBITS - 8); + uint32_t fg_alpha = _srcalpha >> (FRACBITS - 8); + uint32_t bg_alpha = _destalpha >> (FRACBITS - 8); DWORD local_vplce[4] = { vplce[0], vplce[1], vplce[2], vplce[3] }; DWORD local_vince[4] = { vince[0], vince[1], vince[2], vince[3] }; - int skipped = thread->skipped_by_thread(dc_dest_y); + int skipped = thread->skipped_by_thread(_dest_y); for (int i = 0; i < 4; i++) { local_vplce[i] += local_vince[i] * skipped; @@ -3088,52 +3110,52 @@ public: class Tmvline1SubClampRGBACommand : public DrawerCommand { - DWORD dc_iscale; - DWORD dc_texturefrac; - int dc_count; - const BYTE *dc_source; - BYTE *dc_dest; + DWORD _iscale; + DWORD _texturefrac; + int _count; + const BYTE *_source; + BYTE *_dest; int tmvlinebits; - int dc_pitch; - fixed_t dc_light; - ShadeConstants dc_shade_constants; - fixed_t dc_srcalpha; - fixed_t dc_destalpha; + int _pitch; + fixed_t _light; + ShadeConstants _shade_constants; + fixed_t _srcalpha; + fixed_t _destalpha; public: Tmvline1SubClampRGBACommand() { - dc_iscale = ::dc_iscale; - dc_texturefrac = ::dc_texturefrac; - dc_count = ::dc_count; - dc_source = ::dc_source; - dc_dest = ::dc_dest; + _iscale = dc_iscale; + _texturefrac = dc_texturefrac; + _count = dc_count; + _source = dc_source; + _dest = dc_dest; tmvlinebits = ::tmvlinebits; - dc_pitch = ::dc_pitch; - dc_light = ::dc_light; - dc_shade_constants = ::dc_shade_constants; - dc_srcalpha = ::dc_srcalpha; - dc_destalpha = ::dc_destalpha; + _pitch = dc_pitch; + _light = dc_light; + _shade_constants = dc_shade_constants; + _srcalpha = dc_srcalpha; + _destalpha = dc_destalpha; } void Execute(DrawerThread *thread) override { - int count = thread->count_for_thread(dc_dest_y, dc_count); + int count = thread->count_for_thread(_dest_y, _count); if (count <= 0) return; - DWORD fracstep = dc_iscale * thread->num_cores; - DWORD frac = dc_texturefrac + dc_iscale * thread->skipped_by_thread(dc_dest_y); - const uint32 *source = (const uint32 *)dc_source; - uint32_t *dest = thread->dest_for_thread(dc_dest_y, dc_pitch, (uint32_t*)dc_dest); + DWORD fracstep = _iscale * thread->num_cores; + DWORD frac = _texturefrac + _iscale * thread->skipped_by_thread(_dest_y); + const uint32 *source = (const uint32 *)_source; + uint32_t *dest = thread->dest_for_thread(_dest_y, _pitch, (uint32_t*)_dest); int bits = tmvlinebits; - int pitch = dc_pitch * thread->num_cores; + int pitch = _pitch * thread->num_cores; - uint32_t light = calc_light_multiplier(dc_light); - ShadeConstants shade_constants = dc_shade_constants; + uint32_t light = calc_light_multiplier(_light); + ShadeConstants shade_constants = _shade_constants; - uint32_t fg_alpha = dc_srcalpha >> (FRACBITS - 8); - uint32_t bg_alpha = dc_destalpha >> (FRACBITS - 8); + uint32_t fg_alpha = _srcalpha >> (FRACBITS - 8); + uint32_t bg_alpha = _destalpha >> (FRACBITS - 8); do { @@ -3163,12 +3185,12 @@ public: class Tmvline4SubClampRGBACommand : public DrawerCommand { - BYTE *dc_dest; - int dc_count; - int dc_pitch; - ShadeConstants dc_shade_constants; - fixed_t dc_srcalpha; - fixed_t dc_destalpha; + BYTE *_dest; + int _count; + int _pitch; + ShadeConstants _shade_constants; + fixed_t _srcalpha; + fixed_t _destalpha; int tmvlinebits; fixed_t palookuplight[4]; DWORD vplce[4]; @@ -3178,12 +3200,12 @@ class Tmvline4SubClampRGBACommand : public DrawerCommand public: Tmvline4SubClampRGBACommand() { - dc_dest = ::dc_dest; - dc_count = ::dc_count; - dc_pitch = ::dc_pitch; - dc_shade_constants = ::dc_shade_constants; - dc_srcalpha = ::dc_srcalpha; - dc_destalpha = ::dc_destalpha; + _dest = dc_dest; + _count = dc_count; + _pitch = dc_pitch; + _shade_constants = dc_shade_constants; + _srcalpha = dc_srcalpha; + _destalpha = dc_destalpha; tmvlinebits = ::tmvlinebits; for (int i = 0; i < 4; i++) { @@ -3196,12 +3218,12 @@ public: void Execute(DrawerThread *thread) override { - int count = thread->count_for_thread(dc_dest_y, dc_count); + int count = thread->count_for_thread(_dest_y, _count); if (count <= 0) return; - uint32_t *dest = thread->dest_for_thread(dc_dest_y, dc_pitch, (uint32_t*)dc_dest); - int pitch = dc_pitch * thread->num_cores; + uint32_t *dest = thread->dest_for_thread(_dest_y, _pitch, (uint32_t*)_dest); + int pitch = _pitch * thread->num_cores; int bits = tmvlinebits; uint32_t light[4]; @@ -3210,14 +3232,14 @@ public: light[2] = calc_light_multiplier(palookuplight[2]); light[3] = calc_light_multiplier(palookuplight[3]); - ShadeConstants shade_constants = dc_shade_constants; + ShadeConstants shade_constants = _shade_constants; - uint32_t fg_alpha = dc_srcalpha >> (FRACBITS - 8); - uint32_t bg_alpha = dc_destalpha >> (FRACBITS - 8); + uint32_t fg_alpha = _srcalpha >> (FRACBITS - 8); + uint32_t bg_alpha = _destalpha >> (FRACBITS - 8); DWORD local_vplce[4] = { vplce[0], vplce[1], vplce[2], vplce[3] }; DWORD local_vince[4] = { vince[0], vince[1], vince[2], vince[3] }; - int skipped = thread->skipped_by_thread(dc_dest_y); + int skipped = thread->skipped_by_thread(_dest_y); for (int i = 0; i < 4; i++) { local_vplce[i] += local_vince[i] * skipped; @@ -3255,52 +3277,52 @@ public: class Tmvline1RevSubClampRGBACommand : public DrawerCommand { - DWORD dc_iscale; - DWORD dc_texturefrac; - int dc_count; - const BYTE *dc_source; - BYTE *dc_dest; + DWORD _iscale; + DWORD _texturefrac; + int _count; + const BYTE *_source; + BYTE *_dest; int tmvlinebits; - int dc_pitch; - fixed_t dc_light; - ShadeConstants dc_shade_constants; - fixed_t dc_srcalpha; - fixed_t dc_destalpha; + int _pitch; + fixed_t _light; + ShadeConstants _shade_constants; + fixed_t _srcalpha; + fixed_t _destalpha; public: Tmvline1RevSubClampRGBACommand() { - dc_iscale = ::dc_iscale; - dc_texturefrac = ::dc_texturefrac; - dc_count = ::dc_count; - dc_source = ::dc_source; - dc_dest = ::dc_dest; + _iscale = dc_iscale; + _texturefrac = dc_texturefrac; + _count = dc_count; + _source = dc_source; + _dest = dc_dest; tmvlinebits = ::tmvlinebits; - dc_pitch = ::dc_pitch; - dc_light = ::dc_light; - dc_shade_constants = ::dc_shade_constants; - dc_srcalpha = ::dc_srcalpha; - dc_destalpha = ::dc_destalpha; + _pitch = dc_pitch; + _light = dc_light; + _shade_constants = dc_shade_constants; + _srcalpha = dc_srcalpha; + _destalpha = dc_destalpha; } void Execute(DrawerThread *thread) override { - int count = thread->count_for_thread(dc_dest_y, dc_count); + int count = thread->count_for_thread(_dest_y, _count); if (count <= 0) return; - DWORD fracstep = dc_iscale * thread->num_cores; - DWORD frac = dc_texturefrac + dc_iscale * thread->skipped_by_thread(dc_dest_y); - const uint32 *source = (const uint32 *)dc_source; - uint32_t *dest = thread->dest_for_thread(dc_dest_y, dc_pitch, (uint32_t*)dc_dest); + DWORD fracstep = _iscale * thread->num_cores; + DWORD frac = _texturefrac + _iscale * thread->skipped_by_thread(_dest_y); + const uint32 *source = (const uint32 *)_source; + uint32_t *dest = thread->dest_for_thread(_dest_y, _pitch, (uint32_t*)_dest); int bits = tmvlinebits; - int pitch = dc_pitch * thread->num_cores; + int pitch = _pitch * thread->num_cores; - uint32_t light = calc_light_multiplier(dc_light); - ShadeConstants shade_constants = dc_shade_constants; + uint32_t light = calc_light_multiplier(_light); + ShadeConstants shade_constants = _shade_constants; - uint32_t fg_alpha = dc_srcalpha >> (FRACBITS - 8); - uint32_t bg_alpha = dc_destalpha >> (FRACBITS - 8); + uint32_t fg_alpha = _srcalpha >> (FRACBITS - 8); + uint32_t bg_alpha = _destalpha >> (FRACBITS - 8); do { @@ -3330,12 +3352,12 @@ public: class Tmvline4RevSubClampRGBACommand : public DrawerCommand { - BYTE *dc_dest; - int dc_count; - int dc_pitch; - ShadeConstants dc_shade_constants; - fixed_t dc_srcalpha; - fixed_t dc_destalpha; + BYTE *_dest; + int _count; + int _pitch; + ShadeConstants _shade_constants; + fixed_t _srcalpha; + fixed_t _destalpha; int tmvlinebits; fixed_t palookuplight[4]; DWORD vplce[4]; @@ -3345,12 +3367,12 @@ class Tmvline4RevSubClampRGBACommand : public DrawerCommand public: Tmvline4RevSubClampRGBACommand() { - dc_dest = ::dc_dest; - dc_count = ::dc_count; - dc_pitch = ::dc_pitch; - dc_shade_constants = ::dc_shade_constants; - dc_srcalpha = ::dc_srcalpha; - dc_destalpha = ::dc_destalpha; + _dest = dc_dest; + _count = dc_count; + _pitch = dc_pitch; + _shade_constants = dc_shade_constants; + _srcalpha = dc_srcalpha; + _destalpha = dc_destalpha; tmvlinebits = ::tmvlinebits; for (int i = 0; i < 4; i++) { @@ -3363,12 +3385,12 @@ public: void Execute(DrawerThread *thread) override { - int count = thread->count_for_thread(dc_dest_y, dc_count); + int count = thread->count_for_thread(_dest_y, _count); if (count <= 0) return; - uint32_t *dest = thread->dest_for_thread(dc_dest_y, dc_pitch, (uint32_t*)dc_dest); - int pitch = dc_pitch * thread->num_cores; + uint32_t *dest = thread->dest_for_thread(_dest_y, _pitch, (uint32_t*)_dest); + int pitch = _pitch * thread->num_cores; int bits = tmvlinebits; uint32_t light[4]; @@ -3377,14 +3399,14 @@ public: light[2] = calc_light_multiplier(palookuplight[2]); light[3] = calc_light_multiplier(palookuplight[3]); - ShadeConstants shade_constants = dc_shade_constants; + ShadeConstants shade_constants = _shade_constants; - uint32_t fg_alpha = dc_srcalpha >> (FRACBITS - 8); - uint32_t bg_alpha = dc_destalpha >> (FRACBITS - 8); + uint32_t fg_alpha = _srcalpha >> (FRACBITS - 8); + uint32_t bg_alpha = _destalpha >> (FRACBITS - 8); DWORD local_vplce[4] = { vplce[0], vplce[1], vplce[2], vplce[3] }; DWORD local_vince[4] = { vince[0], vince[1], vince[2], vince[3] }; - int skipped = thread->skipped_by_thread(dc_dest_y); + int skipped = thread->skipped_by_thread(_dest_y); for (int i = 0; i < 4; i++) { local_vplce[i] += local_vince[i] * skipped; @@ -3425,9 +3447,9 @@ class DrawFogBoundaryLineRGBACommand : public DrawerCommand int _y; int _x; int _x2; - BYTE *dc_destorg; - fixed_t dc_light; - ShadeConstants dc_shade_constants; + BYTE *_destorg; + fixed_t _light; + ShadeConstants _shade_constants; public: DrawFogBoundaryLineRGBACommand(int y, int x, int x2) @@ -3436,9 +3458,9 @@ public: _x = x; _x2 = x2; - dc_destorg = ::dc_destorg; - dc_light = ::dc_light; - dc_shade_constants = ::dc_shade_constants; + _destorg = dc_destorg; + _light = dc_light; + _shade_constants = dc_shade_constants; } void Execute(DrawerThread *thread) override @@ -3450,10 +3472,10 @@ public: int x = _x; int x2 = _x2; - uint32_t *dest = ylookup[y] + (uint32_t*)dc_destorg; + uint32_t *dest = ylookup[y] + (uint32_t*)_destorg; - uint32_t light = calc_light_multiplier(dc_light); - ShadeConstants constants = dc_shade_constants; + uint32_t light = calc_light_multiplier(_light); + ShadeConstants constants = _shade_constants; do { @@ -3492,6 +3514,157 @@ public: } }; +class DrawTiltedSpanRGBACommand : public DrawerCommand +{ + int _y; + int _x1; + int _x2; + BYTE *_destorg; + fixed_t _light; + ShadeConstants _shade_constants; + const BYTE *_source; + +public: + DrawTiltedSpanRGBACommand(int y, int x1, int x2) + { + _y = y; + _x1 = x1; + _x2 = x2; + + _destorg = dc_destorg; + _source = ds_source; + } + + void Execute(DrawerThread *thread) override + { + if (thread->line_skipped_by_thread(_y)) + return; + + int y = _y; + int x1 = _x1; + int x2 = _x2; + + // Slopes are broken currently in master. + // Until R_DrawTiltedPlane is fixed we are just going to fill with a solid color. + + uint32_t *source = (uint32_t*)_source; + uint32_t *dest = ylookup[y] + x1 + (uint32_t*)_destorg; + + int count = x2 - x1 + 1; + while (count > 0) + { + *(dest++) = source[0]; + count--; + } + } +}; + +class DrawColoredSpanRGBACommand : public DrawerCommand +{ + int _y; + int _x1; + int _x2; + BYTE *_destorg; + fixed_t _light; + int _color; + +public: + DrawColoredSpanRGBACommand(int y, int x1, int x2) + { + _y = y; + _x1 = x1; + _x2 = x2; + + _destorg = dc_destorg; + _light = ds_light; + _color = ds_color; + } + + void Execute(DrawerThread *thread) override + { + if (thread->line_skipped_by_thread(_y)) + return; + + int y = _y; + int x1 = _x1; + int x2 = _x2; + + uint32_t *dest = ylookup[y] + x1 + (uint32_t*)_destorg; + int count = (x2 - x1 + 1); + uint32_t light = calc_light_multiplier(_light); + uint32_t color = shade_pal_index_simple(_color, light); + for (int i = 0; i < count; i++) + dest[i] = color; + } +}; + +class FillTransColumnRGBACommand : public DrawerCommand +{ + int _x; + int _y1; + int _y2; + int _color; + int _a; + BYTE *_destorg; + int _pitch; + fixed_t _light; + +public: + FillTransColumnRGBACommand(int x, int y1, int y2, int color, int a) + { + _x = x; + _y1 = y1; + _y2 = y2; + _color = color; + _a = a; + + _destorg = dc_destorg; + _pitch = dc_pitch; + } + + void Execute(DrawerThread *thread) override + { + int x = _x; + int y1 = _y1; + int y2 = _y2; + int color = _color; + int a = _a; + + int ycount = thread->count_for_thread(y1, y2 - y1 + 1); + if (ycount <= 0) + return; + + uint32_t fg = GPalette.BaseColors[color].d; + uint32_t fg_red = (fg >> 16) & 0xff; + uint32_t fg_green = (fg >> 8) & 0xff; + uint32_t fg_blue = fg & 0xff; + + uint32_t alpha = a + 1; + uint32_t inv_alpha = 256 - alpha; + + fg_red *= alpha; + fg_green *= alpha; + fg_blue *= alpha; + + int spacing = _pitch * thread->num_cores; + uint32_t *dest = thread->dest_for_thread(y1, _pitch, ylookup[y1] + x + (uint32_t*)_destorg); + + for (int y = 0; y < ycount; y++) + { + uint32_t bg_red = (*dest >> 16) & 0xff; + uint32_t bg_green = (*dest >> 8) & 0xff; + uint32_t bg_blue = (*dest) & 0xff; + + uint32_t red = (fg_red + bg_red * inv_alpha) / 256; + uint32_t green = (fg_green + bg_green * inv_alpha) / 256; + uint32_t blue = (fg_blue + bg_blue * inv_alpha) / 256; + + *dest = 0xff000000 | (red << 16) | (green << 8) | blue; + dest += spacing; + } + } +}; + ApplySpecialColormapRGBACommand::ApplySpecialColormapRGBACommand(FSpecialColormap *colormap, DFrameBuffer *screen) { buffer = screen->GetBuffer(); diff --git a/src/r_draw_rgba.h b/src/r_draw_rgba.h index 47ea75260d..0ab3e298a4 100644 --- a/src/r_draw_rgba.h +++ b/src/r_draw_rgba.h @@ -184,6 +184,8 @@ public: virtual void Execute(DrawerThread *thread) = 0; }; +EXTERN_CVAR(Bool, r_multithreaded) + // Manages queueing up commands and executing them on worker threads class DrawerCommandQueue { @@ -227,7 +229,7 @@ public: static void QueueCommand(Types &&... args) { auto queue = Instance(); - if (queue->threaded_render == 0) + if (queue->threaded_render == 0 || !r_multithreaded) { T command(std::forward(args)...); command.Execute(&queue->single_core_thread); diff --git a/src/r_drawt_rgba.cpp b/src/r_drawt_rgba.cpp index d2d715c8dd..2311cb4477 100644 --- a/src/r_drawt_rgba.cpp +++ b/src/r_drawt_rgba.cpp @@ -59,8 +59,8 @@ class RtCopy1colRGBACommand : public DrawerCommand int sx; int yl; int yh; - BYTE *dc_destorg; - int dc_pitch; + BYTE *_destorg; + int _pitch; public: RtCopy1colRGBACommand(int hx, int sx, int yl, int yh) @@ -70,8 +70,8 @@ public: this->yl = yl; this->yh = yh; - dc_destorg = ::dc_destorg; - dc_pitch = ::dc_pitch; + _destorg = dc_destorg; + _pitch = dc_pitch; } void Execute(DrawerThread *thread) override @@ -85,9 +85,9 @@ public: if (count <= 0) return; - dest = thread->dest_for_thread(yl, dc_pitch, ylookup[yl] + sx + (uint32_t*)dc_destorg); + dest = thread->dest_for_thread(yl, _pitch, ylookup[yl] + sx + (uint32_t*)_destorg); source = &thread->dc_temp_rgba[yl * 4 + hx] + thread->skipped_by_thread(yl) * 4; - pitch = dc_pitch * thread->num_cores; + pitch = _pitch * thread->num_cores; sincr = thread->num_cores * 4; if (count & 1) { @@ -121,11 +121,11 @@ class RtMap1colRGBACommand : public DrawerCommand int sx; int yl; int yh; - fixed_t dc_light; - ShadeConstants dc_shade_constants; - BYTE *dc_destorg; - int dc_pitch; - BYTE *dc_colormap; + fixed_t _light; + ShadeConstants _shade_constants; + BYTE *_destorg; + int _pitch; + BYTE *_colormap; public: RtMap1colRGBACommand(int hx, int sx, int yl, int yh) @@ -135,11 +135,11 @@ public: this->yl = yl; this->yh = yh; - dc_light = ::dc_light; - dc_shade_constants = ::dc_shade_constants; - dc_destorg = ::dc_destorg; - dc_pitch = ::dc_pitch; - dc_colormap = ::dc_colormap; + _light = dc_light; + _shade_constants = dc_shade_constants; + _destorg = dc_destorg; + _pitch = dc_pitch; + _colormap = dc_colormap; } void Execute(DrawerThread *thread) override @@ -154,15 +154,15 @@ public: if (count <= 0) return; - uint32_t light = calc_light_multiplier(dc_light); - ShadeConstants shade_constants = dc_shade_constants; + uint32_t light = calc_light_multiplier(_light); + ShadeConstants shade_constants = _shade_constants; - dest = thread->dest_for_thread(yl, dc_pitch, ylookup[yl] + sx + (uint32_t*)dc_destorg); + dest = thread->dest_for_thread(yl, _pitch, ylookup[yl] + sx + (uint32_t*)_destorg); source = &thread->dc_temp_rgba[yl * 4 + hx] + thread->skipped_by_thread(yl) * 4; - pitch = dc_pitch * thread->num_cores; + pitch = _pitch * thread->num_cores; sincr = thread->num_cores * 4; - BYTE *colormap = dc_colormap; + BYTE *colormap = _colormap; if (count & 1) { *dest = shade_pal_index(colormap[*source], light, shade_constants); @@ -186,11 +186,11 @@ class RtMap4colsRGBACommand : public DrawerCommand int sx; int yl; int yh; - fixed_t dc_light; - ShadeConstants dc_shade_constants; - BYTE *dc_destorg; - int dc_pitch; - BYTE *colormap; + fixed_t _light; + ShadeConstants _shade_constants; + BYTE *_destorg; + int _pitch; + BYTE *_colormap; public: RtMap4colsRGBACommand(int sx, int yl, int yh) @@ -199,11 +199,11 @@ public: this->yl = yl; this->yh = yh; - dc_light = ::dc_light; - dc_shade_constants = ::dc_shade_constants; - dc_destorg = ::dc_destorg; - dc_pitch = ::dc_pitch; - dc_colormap = ::dc_colormap; + _light = dc_light; + _shade_constants = dc_shade_constants; + _destorg = dc_destorg; + _pitch = dc_pitch; + _colormap = dc_colormap; } #ifdef NO_SSE @@ -219,15 +219,15 @@ public: if (count <= 0) return; - uint32_t light = calc_light_multiplier(dc_light); - ShadeConstants shade_constants = dc_shade_constants; + uint32_t light = calc_light_multiplier(_light); + ShadeConstants shade_constants = _shade_constants; - dest = thread->dest_for_thread(yl, dc_pitch, ylookup[yl] + sx + (uint32_t*)dc_destorg); + dest = thread->dest_for_thread(yl, _pitch, ylookup[yl] + sx + (uint32_t*)_destorg); source = &thread->dc_temp_rgba[yl * 4] + thread->skipped_by_thread(yl) * 4; - pitch = dc_pitch * thread->num_cores; + pitch = _pitch * thread->num_cores; sincr = thread->num_cores * 4; - BYTE *colormap = dc_colormap; + BYTE *colormap = _colormap; if (count & 1) { dest[0] = shade_pal_index(colormap[source[0]], light, shade_constants); @@ -266,16 +266,16 @@ public: if (count <= 0) return; - ShadeConstants shade_constants = dc_shade_constants; - uint32_t light = calc_light_multiplier(dc_light); + ShadeConstants shade_constants = _shade_constants; + uint32_t light = calc_light_multiplier(_light); uint32_t *palette = (uint32_t*)GPalette.BaseColors; - dest = thread->dest_for_thread(yl, dc_pitch, ylookup[yl] + sx + (uint32_t*)dc_destorg); + dest = thread->dest_for_thread(yl, _pitch, ylookup[yl] + sx + (uint32_t*)_destorg); source = &thread->dc_temp_rgba[yl * 4] + thread->skipped_by_thread(yl) * 4; - pitch = dc_pitch * thread->num_cores; + pitch = _pitch * thread->num_cores; sincr = thread->num_cores * 4; - BYTE *colormap = dc_colormap; + BYTE *colormap = _colormap; if (shade_constants.simple_shade) { @@ -507,13 +507,13 @@ class RtAdd1colRGBACommand : public DrawerCommand int sx; int yl; int yh; - BYTE *dc_destorg; - int dc_pitch; - fixed_t dc_light; - ShadeConstants dc_shade_constants; - fixed_t dc_srcalpha; - fixed_t dc_destalpha; - BYTE *dc_colormap; + BYTE *_destorg; + int _pitch; + fixed_t _light; + ShadeConstants _shade_constants; + fixed_t _srcalpha; + fixed_t _destalpha; + BYTE *_colormap; public: RtAdd1colRGBACommand(int hx, int sx, int yl, int yh) @@ -523,13 +523,13 @@ public: this->yl = yl; this->yh = yh; - dc_destorg = ::dc_destorg; - dc_pitch = ::dc_pitch; - dc_light = ::dc_light; - dc_shade_constants = ::dc_shade_constants; - dc_srcalpha = ::dc_srcalpha; - dc_destalpha = ::dc_destalpha; - dc_colormap = ::dc_colormap; + _destorg = dc_destorg; + _pitch = dc_pitch; + _light = dc_light; + _shade_constants = dc_shade_constants; + _srcalpha = dc_srcalpha; + _destalpha = dc_destalpha; + _colormap = dc_colormap; } void Execute(DrawerThread *thread) override @@ -544,17 +544,17 @@ public: if (count <= 0) return; - dest = thread->dest_for_thread(yl, dc_pitch, ylookup[yl] + sx + (uint32_t*)dc_destorg); + dest = thread->dest_for_thread(yl, _pitch, ylookup[yl] + sx + (uint32_t*)_destorg); source = &thread->dc_temp_rgba[yl * 4 + hx] + thread->skipped_by_thread(yl) * 4; - pitch = dc_pitch * thread->num_cores; + pitch = _pitch * thread->num_cores; sincr = 4 * thread->num_cores; - uint32_t light = calc_light_multiplier(dc_light); - ShadeConstants shade_constants = dc_shade_constants; - BYTE *colormap = dc_colormap; + uint32_t light = calc_light_multiplier(_light); + ShadeConstants shade_constants = _shade_constants; + BYTE *colormap = _colormap; - uint32_t fg_alpha = dc_srcalpha >> (FRACBITS - 8); - uint32_t bg_alpha = dc_destalpha >> (FRACBITS - 8); + uint32_t fg_alpha = _srcalpha >> (FRACBITS - 8); + uint32_t bg_alpha = _destalpha >> (FRACBITS - 8); do { uint32_t fg = shade_pal_index(colormap[*source], light, shade_constants); @@ -583,13 +583,13 @@ class RtAdd4colsRGBACommand : public DrawerCommand int sx; int yl; int yh; - BYTE *dc_destorg; - int dc_pitch; - fixed_t dc_light; - ShadeConstants dc_shade_constants; - BYTE *dc_colormap; - fixed_t dc_srcalpha; - fixed_t dc_destalpha; + BYTE *_destorg; + int _pitch; + fixed_t _light; + ShadeConstants _shade_constants; + BYTE *_colormap; + fixed_t _srcalpha; + fixed_t _destalpha; public: RtAdd4colsRGBACommand(int sx, int yl, int yh) @@ -598,13 +598,13 @@ public: this->yl = yl; this->yh = yh; - dc_destorg = ::dc_destorg; - dc_pitch = ::dc_pitch; - dc_light = ::dc_light; - dc_shade_constants = ::dc_shade_constants; - dc_colormap = ::dc_colormap; - dc_srcalpha = ::dc_srcalpha; - dc_destalpha = ::dc_destalpha; + _destorg = dc_destorg; + _pitch = dc_pitch; + _light = dc_light; + _shade_constants = dc_shade_constants; + _colormap = dc_colormap; + _srcalpha = dc_srcalpha; + _destalpha = dc_destalpha; } #ifdef NO_SSE @@ -620,17 +620,17 @@ public: if (count <= 0) return; - dest = thread->dest_for_thread(yl, dc_pitch, ylookup[yl] + sx + (uint32_t*)dc_destorg); + dest = thread->dest_for_thread(yl, _pitch, ylookup[yl] + sx + (uint32_t*)_destorg); source = &thread->dc_temp_rgba[yl * 4] + thread->skipped_by_thread(yl) * 4; - pitch = dc_pitch * thread->num_cores; + pitch = _pitch * thread->num_cores; sincr = 4 * thread->num_cores; - uint32_t light = calc_light_multiplier(dc_light); - ShadeConstants shade_constants = dc_shade_constants; - BYTE *colormap = dc_colormap; + uint32_t light = calc_light_multiplier(_light); + ShadeConstants shade_constants = _shade_constants; + BYTE *colormap = _colormap; - uint32_t fg_alpha = dc_srcalpha >> (FRACBITS - 8); - uint32_t bg_alpha = dc_destalpha >> (FRACBITS - 8); + uint32_t fg_alpha = _srcalpha >> (FRACBITS - 8); + uint32_t bg_alpha = _destalpha >> (FRACBITS - 8); do { for (int i = 0; i < 4; i++) @@ -668,19 +668,19 @@ public: if (count <= 0) return; - dest = thread->dest_for_thread(yl, dc_pitch, ylookup[yl] + sx + (uint32_t*)dc_destorg); + dest = thread->dest_for_thread(yl, _pitch, ylookup[yl] + sx + (uint32_t*)_destorg); source = &thread->dc_temp_rgba[yl * 4] + thread->skipped_by_thread(yl) * 4; - pitch = dc_pitch * thread->num_cores; + pitch = _pitch * thread->num_cores; sincr = 4 * thread->num_cores; - uint32_t light = calc_light_multiplier(dc_light); + uint32_t light = calc_light_multiplier(_light); uint32_t *palette = (uint32_t*)GPalette.BaseColors; - BYTE *colormap = dc_colormap; + BYTE *colormap = _colormap; - uint32_t fg_alpha = dc_srcalpha >> (FRACBITS - 8); - uint32_t bg_alpha = dc_destalpha >> (FRACBITS - 8); + uint32_t fg_alpha = _srcalpha >> (FRACBITS - 8); + uint32_t bg_alpha = _destalpha >> (FRACBITS - 8); - ShadeConstants shade_constants = dc_shade_constants; + ShadeConstants shade_constants = _shade_constants; if (shade_constants.simple_shade) { @@ -764,11 +764,11 @@ class RtShaded1colRGBACommand : public DrawerCommand int sx; int yl; int yh; - lighttable_t *dc_colormap; - BYTE *dc_destorg; - int dc_pitch; - int dc_color; - fixed_t dc_light; + lighttable_t *_colormap; + BYTE *_destorg; + int _pitch; + int _color; + fixed_t _light; public: RtShaded1colRGBACommand(int hx, int sx, int yl, int yh) @@ -778,11 +778,11 @@ public: this->yl = yl; this->yh = yh; - dc_colormap = ::dc_colormap; - dc_destorg = ::dc_destorg; - dc_pitch = ::dc_pitch; - dc_color = ::dc_color; - dc_light = ::dc_light; + _colormap = dc_colormap; + _destorg = dc_destorg; + _pitch = dc_pitch; + _color = dc_color; + _light = dc_light; } void Execute(DrawerThread *thread) override @@ -798,13 +798,13 @@ public: if (count <= 0) return; - colormap = dc_colormap; - dest = thread->dest_for_thread(yl, dc_pitch, ylookup[yl] + sx + (uint32_t*)dc_destorg); + colormap = _colormap; + dest = thread->dest_for_thread(yl, _pitch, ylookup[yl] + sx + (uint32_t*)_destorg); source = &thread->dc_temp_rgba[yl * 4 + hx] + thread->skipped_by_thread(yl) * 4; - pitch = dc_pitch * thread->num_cores; + pitch = _pitch * thread->num_cores; sincr = 4 * thread->num_cores; - uint32_t fg = shade_pal_index_simple(dc_color, calc_light_multiplier(dc_light)); + uint32_t fg = shade_pal_index_simple(_color, calc_light_multiplier(_light)); uint32_t fg_red = (fg >> 16) & 0xff; uint32_t fg_green = (fg >> 8) & 0xff; uint32_t fg_blue = fg & 0xff; @@ -833,11 +833,11 @@ class RtShaded4colsRGBACommand : public DrawerCommand int sx; int yl; int yh; - lighttable_t *dc_colormap; - int dc_color; - BYTE *dc_destorg; - int dc_pitch; - fixed_t dc_light; + lighttable_t *_colormap; + int _color; + BYTE *_destorg; + int _pitch; + fixed_t _light; public: RtShaded4colsRGBACommand(int sx, int yl, int yh) @@ -846,11 +846,11 @@ public: this->yl = yl; this->yh = yh; - dc_colormap = ::dc_colormap; - dc_color = ::dc_color; - dc_destorg = ::dc_destorg; - dc_pitch = ::dc_pitch; - dc_light = ::dc_light; + _colormap = dc_colormap; + _color = dc_color; + _destorg = dc_destorg; + _pitch = dc_pitch; + _light = dc_light; } #ifdef NO_SSE @@ -867,13 +867,13 @@ public: if (count <= 0) return; - colormap = dc_colormap; - dest = thread->dest_for_thread(yl, dc_pitch, ylookup[yl] + sx + (uint32_t*)dc_destorg); + colormap = _colormap; + dest = thread->dest_for_thread(yl, _pitch, ylookup[yl] + sx + (uint32_t*)_destorg); source = &thread->dc_temp_rgba[yl * 4] + thread->skipped_by_thread(yl) * 4; - pitch = dc_pitch * thread->num_cores; + pitch = _pitch * thread->num_cores; sincr = 4 * thread->num_cores; - uint32_t fg = shade_pal_index_simple(dc_color, calc_light_multiplier(dc_light)); + uint32_t fg = shade_pal_index_simple(_color, calc_light_multiplier(_light)); uint32_t fg_red = (fg >> 16) & 0xff; uint32_t fg_green = (fg >> 8) & 0xff; uint32_t fg_blue = fg & 0xff; @@ -912,13 +912,13 @@ public: if (count <= 0) return; - colormap = dc_colormap; - dest = thread->dest_for_thread(yl, dc_pitch, ylookup[yl] + sx + (uint32_t*)dc_destorg); + colormap = _colormap; + dest = thread->dest_for_thread(yl, _pitch, ylookup[yl] + sx + (uint32_t*)_destorg); source = &thread->dc_temp_rgba[yl * 4] + thread->skipped_by_thread(yl) * 4; - pitch = dc_pitch * thread->num_cores; + pitch = _pitch * thread->num_cores; sincr = 4 * thread->num_cores; - __m128i fg = _mm_unpackhi_epi8(_mm_set1_epi32(shade_pal_index_simple(dc_color, calc_light_multiplier(dc_light))), _mm_setzero_si128()); + __m128i fg = _mm_unpackhi_epi8(_mm_set1_epi32(shade_pal_index_simple(_color, calc_light_multiplier(_light))), _mm_setzero_si128()); __m128i alpha_one = _mm_set1_epi16(64); do { @@ -957,12 +957,12 @@ class RtAddClamp1colRGBACommand : public DrawerCommand int sx; int yl; int yh; - BYTE *dc_destorg; - int dc_pitch; - fixed_t dc_light; - ShadeConstants dc_shade_constants; - fixed_t dc_srcalpha; - fixed_t dc_destalpha; + BYTE *_destorg; + int _pitch; + fixed_t _light; + ShadeConstants _shade_constants; + fixed_t _srcalpha; + fixed_t _destalpha; public: RtAddClamp1colRGBACommand(int hx, int sx, int yl, int yh) @@ -972,12 +972,12 @@ public: this->yl = yl; this->yh = yh; - dc_destorg = ::dc_destorg; - dc_pitch = ::dc_pitch; - dc_light = ::dc_light; - dc_shade_constants = ::dc_shade_constants; - dc_srcalpha = ::dc_srcalpha; - dc_destalpha = ::dc_destalpha; + _destorg = dc_destorg; + _pitch = dc_pitch; + _light = dc_light; + _shade_constants = dc_shade_constants; + _srcalpha = dc_srcalpha; + _destalpha = dc_destalpha; } void Execute(DrawerThread *thread) override @@ -992,16 +992,16 @@ public: if (count <= 0) return; - dest = thread->dest_for_thread(yl, dc_pitch, ylookup[yl] + sx + (uint32_t*)dc_destorg); + dest = thread->dest_for_thread(yl, _pitch, ylookup[yl] + sx + (uint32_t*)_destorg); source = &thread->dc_temp_rgba[yl * 4 + hx] + thread->skipped_by_thread(yl) * 4; - pitch = dc_pitch * thread->num_cores; + pitch = _pitch * thread->num_cores; sincr = 4 * thread->num_cores; - uint32_t light = calc_light_multiplier(dc_light); - ShadeConstants shade_constants = dc_shade_constants; + uint32_t light = calc_light_multiplier(_light); + ShadeConstants shade_constants = _shade_constants; - uint32_t fg_alpha = dc_srcalpha >> (FRACBITS - 8); - uint32_t bg_alpha = dc_destalpha >> (FRACBITS - 8); + uint32_t fg_alpha = _srcalpha >> (FRACBITS - 8); + uint32_t bg_alpha = _destalpha >> (FRACBITS - 8); do { uint32_t fg = shade_pal_index(*source, light, shade_constants); @@ -1029,12 +1029,12 @@ class RtAddClamp4colsRGBACommand : public DrawerCommand int sx; int yl; int yh; - BYTE *dc_destorg; - int dc_pitch; - fixed_t dc_light; - fixed_t dc_srcalpha; - fixed_t dc_destalpha; - ShadeConstants dc_shade_constants; + BYTE *_destorg; + int _pitch; + fixed_t _light; + fixed_t _srcalpha; + fixed_t _destalpha; + ShadeConstants _shade_constants; public: RtAddClamp4colsRGBACommand(int sx, int yl, int yh) @@ -1043,12 +1043,12 @@ public: this->yl = yl; this->yh = yh; - dc_destorg = ::dc_destorg; - dc_pitch = ::dc_pitch; - dc_light = ::dc_light; - dc_srcalpha = ::dc_srcalpha; - dc_destalpha = ::dc_destalpha; - dc_shade_constants = ::dc_shade_constants; + _destorg = dc_destorg; + _pitch = dc_pitch; + _light = dc_light; + _srcalpha = dc_srcalpha; + _destalpha = dc_destalpha; + _shade_constants = dc_shade_constants; } #ifdef NO_SSE @@ -1064,16 +1064,16 @@ public: if (count <= 0) return; - dest = thread->dest_for_thread(yl, dc_pitch, ylookup[yl] + sx + (uint32_t*)dc_destorg); + dest = thread->dest_for_thread(yl, _pitch, ylookup[yl] + sx + (uint32_t*)_destorg); source = &thread->dc_temp_rgba[yl * 4] + thread->skipped_by_thread(yl) * 4; - pitch = dc_pitch * thread->num_cores; + pitch = _pitch * thread->num_cores; sincr = 4 * thread->num_cores; - uint32_t light = calc_light_multiplier(dc_light); - ShadeConstants shade_constants = dc_shade_constants; + uint32_t light = calc_light_multiplier(_light); + ShadeConstants shade_constants = _shade_constants; - uint32_t fg_alpha = dc_srcalpha >> (FRACBITS - 8); - uint32_t bg_alpha = dc_destalpha >> (FRACBITS - 8); + uint32_t fg_alpha = _srcalpha >> (FRACBITS - 8); + uint32_t bg_alpha = _destalpha >> (FRACBITS - 8); do { for (int i = 0; i < 4; i++) @@ -1110,18 +1110,18 @@ public: if (count <= 0) return; - dest = thread->dest_for_thread(yl, dc_pitch, ylookup[yl] + sx + (uint32_t*)dc_destorg); + dest = thread->dest_for_thread(yl, _pitch, ylookup[yl] + sx + (uint32_t*)_destorg); source = &thread->dc_temp_rgba[yl * 4] + thread->skipped_by_thread(yl) * 4; - pitch = dc_pitch * thread->num_cores; + pitch = _pitch * thread->num_cores; sincr = 4 * thread->num_cores; - uint32_t light = calc_light_multiplier(dc_light); + uint32_t light = calc_light_multiplier(_light); uint32_t *palette = (uint32_t*)GPalette.BaseColors; - uint32_t fg_alpha = dc_srcalpha >> (FRACBITS - 8); - uint32_t bg_alpha = dc_destalpha >> (FRACBITS - 8); + uint32_t fg_alpha = _srcalpha >> (FRACBITS - 8); + uint32_t bg_alpha = _destalpha >> (FRACBITS - 8); - ShadeConstants shade_constants = dc_shade_constants; + ShadeConstants shade_constants = _shade_constants; if (shade_constants.simple_shade) { @@ -1205,12 +1205,12 @@ class RtSubClamp1colRGBACommand : public DrawerCommand int sx; int yl; int yh; - BYTE *dc_destorg; - int dc_pitch; - fixed_t dc_light; - fixed_t dc_srcalpha; - fixed_t dc_destalpha; - ShadeConstants dc_shade_constants; + BYTE *_destorg; + int _pitch; + fixed_t _light; + fixed_t _srcalpha; + fixed_t _destalpha; + ShadeConstants _shade_constants; public: RtSubClamp1colRGBACommand(int hx, int sx, int yl, int yh) @@ -1220,12 +1220,12 @@ public: this->yl = yl; this->yh = yh; - dc_destorg = ::dc_destorg; - dc_pitch = ::dc_pitch; - dc_light = ::dc_light; - dc_srcalpha = ::dc_srcalpha; - dc_destalpha = ::dc_destalpha; - dc_shade_constants = ::dc_shade_constants; + _destorg = dc_destorg; + _pitch = dc_pitch; + _light = dc_light; + _srcalpha = dc_srcalpha; + _destalpha = dc_destalpha; + _shade_constants = dc_shade_constants; } void Execute(DrawerThread *thread) override @@ -1240,16 +1240,16 @@ public: if (count <= 0) return; - dest = thread->dest_for_thread(yl, dc_pitch, ylookup[yl] + sx + (uint32_t*)dc_destorg); + dest = thread->dest_for_thread(yl, _pitch, ylookup[yl] + sx + (uint32_t*)_destorg); source = &thread->dc_temp_rgba[yl * 4 + hx] + thread->skipped_by_thread(yl) * 4; - pitch = dc_pitch * thread->num_cores; + pitch = _pitch * thread->num_cores; sincr = 4 * thread->num_cores; - uint32_t light = calc_light_multiplier(dc_light); - ShadeConstants shade_constants = dc_shade_constants; + uint32_t light = calc_light_multiplier(_light); + ShadeConstants shade_constants = _shade_constants; - uint32_t fg_alpha = dc_srcalpha >> (FRACBITS - 8); - uint32_t bg_alpha = dc_destalpha >> (FRACBITS - 8); + uint32_t fg_alpha = _srcalpha >> (FRACBITS - 8); + uint32_t bg_alpha = _destalpha >> (FRACBITS - 8); do { uint32_t fg = shade_pal_index(*source, light, shade_constants); @@ -1277,12 +1277,12 @@ class RtSubClamp4colsRGBACommand : public DrawerCommand int sx; int yl; int yh; - BYTE *dc_destorg; - int dc_pitch; - fixed_t dc_light; - fixed_t dc_srcalpha; - fixed_t dc_destalpha; - ShadeConstants dc_shade_constants; + BYTE *_destorg; + int _pitch; + fixed_t _light; + fixed_t _srcalpha; + fixed_t _destalpha; + ShadeConstants _shade_constants; public: RtSubClamp4colsRGBACommand(int sx, int yl, int yh) @@ -1291,12 +1291,12 @@ public: this->yl = yl; this->yh = yh; - dc_destorg = ::dc_destorg; - dc_pitch = ::dc_pitch; - dc_light = ::dc_light; - dc_srcalpha = ::dc_srcalpha; - dc_destalpha = ::dc_destalpha; - dc_shade_constants = ::dc_shade_constants; + _destorg = dc_destorg; + _pitch = dc_pitch; + _light = dc_light; + _srcalpha = dc_srcalpha; + _destalpha = dc_destalpha; + _shade_constants = dc_shade_constants; } void Execute(DrawerThread *thread) override @@ -1311,16 +1311,16 @@ public: if (count <= 0) return; - dest = thread->dest_for_thread(yl, dc_pitch, ylookup[yl] + sx + (uint32_t*)dc_destorg); + dest = thread->dest_for_thread(yl, _pitch, ylookup[yl] + sx + (uint32_t*)_destorg); source = &thread->dc_temp_rgba[yl * 4] + thread->skipped_by_thread(yl) * 4; - pitch = dc_pitch * thread->num_cores; + pitch = _pitch * thread->num_cores; sincr = 4 * thread->num_cores; - uint32_t light = calc_light_multiplier(dc_light); - ShadeConstants shade_constants = dc_shade_constants; + uint32_t light = calc_light_multiplier(_light); + ShadeConstants shade_constants = _shade_constants; - uint32_t fg_alpha = dc_srcalpha >> (FRACBITS - 8); - uint32_t bg_alpha = dc_destalpha >> (FRACBITS - 8); + uint32_t fg_alpha = _srcalpha >> (FRACBITS - 8); + uint32_t bg_alpha = _destalpha >> (FRACBITS - 8); do { for (int i = 0; i < 4; i++) @@ -1353,12 +1353,12 @@ class RtRevSubClamp1colRGBACommand : public DrawerCommand int sx; int yl; int yh; - BYTE *dc_destorg; - int dc_pitch; - fixed_t dc_light; - fixed_t dc_srcalpha; - fixed_t dc_destalpha; - ShadeConstants dc_shade_constants; + BYTE *_destorg; + int _pitch; + fixed_t _light; + fixed_t _srcalpha; + fixed_t _destalpha; + ShadeConstants _shade_constants; public: RtRevSubClamp1colRGBACommand(int hx, int sx, int yl, int yh) @@ -1368,12 +1368,12 @@ public: this->yl = yl; this->yh = yh; - dc_destorg = ::dc_destorg; - dc_pitch = ::dc_pitch; - dc_light = ::dc_light; - dc_srcalpha = ::dc_srcalpha; - dc_destalpha = ::dc_destalpha; - dc_shade_constants = ::dc_shade_constants; + _destorg = dc_destorg; + _pitch = dc_pitch; + _light = dc_light; + _srcalpha = dc_srcalpha; + _destalpha = dc_destalpha; + _shade_constants = dc_shade_constants; } void Execute(DrawerThread *thread) override @@ -1388,16 +1388,16 @@ public: if (count <= 0) return; - dest = thread->dest_for_thread(yl, dc_pitch, ylookup[yl] + sx + (uint32_t*)dc_destorg); + dest = thread->dest_for_thread(yl, _pitch, ylookup[yl] + sx + (uint32_t*)_destorg); source = &thread->dc_temp_rgba[yl * 4 + hx] + thread->skipped_by_thread(yl) * 4; - pitch = dc_pitch * thread->num_cores; + pitch = _pitch * thread->num_cores; sincr = 4 * thread->num_cores; - uint32_t light = calc_light_multiplier(dc_light); - ShadeConstants shade_constants = dc_shade_constants; + uint32_t light = calc_light_multiplier(_light); + ShadeConstants shade_constants = _shade_constants; - uint32_t fg_alpha = dc_srcalpha >> (FRACBITS - 8); - uint32_t bg_alpha = dc_destalpha >> (FRACBITS - 8); + uint32_t fg_alpha = _srcalpha >> (FRACBITS - 8); + uint32_t bg_alpha = _destalpha >> (FRACBITS - 8); do { uint32_t fg = shade_pal_index(*source, light, shade_constants); @@ -1425,12 +1425,12 @@ class RtRevSubClamp4colsRGBACommand : public DrawerCommand int sx; int yl; int yh; - BYTE *dc_destorg; - int dc_pitch; - fixed_t dc_light; - fixed_t dc_srcalpha; - fixed_t dc_destalpha; - ShadeConstants dc_shade_constants; + BYTE *_destorg; + int _pitch; + fixed_t _light; + fixed_t _srcalpha; + fixed_t _destalpha; + ShadeConstants _shade_constants; public: RtRevSubClamp4colsRGBACommand(int sx, int yl, int yh) @@ -1439,12 +1439,12 @@ public: this->yl = yl; this->yh = yh; - dc_destorg = ::dc_destorg; - dc_pitch = ::dc_pitch; - dc_light = ::dc_light; - dc_srcalpha = ::dc_srcalpha; - dc_destalpha = ::dc_destalpha; - dc_shade_constants = ::dc_shade_constants; + _destorg = dc_destorg; + _pitch = dc_pitch; + _light = dc_light; + _srcalpha = dc_srcalpha; + _destalpha = dc_destalpha; + _shade_constants = dc_shade_constants; } void Execute(DrawerThread *thread) override @@ -1459,16 +1459,16 @@ public: if (count <= 0) return; - dest = thread->dest_for_thread(yl, dc_pitch, ylookup[yl] + sx + (uint32_t*)dc_destorg); + dest = thread->dest_for_thread(yl, _pitch, ylookup[yl] + sx + (uint32_t*)_destorg); source = &thread->dc_temp_rgba[yl * 4] + thread->skipped_by_thread(yl) * 4; - pitch = dc_pitch * thread->num_cores; + pitch = _pitch * thread->num_cores; sincr = 4 * thread->num_cores; - uint32_t light = calc_light_multiplier(dc_light); - ShadeConstants shade_constants = dc_shade_constants; + uint32_t light = calc_light_multiplier(_light); + ShadeConstants shade_constants = _shade_constants; - uint32_t fg_alpha = dc_srcalpha >> (FRACBITS - 8); - uint32_t bg_alpha = dc_destalpha >> (FRACBITS - 8); + uint32_t fg_alpha = _srcalpha >> (FRACBITS - 8); + uint32_t bg_alpha = _destalpha >> (FRACBITS - 8); do { for (int i = 0; i < 4; i++) @@ -1513,29 +1513,29 @@ public: class DrawColumnHorizRGBACommand : public DrawerCommand { - int dc_count; - fixed_t dc_iscale; - fixed_t dc_texturefrac; - const BYTE *dc_source; - int dc_x; - int dc_yl; - int dc_yh; + int _count; + fixed_t _iscale; + fixed_t _texturefrac; + const BYTE *_source; + int _x; + int _yl; + int _yh; public: DrawColumnHorizRGBACommand() { - dc_count = ::dc_count; - dc_iscale = ::dc_iscale; - dc_texturefrac = ::dc_texturefrac; - dc_source = ::dc_source; - dc_x = ::dc_x; - dc_yl = ::dc_yl; - dc_yh = ::dc_yh; + _count = dc_count; + _iscale = dc_iscale; + _texturefrac = dc_texturefrac; + _source = dc_source; + _x = dc_x; + _yl = dc_yl; + _yh = dc_yh; } void Execute(DrawerThread *thread) override { - int count = dc_count; + int count = _count; uint32_t *dest; fixed_t fracstep; fixed_t frac; @@ -1544,13 +1544,13 @@ public: return; { - int x = dc_x & 3; - dest = &thread->dc_temp_rgba[x + 4 * dc_yl]; + int x = _x & 3; + dest = &thread->dc_temp_rgba[x + 4 * _yl]; } - fracstep = dc_iscale; - frac = dc_texturefrac; + fracstep = _iscale; + frac = _texturefrac; - const BYTE *source = dc_source; + const BYTE *source = _source; if (count & 1) { *dest = source[frac >> FRACBITS]; dest += 4; frac += fracstep; @@ -1587,34 +1587,34 @@ public: class FillColumnHorizRGBACommand : public DrawerCommand { - int dc_x; - int dc_yl; - int dc_yh; - int dc_count; - int dc_color; + int _x; + int _yl; + int _yh; + int _count; + int _color; public: FillColumnHorizRGBACommand() { - dc_x = ::dc_x; - dc_count = ::dc_count; - dc_color = ::dc_color; - dc_yl = ::dc_yl; - dc_yh = ::dc_yh; + _x = dc_x; + _count = dc_count; + _color = dc_color; + _yl = dc_yl; + _yh = dc_yh; } void Execute(DrawerThread *thread) override { - int count = dc_count; - int color = dc_color; + int count = _count; + int color = _color; uint32_t *dest; if (count <= 0) return; { - int x = dc_x & 3; - dest = &thread->dc_temp_rgba[x + 4 * dc_yl]; + int x = _x & 3; + dest = &thread->dc_temp_rgba[x + 4 * _yl]; } if (count & 1) {