mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-10 10:08:18 +00:00
Simplify TickSpeed getters
This commit is contained in:
parent
b9fd612ef5
commit
9627e7b3a8
|
@ -87,8 +87,6 @@ protected:
|
|||
float m_GlobalTime;
|
||||
float m_RenderFrameTime;
|
||||
|
||||
int m_GameTickSpeed;
|
||||
|
||||
float m_FrameTimeAvg;
|
||||
|
||||
TMapLoadingCallbackFunc m_MapLoadingCBFunc;
|
||||
|
@ -141,7 +139,7 @@ public:
|
|||
inline float PredIntraGameTick(int Conn) const { return m_aPredIntraTick[Conn]; }
|
||||
inline float IntraGameTickSincePrev(int Conn) const { return m_aGameIntraTickSincePrev[Conn]; }
|
||||
inline float GameTickTime(int Conn) const { return m_aGameTickTime[Conn]; }
|
||||
inline int GameTickSpeed() const { return m_GameTickSpeed; }
|
||||
inline int GameTickSpeed() const { return SERVER_TICK_SPEED; }
|
||||
|
||||
// other time access
|
||||
inline float RenderFrameTime() const { return m_RenderFrameTime; }
|
||||
|
|
|
@ -83,8 +83,6 @@ CClient::CClient() :
|
|||
m_RenderFrameTime = 0.0001f;
|
||||
m_LastRenderTime = time_get();
|
||||
|
||||
m_GameTickSpeed = SERVER_TICK_SPEED;
|
||||
|
||||
m_SnapCrcErrors = 0;
|
||||
m_AutoScreenshotRecycle = false;
|
||||
m_AutoStatScreenshotRecycle = false;
|
||||
|
|
|
@ -29,7 +29,6 @@ class IServer : public IInterface
|
|||
MACRO_INTERFACE("server", 0)
|
||||
protected:
|
||||
int m_CurrentGameTick;
|
||||
int m_TickSpeed;
|
||||
|
||||
public:
|
||||
/*
|
||||
|
@ -46,7 +45,7 @@ public:
|
|||
};
|
||||
|
||||
int Tick() const { return m_CurrentGameTick; }
|
||||
int TickSpeed() const { return m_TickSpeed; }
|
||||
int TickSpeed() const { return SERVER_TICK_SPEED; }
|
||||
|
||||
virtual int Port() const = 0;
|
||||
virtual int MaxClients() const = 0;
|
||||
|
|
|
@ -317,8 +317,6 @@ CServer::CServer()
|
|||
m_aDemoRecorder[i] = CDemoRecorder(&m_SnapshotDelta, true);
|
||||
m_aDemoRecorder[MAX_CLIENTS] = CDemoRecorder(&m_SnapshotDelta, false);
|
||||
|
||||
m_TickSpeed = TickSpeed();
|
||||
|
||||
m_pGameServer = 0;
|
||||
|
||||
m_CurrentGameTick = MIN_TICK;
|
||||
|
|
|
@ -355,7 +355,6 @@ void CGameClient::OnInit()
|
|||
str_format(aBuf, sizeof(aBuf), "initialisation finished after %.2fms", ((End - Start) * 1000) / (float)time_freq());
|
||||
Console()->Print(IConsole::OUTPUT_LEVEL_DEBUG, "gameclient", aBuf);
|
||||
|
||||
m_GameWorld.m_GameTickSpeed = Client()->GameTickSpeed();
|
||||
m_GameWorld.m_pCollision = Collision();
|
||||
m_GameWorld.m_pTuningList = m_aTuningList;
|
||||
|
||||
|
|
|
@ -593,7 +593,6 @@ void CGameWorld::CopyWorld(CGameWorld *pFrom)
|
|||
pFrom->m_pChild = this;
|
||||
|
||||
m_GameTick = pFrom->m_GameTick;
|
||||
m_GameTickSpeed = pFrom->m_GameTickSpeed;
|
||||
m_pCollision = pFrom->m_pCollision;
|
||||
m_WorldConfig = pFrom->m_WorldConfig;
|
||||
for(int i = 0; i < 2; i++)
|
||||
|
|
|
@ -51,12 +51,11 @@ public:
|
|||
std::vector<CCharacter *> IntersectedCharacters(vec2 Pos0, vec2 Pos1, float Radius, const CEntity *pNotThis = nullptr);
|
||||
|
||||
int m_GameTick;
|
||||
int m_GameTickSpeed;
|
||||
CCollision *m_pCollision;
|
||||
|
||||
// getter for server variables
|
||||
int GameTick() { return m_GameTick; }
|
||||
int GameTickSpeed() { return m_GameTickSpeed; }
|
||||
int GameTickSpeed() { return SERVER_TICK_SPEED; }
|
||||
CCollision *Collision() { return m_pCollision; }
|
||||
CTeamsCore *Teams() { return &m_Teams; }
|
||||
std::vector<SSwitchers> &Switchers() { return m_Core.m_vSwitchers; }
|
||||
|
|
Loading…
Reference in a new issue