2
0
mirror of https://github.com/FWGS/xash3d-fwgs synced 2024-11-26 03:39:16 +01:00

engine: client: remove media/ prefix for CD tracks, add it while parsing cdaudio.txt for compatibility

This commit is contained in:
Alibek Omarov 2023-04-19 17:54:28 +03:00
parent cadad6ce34
commit 398cec626e
2 changed files with 10 additions and 5 deletions

View File

@ -200,7 +200,7 @@ CL_InitCDAudio
Initialize CD playlist
====================
*/
void CL_InitCDAudio( const char *filename )
static void CL_InitCDAudio( const char *filename )
{
byte *afile;
char *pfile;
@ -221,8 +221,13 @@ void CL_InitCDAudio( const char *filename )
// format: trackname\n [num]
while(( pfile = COM_ParseFile( pfile, token, sizeof( token ))) != NULL )
{
if( !Q_stricmp( token, "blank" )) token[0] = '\0';
Q_strncpy( clgame.cdtracks[c], token, sizeof( clgame.cdtracks[0] ));
if( !Q_stricmp( token, "blank" ))
clgame.cdtracks[c][0] = '\0';
else
{
Q_snprintf( clgame.cdtracks[c], sizeof( clgame.cdtracks[c] ),
"media/%s", token );
}
if( ++c > MAX_CDTRACKS - 1 )
{

View File

@ -95,7 +95,7 @@ void S_StartBackgroundTrack( const char *introTrack, const char *mainTrack, int
else Q_strncpy( s_bgTrack.loopName, mainTrack, sizeof( s_bgTrack.loopName ));
// open stream
s_bgTrack.stream = FS_OpenStream( va( "media/%s", introTrack ));
s_bgTrack.stream = FS_OpenStream( introTrack );
Q_strncpy( s_bgTrack.current, introTrack, sizeof( s_bgTrack.current ));
memset( &musicfade, 0, sizeof( musicfade )); // clear any soundfade
s_bgTrack.source = cls.key_dest;
@ -242,7 +242,7 @@ void S_StreamBackgroundTrack( void )
if( s_bgTrack.loopName[0] )
{
FS_FreeStream( s_bgTrack.stream );
s_bgTrack.stream = FS_OpenStream( va( "media/%s", s_bgTrack.loopName ));
s_bgTrack.stream = FS_OpenStream( s_bgTrack.loopName );
Q_strncpy( s_bgTrack.current, s_bgTrack.loopName, sizeof( s_bgTrack.current ));
if( !s_bgTrack.stream ) return;