- 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:
Flugente
2018-07-21 15:02:44 +00:00
parent 69aeea0679
commit d66bdad9e3
7 changed files with 101 additions and 337 deletions
+17
View File
@@ -2552,3 +2552,20 @@ UINT32 GetFreeSpaceOnHardDrive( STR pzDriveLetter )
return( uiBytesFree );
}
// Flugente: simple wrapper to check whether an audio file in mp3/ogg/wav format exists
BOOLEAN SoundFileExists( STR strFilename, STR zFoundFilename )
{
SGPFILENAME zFilename;
sprintf( zFoundFilename, "%s.mp3", strFilename );
if ( !FileExists( zFoundFilename ) )
{
sprintf( zFoundFilename, "%s.ogg", strFilename );
if ( !FileExists( zFoundFilename ) )
{
sprintf( zFoundFilename, "%s.wav", strFilename );
}
}
return FileExists( zFoundFilename );
}