mirror of
https://github.com/ZDoom/raze-gles.git
synced 2025-02-05 13:20:56 +00:00
- gameclock must also be set before calling gi->Render.
This runs at the display's frame rate so the timer value from the Ticker call is not precise enough to do all the work.
This commit is contained in:
parent
5daaa1fc06
commit
98557947da
1 changed files with 6 additions and 2 deletions
|
@ -82,6 +82,7 @@
|
||||||
#include "glbackend/glbackend.h"
|
#include "glbackend/glbackend.h"
|
||||||
#include "palette.h"
|
#include "palette.h"
|
||||||
#include "build.h"
|
#include "build.h"
|
||||||
|
#include "g_input.h"
|
||||||
|
|
||||||
CVAR(Bool, vid_activeinbackground, false, CVAR_ARCHIVE | CVAR_GLOBALCONFIG)
|
CVAR(Bool, vid_activeinbackground, false, CVAR_ARCHIVE | CVAR_GLOBALCONFIG)
|
||||||
CVAR(Bool, r_ticstability, true, CVAR_ARCHIVE | CVAR_GLOBALCONFIG)
|
CVAR(Bool, r_ticstability, true, CVAR_ARCHIVE | CVAR_GLOBALCONFIG)
|
||||||
|
@ -107,6 +108,7 @@ int gametic;
|
||||||
|
|
||||||
void G_BuildTiccmd(ticcmd_t* cmd)
|
void G_BuildTiccmd(ticcmd_t* cmd)
|
||||||
{
|
{
|
||||||
|
I_GetEvent();
|
||||||
gi->GetInput(&cmd->ucmd);
|
gi->GetInput(&cmd->ucmd);
|
||||||
cmd->consistancy = consistancy[myconnectindex][(maketic / ticdup) % BACKUPTICS];
|
cmd->consistancy = consistancy[myconnectindex][(maketic / ticdup) % BACKUPTICS];
|
||||||
}
|
}
|
||||||
|
@ -192,7 +194,7 @@ static void GameTicker()
|
||||||
case GS_LEVEL:
|
case GS_LEVEL:
|
||||||
gameupdatetime.Reset();
|
gameupdatetime.Reset();
|
||||||
gameupdatetime.Clock();
|
gameupdatetime.Clock();
|
||||||
gameclock += 120 / GameTicRate;
|
gameclock = I_GetBuildTime() - gameclockstart;
|
||||||
gi->Ticker();
|
gi->Ticker();
|
||||||
gameupdatetime.Unclock();
|
gameupdatetime.Unclock();
|
||||||
break;
|
break;
|
||||||
|
@ -246,6 +248,7 @@ void Display()
|
||||||
twod->Clear();
|
twod->Clear();
|
||||||
twod->SetSize(screen->GetWidth(), screen->GetHeight());
|
twod->SetSize(screen->GetWidth(), screen->GetHeight());
|
||||||
twodpsp.SetSize(screen->GetWidth(), screen->GetHeight());
|
twodpsp.SetSize(screen->GetWidth(), screen->GetHeight());
|
||||||
|
gameclock = I_GetBuildTime() - gameclockstart;
|
||||||
gi->Render();
|
gi->Render();
|
||||||
DrawFullscreenBlends();
|
DrawFullscreenBlends();
|
||||||
}
|
}
|
||||||
|
@ -390,6 +393,7 @@ void TryRunTics (void)
|
||||||
}
|
}
|
||||||
if (!cl_syncinput)
|
if (!cl_syncinput)
|
||||||
{
|
{
|
||||||
|
I_GetEvent();
|
||||||
gi->GetInput(nullptr);
|
gi->GetInput(nullptr);
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
|
@ -507,9 +511,9 @@ void MainLoop ()
|
||||||
}
|
}
|
||||||
I_SetFrameTime();
|
I_SetFrameTime();
|
||||||
|
|
||||||
I_StartTic ();
|
|
||||||
TryRunTics (); // will run at least one tic
|
TryRunTics (); // will run at least one tic
|
||||||
// Update display, next frame, with current state.
|
// Update display, next frame, with current state.
|
||||||
|
I_StartTic();
|
||||||
|
|
||||||
Display();
|
Display();
|
||||||
Mus_UpdateMusic(); // must be at the end.
|
Mus_UpdateMusic(); // must be at the end.
|
||||||
|
|
Loading…
Reference in a new issue