[Scummvm-git-logs] scummvm master -> 378bdab844a94637ede52ae504ca8715fadd35dd
bluegr
noreply at scummvm.org
Wed Jun 24 00:23:17 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:
378bdab844 NANCY: Clean up handling of the player scrolling flag for Nancy11+
Commit: 378bdab844a94637ede52ae504ca8715fadd35dd
https://github.com/scummvm/scummvm/commit/378bdab844a94637ede52ae504ca8715fadd35dd
Author: Filippos Karapetis (bluegr at gmail.com)
Date: 2026-06-24T03:23:05+03:00
Commit Message:
NANCY: Clean up handling of the player scrolling flag for Nancy11+
This flag is actually stored in a reserved event flag (33), so it's
already stored in saved games. The code for synchronizing the
_playerScrollingEnabled was never actually used, as in the save
game code, the version used in the serializer isn't the game type,
but the save game version, so this was dead code (oops).
Now, the reserved flag is handled instead. Also, added a note to
remember that _lastHintCharacter and _lastHintID can be repurposed
by newer games, if needed, to avoid bumping the save version
Changed paths:
engines/nancy/state/scene.cpp
engines/nancy/state/scene.h
diff --git a/engines/nancy/state/scene.cpp b/engines/nancy/state/scene.cpp
index 11368fef74f..18571f13cdd 100644
--- a/engines/nancy/state/scene.cpp
+++ b/engines/nancy/state/scene.cpp
@@ -573,6 +573,26 @@ bool Scene::getEventFlag(FlagDescription eventFlag) const {
return getEventFlag(eventFlag.label, eventFlag.flag);
}
+// Nancy 11+ AR 30/31 store the "player scrolling disabled" state in event flag
+// 1033 (eventData[0x21] in the original; nancy3+ event-flag labels start at
+// 1000, so this is index 33). It persists across scenes and is saved/restored
+// together with the rest of the event flags.
+static const int16 kPlayerScrollingDisabledFlag = 1033;
+
+void Scene::setPlayerScrolling(bool enabled) {
+ setEventFlag(kPlayerScrollingDisabledFlag, enabled ? g_nancy->_false : g_nancy->_true);
+}
+
+bool Scene::getPlayerScrolling() const {
+ // Player-scrolling control only exists from Nancy 11; older games must not
+ // consult this flag, since they may use that event-flag index for something else
+ if (g_nancy->getGameType() < kGameTypeNancy11) {
+ return true;
+ }
+
+ return !getEventFlag(kPlayerScrollingDisabledFlag, g_nancy->_true);
+}
+
void Scene::setLogicCondition(int16 label, byte flag) {
if (label > kEvNoEvent) {
if (label >= 2000) {
@@ -785,6 +805,9 @@ void Scene::synchronize(Common::Serializer &ser) {
ser.syncAsUint16LE(_difficulty);
ser.syncArray<uint16>(_hintsRemaining.data(), _hintsRemaining.size(), Common::Serializer::Uint16LE);
+ // NOTE: These two variables are only used by the hint system in
+ // Nancy 1, so they can be freely repurposed by newer games to
+ // store new data, if needed, to avoid bumping the save version.
ser.syncAsSint16LE(_lastHintCharacter);
ser.syncAsSint16LE(_lastHintID);
@@ -822,8 +845,6 @@ void Scene::synchronize(Common::Serializer &ser) {
}
}
- ser.syncAsByte(_playerScrollingEnabled, kGameTypeNancy11);
-
_isRunningAd = false;
ConfMan.removeKey("restore_after_ad", Common::ConfigManager::kTransientDomain);
@@ -1317,9 +1338,6 @@ void Scene::initStaticData() {
auto *bootSummary = GetEngineData(BSUM);
assert(bootSummary);
- // Nancy 11+ AR 30/31. Player scrolling defaults to enabled at game start.
- _playerScrollingEnabled = true;
-
Common::Path imageName = "FRAME";
if (g_nancy->getGameType() <= kGameTypeNancy9) {
diff --git a/engines/nancy/state/scene.h b/engines/nancy/state/scene.h
index f99ba40d4d9..407971b6b9c 100644
--- a/engines/nancy/state/scene.h
+++ b/engines/nancy/state/scene.h
@@ -171,9 +171,10 @@ public:
Time getMovementTimeDelta(bool fast) const { return fast ? _sceneState.summary.fastMoveTimeDelta : _sceneState.summary.slowMoveTimeDelta; }
// Nancy 11+ AR 30/31. Toggles whether the player may scroll/pan the viewport.
- // Persists across scene changes until changed by another StartPlayerScrolling/StopPlayerScrolling.
- void setPlayerScrolling(bool enabled) { _playerScrollingEnabled = enabled; }
- bool getPlayerScrolling() const { return _playerScrollingEnabled; }
+ // Backed by a reserved event flag (so it persists across scene changes and
+ // is saved/restored with the rest of the event flags).
+ void setPlayerScrolling(bool enabled);
+ bool getPlayerScrolling() const;
void registerGraphics();
@@ -338,9 +339,6 @@ private:
bool _destroyOnExit;
bool _isRunningAd;
- // Nancy 11+ AR 30/31. Whether the player is currently allowed to scroll the viewport.
- bool _playerScrollingEnabled = true;
-
State _state;
};
More information about the Scummvm-git-logs
mailing list