summaryrefslogtreecommitdiff
path: root/src/client
diff options
context:
space:
mode:
Diffstat (limited to 'src/client')
-rw-r--r--src/client/cl_cgame.c7
-rw-r--r--src/client/cl_main.c46
-rw-r--r--src/client/cl_scrn.c24
-rw-r--r--src/client/client.h3
4 files changed, 56 insertions, 24 deletions
diff --git a/src/client/cl_cgame.c b/src/client/cl_cgame.c
index db18a8f7..5b09acfa 100644
--- a/src/client/cl_cgame.c
+++ b/src/client/cl_cgame.c
@@ -628,6 +628,13 @@ long CL_CgameSystemCalls( long *args ) {
case CG_KEY_GETKEY:
return Key_GetKey( VMA(1) );
+ case CG_GETDEMOSTATE:
+ return CL_DemoState( );
+ case CG_GETDEMOPOS:
+ return CL_DemoPos( );
+ case CG_GETDEMONAME:
+ CL_DemoName( VMA(1), args[2] );
+ return 0;
case CG_MEMSET:
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';
+ }
+}
//======================================================================
diff --git a/src/client/cl_scrn.c b/src/client/cl_scrn.c
index 8207d839..d1da0018 100644
--- a/src/client/cl_scrn.c
+++ b/src/client/cl_scrn.c
@@ -322,29 +322,6 @@ int SCR_GetBigStringWidth( const char *str ) {
//===============================================================================
/*
-=================
-SCR_DrawDemoRecording
-=================
-*/
-void SCR_DrawDemoRecording( void ) {
- char string[1024];
- int pos;
-
- if ( !clc.demorecording ) {
- return;
- }
- if ( clc.spDemoRecording ) {
- return;
- }
-
- pos = FS_FTell( clc.demofile );
- sprintf( string, "RECORDING %s: %ik", clc.demoName, pos / 1024 );
-
- SCR_DrawStringExt( 320 - strlen( string ) * 4, 20, 8, string, g_color_table[7], qtrue );
-}
-
-
-/*
===============================================================================
DEBUG GRAPH
@@ -490,7 +467,6 @@ void SCR_DrawScreenField( stereoFrame_t stereoFrame ) {
break;
case CA_ACTIVE:
CL_CGameRendering( stereoFrame );
- SCR_DrawDemoRecording();
break;
}
}
diff --git a/src/client/client.h b/src/client/client.h
index 5f609dde..1c4fa198 100644
--- a/src/client/client.h
+++ b/src/client/client.h
@@ -372,6 +372,9 @@ void CL_Snd_Restart_f (void);
void CL_StartDemoLoop( void );
void CL_NextDemo( void );
void CL_ReadDemoMessage( void );
+demoState_t CL_DemoState( void );
+int CL_DemoPos( void );
+void CL_DemoName( char *buffer, int size );
void CL_InitDownloads(void);
void CL_NextDownload(void);