Create SWPixelFormatDrawers for pal and bgra drawers

This commit is contained in:
Magnus Norddahl 2016-12-27 08:47:51 +01:00
parent d5032663ad
commit 272b302294
4 changed files with 199 additions and 324 deletions

View file

@ -135,8 +135,25 @@ namespace swrenderer
unsigned int *horizspan[4]; unsigned int *horizspan[4];
} }
namespace
{
SWPixelFormatDrawers *active_drawers;
SWPalDrawers pal_drawers;
SWTruecolorDrawers tc_drawers;
}
SWPixelFormatDrawers *R_ActiveDrawers()
{
return active_drawers;
}
void R_InitColumnDrawers() void R_InitColumnDrawers()
{ {
if (r_swtruecolor)
active_drawers = &tc_drawers;
else
active_drawers = &pal_drawers;
colfunc = basecolfunc = R_DrawColumn; colfunc = basecolfunc = R_DrawColumn;
fuzzcolfunc = R_DrawFuzzColumn; fuzzcolfunc = R_DrawFuzzColumn;
transcolfunc = R_DrawTranslatedColumn; transcolfunc = R_DrawTranslatedColumn;
@ -620,122 +637,6 @@ namespace swrenderer
R_SetDSColorMapLight(colormap, 0, shade); R_SetDSColorMapLight(colormap, 0, shade);
} }
/////////////////////////////////////////////////////////////////////////
void R_DrawWallColumn()
{
if (r_swtruecolor)
DrawerCommandQueue::QueueCommand<DrawWall1LLVMCommand>();
else
DrawerCommandQueue::QueueCommand<DrawWall1PalCommand>();
}
void R_DrawWallMaskedColumn()
{
if (r_swtruecolor)
DrawerCommandQueue::QueueCommand<DrawWallMasked1LLVMCommand>();
else
DrawerCommandQueue::QueueCommand<DrawWallMasked1PalCommand>();
}
void R_DrawWallAddColumn()
{
if (r_swtruecolor)
DrawerCommandQueue::QueueCommand<DrawWallAdd1LLVMCommand>();
else if (drawerargs::dc_num_lights == 0)
DrawerCommandQueue::QueueCommand<DrawWallAdd1PalCommand>();
else
DrawerCommandQueue::QueueCommand<DrawWallAddClamp1PalCommand>();
}
void R_DrawWallAddClampColumn()
{
if (r_swtruecolor)
DrawerCommandQueue::QueueCommand<DrawWallAddClamp1LLVMCommand>();
else
DrawerCommandQueue::QueueCommand<DrawWallAddClamp1PalCommand>();
}
void R_DrawWallSubClampColumn()
{
if (r_swtruecolor)
DrawerCommandQueue::QueueCommand<DrawWallSubClamp1LLVMCommand>();
else
DrawerCommandQueue::QueueCommand<DrawWallSubClamp1PalCommand>();
}
void R_DrawWallRevSubClampColumn()
{
if (r_swtruecolor)
DrawerCommandQueue::QueueCommand<DrawWallRevSubClamp1LLVMCommand>();
else
DrawerCommandQueue::QueueCommand<DrawWallRevSubClamp1PalCommand>();
}
void R_DrawSingleSkyColumn(uint32_t solid_top, uint32_t solid_bottom)
{
if (r_swtruecolor)
DrawerCommandQueue::QueueCommand<DrawSingleSky1LLVMCommand>(solid_top, solid_bottom);
else
DrawerCommandQueue::QueueCommand<DrawSingleSky1PalCommand>(solid_top, solid_bottom);
}
void R_DrawDoubleSkyColumn(uint32_t solid_top, uint32_t solid_bottom)
{
if (r_swtruecolor)
DrawerCommandQueue::QueueCommand<DrawDoubleSky1LLVMCommand>(solid_top, solid_bottom);
else
DrawerCommandQueue::QueueCommand<DrawDoubleSky1PalCommand>(solid_top, solid_bottom);
}
void R_DrawColumn()
{
if (r_swtruecolor)
DrawerCommandQueue::QueueCommand<DrawColumnLLVMCommand>();
else
DrawerCommandQueue::QueueCommand<DrawColumnPalCommand>();
}
void R_FillColumn()
{
if (r_swtruecolor)
DrawerCommandQueue::QueueCommand<FillColumnLLVMCommand>();
else
DrawerCommandQueue::QueueCommand<FillColumnPalCommand>();
}
void R_FillAddColumn()
{
if (r_swtruecolor)
DrawerCommandQueue::QueueCommand<FillColumnAddLLVMCommand>();
else
DrawerCommandQueue::QueueCommand<FillColumnAddPalCommand>();
}
void R_FillAddClampColumn()
{
if (r_swtruecolor)
DrawerCommandQueue::QueueCommand<FillColumnAddClampLLVMCommand>();
else
DrawerCommandQueue::QueueCommand<FillColumnAddClampPalCommand>();
}
void R_FillSubClampColumn()
{
if (r_swtruecolor)
DrawerCommandQueue::QueueCommand<FillColumnSubClampLLVMCommand>();
else
DrawerCommandQueue::QueueCommand<FillColumnSubClampPalCommand>();
}
void R_FillRevSubClampColumn()
{
if (r_swtruecolor)
DrawerCommandQueue::QueueCommand<FillColumnRevSubClampLLVMCommand>();
else
DrawerCommandQueue::QueueCommand<FillColumnRevSubClampPalCommand>();
}
void R_UpdateFuzzPos() void R_UpdateFuzzPos()
{ {
using namespace drawerargs; using namespace drawerargs;
@ -745,174 +646,4 @@ namespace swrenderer
if (dc_yl <= dc_yh) if (dc_yl <= dc_yh)
fuzzpos = (fuzzpos + dc_yh - dc_yl + 1) % FUZZTABLE; fuzzpos = (fuzzpos + dc_yh - dc_yl + 1) % FUZZTABLE;
} }
void R_DrawFuzzColumn()
{
if (r_swtruecolor)
DrawerCommandQueue::QueueCommand<DrawFuzzColumnRGBACommand>();
else
DrawerCommandQueue::QueueCommand<DrawFuzzColumnPalCommand>();
R_UpdateFuzzPos();
}
void R_DrawAddColumn()
{
if (r_swtruecolor)
DrawerCommandQueue::QueueCommand<DrawColumnAddLLVMCommand>();
else
DrawerCommandQueue::QueueCommand<DrawColumnAddPalCommand>();
}
void R_DrawTranslatedColumn()
{
if (r_swtruecolor)
DrawerCommandQueue::QueueCommand<DrawColumnTranslatedLLVMCommand>();
else
DrawerCommandQueue::QueueCommand<DrawColumnTranslatedPalCommand>();
}
void R_DrawTlatedAddColumn()
{
if (r_swtruecolor)
DrawerCommandQueue::QueueCommand<DrawColumnTlatedAddLLVMCommand>();
else
DrawerCommandQueue::QueueCommand<DrawColumnTlatedAddPalCommand>();
}
void R_DrawShadedColumn()
{
if (r_swtruecolor)
DrawerCommandQueue::QueueCommand<DrawColumnShadedLLVMCommand>();
else
DrawerCommandQueue::QueueCommand<DrawColumnShadedPalCommand>();
}
void R_DrawAddClampColumn()
{
if (r_swtruecolor)
DrawerCommandQueue::QueueCommand<DrawColumnAddClampLLVMCommand>();
else
DrawerCommandQueue::QueueCommand<DrawColumnAddClampPalCommand>();
}
void R_DrawAddClampTranslatedColumn()
{
if (r_swtruecolor)
DrawerCommandQueue::QueueCommand<DrawColumnAddClampTranslatedLLVMCommand>();
else
DrawerCommandQueue::QueueCommand<DrawColumnAddClampTranslatedPalCommand>();
}
void R_DrawSubClampColumn()
{
if (r_swtruecolor)
DrawerCommandQueue::QueueCommand<DrawColumnSubClampLLVMCommand>();
else
DrawerCommandQueue::QueueCommand<DrawColumnSubClampPalCommand>();
}
void R_DrawSubClampTranslatedColumn()
{
if (r_swtruecolor)
DrawerCommandQueue::QueueCommand<DrawColumnSubClampTranslatedLLVMCommand>();
else
DrawerCommandQueue::QueueCommand<DrawColumnSubClampTranslatedPalCommand>();
}
void R_DrawRevSubClampColumn()
{
if (r_swtruecolor)
DrawerCommandQueue::QueueCommand<DrawColumnRevSubClampLLVMCommand>();
else
DrawerCommandQueue::QueueCommand<DrawColumnRevSubClampPalCommand>();
}
void R_DrawRevSubClampTranslatedColumn()
{
if (r_swtruecolor)
DrawerCommandQueue::QueueCommand<DrawColumnRevSubClampTranslatedLLVMCommand>();
else
DrawerCommandQueue::QueueCommand<DrawColumnRevSubClampTranslatedPalCommand>();
}
void R_DrawSpan()
{
if (r_swtruecolor)
DrawerCommandQueue::QueueCommand<DrawSpanLLVMCommand>();
else
DrawerCommandQueue::QueueCommand<DrawSpanPalCommand>();
}
void R_DrawSpanMasked()
{
if (r_swtruecolor)
DrawerCommandQueue::QueueCommand<DrawSpanMaskedLLVMCommand>();
else
DrawerCommandQueue::QueueCommand<DrawSpanMaskedPalCommand>();
}
void R_DrawSpanTranslucent()
{
if (r_swtruecolor)
DrawerCommandQueue::QueueCommand<DrawSpanTranslucentLLVMCommand>();
else
DrawerCommandQueue::QueueCommand<DrawSpanTranslucentPalCommand>();
}
void R_DrawSpanMaskedTranslucent()
{
if (r_swtruecolor)
DrawerCommandQueue::QueueCommand<DrawSpanMaskedTranslucentLLVMCommand>();
else
DrawerCommandQueue::QueueCommand<DrawSpanMaskedTranslucentPalCommand>();
}
void R_DrawSpanAddClamp()
{
if (r_swtruecolor)
DrawerCommandQueue::QueueCommand<DrawSpanAddClampLLVMCommand>();
else
DrawerCommandQueue::QueueCommand<DrawSpanAddClampPalCommand>();
}
void R_DrawSpanMaskedAddClamp()
{
if (r_swtruecolor)
DrawerCommandQueue::QueueCommand<DrawSpanMaskedAddClampLLVMCommand>();
else
DrawerCommandQueue::QueueCommand<DrawSpanMaskedAddClampPalCommand>();
}
void R_FillSpan()
{
if (r_swtruecolor)
DrawerCommandQueue::QueueCommand<FillSpanRGBACommand>();
else
DrawerCommandQueue::QueueCommand<FillSpanPalCommand>();
}
void R_DrawTiltedSpan(int y, int x1, int x2, const FVector3 &plane_sz, const FVector3 &plane_su, const FVector3 &plane_sv, bool plane_shade, int planeshade, float planelightfloat, fixed_t pviewx, fixed_t pviewy)
{
if (r_swtruecolor)
DrawerCommandQueue::QueueCommand<DrawTiltedSpanRGBACommand>(y, x1, x2, plane_sz, plane_su, plane_sv, plane_shade, planeshade, planelightfloat, pviewx, pviewy);
else
DrawerCommandQueue::QueueCommand<DrawTiltedSpanPalCommand>(y, x1, x2, plane_sz, plane_su, plane_sv, plane_shade, planeshade, planelightfloat, pviewx, pviewy);
}
void R_DrawColoredSpan(int y, int x1, int x2)
{
if (r_swtruecolor)
DrawerCommandQueue::QueueCommand<DrawColoredSpanRGBACommand>(y, x1, x2);
else
DrawerCommandQueue::QueueCommand<DrawColoredSpanPalCommand>(y, x1, x2);
}
void R_DrawFogBoundaryLine(int y, int x1, int x2)
{
if (r_swtruecolor)
DrawerCommandQueue::QueueCommand<DrawFogBoundaryLineRGBACommand>(y, x1, x2);
else
DrawerCommandQueue::QueueCommand<DrawFogBoundaryLinePalCommand>(y, x1, x2);
}
} }

