mirror of
https://github.com/YGGverse/xash3d-fwgs.git
synced 2025-01-29 16:24:16 +00:00
client: add waveplaylen console command like in GoldSrc
This commit is contained in:
parent
fe2c4af8c2
commit
0a818f3f3f
@ -418,3 +418,32 @@ void SCR_Viewpos_f( void )
|
|||||||
Con_Printf( "org ( %g %g %g )\n", refState.vieworg[0], refState.vieworg[1], refState.vieworg[2] );
|
Con_Printf( "org ( %g %g %g )\n", refState.vieworg[0], refState.vieworg[1], refState.vieworg[2] );
|
||||||
Con_Printf( "ang ( %g %g %g )\n", refState.viewangles[0], refState.viewangles[1], refState.viewangles[2] );
|
Con_Printf( "ang ( %g %g %g )\n", refState.viewangles[0], refState.viewangles[1], refState.viewangles[2] );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
=============
|
||||||
|
CL_WavePlayLen_f
|
||||||
|
|
||||||
|
=============
|
||||||
|
*/
|
||||||
|
void CL_WavePlayLen_f( void )
|
||||||
|
{
|
||||||
|
const char *name;
|
||||||
|
uint msecs;
|
||||||
|
|
||||||
|
if( Cmd_Argc() != 2 )
|
||||||
|
{
|
||||||
|
Con_Printf( "waveplaylen <wave file name>: returns approximate number of milliseconds a wave file will take to play.\n" );
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
name = Cmd_Argv( 1 );
|
||||||
|
msecs = Sound_GetApproxWavePlayLen( name );
|
||||||
|
|
||||||
|
if( msecs == 0 )
|
||||||
|
{
|
||||||
|
Con_Printf( "Unable to read %s, file may be missing or incorrectly formatted.\n", name );
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
Con_Printf( "Play time is approximately %dms\n", msecs );
|
||||||
|
}
|
||||||
|
@ -2879,6 +2879,7 @@ void CL_InitLocal( void )
|
|||||||
Cmd_AddCommand ("internetservers", CL_InternetServers_f, "collect info about internet servers" );
|
Cmd_AddCommand ("internetservers", CL_InternetServers_f, "collect info about internet servers" );
|
||||||
Cmd_AddCommand ("cd", CL_PlayCDTrack_f, "Play cd-track (not real cd-player of course)" );
|
Cmd_AddCommand ("cd", CL_PlayCDTrack_f, "Play cd-track (not real cd-player of course)" );
|
||||||
Cmd_AddCommand ("mp3", CL_PlayCDTrack_f, "Play mp3-track (based on virtual cd-player)" );
|
Cmd_AddCommand ("mp3", CL_PlayCDTrack_f, "Play mp3-track (based on virtual cd-player)" );
|
||||||
|
Cmd_AddCommand ("waveplaylen", CL_WavePlayLen_f, "Get approximate length of wave file");
|
||||||
|
|
||||||
Cmd_AddCommand ("setinfo", CL_SetInfo_f, "examine or change the userinfo string (alias of userinfo)" );
|
Cmd_AddCommand ("setinfo", CL_SetInfo_f, "examine or change the userinfo string (alias of userinfo)" );
|
||||||
Cmd_AddCommand ("userinfo", CL_SetInfo_f, "examine or change the userinfo string (alias of setinfo)" );
|
Cmd_AddCommand ("userinfo", CL_SetInfo_f, "examine or change the userinfo string (alias of setinfo)" );
|
||||||
|
@ -717,6 +717,7 @@ void CL_SaveShot_f( void );
|
|||||||
void CL_LevelShot_f( void );
|
void CL_LevelShot_f( void );
|
||||||
void CL_SetSky_f( void );
|
void CL_SetSky_f( void );
|
||||||
void SCR_Viewpos_f( void );
|
void SCR_Viewpos_f( void );
|
||||||
|
void CL_WavePlayLen_f( void );
|
||||||
|
|
||||||
//
|
//
|
||||||
// cl_custom.c
|
// cl_custom.c
|
||||||
|
Loading…
x
Reference in New Issue
Block a user