diff --git a/source/core/screenjob.cpp b/source/core/screenjob.cpp index f2417dc5b..8f132a5ee 100644 --- a/source/core/screenjob.cpp +++ b/source/core/screenjob.cpp @@ -125,14 +125,15 @@ class ScreenJobRunner int index = -1; float screenfade; bool clearbefore; + bool skipall; int actionState; int terminateState; int fadeticks = 0; int last_paused_tic = -1; public: - ScreenJobRunner(JobDesc* jobs_, int count, CompletionFunc completion_, bool clearbefore_) - : completion(std::move(completion_)), clearbefore(clearbefore_) + ScreenJobRunner(JobDesc* jobs_, int count, CompletionFunc completion_, bool clearbefore_, bool skipall_) + : completion(std::move(completion_)), clearbefore(clearbefore_), skipall(skipall_) { jobs.Resize(count); memcpy(jobs.Data(), jobs_, count * sizeof(JobDesc)); @@ -167,7 +168,7 @@ public: jobs[index].job->Destroy(); } index++; - while (index < jobs.Size() && (jobs[index].job == nullptr || (skip && jobs[index].ignoreifskipped))) + while (index < jobs.Size() && (jobs[index].job == nullptr || (skip && skipall))) { if (jobs[index].job != nullptr) jobs[index].job->Destroy(); index++; @@ -316,13 +317,13 @@ public: ScreenJobRunner *runner; -void RunScreenJob(JobDesc* jobs, int count, CompletionFunc completion, bool clearbefore, bool blockingui) +void RunScreenJob(JobDesc* jobs, int count, CompletionFunc completion, bool clearbefore, bool blockingui, bool skipall) { assert(completion != nullptr); videoclearFade(); if (count) { - runner = new ScreenJobRunner(jobs, count, completion, clearbefore); + runner = new ScreenJobRunner(jobs, count, completion, clearbefore, skipall); gameaction = blockingui? ga_intro : ga_intermission; } else diff --git a/source/core/screenjob.h b/source/core/screenjob.h index b0a48b058..7d90de300 100644 --- a/source/core/screenjob.h +++ b/source/core/screenjob.h @@ -135,11 +135,11 @@ struct JobDesc { DScreenJob* job; void (*postAction)(); - bool ignoreifskipped; + //bool ignoreifskipped; }; -void RunScreenJob(JobDesc *jobs, int count, CompletionFunc completion, bool clearbefore = true, bool blockingui = false); +void RunScreenJob(JobDesc *jobs, int count, CompletionFunc completion, bool clearbefore = true, bool blockingui = false, bool skipall = false); void EndScreenJob(); void DeleteScreenJob(); bool ScreenJobResponder(event_t* ev); diff --git a/source/games/duke/src/2d_d.cpp b/source/games/duke/src/2d_d.cpp index c26c7ad14..d3142086c 100644 --- a/source/games/duke/src/2d_d.cpp +++ b/source/games/duke/src/2d_d.cpp @@ -1129,9 +1129,9 @@ void e4intro(const CompletionFunc& completion) S_PlaySpecialMusic(MUS_BRIEFING); jobs[job++] = { PlayVideo("vol41a.anm", vol41a, framespeed_10), nullptr }; - jobs[job++] = { PlayVideo("vol42a.anm", vol42a, framespeed_14), nullptr, true }; - jobs[job++] = { PlayVideo("vol43a.anm", vol43a, framespeed_10), nullptr, true }; - RunScreenJob(jobs, job, completion); + jobs[job++] = { PlayVideo("vol42a.anm", vol42a, framespeed_14), nullptr }; + jobs[job++] = { PlayVideo("vol43a.anm", vol43a, framespeed_10), nullptr }; + RunScreenJob(jobs, job, completion, true, false, true); } //---------------------------------------------------------------------------