- tested all of Duke's and RR's cutscenes.

This commit is contained in:
Christoph Oelckers 2021-04-27 00:01:25 +02:00
parent 06abc0cfe2
commit 3c27ec8cbd
13 changed files with 86 additions and 56 deletions

View file

@ -138,6 +138,10 @@ void S_StopCustomStream(SoundStream *stream)
void S_PauseAllCustomStreams(bool on)
{
static bool paused = false;
if (paused == on) return;
paused = on;
for (auto s : customStreams)
{
s->SetPaused(on);

View file

@ -416,10 +416,8 @@ DEFINE_ACTION_FUNCTION_NATIVE(FDynArray_I32, Push, ArrayPush<FDynArray_I32 COMMA
DEFINE_ACTION_FUNCTION(FDynArray_I32, PushV)
{
PARAM_SELF_STRUCT_PROLOGUE(FDynArray_I32);
PARAM_INT(val);
PARAM_VA_POINTER(va_reginfo); // Get the hidden type information array
self->Push(val);
VMVa_List args = { param + 3, 0, numparam - 4, va_reginfo + 3 };
VMVa_List args = { param + 1, 0, numparam - 2, va_reginfo + 1 };
while (args.curindex < args.numargs)
{
if (args.reginfo[args.curindex] == REGT_INT)

View file

@ -337,8 +337,7 @@ DEFINE_ACTION_FUNCTION(_TexMan, GetName)
static int CheckForTexture(const FString& name, int type, int flags)
{
// ForceLookup is intentionally blocked here, this flag is for internal use only.
return TexMan.CheckForTexture(name, static_cast<ETextureType>(type), (flags & ~FTextureManager::TEXMAN_ForceLookup)).GetIndex();
return TexMan.CheckForTexture(name, static_cast<ETextureType>(type), flags).GetIndex();
}
DEFINE_ACTION_FUNCTION_NATIVE(_TexMan, CheckForTexture, CheckForTexture)

View file

@ -223,6 +223,13 @@ bool StartCutscene(CutsceneDef& cs, int flags, CompletionFunc completion_)
return false;
}
bool StartCutscene(const char* s, int flags, CompletionFunc completion)
{
CutsceneDef def;
def.function = s;
return StartCutscene(def, 0, completion);
}
void DeleteScreenJob()
{
@ -311,6 +318,28 @@ void PlayLogos(gameaction_t complete_ga, gameaction_t def_ga, bool stopmusic)
}
}
CCMD(testcutscene)
{
if (argv.argc() < 2)
{
Printf("Usage: testcutscene <buildfunction>\n");
return;
}
try
{
CutsceneDef def;
def.function = argv[1];
if (StartCutscene(def, 0, [](bool) { }))
{
C_HideConsole();
}
}
catch (const CRecoverableError& err)
{
Printf("Unable to play cutscene\n");
}
}
/*
Duke:
if (!userConfig.nologo) fi.ShowLogo([](bool) { gameaction = ga_mainmenunostopsound; });

View file

@ -200,4 +200,7 @@ bool ScreenJobResponder(event_t* ev);
bool ScreenJobTick();
void ScreenJobDraw();
struct CutsceneDef;
bool StartCutscene(CutsceneDef& cs, int flags, CompletionFunc completion);
bool StartCutscene(const char* s, int flags, CompletionFunc completion);
void PlayLogos(gameaction_t complete_ga, gameaction_t def_ga, bool stopmusic);

View file

@ -145,34 +145,6 @@ static void BigText(double x, double y, const char* text, int align = -1, double
DrawText(twod, BigFont, CR_UNTRANSLATED, x, y - 12, text, DTA_FullscreenScale, FSMode_Fit320x200, DTA_Alpha, alpha, TAG_DONE);
}
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
void showtwoscreens(const CompletionFunc& completion)
{
#if 0
TArray<DScreenJob*> jobs;
jobs.Push(Create<DImageScreen>(3291));
jobs.Push(Create<DImageScreen>(3290));
RunScreenJob(jobs, completion);
#endif
}
void doorders(const CompletionFunc& completion)
{
#if 0
TArray<DScreenJob*> jobs;
for (int i = 0; i < 4; i++)
jobs.Push(Create<DImageScreen>(ORDERING + i));
RunScreenJob(jobs, completion);
#endif
}
//---------------------------------------------------------------------------
//
//

View file

@ -162,9 +162,6 @@ int hits(DDukeActor* snum);
DDukeActor* LocateTheLocator(int n, int sectnum);
void clearcamera(player_struct* ps);
void showtwoscreens(const CompletionFunc& func);
void doorders(const CompletionFunc& func);
void LoadActor(DDukeActor* i, int p, int x);
void execute(DDukeActor* s, int p, int d);
void makeitfall(DDukeActor* s);

View file

@ -94,20 +94,20 @@ void GameInterface::ExitFromMenu()
{
auto runbonus = [=](auto completion)
{
// MP scoreboard
// MP scoreboard
if (playerswhenstarted > 1 && !ud.coop)
{
dobonus(1, completion);
}
else completion(false);
{
dobonus(1, completion);
}
else completion(false);
};
auto runtwoscreens = [](auto completion)
{
// shareware and TEN screens
if (isShareware() && !isRR())
showtwoscreens(completion);
else completion(false);
// shareware and TEN screens
if (isShareware() && !isRR())
StartCutscene("DukeCutscenes.BuildSharewareExit", 0, completion);
else completion(false);
};
runbonus([=](bool aborted) { runtwoscreens(endthegame); });

View file

@ -926,7 +926,6 @@ void enterlevel(MapRecord *mi, int gamemode)
OnEvent(EVENT_ENTERLEVEL);
// Stop all sounds
S_ResumeSound(false);
FX_StopAllSounds();
FX_SetReverb(0);
@ -1078,7 +1077,7 @@ void exitlevel(MapRecord *nextlevel)
if (ud.multimode < 2)
{
if (isShareware())
doorders([](bool) { gameaction = ga_startup; });
StartCutscene("DukeCutscenes.BuildSharewareOrder", 0, [](bool) { gameaction = ga_startup; });
else gameaction = ga_startup;
return;
}