Inexor
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
legacy_time.hpp
Go to the documentation of this file.
1 #pragma once
3 
5 
6 extern int totalmillis; // elapsed wall time since program start (in real milliseconds)
7 extern int elapsedtime; // elapsed wall time since last updatetime() (in real milliseconds)
8 extern uint totalsecs; // probably bc the server is longer running there was a need of a bigger range.
9 
10 // note: virtual game milliseconds is scaled with the gamespeed and effected by a paused game.
11 extern int curtime; // elapsed frame time since last updatetime() (in virtual game milliseconds)
12 extern int lastmillis; // elapsed frame time since program start (in virtual game milliseconds)
13 extern int gamemillis; // elapsed frame time since game start (in virtual game milliseconds)
14 
21 extern void updatetime(bool is_paused, int gamespeed, int fps_limit = 0);
22 
24 extern int time_since_program_start();
25 
31 extern int scaletime(int time, int gamespeed);
32 
34 extern const char *gettimestr(const char *format = "%d_%b_%y_%H.%M.%S", bool forcelowercase = false);
unsigned int uint
Definition: cube_types.hpp:9
int lastmillis
Definition: legacy_time.cpp:14
int time_since_program_start()
real time in milliseconds since program start.
Definition: legacy_time.cpp:41
int scaletime(int time, int gamespeed)
scale time with gametime: gamespeed default is 100.
Definition: legacy_time.cpp:18
int totalmillis
microtiming header
Definition: legacy_time.cpp:14
void format(tagval *args, int numargs)
Definition: command.cpp:2584
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.
Definition: legacy_time.cpp:51
uint totalsecs
Definition: legacy_time.cpp:16
void updatetime(bool is_paused, int gamespeed, int fps_limit=0)
Updates the above global timing variables.
Definition: legacy_time.cpp:93
int gamespeed
Definition: client.cpp:229
int gamemillis
Definition: legacy_time.cpp:15
int curtime
Definition: legacy_time.cpp:14
int elapsedtime
Definition: legacy_time.cpp:14