mirror of
https://github.com/ZDoom/raze-gles.git
synced 2024-12-30 13:21:04 +00:00
parent
e0b4dde3cd
commit
9af093b818
2 changed files with 13 additions and 10 deletions
|
@ -575,6 +575,7 @@ class ScreenJobRunner
|
||||||
int64_t lastTime = -1;
|
int64_t lastTime = -1;
|
||||||
int actionState;
|
int actionState;
|
||||||
int terminateState;
|
int terminateState;
|
||||||
|
uint64_t clock = 0;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
ScreenJobRunner(JobDesc* jobs_, int count, CompletionFunc completion_, bool clearbefore_)
|
ScreenJobRunner(JobDesc* jobs_, int count, CompletionFunc completion_, bool clearbefore_)
|
||||||
|
@ -630,15 +631,17 @@ public:
|
||||||
auto now = I_nsTime();
|
auto now = I_nsTime();
|
||||||
bool processed = job.job->ProcessInput();
|
bool processed = job.job->ProcessInput();
|
||||||
bool skiprequest = inputState.CheckAllInput() && !processed;
|
bool skiprequest = inputState.CheckAllInput() && !processed;
|
||||||
if (startTime == -1) lastTime = startTime = now;
|
if (startTime == -1)
|
||||||
|
|
||||||
if (M_Active())
|
|
||||||
{
|
{
|
||||||
startTime += now - lastTime;
|
lastTime = startTime = now;
|
||||||
|
}
|
||||||
|
else if (!M_Active())
|
||||||
|
{
|
||||||
|
clock += now - lastTime;
|
||||||
|
if (clock == 0) clock = 1;
|
||||||
}
|
}
|
||||||
lastTime = now;
|
lastTime = now;
|
||||||
|
|
||||||
auto clock = now - startTime;
|
|
||||||
if (screenfade < 1.f)
|
if (screenfade < 1.f)
|
||||||
{
|
{
|
||||||
float ms = (clock / 1'000'000) / job.job->fadetime;
|
float ms = (clock / 1'000'000) / job.job->fadetime;
|
||||||
|
@ -649,7 +652,8 @@ public:
|
||||||
else job.job->fadestate = DScreenJob::visible;
|
else job.job->fadestate = DScreenJob::visible;
|
||||||
job.job->SetClock(clock);
|
job.job->SetClock(clock);
|
||||||
int state = job.job->Frame(clock, skiprequest);
|
int state = job.job->Frame(clock, skiprequest);
|
||||||
startTime -= job.job->GetClock() - clock;
|
clock = job.job->GetClock();
|
||||||
|
if (clock == 0) clock = 1;
|
||||||
return state;
|
return state;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -657,13 +661,13 @@ public:
|
||||||
{
|
{
|
||||||
auto now = I_nsTime();
|
auto now = I_nsTime();
|
||||||
|
|
||||||
if (M_Active())
|
if (!M_Active())
|
||||||
{
|
{
|
||||||
startTime += now - lastTime;
|
clock += now - lastTime;
|
||||||
|
if (clock == 0) clock = 1;
|
||||||
}
|
}
|
||||||
lastTime = now;
|
lastTime = now;
|
||||||
|
|
||||||
auto clock = now - startTime;
|
|
||||||
float ms = (clock / 1'000'000) / jobs[index].job->fadetime;
|
float ms = (clock / 1'000'000) / jobs[index].job->fadetime;
|
||||||
float screenfade2 = clamp(screenfade - ms, 0.f, 1.f);
|
float screenfade2 = clamp(screenfade - ms, 0.f, 1.f);
|
||||||
if (!M_Active()) twod->SetScreenFade(screenfade2);
|
if (!M_Active()) twod->SetScreenFade(screenfade2);
|
||||||
|
|
|
@ -879,7 +879,6 @@ public:
|
||||||
|
|
||||||
int Frame(uint64_t clock, bool skiprequest)
|
int Frame(uint64_t clock, bool skiprequest)
|
||||||
{
|
{
|
||||||
Printf("Clock = %llu\n", clock);
|
|
||||||
if (clock == 0) S_PlayBonusMusic();
|
if (clock == 0) S_PlayBonusMusic();
|
||||||
twod->ClearScreen();
|
twod->ClearScreen();
|
||||||
int currentclock = int(clock * 120 / 1'000'000'000);
|
int currentclock = int(clock * 120 / 1'000'000'000);
|
||||||
|
|
Loading…
Reference in a new issue