- More rgb555 reimplements.

This commit is contained in:
Rachael Alexanderson 2016-12-24 04:35:05 -05:00
parent 9d2128a4f4
commit 88b6038999
1 changed files with 78 additions and 23 deletions

View File

@ -527,6 +527,9 @@ namespace swrenderer
int bits = _fracbits; int bits = _fracbits;
int pitch = _pitch; int pitch = _pitch;
uint32_t *fg2rgb = _srcblend;
uint32_t *bg2rgb = _destblend;
count = thread->count_for_thread(_dest_y, count); count = thread->count_for_thread(_dest_y, count);
if (count <= 0) if (count <= 0)
return; return;
@ -536,6 +539,28 @@ namespace swrenderer
fracstep *= thread->num_cores; fracstep *= thread->num_cores;
pitch *= thread->num_cores; pitch *= thread->num_cores;
if (!r_blendmode)
{
do
{
uint8_t pix = source[frac >> bits];
if (pix != 0)
{
uint32_t a = (fg2rgb[colormap[pix]] | 0x40100400) - bg2rgb[*dest];
uint32_t b = a;
b &= 0x40100400;
b = b - (b >> 5);
a &= b;
a |= 0x01f07c1f;
*dest = RGB32k.All[a & (a >> 15)];
}
frac += fracstep;
dest += pitch;
} while (--count);
}
else
{
do do
{ {
uint8_t pix = source[frac >> bits]; uint8_t pix = source[frac >> bits];
@ -550,6 +575,7 @@ namespace swrenderer
dest += pitch; dest += pitch;
} while (--count); } while (--count);
} }
}
void DrawWallSubClamp4PalCommand::Execute(DrawerThread *thread) void DrawWallSubClamp4PalCommand::Execute(DrawerThread *thread)
{ {
@ -557,6 +583,9 @@ namespace swrenderer
int count = _count; int count = _count;
int bits = _fracbits; int bits = _fracbits;
uint32_t *fg2rgb = _srcblend;
uint32_t *bg2rgb = _destblend;
uint32_t dc_wall_texturefrac[4] = { _texturefrac[0], _texturefrac[1], _texturefrac[2], _texturefrac[3] }; uint32_t dc_wall_texturefrac[4] = { _texturefrac[0], _texturefrac[1], _texturefrac[2], _texturefrac[3] };
uint32_t dc_wall_iscale[4] = { _iscale[0], _iscale[1], _iscale[2], _iscale[3] }; uint32_t dc_wall_iscale[4] = { _iscale[0], _iscale[1], _iscale[2], _iscale[3] };
@ -574,6 +603,31 @@ namespace swrenderer
} }
pitch *= thread->num_cores; pitch *= thread->num_cores;
if (!r_blendmode)
{
do
{
for (int i = 0; i < 4; ++i)
{
uint8_t pix = _source[i][dc_wall_texturefrac[i] >> bits];
if (pix != 0)
{
uint32_t a = (fg2rgb[_colormap[i][pix]] | 0x40100400) - bg2rgb[dest[i]];
uint32_t b = a;
b &= 0x40100400;
b = b - (b >> 5);
a &= b;
a |= 0x01f07c1f;
dest[i] = RGB32k.All[a & (a >> 15)];
}
dc_wall_texturefrac[i] += dc_wall_iscale[i];
}
dest += pitch;
} while (--count);
}
else
{
do do
{ {
for (int i = 0; i < 4; ++i) for (int i = 0; i < 4; ++i)
@ -591,6 +645,7 @@ namespace swrenderer
dest += pitch; dest += pitch;
} while (--count); } while (--count);
} }
}
void DrawWallRevSubClamp1PalCommand::Execute(DrawerThread *thread) void DrawWallRevSubClamp1PalCommand::Execute(DrawerThread *thread)
{ {