- redid Duke cutscene code to use functions, not classes as exports and added the missing screens.

Functions are better because they allow doing more in the internal setup code.
This commit is contained in:
Christoph Oelckers 2021-04-26 01:20:49 +02:00
parent eeefc4355e
commit 88dfb93865
4 changed files with 169 additions and 208 deletions

View file

@ -178,124 +178,6 @@ void Logo_d(const CompletionFunc &completion)
} }
#if 0
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
static void bonussequence_d(int num, TArray<DScreenJob*>& jobs)
{
static const AnimSound cineov2sound[] =
{
{ 1, WIND_AMBIENCE+1 },
{ 26, ENDSEQVOL2SND1+1 },
{ 36, ENDSEQVOL2SND2+1 },
{ 54, THUD+1 },
{ 62, ENDSEQVOL2SND3+1 },
{ 75, ENDSEQVOL2SND4 + 1 },
{ 81, ENDSEQVOL2SND5 + 1 },
{ 115, ENDSEQVOL2SND6 + 1 },
{ 124, ENDSEQVOL2SND7 + 1 },
{ -1, -1 }
};
static const AnimSound cineov3sound[] =
{
{ 1, WIND_REPEAT + 1 },
{ 98, DUKE_GRUNT + 1 },
{ 102, THUD + 1 },
{ 102, SQUISHED + 1 },
{ 124, ENDSEQVOL3SND3 + 1 },
{ 134, ENDSEQVOL3SND2 + 1 },
{ 158, PIPEBOMB_EXPLODE + 1 },
{ -1,-1 }
};
static const AnimSound dukedcsound[] =
{
{ 144, ENDSEQVOL3SND3 + 1 },
{ -1,-1 }
};
static const AnimSound vol4e1[] =
{
{ 3, DUKE_UNDERWATER+1 },
{ 35, VOL4ENDSND1+1 },
{ -1,-1 }
};
static const AnimSound vol4e2[] =
{
{ 11, DUKE_UNDERWATER+1 },
{ 20, VOL4ENDSND1+1 },
{ 39, VOL4ENDSND2+1 },
{ 50, -1 },
{ -1,-1 }
};
static const AnimSound vol4e3[] =
{
{ 1, BOSS4_DEADSPEECH+1 },
{ 40, VOL4ENDSND1+1 },
{ 40, DUKE_UNDERWATER+1 },
{ 50, BIGBANG+1 },
{ -1,-1 }
};
static const int framespeed_10[] = { 10, 10, 10 };
static const int framespeed_14[] = { 14, 14, 14 };
static const int framespeed_18[] = { 18, 18, 18 };
switch (num)
{
case 0:
jobs.Push(Create<DEpisode1End1>());
jobs.Push(Create<DImageScreen>(E1ENDSCREEN, DScreenJob::fadein|DScreenJob::fadeout|DScreenJob::stopmusic, 0x7fffffff));
break;
case 1:
Mus_Stop();
jobs.Push(PlayVideo("cineov2.anm", cineov2sound, framespeed_18));
jobs.Push(Create<DE2EndScreen>());
break;
case 2:
Mus_Stop();
if (g_gameType & GAMEFLAG_DUKEDC)
{
jobs.Push(PlayVideo("radlogo.anm", dukedcsound, framespeed_10));
}
else
{
jobs.Push(PlayVideo("cineov3.anm", cineov3sound, framespeed_10));
jobs.Push(Create<DBlackScreen>(200, DScreenJob::stopsound));
jobs.Push(Create<DEpisode3End>());
if (!isPlutoPak()) jobs.Push(Create<DImageScreen>(TexMan.GetGameTextureByName("DUKETEAM.ANM", false, FTextureManager::TEXMAN_ForceLookup),
DScreenJob::fadein | DScreenJob::fadeout | DScreenJob::stopsound, 0x7fffffff));
}
break;
case 3:
Mus_Stop();
jobs.Push(PlayVideo("vol4e1.anm", vol4e1, framespeed_10));
jobs.Push(PlayVideo("vol4e2.anm", vol4e2, framespeed_10));
jobs.Push(PlayVideo("vol4e3.anm", vol4e3, framespeed_10));
jobs.Push(Create<DEpisode4Text>());
jobs.Push(Create<DImageScreen>(TexMan.GetGameTextureByName("DUKETEAM.ANM", false, FTextureManager::TEXMAN_ForceLookup),
DScreenJob::fadein | DScreenJob::fadeout | DScreenJob::stopsound, 0x7fffffff));
break;
case 4:
Mus_Stop();
jobs.Push(Create<DEpisode5End>());
break;
}
}
#endif
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
// //
// //

