mirror of
https://git.do.srb2.org/STJr/SRB2.git
synced 2025-01-22 01:01:45 +00:00
Merge branch 'fix-perfstats-3' into 'next'
Fix incorrect values caused by outdated use of timing functions in perfstats 3 See merge request STJr/SRB2!1460
This commit is contained in:
commit
164fbeff91
3 changed files with 5 additions and 5 deletions
|
@ -473,7 +473,7 @@ void LUAh_ThinkFrame(void)
|
|||
hook_p hookp;
|
||||
// variables used by perf stats
|
||||
int hook_index = 0;
|
||||
int time_taken = 0;
|
||||
precise_t time_taken = 0;
|
||||
if (!gL || !(hooksAvailable[hook_ThinkFrame/8] & (1<<(hook_ThinkFrame%8))))
|
||||
return;
|
||||
|
||||
|
|
|
@ -62,7 +62,7 @@ int thinkframe_hooks_capacity = 16;
|
|||
|
||||
static INT32 draw_row;
|
||||
|
||||
void PS_SetThinkFrameHookInfo(int index, UINT32 time_taken, char* short_src)
|
||||
void PS_SetThinkFrameHookInfo(int index, precise_t time_taken, char* short_src)
|
||||
{
|
||||
if (!thinkframe_hooks)
|
||||
{
|
||||
|
@ -565,7 +565,7 @@ void M_DrawPerfStats(void)
|
|||
len = (int)strlen(str);
|
||||
if (len > 20)
|
||||
str += len - 20;
|
||||
snprintf(s, sizeof s - 1, "%20s: %u", str, thinkframe_hooks[i].time_taken);
|
||||
snprintf(s, sizeof s - 1, "%20s: %d", str, I_PreciseToMicros(thinkframe_hooks[i].time_taken));
|
||||
V_DrawSmallString(x, y, V_MONOSPACE | V_ALLOWLOWERCASE | text_color, s);
|
||||
y += 4; // repeated code!
|
||||
if (y > 192)
|
||||
|
|
|
@ -30,11 +30,11 @@ extern int ps_lua_mobjhooks;
|
|||
|
||||
typedef struct
|
||||
{
|
||||
UINT32 time_taken;
|
||||
precise_t time_taken;
|
||||
char short_src[LUA_IDSIZE];
|
||||
} ps_hookinfo_t;
|
||||
|
||||
void PS_SetThinkFrameHookInfo(int index, UINT32 time_taken, char* short_src);
|
||||
void PS_SetThinkFrameHookInfo(int index, precise_t time_taken, char* short_src);
|
||||
|
||||
void M_DrawPerfStats(void);
|
||||
|
||||
|
|
Loading…
Reference in a new issue