Change RenderTranslucentPass to be a singleton
This commit is contained in:
parent
8b0304c1e3
commit
34f85569b4
8 changed files with 31 additions and 20 deletions
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -288,9 +288,11 @@ namespace swrenderer
|
|||
|
||||
if (x < x2)
|
||||
{
|
||||
RenderTranslucentPass *translucentPass = RenderTranslucentPass::Instance();
|
||||
|
||||
while (x < x2)
|
||||
{
|
||||
if (!RenderTranslucentPass::ClipSpriteColumnWithPortals(x, vis))
|
||||
if (!translucentPass->ClipSpriteColumnWithPortals(x, vis))
|
||||
R_DrawMaskedColumn(x, iscale, tex, frac, spryscale, sprtopscreen, sprflipvert, mfloorclip, mceilingclip, false);
|
||||
x++;
|
||||
frac += xiscale;
|
||||
|
|
|
|||
|
|
@ -178,7 +178,7 @@ namespace swrenderer
|
|||
vis->Light.SetColormap(r_SpriteVisibility / MAX(tz, MINZ), spriteshade, basecolormap, fullbright, invertcolormap, fadeToBlack);
|
||||
|
||||
VisibleSpriteList::Instance()->Push(vis);
|
||||
RenderTranslucentPass::DrewAVoxel = true;
|
||||
RenderTranslucentPass::Instance()->DrewAVoxel = true;
|
||||
}
|
||||
|
||||
void RenderVoxel::Render(short *cliptop, short *clipbottom, int minZ, int maxZ)
|
||||
|
|
|
|||
|
|
@ -226,13 +226,15 @@ namespace swrenderer
|
|||
}
|
||||
else
|
||||
{
|
||||
RenderTranslucentPass *translucentPass = RenderTranslucentPass::Instance();
|
||||
|
||||
while (x < x2)
|
||||
{
|
||||
if (calclighting)
|
||||
{ // calculate lighting
|
||||
R_SetColorMapLight(usecolormap, light, shade);
|
||||
}
|
||||
if (!RenderTranslucentPass::ClipSpriteColumnWithPortals(x, spr))
|
||||
if (!translucentPass->ClipSpriteColumnWithPortals(x, spr))
|
||||
DrawColumn(x, WallSpriteTile, walltexcoords, texturemid, maskedScaleY, sprflipvert, mfloorclip, mceilingclip);
|
||||
light += lightstep;
|
||||
x++;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue