From e0b4dde3cdfb393de65e1f2785584d036db38c6b Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Sat, 5 Sep 2020 15:59:32 +0200 Subject: [PATCH] - fixed: A screen job that fades out was not rendering its final (black) frame which could result in visual glitches. Fixes #320 --- source/common/2d/v_2ddrawer.h | 5 +++++ source/core/mainloop.cpp | 3 ++- source/core/screenjob.cpp | 1 + 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/source/common/2d/v_2ddrawer.h b/source/common/2d/v_2ddrawer.h index 93fdccd86..b496234d6 100644 --- a/source/common/2d/v_2ddrawer.h +++ b/source/common/2d/v_2ddrawer.h @@ -215,6 +215,11 @@ public: void SetClipRect(int x, int y, int w, int h); void GetClipRect(int* x, int* y, int* w, int* h); + int DrawCount() const + { + return mData.Size(); + } + bool mIsFirstPass = true; }; diff --git a/source/core/mainloop.cpp b/source/core/mainloop.cpp index 263c243a3..95ec1233e 100644 --- a/source/core/mainloop.cpp +++ b/source/core/mainloop.cpp @@ -347,8 +347,9 @@ void Display() twodpsp.SetSize(screen->GetWidth(), screen->GetHeight()); gi->Render(); DrawFullscreenBlends(); + break; } - break; + [[fallthrough]]; default: twod->ClearScreen(); diff --git a/source/core/screenjob.cpp b/source/core/screenjob.cpp index 82ccf0589..ba3d0f5ce 100644 --- a/source/core/screenjob.cpp +++ b/source/core/screenjob.cpp @@ -681,6 +681,7 @@ public: { DeleteJobs(); twod->SetScreenFade(1); + twod->ClearScreen(); // This must not leave the 2d buffer empty. if (completion) completion(false); return false; }