[Scummvm-git-logs] scummvm master -> 54df7271bffc552c3a2caf5de6027deabaf33f91
eriktorbjorn
noreply at scummvm.org
Sun Apr 27 07:09:23 UTC 2025
This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://api.github.com/repos/scummvm/scummvm .
Summary:
54df7271bf SCUMM: Document remaining deficiencies in CD audio restoring
Commit: 54df7271bffc552c3a2caf5de6027deabaf33f91
https://github.com/scummvm/scummvm/commit/54df7271bffc552c3a2caf5de6027deabaf33f91
Author: Torbjörn Andersson (eriktorbjorn at users.sourceforge.net)
Date: 2025-04-27T09:09:12+02:00
Commit Message:
SCUMM: Document remaining deficiencies in CD audio restoring
If a player saves more than once during the same non-looping sound,
we're in trouble because info.start no longer refers to the original
beginning of the sound. We can work around that for MI1, but probably
not for VGA Loom.
But this will have to do as a fallback solution until someone can think
of a better way.
Changed paths:
engines/scumm/soundcd.cpp
diff --git a/engines/scumm/soundcd.cpp b/engines/scumm/soundcd.cpp
index d1dbe9b787d..f01ec67fb52 100644
--- a/engines/scumm/soundcd.cpp
+++ b/engines/scumm/soundcd.cpp
@@ -326,10 +326,24 @@ void SoundCD::restoreCDAudioAfterLoad(AudioCDManager::Status &info) {
if (_vm->_game.platform == Common::kPlatformFMTowns)
return;
- int track = info.track;
- int numLoops = info.numLoops;
- int start = info.start;
- int duration = info.duration;
+ int track, numLoops, start, duration;
+
+ // FIXME: We still have a problem if the user saves more than once during
+ // the same sound, because then info.start no longer refers to the original
+ // start of the sound. We can fix that for some games, but probably not
+ // where it really counts, i.e. VGA Loom.
+
+ if (_currentCDSound) {
+ int end;
+
+ track = getCDTrackIdFromSoundId(_currentCDSound, numLoops, start, end);
+ duration = (end <= start) ? 0 : end - start;
+ } else {
+ track = info.track;
+ numLoops = info.numLoops;
+ start = info.start;
+ duration = info.duration;
+ }
// We only try to restore the position of the track if it's a non-looping
// sound. (This is particularly important for the talkie version of Loom.)
@@ -351,6 +365,7 @@ void SoundCD::restoreCDAudioAfterLoad(AudioCDManager::Status &info) {
// version of Loom. We move the offset forward by a little bit to
// restore the correct sync. (At least that's what the old version
// of this code said, and who am I to argue?)
+
start += (int)(musicTimer * 1.25);
if (duration)
More information about the Scummvm-git-logs
mailing list