diff --git a/source/core/screenjob.cpp b/source/core/screenjob.cpp index a393cd2d9..9d57fabb8 100644 --- a/source/core/screenjob.cpp +++ b/source/core/screenjob.cpp @@ -259,15 +259,16 @@ public: DScreenJob *PlayVideo(const char* filename, const AnimSound* ans, const int* frameticks) { + auto nothing = []()->DScreenJob* { return Create(); }; if (!filename) { - return nullptr; + return nothing(); } auto fr = fileSystem.OpenFileReader(filename); if (!fr.isOpen()) { Printf("%s: Unable to open video\n", filename); - return nullptr; + return nothing(); } char id[20] = {}; @@ -281,7 +282,7 @@ DScreenJob *PlayVideo(const char* filename, const AnimSound* ans, const int* fra { Printf("%s: invalid ANM file.\n", filename); anm->Destroy(); - return nullptr; + return nothing(); } return anm; } @@ -298,6 +299,6 @@ DScreenJob *PlayVideo(const char* filename, const AnimSound* ans, const int* fra { Printf("%s: Unknown video format\n", filename); } - return nullptr; + return nothing(); } diff --git a/source/core/screenjob.h b/source/core/screenjob.h index cc12544f6..680183c63 100644 --- a/source/core/screenjob.h +++ b/source/core/screenjob.h @@ -33,7 +33,7 @@ public: return now; } - virtual int Frame(uint64_t clock, bool skiprequest) = 0; + virtual int Frame(uint64_t clock, bool skiprequest) { return 0; } }; //--------------------------------------------------------------------------- diff --git a/source/games/duke/src/2d_r.cpp b/source/games/duke/src/2d_r.cpp index eed134d8a..f22d40e16 100644 --- a/source/games/duke/src/2d_r.cpp +++ b/source/games/duke/src/2d_r.cpp @@ -360,7 +360,7 @@ class DRRLevelSummaryScreen : public DScreenJob } public: - DRRLevelSummaryScreen(bool dofadein = true) : DScreenJob(dofadein? (fadein | fadeout) : fadeout) + DRRLevelSummaryScreen(bool dofadeout = true) : DScreenJob(dofadeout? (fadein | fadeout) : fadein) { PlayBonusMusic(); if (boardfilename[0]) @@ -577,9 +577,9 @@ void dobonus_r(bool bonusonly, CompletionFunc completion) } else if (!bonusonly && ud.multimode <= 1) { - jobs[job++] = { Create() }; if (isRRRA() && !boardfilename[0] && currentLevel->levelNumber < 106) // fixme: The logic here is awful. Shift more control to the map records. { + jobs[job++] = { Create(true) }; int levnum = clamp((currentLevel->levelNumber / 100) * 7 + (currentLevel->levelNumber % 100), 0, 13); char fn[20]; mysnprintf(fn, 20, "lvl%d.anm", levnum + 1); @@ -590,7 +590,7 @@ void dobonus_r(bool bonusonly, CompletionFunc completion) jobs[job++] = { Create() }; } } - + else jobs[job++] = { Create(false) }; } if (job) RunScreenJob(jobs, job, completion);