[Scummvm-git-logs] scummvm master -> 3bdebc3a53c5f9dd35093afd5d4db6e03cf14f19
elasota
noreply at scummvm.org
Sun Apr 9 15:53:58 UTC 2023
This automated email contains information about 8 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
12b69f3169 VCRUISE: Fix facing animations stopping one frame too soon
6fbdfec5f6 VCRUISE: Remove delay when ending at a stop frame.
b0342e5eaa VCRUISE: Remove empty line
3e61aded8e VCRUISE: Cache release looping sounds when their volume is zero.
1e7615fee7 VCRUISE: Handle property-updating playlist entries correctly
8012a52cb9 VCRUISE: Fix integer overflow when calculating distances in the forest
e0b6870f14 VCRUISE: Fix crash in temple puzzle
3bdebc3a53 VCRUISE: Disable the "static" opcode until we can figure out what it actually does.
Commit: 12b69f31698704ab574daaa46068e9b22061d384
https://github.com/scummvm/scummvm/commit/12b69f31698704ab574daaa46068e9b22061d384
Author: elasota (ejlasota at gmail.com)
Date: 2023-04-09T11:49:39-04:00
Commit Message:
VCRUISE: Fix facing animations stopping one frame too soon
Changed paths:
engines/vcruise/runtime.cpp
diff --git a/engines/vcruise/runtime.cpp b/engines/vcruise/runtime.cpp
index 733ee719b40..05ecdaa6a9a 100644
--- a/engines/vcruise/runtime.cpp
+++ b/engines/vcruise/runtime.cpp
@@ -1308,7 +1308,7 @@ void Runtime::continuePlayingAnimation(bool loop, bool useStopFrame, bool &outAn
_animPendingDecodeFrame = _animFirstFrame;
}
- if (useStopFrame && _animPendingDecodeFrame == _animStopFrame) {
+ if (useStopFrame && _animDisplayingFrame == _animStopFrame) {
outAnimationEnded = true;
return;
}
Commit: 6fbdfec5f619fcf7c4e51809ef34457605306046
https://github.com/scummvm/scummvm/commit/6fbdfec5f619fcf7c4e51809ef34457605306046
Author: elasota (ejlasota at gmail.com)
Date: 2023-04-09T11:49:39-04:00
Commit Message:
VCRUISE: Remove delay when ending at a stop frame.
Changed paths:
engines/vcruise/runtime.cpp
diff --git a/engines/vcruise/runtime.cpp b/engines/vcruise/runtime.cpp
index 05ecdaa6a9a..5fce6821e9a 100644
--- a/engines/vcruise/runtime.cpp
+++ b/engines/vcruise/runtime.cpp
@@ -1308,11 +1308,6 @@ void Runtime::continuePlayingAnimation(bool loop, bool useStopFrame, bool &outAn
_animPendingDecodeFrame = _animFirstFrame;
}
- if (useStopFrame && _animDisplayingFrame == _animStopFrame) {
- outAnimationEnded = true;
- return;
- }
-
const Graphics::Surface *surface = _animDecoder->decodeNextFrame();
if (!surface) {
outAnimationEnded = true;
@@ -1371,6 +1366,11 @@ void Runtime::continuePlayingAnimation(bool loop, bool useStopFrame, bool &outAn
return;
}
}
+
+ if (useStopFrame && _animDisplayingFrame == _animStopFrame) {
+ outAnimationEnded = true;
+ return;
+ }
}
}
Commit: b0342e5eaa0c26caab3bb8c3b883ed41e29d3c1f
https://github.com/scummvm/scummvm/commit/b0342e5eaa0c26caab3bb8c3b883ed41e29d3c1f
Author: elasota (ejlasota at gmail.com)
Date: 2023-04-09T11:49:39-04:00
Commit Message:
VCRUISE: Remove empty line
Changed paths:
engines/vcruise/audio_player.cpp
diff --git a/engines/vcruise/audio_player.cpp b/engines/vcruise/audio_player.cpp
index 65957de5e5f..ce1bc323569 100644
--- a/engines/vcruise/audio_player.cpp
+++ b/engines/vcruise/audio_player.cpp
@@ -64,7 +64,6 @@ void AudioPlayer::play(byte volume, int8 balance) {
_exhausted = false;
_mixer->playStream(_soundType, &_handle, this, -1, volume, balance, DisposeAfterUse::NO);
}
-
}
void AudioPlayer::setVolume(byte volume) {
Commit: 3e61aded8e043e52d3db80521c2150aec25a6d8b
https://github.com/scummvm/scummvm/commit/3e61aded8e043e52d3db80521c2150aec25a6d8b
Author: elasota (ejlasota at gmail.com)
Date: 2023-04-09T11:49:39-04:00
Commit Message:
VCRUISE: Cache release looping sounds when their volume is zero.
Changed paths:
engines/vcruise/runtime.cpp
engines/vcruise/runtime.h
diff --git a/engines/vcruise/runtime.cpp b/engines/vcruise/runtime.cpp
index 5fce6821e9a..cb3cddd38c9 100644
--- a/engines/vcruise/runtime.cpp
+++ b/engines/vcruise/runtime.cpp
@@ -399,7 +399,7 @@ SoundCache::~SoundCache() {
SoundInstance::SoundInstance()
: id(0), rampStartVolume(0), rampEndVolume(0), rampRatePerMSec(0), rampStartTime(0), rampTerminateOnCompletion(false),
- volume(0), balance(0), effectiveBalance(0), effectiveVolume(0), is3D(false), isLooping(false), isSpeech(false), x(0), y(0), endTime(0) {
+ volume(0), balance(0), effectiveBalance(0), effectiveVolume(0), is3D(false), isLooping(false), isSpeech(false), isSilencedLoop(false), x(0), y(0), endTime(0) {
}
SoundInstance::~SoundInstance() {
@@ -2360,6 +2360,21 @@ void Runtime::triggerSound(bool looping, SoundInstance &snd, uint volume, int32
computeEffectiveVolumeAndBalance(snd);
+ if (volume == 0 && looping) {
+ if (snd.cache) {
+ if (snd.cache->player)
+ snd.cache->player.reset();
+
+ snd.cache.reset();
+ }
+
+ snd.isSilencedLoop = true;
+ snd.endTime = 0;
+ return;
+ }
+
+ snd.isSilencedLoop = false;
+
SoundCache *cache = loadCache(snd);
// Reset if looping state changes
@@ -2369,12 +2384,11 @@ void Runtime::triggerSound(bool looping, SoundInstance &snd, uint volume, int32
cache->stream->rewind();
}
- if (!cache->loopingStream && looping)
- cache->player.reset();
-
// Construct looping stream if needed and none exists
- if (looping && !cache->loopingStream)
+ if (looping && !cache->loopingStream) {
+ cache->player.reset();
cache->loopingStream.reset(new Audio::LoopingAudioStream(cache->stream.get(), 0, DisposeAfterUse::NO, true));
+ }
const Audio::Mixer::SoundType soundType = (isSpeech ? Audio::Mixer::kSpeechSoundType : Audio::Mixer::kSFXSoundType);
@@ -2406,6 +2420,9 @@ void Runtime::triggerSoundRamp(SoundInstance &snd, uint durationMSec, uint newVo
snd.rampStartTime = g_system->getMillis();
snd.rampRatePerMSec = 65536;
+ if (!snd.isLooping && newVolume == 0)
+ snd.rampTerminateOnCompletion = true;
+
if (durationMSec)
snd.rampRatePerMSec = 65536 / durationMSec;
}
@@ -2454,6 +2471,23 @@ void Runtime::updateSounds(uint32 timestamp) {
snd.cache.reset();
snd.endTime = 0;
}
+
+ if (snd.isLooping) {
+ if (snd.volume == 0) {
+ if (!snd.isSilencedLoop) {
+ if (snd.cache) {
+ snd.cache->player.reset();
+ snd.cache.reset();
+ }
+ snd.isSilencedLoop = true;
+ }
+ } else {
+ if (snd.isSilencedLoop) {
+ triggerSound(true, snd, snd.volume, snd.balance, snd.is3D, snd.isSpeech);
+ assert(snd.isSilencedLoop == false);
+ }
+ }
+ }
}
}
diff --git a/engines/vcruise/runtime.h b/engines/vcruise/runtime.h
index 6bcc98faa10..92fffc3ae27 100644
--- a/engines/vcruise/runtime.h
+++ b/engines/vcruise/runtime.h
@@ -221,6 +221,7 @@ struct SoundInstance {
bool is3D;
bool isLooping;
bool isSpeech;
+ bool isSilencedLoop; // Loop is still playing but reached 0 volume so the player was unloaded
int32 x;
int32 y;
Commit: 1e7615fee723af2daefe61c482f837ed86d4d7e0
https://github.com/scummvm/scummvm/commit/1e7615fee723af2daefe61c482f837ed86d4d7e0
Author: elasota (ejlasota at gmail.com)
Date: 2023-04-09T11:49:40-04:00
Commit Message:
VCRUISE: Handle property-updating playlist entries correctly
Changed paths:
engines/vcruise/audio_player.cpp
engines/vcruise/runtime.cpp
engines/vcruise/runtime.h
diff --git a/engines/vcruise/audio_player.cpp b/engines/vcruise/audio_player.cpp
index ce1bc323569..e55285ff759 100644
--- a/engines/vcruise/audio_player.cpp
+++ b/engines/vcruise/audio_player.cpp
@@ -75,10 +75,12 @@ void AudioPlayer::setBalance(int8 balance) {
}
void AudioPlayer::setVolumeAndBalance(byte volume, int8 balance) {
- Common::StackLock lock(_mixer->mutex());
+ if (_isPlaying) {
+ Common::StackLock lock(_mixer->mutex());
- _mixer->setChannelVolume(_handle, volume);
- _mixer->setChannelBalance(_handle, balance);
+ _mixer->setChannelVolume(_handle, volume);
+ _mixer->setChannelBalance(_handle, balance);
+ }
}
void AudioPlayer::stop() {
diff --git a/engines/vcruise/runtime.cpp b/engines/vcruise/runtime.cpp
index cb3cddd38c9..1afed62bd27 100644
--- a/engines/vcruise/runtime.cpp
+++ b/engines/vcruise/runtime.cpp
@@ -212,8 +212,7 @@ void Runtime::GyroState::reset() {
isWaitingForAnimation = false;
}
-
-SfxPlaylistEntry::SfxPlaylistEntry() : frame(0), balance(0), volume(0) {
+SfxPlaylistEntry::SfxPlaylistEntry() : frame(0), balance(0), volume(0), isUpdate(false) {
}
SfxPlaylist::SfxPlaylist() {
@@ -366,9 +365,16 @@ void SfxData::load(Common::SeekableReadStream &stream, Audio::Mixer *mixer) {
continue;
}
- SoundMap_t::const_iterator soundIt = this->sounds.find(tokens[1]);
+ bool isUpdate = false;
+ Common::String soundName = tokens[1];
+ if (soundName.size() >= 1 && soundName[0] == '*') {
+ soundName = soundName.substr(1);
+ isUpdate = true;
+ }
+
+ SoundMap_t::const_iterator soundIt = this->sounds.find(soundName);
if (soundIt == this->sounds.end()) {
- warning("Playlist entry referenced non-existent sound: %s", tokens[1].c_str());
+ warning("Playlist entry referenced non-existent sound: %s", soundName.c_str());
continue;
}
@@ -377,6 +383,7 @@ void SfxData::load(Common::SeekableReadStream &stream, Audio::Mixer *mixer) {
plEntry.frame = frameNum;
plEntry.volume = volume;
plEntry.sample = soundIt->_value;
+ plEntry.isUpdate = isUpdate;
playlist->entries.push_back(plEntry);
} else {
@@ -1334,9 +1341,13 @@ void Runtime::continuePlayingAnimation(bool loop, bool useStopFrame, bool &outAn
if (playlistEntry.frame == decodeFrameInPlaylist) {
VCruise::AudioPlayer &audioPlayer = *playlistEntry.sample->audioPlayer;
- audioPlayer.stop();
- playlistEntry.sample->audioStream->seek(0);
- audioPlayer.play(playlistEntry.volume, playlistEntry.frame);
+ if (playlistEntry.isUpdate) {
+ audioPlayer.setVolumeAndBalance(playlistEntry.volume, playlistEntry.balance);
+ } else {
+ audioPlayer.stop();
+ playlistEntry.sample->audioStream->seek(0);
+ audioPlayer.play(playlistEntry.volume, playlistEntry.balance);
+ }
// No break, it's possible for there to be multiple sounds in the same frame
}
diff --git a/engines/vcruise/runtime.h b/engines/vcruise/runtime.h
index 92fffc3ae27..c8c8ff0e075 100644
--- a/engines/vcruise/runtime.h
+++ b/engines/vcruise/runtime.h
@@ -155,6 +155,7 @@ struct SfxPlaylistEntry {
Common::SharedPtr<SfxSound> sample;
int8 balance;
uint8 volume;
+ bool isUpdate;
};
struct SfxPlaylist {
Commit: 8012a52cb9909a0dee723b847bd9eaf69c2795c0
https://github.com/scummvm/scummvm/commit/8012a52cb9909a0dee723b847bd9eaf69c2795c0
Author: elasota (ejlasota at gmail.com)
Date: 2023-04-09T11:49:40-04:00
Commit Message:
VCRUISE: Fix integer overflow when calculating distances in the forest
Changed paths:
engines/vcruise/runtime.cpp
diff --git a/engines/vcruise/runtime.cpp b/engines/vcruise/runtime.cpp
index 1afed62bd27..b7797079c2e 100644
--- a/engines/vcruise/runtime.cpp
+++ b/engines/vcruise/runtime.cpp
@@ -2536,7 +2536,10 @@ bool Runtime::computeEffectiveVolumeAndBalance(SoundInstance &snd) {
int32 dx = snd.x - _listenerX;
int32 dy = snd.y - _listenerY;
- uint distance = static_cast<uint>(sqrt(dx * dx + dy * dy));
+ double dxf = dx;
+ double dyf = dy;
+
+ uint distance = static_cast<uint>(sqrt(dxf * dxf + dyf * dyf));
if (distance >= snd.params3D.maxRange)
effectiveVolume = 0;
Commit: e0b6870f14ea5543f9ec1a89657907f8fe19125b
https://github.com/scummvm/scummvm/commit/e0b6870f14ea5543f9ec1a89657907f8fe19125b
Author: elasota (ejlasota at gmail.com)
Date: 2023-04-09T11:49:40-04:00
Commit Message:
VCRUISE: Fix crash in temple puzzle
Changed paths:
engines/vcruise/runtime.cpp
diff --git a/engines/vcruise/runtime.cpp b/engines/vcruise/runtime.cpp
index b7797079c2e..b2cff048fde 100644
--- a/engines/vcruise/runtime.cpp
+++ b/engines/vcruise/runtime.cpp
@@ -1842,7 +1842,7 @@ SoundCache *Runtime::loadCache(SoundInstance &sound) {
return cachedSound.get();
}
-void Runtime::resolveSoundByName(const Common::String &soundName, StackInt_t &outSoundID, SoundInstance *&outWave) {
+void Runtime::resolveSoundByName(const Common::String &soundName, bool load, StackInt_t &outSoundID, SoundInstance *&outWave) {
Common::String sndName = soundName;
uint soundID = 0;
@@ -1861,15 +1861,17 @@ void Runtime::resolveSoundByName(const Common::String &soundName, StackInt_t &ou
}
}
- Common::HashMap<Common::String, Common::ArchiveMemberPtr>::const_iterator waveIt = _waves.find(sndName);
+ if (load) {
+ Common::HashMap<Common::String, Common::ArchiveMemberPtr>::const_iterator waveIt = _waves.find(sndName);
- if (waveIt != _waves.end()) {
- Common::SharedPtr<SoundInstance> snd = loadWave(sndName, soundID, waveIt->_value);
- outWave = snd.get();
+ if (waveIt != _waves.end()) {
+ Common::SharedPtr<SoundInstance> snd = loadWave(sndName, soundID, waveIt->_value);
+ outWave = snd.get();
+ }
}
}
-void Runtime::resolveSoundByNameOrID(const StackValue &stackValue, StackInt_t &outSoundID, SoundInstance *&outWave) {
+void Runtime::resolveSoundByNameOrID(const StackValue &stackValue, bool load, StackInt_t &outSoundID, SoundInstance *&outWave) {
outSoundID = 0;
outWave = nullptr;
@@ -1886,7 +1888,7 @@ void Runtime::resolveSoundByNameOrID(const StackValue &stackValue, StackInt_t &o
}
if (stackValue.type == StackValue::kString)
- resolveSoundByName(stackValue.value.s, outSoundID, outWave);
+ resolveSoundByName(stackValue.value.s, load, outSoundID, outWave);
}
void Runtime::changeToScreen(uint roomNumber, uint screenNumber) {
@@ -2445,6 +2447,7 @@ void Runtime::stopSound(SoundInstance &sound) {
sound.cache->player.reset();
sound.cache.reset();
sound.endTime = 0;
+ sound.isSilencedLoop = false;
}
void Runtime::updateSounds(uint32 timestamp) {
@@ -2614,7 +2617,7 @@ void Runtime::triggerAmbientSounds() {
StackInt_t soundID = 0;
SoundInstance *cachedSound = nullptr;
- resolveSoundByName(sound.name, soundID, cachedSound);
+ resolveSoundByName(sound.name, true, soundID, cachedSound);
if (cachedSound) {
triggerSound(false, *cachedSound, sound.volume, sound.balance, false, false);
@@ -3805,7 +3808,7 @@ void Runtime::scriptOpSoundS1(ScriptArg_t arg) {
StackInt_t soundID = 0;
SoundInstance *cachedSound = nullptr;
- resolveSoundByName(sndNameArgs[0], soundID, cachedSound);
+ resolveSoundByName(sndNameArgs[0], true, soundID, cachedSound);
if (cachedSound)
triggerSound(false, *cachedSound, 100, 0, false, false);
@@ -3817,7 +3820,7 @@ void Runtime::scriptOpSoundS2(ScriptArg_t arg) {
StackInt_t soundID = 0;
SoundInstance *cachedSound = nullptr;
- resolveSoundByName(sndNameArgs[0], soundID, cachedSound);
+ resolveSoundByName(sndNameArgs[0], true, soundID, cachedSound);
if (cachedSound)
triggerSound(false, *cachedSound, sndParamArgs[0], 0, false, false);
@@ -3829,7 +3832,7 @@ void Runtime::scriptOpSoundS3(ScriptArg_t arg) {
StackInt_t soundID = 0;
SoundInstance *cachedSound = nullptr;
- resolveSoundByName(sndNameArgs[0], soundID, cachedSound);
+ resolveSoundByName(sndNameArgs[0], true, soundID, cachedSound);
if (cachedSound)
triggerSound(false, *cachedSound, sndParamArgs[0], sndParamArgs[1], false, false);
@@ -3840,7 +3843,7 @@ void Runtime::scriptOpSoundL1(ScriptArg_t arg) {
StackInt_t soundID = 0;
SoundInstance *cachedSound = nullptr;
- resolveSoundByName(sndNameArgs[0], soundID, cachedSound);
+ resolveSoundByName(sndNameArgs[0], true, soundID, cachedSound);
if (cachedSound)
triggerSound(true, *cachedSound, 100, 0, false, false);
@@ -3852,7 +3855,7 @@ void Runtime::scriptOpSoundL2(ScriptArg_t arg) {
StackInt_t soundID = 0;
SoundInstance *cachedSound = nullptr;
- resolveSoundByName(sndNameArgs[0], soundID, cachedSound);
+ resolveSoundByName(sndNameArgs[0], true, soundID, cachedSound);
if (cachedSound)
triggerSound(true, *cachedSound, sndParamArgs[0], 0, false, false);
@@ -3864,7 +3867,7 @@ void Runtime::scriptOpSoundL3(ScriptArg_t arg) {
StackInt_t soundID = 0;
SoundInstance *cachedSound = nullptr;
- resolveSoundByName(sndNameArgs[0], soundID, cachedSound);
+ resolveSoundByName(sndNameArgs[0], true, soundID, cachedSound);
if (cachedSound)
triggerSound(true, *cachedSound, sndParamArgs[0], sndParamArgs[1], false, false);
@@ -3876,7 +3879,7 @@ void Runtime::scriptOp3DSoundL2(ScriptArg_t arg) {
StackInt_t soundID = 0;
SoundInstance *cachedSound = nullptr;
- resolveSoundByName(sndNameArgs[0], soundID, cachedSound);
+ resolveSoundByName(sndNameArgs[0], true, soundID, cachedSound);
if (cachedSound) {
setSound3DParameters(*cachedSound, sndParamArgs[1], sndParamArgs[2], _pendingSoundParams3D);
@@ -3890,7 +3893,7 @@ void Runtime::scriptOp3DSoundL3(ScriptArg_t arg) {
StackInt_t soundID = 0;
SoundInstance *cachedSound = nullptr;
- resolveSoundByName(sndNameArgs[0], soundID, cachedSound);
+ resolveSoundByName(sndNameArgs[0], true, soundID, cachedSound);
if (cachedSound) {
setSound3DParameters(*cachedSound, sndParamArgs[2], sndParamArgs[3], _pendingSoundParams3D);
@@ -3904,7 +3907,7 @@ void Runtime::scriptOp3DSoundS2(ScriptArg_t arg) {
StackInt_t soundID = 0;
SoundInstance *cachedSound = nullptr;
- resolveSoundByName(sndNameArgs[0], soundID, cachedSound);
+ resolveSoundByName(sndNameArgs[0], true, soundID, cachedSound);
if (cachedSound) {
setSound3DParameters(*cachedSound, sndParamArgs[1], sndParamArgs[2], _pendingSoundParams3D);
@@ -3938,10 +3941,14 @@ void Runtime::scriptOpStopSndLA(ScriptArg_t arg) {
}
void Runtime::scriptOpStopSndLO(ScriptArg_t arg) {
- TAKE_STACK_INT(1);
+ TAKE_STACK_VAR(1);
- warning("StopSndLO not implemented yet");
- (void)stackArgs;
+ StackInt_t soundID = 0;
+ SoundInstance *cachedSound = nullptr;
+ resolveSoundByNameOrID(stackArgs[0], false, soundID, cachedSound);
+
+ if (cachedSound)
+ stopSound(*cachedSound);
}
void Runtime::scriptOpRange(ScriptArg_t arg) {
@@ -4077,7 +4084,7 @@ void Runtime::scriptOpVolumeUp3(ScriptArg_t arg) {
StackInt_t soundID = 0;
SoundInstance *cachedSound = nullptr;
- resolveSoundByNameOrID(sndIDArgs[0], soundID, cachedSound);
+ resolveSoundByNameOrID(sndIDArgs[0], true, soundID, cachedSound);
if (cachedSound)
triggerSoundRamp(*cachedSound, sndParamArgs[0] * 100, sndParamArgs[1], false);
@@ -4089,7 +4096,7 @@ void Runtime::scriptOpVolumeDn2(ScriptArg_t arg) {
StackInt_t soundID = 0;
SoundInstance *cachedSound = nullptr;
- resolveSoundByNameOrID(sndIDArgs[0], soundID, cachedSound);
+ resolveSoundByNameOrID(sndIDArgs[0], true, soundID, cachedSound);
// FIXME: Just do this instantly
if (cachedSound)
@@ -4102,7 +4109,7 @@ void Runtime::scriptOpVolumeDn3(ScriptArg_t arg) {
StackInt_t soundID = 0;
SoundInstance *cachedSound = nullptr;
- resolveSoundByNameOrID(sndIDArgs[0], soundID, cachedSound);
+ resolveSoundByNameOrID(sndIDArgs[0], true, soundID, cachedSound);
if (cachedSound)
triggerSoundRamp(*cachedSound, sndParamArgs[0] * 100, sndParamArgs[1], false);
@@ -4114,7 +4121,7 @@ void Runtime::scriptOpVolumeDn4(ScriptArg_t arg) {
StackInt_t soundID = 0;
SoundInstance *cachedSound = nullptr;
- resolveSoundByNameOrID(sndIDArgs[0], soundID, cachedSound);
+ resolveSoundByNameOrID(sndIDArgs[0], true, soundID, cachedSound);
if (cachedSound)
triggerSoundRamp(*cachedSound, sndParamArgs[0] * 100, sndParamArgs[1], sndParamArgs[2] != 0);
@@ -4187,7 +4194,7 @@ void Runtime::scriptOpSay1(ScriptArg_t arg) {
StackInt_t soundID = 0;
SoundInstance *cachedSound = nullptr;
- resolveSoundByName(soundIDStr, soundID, cachedSound);
+ resolveSoundByName(soundIDStr, true, soundID, cachedSound);
if (cachedSound)
triggerSound(false, *cachedSound, 100, 0, false, true);
@@ -4199,7 +4206,7 @@ void Runtime::scriptOpSay3(ScriptArg_t arg) {
StackInt_t soundID = 0;
SoundInstance *cachedSound = nullptr;
- resolveSoundByName(sndNameArgs[0], soundID, cachedSound);
+ resolveSoundByName(sndNameArgs[0], true, soundID, cachedSound);
if (cachedSound) {
TriggeredOneShot oneShot;
@@ -4223,7 +4230,7 @@ void Runtime::scriptOpSay3Get(ScriptArg_t arg) {
StackInt_t soundID = 0;
SoundInstance *cachedSound = nullptr;
- resolveSoundByName(sndNameArgs[0], soundID, cachedSound);
+ resolveSoundByName(sndNameArgs[0], true, soundID, cachedSound);
if (cachedSound) {
TriggeredOneShot oneShot;
Commit: 3bdebc3a53c5f9dd35093afd5d4db6e03cf14f19
https://github.com/scummvm/scummvm/commit/3bdebc3a53c5f9dd35093afd5d4db6e03cf14f19
Author: elasota (ejlasota at gmail.com)
Date: 2023-04-09T11:49:40-04:00
Commit Message:
VCRUISE: Disable the "static" opcode until we can figure out what it actually does.
Changed paths:
engines/vcruise/runtime.cpp
engines/vcruise/runtime.h
diff --git a/engines/vcruise/runtime.cpp b/engines/vcruise/runtime.cpp
index b2cff048fde..6c3a8680dc4 100644
--- a/engines/vcruise/runtime.cpp
+++ b/engines/vcruise/runtime.cpp
@@ -1954,6 +1954,7 @@ void Runtime::changeToScreen(uint roomNumber, uint screenNumber) {
_havePendingReturnToIdleState = true;
_haveIdleStaticAnimation = false;
+ _idleCurrentStaticAnimation.clear();
_havePendingPlayAmbientSounds = true;
recordSaveGameSnapshot();
@@ -3619,6 +3620,14 @@ void Runtime::scriptOpAnim(ScriptArg_t arg) {
void Runtime::scriptOpStatic(ScriptArg_t arg) {
TAKE_STACK_INT(kAnimDefStackArgs);
+ // FIXME: What does this actually do?
+ // It looks like this sets the last frame of an animation as the current scene graphic, but
+ // in some cases that's wrong. For instance, after solving the temple puzzle in Reah, viewing
+ // the rock on the left (screen 0c4 in room 20) runs ":PLANAS_SKALA static" after the rock
+ // symbol displays. However, :PLANAS_SKALA shows the rock with no symbol.
+ //
+ // Another problem occurs when viewing the rotor puzzle in the citadel, described below for now.
+#if 0
// QUIRK/BUG WORKAROUND: Static animations don't override other static animations!
//
// In Reah Room05, the script for 0b8 (NGONG) sets the static animation to :NNAWA_NGONG and then
@@ -3635,6 +3644,8 @@ void Runtime::scriptOpStatic(ScriptArg_t arg) {
if (animDef.animName == _idleCurrentStaticAnimation)
return;
+ // FIXME: _idleCurrentStaticAnimation must be cleared sometime! Maybe on loading a save.
+
changeAnimation(animDef, animDef.lastFrame, false, _animSpeedStaticAnim);
_havePendingReturnToIdleState = true;
@@ -3643,6 +3654,7 @@ void Runtime::scriptOpStatic(ScriptArg_t arg) {
_idleCurrentStaticAnimation = animDef.animName;
_gameState = kGameStateWaitingForAnimation;
+#endif
}
void Runtime::scriptOpVarLoad(ScriptArg_t arg) {
diff --git a/engines/vcruise/runtime.h b/engines/vcruise/runtime.h
index c8c8ff0e075..51cdf82e005 100644
--- a/engines/vcruise/runtime.h
+++ b/engines/vcruise/runtime.h
@@ -617,8 +617,8 @@ private:
void findWaves();
Common::SharedPtr<SoundInstance> loadWave(const Common::String &soundName, uint soundID, const Common::ArchiveMemberPtr &archiveMemberPtr);
SoundCache *loadCache(SoundInstance &sound);
- void resolveSoundByName(const Common::String &soundName, StackInt_t &outSoundID, SoundInstance *&outWave);
- void resolveSoundByNameOrID(const StackValue &stackValue, StackInt_t &outSoundID, SoundInstance *&outWave);
+ void resolveSoundByName(const Common::String &soundName, bool resolveSoundByName, StackInt_t &outSoundID, SoundInstance *&outWave);
+ void resolveSoundByNameOrID(const StackValue &stackValue, bool resolveSoundByName, StackInt_t &outSoundID, SoundInstance *&outWave);
void changeToScreen(uint roomNumber, uint screenNumber);
void returnToIdleState();
More information about the Scummvm-git-logs
mailing list