View file

@ -608,8 +608,13 @@ x(VICTORY7, 3266)
x(VICTORY8, 3267) x(VICTORY8, 3267)
x(VICTORY9, 3268) x(VICTORY9, 3268)
x(ORDERING, 3270) x(ORDERING, 3270)
x(ORDERING1, 3271)
x(ORDERING2, 3272)
x(ORDERING3, 3273)
x(TEXTSTORY, 3280) x(TEXTSTORY, 3280)
x(LOADSCREEN, 3281) x(LOADSCREEN, 3281)
x(SWEXIT2, 3290)
x(SWEXIT1, 3291)
x(E1ENDSCREEN, 3292) x(E1ENDSCREEN, 3292)
x(E2ENDSCREEN, 3293) x(E2ENDSCREEN, 3293)
x(BORNTOBEWILDSCREEN, 3370) x(BORNTOBEWILDSCREEN, 3370)

View file

@ -26,18 +26,16 @@ Prepared for public release: 03/21/2003 - Charlie Wiederhold, 3D Realms
*/ */
//------------------------------------------------------------------------- //-------------------------------------------------------------------------
class DukeCutscenes
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
class DukeIntro : ScreenJobRunner
{ {
void Init() //---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
static void BuildIntro(ScreenJobRunner runner)
{ {
Super.Init();
Raze.StopMusic(); Raze.StopMusic();
Raze.StopAllSounds(); Raze.StopAllSounds();
@ -49,41 +47,33 @@ class DukeIntro : ScreenJobRunner
soundinfo.Pushv( soundinfo.Pushv(
1, DukeSnd.FLY_BY+1, 1, DukeSnd.FLY_BY+1,
19, DukeSnd.PIPEBOMB_EXPLODE+1); 19, DukeSnd.PIPEBOMB_EXPLODE+1);
jobs.Push(MoviePlayerJob.CreateWithSoundinfo("logo.anm", soundinfo, 0, 9, 9, 9)); runner.Append(MoviePlayerJob.CreateWithSoundinfo("logo.anm", soundinfo, 0, 9, 9, 9));
} }
if (!Raze.isNam()) jobs.Push(new("DRealmsScreen").Init()); if (!Raze.isNam()) runner.Append(new("DRealmsScreen").Init());
} }
jobs.Push(new("DukeTitleScreen").Init()); runner.Append(new("DukeTitleScreen").Init());
} }
}
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
// //
// //
// //
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
class DukeE1End : ScreenJobRunner static void BuildE1End(ScreenJobRunner runner)
{
void Init()
{ {
Super.Init(); runner.Append(new("Episode1End1").Init());
jobs.Push(new("Episode1End1").Init()); runner.Append(ImageScreen.CreateNamed("E1ENDSCREEN", ScreenJob.fadein|ScreenJob.fadeout|ScreenJob.stopmusic, 0x7fffffff));
jobs.Push(ImageScreen.CreateNamed("E1ENDSCREEN", ScreenJob.fadein|ScreenJob.fadeout|ScreenJob.stopmusic, 0x7fffffff));
} }
}
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
// //
// //
// //
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
class DukeE2End : ScreenJobRunner static void BuildE2End(ScreenJobRunner runner)
{
void Init()
{ {
Super.Init();
Array<int> soundinfo; Array<int> soundinfo;
soundinfo.Pushv( soundinfo.Pushv(
1, DukeSnd.WIND_AMBIENCE+1, 1, DukeSnd.WIND_AMBIENCE+1,
@ -96,22 +86,18 @@ class DukeE2End : ScreenJobRunner
115, DukeSnd.ENDSEQVOL2SND6 + 1, 115, DukeSnd.ENDSEQVOL2SND6 + 1,
124, DukeSnd.ENDSEQVOL2SND7 + 1); 124, DukeSnd.ENDSEQVOL2SND7 + 1);
jobs.Push(MoviePlayerJob.CreateWithSoundinfo("cineov2.anm", soundinfo, 0, 18, 18, 18)); runner.Append(MoviePlayerJob.CreateWithSoundinfo("cineov2.anm", soundinfo, 0, 18, 18, 18));
jobs.Push(new("E2EndScreen").Init()); runner.Append(new("E2EndScreen").Init());
} }
}
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
// //
// //
// //
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
class DukeE3End : ScreenJobRunner static void BuildE3End(ScreenJobRunner runner)
{
void Init()
{ {
Super.Init();
Array<int> soundinfo; Array<int> soundinfo;
soundinfo.Pushv( soundinfo.Pushv(
1, DukeSnd.WIND_REPEAT + 1, 1, DukeSnd.WIND_REPEAT + 1,
@ -122,79 +108,162 @@ class DukeE3End : ScreenJobRunner
134, DukeSnd.ENDSEQVOL3SND2 + 1, 134, DukeSnd.ENDSEQVOL3SND2 + 1,
158, DukeSnd.PIPEBOMB_EXPLODE + 1); 158, DukeSnd.PIPEBOMB_EXPLODE + 1);
jobs.Push(MoviePlayerJob.CreateWithSoundinfo("cineov3.anm", soundinfo, 0, 10, 10, 10)); runner.Append(MoviePlayerJob.CreateWithSoundinfo("cineov3.anm", soundinfo, 0, 10, 10, 10));
jobs.Push(BlackScreen.Create(200, ScreenJob.stopsound)); runner.Append(BlackScreen.Create(200, ScreenJob.stopsound));
jobs.Push(new("Episode3End").Init()); runner.Append(new("Episode3End").Init());
if (!Raze.isPlutoPak()) jobs.Push(ImageScreen.CreateNamed("DUKETEAM.ANM", ScreenJob.fadein | ScreenJob.fadeout | ScreenJob.stopsound, 0x7fffffff)); if (!Raze.isPlutoPak()) runner.Append(ImageScreen.CreateNamed("DUKETEAM.ANM", ScreenJob.fadein | ScreenJob.fadeout | ScreenJob.stopsound, 0x7fffffff));
} }
}
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
// //
// //
// //
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
class DukeDCEnd : ScreenJobRunner static void BuildDCEnd(ScreenJobRunner runner)
{
void Init()
{ {
Super.Init();
Array<int> soundinfo; Array<int> soundinfo;
soundinfo.Pushv(144, DukeSnd.ENDSEQVOL3SND3 + 1); soundinfo.Pushv(144, DukeSnd.ENDSEQVOL3SND3 + 1);
jobs.Push(MoviePlayerJob.CreateWithSoundinfo("radlogo.anm", soundinfo, 0, 10, 10, 10)); runner.Append(MoviePlayerJob.CreateWithSoundinfo("radlogo.anm", soundinfo, 0, 10, 10, 10));
} }
}
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
// //
// //
// //
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
class DukeE4End : ScreenJobRunner static void BuildE4End(ScreenJobRunner runner)
{
void Init()
{ {
Super.Init(true, true);
Array<int> soundinfo; Array<int> soundinfo;
soundinfo.Pushv( soundinfo.Pushv(
3, DukeSnd.DUKE_UNDERWATER+1, 3, DukeSnd.DUKE_UNDERWATER+1,
35, DukeSnd.VOL4ENDSND1+1); 35, DukeSnd.VOL4ENDSND1+1);
jobs.Push(MoviePlayerJob.CreateWithSoundinfo("vol4e1.anm", soundinfo, 0, 10, 10, 10)); runner.Append(MoviePlayerJob.CreateWithSoundinfo("vol4e1.anm", soundinfo, 0, 10, 10, 10));
soundinfo.Pushv( soundinfo.Pushv(
11, DukeSnd.DUKE_UNDERWATER+1, 11, DukeSnd.DUKE_UNDERWATER+1,
20, DukeSnd.VOL4ENDSND1+1, 20, DukeSnd.VOL4ENDSND1+1,
39, DukeSnd.VOL4ENDSND2+1, 39, DukeSnd.VOL4ENDSND2+1,
50, -1); 50, -1);
jobs.Push(MoviePlayerJob.CreateWithSoundinfo("vol4e2.anm", soundinfo, 0, 10, 10, 10)); runner.Append(MoviePlayerJob.CreateWithSoundinfo("vol4e2.anm", soundinfo, 0, 10, 10, 10));
soundinfo.Pushv( soundinfo.Pushv(
1, DukeSnd.BOSS4_DEADSPEECH+1, 1, DukeSnd.BOSS4_DEADSPEECH+1,
40, DukeSnd.VOL4ENDSND1+1, 40, DukeSnd.VOL4ENDSND1+1,
40, DukeSnd.DUKE_UNDERWATER+1, 40, DukeSnd.DUKE_UNDERWATER+1,
50, DukeSnd.BIGBANG+1); 50, DukeSnd.BIGBANG+1);
jobs.Push(MoviePlayerJob.CreateWithSoundinfo("vol4e3.anm", soundinfo, 0, 10, 10, 10)); runner.Append(MoviePlayerJob.CreateWithSoundinfo("vol4e3.anm", soundinfo, 0, 10, 10, 10));
jobs.Push(new("Episode4Text").Init()); runner.Append(new("Episode4Text").Init());
jobs.Push(ImageScreen.CreateNamed("DUKETEAM.ANM", ScreenJob.fadein | ScreenJob.fadeout | ScreenJob.stopsound, 0x7fffffff)); runner.Append(ImageScreen.CreateNamed("DUKETEAM.ANM", ScreenJob.fadein | ScreenJob.fadeout | ScreenJob.stopsound, 0x7fffffff));
} }
}
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
// //
// //
// //
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
class DukeE5End : ScreenJobRunner static void BuildE5End(ScreenJobRunner runner)
{
void Init()
{ {
Super.Init(); runner.Append(new("Episode5End").Init());
jobs.Push(new("Episode5End").Init());
} }
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
static void BuildE4Intro(ScreenJobRunner runner)
{
Array<int> soundinfo;
Duke.PlaySpecialMusic(Duke.MUS_BRIEFING);
soundinfo.Pushv(
1, DukeSnd.INTRO4_B + 1,
12, DukeSnd.SHORT_CIRCUIT + 1,
18, DukeSnd.INTRO4_5 + 1,
34, DukeSnd.SHORT_CIRCUIT + 1);
runner.Append(MoviePlayerJob.CreateWithSoundinfo("vol41a1.anm", soundinfo, 0, 10, 10, 10));
soundinfo.Pushv(
1, DukeSnd.INTRO4_1 + 1,
7, DukeSnd.INTRO4_3 + 1,
12, DukeSnd.INTRO4_2 + 1,
26, DukeSnd.INTRO4_4 + 1);
runner.Append(MoviePlayerJob.CreateWithSoundinfo("vol42a.anm", soundinfo, 0, 14, 14, 14));
soundinfo.Pushv(
10, DukeSnd.INTRO4_6 + 1);
runner.Append(MoviePlayerJob.CreateWithSoundinfo("vol43a.anm", soundinfo, 0, 10, 10, 10));
runner.skipall = true;
}
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
static void BuildMPSummary(ScreenJobRunner runner, int playerswhenstarted)
{
runner.Append(new("DukeMultiplayerBonusScreen").Init(playerswhenstarted));
}
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
static void BuildSPSummary(ScreenJobRunner runner, MapRecord map, int kills_, int maxkills_, int secrets_, int maxsecrets_, int supersecrets_, int time_, bool cheated)
{
let screen = SummaryScreenBase(new("DukeLevelSummaryScreen").Init());
if (screen) screen.SetParameters(map, kills_, maxkills_, secrets_, maxsecrets_, supersecrets_, time_, cheated);
runner.Append(screen);
}
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
static void BuildSharewareExit(ScreenJobRunner runner)
{
runner.Append(ImageScreen.CreateNamed("SWEXIT1"));
runner.Append(ImageScreen.CreateNamed("SWEXIT2"));
}
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
static void BuildSharewareOrder(ScreenJobRunner runner)
{
runner.Append(ImageScreen.CreateNamed("ORDERING"));
runner.Append(ImageScreen.CreateNamed("ORDERING1"));
runner.Append(ImageScreen.CreateNamed("ORDERING2"));
runner.Append(ImageScreen.CreateNamed("ORDERING3"));
}
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
static void BuildLoading(ScreenJobRunner runner, MapRecord map)
{
runner.Append(new("DukeLoadScreen").Init(map));
}
} }

View file

@ -349,7 +349,7 @@ class ScreenJobRunner : Object
DeleteJobs(); DeleteJobs();
} }
void DeleteJobs() protected void DeleteJobs()
{ {
// Free all allocated resources now. // Free all allocated resources now.
for (int i = 0; i < jobs.Size(); i++) for (int i = 0; i < jobs.Size(); i++)
@ -359,13 +359,18 @@ class ScreenJobRunner : Object
jobs.Clear(); jobs.Clear();
} }
void Append(ScreenJob job)
{
jobs.Push(job);
}
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
// //
// //
// //
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
void AdvanceJob(bool skip) protected void AdvanceJob(bool skip)
{ {
if (index == jobs.Size()-1) if (index == jobs.Size()-1)
{ {