- some final fixes.

This commit is contained in:
Christoph Oelckers 2020-07-01 22:27:38 +02:00
parent c09b4896a6
commit b281c34357
3 changed files with 9 additions and 8 deletions

View file

@ -259,15 +259,16 @@ public:
DScreenJob *PlayVideo(const char* filename, const AnimSound* ans, const int* frameticks)
{
auto nothing = []()->DScreenJob* { return Create<DScreenJob>(); };
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();
}

View file

@ -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; }
};
//---------------------------------------------------------------------------

View file

@ -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<DRRLevelSummaryScreen>() };
if (isRRRA() && !boardfilename[0] && currentLevel->levelNumber < 106) // fixme: The logic here is awful. Shift more control to the map records.
{
jobs[job++] = { Create<DRRLevelSummaryScreen>(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<DRRRAEndOfGame>() };
}
}
else jobs[job++] = { Create<DRRLevelSummaryScreen>(false) };
}
if (job)
RunScreenJob(jobs, job, completion);