- migrated the Duke end of episode animations.

This commit is contained in:
Christoph Oelckers 2021-04-16 00:25:22 +02:00
parent 2a2c85c082
commit a78af92959

View file

@ -437,7 +437,6 @@ public:
FGameTexture* getTexture() FGameTexture* getTexture()
{ {
// Here we must provide a real texture, even if invalid, so that the sounds play.
auto texid = TexMan.CheckForTexture("radlogo.anm", ETextureType::Any, FTextureManager::TEXMAN_TryAny | FTextureManager::TEXMAN_ForceLookup); auto texid = TexMan.CheckForTexture("radlogo.anm", ETextureType::Any, FTextureManager::TEXMAN_TryAny | FTextureManager::TEXMAN_ForceLookup);
if (texid.isValid()) return TexMan.GetGameTexture(texid); if (texid.isValid()) return TexMan.GetGameTexture(texid);
else return TexMan.GameByIndex(0); else return TexMan.GameByIndex(0);
@ -448,7 +447,17 @@ public:
{ {
} }
int Frame(uint64_t clock, bool skiprequest) bool OnEvent(event_t* evt) override
{
if (evt->type == EV_GUI_KeyDown)
{
state = skipped;
FX_StopAllSounds();
}
return true;
}
void OnTick() override
{ {
switch (sound) switch (sound)
{ {
@ -493,23 +502,21 @@ public:
if (!S_CheckSoundPlaying(ENDSEQVOL3SND9)) if (!S_CheckSoundPlaying(ENDSEQVOL3SND9))
{ {
sound++; sound++;
waittime = clock + (SoundEnabled()? 1'000'000'000 : 5'000'000'000); // if sound is off this wouldn't wait without a longer delay here. waittime = ticks + GameTicRate * (SoundEnabled() ? 1 : 5); // if sound is off this wouldn't wait without a longer delay here.
} }
break; break;
case 6: case 6:
if (isPlutoPak()) if (isPlutoPak())
{ {
if (clock > waittime) skiprequest = true; if (ticks > waittime) state = finished;
} }
break; break;
default: default:
break; break;
} }
int ret = DImageScreen::Frame(clock, skiprequest); if (state != running) FX_StopAllSounds();
if (ret != 1) FX_StopAllSounds();
return ret;
} }
}; };
@ -519,12 +526,12 @@ public:
// //
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
class DEpisode4Text : public DScreenJob class DEpisode4Text : public DSkippableScreenJob
{ {
public: public:
DEpisode4Text() : DScreenJob(fadein | fadeout) {} DEpisode4Text() : DSkippableScreenJob(fadein | fadeout) {}
int Frame(uint64_t clock, bool skiprequest) void Draw(double)
{ {
twod->ClearScreen(); twod->ClearScreen();
BigText(160, 60, GStrings("Thanks to all our")); BigText(160, 60, GStrings("Thanks to all our"));
@ -532,7 +539,6 @@ public:
BigText(160, 60 + 16 + 16, GStrings("us big heads.")); BigText(160, 60 + 16 + 16, GStrings("us big heads."));
BigText(160, 70 + 16 + 16 + 16, GStrings("Look for a Duke Nukem 3D")); BigText(160, 70 + 16 + 16 + 16, GStrings("Look for a Duke Nukem 3D"));
BigText(160, 70 + 16 + 16 + 16 + 16, GStrings("sequel soon.")); BigText(160, 70 + 16 + 16 + 16 + 16, GStrings("sequel soon."));
return skiprequest ? -1 : 1;
} }
}; };
@ -551,7 +557,7 @@ public:
{ {
} }
int Frame(uint64_t clock, bool skiprequest) void OnTick() override
{ {
switch (sound) switch (sound)
{ {
@ -567,9 +573,6 @@ public:
default: default:
break; break;
} }
int ret = DImageScreen::Frame(clock, skiprequest);
if (ret != 1) FX_StopAllSounds();
return ret;
} }
}; };
@ -1120,14 +1123,13 @@ class DDukeLoadScreen : public DScreenJob
public: public:
DDukeLoadScreen(MapRecord *maprec) : DScreenJob(0), rec(maprec) {} DDukeLoadScreen(MapRecord *maprec) : DScreenJob(0), rec(maprec) {}
int Frame(uint64_t clock, bool skiprequest) void Draw(double) override
{ {
twod->ClearScreen(); twod->ClearScreen();
DrawTexture(twod, tileGetTexture(LOADSCREEN), 0, 0, DTA_FullscreenEx, FSMode_ScaleToFit43, DTA_LegacyRenderStyle, STYLE_Normal, TAG_DONE); DrawTexture(twod, tileGetTexture(LOADSCREEN), 0, 0, DTA_FullscreenEx, FSMode_ScaleToFit43, DTA_LegacyRenderStyle, STYLE_Normal, TAG_DONE);
BigText(160, 90, (rec->flags & MI_USERMAP)? GStrings("TXT_LOADUM") : GStrings("TXT_LOADING")); BigText(160, 90, (rec->flags & MI_USERMAP)? GStrings("TXT_LOADUM") : GStrings("TXT_LOADING"));
BigText(160, 114, rec->DisplayName()); BigText(160, 114, rec->DisplayName());
return 0;
} }
}; };