- 2D drawer cleanup.

This commit is contained in:
Christoph Oelckers 2020-04-11 19:46:57 +02:00
commit b18faacab0
36 changed files with 1032 additions and 1147 deletions

View file

@ -228,7 +228,7 @@ private:
if (left >= 0 && right < 320 && top >= 0 && bottom < 200)
{
screen->DrawTexture(c[i], lnodes[n].x, lnodes[n].y, DTA_320x200, true, TAG_DONE);
DrawTexture(twod, c[i], lnodes[n].x, lnodes[n].y, DTA_320x200, true, TAG_DONE);
break;
}
}
@ -600,16 +600,16 @@ void DInterBackground::drawBackground(int state, bool drawsplat, bool snl_pointe
// placing the animations precisely where they belong on the base pic
animwidth = background->GetDisplayWidthDouble();
animheight = background->GetDisplayHeightDouble();
screen->DrawTexture(background, 0, 0, DTA_Fullscreen, true, TAG_DONE);
DrawTexture(twod, background, 0, 0, DTA_Fullscreen, true, TAG_DONE);
}
else
{
screen->FlatFill(0, 0, SCREENWIDTH, SCREENHEIGHT, background);
twod->AddFlatFill(0, 0, SCREENWIDTH, SCREENHEIGHT, background);
}
}
else
{
screen->Clear(0, 0, SCREENWIDTH, SCREENHEIGHT, 0, 0);
ClearRect(twod, 0, 0, SCREENWIDTH, SCREENHEIGHT, 0, 0);
}
for (i = 0; i<anims.Size(); i++)
@ -655,7 +655,7 @@ void DInterBackground::drawBackground(int state, bool drawsplat, bool snl_pointe
break;
}
if (a->ctr >= 0)
screen->DrawTexture(a->frames[a->ctr], a->loc.x, a->loc.y,
DrawTexture(twod, a->frames[a->ctr], a->loc.x, a->loc.y,
DTA_VirtualWidthF, animwidth, DTA_VirtualHeightF, animheight, TAG_DONE);
}
@ -724,10 +724,10 @@ void WI_Drawer()
ScaleOverrider s;
IFVIRTUALPTRNAME(WI_Screen, "StatusScreen", Drawer)
{
screen->FillBorder(nullptr);
FillBorder(twod, nullptr);
VMValue self = WI_Screen;
VMCall(func, &self, 1, nullptr, 0);
screen->ClearClipRect(); // make sure the scripts don't leave a valid clipping rect behind.
twod->ClearClipRect(); // make sure the scripts don't leave a valid clipping rect behind.
// The internal handling here is somewhat poor. After being set to 'LeavingIntermission'
// the screen is needed for one more draw operation so we cannot delete it right away but only here.