View file

@ -123,6 +123,49 @@ namespace swrenderer
extern bool r_swtruecolor; extern bool r_swtruecolor;
class SWPixelFormatDrawers
{
public:
virtual ~SWPixelFormatDrawers() { }
virtual void DrawWallColumn() = 0;
virtual void DrawWallMaskedColumn() = 0;
virtual void DrawWallAddColumn() = 0;
virtual void DrawWallAddClampColumn() = 0;
virtual void DrawWallSubClampColumn() = 0;
virtual void DrawWallRevSubClampColumn() = 0;
virtual void DrawSingleSkyColumn(uint32_t solid_top, uint32_t solid_bottom) = 0;
virtual void DrawDoubleSkyColumn(uint32_t solid_top, uint32_t solid_bottom) = 0;
virtual void DrawColumn() = 0;
virtual void FillColumn() = 0;
virtual void FillAddColumn() = 0;
virtual void FillAddClampColumn() = 0;
virtual void FillSubClampColumn() = 0;
virtual void FillRevSubClampColumn() = 0;
virtual void DrawFuzzColumn() = 0;
virtual void DrawAddColumn() = 0;
virtual void DrawTranslatedColumn() = 0;
virtual void DrawTranslatedAddColumn() = 0;
virtual void DrawShadedColumn() = 0;
virtual void DrawAddClampColumn() = 0;
virtual void DrawAddClampTranslatedColumn() = 0;
virtual void DrawSubClampColumn() = 0;
virtual void DrawSubClampTranslatedColumn() = 0;
virtual void DrawRevSubClampColumn() = 0;
virtual void DrawRevSubClampTranslatedColumn() = 0;
virtual void DrawSpan() = 0;
virtual void DrawSpanMasked() = 0;
virtual void DrawSpanTranslucent() = 0;
virtual void DrawSpanMaskedTranslucent() = 0;
virtual void DrawSpanAddClamp() = 0;
virtual void DrawSpanMaskedAddClamp() = 0;
virtual void FillSpan() = 0;
virtual void DrawTiltedSpan(int y, int x1, int x2, const FVector3 &plane_sz, const FVector3 &plane_su, const FVector3 &plane_sv, bool plane_shade, int planeshade, float planelightfloat, fixed_t pviewx, fixed_t pviewy) = 0;
virtual void DrawColoredSpan(int y, int x1, int x2) = 0;
virtual void DrawFogBoundaryLine(int y, int x1, int x2) = 0;
};
SWPixelFormatDrawers *R_ActiveDrawers();
void R_InitColumnDrawers(); void R_InitColumnDrawers();
void R_InitShadeMaps(); void R_InitShadeMaps();
void R_InitFuzzTable(int fuzzoff); void R_InitFuzzTable(int fuzzoff);
@ -136,44 +179,6 @@ namespace swrenderer
void R_UpdateFuzzPos(); void R_UpdateFuzzPos();
void R_DrawColumn();
void R_DrawFuzzColumn();
void R_DrawTranslatedColumn();
void R_DrawShadedColumn();
void R_FillColumn();
void R_FillAddColumn();
void R_FillAddClampColumn();
void R_FillSubClampColumn();
void R_FillRevSubClampColumn();
void R_DrawAddColumn();
void R_DrawTlatedAddColumn();
void R_DrawAddClampColumn();
void R_DrawAddClampTranslatedColumn();
void R_DrawSubClampColumn();
void R_DrawSubClampTranslatedColumn();
void R_DrawRevSubClampColumn();
void R_DrawRevSubClampTranslatedColumn();
void R_DrawSpan();
void R_DrawSpanMasked();
void R_DrawSpanTranslucent();
void R_DrawSpanMaskedTranslucent();
void R_DrawSpanAddClamp();
void R_DrawSpanMaskedAddClamp();
void R_FillSpan();
void R_DrawTiltedSpan(int y, int x1, int x2, const FVector3 &plane_sz, const FVector3 &plane_su, const FVector3 &plane_sv, bool plane_shade, int planeshade, float planelightfloat, fixed_t pviewx, fixed_t pviewy);
void R_DrawColoredSpan(int y, int x1, int x2);
void R_DrawFogBoundaryLine(int y, int x1, int x2);
void R_DrawWallColumn();
void R_DrawWallMaskedColumn();
void R_DrawWallAddColumn();
void R_DrawWallAddClampColumn();
void R_DrawWallSubClampColumn();
void R_DrawWallRevSubClampColumn();
void R_DrawSingleSkyColumn(uint32_t solid_top, uint32_t solid_bottom);
void R_DrawDoubleSkyColumn(uint32_t solid_top, uint32_t solid_bottom);
// Sets dc_colormap and dc_light to their appropriate values depending on the output format (pal vs true color) // Sets dc_colormap and dc_light to their appropriate values depending on the output format (pal vs true color)
void R_SetColorMapLight(FSWColormap *base_colormap, float light, int shade); void R_SetColorMapLight(FSWColormap *base_colormap, float light, int shade);
void R_SetDSColorMapLight(FSWColormap *base_colormap, float light, int shade); void R_SetDSColorMapLight(FSWColormap *base_colormap, float light, int shade);
@ -181,4 +186,43 @@ namespace swrenderer
void R_SetSpanTexture(FTexture *tex); void R_SetSpanTexture(FTexture *tex);
void R_SetSpanColormap(FDynamicColormap *colormap, int shade); void R_SetSpanColormap(FDynamicColormap *colormap, int shade);
inline void R_DrawWallColumn() { R_ActiveDrawers()->DrawWallColumn(); }
inline void R_DrawWallMaskedColumn() { R_ActiveDrawers()->DrawWallMaskedColumn(); }
inline void R_DrawWallAddColumn() { R_ActiveDrawers()->DrawWallAddColumn(); }
inline void R_DrawWallAddClampColumn() { R_ActiveDrawers()->DrawWallAddClampColumn(); }
inline void R_DrawWallSubClampColumn() { R_ActiveDrawers()->DrawWallSubClampColumn(); }
inline void R_DrawWallRevSubClampColumn() { R_ActiveDrawers()->DrawWallRevSubClampColumn(); }
inline void R_DrawSingleSkyColumn(uint32_t solid_top, uint32_t solid_bottom) { R_ActiveDrawers()->DrawSingleSkyColumn(solid_top, solid_bottom); }
inline void R_DrawDoubleSkyColumn(uint32_t solid_top, uint32_t solid_bottom) { R_ActiveDrawers()->DrawDoubleSkyColumn(solid_top, solid_bottom); }
inline void R_DrawColumn() { R_ActiveDrawers()->DrawColumn(); }
inline void R_FillColumn() { R_ActiveDrawers()->FillColumn(); }
inline void R_FillAddColumn() { R_ActiveDrawers()->FillAddColumn(); }
inline void R_FillAddClampColumn() { R_ActiveDrawers()->FillAddClampColumn(); }
inline void R_FillSubClampColumn() { R_ActiveDrawers()->FillSubClampColumn(); }
inline void R_FillRevSubClampColumn() { R_ActiveDrawers()->FillRevSubClampColumn(); }
inline void R_DrawFuzzColumn() { R_ActiveDrawers()->DrawFuzzColumn(); }
inline void R_DrawAddColumn() { R_ActiveDrawers()->DrawAddColumn(); }
inline void R_DrawTranslatedColumn() { R_ActiveDrawers()->DrawTranslatedColumn(); }
inline void R_DrawTlatedAddColumn() { R_ActiveDrawers()->DrawTranslatedAddColumn(); }
inline void R_DrawShadedColumn() { R_ActiveDrawers()->DrawShadedColumn(); }
inline void R_DrawAddClampColumn() { R_ActiveDrawers()->DrawAddClampColumn(); }
inline void R_DrawAddClampTranslatedColumn() { R_ActiveDrawers()->DrawAddClampTranslatedColumn(); }
inline void R_DrawSubClampColumn() { R_ActiveDrawers()->DrawSubClampColumn(); }
inline void R_DrawSubClampTranslatedColumn() { R_ActiveDrawers()->DrawSubClampTranslatedColumn(); }
inline void R_DrawRevSubClampColumn() { R_ActiveDrawers()->DrawRevSubClampColumn(); }
inline void R_DrawRevSubClampTranslatedColumn() { R_ActiveDrawers()->DrawRevSubClampTranslatedColumn(); }
inline void R_DrawSpan() { R_ActiveDrawers()->DrawSpan(); }
inline void R_DrawSpanMasked() { R_ActiveDrawers()->DrawSpanMasked(); }
inline void R_DrawSpanTranslucent() { R_ActiveDrawers()->DrawSpanTranslucent(); }
inline void R_DrawSpanMaskedTranslucent() { R_ActiveDrawers()->DrawSpanMaskedTranslucent(); }
inline void R_DrawSpanAddClamp() { R_ActiveDrawers()->DrawSpanAddClamp(); }
inline void R_DrawSpanMaskedAddClamp() { R_ActiveDrawers()->DrawSpanMaskedAddClamp(); }
inline void R_FillSpan() { R_ActiveDrawers()->FillSpan(); }
inline void R_DrawTiltedSpan(int y, int x1, int x2, const FVector3 &plane_sz, const FVector3 &plane_su, const FVector3 &plane_sv, bool plane_shade, int planeshade, float planelightfloat, fixed_t pviewx, fixed_t pviewy)
{
R_ActiveDrawers()->DrawTiltedSpan(y, x1, x2, plane_sz, plane_su, plane_sv, plane_shade, planeshade, planelightfloat, pviewx, pviewy);
}
inline void R_DrawColoredSpan(int y, int x1, int x2) { R_ActiveDrawers()->DrawColoredSpan(y, x1, x2); }
inline void R_DrawFogBoundaryLine(int y, int x1, int x2) { R_ActiveDrawers()->DrawFogBoundaryLine(y, x1, x2); }
} }

