diff options
author | Thanasis Antoniou | 2019-07-22 01:08:23 +0300 |
---|---|---|
committer | Thanasis Antoniou | 2019-07-22 01:09:23 +0300 |
commit | af9ec2f69139d74a697b6e534d31c8f31e1ce587 (patch) | |
tree | c521d71c82aa8a4a7adc3ef05225a11da9c4edb1 | |
parent | 4e16711e478d416846502164864faa31bc59fa7b (diff) | |
download | scummvm-rg350-af9ec2f69139d74a697b6e534d31c8f31e1ce587.tar.gz scummvm-rg350-af9ec2f69139d74a697b6e534d31c8f31e1ce587.tar.bz2 scummvm-rg350-af9ec2f69139d74a697b6e534d31c8f31e1ce587.zip |
BLADERUNNER: Revert uint32 vars to int32 if they could be init to -1
-rw-r--r-- | engines/bladerunner/actor.cpp | 40 | ||||
-rw-r--r-- | engines/bladerunner/actor.h | 8 | ||||
-rw-r--r-- | engines/bladerunner/actor_dialogue_queue.cpp | 22 | ||||
-rw-r--r-- | engines/bladerunner/actor_dialogue_queue.h | 6 | ||||
-rw-r--r-- | engines/bladerunner/bladerunner.cpp | 2 | ||||
-rw-r--r-- | engines/bladerunner/debugger.cpp | 2 | ||||
-rw-r--r-- | engines/bladerunner/movement_track.cpp | 12 | ||||
-rw-r--r-- | engines/bladerunner/movement_track.h | 8 | ||||
-rw-r--r-- | engines/bladerunner/music.cpp | 28 | ||||
-rw-r--r-- | engines/bladerunner/music.h | 8 | ||||
-rw-r--r-- | engines/bladerunner/script/scene/ct01.cpp | 4 | ||||
-rw-r--r-- | engines/bladerunner/script/scene/dr06.cpp | 2 | ||||
-rw-r--r-- | engines/bladerunner/script/scene/nr10.cpp | 2 | ||||
-rw-r--r-- | engines/bladerunner/script/scene/rc02.cpp | 4 | ||||
-rw-r--r-- | engines/bladerunner/script/scene/ug16.cpp | 2 | ||||
-rw-r--r-- | engines/bladerunner/script/script.cpp | 38 | ||||
-rw-r--r-- | engines/bladerunner/script/script.h | 14 |
17 files changed, 104 insertions, 98 deletions
diff --git a/engines/bladerunner/actor.cpp b/engines/bladerunner/actor.cpp index df78b00593..e52cebf2b7 100644 --- a/engines/bladerunner/actor.cpp +++ b/engines/bladerunner/actor.cpp @@ -100,7 +100,7 @@ void Actor::setup(int actorId) { _timer4RemainDefault = 60000u; _movementTrackWalkingToWaypointId = -1; - _movementTrackDelayOnNextWaypoint = (uint32)(-1); // original was -1, int + _movementTrackDelayOnNextWaypoint = -1; for (int i = 0; i != kActorTimers; ++i) { _timersLeft[i] = 0u; @@ -122,7 +122,7 @@ void Actor::setup(int actorId) { _movementTrackPaused = false; _movementTrackNextWaypointId = -1; - _movementTrackNextDelay = (uint32)(-1); // original was -1, int + _movementTrackNextDelay = -1; _movementTrackNextAngle = -1; _movementTrackNextRunning = false; @@ -220,12 +220,12 @@ void Actor::increaseFPS() { setFPS(fps); } -void Actor::timerStart(int timerId, uint32 interval) { +void Actor::timerStart(int timerId, int32 interval) { assert(timerId >= 0 && timerId < kActorTimers); - if ((int32)interval == -1 ) { - interval = 0u; + if (interval < 0 ) { + interval = 0; } - _timersLeft[timerId] = interval; + _timersLeft[timerId] = (uint32)interval; _timersLast[timerId] = _vm->_time->current(); } @@ -310,7 +310,7 @@ void Actor::movementTrackNext(bool omitAiScript) { bool hasNextMovement; bool running; int angle; - uint32 delay; + int32 delay; int waypointId; Vector3 waypointPosition; bool arrived; @@ -340,9 +340,9 @@ void Actor::movementTrackNext(bool omitAiScript) { setAtXYZ(waypointPosition, angle, true, false, false); if (!delay) { - delay = 1u; + delay = 1; } - if ((int32)delay != -1 && delay > 1u) { + if (delay > 1) { changeAnimationMode(kAnimationModeIdle, false); } timerStart(kActorTimerMovementTrack, delay); @@ -380,13 +380,13 @@ void Actor::movementTrackUnpause() { void Actor::movementTrackWaypointReached() { if (!_movementTrack->isPaused() && _id != kActorMcCoy) { - if (_movementTrackWalkingToWaypointId >= 0 && (int32)(_movementTrackDelayOnNextWaypoint) != -1) { // original was _movementTrackDelayOnNextWaypoint >= 0u + if (_movementTrackWalkingToWaypointId >= 0 && _movementTrackDelayOnNextWaypoint >= 0) { if (!_movementTrackDelayOnNextWaypoint) { - _movementTrackDelayOnNextWaypoint = 1u; + _movementTrackDelayOnNextWaypoint = 1; } if (_vm->_aiScripts->reachedMovementTrackWaypoint(_id, _movementTrackWalkingToWaypointId)) { - uint32 delay = _movementTrackDelayOnNextWaypoint; - if (delay > 1u) { + int32 delay = _movementTrackDelayOnNextWaypoint; + if (delay > 1) { changeAnimationMode(kAnimationModeIdle, false); delay = _movementTrackDelayOnNextWaypoint; // todo: analyze if movement is changed in some aiscript->ChangeAnimationMode? } @@ -394,7 +394,7 @@ void Actor::movementTrackWaypointReached() { } } _movementTrackWalkingToWaypointId = -1; - _movementTrackDelayOnNextWaypoint = 0u; + _movementTrackDelayOnNextWaypoint = 0; } } @@ -734,7 +734,7 @@ bool Actor::tick(bool forceDraw, Common::Rect *screenRect) { if (nextFrameTime <= 0) { nextFrameTime = 1; } - timerStart(kActorTimerAnimationFrame, (uint32)nextFrameTime); + timerStart(kActorTimerAnimationFrame, nextFrameTime); } if (_targetFacing >= 0) { if (_targetFacing == _facing) { @@ -1454,7 +1454,7 @@ void Actor::load(SaveFileReadStream &f) { _position = f.readVector3(); _facing = f.readInt(); _targetFacing = f.readInt(); - _timer4RemainDefault = (uint32)f.readInt(); + _timer4RemainDefault = f.readUint32LE(); _honesty = f.readInt(); _intelligence = f.readInt(); @@ -1468,7 +1468,7 @@ void Actor::load(SaveFileReadStream &f) { _movementTrackPaused = f.readBool(); _movementTrackNextWaypointId = f.readInt(); - _movementTrackNextDelay = (uint32)f.readInt(); + _movementTrackNextDelay = f.readInt(); _movementTrackNextAngle = f.readInt(); _movementTrackNextRunning = f.readBool(); @@ -1488,7 +1488,7 @@ void Actor::load(SaveFileReadStream &f) { _animationFrame = f.readInt(); _movementTrackWalkingToWaypointId = f.readInt(); - _movementTrackDelayOnNextWaypoint = (uint32)f.readInt(); + _movementTrackDelayOnNextWaypoint = f.readInt(); _screenRectangle = f.readRect(); _retiredWidth = f.readInt(); @@ -1499,7 +1499,7 @@ void Actor::load(SaveFileReadStream &f) { _scale = f.readFloat(); for (int i = 0; i < kActorTimers; ++i) { - _timersLeft[i] = (uint32)f.readInt(); + _timersLeft[i] = f.readUint32LE(); } // Bugfix: Special initialization case for timer 4 (kActorTimerClueExchange) when its value is restored as 0 // This should be harmless, but will remedy any broken save-games where the timer 4 was saved as 0. @@ -1509,7 +1509,7 @@ void Actor::load(SaveFileReadStream &f) { uint32 now = _vm->_time->getPauseStart(); for (int i = 0; i < kActorTimers; ++i) { - _timersLast[i] = now - (uint32)(f.readInt()); // we require an unsigned difference here, since _timersLast is essentially keeping time + _timersLast[i] = now - f.readUint32LE(); // we require an unsigned difference here, since _timersLast is essentially keeping time } int actorCount = _vm->_gameInfo->getActorCount(); diff --git a/engines/bladerunner/actor.h b/engines/bladerunner/actor.h index a7336b78f7..01f263856d 100644 --- a/engines/bladerunner/actor.h +++ b/engines/bladerunner/actor.h @@ -88,12 +88,12 @@ private: // Movement bool _movementTrackPaused; int _movementTrackNextWaypointId; - uint32 _movementTrackNextDelay; // probably not used - int _movementTrackNextAngle; // probably not used + int32 _movementTrackNextDelay; // probably not used + int _movementTrackNextAngle; // probably not used bool _movementTrackNextRunning; int _movementTrackWalkingToWaypointId; - uint32 _movementTrackDelayOnNextWaypoint; + int32 _movementTrackDelayOnNextWaypoint; // Animation int _width; @@ -143,7 +143,7 @@ public: void setFPS(int fps); void increaseFPS(); - void timerStart(int timerId, uint32 interval); + void timerStart(int timerId, int32 interval); void timerReset(int timerId); uint32 timerLeft(int timerId); void timersUpdate(); diff --git a/engines/bladerunner/actor_dialogue_queue.cpp b/engines/bladerunner/actor_dialogue_queue.cpp index 31cb9ad5a6..6c259c78bc 100644 --- a/engines/bladerunner/actor_dialogue_queue.cpp +++ b/engines/bladerunner/actor_dialogue_queue.cpp @@ -38,7 +38,7 @@ ActorDialogueQueue::Entry::Entry() { isNotPause = false; isPause = false; actorId = -1; - delay = (uint32)(-1); // original was -1, int + delay = -1; sentenceId = -1; animationMode = -1; } @@ -62,13 +62,13 @@ void ActorDialogueQueue::add(int actorId, int sentenceId, int animationMode) { entry.actorId = actorId; entry.sentenceId = sentenceId; entry.animationMode = animationMode; - entry.delay = (uint32)(-1); // original was -1, int + entry.delay = -1; _entries.push_back(entry); } } -void ActorDialogueQueue::addPause(uint32 delay) { +void ActorDialogueQueue::addPause(int32 delay) { if (_entries.size() < kMaxEntries) { Entry entry; entry.isNotPause = false; @@ -96,7 +96,7 @@ void ActorDialogueQueue::flush(int a1, bool callScript) { } if (_isPause) { _isPause = false; - _delay = 0u; + _delay = 0; _timeLast = 0u; } clear(); @@ -116,7 +116,7 @@ bool ActorDialogueQueue::isEmpty() { && _sentenceId == -1 \ && _animationMode == -1 \ && _animationModePrevious == -1 \ - && _delay == 0u \ + && _delay == 0 \ && _timeLast == 0u; } @@ -126,12 +126,12 @@ void ActorDialogueQueue::tick() { uint32 time = _vm->_time->current(); uint32 timeDiff = time - _timeLast; // unsigned difference is intentional _timeLast = time; - _delay = ((int32)_delay == -1 || (_delay < timeDiff) ) ? 0u : (_delay - timeDiff); - if (_delay > 0u) { + _delay = (_delay < 0 || ((uint32)_delay < timeDiff) ) ? 0 : ((uint32)_delay - timeDiff); + if (_delay > 0) { return; } _isPause = false; - _delay = 0u; + _delay = 0; _timeLast = 0u; if (_entries.empty()) { flush(0, true); @@ -212,7 +212,7 @@ void ActorDialogueQueue::load(SaveFileReadStream &f) { e.actorId = f.readInt(); e.sentenceId = f.readInt(); e.animationMode = f.readInt(); - e.delay = (uint32)f.readInt(); + e.delay = f.readInt(); } f.skip((kMaxEntries - count) * 24); @@ -223,7 +223,7 @@ void ActorDialogueQueue::load(SaveFileReadStream &f) { _animationMode = f.readInt(); _animationModePrevious = f.readInt(); _isPause = f.readBool(); - _delay = (uint32)f.readInt(); + _delay = f.readInt(); _timeLast = 0u; } @@ -235,7 +235,7 @@ void ActorDialogueQueue::clear() { _animationMode = -1; _animationModePrevious = -1; _isPause = false; - _delay = 0u; + _delay = 0; _timeLast = 0u; } diff --git a/engines/bladerunner/actor_dialogue_queue.h b/engines/bladerunner/actor_dialogue_queue.h index 8ae3a0a2e0..90662e7924 100644 --- a/engines/bladerunner/actor_dialogue_queue.h +++ b/engines/bladerunner/actor_dialogue_queue.h @@ -40,7 +40,7 @@ class ActorDialogueQueue { int actorId; int sentenceId; int animationMode; - uint32 delay; + int32 delay; Entry(); }; @@ -54,7 +54,7 @@ class ActorDialogueQueue { int _animationMode; int _animationModePrevious; bool _isPause; - uint32 _delay; + int32 _delay; uint32 _timeLast; public: @@ -62,7 +62,7 @@ public: ~ActorDialogueQueue(); void add(int actorId, int sentenceId, int animationMode); - void addPause(uint32 delay); + void addPause(int32 delay); void flush(int a1, bool callScript); bool isEmpty(); void tick(); diff --git a/engines/bladerunner/bladerunner.cpp b/engines/bladerunner/bladerunner.cpp index 094d27e80f..e4049830d7 100644 --- a/engines/bladerunner/bladerunner.cpp +++ b/engines/bladerunner/bladerunner.cpp @@ -584,7 +584,7 @@ bool BladeRunnerEngine::startup(bool hasSavegames) { _playerActor = _actors[_gameInfo->getPlayerId()]; _playerActor->setFPS(15); - _playerActor->timerStart(kActorTimerRunningStaminaFPS, 200u); + _playerActor->timerStart(kActorTimerRunningStaminaFPS, 200); _policeMaze = new PoliceMaze(this); diff --git a/engines/bladerunner/debugger.cpp b/engines/bladerunner/debugger.cpp index 0951e4cfa9..05bc47dc41 100644 --- a/engines/bladerunner/debugger.cpp +++ b/engines/bladerunner/debugger.cpp @@ -858,7 +858,7 @@ bool Debugger::cmdTimer(int argc, const char **argv) { if (value == 0) { actor->timerReset(timer); } else { - actor->timerStart(timer, (uint32)value); + actor->timerStart(timer, value); } } diff --git a/engines/bladerunner/movement_track.cpp b/engines/bladerunner/movement_track.cpp index e5ccd2fad0..900ef8886c 100644 --- a/engines/bladerunner/movement_track.cpp +++ b/engines/bladerunner/movement_track.cpp @@ -41,17 +41,17 @@ void MovementTrack::reset() { _paused = false; for (int i = 0; i < kSize; i++) { _entries[i].waypointId = -1; - _entries[i].delay = (uint32)(-1); // original was -1, int + _entries[i].delay = -1; _entries[i].angle = -1; _entries[i].run = false; } } -int MovementTrack::append(int waypointId, uint32 delay, bool run) { +int MovementTrack::append(int waypointId, int32 delay, bool run) { return append(waypointId, delay, -1, run); } -int MovementTrack::append(int waypointId, uint32 delay, int angle, bool run) { +int MovementTrack::append(int waypointId, int32 delay, int angle, bool run) { if (_lastIndex >= kSize) { return 0; } @@ -92,7 +92,7 @@ bool MovementTrack::hasNext() const { return _hasNext; } -bool MovementTrack::next(int *waypointId, uint32 *delay, int *angle, bool *run) { +bool MovementTrack::next(int *waypointId, int32 *delay, int *angle, bool *run) { if (_currentIndex < _lastIndex && _hasNext) { *waypointId = _entries[_currentIndex].waypointId; *delay = _entries[_currentIndex].delay; @@ -101,7 +101,7 @@ bool MovementTrack::next(int *waypointId, uint32 *delay, int *angle, bool *run) return true; } else { *waypointId = -1; - *delay = (uint32)(-1); // original was -1, int + *delay = -1; *angle = -1; *run = false; _hasNext = false; @@ -131,7 +131,7 @@ void MovementTrack::load(SaveFileReadStream &f) { for (int i = 0; i < kSize; ++i) { Entry &e = _entries[i]; e.waypointId = f.readInt(); - e.delay = (uint32)f.readInt(); + e.delay = f.readInt(); e.angle = f.readInt(); e.run = f.readBool(); } diff --git a/engines/bladerunner/movement_track.h b/engines/bladerunner/movement_track.h index 4dd20f6c35..e13cd6f98c 100644 --- a/engines/bladerunner/movement_track.h +++ b/engines/bladerunner/movement_track.h @@ -37,7 +37,7 @@ class MovementTrack { struct Entry { int waypointId; - uint32 delay; + int32 delay; int angle; bool run; }; @@ -51,15 +51,15 @@ class MovementTrack { public: MovementTrack(); ~MovementTrack(); - int append(int waypointId, uint32 delay, bool run); - int append(int waypointId, uint32 delay, int angle, bool run); + int append(int waypointId, int32 delay, bool run); + int append(int waypointId, int32 delay, int angle, bool run); void flush(); void repeat(); void pause(); void unpause(); bool isPaused() const; bool hasNext() const; - bool next(int *waypointId, uint32 *delay, int *angle, bool *run); + bool next(int *waypointId, int32 *delay, int *angle, bool *run); void save(SaveFileWriteStream &f); void load(SaveFileReadStream &f); diff --git a/engines/bladerunner/music.cpp b/engines/bladerunner/music.cpp index 59a4e5eae8..31517745a0 100644 --- a/engines/bladerunner/music.cpp +++ b/engines/bladerunner/music.cpp @@ -54,7 +54,7 @@ Music::~Music() { _vm->getTimerManager()->removeTimerProc(timerCallbackNext); } -bool Music::play(const Common::String &trackName, int volume, int pan, uint32 timeFadeIn, uint32 timePlay, int loop, uint32 timeFadeOut) { +bool Music::play(const Common::String &trackName, int volume, int pan, int32 timeFadeIn, int32 timePlay, int loop, int32 timeFadeOut) { //Common::StackLock lock(_mutex); if (_musicVolume <= 0) { @@ -63,7 +63,7 @@ bool Music::play(const Common::String &trackName, int volume, int pan, uint32 ti int volumeAdjusted = volume * _musicVolume / 100; int volumeStart = volumeAdjusted; - if ((int32)timeFadeIn != -1 && timeFadeIn > 0u) { + if (timeFadeIn > 0) { volumeStart = 1; } @@ -82,6 +82,9 @@ bool Music::play(const Common::String &trackName, int volume, int pan, uint32 ti _isNextPresent = true; } else { _current.loop = loop; + if (timeFadeIn < 0) { + timeFadeIn = 0; + } adjustVolume(volumeAdjusted, timeFadeIn); adjustPan(volumeAdjusted, timeFadeIn); } @@ -104,14 +107,14 @@ bool Music::play(const Common::String &trackName, int volume, int pan, uint32 ti return false; } - if ((int32)timeFadeIn != -1 && timeFadeIn > 0u) { + if (timeFadeIn > 0) { adjustVolume(volumeAdjusted, timeFadeIn); } _current.name = trackName; - if ((int32)timePlay != -1 && timePlay > 0u) { + if (timePlay > 0) { _vm->getTimerManager()->removeTimerProc(timerCallbackFadeOut); _vm->getTimerManager()->installTimerProc(timerCallbackFadeOut, timePlay * 1000 * 1000, this, "BladeRunnerMusicFadeoutTimer"); - } else if ((int32)timeFadeOut != -1 && timeFadeOut > 0u) { + } else if (timeFadeOut > 0) { _vm->getTimerManager()->removeTimerProc(timerCallbackFadeOut); _vm->getTimerManager()->installTimerProc(timerCallbackFadeOut, (_stream->getLength() - timeFadeOut * 1000) * 1000, this, "BladeRunnerMusicFadeoutTimer"); } @@ -200,17 +203,17 @@ void Music::load(SaveFileReadStream &f) { _current.name = f.readStringSz(13); _current.volume = f.readInt(); _current.pan = f.readInt(); - _current.timeFadeIn = (uint32)f.readInt(); - _current.timePlay = (uint32)f.readInt(); + _current.timeFadeIn = f.readInt(); + _current.timePlay = f.readInt(); _current.loop = f.readInt(); - _current.timeFadeOut = (uint32)f.readInt(); + _current.timeFadeOut = f.readInt(); _next.name = f.readStringSz(13); _next.volume = f.readInt(); _next.pan = f.readInt(); - _next.timeFadeIn = (uint32)f.readInt(); - _next.timePlay = (uint32)f.readInt(); + _next.timeFadeIn = f.readInt(); + _next.timePlay = f.readInt(); _next.loop = f.readInt(); - _next.timeFadeOut = (uint32)f.readInt(); + _next.timeFadeOut = f.readInt(); stop(2); if (_isPlaying) { @@ -262,6 +265,9 @@ void Music::ended() { void Music::fadeOut() { _vm->getTimerManager()->removeTimerProc(timerCallbackFadeOut); if (_channel >= 0) { + if (_current.timeFadeOut < 0) { + _current.timeFadeOut = 0; + } _vm->_audioMixer->stop(_channel, 60u * _current.timeFadeOut); } } diff --git a/engines/bladerunner/music.h b/engines/bladerunner/music.h index 0717544643..306f55147e 100644 --- a/engines/bladerunner/music.h +++ b/engines/bladerunner/music.h @@ -38,10 +38,10 @@ class Music { Common::String name; int volume; int pan; - uint32 timeFadeIn; - uint32 timePlay; + int32 timeFadeIn; + int32 timePlay; int loop; - uint32 timeFadeOut; + int32 timeFadeOut; }; BladeRunnerEngine *_vm; @@ -61,7 +61,7 @@ public: Music(BladeRunnerEngine *vm); ~Music(); - bool play(const Common::String &trackName, int volume, int pan, uint32 timeFadeIn, uint32 timePlay, int loop, uint32 timeFadeOut); + bool play(const Common::String &trackName, int volume, int pan, int32 timeFadeIn, int32 timePlay, int loop, int32 timeFadeOut); void stop(uint32 delay); void adjust(int volume, int pan, uint32 delay); bool isPlaying(); diff --git a/engines/bladerunner/script/scene/ct01.cpp b/engines/bladerunner/script/scene/ct01.cpp index a1a63bf22e..e58f270053 100644 --- a/engines/bladerunner/script/scene/ct01.cpp +++ b/engines/bladerunner/script/scene/ct01.cpp @@ -534,8 +534,8 @@ void SceneScriptCT01::PlayerWalkedIn() { void SceneScriptCT01::PlayerWalkedOut() { Ambient_Sounds_Remove_All_Non_Looping_Sounds(true); if (Game_Flag_Query(kFlagCT01toCT12)) { - Ambient_Sounds_Remove_Looping_Sound(kSfxCTAMBL1, true); - Ambient_Sounds_Remove_Looping_Sound(kSfxCTAMBR1, true); + Ambient_Sounds_Remove_Looping_Sound(kSfxCTAMBL1, 1); + Ambient_Sounds_Remove_Looping_Sound(kSfxCTAMBR1, 1); } else { Ambient_Sounds_Remove_All_Looping_Sounds(1); } diff --git a/engines/bladerunner/script/scene/dr06.cpp b/engines/bladerunner/script/scene/dr06.cpp index 037f10dcf4..0d788ba124 100644 --- a/engines/bladerunner/script/scene/dr06.cpp +++ b/engines/bladerunner/script/scene/dr06.cpp @@ -85,7 +85,7 @@ bool SceneScriptDR06::ClickedOn3DObject(const char *objectName, bool a2) { Game_Flag_Set(kFlagDR06JesterActive); } else { Overlay_Play("DR06over", 0, true, true, 0); - Ambient_Sounds_Remove_Looping_Sound(kSfxJESTMOV1, false); + Ambient_Sounds_Remove_Looping_Sound(kSfxJESTMOV1, 0); Game_Flag_Reset(kFlagDR06JesterActive); } return true; diff --git a/engines/bladerunner/script/scene/nr10.cpp b/engines/bladerunner/script/scene/nr10.cpp index 270feb50e9..778f19d33c 100644 --- a/engines/bladerunner/script/scene/nr10.cpp +++ b/engines/bladerunner/script/scene/nr10.cpp @@ -81,7 +81,7 @@ bool SceneScriptNR10::ClickedOn3DObject(const char *objectName, bool combatMode) Game_Flag_Reset(kFlagNR10McCoyBlinded); Actor_Set_Invisible(kActorMcCoy, false); Actor_Set_Invisible(kActorDektora, false); - Ambient_Sounds_Remove_Looping_Sound(kSfx35MM, true); + Ambient_Sounds_Remove_Looping_Sound(kSfx35MM, 1); Sound_Play(kSfx35MMBRK1, 52, 0, 0, 50); Scene_Loop_Set_Default(0); Scene_Loop_Start_Special(kSceneLoopModeOnce, 0, true); diff --git a/engines/bladerunner/script/scene/rc02.cpp b/engines/bladerunner/script/scene/rc02.cpp index 84b67d9f77..e307fdf1dc 100644 --- a/engines/bladerunner/script/scene/rc02.cpp +++ b/engines/bladerunner/script/scene/rc02.cpp @@ -416,8 +416,8 @@ bool SceneScriptRC02::ClickedOnExit(int exitId) { if (!Loop_Actor_Walk_To_XYZ(kActorMcCoy, -71.51f, -1238.89f, 108587.15f, 0, true, false, false)) { Game_Flag_Set(kFlagRC02toRC01); Ambient_Sounds_Remove_All_Non_Looping_Sounds(true); - Ambient_Sounds_Remove_Looping_Sound(kSfxBRBED5, true); - Ambient_Sounds_Remove_Looping_Sound(kSfxWINDLOP8, true); + Ambient_Sounds_Remove_Looping_Sound(kSfxBRBED5, 1); + Ambient_Sounds_Remove_Looping_Sound(kSfxWINDLOP8, 1); Ambient_Sounds_Adjust_Looping_Sound(kSfxRCRAIN1, 100, -101, 1); Actor_Set_Goal_Number(kActorRunciter, kGoalRunciterDefault); Set_Enter(kSetRC01, kSceneRC01); diff --git a/engines/bladerunner/script/scene/ug16.cpp b/engines/bladerunner/script/scene/ug16.cpp index b1dbdda0f4..b6f5c21553 100644 --- a/engines/bladerunner/script/scene/ug16.cpp +++ b/engines/bladerunner/script/scene/ug16.cpp @@ -185,7 +185,7 @@ bool SceneScriptUG16::ClickedOn2DRegion(int region) { void SceneScriptUG16::SceneFrameAdvanced(int frame) { if (frame == 132) { - Ambient_Sounds_Remove_Looping_Sound(kSfxELECLAB1, true); + Ambient_Sounds_Remove_Looping_Sound(kSfxELECLAB1, 1); } } diff --git a/engines/bladerunner/script/script.cpp b/engines/bladerunner/script/script.cpp index d0355d3289..d8faa02f0d 100644 --- a/engines/bladerunner/script/script.cpp +++ b/engines/bladerunner/script/script.cpp @@ -1139,8 +1139,8 @@ void ScriptBase::Footstep_Sound_Override_Off() { _vm->_scene->_set->resetFoodstepSoundOverride(); } -bool ScriptBase::Music_Play(int musicId, int volume, int pan, uint32 timeFadeIn, uint32 timePlay, int loop, uint32 timeFadeOut) { - debugC(kDebugScript, "Music_Play(%d, %d, %d, %u, %u, %d, %u)", musicId, volume, pan, timeFadeIn, timePlay, loop, timeFadeOut); +bool ScriptBase::Music_Play(int musicId, int volume, int pan, int32 timeFadeIn, int32 timePlay, int loop, int32 timeFadeOut) { + debugC(kDebugScript, "Music_Play(%d, %d, %d, %d, %d, %d, %d)", musicId, volume, pan, timeFadeIn, timePlay, loop, timeFadeOut); return _vm->_music->play(_vm->_gameInfo->getMusicTrack(musicId), volume, pan, timeFadeIn, timePlay, loop, timeFadeOut); } @@ -1657,8 +1657,8 @@ void ScriptBase::ADQ_Add(int actorId, int sentenceId, int animationMode) { _vm->_actorDialogueQueue->add(actorId, sentenceId, animationMode); } -void ScriptBase::ADQ_Add_Pause(uint32 delay) { - debugC(kDebugScript, "ADQ_Add_Pause(%u)", delay); +void ScriptBase::ADQ_Add_Pause(int32 delay) { + debugC(kDebugScript, "ADQ_Add_Pause(%d)", delay); _vm->_actorDialogueQueue->addPause(delay); } @@ -1684,10 +1684,10 @@ void ScriptBase::I_Sez(const char *str) { _vm->ISez(str); } -void ScriptBase::AI_Countdown_Timer_Start(int actorId, signed int timer, uint32 seconds) { - debugC(kDebugScript, "AI_Countdown_Timer_Start(%d, %d, %u)", actorId, timer, seconds); +void ScriptBase::AI_Countdown_Timer_Start(int actorId, signed int timer, int32 seconds) { + debugC(kDebugScript, "AI_Countdown_Timer_Start(%d, %d, %d)", actorId, timer, seconds); if (timer >= 0 && timer <= 2) { - _vm->_actors[actorId]->timerStart(timer, 1000u * seconds); + _vm->_actors[actorId]->timerStart(timer, 1000 * seconds); } } @@ -1714,24 +1714,24 @@ void ScriptBase::AI_Movement_Track_Repeat(int actorId) { _vm->_actors[actorId]->movementTrackNext(true); } -void ScriptBase::AI_Movement_Track_Append_Run_With_Facing(int actorId, int waypointId, uint32 delay, int angle) { - debugC(kDebugScript, "AI_Movement_Track_Append_Run_With_Facing(%d, %d, %u, %d)", actorId, waypointId, delay, angle); - _vm->_actors[actorId]->_movementTrack->append(waypointId, delay * 1000u, angle, true); +void ScriptBase::AI_Movement_Track_Append_Run_With_Facing(int actorId, int waypointId, int32 delay, int angle) { + debugC(kDebugScript, "AI_Movement_Track_Append_Run_With_Facing(%d, %d, %d, %d)", actorId, waypointId, delay, angle); + _vm->_actors[actorId]->_movementTrack->append(waypointId, delay * 1000, angle, true); } -void ScriptBase::AI_Movement_Track_Append_With_Facing(int actorId, int waypointId, uint32 delay, int angle) { - debugC(kDebugScript, "AI_Movement_Track_Append_With_Facing(%d, %d, %u, %d)", actorId, waypointId, delay, angle); - _vm->_actors[actorId]->_movementTrack->append(waypointId, delay * 1000u, angle, false); +void ScriptBase::AI_Movement_Track_Append_With_Facing(int actorId, int waypointId, int32 delay, int angle) { + debugC(kDebugScript, "AI_Movement_Track_Append_With_Facing(%d, %d, %d, %d)", actorId, waypointId, delay, angle); + _vm->_actors[actorId]->_movementTrack->append(waypointId, delay * 1000, angle, false); } -void ScriptBase::AI_Movement_Track_Append_Run(int actorId, int waypointId, uint32 delay) { - debugC(kDebugScript, "AI_Movement_Track_Append_Run(%d, %d, %u)", actorId, waypointId, delay); - _vm->_actors[actorId]->_movementTrack->append(waypointId, delay * 1000u, true); +void ScriptBase::AI_Movement_Track_Append_Run(int actorId, int waypointId, int32 delay) { + debugC(kDebugScript, "AI_Movement_Track_Append_Run(%d, %d, %d)", actorId, waypointId, delay); + _vm->_actors[actorId]->_movementTrack->append(waypointId, delay * 1000, true); } -void ScriptBase::AI_Movement_Track_Append(int actorId, int waypointId, uint32 delay) { - debugC(kDebugScript, "AI_Movement_Track_Append(%d, %d, %u)", actorId, waypointId, delay); - _vm->_actors[actorId]->_movementTrack->append(waypointId, delay * 1000u, false); +void ScriptBase::AI_Movement_Track_Append(int actorId, int waypointId, int32 delay) { + debugC(kDebugScript, "AI_Movement_Track_Append(%d, %d, %d)", actorId, waypointId, delay); + _vm->_actors[actorId]->_movementTrack->append(waypointId, delay * 1000, false); } void ScriptBase::AI_Movement_Track_Flush(int actorId) { diff --git a/engines/bladerunner/script/script.h b/engines/bladerunner/script/script.h index ac88458f42..4eb929004b 100644 --- a/engines/bladerunner/script/script.h +++ b/engines/bladerunner/script/script.h @@ -172,7 +172,7 @@ protected: void Footstep_Sounds_Set(int index, int value); void Footstep_Sound_Override_On(int footstepSoundOverride); void Footstep_Sound_Override_Off(); - bool Music_Play(int musicId, int volume, int pan, uint32 timeFadeIn, uint32 timePlay, int loop, uint32 timeFadeOut); + bool Music_Play(int musicId, int volume, int pan, int32 timeFadeIn, int32 timePlay, int loop, int32 timeFadeOut); void Music_Adjust(int volume, int pan, uint32 delay); void Music_Stop(uint32 delay); bool Music_Is_Playing(); @@ -265,21 +265,21 @@ protected: void Set_Fog_Density(const char *fogName, float density); void ADQ_Flush(); void ADQ_Add(int actorId, int sentenceId, int animationMode); - void ADQ_Add_Pause(uint32 delay); + void ADQ_Add_Pause(int32 delay); void ADQ_Wait_For_All_Queued_Dialogue(); bool Game_Over(); void Autosave_Game(int textId); void I_Sez(const char *str); - void AI_Countdown_Timer_Start(int actorId, signed int timer, uint32 seconds); + void AI_Countdown_Timer_Start(int actorId, signed int timer, int32 seconds); void AI_Countdown_Timer_Reset(int actorId, int timer); void AI_Movement_Track_Unpause(int actorId); void AI_Movement_Track_Pause(int actorId); void AI_Movement_Track_Repeat(int actorId); - void AI_Movement_Track_Append_Run_With_Facing(int actorId, int waypointId, uint32 delay, int angle); - void AI_Movement_Track_Append_With_Facing(int actorId, int waypointId, uint32 delay, int angle); - void AI_Movement_Track_Append_Run(int actorId, int waypointId, uint32 delay); - void AI_Movement_Track_Append(int actorId, int waypointId, uint32 delay); + void AI_Movement_Track_Append_Run_With_Facing(int actorId, int waypointId, int32 delay, int angle); + void AI_Movement_Track_Append_With_Facing(int actorId, int waypointId, int32 delay, int angle); + void AI_Movement_Track_Append_Run(int actorId, int waypointId, int32 delay); + void AI_Movement_Track_Append(int actorId, int waypointId, int32 delay); void AI_Movement_Track_Flush(int actorId); void ESPER_Add_Photo(const char *name, int photoId, int shapeId); |