Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
SRB2
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Terraform modules
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
John Peter Sa
SRB2
Commits
3670af5a
Commit
3670af5a
authored
Apr 15, 2021
by
Hannu Hanhi
Browse files
Options
Downloads
Patches
Plain Diff
Fix incorrect values caused by outdated use of timing functions in perfstats 3
parent
99c773f3
No related branches found
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/lua_hooklib.c
+1
-1
1 addition, 1 deletion
src/lua_hooklib.c
src/m_perfstats.c
+2
-2
2 additions, 2 deletions
src/m_perfstats.c
src/m_perfstats.h
+2
-2
2 additions, 2 deletions
src/m_perfstats.h
with
5 additions
and
5 deletions
src/lua_hooklib.c
+
1
−
1
View file @
3670af5a
...
@@ -473,7 +473,7 @@ void LUAh_ThinkFrame(void)
...
@@ -473,7 +473,7 @@ void LUAh_ThinkFrame(void)
hook_p
hookp
;
hook_p
hookp
;
// variables used by perf stats
// variables used by perf stats
int
hook_index
=
0
;
int
hook_index
=
0
;
in
t
time_taken
=
0
;
precise_
t
time_taken
=
0
;
if
(
!
gL
||
!
(
hooksAvailable
[
hook_ThinkFrame
/
8
]
&
(
1
<<
(
hook_ThinkFrame
%
8
))))
if
(
!
gL
||
!
(
hooksAvailable
[
hook_ThinkFrame
/
8
]
&
(
1
<<
(
hook_ThinkFrame
%
8
))))
return
;
return
;
...
...
This diff is collapsed.
Click to expand it.
src/m_perfstats.c
+
2
−
2
View file @
3670af5a
...
@@ -62,7 +62,7 @@ int thinkframe_hooks_capacity = 16;
...
@@ -62,7 +62,7 @@ int thinkframe_hooks_capacity = 16;
static
INT32
draw_row
;
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
)
if
(
!
thinkframe_hooks
)
{
{
...
@@ -565,7 +565,7 @@ void M_DrawPerfStats(void)
...
@@ -565,7 +565,7 @@ void M_DrawPerfStats(void)
len
=
(
int
)
strlen
(
str
);
len
=
(
int
)
strlen
(
str
);
if
(
len
>
20
)
if
(
len
>
20
)
str
+=
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
);
V_DrawSmallString
(
x
,
y
,
V_MONOSPACE
|
V_ALLOWLOWERCASE
|
text_color
,
s
);
y
+=
4
;
// repeated code!
y
+=
4
;
// repeated code!
if
(
y
>
192
)
if
(
y
>
192
)
...
...
This diff is collapsed.
Click to expand it.
src/m_perfstats.h
+
2
−
2
View file @
3670af5a
...
@@ -30,11 +30,11 @@ extern int ps_lua_mobjhooks;
...
@@ -30,11 +30,11 @@ extern int ps_lua_mobjhooks;
typedef
struct
typedef
struct
{
{
UINT32
time_taken
;
precise_t
time_taken
;
char
short_src
[
LUA_IDSIZE
];
char
short_src
[
LUA_IDSIZE
];
}
ps_hookinfo_t
;
}
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
);
void
M_DrawPerfStats
(
void
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment