src/engine/eTimer.cpp File Reference

#include "tMemManager.h"
#include "eTimer.h"
#include "eNetGameObject.h"
#include "nSimulatePing.h"
#include "tRecorder.h"
#include "tMath.h"
#include "tConfiguration.h"
#include "eLagCompensation.h"

Include dependency graph for eTimer.cpp:

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

eTimerse_mainGameTimer = NULL
static nVersionFeature se_clientLagCompensation (14)
static REAL se_lagOffsetLegacy = 0.0f
static tSettingItem< REALse_lagOffsetLegacyConf ("LAG_OFFSET_LEGACY", se_lagOffsetLegacy)
static REAL se_timerStartFudge = 0.0
static tSettingItem< REALse_timerStartFudgeConf ("TIMER_SYNC_START_FUDGE", se_timerStartFudge)
static REAL se_timerStartFudgeStop = 2.0
static tSettingItem< REALse_timerStartFudgeStopConf ("TIMER_SYNC_START_FUDGE_STOP", se_timerStartFudgeStop)
static nNOInitialisator< eTimereTimer_init (210,"eTimer")


Function Documentation

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 }

Here is the call graph for this function:

Here is the caller graph for this function:

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 }

Here is the call graph for this function:

Here is the caller graph for this function:

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 }

Here is the call graph for this function:

Here is the caller graph for this function:

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 }

Here is the call graph for this function:

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 }

Here is the caller graph for this function:

void se_MakeGameTimer (  ) 

Definition at line 399 of file eTimer.cpp.

References tNEW.

Referenced by own_game().

00399                        {
00400     tNEW(eTimer);
00401 }

Here is the caller graph for this function:

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 }

Here is the call graph for this function:

Here is the caller graph for this function:

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 }

Here is the call graph for this function:

Here is the caller graph for this function:

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 }

Here is the call graph for this function:

Here is the caller graph for this function:

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 }

Here is the call graph for this function:

Here is the caller graph for this function:

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 }

Here is the call graph for this function:

Here is the caller graph for this function:


Variable Documentation

nNOInitialisator<eTimer> eTimer_init(210,"eTimer") [static]

Referenced by eTimer::CreatorDescriptor().

nVersionFeature se_clientLagCompensation(14) [static]

REAL se_lagOffsetLegacy = 0.0f [static]

Definition at line 87 of file eTimer.cpp.

Referenced by eTimer::WriteSync().

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]

Definition at line 114 of file eTimer.cpp.

Referenced by eTimer::ReadSync().

tSettingItem<REAL> se_timerStartFudgeConf("TIMER_SYNC_START_FUDGE", se_timerStartFudge) [static]

REAL se_timerStartFudgeStop = 2.0 [static]

Definition at line 116 of file eTimer.cpp.

Referenced by eTimer::ReadSync().

tSettingItem<REAL> se_timerStartFudgeStopConf("TIMER_SYNC_START_FUDGE_STOP", se_timerStartFudgeStop) [static]


Generated on Sat Mar 15 22:59:25 2008 for Armagetron Advanced by  doxygen 1.5.4