Merge remote-tracking branch 'upstream/master' into zdoom-rgb666-take2

# Conflicts:
#	src/r_draw_pal.cpp
This commit is contained in:
Magnus Norddahl 2016-12-23 21:27:50 +01:00
commit 8cc4c8a192
14 changed files with 261 additions and 374 deletions

View file

@ -96,17 +96,15 @@ namespace swrenderer
uint8_t *dc_destorg;
int dc_destheight;
int dc_count;
uint32_t vplce[4];
uint32_t vince[4];
uint8_t *palookupoffse[4];
fixed_t palookuplight[4];
const uint8_t *bufplce[4];
const uint8_t *bufplce2[4];
uint32_t buftexturefracx[4];
uint32_t bufheight[4];
int vlinebits;
int mvlinebits;
int tmvlinebits;
uint32_t dc_wall_texturefrac[4];
uint32_t dc_wall_iscale[4];
uint8_t *dc_wall_colormap[4];
fixed_t dc_wall_light[4];
const uint8_t *dc_wall_source[4];
const uint8_t *dc_wall_source2[4];
uint32_t dc_wall_texturefracx[4];
uint32_t dc_wall_sourceheight[4];
int dc_wall_fracbits;
int ds_y;
int ds_x1;
int ds_x2;
@ -491,50 +489,35 @@ namespace swrenderer
return tex->GetColumn(col, nullptr);
}
bool R_GetTransMaskDrawers(fixed_t(**tmvline1)(), void(**tmvline4)())
bool R_GetTransMaskDrawers(void(**drawCol1)(), void(**drawCol4)())
{
if (colfunc == R_DrawAddColumn)
{
*tmvline1 = tmvline1_add;
*tmvline4 = tmvline4_add;
*drawCol1 = R_DrawWallAddCol1;
*drawCol4 = R_DrawWallAddCol4;
return true;
}
if (colfunc == R_DrawAddClampColumn)
{
*tmvline1 = tmvline1_addclamp;
*tmvline4 = tmvline4_addclamp;
*drawCol1 = R_DrawWallAddClampCol1;
*drawCol4 = R_DrawWallAddClampCol4;
return true;
}
if (colfunc == R_DrawSubClampColumn)
{
*tmvline1 = tmvline1_subclamp;
*tmvline4 = tmvline4_subclamp;
*drawCol1 = R_DrawWallSubClampCol1;
*drawCol4 = R_DrawWallSubClampCol4;
return true;
}
if (colfunc == R_DrawRevSubClampColumn)
{
*tmvline1 = tmvline1_revsubclamp;
*tmvline4 = tmvline4_revsubclamp;
*drawCol1 = R_DrawWallRevSubClampCol1;
*drawCol4 = R_DrawWallRevSubClampCol4;
return true;
}
return false;
}
void setupvline(int fracbits)
{
drawerargs::vlinebits = fracbits;
}
void setupmvline(int fracbits)
{
drawerargs::mvlinebits = fracbits;
}
void setuptmvline(int fracbits)
{
drawerargs::tmvlinebits = fracbits;
}
void R_SetColorMapLight(lighttable_t *base_colormap, float light, int shade)
{
using namespace drawerargs;
@ -967,118 +950,64 @@ namespace swrenderer
rt_revsubclamp4cols(sx, yl, yh);
}
uint32_t vlinec1()
void R_DrawWallCol1()
{
using namespace drawerargs;
DrawerCommandQueue::QueueCommand<DrawWall1PalCommand>();
return dc_texturefrac + dc_count * dc_iscale;
}
void vlinec4()
void R_DrawWallCol4()
{
using namespace drawerargs;
DrawerCommandQueue::QueueCommand<DrawWall4PalCommand>();
for (int i = 0; i < 4; i++)
vplce[i] += vince[i] * dc_count;
}
uint32_t mvlinec1()
void R_DrawWallMaskedCol1()
{
using namespace drawerargs;
DrawerCommandQueue::QueueCommand<DrawWallMasked1PalCommand>();
return dc_texturefrac + dc_count * dc_iscale;
}
void mvlinec4()
void R_DrawWallMaskedCol4()
{
using namespace drawerargs;
DrawerCommandQueue::QueueCommand<DrawWallMasked4PalCommand>();
for (int i = 0; i < 4; i++)
vplce[i] += vince[i] * dc_count;
}
fixed_t tmvline1_add()
void R_DrawWallAddCol1()
{
using namespace drawerargs;
DrawerCommandQueue::QueueCommand<DrawWallAdd1PalCommand>();
return dc_texturefrac + dc_count * dc_iscale;
}
void tmvline4_add()
void R_DrawWallAddCol4()
{
using namespace drawerargs;
DrawerCommandQueue::QueueCommand<DrawWallAdd4PalCommand>();
for (int i = 0; i < 4; i++)
vplce[i] += vince[i] * dc_count;
}
fixed_t tmvline1_addclamp()
void R_DrawWallAddClampCol1()
{
using namespace drawerargs;
DrawerCommandQueue::QueueCommand<DrawWallAddClamp1PalCommand>();
return dc_texturefrac + dc_count * dc_iscale;
}
void tmvline4_addclamp()
void R_DrawWallAddClampCol4()
{
using namespace drawerargs;
DrawerCommandQueue::QueueCommand<DrawWallAddClamp4PalCommand>();
for (int i = 0; i < 4; i++)
vplce[i] += vince[i] * dc_count;
}
fixed_t tmvline1_subclamp()
void R_DrawWallSubClampCol1()
{
using namespace drawerargs;
DrawerCommandQueue::QueueCommand<DrawWallSubClamp1PalCommand>();
return dc_texturefrac + dc_count * dc_iscale;
}
void tmvline4_subclamp()
void R_DrawWallSubClampCol4()
{
using namespace drawerargs;
DrawerCommandQueue::QueueCommand<DrawWallSubClamp4PalCommand>();
for (int i = 0; i < 4; i++)
vplce[i] += vince[i] * dc_count;
}
fixed_t tmvline1_revsubclamp()
void R_DrawWallRevSubClampCol1()
{
using namespace drawerargs;
DrawerCommandQueue::QueueCommand<DrawWallRevSubClamp1PalCommand>();
return dc_texturefrac + dc_count * dc_iscale;
}
void tmvline4_revsubclamp()
void R_DrawWallRevSubClampCol4()
{
using namespace drawerargs;
DrawerCommandQueue::QueueCommand<DrawWallRevSubClamp4PalCommand>();
for (int i = 0; i < 4; i++)
vplce[i] += vince[i] * dc_count;
}
void R_DrawSingleSkyCol1(uint32_t solid_top, uint32_t solid_bottom)