#include "tMemManager.h"
#include "eTimer.h"
#include "eNetGameObject.h"
#include "nSimulatePing.h"
#include "tRecorder.h"
#include "tMath.h"
#include "tConfiguration.h"
#include "eLagCompensation.h"
Go to the source code of this file.
Functions | |
static bool | se_SmoothTime () |
REAL | se_GameTime () |
REAL | se_GameTimeNoSync () |
void | se_SyncGameTimer () |
void | se_MakeGameTimer () |
void | se_KillGameTimer () |
void | se_ResetGameTimer (REAL t) |
void | se_PauseGameTimer (bool p) |
REAL | se_AverageFrameTime () |
REAL | se_AverageFPS () |
REAL | se_PredictTime () |
Variables | |
eTimer * | se_mainGameTimer = NULL |
static nVersionFeature | se_clientLagCompensation (14) |
static REAL | se_lagOffsetLegacy = 0.0f |
static tSettingItem< REAL > | se_lagOffsetLegacyConf ("LAG_OFFSET_LEGACY", se_lagOffsetLegacy) |
static REAL | se_timerStartFudge = 0.0 |
static tSettingItem< REAL > | se_timerStartFudgeConf ("TIMER_SYNC_START_FUDGE", se_timerStartFudge) |
static REAL | se_timerStartFudgeStop = 2.0 |
static tSettingItem< REAL > | se_timerStartFudgeStopConf ("TIMER_SYNC_START_FUDGE_STOP", se_timerStartFudgeStop) |
static nNOInitialisator< eTimer > | eTimer_init (210,"eTimer") |
REAL se_AverageFPS | ( | ) |
Definition at line 424 of file eTimer.cpp.
References eTimer::AverageFPS().
Referenced by cCockpit::cb_Framerate(), and se_AverageFrameTime().
00424 { 00425 if (se_mainGameTimer) 00426 return se_mainGameTimer->AverageFPS(); 00427 else 00428 return (.2); 00429 }
REAL se_AverageFrameTime | ( | ) |
Definition at line 420 of file eTimer.cpp.
References se_AverageFPS().
Referenced by Delay(), and se_PredictTime().
00420 { 00421 return 1/se_AverageFPS(); 00422 }
REAL se_GameTime | ( | ) |
Definition at line 381 of file eTimer.cpp.
References eTimer::Time().
Referenced by eCamera::Act(), gCycleWallsDisplayListManager::CannotHaveList(), gSpawnPoint::Clear(), gNetPlayerWall::CopyIntoGrid(), gAIPlayer::CycleBlocksWay(), gSpawnPoint::Danger(), gPlayerWall::Deletable(), cWidget::Map::DrawWalls(), eGameObject::eGameObject(), gAIPlayer::EmergencySurvive(), gGame::GameLoop(), gBaseZoneHack::gBaseZoneHack(), gCycle::gCycle(), eCamera::MyInit(), new_destination_handler(), gAILog::NextEntry(), gCycle::OnNotifyNewDestination(), paint_sr_lowerSky(), gCycle::PassEdge(), gNetPlayerWall::RealWallReceived(), eNetGameObject::ReceiveControlNet(), gSpark::Render(), gCycle::Render(), cCockpit::Render(), eCamera::Render(), gCycle::Render2D(), gNetPlayerWall::RenderBegin(), gNetPlayerWall::RenderList(), gNetPlayerWall::RenderNormal(), gAIPlayer::RightBeforeDeath(), gNetPlayerWall::s_CopyIntoGrid(), se_ClampCamera(), gAIPlayer::SetTraceSide(), sg_CreateWinDeathZone(), sg_FullscreenMessage(), sg_TopologyPoliceCheck(), gSpawnPoint::Spawn(), gGame::StateUpdate(), gAIPlayer::SwitchToState(), gCycle::SyncEnemy(), gAIPlayer::Think(), gAIPlayer::ThinkCloseCombat(), gAIPlayer::ThinkPath(), gAIPlayer::ThinkSurvive(), gAIPlayer::ThinkTrace(), eCamera::Timestep(), and gCycleMovement::TimestepCore().
00381 { 00382 if (se_mainGameTimer) 00383 return se_mainGameTimer->Time(); 00384 else 00385 return 0; 00386 }
REAL se_GameTimeNoSync | ( | ) |
Definition at line 387 of file eTimer.cpp.
References eTimer::TimeNoSync().
00387 { 00388 if (se_mainGameTimer) 00389 return se_mainGameTimer->TimeNoSync(); 00390 else 00391 return 0; 00392 }
void se_KillGameTimer | ( | ) |
Definition at line 403 of file eTimer.cpp.
References NULL.
Referenced by own_game().
00403 { 00404 if (se_mainGameTimer) 00405 delete se_mainGameTimer; 00406 se_mainGameTimer=NULL; // to make sure 00407 }
void se_MakeGameTimer | ( | ) |
Definition at line 399 of file eTimer.cpp.
References tNEW.
Referenced by own_game().
void se_PauseGameTimer | ( | bool | p | ) |
Definition at line 415 of file eTimer.cpp.
References nCLIENT, eTimer::pause(), and sn_GetNetState().
Referenced by Activate(), gGame::GameLoop(), ingame_menu_cleanup(), init_game_camera(), init_game_grid(), sg_FullscreenMessage(), and gGame::StateUpdate().
00415 { 00416 if (se_mainGameTimer && sn_GetNetState()!=nCLIENT) 00417 se_mainGameTimer->pause(p); 00418 }
REAL se_PredictTime | ( | ) |
Definition at line 431 of file eTimer.cpp.
References se_AverageFrameTime().
Referenced by gCycle::CalculatePredictPosition(), and gCycle::PreparePredictPosition().
00431 { 00432 return se_AverageFrameTime()*.5; 00433 }
void se_ResetGameTimer | ( | REAL | t | ) |
Definition at line 410 of file eTimer.cpp.
References eTimer::Reset().
Referenced by init_game_camera(), and init_game_grid().
00410 { 00411 if (se_mainGameTimer) 00412 se_mainGameTimer->Reset(t); 00413 }
static bool se_SmoothTime | ( | ) | [static] |
Definition at line 198 of file eTimer.cpp.
References tRecorder::PlaybackStrict(), tRecorder::Record(), section, and tTimerIsAccurate().
Referenced by eTimer::SyncTime().
00199 { 00200 bool smooth = 0; 00201 00202 // try to get value from recording 00203 char const * section = "SMOOTHTIME"; 00204 if ( !tRecorder::PlaybackStrict( section, smooth ) ) 00205 { 00206 // get value by OS type 00207 smooth = !tTimerIsAccurate(); 00208 } 00209 // archive the decision 00210 tRecorder::Record( section, smooth ); 00211 00212 return smooth; 00213 }
void se_SyncGameTimer | ( | ) |
Definition at line 394 of file eTimer.cpp.
References eTimer::SyncTime().
Referenced by gGame::GameLoop(), and gGame::StateUpdate().
00394 { 00395 if (se_mainGameTimer) 00396 se_mainGameTimer->SyncTime(); 00397 }
nNOInitialisator<eTimer> eTimer_init(210,"eTimer") [static] |
Referenced by eTimer::CreatorDescriptor().
nVersionFeature se_clientLagCompensation(14) [static] |
REAL se_lagOffsetLegacy = 0.0f [static] |
tSettingItem< REAL > se_lagOffsetLegacyConf("LAG_OFFSET_LEGACY", se_lagOffsetLegacy) [static] |
eTimer* se_mainGameTimer = NULL |
Definition at line 37 of file eTimer.cpp.
Referenced by gCycle::Act(), gGame::Analysis(), display_cockpit_lucifer(), gGame::GameLoop(), gWallRim::RenderReal(), scores(), and sg_FullscreenMessage().
REAL se_timerStartFudge = 0.0 [static] |
tSettingItem<REAL> se_timerStartFudgeConf("TIMER_SYNC_START_FUDGE", se_timerStartFudge) [static] |
REAL se_timerStartFudgeStop = 2.0 [static] |
tSettingItem<REAL> se_timerStartFudgeStopConf("TIMER_SYNC_START_FUDGE_STOP", se_timerStartFudgeStop) [static] |