View file

@ -231,4 +231,57 @@ namespace swrenderer
uint32_t _alpha; uint32_t _alpha;
uint32_t _fracposx; uint32_t _fracposx;
}; };
class SWPalDrawers : public SWPixelFormatDrawers
{
public:
void DrawWallColumn() override { DrawerCommandQueue::QueueCommand<DrawWall1PalCommand>(); }
void DrawWallMaskedColumn() override { DrawerCommandQueue::QueueCommand<DrawWallMasked1PalCommand>(); }
void DrawWallAddColumn() override
{
if (drawerargs::dc_num_lights == 0)
DrawerCommandQueue::QueueCommand<DrawWallAdd1PalCommand>();
else
DrawerCommandQueue::QueueCommand<DrawWallAddClamp1PalCommand>();
}
void DrawWallAddClampColumn() override { DrawerCommandQueue::QueueCommand<DrawWallAddClamp1PalCommand>(); }
void DrawWallSubClampColumn() override { DrawerCommandQueue::QueueCommand<DrawWallSubClamp1PalCommand>(); }
void DrawWallRevSubClampColumn() override { DrawerCommandQueue::QueueCommand<DrawWallRevSubClamp1PalCommand>(); }
void DrawSingleSkyColumn(uint32_t solid_top, uint32_t solid_bottom) override { DrawerCommandQueue::QueueCommand<DrawSingleSky1PalCommand>(solid_top, solid_bottom); }
void DrawDoubleSkyColumn(uint32_t solid_top, uint32_t solid_bottom) override { DrawerCommandQueue::QueueCommand<DrawDoubleSky1PalCommand>(solid_top, solid_bottom); }
void DrawColumn() override { DrawerCommandQueue::QueueCommand<DrawColumnPalCommand>(); }
void FillColumn() override { DrawerCommandQueue::QueueCommand<FillColumnPalCommand>(); }
void FillAddColumn() override { DrawerCommandQueue::QueueCommand<FillColumnAddPalCommand>(); }
void FillAddClampColumn() override { DrawerCommandQueue::QueueCommand<FillColumnAddClampPalCommand>(); }
void FillSubClampColumn() override { DrawerCommandQueue::QueueCommand<FillColumnSubClampPalCommand>(); }
void FillRevSubClampColumn() override { DrawerCommandQueue::QueueCommand<FillColumnRevSubClampPalCommand>(); }
void DrawFuzzColumn() override { DrawerCommandQueue::QueueCommand<DrawFuzzColumnPalCommand>(); R_UpdateFuzzPos(); }
void DrawAddColumn() override { DrawerCommandQueue::QueueCommand<DrawColumnAddPalCommand>(); }
void DrawTranslatedColumn() override { DrawerCommandQueue::QueueCommand<DrawColumnTranslatedPalCommand>(); }
void DrawTranslatedAddColumn() override { DrawerCommandQueue::QueueCommand<DrawColumnTlatedAddPalCommand>(); }
void DrawShadedColumn() override { DrawerCommandQueue::QueueCommand<DrawColumnShadedPalCommand>(); }
void DrawAddClampColumn() override { DrawerCommandQueue::QueueCommand<DrawColumnAddClampPalCommand>(); }
void DrawAddClampTranslatedColumn() override { DrawerCommandQueue::QueueCommand<DrawColumnAddClampTranslatedPalCommand>(); }
void DrawSubClampColumn() override { DrawerCommandQueue::QueueCommand<DrawColumnSubClampPalCommand>(); }
void DrawSubClampTranslatedColumn() override { DrawerCommandQueue::QueueCommand<DrawColumnSubClampTranslatedPalCommand>(); }
void DrawRevSubClampColumn() override { DrawerCommandQueue::QueueCommand<DrawColumnRevSubClampPalCommand>(); }
void DrawRevSubClampTranslatedColumn() override { DrawerCommandQueue::QueueCommand<DrawColumnRevSubClampTranslatedPalCommand>(); }
void DrawSpan() override { DrawerCommandQueue::QueueCommand<DrawSpanPalCommand>(); }
void DrawSpanMasked() override { DrawerCommandQueue::QueueCommand<DrawSpanMaskedPalCommand>(); }
void DrawSpanTranslucent() override { DrawerCommandQueue::QueueCommand<DrawSpanTranslucentPalCommand>(); }
void DrawSpanMaskedTranslucent() override { DrawerCommandQueue::QueueCommand<DrawSpanMaskedTranslucentPalCommand>(); }
void DrawSpanAddClamp() override { DrawerCommandQueue::QueueCommand<DrawSpanAddClampPalCommand>(); }
void DrawSpanMaskedAddClamp() override { DrawerCommandQueue::QueueCommand<DrawSpanMaskedAddClampPalCommand>(); }
void FillSpan() override { DrawerCommandQueue::QueueCommand<FillSpanPalCommand>(); }
void DrawTiltedSpan(int y, int x1, int x2, const FVector3 &plane_sz, const FVector3 &plane_su, const FVector3 &plane_sv, bool plane_shade, int planeshade, float planelightfloat, fixed_t pviewx, fixed_t pviewy) override
{
DrawerCommandQueue::QueueCommand<DrawTiltedSpanPalCommand>(y, x1, x2, plane_sz, plane_su, plane_sv, plane_shade, planeshade, planelightfloat, pviewx, pviewy);
}
void DrawColoredSpan(int y, int x1, int x2) override { DrawerCommandQueue::QueueCommand<DrawColoredSpanPalCommand>(y, x1, x2); }
void DrawFogBoundaryLine(int y, int x1, int x2) override { DrawerCommandQueue::QueueCommand<DrawFogBoundaryLinePalCommand>(y, x1, x2); }
};
} }

