mirror of
https://github.com/ZDoom/raze-gles.git
synced 2024-12-25 03:00:46 +00:00
screens.cpp: Show average game update time over the last 100 game updates
git-svn-id: https://svn.eduke32.com/eduke32@6963 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
parent
bf043adb73
commit
448dd1cd01
4 changed files with 8 additions and 1 deletions
|
@ -6770,6 +6770,9 @@ MAIN_LOOP_RESTART:
|
|||
|
||||
gameUpdate = true;
|
||||
g_gameUpdateTime = timerGetTicks()-gameUpdateStartTime;
|
||||
if (g_gameUpdateAvgTime < 0.f)
|
||||
g_gameUpdateAvgTime = g_gameUpdateTime;
|
||||
g_gameUpdateAvgTime = ((GAMEUPDATEAVGTIMENUMSAMPLES-1.f)*g_gameUpdateAvgTime+g_gameUpdateTime)/((float) GAMEUPDATEAVGTIMENUMSAMPLES);
|
||||
}
|
||||
|
||||
G_DoCheats();
|
||||
|
|
|
@ -90,6 +90,8 @@ int32_t g_gametypeFlags[MAXGAMETYPES] =
|
|||
GAMETYPE_TDMSPAWN,
|
||||
};
|
||||
|
||||
float g_gameUpdateAvgTime = -1.f;
|
||||
|
||||
int32_t g_actorRespawnTime = 768;
|
||||
int32_t g_bouncemineRadius = 2500;
|
||||
int32_t g_deleteQueueSize = 64;
|
||||
|
|
|
@ -163,6 +163,8 @@ G_EXTERN uint32_t everyothertime;
|
|||
G_EXTERN uint32_t g_moveThingsCount;
|
||||
G_EXTERN uint32_t g_gameUpdateTime;
|
||||
G_EXTERN uint32_t g_gameUpdateAndDrawTime;
|
||||
#define GAMEUPDATEAVGTIMENUMSAMPLES 100
|
||||
extern float g_gameUpdateAvgTime;
|
||||
|
||||
#ifndef global_c_
|
||||
extern char CheatKeys[2];
|
||||
|
|
|
@ -837,7 +837,7 @@ static void G_PrintFPS(void)
|
|||
printext256(windowxy2.x-(chars<<(3-x)), windowxy1.y+30+FPS_YOFFSET,
|
||||
FPS_COLOR(g_gameUpdateAndDrawTime >= SLOW_FRAME_TIME), -1, tempbuf, x);
|
||||
|
||||
chars = Bsprintf(tempbuf, "Min Game Update: %2d ms Max Game Update: %2d ms", minGameUpdate, maxGameUpdate);
|
||||
chars = Bsprintf(tempbuf, "Min GU: %2d ms Max GU: %2d ms Avg GU: %5.2f ms", minGameUpdate, maxGameUpdate, g_gameUpdateAvgTime);
|
||||
|
||||
printext256(windowxy2.x-(chars<<(3-x))+1, windowxy1.y+40+2+FPS_YOFFSET, 0, -1, tempbuf, x);
|
||||
printext256(windowxy2.x-(chars<<(3-x)), windowxy1.y+40+FPS_YOFFSET,
|
||||
|
|
Loading…
Reference in a new issue