Change RenderTranslucentPass to be a singleton

This commit is contained in:
Magnus Norddahl 2017-01-26 08:36:28 +01:00
commit 34f85569b4
8 changed files with 31 additions and 20 deletions

View file

@ -236,11 +236,13 @@ namespace swrenderer
uint32_t fracstepx = PARTICLE_TEXTURE_SIZE * FRACUNIT / countbase;
uint32_t fracposx = fracstepx / 2;
RenderTranslucentPass *translucentPass = RenderTranslucentPass::Instance();
if (r_swtruecolor)
{
for (int x = x1; x < (x1 + countbase); x++, fracposx += fracstepx)
{
if (RenderTranslucentPass::ClipSpriteColumnWithPortals(x, vis))
if (translucentPass->ClipSpriteColumnWithPortals(x, vis))
continue;
uint32_t *dest = ylookup[yl] + x + (uint32_t*)dc_destorg;
DrawerCommandQueue::QueueCommand<DrawParticleColumnRGBACommand>(dest, yl, spacing, ycount, fg, alpha, fracposx);
@ -250,7 +252,7 @@ namespace swrenderer
{
for (int x = x1; x < (x1 + countbase); x++, fracposx += fracstepx)
{
if (RenderTranslucentPass::ClipSpriteColumnWithPortals(x, vis))
if (translucentPass->ClipSpriteColumnWithPortals(x, vis))
continue;
uint8_t *dest = ylookup[yl] + x + dc_destorg;
DrawerCommandQueue::QueueCommand<DrawParticleColumnPalCommand>(dest, yl, spacing, ycount, fg, alpha, fracposx);