- fixed recursion issues caused by the plasma generator function performing a busy wait.

This commit is contained in:
Christoph Oelckers 2019-12-25 18:57:08 +01:00
parent 28cbecea67
commit 23bc599468
2 changed files with 184 additions and 182 deletions

View file

@ -887,6 +887,7 @@ void M_Drawer (void)
} }
if (!going) if (!going)
{ {
assert(DMenu::CurrentMenu);
DMenu::CurrentMenu->origin = { 0,0 }; DMenu::CurrentMenu->origin = { 0,0 };
// else if (DrawBackground) Menu_DrawBackground(origin); // else if (DrawBackground) Menu_DrawBackground(origin);
DMenu::CurrentMenu->Drawer(); DMenu::CurrentMenu->Drawer();

View file

@ -309,8 +309,15 @@ int nLogoTile;
#define kPlasmaWidth 320 #define kPlasmaWidth 320
#define kPlasmaHeight 80 #define kPlasmaHeight 80
int nextPlasmaTic;
void menu_DoPlasma() void menu_DoPlasma()
{ {
int ptile = nPlasmaTile;
if (totalclock >= nextPlasmaTic || !PlasmaBuffer)
{
nextPlasmaTic = (int)totalclock + 4;
if (!nLogoTile) if (!nLogoTile)
nLogoTile = EXHUMED ? kExhumedLogo : kPowerslaveLogo; nLogoTile = EXHUMED ? kExhumedLogo : kPowerslaveLogo;
@ -504,9 +511,6 @@ void menu_DoPlasma()
tileInvalidate(nPlasmaTile, -1, -1); tileInvalidate(nPlasmaTile, -1, -1);
overwritesprite(0, 0, nPlasmaTile, 0, 2, kPalNormal);
overwritesprite(160, 40, nLogoTile, 0, 3, kPalNormal);
// flip between tile 4092 and 4093 // flip between tile 4092 and 4093
if (nPlasmaTile == kTile4092) { if (nPlasmaTile == kTile4092) {
nPlasmaTile = kTile4093; nPlasmaTile = kTile4093;
@ -514,18 +518,15 @@ void menu_DoPlasma()
else if (nPlasmaTile == kTile4093) { else if (nPlasmaTile == kTile4093) {
nPlasmaTile = kTile4092; nPlasmaTile = kTile4092;
} }
}
overwritesprite(0, 0, ptile, 0, 2, kPalNormal);
overwritesprite(160, 40, nLogoTile, 0, 3, kPalNormal);
// draw the fire urn/lamp thingies // draw the fire urn/lamp thingies
int dword_9AB5F = ((int)totalclock/16) & 3; int dword_9AB5F = ((int)totalclock/16) & 3;
overwritesprite(50, 150, kTile3512 + dword_9AB5F, 0, 3, kPalNormal); overwritesprite(50, 150, kTile3512 + dword_9AB5F, 0, 3, kPalNormal);
overwritesprite(270, 150, kTile3512 + ((dword_9AB5F + 2) & 3), 0, 3, kPalNormal); overwritesprite(270, 150, kTile3512 + ((dword_9AB5F + 2) & 3), 0, 3, kPalNormal);
// TEMP
int time = (int)totalclock + 4;
while ((int)totalclock < time) {
HandleAsync();
}
} }