Added r_multithreaded CVAR and fixed some broken colors

This commit is contained in:
Magnus Norddahl 2016-06-17 07:38:05 +02:00
parent 312776621e
commit 70dbde4f78
3 changed files with 1314 additions and 1291 deletions

File diff suppressed because it is too large Load diff

View file

@ -178,17 +178,19 @@ public:
class DrawerCommand
{
protected:
int dc_dest_y;
int _dest_y;
public:
DrawerCommand()
{
dc_dest_y = static_cast<int>((dc_dest - dc_destorg) / (dc_pitch * 4));
_dest_y = static_cast<int>((dc_dest - dc_destorg) / (dc_pitch * 4));
}
virtual void Execute(DrawerThread *thread) = 0;
};
EXTERN_CVAR(Bool, r_multithreaded)
// Manages queueing up commands and executing them on worker threads
class DrawerCommandQueue
{
@ -232,7 +234,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<Types>(args)...);
command.Execute(&queue->single_core_thread);

View file

@ -61,8 +61,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)
@ -72,8 +72,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
@ -87,9 +87,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) {
@ -123,11 +123,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)
@ -137,11 +137,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
@ -156,15 +156,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);
@ -188,11 +188,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)
@ -201,11 +201,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
@ -221,15 +221,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);
@ -268,16 +268,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)
{
@ -509,13 +509,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)
@ -525,13 +525,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
@ -546,17 +546,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);
@ -585,13 +585,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)
@ -600,13 +600,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
@ -622,17 +622,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++)
@ -670,19 +670,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)
{
@ -766,11 +766,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)
@ -780,11 +780,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
@ -800,13 +800,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;
@ -835,11 +835,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)
@ -848,11 +848,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
@ -869,13 +869,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;
@ -914,13 +914,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 {
@ -959,12 +959,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)
@ -974,12 +974,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
@ -994,16 +994,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);
@ -1031,12 +1031,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)
@ -1045,12 +1045,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
@ -1066,16 +1066,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++)
@ -1112,18 +1112,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)
{
@ -1207,12 +1207,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)
@ -1222,12 +1222,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
@ -1242,16 +1242,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);
@ -1279,12 +1279,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)
@ -1293,12 +1293,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
@ -1313,16 +1313,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++)
@ -1355,12 +1355,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)
@ -1370,12 +1370,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
@ -1390,16 +1390,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);
@ -1427,12 +1427,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)
@ -1441,12 +1441,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
@ -1461,16 +1461,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++)
@ -1515,29 +1515,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;
@ -1546,13 +1546,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;
@ -1589,34 +1589,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) {