- statFPS() doesn't need to be in GameInterface.

This commit is contained in:
Mitchell Richters 2023-10-31 14:38:30 +11:00
parent 2797919f2c
commit 5220a57f78
3 changed files with 8 additions and 21 deletions

View file

@ -15,6 +15,8 @@
EXTERN_CVAR(Bool, hud_textfont)
extern cycle_t drawtime, actortime, thinktime, gameupdatetime;
extern bool sendsave;
extern FString savedescription;
extern FString savegamefile;

View file

@ -246,7 +246,12 @@ CUSTOM_CVARD(Int, r_drawweapon, 1, CVAR_ARCHIVE|CVAR_GLOBALCONFIG, "enable/disab
ADD_STAT(fps)
{
return gi->statFPS();
FString output;
output.AppendFormat("Actor think time: %.3f ms\n", actortime.TimeMS());
output.AppendFormat("Total think time: %.3f ms\n", thinktime.TimeMS());
output.AppendFormat("Game Update: %.3f ms\n", gameupdatetime.TimeMS());
output.AppendFormat("Draw time: %.3f ms\n", drawtime.TimeMS());
return output;
}
CUSTOM_CVARD(Int, r_showfps, 0, 0, "show the frame rate counter")

View file

@ -43,8 +43,6 @@ enum EMenuSounds : int;
struct MapRecord;
struct TilesetBuildInfo;
extern cycle_t drawtime, actortime, thinktime, gameupdatetime;
struct GeoEffect
{
sectortype** geosectorwarp;
@ -114,24 +112,6 @@ struct GameInterface
virtual void StartSoundEngine() = 0;
virtual void doPlayerMovement();
virtual unsigned getCrouchState() = 0;
virtual FString statFPS()
{
FString output;
output.AppendFormat("Actor think time: %.3f ms\n", actortime.TimeMS());
output.AppendFormat("Total think time: %.3f ms\n", thinktime.TimeMS());
output.AppendFormat("Game Update: %.3f ms\n", gameupdatetime.TimeMS());
output.AppendFormat("Draw time: %.3f ms\n", drawtime.TimeMS());
return output;
}
};
extern GameInterface* gi;
void ImGui_Begin_Frame();