[Scummvm-git-logs] scummvm master -> 1d800f4799a1b024468bd5cae8d403f741c7cfa4
bluegr
noreply at scummvm.org
Sat Jun 20 09:56:28 UTC 2026
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:
1d800f4799 NANCY: Implement PlayRandomMovieControl for Nancy 11
Commit: 1d800f4799a1b024468bd5cae8d403f741c7cfa4
https://github.com/scummvm/scummvm/commit/1d800f4799a1b024468bd5cae8d403f741c7cfa4
Author: Filippos Karapetis (bluegr at gmail.com)
Date: 2026-06-20T12:56:19+03:00
Commit Message:
NANCY: Implement PlayRandomMovieControl for Nancy 11
Now, conversations with characters exit correctly
Changed paths:
engines/nancy/action/secondarymovie.cpp
engines/nancy/action/secondarymovie.h
engines/nancy/commontypes.cpp
engines/nancy/commontypes.h
diff --git a/engines/nancy/action/secondarymovie.cpp b/engines/nancy/action/secondarymovie.cpp
index 8ac8ae5a835..9e450a4e1e8 100644
--- a/engines/nancy/action/secondarymovie.cpp
+++ b/engines/nancy/action/secondarymovie.cpp
@@ -376,20 +376,17 @@ void PlaySecondaryMovie::execute() {
// --- PlayRandomMovieControl --------------------------------------------
void PlayRandomMovieControl::readData(Common::SeekableReadStream &stream) {
- _targetA = stream.readUint32LE();
- _targetB = stream.readUint32LE();
- _targetC = stream.readUint32LE();
- _flagsOrIndex = stream.readUint16LE();
- _trailing = stream.readByte();
+ _mode = stream.readByte();
+ _sceneChange.readData(stream, true, true);
}
void PlayRandomMovieControl::execute() {
- // Original binary debug string:
- // "STOP AT_PLAY_RANDOM_MOVIE AR %d in Scene %d"
- // so two of the chunk fields identify the target AR / scene.
- // Until the exact identification scheme is known, this stub just
- // warns and completes.
- warning("PlayRandomMovieControl is not yet fully implemented");
+ //PlaySecondaryMovie *target = NancySceneState.getActiveMovie();
+ //if (target && target->_isRandom) {
+ // target->stopRandom();
+ //}
+
+ _sceneChange.execute();
finishExecution();
}
diff --git a/engines/nancy/action/secondarymovie.h b/engines/nancy/action/secondarymovie.h
index b68e47502d0..0c8f35ad3e7 100644
--- a/engines/nancy/action/secondarymovie.h
+++ b/engines/nancy/action/secondarymovie.h
@@ -137,14 +137,8 @@ protected:
};
// Companion AR for the random-movie variant of PlaySecondaryMovie. When
-// executed it locates the matching PlaySecondaryMovie(isRandom=true)
-// instance (by sequence/AR name) and stops it. First seen in Nancy 11
-// (AR 46, AT_PLAY_RANDOM_MOVIE_CONTROL).
-//
-// Chunk layout: fixed 15 bytes (3 Ã uint32 + uint16 + uint8). The exact
-// meaning of each field is not yet reverse-engineered; the runtime debug
-// string is "STOP AT_PLAY_RANDOM_MOVIE AR %d in Scene %d", so at least two
-// of these fields identify the target AR.
+// executed it stops the currently-active random PlaySecondaryMovie and
+// optionally performs a scene change / event-flag set.
class PlayRandomMovieControl : public ActionRecord {
public:
PlayRandomMovieControl() {}
@@ -152,14 +146,17 @@ public:
void readData(Common::SeekableReadStream &stream) override;
void execute() override;
+ enum RandomMovieControlMode : byte {
+ kStopNow = 0,
+ kStopAfterSequence = 1,
+ kResume = 2
+ };
+
protected:
Common::String getRecordTypeName() const override { return "PlayRandomMovieControl"; }
- uint32 _targetA = 0;
- uint32 _targetB = 0;
- uint32 _targetC = 0;
- uint16 _flagsOrIndex = 0;
- byte _trailing = 0;
+ byte _mode = kStopNow;
+ SceneChangeWithFlag _sceneChange;
};
} // End of namespace Action
diff --git a/engines/nancy/commontypes.cpp b/engines/nancy/commontypes.cpp
index 15c8887f2f7..d99d96e074a 100644
--- a/engines/nancy/commontypes.cpp
+++ b/engines/nancy/commontypes.cpp
@@ -50,7 +50,7 @@ void SceneChangeDescription::readData(Common::SeekableReadStream &stream, bool l
}
}
-void SceneChangeWithFlag::readData(Common::SeekableReadStream &stream, bool reverseFormat) {
+void SceneChangeWithFlag::readData(Common::SeekableReadStream &stream, bool reverseFormat, bool terse) {
_sceneChange.sceneID = stream.readUint16LE();
_sceneChange.frameID = stream.readUint16LE();
_sceneChange.verticalOffset = stream.readUint16LE();
@@ -61,23 +61,29 @@ void SceneChangeWithFlag::readData(Common::SeekableReadStream &stream, bool reve
_flag.label = stream.readSint16LE();
_flag.flag = stream.readByte();
+ if (terse) {
+ stream.skip(1); // unknown
+ stream.skip(2); // shouldStopRendering
+ }
+
if (g_nancy->getGameType() >= kGameTypeNancy3) {
- int32 x = stream.readSint32LE();
- int32 y = stream.readSint32LE();
- int32 z = stream.readSint32LE();
+ int32 x = terse ? 0 : stream.readSint32LE();
+ int32 y = terse ? 0 : stream.readSint32LE();
+ int32 z = terse ? 1 : stream.readSint32LE();
_sceneChange.listenerFrontVector.set(x, y, z);
_sceneChange.frontVectorFrameID = _sceneChange.frameID;
}
} else {
if (g_nancy->getGameType() >= kGameTypeNancy3) {
- int32 x = stream.readSint32LE();
- int32 y = stream.readSint32LE();
- int32 z = stream.readSint32LE();
+ int32 x = terse ? 0 : stream.readSint32LE();
+ int32 y = terse ? 0 : stream.readSint32LE();
+ int32 z = terse ? 1 : stream.readSint32LE();
_sceneChange.listenerFrontVector.set(x, y, z);
_sceneChange.frontVectorFrameID = _sceneChange.frameID;
}
stream.skip(2); // shouldStopRendering
+
_flag.label = stream.readSint16LE();
_flag.flag = stream.readByte();
}
diff --git a/engines/nancy/commontypes.h b/engines/nancy/commontypes.h
index 8d1cf27be6f..9a55aaad7c7 100644
--- a/engines/nancy/commontypes.h
+++ b/engines/nancy/commontypes.h
@@ -173,7 +173,7 @@ struct SceneChangeWithFlag {
SceneChangeDescription _sceneChange;
FlagDescription _flag;
- void readData(Common::SeekableReadStream &stream, bool reverseFormat = false);
+ void readData(Common::SeekableReadStream &stream, bool reverseFormat = false, bool terse = false);
void execute();
};
More information about the Scummvm-git-logs
mailing list