Skip to content

Commit

Permalink
portability: fix PlayJA2SampleFromFile function
Browse files Browse the repository at this point in the history
STR8 is a typedef for char * which MSVC is more than happy to pass a const char * to. this isn't valid C++ anywhere else
  • Loading branch information
majcosta committed Dec 15, 2024
1 parent 37eb390 commit 132c69b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Utils/Sound Control.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -496,7 +496,7 @@ UINT32 PlayWeaponSound(STR8 szFileName, UINT32 ubVolume, UINT32 uiPan)
return(SoundPlay((STR)szFileName, &spParms));
}

UINT32 PlayJA2SampleFromFile( STR8 szFileName, UINT32 usRate, UINT32 ubVolume, UINT32 ubLoops, UINT32 uiPan )
UINT32 PlayJA2SampleFromFile( const char * szFileName, UINT32 usRate, UINT32 ubVolume, UINT32 ubLoops, UINT32 uiPan )
{
//SoundLog((CHAR8 *)String(" Play sound %s on volume %d", szFileName, ubVolume));
// does the same thing as PlayJA2Sound, but one only has to pass the filename, not the index of the sound array
Expand Down
2 changes: 1 addition & 1 deletion Utils/Sound Control.h
Original file line number Diff line number Diff line change
Expand Up @@ -416,7 +416,7 @@ BOOLEAN ShutdownJA2Sound( );
UINT32 PlayJA2Sample( UINT32 usNum, UINT32 usRate, UINT32 ubVolume, UINT32 ubLoops, UINT32 uiPan );
UINT32 PlayJA2StreamingSample( UINT32 usNum, UINT32 usRate, UINT32 ubVolume, UINT32 ubLoops, UINT32 uiPan );

UINT32 PlayJA2SampleFromFile( STR8 szFileName, UINT32 usRate, UINT32 ubVolume, UINT32 ubLoops, UINT32 uiPan );
UINT32 PlayJA2SampleFromFile( const char * szFileName, UINT32 usRate, UINT32 ubVolume, UINT32 ubLoops, UINT32 uiPan );
UINT32 PlayWeaponSound(STR8 szFileName, UINT32 ubVolume, UINT32 uiPan);
UINT32 PlayJA2StreamingSampleFromFile( STR8 szFileName, UINT32 usRate, UINT32 ubVolume, UINT32 ubLoops, UINT32 uiPan, SOUND_STOP_CALLBACK EndsCallback );

Expand Down

0 comments on commit 132c69b

Please sign in to comment.