Don't use legacy function names in sound code

This commit is contained in:
Lwmte 2021-10-02 18:54:53 +03:00
parent fa8e66931b
commit 961937d7cd
10 changed files with 15 additions and 33 deletions

View file

@ -534,7 +534,7 @@ GAME_STATUS DoTitle(int index)
UseSpotCam = true;
// Play background music
S_CDPlay("083_horus", SOUND_TRACK_BGM);
PlaySoundTrack("083_horus", SOUND_TRACK_BGM);
// Initialise ponytails
InitialiseHair();
@ -685,7 +685,7 @@ GAME_STATUS DoLevel(int index, std::string ambient, bool loadFromSavegame)
InitSpotCamSequences();
// Play background music
S_CDPlay(ambient, SOUND_TRACK_BGM);
PlaySoundTrack(ambient, SOUND_TRACK_BGM);
// Initialise ponytails
InitialiseHair();

View file

@ -1877,8 +1877,6 @@ int Inventory::DoTitleInventory()
UpdateSceneAndDrawInventory();
}
S_CDPlay(CDA_XA11_FLYBY1, SOUND_TRACK_BGM);
OpenRing(INV_RING_OPTIONS, true);
int result = INV_RESULT_NONE;

View file

@ -133,7 +133,6 @@ void NatlaControl(short itemNum)
natla->flags = 0;
timer = 0;
item->hitPoints = NATLA_NEAR_DEATH;
//S_CDPlay(54, SOUND_TRACK_ONESHOT);
}
else
item->hitPoints = -16384;

View file

@ -875,9 +875,6 @@ void SpeedBoatCollision(short itemNum, ITEM_INFO* litem, COLL_INFO* coll)
g_Level.Items[itemNum].status = ITEM_ACTIVE;
}
// TODO: play a cd when starting ! (boat)
//S_CDPlay(12, SOUND_TRACK_ONESHOT);
Lara.Vehicle = itemNum;
}

View file

@ -814,8 +814,6 @@ void MineCartCollision(short itemNum, ITEM_INFO* l, COLL_INFO* coll)
l->pos.xRot = v->pos.xRot;
l->pos.yRot = v->pos.yRot;
l->pos.zRot = v->pos.zRot;
//S_CDPlay(12, SOUND_TRACK_ONESHOT);
}
else
{

View file

@ -418,7 +418,6 @@ static int JeepCheckGetOff()
Lara.Vehicle = NO_ITEM;
Lara.gunStatus = LG_NO_ARMS;
CurrentLoopedSoundTrack = 110;
S_CDPlay(110, SOUND_TRACK_BGM);
return false;
}
}
@ -1606,7 +1605,6 @@ void JeepCollision(short itemNumber, ITEM_INFO* l, COLL_INFO* coll)
item->flags |= 0x20;
CurrentLoopedSoundTrack = 98;
S_CDPlay(98, SOUND_TRACK_BGM);
}
else
ObjectCollision(itemNumber, l, coll);

View file

@ -179,7 +179,7 @@ void ControlTeleporter(short itemNumber)
{
if (item->itemFlags[0] == 15)
{
//S_CDPlay("xa12_z_10", SOUND_TRACK_ONESHOT);
//PlaySoundTrack("xa12_z_10", SOUND_TRACK_ONESHOT);
}
else if (item->itemFlags[0] == 70)
{

View file

@ -30,7 +30,7 @@ Functions and callbacks for level-specific logic scripts.
static void PlayAudioTrack(std::string const & trackName, sol::optional<bool> looped)
{
S_CDPlay(trackName, looped.value_or(SOUND_TRACK_ONESHOT));
PlaySoundTrack(trackName, looped.value_or(SOUND_TRACK_ONESHOT));
}
static void PlaySoundEffect(int id, GameScriptPosition p, int flags)
@ -54,7 +54,7 @@ static void PlaySoundEffect(int id, int flags)
static void SetAmbientTrack(std::string const & trackName)
{
S_CDPlay(trackName, SOUND_TRACK_BGM);
PlaySoundTrack(trackName, SOUND_TRACK_BGM);
}
static int FindRoomNumber(GameScriptPosition pos)
@ -517,7 +517,7 @@ void AddOneSecret()
if (Savegame.Level.Secrets >= 255)
return;
Savegame.Level.Secrets++;
S_CDPlay(TRACK_FOUND_SECRET, SOUND_TRACK_ONESHOT);
PlaySoundTrack(TRACK_FOUND_SECRET, SOUND_TRACK_ONESHOT);
}
/*

View file

@ -313,10 +313,10 @@ void Sound_FreeSamples()
void PlaySoundTrack(short track, short flags)
{
S_CDPlayEx(track, flags, SOUND_TRACK_ONESHOT);
PlaySoundTrack(track, flags, SOUND_TRACK_ONESHOT);
}
void S_CDPlay(std::string track, unsigned int mode)
void PlaySoundTrack(std::string track, unsigned int mode)
{
bool crossfade = false;
DWORD crossfadeTime;
@ -403,7 +403,7 @@ void S_CDPlay(std::string track, unsigned int mode)
BASS_Soundtrack[mode].track = track;
}
void S_CDPlayEx(std::string track, DWORD mask, DWORD unknown)
void PlaySoundTrack(std::string track, DWORD mask, DWORD unknown)
{
// Check and modify soundtrack map mask, if needed.
// If existing mask is unmodified (same activation mask setup), track won't play.
@ -416,20 +416,13 @@ void S_CDPlayEx(std::string track, DWORD mask, DWORD unknown)
SoundTracks[track].Mask |= filteredMask;
}
S_CDPlay(track, SoundTracks[track].looped);
PlaySoundTrack(track, SoundTracks[track].looped);
}
// Legacy!
void S_CDPlay(int index, unsigned int mode)
void PlaySoundTrack(int index, DWORD mask, DWORD unknown)
{
std::pair<const std::string, AudioTrack>& track = *std::next(SoundTracks.begin(), index);
S_CDPlay(track.first, mode);
}
void S_CDPlayEx(int index, DWORD mask, DWORD unknown)
{
std::pair<const std::string, AudioTrack>& track = *std::next(SoundTracks.begin(), index);
S_CDPlayEx(track.first, mask, unknown);
PlaySoundTrack(track.first, mask, unknown);
}
void StopSoundTracks()

View file

@ -123,10 +123,9 @@ void Sound_FreeSamples();
void Sound_Stop();
void PlaySoundTrack(short track, short flags);
void S_CDPlay(std::string trackName, unsigned int mode);
void S_CDPlayEx(std::string trackName, DWORD mask, DWORD unknown);
void S_CDPlay(int index, unsigned int mode);
void S_CDPlayEx(int index, DWORD mask, DWORD unknown);
void PlaySoundTrack(std::string trackName, unsigned int mode);
void PlaySoundTrack(std::string trackName, DWORD mask, DWORD unknown);
void PlaySoundTrack(int index, DWORD mask, DWORD unknown);
void StopSoundTracks();
void SayNo();
void PlaySoundSources();