From b939168b6129bc59811846ce522015e546fe14e4 Mon Sep 17 00:00:00 2001 From: Thanasis Antoniou Date: Mon, 29 Jul 2019 15:09:42 +0300 Subject: BLADERUNNER: Fix compile for AmigaOS --- engines/bladerunner/ambient_sounds.cpp | 52 +++++++++++++++++----------------- 1 file changed, 26 insertions(+), 26 deletions(-) (limited to 'engines') diff --git a/engines/bladerunner/ambient_sounds.cpp b/engines/bladerunner/ambient_sounds.cpp index 4825a70278..6d2169eaf1 100644 --- a/engines/bladerunner/ambient_sounds.cpp +++ b/engines/bladerunner/ambient_sounds.cpp @@ -57,19 +57,19 @@ AmbientSounds::~AmbientSounds() { delete[] _loopingSounds; } -static inline void sort(int &a, int &b) { - if (a > b) { - int t = a; - a = b; - b = t; +static inline void sort(int32 *a, int32 *b) { + if (*a > *b) { + int32 t = *a; + *a = *b; + *b = t; } } -static inline void sort(uint &a, uint &b) { - if (a > b) { - uint t = a; - a = b; - b = t; +static inline void sort(uint32 *a, uint32 *b) { + if (*a > *b) { + uint32 t = *a; + *a = *b; + *b = t; } } @@ -83,11 +83,11 @@ void AmbientSounds::addSound( #if BLADERUNNER_ORIGINAL_BUGS #else - sort(timeMin, timeMax); + sort(&timeMin, &timeMax); #endif // BLADERUNNER_ORIGINAL_BUGS - sort(volumeMin, volumeMax); - sort(panStartMin, panStartMax); - sort(panEndMin, panEndMax); + sort(&volumeMin, &volumeMax); + sort(&panStartMin, &panStartMax); + sort(&panEndMin, &panEndMax); addSoundByName( _vm->_gameInfo->getSfxTrack(sfxId), @@ -116,11 +116,11 @@ void AmbientSounds::removeAllNonLoopingSounds(bool stopPlaying) { void AmbientSounds::addSpeech(int actorId, int sentenceId, uint32 timeMin, uint32 timeMax, int volumeMin, int volumeMax, int panStartMin, int panStartMax, int panEndMin, int panEndMax, int priority, int unk) { #if BLADERUNNER_ORIGINAL_BUGS #else - sort(timeMin, timeMax); + sort(&timeMin, &timeMax); #endif // BLADERUNNER_ORIGINAL_BUGS - sort(volumeMin, volumeMax); - sort(panStartMin, panStartMax); - sort(panEndMin, panEndMax); + sort(&volumeMin, &volumeMax); + sort(&panStartMin, &panStartMax); + sort(&panEndMin, &panEndMax); Common::String name = Common::String::format( "%02d-%04d%s.AUD", actorId, sentenceId, _vm->_languageCode.c_str()); addSoundByName(name, @@ -333,10 +333,10 @@ void AmbientSounds::addSoundByName( #if BLADERUNNER_ORIGINAL_BUGS #else - sort(timeMin, timeMax); - sort(volumeMin, volumeMax); - sort(panStartMin, panStartMax); - sort(panEndMin, panEndMax); + sort(&timeMin, &timeMax); + sort(&volumeMin, &volumeMax); + sort(&panStartMin, &panStartMax); + sort(&panEndMin, &panEndMax); #endif // BLADERUNNER_ORIGINAL_BUGS track.isActive = true; @@ -442,7 +442,7 @@ void AmbientSounds::load(SaveFileReadStream &f) { track.nextPlayTimeStart = now; #if BLADERUNNER_ORIGINAL_BUGS #else - sort(track.timeMin, track.timeMax); + sort(&(track.timeMin), &(track.timeMax)); #endif // BLADERUNNER_ORIGINAL_BUGS track.nextPlayTimeDiff = _vm->_rnd.getRandomNumberRng(track.timeMin, track.timeMax); track.volumeMin = f.readInt(); @@ -454,9 +454,9 @@ void AmbientSounds::load(SaveFileReadStream &f) { track.panEndMax = f.readInt(); #if BLADERUNNER_ORIGINAL_BUGS #else - sort(track.volumeMin, track.volumeMax); - sort(track.panStartMin, track.panStartMax); - sort(track.panEndMin, track.panEndMax); + sort(&(track.volumeMin), &(track.volumeMax)); + sort(&(track.panStartMin), &(track.panStartMax)); + sort(&(track.panEndMin), &(track.panEndMax)); #endif // BLADERUNNER_ORIGINAL_BUGS track.priority = f.readInt(); f.skip(4); // field_45 -- cgit v1.2.3