2023-09-08 19:41:57 +07:00
|
|
|
|
//========= Copyright <20> 1996-2005, Valve Corporation, All rights reserved. ============//
|
2010-07-22 01:46:14 -05:00
|
|
|
|
//
|
|
|
|
|
// Purpose:
|
|
|
|
|
//
|
|
|
|
|
//=============================================================================//
|
|
|
|
|
|
|
|
|
|
#ifndef GLOBALVARS_BASE_H
|
|
|
|
|
#define GLOBALVARS_BASE_H
|
|
|
|
|
|
|
|
|
|
#ifdef _WIN32
|
|
|
|
|
#pragma once
|
|
|
|
|
#endif
|
|
|
|
|
|
2023-09-08 19:41:57 +07:00
|
|
|
|
enum GlobalVarsUsageWarning_t
|
|
|
|
|
{
|
|
|
|
|
GV_RENDERTIME_CALLED_DURING_SIMULATION,
|
|
|
|
|
GV_CURTIME_CALLED_DURING_RENDERING
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
typedef void (*FnGlobalVarsWarningFunc)(GlobalVarsUsageWarning_t);
|
2010-07-22 01:46:14 -05:00
|
|
|
|
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
// Purpose: Global variables used by shared code
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
class CGlobalVarsBase
|
|
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
|
2023-09-08 19:41:57 +07:00
|
|
|
|
CGlobalVarsBase();
|
2010-07-22 01:46:14 -05:00
|
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
// Absolute time (per frame still - Use Plat_FloatTime() for a high precision real time
|
|
|
|
|
// perf clock, but not that it doesn't obey host_timescale/host_framerate)
|
2023-09-08 19:41:57 +07:00
|
|
|
|
float realtime;
|
2010-07-22 01:46:14 -05:00
|
|
|
|
// Absolute frame counter - continues to increase even if game is paused
|
2023-09-08 19:41:57 +07:00
|
|
|
|
int framecount;
|
|
|
|
|
|
2010-07-22 01:46:14 -05:00
|
|
|
|
// Non-paused frametime
|
2023-09-08 19:41:57 +07:00
|
|
|
|
float absoluteframetime;
|
|
|
|
|
float absoluteframestarttimestddev;
|
|
|
|
|
|
|
|
|
|
int maxClients;
|
|
|
|
|
|
|
|
|
|
// zer0k: Command queue related
|
|
|
|
|
int unknown1;
|
|
|
|
|
int unknown2;
|
2024-05-24 05:48:58 +03:00
|
|
|
|
int unknown3;
|
|
|
|
|
int unknown4;
|
|
|
|
|
int unknown5;
|
2023-09-08 19:41:57 +07:00
|
|
|
|
|
|
|
|
|
FnGlobalVarsWarningFunc m_pfnWarningFunc;
|
|
|
|
|
|
|
|
|
|
// Time spent on last server or client frame (has nothing to do with think intervals)
|
|
|
|
|
float frametime;
|
2010-07-22 01:46:14 -05:00
|
|
|
|
|
|
|
|
|
// Current time
|
|
|
|
|
//
|
|
|
|
|
// On the client, this (along with tickcount) takes a different meaning based on what
|
|
|
|
|
// piece of code you're in:
|
|
|
|
|
//
|
|
|
|
|
// - While receiving network packets (like in PreDataUpdate/PostDataUpdate and proxies),
|
|
|
|
|
// this is set to the SERVER TICKCOUNT for that packet. There is no interval between
|
|
|
|
|
// the server ticks.
|
|
|
|
|
// [server_current_Tick * tick_interval]
|
|
|
|
|
//
|
|
|
|
|
// - While rendering, this is the exact client clock
|
|
|
|
|
// [client_current_tick * tick_interval + interpolation_amount]
|
|
|
|
|
//
|
|
|
|
|
// - During prediction, this is based on the client's current tick:
|
|
|
|
|
// [client_current_tick * tick_interval]
|
2023-09-08 19:41:57 +07:00
|
|
|
|
float curtime;
|
|
|
|
|
float rendertime;
|
2010-07-22 01:46:14 -05:00
|
|
|
|
|
2023-09-08 19:41:57 +07:00
|
|
|
|
// zer0k: Command queue + interpolation related
|
2024-05-24 05:48:58 +03:00
|
|
|
|
float unknown6;
|
|
|
|
|
float unknown7;
|
2010-07-22 01:46:14 -05:00
|
|
|
|
|
2023-09-08 19:41:57 +07:00
|
|
|
|
bool m_bInSimulation;
|
|
|
|
|
bool m_bEnableAssertions;
|
2010-07-22 01:46:14 -05:00
|
|
|
|
|
2023-09-08 19:41:57 +07:00
|
|
|
|
// Simulation ticks - does not increase when game is paused
|
|
|
|
|
int tickcount;
|
2024-02-10 09:17:18 +01:00
|
|
|
|
// Non-zero when during movement processing, it's the part after the decimal point of the "when" field in player's subtick moves.
|
|
|
|
|
float m_flSubtickFraction;
|
2010-07-22 01:46:14 -05:00
|
|
|
|
};
|
|
|
|
|
|
2023-09-08 19:41:57 +07:00
|
|
|
|
inline CGlobalVarsBase::CGlobalVarsBase()
|
2010-07-22 01:46:14 -05:00
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#endif // GLOBALVARS_BASE_H
|