From 0c55c61b17c0938c248ca8cfceaabd1a2d0a7101 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Wed, 9 Sep 2020 23:10:18 +0200 Subject: [PATCH] - SW load screen setup. --- source/sw/src/2d.cpp | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/source/sw/src/2d.cpp b/source/sw/src/2d.cpp index 7352a43a2..9b1d69aba 100644 --- a/source/sw/src/2d.cpp +++ b/source/sw/src/2d.cpp @@ -630,11 +630,10 @@ void SybexScreen(CompletionFunc completion) class DSWLoadScreen : public DScreenJob { - std::function callback; MapRecord* rec; public: - DSWLoadScreen(MapRecord* maprec, std::function 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(rec) }; + RunScreenJob(&job, 1, func); +} + END_SW_NS