View file

@ -338,6 +338,53 @@ namespace swrenderer
uint32_t _fracposx; uint32_t _fracposx;
}; };
/////////////////////////////////////////////////////////////////////////////
class SWTruecolorDrawers : public SWPixelFormatDrawers
{
public:
void DrawWallColumn() override { DrawerCommandQueue::QueueCommand<DrawWall1LLVMCommand>(); }
void DrawWallMaskedColumn() override { DrawerCommandQueue::QueueCommand<DrawWallMasked1LLVMCommand>(); }
void DrawWallAddColumn() override { DrawerCommandQueue::QueueCommand<DrawWallAdd1LLVMCommand>(); }
void DrawWallAddClampColumn() override { DrawerCommandQueue::QueueCommand<DrawWallAddClamp1LLVMCommand>(); }
void DrawWallSubClampColumn() override { DrawerCommandQueue::QueueCommand<DrawWallSubClamp1LLVMCommand>(); }
void DrawWallRevSubClampColumn() override { DrawerCommandQueue::QueueCommand<DrawWallRevSubClamp1LLVMCommand>(); }
void DrawSingleSkyColumn(uint32_t solid_top, uint32_t solid_bottom) override { DrawerCommandQueue::QueueCommand<DrawSingleSky1LLVMCommand>(solid_top, solid_bottom); }
void DrawDoubleSkyColumn(uint32_t solid_top, uint32_t solid_bottom) override { DrawerCommandQueue::QueueCommand<DrawDoubleSky1LLVMCommand>(solid_top, solid_bottom); }
void DrawColumn() override { DrawerCommandQueue::QueueCommand<DrawColumnLLVMCommand>(); }
void FillColumn() override { DrawerCommandQueue::QueueCommand<FillColumnLLVMCommand>(); }
void FillAddColumn() override { DrawerCommandQueue::QueueCommand<FillColumnAddLLVMCommand>(); }
void FillAddClampColumn() override { DrawerCommandQueue::QueueCommand<FillColumnAddClampLLVMCommand>(); }
void FillSubClampColumn() override { DrawerCommandQueue::QueueCommand<FillColumnSubClampLLVMCommand>(); }
void FillRevSubClampColumn() override { DrawerCommandQueue::QueueCommand<FillColumnRevSubClampLLVMCommand>(); }
void DrawFuzzColumn() override { DrawerCommandQueue::QueueCommand<DrawFuzzColumnRGBACommand>(); R_UpdateFuzzPos(); }
void DrawAddColumn() override { DrawerCommandQueue::QueueCommand<DrawColumnAddLLVMCommand>(); }
void DrawTranslatedColumn() override { DrawerCommandQueue::QueueCommand<DrawColumnTranslatedLLVMCommand>(); }
void DrawTranslatedAddColumn() override { DrawerCommandQueue::QueueCommand<DrawColumnTlatedAddLLVMCommand>(); }
void DrawShadedColumn() override { DrawerCommandQueue::QueueCommand<DrawColumnShadedLLVMCommand>(); }
void DrawAddClampColumn() override { DrawerCommandQueue::QueueCommand<DrawColumnAddClampLLVMCommand>(); }
void DrawAddClampTranslatedColumn() override { DrawerCommandQueue::QueueCommand<DrawColumnAddClampTranslatedLLVMCommand>(); }
void DrawSubClampColumn() override { DrawerCommandQueue::QueueCommand<DrawColumnSubClampLLVMCommand>(); }
void DrawSubClampTranslatedColumn() override { DrawerCommandQueue::QueueCommand<DrawColumnSubClampTranslatedLLVMCommand>(); }
void DrawRevSubClampColumn() override { DrawerCommandQueue::QueueCommand<DrawColumnRevSubClampLLVMCommand>(); }
void DrawRevSubClampTranslatedColumn() override { DrawerCommandQueue::QueueCommand<DrawColumnRevSubClampTranslatedLLVMCommand>(); }
void DrawSpan() override { DrawerCommandQueue::QueueCommand<DrawSpanLLVMCommand>(); }
void DrawSpanMasked() override { DrawerCommandQueue::QueueCommand<DrawSpanMaskedLLVMCommand>(); }
void DrawSpanTranslucent() override { DrawerCommandQueue::QueueCommand<DrawSpanTranslucentLLVMCommand>(); }
void DrawSpanMaskedTranslucent() override { DrawerCommandQueue::QueueCommand<DrawSpanMaskedTranslucentLLVMCommand>(); }
void DrawSpanAddClamp() override { DrawerCommandQueue::QueueCommand<DrawSpanAddClampLLVMCommand>(); }
void DrawSpanMaskedAddClamp() override { DrawerCommandQueue::QueueCommand<DrawSpanMaskedAddClampLLVMCommand>(); }
void FillSpan() override { DrawerCommandQueue::QueueCommand<FillSpanRGBACommand>(); }
void DrawTiltedSpan(int y, int x1, int x2, const FVector3 &plane_sz, const FVector3 &plane_su, const FVector3 &plane_sv, bool plane_shade, int planeshade, float planelightfloat, fixed_t pviewx, fixed_t pviewy) override
{
DrawerCommandQueue::QueueCommand<DrawTiltedSpanRGBACommand>(y, x1, x2, plane_sz, plane_su, plane_sv, plane_shade, planeshade, planelightfloat, pviewx, pviewy);
}
void DrawColoredSpan(int y, int x1, int x2) override { DrawerCommandQueue::QueueCommand<DrawColoredSpanRGBACommand>(y, x1, x2); }
void DrawFogBoundaryLine(int y, int x1, int x2) override { DrawerCommandQueue::QueueCommand<DrawFogBoundaryLineRGBACommand>(y, x1, x2); }
};
///////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////
// Pixel shading inline functions: // Pixel shading inline functions: