mirror of
https://github.com/1dot13/source.git
synced 2026-07-29 13:52:17 +02:00
- Added a wrapper that takes care of determining the file type of audio files.
- Fix: 'hit' sounds of non-profile NPCs were not played correctly git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8580 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
+5
-18
@@ -151,20 +151,13 @@ BOOLEAN MusicPlay(UINT32 uiNum)
|
||||
if ( NewSound == FALSE && MusicMode == MUSIC_OLD_TYPE )
|
||||
{
|
||||
#endif
|
||||
sprintf( zFileName, "%s.mp3", szMusicList[uiNum] );
|
||||
if ( !FileExists( zFileName ) )
|
||||
{
|
||||
sprintf( zFileName, "%s.ogg", szMusicList[uiNum] );
|
||||
if ( !FileExists( zFileName ) )
|
||||
{
|
||||
sprintf( zFileName, "%s.wav", szMusicList[uiNum] );
|
||||
}
|
||||
}
|
||||
SoundFileExists( szMusicList[uiNum], zFileName );
|
||||
#ifdef NEWMUSIC
|
||||
}
|
||||
else if ( NewSound == TRUE )
|
||||
{
|
||||
CHAR8 modstr[32] = "";
|
||||
CHAR8 modstr2[164] = "";
|
||||
|
||||
switch ( MusicMode )
|
||||
{
|
||||
@@ -176,16 +169,10 @@ BOOLEAN MusicPlay(UINT32 uiNum)
|
||||
case MUSIC_TACTICAL_CREEPY_MUSIC: sprintf( modstr, "CREEPY_" ); break;
|
||||
default: break;
|
||||
}
|
||||
|
||||
sprintf( modstr2, "%s\\%s%d", szMusicList[15], modstr, uiNum );
|
||||
|
||||
sprintf( zFileName, "%s\\%s%d.ogg", szMusicList[15], modstr, uiNum );
|
||||
if ( !FileExists( zFileName ) )
|
||||
{
|
||||
sprintf( zFileName, "%s\\%s%d.wav", szMusicList[15], modstr, uiNum );
|
||||
if ( !FileExists( zFileName ) )
|
||||
{
|
||||
sprintf( zFileName, "%s\\%s%d.mp3", szMusicList[15], modstr, uiNum );
|
||||
}
|
||||
}
|
||||
SoundFileExists( modstr2, zFileName );
|
||||
}
|
||||
#endif
|
||||
uiMusicHandle = SoundPlayStreamedFile(zFileName, &spParms);
|
||||
|
||||
Reference in New Issue
Block a user