Inexor
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Functions | Variables
legacy_time.hpp File Reference
#include "inexor/shared/cube_types.hpp"

Go to the source code of this file.

Functions

void updatetime (bool is_paused, int gamespeed, int fps_limit=0)
 Updates the above global timing variables. More...
 
int time_since_program_start ()
 real time in milliseconds since program start. More...
 
int scaletime (int time, int gamespeed)
 scale time with gametime: gamespeed default is 100. More...
 
const char * gettimestr (const char *format="%d_%b_%y_%H.%M.%S", bool forcelowercase=false)
 Returns a string of the current time in the specified format. More...
 

Variables

int totalmillis
 microtiming header More...
 
int elapsedtime
 
uint totalsecs
 
int curtime
 
int lastmillis
 
int gamemillis
 

Function Documentation

const char* gettimestr ( const char *  format = "%d_%b_%y_%H.%M.%S",
bool  forcelowercase = false 
)

Returns a string of the current time in the specified format.

References systime, timebuf, and totalmillis.

Referenced by gl_drawhud(), and screenshot().

int scaletime ( int  time,
int  gamespeed 
)

scale time with gametime: gamespeed default is 100.

Hence default return value would be t * 100.

Parameters
timein milliseconds.
gamespeedthere exist wall time and frame time: one is the virtual 'clock' for the game, the other one is scaled (and does not update when paused).

References game::gamespeed.

Referenced by physicsframe(), and updatetime().

int time_since_program_start ( )

real time in milliseconds since program start.

Referenced by recorder::gettime(), and updatetime().

void updatetime ( bool  is_paused,
int  gamespeed,
int  fps_limit = 0 
)

Updates the above global timing variables.

Parameters
is_pausedif true we won't update any frame times.
gamespeedthere exist wall time and frame time: one is the virtual 'clock' for the game, the other one is scaled (and does not update when paused).
fps_limitin case of limited fps we let this thread sleep for some milliseconds, if 0 everythings unlimited. TODO: encapsulate this into a class to make concurrency easier.

References curtime, elapsedtime, lastmillis, limitfps(), scaletime(), time_since_program_start(), totalmillis, and totalsecs.

Referenced by main(), and server::serverslice().

Variable Documentation

int curtime
int elapsedtime

Referenced by computezoom(), main(), and updatetime().

int gamemillis
int lastmillis

Referenced by aiman::addai(), decalrenderer::adddecal(), adddynlight(), addmotionblur(), listrenderer::addpart(), varenderer< T >::addpart(), addsleep(), ai::aiinfo::addstate(), game::captureclientmode::aidefend(), game::ctfclientmode::aidefend(), game::allowmove(), animategrass(), partrenderer::calc(), animmodel::part::calcanim(), dynlight::calccolor(), calcmodelpreviewpos(), dynlight::calcradius(), ai::canshoot(), server::changemap(), changetexgen(), game::checkattacksound(), server::checkmaps(), ai::checkroute(), skelmodel::skeleton::checkskelcache(), entities::checktriggers(), server::chooseworstteam(), cleardynlights(), decalrenderer::clearfadeddecals(), ai::aiinfo::clearsetup(), damageblend(), game::movable::damaged(), game::damaged(), game::deathstate(), game::collectclientmode::deposittokens(), server::collectservermode::deposittokens(), server::disconnect_client(), game::ctfclientmode::drawblip(), drawdamagescreen(), game::ctfclientmode::drawhud(), game::collectclientmode::drawhud(), game::captureclientmode::drawhud(), game::drawhudgun(), game::drawhudmodel(), drawskybox(), server::ctfservermode::dropflag(), game::ctfclientmode::dropflag(), game::collectclientmode::droptoken(), server::collectservermode::droptokens(), decalrenderer::fadeindecals(), decalrenderer::fadeoutdecals(), fireballrenderer::finddepthfxranges(), server::findscore(), server::forcespectator(), gengrassquads(), ai::getaimpos(), gl_drawframe(), ai::hastarget(), game::hit(), game::ctfclientmode::interpflagpos(), interppos(), game::ctfclientmode::invisflag(), ai::jumpto(), game::lighteffects(), ai::logic(), main(), flarerenderer::makelightflares(), ragdolldata::move(), moveragdoll(), game::moveragdolls(), game::newbouncer(), game::newprojectile(), game::otherplayers(), server::ctfservermode::parseflags(), game::parsemessages(), game::parsepositions(), game::collectclientmode::parsetokens(), physicsframe(), server::player_connected(), game::predictplayer(), ai::process(), game::receivefile(), vertmodel::vertmeshgroup::render(), animmodel::part::render(), animmodel::render(), ai::render(), skelmodel::skelmeshgroup::render(), renderbackground(), renderclient(), entities::renderentities(), game::captureclientmode::rendergame(), game::collectclientmode::rendergame(), game::ctfclientmode::rendergame(), game::rendergame(), renderlava(), renderlightning(), rendermaterials(), rendermodel(), fireballrenderer::renderpart(), game::renderplayer(), game::bombclientmode::renderplayersposindicator(), renderpostfx(), game::renderscoreboard(), rendervertwater(), renderwater(), game::respawn(), game::respawnself(), game::captureclientmode::respawnwait(), game::collectclientmode::respawnwait(), game::ctfclientmode::respawnwait(), game::saveragdoll(), server::ctfservermode::scoreflag(), game::selectcrosshair(), game::sendmap(), animmodel::animpos::setframes(), animmodel::skin::setshaderparams(), server::ctfservermode::setup(), ai::setup(), setupcaustics(), setupgeom(), setuplightning(), entities::setuptriggerflags(), game::shoot(), game::shoteffects(), game::collectclientmode::stealtoken(), game::suicide(), ai::aiinfo::switchstate(), game::ctfclientmode::takeflag(), server::ctfservermode::takeflag(), game::taunt(), ai::think(), ai::timeouts(), game::timeupdate(), entities::trypickup(), entities::unlocktriggers(), server::unspectate(), server::collectservermode::update(), server::ctfservermode::update(), varenderer< T >::update(), game::updatebouncers(), game::updatemovables(), updateparticles(), game::updateprojectiles(), updatetime(), game::updateworld(), and ai::violence().

int totalmillis
uint totalsecs