summaryrefslogtreecommitdiff
path: root/src/cgame
diff options
context:
space:
mode:
authorTony J. White <tjw@tjw.org>2009-10-03 11:43:31 +0000
committerTim Angus <tim@ngus.net>2013-01-03 00:15:17 +0000
commitd50e12bb38f69124416033039f8084b2bc11f972 (patch)
tree5a081d29a5e38fe3e958822475a55a32be259b85 /src/cgame
parentaaa6c764b0faf5bcdc0108eed7a18a130caab662 (diff)
* add new CG syscall trap_S_SoundDuration() that returns play time
in msec for a registered sfxHandle
Diffstat (limited to 'src/cgame')
-rw-r--r--src/cgame/cg_public.h2
-rw-r--r--src/cgame/cg_syscalls.asm2
-rw-r--r--src/cgame/cg_syscalls.c5
3 files changed, 9 insertions, 0 deletions
diff --git a/src/cgame/cg_public.h b/src/cgame/cg_public.h
index 4d9e965a..3f4b13f3 100644
--- a/src/cgame/cg_public.h
+++ b/src/cgame/cg_public.h
@@ -181,6 +181,8 @@ typedef enum
CG_KEY_SETOVERSTRIKEMODE,
CG_KEY_GETOVERSTRIKEMODE,
+ CG_S_SOUNDDURATION,
+
CG_MEMSET = 200,
CG_MEMCPY,
CG_STRNCPY,
diff --git a/src/cgame/cg_syscalls.asm b/src/cgame/cg_syscalls.asm
index 218bd833..a28c5db2 100644
--- a/src/cgame/cg_syscalls.asm
+++ b/src/cgame/cg_syscalls.asm
@@ -104,6 +104,8 @@ equ trap_Parse_SourceFileAndLine -100
equ trap_Key_SetOverstrikeMode -101
equ trap_Key_GetOverstrikeMode -102
+equ trap_S_SoundDuration -103
+
equ memset -201
equ memcpy -202
equ strncpy -203
diff --git a/src/cgame/cg_syscalls.c b/src/cgame/cg_syscalls.c
index 98ba171e..01b7ca85 100644
--- a/src/cgame/cg_syscalls.c
+++ b/src/cgame/cg_syscalls.c
@@ -290,6 +290,11 @@ sfxHandle_t trap_S_RegisterSound( const char *sample, qboolean compressed )
return syscall( CG_S_REGISTERSOUND, sample, compressed );
}
+int trap_S_SoundDuration( sfxHandle_t handle )
+{
+ return syscall( CG_S_SOUNDDURATION, handle );
+}
+
void trap_S_StartBackgroundTrack( const char *intro, const char *loop )
{
syscall( CG_S_STARTBACKGROUNDTRACK, intro, loop );