mirror of
https://github.com/ZDoom/raze-gles.git
synced 2025-01-27 09:20:51 +00:00
- SW load screen setup.
This commit is contained in:
parent
b52a2b0d9a
commit
0c55c61b17
1 changed files with 8 additions and 10 deletions
|
@ -630,11 +630,10 @@ void SybexScreen(CompletionFunc completion)
|
|||
|
||||
class DSWLoadScreen : public DScreenJob
|
||||
{
|
||||
std::function<int(void)> callback;
|
||||
MapRecord* rec;
|
||||
|
||||
public:
|
||||
DSWLoadScreen(MapRecord* maprec, std::function<int(void)> callback_) : DScreenJob(fadein | fadeout), callback(callback_), rec(maprec) {}
|
||||
DSWLoadScreen(MapRecord* maprec) : DScreenJob(0), rec(maprec) {}
|
||||
|
||||
int Frame(uint64_t clock, bool skiprequest)
|
||||
{
|
||||
|
@ -645,15 +644,14 @@ public:
|
|||
MNU_DrawString(160, 170, /*DemoMode ? GStrings("TXT_LBDEMO") :*/ GStrings("TXT_ENTERING"), 1, 16, 0);
|
||||
MNU_DrawString(160, 180, rec->DisplayName(), 1, 16, 0);
|
||||
|
||||
// Initiate the level load once the page has been faded in completely.
|
||||
if (callback && GetFadeState() == visible)
|
||||
{
|
||||
callback();
|
||||
callback = nullptr;
|
||||
}
|
||||
if (clock > 5'000'000'000) return 0; // make sure the screen stays long enough to be seen.
|
||||
return skiprequest ? -1 : 1;
|
||||
return 0;
|
||||
}
|
||||
};
|
||||
|
||||
void loadscreen(MapRecord* rec, CompletionFunc func)
|
||||
{
|
||||
JobDesc job = { Create<DSWLoadScreen>(rec) };
|
||||
RunScreenJob(&job, 1, func);
|
||||
}
|
||||
|
||||
END_SW_NS
|
||||
|
|
Loading…
Reference in a new issue