diff options
author | Tim Angus <tim@ngus.net> | 2006-01-06 02:21:29 +0000 |
---|---|---|
committer | Tim Angus <tim@ngus.net> | 2006-01-06 02:21:29 +0000 |
commit | dc6118816aa49c9b1e6dd82e6c6504f2153c37df (patch) | |
tree | cfcc2d80bd03f2abdaacc8292677650bd8e8181d /src/client/cl_main.c | |
parent | 4e6ae21de9bc373801b68a28b66067480bda4288 (diff) |
* Added traps to query demo state
* Demo state now displayed from cgame
* Merged ioq3-r464
- gcc4/-O0 bug fix
- zone/hunk megs faffage
Diffstat (limited to 'src/client/cl_main.c')
-rw-r--r-- | src/client/cl_main.c | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/src/client/cl_main.c b/src/client/cl_main.c index 04d87cc1..a00f901e 100644 --- a/src/client/cl_main.c +++ b/src/client/cl_main.c @@ -601,6 +601,52 @@ void CL_NextDemo( void ) { Cbuf_Execute(); } +/* +================== +CL_DemoState + +Returns the current state of the demo system +================== +*/ +demoState_t CL_DemoState( void ) { + if( clc.demoplaying ) { + return DS_PLAYBACK; + } else if( clc.demorecording ) { + return DS_RECORDING; + } else { + return DS_NONE; + } +} + +/* +================== +CL_DemoPos + +Returns the current position of the demo +================== +*/ +int CL_DemoPos( void ) { + if( clc.demoplaying || clc.demorecording ) { + return FS_FTell( clc.demofile ); + } else { + return 0; + } +} + +/* +================== +CL_DemoName + +Returns the name of the demo +================== +*/ +void CL_DemoName( char *buffer, int size ) { + if( clc.demoplaying || clc.demorecording ) { + Q_strncpyz( buffer, clc.demoName, size ); + } else if( size >= 1 ) { + buffer[ 0 ] = '\0'; + } +} //====================================================================== |