From 1646e302d25178b097cdf20ab5a6045de19bce6f Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Fri, 11 Sep 2020 20:55:58 +0200 Subject: [PATCH] - fixed screenjob fadeout. --- source/core/screenjob.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/source/core/screenjob.cpp b/source/core/screenjob.cpp index f5dbff53d..b46797c2a 100644 --- a/source/core/screenjob.cpp +++ b/source/core/screenjob.cpp @@ -791,7 +791,11 @@ public: { auto now = I_GetTimeNS(); - if (!M_Active()) + if (startTime == -1) + { + lastTime = startTime = now; + } + else if (!M_Active()) { clock += now - lastTime; if (clock == 0) clock = 1; @@ -833,7 +837,8 @@ public: if (jobs[index].job->fadestyle & DScreenJob::fadeout) { twod->Lock(); - startTime = I_nsTime(); + startTime = -1; + clock = 0; jobs[index].job->fadestate = DScreenJob::fadeout; actionState = State_Fadeout; } @@ -846,6 +851,7 @@ public: else if (actionState == State_Fadeout) { int ended = FadeoutFrame(); + Printf("fadeout = %d\n", ended); if (ended < 1) { AdvanceJob(terminateState < 0);