[Scummvm-git-logs] scummvm master -> b36b31560c987f2c29b42556f369f5f972610daa
bluegr
noreply at scummvm.org
Sat Oct 31 08:46:19 UTC 2026
This automated email contains information about 68 new commits which have been
pushed to the 'scummvm' repo located at https://api.github.com/repos/scummvm/scummvm .
Summary:
636c168e90 NANCY: NANCY21: Include each script only once in a scene
5e7103e26c NANCY: NANCY19: Hand messages to the records made in this frame
2575296bb5 NANCY: NANCY19: Load the scene of a saved game after its flags
aa47d86a04 NANCY: Draw at 60 frames per second
2af6952c10 NANCY: Ignore engine sounds that a game doesn't have
5a1f21c483 NANCY: NANCY19: Only treat a sound as cut off when something stopped it
dcae74174d NANCY: NANCY19: Let scripts change the sounds of Sound records
c5391f0409 NANCY: NANCY21: Keep looping Sound records running
642f124c29 NANCY: NANCY20: Add and subtract vectors of different sizes
46a3d99a8b NANCY: NANCY21: Stop turning at the ends of nodes that don't wrap
68b9984c66 NANCY: NANCY21: Update records under graph nodes once a frame
b92d54ff29 NANCY: NANCY19: Implement Autotext:ShowCC and Autotext.newline
4f6e245291 NANCY: NANCY22: Number the sound channels like Nancy22 does
24f78980e7 NANCY: NANCY22: Remove loadstring and setfenv from the Lua scripts
4d62b2cb5f NANCY: NANCY22: Run the environment scripts in a single stream
d12ec8c3e1 NANCY: NANCY22: Add SetMessagingName to Override records
4779c11310 NANCY: NANCY22: Start the manager scripts with the game
06ec749742 NANCY: NANCY22: Add Game.loadName and Game.fastConvo
ee8db38556 NANCY: NANCY22: Add Restart to the records
e056c086ca NANCY: NANCY22: Add Scene:Change and Scene:Attach
76080528c2 NANCY: NANCY22: Add Rect.size
c2eb89a9dd NANCY: NANCY22: Add Player.curViewableStream
8132911020 NANCY: NANCY21: Add Save:Attic and Load:Attic
69bc7bdd9e NANCY: NANCY22: Add Save:GetScreenshotNames and name pictures _SSPIC
9ce4b411f1 NANCY: NANCY22: Add the source field to AnimOverlay records
e6d4290159 NANCY: NANCY22: Remove game check from the SetMessagingName Override
0ee30329a1 NANCY: NANCY19: Add UI:CreateObject and UI:DestroyObject
bcfc559869 NANCY: NANCY19: Move the XSheet code out of the conversations
325d2c29ba NANCY: NANCY22: Add the Xsheet record
d7bc1dd8fa NANCY: NANCY22: Add the Transformer record
d45c728f65 NANCY: NANCY22: Add the facade and enableUturn fields to summaries
98c89fb7ee NANCY: NANCY22: Let NavLogic hotspots act like buttons
3b5dea61f4 NANCY: NANCY22: Add the physics of the driving game
9a190e87df NANCY: NANCY20: Add the Path object
0a5fc93c43 NANCY: NANCY22: Transform rectangles and vectors like Nancy22 does
a62e023d14 NANCY: NANCY22: Add the rain, hail and dust particles
33b2cc7f84 NANCY: NANCY22: Change to unstable - the game now starts
ef2e13d6c3 NANCY: Share the XSheet reader between both conversation systems
1b66f042d0 NANCY: NANCY20: Add Game.cheatMode and the cheat_mode console command
07fcfe278b NANCY: NANCY16: Type into the edit box that was clicked
b323161dfe NANCY: NANCY22: Add the cycleFocus message
2a321daad0 NANCY: NANCY1NEW: Add the variable lists and the text variables
e1a90c3ddf NANCY: NANCY1NEW: Change to unstable - the game now starts
2d02d8194e NANCY: Keep movies in time with their sounds
c87d950eba NANCY: NANCY1NEW: Let the scripts use loadstring again
a419595913 NANCY: NANCY21: Allow scene summaries without a background
b99c46f02d NANCY: NANCY19: Send messages to scenes that are still loading
34a9c54a5b NANCY: NANCY22: Keep Xsheet records on screen when restarted
76233ae4e4 NANCY: NANCY19: Let Esc skip movies that stop on their last frame
cac30326f6 NANCY: NANCY20: Add Rect:RightBottomSet and the number of a Color
bfdec0ab16 NANCY: NANCY20: Add Path:AddPoint
c65f95592e NANCY: NANCY20: Implement Ref:SampleArea
ad6bdad64b NANCY: NANCY21: Count particles from the last one made
0fe2373399 NANCY: NANCY22: Let Save:Data keep Rects
6bc3baea3b NANCY: NANCY22: Add the beginFlash and endFlash messages
0cd85aa17e NANCY: NANCY1NEW: Add the stages of particle records by name
0505d9ca2a NANCY: NANCY23: Add Streams:GetTime
da3627ede7 NANCY: NANCY19: Add Game.time
26a43c461b NANCY: NANCY23: Add Game.hourFormat
c6a2fbbf45 NANCY: NANCY23: Implement Sound:StopIfPlaying
91eedf66bb NANCY: NANCY23: Add FastForward to Physics records
413ffea46c NANCY: NANCY23: Load the font files that come with the game
32c7361c40 NANCY: NANCY23: Let Ref:Add load pictures the camera took
739d79bbfb NANCY: NANCY23: Implement Ref:Difference
98dbec6a04 NANCY: NANCY23: Draw the calligraphy with particles
7478f4d05f NANCY: NANCY23: Add detection entry and set it to unstable
794ea9baf3 NANCY: Simplify game detection entries
b36b31560c NANCY: Move all resource-related code inside the new resource folder
Commit: 636c168e90aaf8306c7ecfcf45b6a0ac629d093d
https://github.com/scummvm/scummvm/commit/636c168e90aaf8306c7ecfcf45b6a0ac629d093d
Author: Filippos Karapetis (bluegr at gmail.com)
Date: 2026-10-31T10:41:29+02:00
Commit Message:
NANCY: NANCY21: Include each script only once in a scene
Scripts that include each other, like ThemeManager_SC and
ThemeControls_SC in Nancy22, don't include each other forever anymore.
As in the original from Nancy21 on, a scene skips a script it has
already included.
Changed paths:
engines/nancy/script/scenecontext.cpp
engines/nancy/script/scenecontext.h
diff --git a/engines/nancy/script/scenecontext.cpp b/engines/nancy/script/scenecontext.cpp
index 880e0ed79b9..0c6cafd7cd6 100644
--- a/engines/nancy/script/scenecontext.cpp
+++ b/engines/nancy/script/scenecontext.cpp
@@ -109,7 +109,7 @@ bool SceneContext::load() {
const ScriptBootData *boot = (const ScriptBootData *)g_nancy->getEngineData("ScriptBootData");
if (boot) {
for (const Common::String &name : boot->includeFileNames) {
- if (!_lua->runScript(name)) {
+ if (!include(name)) {
return false;
}
}
@@ -175,6 +175,14 @@ Common::String SceneContext::findGlobalName(const Record *record) const {
}
bool SceneContext::include(const Common::String &name) {
+ if (g_nancy->getGameType() >= kGameTypeNancy21) {
+ if (_includedNames.contains(name)) {
+ return true;
+ }
+
+ _includedNames.setVal(name, true);
+ }
+
return _lua->runScript(name);
}
diff --git a/engines/nancy/script/scenecontext.h b/engines/nancy/script/scenecontext.h
index 6ed8543227c..0f0affbcd65 100644
--- a/engines/nancy/script/scenecontext.h
+++ b/engines/nancy/script/scenecontext.h
@@ -138,7 +138,9 @@ public:
// Lets the records under a node know that it changed its z or transform
void onGraphNodeChanged(GraphNode *node);
- // Runs another script as a part of this scene
+ // Runs another script as a part of this scene. From Nancy21 on, a script
+ // that the scene already included is left out, since scripts include each
+ // other, e.g. ThemeManager_SC and ThemeControls_SC in Nancy22.
bool include(const Common::String &name);
// Changes the scene of a stream; no name stands for the one this scene is in
@@ -177,6 +179,7 @@ private:
Common::Array<ConvoResponse *> _convoResponses;
Common::Array<GraphNode *> _graphNodes;
Common::HashMap<Common::String, RefImage *, Common::IgnoreCase_Hash, Common::IgnoreCase_EqualTo> _refs;
+ Common::HashMap<Common::String, bool, Common::IgnoreCase_Hash, Common::IgnoreCase_EqualTo> _includedNames;
double _time = 0.0;
double _elapsedTime = 0.0;
Commit: 5e7103e26c9746080a1d41cd0006b0edfe864815
https://github.com/scummvm/scummvm/commit/5e7103e26c9746080a1d41cd0006b0edfe864815
Author: Filippos Karapetis (bluegr at gmail.com)
Date: 2026-10-31T10:41:31+02:00
Commit Message:
NANCY: NANCY19: Hand messages to the records made in this frame
A record that a scene made while it loaded now gets messages right
away. The scripts of Nancy22 call its managers that way as soon as
they load.
Changed paths:
engines/nancy/script/scenecontext.cpp
diff --git a/engines/nancy/script/scenecontext.cpp b/engines/nancy/script/scenecontext.cpp
index 0c6cafd7cd6..04ffb4c0641 100644
--- a/engines/nancy/script/scenecontext.cpp
+++ b/engines/nancy/script/scenecontext.cpp
@@ -333,8 +333,11 @@ bool SceneContext::receiveMessage(const Message &message, bool &wasTaken) {
return true;
}
+ // The records made this frame get messages as well, e.g. the managers of
+ // Nancy22, which the scripts of other scenes call on as soon as they load
bool hasReceiver = false;
- const Common::Array<Record *> records = _records;
+ Common::Array<Record *> records = _records;
+ records.push_back(_newRecords);
for (Record *record : records) {
if (!record->hasMessagingName(message.target)) {
continue;
Commit: 2575296bb5d776e709369af500c477e173e6ca26
https://github.com/scummvm/scummvm/commit/2575296bb5d776e709369af500c477e173e6ca26
Author: Filippos Karapetis (bluegr at gmail.com)
Date: 2026-10-31T10:41:33+02:00
Commit Message:
NANCY: NANCY19: Load the scene of a saved game after its flags
The script of the scene of a loaded game now runs once the flags, the
values the scripts saved and the UI are back. Scenes read those while
they load, e.g. scene 1000 of Nancy22 picks its background by a flag.
Changed paths:
engines/nancy/state/scene.cpp
diff --git a/engines/nancy/state/scene.cpp b/engines/nancy/state/scene.cpp
index 1f1c68107fa..96a3ca92e13 100644
--- a/engines/nancy/state/scene.cpp
+++ b/engines/nancy/state/scene.cpp
@@ -1750,7 +1750,12 @@ void Scene::synchronize(Common::Serializer &ser) {
g_nancy->_sound->stopAllSounds();
_streams.clear();
- load(true);
+
+ // The scripts of a scene read the flags and what the scripts saved
+ // while the scene loads, so it waits until those are back
+ if (g_nancy->getGameType() < kGameTypeNancy19) {
+ load(true);
+ }
}
ser.syncAsUint16LE(_sceneState.pushedScene.sceneID);
@@ -1960,6 +1965,10 @@ void Scene::synchronize(Common::Serializer &ser) {
_ndui->restoreState(((UIStateData *)getPuzzleData(UIStateData::getTag()))->changes);
}
+ if (g_nancy->getGameType() >= kGameTypeNancy19) {
+ load(true);
+ }
+
if (!_streams.isEmpty()) {
_streams.restore();
}
Commit: aa47d86a042a751e8fee742ebe8bbe149655bd4c
https://github.com/scummvm/scummvm/commit/aa47d86a042a751e8fee742ebe8bbe149655bd4c
Author: Filippos Karapetis (bluegr at gmail.com)
Date: 2026-10-31T10:41:36+02:00
Commit Message:
NANCY: Draw at 60 frames per second
The frames now follow each other at exactly 60 a second, instead of
every 16 ms. The driving game of Nancy22 moves its cars 60 times a
second, and its scrolling jumped whenever a frame got none or two.
Changed paths:
engines/nancy/nancy.cpp
diff --git a/engines/nancy/nancy.cpp b/engines/nancy/nancy.cpp
index ef980c7c6e1..cf4399bf992 100644
--- a/engines/nancy/nancy.cpp
+++ b/engines/nancy/nancy.cpp
@@ -542,6 +542,12 @@ Common::Error NancyEngine::run() {
bool graphicsWereSuppressed = false;
+ // The frames follow each other at 60 a second, as the original, which waits
+ // for the display. Later games step what they move 60 times a second, so a
+ // frame that is a little short would make the scrolling jump.
+ const double kFrameMillis = 1000.0 / 60.0;
+ double nextFrameTime = _system->getMillis();
+
// Main loop
while (true) {
_input->processEvents();
@@ -549,7 +555,13 @@ Common::Error NancyEngine::run() {
break;
}
- uint32 frameEndTime = _system->getMillis() + 16;
+ // A frame that came too late doesn't make the next ones shorter
+ nextFrameTime += kFrameMillis;
+ if (nextFrameTime < _system->getMillis()) {
+ nextFrameTime = _system->getMillis() + kFrameMillis;
+ }
+
+ uint32 frameEndTime = (uint32)nextFrameTime;
if (!graphicsWereSuppressed) {
_cursor->setCursorType(CursorManager::kNormalArrow);
Commit: 2af6952c101b0cc362b035f33ed122bf6e119e37
https://github.com/scummvm/scummvm/commit/2af6952c101b0cc362b035f33ed122bf6e119e37
Author: Filippos Karapetis (bluegr at gmail.com)
Date: 2026-10-31T10:41:43+02:00
Commit Message:
NANCY: Ignore engine sounds that a game doesn't have
Nancy19 and up have none of the engine's own sounds. Stopping one of
them stopped channel 0 instead, which led to the theme music being
played in Nancy22.
Changed paths:
engines/nancy/sound.cpp
diff --git a/engines/nancy/sound.cpp b/engines/nancy/sound.cpp
index 1e86655135a..fcae44c4e45 100644
--- a/engines/nancy/sound.cpp
+++ b/engines/nancy/sound.cpp
@@ -489,7 +489,9 @@ void SoundManager::pauseSound(const SoundDescription &description, bool pause) {
}
void SoundManager::pauseSound(const Common::String &chunkName, bool pause) {
- pauseSound(_commonSounds[chunkName], pause);
+ if (_commonSounds.contains(chunkName)) {
+ pauseSound(_commonSounds[chunkName], pause);
+ }
}
void SoundManager::pauseAllSounds(bool pause) {
@@ -516,8 +518,9 @@ bool SoundManager::isSoundPlaying(const SoundDescription &description) const {
}
}
+// Nancy19 and up have no common sounds
bool SoundManager::isSoundPlaying(const Common::String &chunkName) const {
- return isSoundPlaying(_commonSounds[chunkName]);
+ return _commonSounds.contains(chunkName) && isSoundPlaying(_commonSounds[chunkName]);
}
void SoundManager::stopSound(uint16 channelID) {
@@ -552,7 +555,9 @@ void SoundManager::stopSound(const SoundDescription &description) {
}
void SoundManager::stopSound(const Common::String &chunkName) {
- stopSound(_commonSounds[chunkName]);
+ if (_commonSounds.contains(chunkName)) {
+ stopSound(_commonSounds[chunkName]);
+ }
}
void SoundManager::stopAllSounds() {
Commit: 5a1f21c48386c0542ee60ea23faa73c5b785346f
https://github.com/scummvm/scummvm/commit/5a1f21c48386c0542ee60ea23faa73c5b785346f
Author: Filippos Karapetis (bluegr at gmail.com)
Date: 2026-10-31T10:41:45+02:00
Commit Message:
NANCY: NANCY19: Only treat a sound as cut off when something stopped it
A Sound record counted as cut off whenever its sound ended a little
before the length the engine worked out for it. The theme manager of
Nancy22 then reported a song as stopped by someone else. Now, a sound
only counts as cut off when another sound starts on its channel, or
the channel is stopped.
Changed paths:
engines/nancy/script/records.cpp
engines/nancy/script/records.h
engines/nancy/sound.cpp
engines/nancy/sound.h
diff --git a/engines/nancy/script/records.cpp b/engines/nancy/script/records.cpp
index 9449a699b1f..3056ef35fc9 100644
--- a/engines/nancy/script/records.cpp
+++ b/engines/nancy/script/records.cpp
@@ -1307,6 +1307,7 @@ void SoundRecord::runOnce() {
_isPlaying = g_nancy->_sound->isSoundPlaying(_sound);
_wasPreempted = false;
+ _channelSerial = g_nancy->_sound->getChannelSerial(_channel);
// The record is done once the sound has played through, whether it loops or not
const double length = _isPlaying ? g_nancy->_sound->getLength(_sound).msecs() / 1000.0 : 0.0;
@@ -1321,8 +1322,9 @@ void SoundRecord::runOnce() {
}
void SoundRecord::run(double sceneTime, double elapsedTime) {
- // Something else taking over the channel ends the record early
- if (_isPlaying && !_isLooping && !g_nancy->_sound->isSoundPlaying(_sound) && sceneTime < _endTime) {
+ // The sound is cut off when another sound starts on its channel, or the
+ // channel is stopped. Ending a little before its length doesn't count.
+ if (_isPlaying && g_nancy->_sound->getChannelSerial(_channel) != _channelSerial && (sceneTime < _endTime || _isLooping)) {
_wasPreempted = true;
}
diff --git a/engines/nancy/script/records.h b/engines/nancy/script/records.h
index a4d31af041d..a95ab0da872 100644
--- a/engines/nancy/script/records.h
+++ b/engines/nancy/script/records.h
@@ -331,6 +331,7 @@ private:
Common::String _caption; // what the sound says, while it is the one on screen
bool _isPlaying = false;
bool _wasPreempted = false;
+ uint32 _channelSerial = 0; // of the channel, once the sound started
double _endTime = 0.0;
};
diff --git a/engines/nancy/sound.cpp b/engines/nancy/sound.cpp
index fcae44c4e45..db2e7b4ad70 100644
--- a/engines/nancy/sound.cpp
+++ b/engines/nancy/sound.cpp
@@ -313,6 +313,8 @@ void SoundManager::loadSound(const SoundDescription &description, SoundEffectDes
}
Channel &existing = _channels[description.channelID];
+ ++existing.serial;
+
if (!forceReload && existing.stream != nullptr) {
// There's a channel already loaded. Check if we're trying to reload the exact same sound
if ( description.name == existing.name &&
@@ -523,11 +525,16 @@ bool SoundManager::isSoundPlaying(const Common::String &chunkName) const {
return _commonSounds.contains(chunkName) && isSoundPlaying(_commonSounds[chunkName]);
}
+uint32 SoundManager::getChannelSerial(uint16 channelID) const {
+ return channelID < _channels.size() ? _channels[channelID].serial : 0;
+}
+
void SoundManager::stopSound(uint16 channelID) {
if (channelID >= _channels.size())
return;
Channel &chan = _channels[channelID];
+ ++chan.serial;
if (isSoundPlaying(channelID)) {
_mixer->stopHandle(chan.handle);
diff --git a/engines/nancy/sound.h b/engines/nancy/sound.h
index 717933abcb4..0ff82579841 100644
--- a/engines/nancy/sound.h
+++ b/engines/nancy/sound.h
@@ -81,6 +81,11 @@ public:
bool isSoundPlaying(const SoundDescription &description) const;
bool isSoundPlaying(const Common::String &chunkName) const;
+ // Goes up whenever a sound starts on the channel or the channel is stopped,
+ // but not when a sound ends by itself. Nancy19 records tell from it whether
+ // their sound was cut off.
+ uint32 getChannelSerial(uint16 channelID) const;
+
void stopSound(uint16 channelID);
void stopSound(const SoundDescription &description);
void stopSound(const Common::String &chunkName);
@@ -155,6 +160,7 @@ protected:
Audio::AudioStream *streamForMixer = nullptr;
Audio::SoundHandle handle;
bool isPersistent = false;
+ uint32 serial = 0;
// Sound effect data, not applicable to nancy2 and below
SoundEffectDescription *effectData = nullptr;
Commit: dcae74174d50f87be9829e7d687ae3ed3b2f4493
https://github.com/scummvm/scummvm/commit/dcae74174d50f87be9829e7d687ae3ed3b2f4493
Author: Filippos Karapetis (bluegr at gmail.com)
Date: 2026-10-31T10:41:47+02:00
Commit Message:
NANCY: NANCY19: Let scripts change the sounds of Sound records
Scripts can now set the sounds, channel, volume, loop and caption of a
Sound record before restarting it, and read its sounds and duration.
The sound system and the conversations of Nancy22 work that way.
Before, they kept playing "silence_SFX", which also wiped subtitles.
Changed paths:
engines/nancy/script/records.cpp
engines/nancy/script/records.h
diff --git a/engines/nancy/script/records.cpp b/engines/nancy/script/records.cpp
index 3056ef35fc9..2906f09ed54 100644
--- a/engines/nancy/script/records.cpp
+++ b/engines/nancy/script/records.cpp
@@ -1310,8 +1310,8 @@ void SoundRecord::runOnce() {
_channelSerial = g_nancy->_sound->getChannelSerial(_channel);
// The record is done once the sound has played through, whether it loops or not
- const double length = _isPlaying ? g_nancy->_sound->getLength(_sound).msecs() / 1000.0 : 0.0;
- _endTime = getContext().getTime() + length;
+ _duration = _isPlaying ? g_nancy->_sound->getLength(_sound).msecs() / 1000.0 : 0.0;
+ _endTime = getContext().getTime() + _duration;
// What the sound says is kept under its name
UI::NDUI::Manager *ui = NancySceneState.getNDUI();
@@ -1347,6 +1347,36 @@ bool SoundRecord::prepareReset() {
return true;
}
+// Scripts hand a record other sounds, or move it to another channel, and then
+// restart it. A record that plays stops when it moves.
+bool SoundRecord::setField(const Common::String &key) {
+ lua_State *L = getLua();
+
+ if (key == "channel") {
+ if (_isPlaying && hasStarted() && !isDone()) {
+ g_nancy->_sound->stopSound(_sound);
+ }
+
+ _channel = checkSoundChannel(L, 3);
+ } else if (key == "volume") {
+ _volume = luaL_checknumber(L, 3);
+ } else if (key == "useCC") {
+ _usesCaption = lua_toboolean(L, 3) != 0;
+ } else if (key == "loop") {
+ _isLooping = lua_toboolean(L, 3) != 0;
+ } else if (key == "sounds") {
+ _names.clear();
+ readStringList(L, 3, _names);
+ if (_names.empty()) {
+ luaL_error(L, "sounds must have one or more fields in its table");
+ }
+ } else {
+ return false;
+ }
+
+ return true;
+}
+
bool SoundRecord::getField(const Common::String &key) {
lua_State *L = getLua();
@@ -1360,6 +1390,19 @@ bool SoundRecord::getField(const Common::String &key) {
lua_pushnumber(L, _endTime);
} else if (key == "preempted") {
lua_pushboolean(L, _wasPreempted);
+ } else if (key == "duration") {
+ lua_pushnumber(L, _duration);
+ } else if (key == "sounds") {
+ // A single sound comes back as its name
+ if (_names.size() == 1) {
+ lua_pushstring(L, _names[0].c_str());
+ } else {
+ lua_createtable(L, _names.size(), 0);
+ for (uint i = 0; i < _names.size(); ++i) {
+ lua_pushstring(L, _names[i].c_str());
+ lua_rawseti(L, -2, i + 1);
+ }
+ }
} else {
return false;
}
diff --git a/engines/nancy/script/records.h b/engines/nancy/script/records.h
index a95ab0da872..6e3a9701c50 100644
--- a/engines/nancy/script/records.h
+++ b/engines/nancy/script/records.h
@@ -319,6 +319,7 @@ protected:
void run(double sceneTime, double elapsedTime) override;
bool prepareReset() override;
bool getField(const Common::String &key) override;
+ bool setField(const Common::String &key) override;
private:
Common::Array<Common::String> _names;
@@ -332,6 +333,7 @@ private:
bool _isPlaying = false;
bool _wasPreempted = false;
uint32 _channelSerial = 0; // of the channel, once the sound started
+ double _duration = 0.0; // of the sound that plays, in seconds
double _endTime = 0.0;
};
Commit: c5391f0409a60ada708ddd37e71e08bd8c6e73af
https://github.com/scummvm/scummvm/commit/c5391f0409a60ada708ddd37e71e08bd8c6e73af
Author: Filippos Karapetis (bluegr at gmail.com)
Date: 2026-10-31T10:41:49+02:00
Commit Message:
NANCY: NANCY21: Keep looping Sound records running
A Sound record with a looping sound doesn't end after the first time
through anymore, so the ambient loops of Nancy22 keep playing.
Changed paths:
engines/nancy/script/records.cpp
diff --git a/engines/nancy/script/records.cpp b/engines/nancy/script/records.cpp
index 2906f09ed54..bcb5ed6e54b 100644
--- a/engines/nancy/script/records.cpp
+++ b/engines/nancy/script/records.cpp
@@ -1328,7 +1328,10 @@ void SoundRecord::run(double sceneTime, double elapsedTime) {
_wasPreempted = true;
}
- if (_endTime <= sceneTime || _wasPreempted) {
+ // From Nancy21 on, a sound that loops keeps the record going
+ const bool hasPlayedThrough = _endTime <= sceneTime && !(_isLooping && g_nancy->getGameType() >= kGameTypeNancy21);
+
+ if (hasPlayedThrough || _wasPreempted) {
// The caption goes with the sound, unless another one has replaced it
UI::NDUI::Manager *ui = NancySceneState.getNDUI();
if (!_caption.empty() && ui && ui->getCaption() == _caption) {
Commit: 642f124c2959a7faa23630286ca510bcb688d0e9
https://github.com/scummvm/scummvm/commit/642f124c2959a7faa23630286ca510bcb688d0e9
Author: Filippos Karapetis (bluegr at gmail.com)
Date: 2026-10-31T10:41:53+02:00
Commit Message:
NANCY: NANCY20: Add and subtract vectors of different sizes
>From Nancy20 on, arithmetic on two vectors of different sizes gives a
vector of the larger size, with 0 for what the smaller one lacks. The
driving game of Nancy22 mixes 2D and 3D vectors.
Changed paths:
engines/nancy/script/mathtypes.cpp
diff --git a/engines/nancy/script/mathtypes.cpp b/engines/nancy/script/mathtypes.cpp
index 03b3ce5e231..4551b10c319 100644
--- a/engines/nancy/script/mathtypes.cpp
+++ b/engines/nancy/script/mathtypes.cpp
@@ -22,6 +22,8 @@
#include "common/scummsys.h"
#include "common/util.h"
+#include "engines/nancy/nancy.h"
+
#include "engines/nancy/script/luabind.h"
#include "engines/nancy/script/mathtypes.h"
@@ -249,19 +251,27 @@ static int vectorNewIndex(lua_State *L) {
return 0;
}
+// Nancy19 only works on two vectors of the same size. From Nancy20 on, the
+// result has the size of the larger one, and what the smaller one lacks is 0.
static void checkSameSize(lua_State *L, const ScriptVector &a, const ScriptVector &b) {
- if (a.size != b.size) {
+ if (a.size != b.size && g_nancy->getGameType() < kGameTypeNancy20) {
luaL_error(L, "Vector 1 has %d dimensions but vector 2 has %d dimensions", a.size, b.size);
}
}
+static double getComponent(const ScriptVector &vector, int index) {
+ return index < vector.size ? vector.v[index] : 0.0;
+}
+
static int vectorAdd(lua_State *L) {
- ScriptVector result = checkVector(L, 1);
- const ScriptVector &other = checkVector(L, 2);
- checkSameSize(L, result, other);
+ const ScriptVector &left = checkVector(L, 1);
+ const ScriptVector &right = checkVector(L, 2);
+ checkSameSize(L, left, right);
+ ScriptVector result;
+ result.size = MAX(left.size, right.size);
for (int i = 0; i < result.size; ++i) {
- result.v[i] += other.v[i];
+ result.v[i] = getComponent(left, i) + getComponent(right, i);
}
pushVector(L, result);
@@ -269,12 +279,14 @@ static int vectorAdd(lua_State *L) {
}
static int vectorSubtract(lua_State *L) {
- ScriptVector result = checkVector(L, 1);
- const ScriptVector &other = checkVector(L, 2);
- checkSameSize(L, result, other);
+ const ScriptVector &left = checkVector(L, 1);
+ const ScriptVector &right = checkVector(L, 2);
+ checkSameSize(L, left, right);
+ ScriptVector result;
+ result.size = MAX(left.size, right.size);
for (int i = 0; i < result.size; ++i) {
- result.v[i] -= other.v[i];
+ result.v[i] = getComponent(left, i) - getComponent(right, i);
}
pushVector(L, result);
@@ -289,9 +301,9 @@ static int vectorMultiply(lua_State *L) {
ScriptVector result;
if (left && right) {
checkSameSize(L, *left, *right);
- result = *left;
+ result.size = MAX(left->size, right->size);
for (int i = 0; i < result.size; ++i) {
- result.v[i] *= right->v[i];
+ result.v[i] = getComponent(*left, i) * getComponent(*right, i);
}
} else {
result = left ? *left : checkVector(L, 2);
@@ -315,8 +327,10 @@ static int vectorDivide(lua_State *L) {
if (right) {
checkSameSize(L, result, *right);
+ const ScriptVector left = result;
+ result.size = MAX(left.size, right->size);
for (int i = 0; i < result.size; ++i) {
- result.v[i] /= right->v[i];
+ result.v[i] = getComponent(left, i) / getComponent(*right, i);
}
} else {
const double divisor = luaL_checknumber(L, 2);
@@ -345,8 +359,8 @@ static int vectorDot(lua_State *L) {
checkSameSize(L, a, b);
double sum = 0.0;
- for (int i = 0; i < a.size; ++i) {
- sum += a.v[i] * b.v[i];
+ for (int i = 0; i < MAX(a.size, b.size); ++i) {
+ sum += getComponent(a, i) * getComponent(b, i);
}
lua_pushnumber(L, sum);
@@ -388,8 +402,10 @@ static int vectorLerp(lua_State *L) {
const double amount = luaL_checknumber(L, 3);
checkSameSize(L, result, other);
+ const ScriptVector from = result;
+ result.size = MAX(from.size, other.size);
for (int i = 0; i < result.size; ++i) {
- result.v[i] += (other.v[i] - result.v[i]) * amount;
+ result.v[i] = getComponent(from, i) + (getComponent(other, i) - getComponent(from, i)) * amount;
}
pushVector(L, result);
Commit: 46a3d99a8b5d9467480a0e2c6628abc721d10862
https://github.com/scummvm/scummvm/commit/46a3d99a8b5d9467480a0e2c6628abc721d10862
Author: Filippos Karapetis (bluegr at gmail.com)
Date: 2026-10-31T10:41:55+02:00
Commit Message:
NANCY: NANCY21: Stop turning at the ends of nodes that don't wrap
A node whose summary sets wrap = false now stops at its first and last
frame, instead of turning on past them.
Changed paths:
engines/nancy/script/records.cpp
engines/nancy/script/records.h
diff --git a/engines/nancy/script/records.cpp b/engines/nancy/script/records.cpp
index bcb5ed6e54b..6f54235cc18 100644
--- a/engines/nancy/script/records.cpp
+++ b/engines/nancy/script/records.cpp
@@ -292,6 +292,9 @@ void SummaryRecord::readTable(int tableIndex) {
lua_pop(L, 1);
+ // Whether turning goes on past the first and the last frame
+ readField(L, tableIndex, "wrap", _wraps);
+
// The background is behind everything else
limitZ(kBackgroundScriptZ);
}
@@ -379,9 +382,9 @@ SummaryRecord::Turn SummaryRecord::getTurnAt(const ScriptPoint &point, bool inVi
const Common::Point place = point.toPoint();
if (boot->leftNodeHotspot.contains(place)) {
- return kTurnLeft;
+ return canTurn(kTurnLeft) ? kTurnLeft : kNoTurn;
} else if (boot->rightNodeHotspot.contains(place)) {
- return kTurnRight;
+ return canTurn(kTurnRight) ? kTurnRight : kNoTurn;
} else if (boot->uturnNodeHotspot.contains(place)) {
return kTurnAround;
}
@@ -389,6 +392,16 @@ SummaryRecord::Turn SummaryRecord::getTurnAt(const ScriptPoint &point, bool inVi
return kNoTurn;
}
+// Turning left goes to the next frame, and right to the one before. A node that
+// doesn't wrap stops at its first and last frame.
+bool SummaryRecord::canTurn(Turn turn) const {
+ if (_wraps) {
+ return true;
+ }
+
+ return turn == kTurnLeft ? _frame + 1 < _numFrames : _frame > 0;
+}
+
void SummaryRecord::onMouseMove(const ScriptPoint &point, bool inViewport) {
// The view turns by itself while the mouse stays on a side, after a first wait
Turn turn = getTurnAt(point, inViewport);
@@ -467,6 +480,10 @@ void SummaryRecord::run(double sceneTime, double elapsedTime) {
return;
}
+ if (!canTurn(_turn)) {
+ return;
+ }
+
if (_lastTurnTime + 0.5 < sceneTime || (_isTurningFast && _lastTurnTime + 0.2 < sceneTime)) {
if (_turn == kTurnLeft) {
setFrame((_frame + 1) % _numFrames);
diff --git a/engines/nancy/script/records.h b/engines/nancy/script/records.h
index 6e3a9701c50..cfeb87edfba 100644
--- a/engines/nancy/script/records.h
+++ b/engines/nancy/script/records.h
@@ -122,6 +122,7 @@ private:
// The side of the node the mouse is on
Turn getTurnAt(const ScriptPoint &point, bool inViewport) const;
+ bool canTurn(Turn turn) const;
void setFrame(uint frame);
void playTheme();
void updateTheme(double sceneTime);
@@ -142,6 +143,8 @@ private:
bool _isTurningFast = false;
double _lastTurnTime = 0.0;
double _sceneTime = 0.0;
+
+ bool _wraps = true;
};
// Changes the scene and sets flags, either right away or when its hotspot gets clicked
Commit: 68b9984c66adbc1d96be707d8ba63bd49b2f3693
https://github.com/scummvm/scummvm/commit/68b9984c66adbc1d96be707d8ba63bd49b2f3693
Author: Filippos Karapetis (bluegr at gmail.com)
Date: 2026-10-31T10:41:57+02:00
Commit Message:
NANCY: NANCY21: Update records under graph nodes once a frame
The records under a graph node now catch up with its changes once a
frame. The driving game of Nancy22 needs this, as it moves its nodes
with every step of its physics.
Changed paths:
engines/nancy/script/scenecontext.cpp
engines/nancy/script/scenecontext.h
diff --git a/engines/nancy/script/scenecontext.cpp b/engines/nancy/script/scenecontext.cpp
index 04ffb4c0641..25cc9cdf68d 100644
--- a/engines/nancy/script/scenecontext.cpp
+++ b/engines/nancy/script/scenecontext.cpp
@@ -374,6 +374,7 @@ void SceneContext::run(double elapsedTime) {
}
renderAttachment();
+ applyGraphNodeChanges();
for (Record *record : _records) {
record->updateGraphics();
@@ -481,16 +482,39 @@ GraphNode *SceneContext::createGraphNode() {
return node;
}
+// Nodes change many times a frame, e.g. the cars of Nancy22's driving game with
+// every step of the physics, so the records under them only catch up once the
+// frame is over. Their transform and z are always worked out when asked for.
void SceneContext::onGraphNodeChanged(GraphNode *node) {
- for (Record *record : _records) {
- if (record->getParentNode() && record->getParentNode()->isUnder(node)) {
- record->onParentNodeChanged();
+ for (const GraphNode *changed : _changedNodes) {
+ if (changed == node) {
+ return;
}
}
- for (Record *record : _newRecords) {
- if (record->getParentNode() && record->getParentNode()->isUnder(node)) {
- record->onParentNodeChanged();
+ _changedNodes.push_back(node);
+}
+
+void SceneContext::applyGraphNodeChanges() {
+ // Catching up can change more nodes, e.g. the z of a Transformer
+ while (!_changedNodes.empty()) {
+ const Common::Array<GraphNode *> changedNodes = _changedNodes;
+ _changedNodes.clear();
+
+ Common::Array<Record *> records = _records;
+ records.push_back(_newRecords);
+ for (Record *record : records) {
+ const GraphNode *parent = record->getParentNode();
+ if (!parent) {
+ continue;
+ }
+
+ for (const GraphNode *node : changedNodes) {
+ if (parent->isUnder(node)) {
+ record->onParentNodeChanged();
+ break;
+ }
+ }
}
}
}
diff --git a/engines/nancy/script/scenecontext.h b/engines/nancy/script/scenecontext.h
index 0f0affbcd65..c00df002896 100644
--- a/engines/nancy/script/scenecontext.h
+++ b/engines/nancy/script/scenecontext.h
@@ -135,8 +135,10 @@ public:
// Nancy21: a new node to group records under, which lasts as long as the scene
GraphNode *createGraphNode();
- // Lets the records under a node know that it changed its z or transform
+ // Lets the records under a node know that it changed its z or transform,
+ // once the frame is over
void onGraphNodeChanged(GraphNode *node);
+ void applyGraphNodeChanges();
// Runs another script as a part of this scene. From Nancy21 on, a script
// that the scene already included is left out, since scripts include each
@@ -178,6 +180,7 @@ private:
ConvoRecord *_convo = nullptr;
Common::Array<ConvoResponse *> _convoResponses;
Common::Array<GraphNode *> _graphNodes;
+ Common::Array<GraphNode *> _changedNodes; // since the last frame
Common::HashMap<Common::String, RefImage *, Common::IgnoreCase_Hash, Common::IgnoreCase_EqualTo> _refs;
Common::HashMap<Common::String, bool, Common::IgnoreCase_Hash, Common::IgnoreCase_EqualTo> _includedNames;
Commit: b92d54ff299708f18b09941e468eb15dd010e25a
https://github.com/scummvm/scummvm/commit/b92d54ff299708f18b09941e468eb15dd010e25a
Author: Filippos Karapetis (bluegr at gmail.com)
Date: 2026-10-31T10:41:59+02:00
Commit Message:
NANCY: NANCY19: Implement Autotext:ShowCC and Autotext.newline
ShowCC puts up the text of a key as the caption. newline is the markup
that starts a new line, which the conversations of Nancy22 put between
the lines they show. Both are there from Nancy19 on, but only the
scripts of Nancy22 use them.
Changed paths:
engines/nancy/script/gameapi.cpp
diff --git a/engines/nancy/script/gameapi.cpp b/engines/nancy/script/gameapi.cpp
index f08fc8608c2..0e0e6833494 100644
--- a/engines/nancy/script/gameapi.cpp
+++ b/engines/nancy/script/gameapi.cpp
@@ -1787,13 +1787,36 @@ static int autotextIndex(lua_State *L) {
return 1;
}
+// Autotext:ShowCC(key[, show]) puts up the text of a key as the caption, and gives
+// a number for it that goes up with every caption; -1 when there is no such text.
+// Only Nancy22 calls it, always with show set.
+static int autotextShowCC(lua_State *L) {
+ static int numShown = 0;
+
+ const char *key = luaL_checkstring(L, 2);
+ Common::String text;
+ if (!findText(key, text)) {
+ lua_pushinteger(L, -1);
+ return 1;
+ }
+
+ UI::NDUI::Manager *ui = NancySceneState.getNDUI();
+ if (ui) {
+ ui->setCaption(text);
+ }
+
+ lua_pushinteger(L, ++numShown);
+ return 1;
+}
+
static const luaL_Reg kAutotextFunctions[] = {
{ "__index", autotextIndex },
+ { "ShowCC", autotextShowCC },
{ "RemoveCC", autotextRemoveCC },
{ nullptr, nullptr }
};
-// TODO: Autotext:ShowCC, the Generics and UIMgr objects, and Log:WriteAll
+// TODO: The Generics and UIMgr objects, and Log:WriteAll
void registerGameAPI(lua_State *L) {
registerGlobal(L, "Flags", "ND.Flags", kFlagsFunctions);
registerGlobal(L, "VarTable", "ND.VarTable", kVarTableFunctions);
@@ -1820,6 +1843,11 @@ void registerGameAPI(lua_State *L) {
registerGlobal(L, "Scene", "ND.Scene", kSceneFunctions);
registerGlobal(L, "Autotext", "ND.Autotext", kAutotextFunctions);
+ // What starts a new line in a text
+ luaL_getmetatable(L, "ND.Autotext");
+ lua_pushstring(L, "<n>");
+ lua_setfield(L, -2, "newline");
+ lua_pop(L, 1);
registerGlobal(L, "Streams", "ND.Streams", kStreamsFunctions);
luaL_getmetatable(L, "ND.Streams");
lua_pushstring(L, State::SceneStreamManager::getMainStreamName());
Commit: 4f6e2452911eb62bdaffd7f13f36f16afbcc300d
https://github.com/scummvm/scummvm/commit/4f6e2452911eb62bdaffd7f13f36f16afbcc300d
Author: Filippos Karapetis (bluegr at gmail.com)
Date: 2026-10-31T10:42:02+02:00
Commit Message:
NANCY: NANCY22: Number the sound channels like Nancy22 does
Nancy22 has five channels for the sounds that go on from scene to
scene, and no numbered music or voice channels anymore, so the numbers
of all channels changed. Also adds AllExceptTheme, every channel but
the theme, which Nancy21 has as well.
Changed paths:
engines/nancy/nancy.cpp
engines/nancy/script/api.h
engines/nancy/script/gameapi.cpp
engines/nancy/script/records.cpp
engines/nancy/script/records.h
engines/nancy/ui/ndui/enginehandlers.cpp
diff --git a/engines/nancy/nancy.cpp b/engines/nancy/nancy.cpp
index cf4399bf992..06559155651 100644
--- a/engines/nancy/nancy.cpp
+++ b/engines/nancy/nancy.cpp
@@ -1221,6 +1221,14 @@ void NancyEngine::populateStaticData() {
sci.sfxChannels = { 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23 };
sci.speechChannels = { 24, 25, 26, 27, 28, 29 };
}
+
+ if (getGameType() >= kGameTypeNancy22) {
+ // Nancy22 has three music channels, five for the sounds that go on from
+ // scene to scene, eight for ambience, ten for effects and four for voices
+ sci.musicChannels = { 0, 1, 2 };
+ sci.sfxChannels = { 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25 };
+ sci.speechChannels = { 26, 27, 28, 29 };
+ }
}
Common::Error NancyEngine::synchronize(Common::Serializer &ser) {
diff --git a/engines/nancy/script/api.h b/engines/nancy/script/api.h
index ade3faf24fc..08157fc415f 100644
--- a/engines/nancy/script/api.h
+++ b/engines/nancy/script/api.h
@@ -110,6 +110,9 @@ void registerRefAPI(lua_State *L);
void pushSoundChannel(lua_State *L, uint16 channel);
uint16 checkSoundChannel(lua_State *L, int index);
+// Whether a channel is one of those speech plays on
+bool isVoiceChannel(uint16 channel);
+
} // End of namespace Script
} // End of namespace Nancy
diff --git a/engines/nancy/script/gameapi.cpp b/engines/nancy/script/gameapi.cpp
index 0e0e6833494..10ebb8390e3 100644
--- a/engines/nancy/script/gameapi.cpp
+++ b/engines/nancy/script/gameapi.cpp
@@ -839,10 +839,6 @@ static const luaL_Reg kLoadFunctions[] = {
static const char *const kSoundChannelType = "ND.SoundChannel";
enum SoundChannelID {
- kChannelFirstMusic = 0, // Theme
- kChannelFirstAmbient = 6,
- kChannelFirstFX = 14,
- kChannelFirstVoice = 24,
kNumSoundChannels = 30,
// These stand for every channel of a kind
@@ -850,7 +846,9 @@ enum SoundChannelID {
kChannelAllMusic = 0x22,
kChannelAllFX = 0x23,
kChannelAllAmbient = 0x24,
- kChannelAllVoice = 0x25
+ kChannelAllVoice = 0x25,
+ kChannelAllGlobal = 0x26, // Nancy22
+ kChannelAllExceptTheme = 0xFFFE // Nancy21; -2 in the original
};
struct SoundChannelName {
@@ -869,6 +867,38 @@ static const SoundChannelName kSoundChannelNames[] = {
{ "AllAmbient", kChannelAllAmbient }, { "AllVoice", kChannelAllVoice }
};
+// Nancy22 has five channels for the sounds that go on from scene to scene, and
+// no more music or voice channels with numbers
+static const SoundChannelName kNancy22SoundChannelNames[] = {
+ { "Theme", 0 }, { "UIMusic", 1 }, { "EngineMusic", 2 },
+ { "Global1", 3 }, { "Global2", 4 }, { "Global3", 5 }, { "Global4", 6 }, { "Global5", 7 },
+ { "Ambient1", 8 }, { "Ambient2", 9 }, { "Ambient3", 10 }, { "Ambient4", 11 },
+ { "Ambient5", 12 }, { "Ambient6", 13 }, { "Ambient7", 14 }, { "Ambient8", 15 },
+ { "FX1", 16 }, { "FX2", 17 }, { "FX3", 18 }, { "FX4", 19 }, { "FX5", 20 }, { "FX6", 21 }, { "FX7", 22 }, { "FX8", 23 },
+ { "UIFX", 24 }, { "EngineFX", 25 },
+ { "NPCVoice", 26 }, { "PlayerVoice", 27 }, { "UIVoice", 28 }, { "EngineVoice", 29 },
+ { "All", kChannelAll }, { "AllExceptTheme", kChannelAllExceptTheme }, { "AllMusic", kChannelAllMusic },
+ { "AllFX", kChannelAllFX }, { "AllAmbient", kChannelAllAmbient }, { "AllVoice", kChannelAllVoice },
+ { "AllGlobal", kChannelAllGlobal }
+};
+
+// Where the channels of each kind begin, and the end of the last kind
+struct SoundChannelLayout {
+ uint16 firstMusic;
+ uint16 firstGlobal;
+ uint16 firstAmbient;
+ uint16 firstFX;
+ uint16 firstVoice;
+ uint16 end;
+};
+
+static const SoundChannelLayout kSoundChannelLayout = { 0, 6, 6, 14, 24, kNumSoundChannels };
+static const SoundChannelLayout kNancy22SoundChannelLayout = { 0, 3, 8, 16, 26, kNumSoundChannels };
+
+static const SoundChannelLayout &getSoundChannelLayout() {
+ return g_nancy->getGameType() >= kGameTypeNancy22 ? kNancy22SoundChannelLayout : kSoundChannelLayout;
+}
+
void pushSoundChannel(lua_State *L, uint16 channel) {
pushValue(L, kSoundChannelType, channel);
}
@@ -877,12 +907,31 @@ uint16 checkSoundChannel(lua_State *L, int index) {
return *(const uint16 *)checkUserData(L, index, kSoundChannelType);
}
+bool isVoiceChannel(uint16 channel) {
+ const SoundChannelLayout &layout = getSoundChannelLayout();
+ return channel >= layout.firstVoice && channel < layout.end;
+}
+
static int soundChannelIndex(lua_State *L) {
const char *name = luaL_checkstring(L, 2);
- for (const SoundChannelName &channel : kSoundChannelNames) {
- if (scumm_stricmp(channel.name, name) == 0) {
- pushSoundChannel(L, channel.channel);
+ if (g_nancy->getGameType() >= kGameTypeNancy22) {
+ for (const SoundChannelName &channel : kNancy22SoundChannelNames) {
+ if (scumm_stricmp(channel.name, name) == 0) {
+ pushSoundChannel(L, channel.channel);
+ return 1;
+ }
+ }
+ } else {
+ for (const SoundChannelName &channel : kSoundChannelNames) {
+ if (scumm_stricmp(channel.name, name) == 0) {
+ pushSoundChannel(L, channel.channel);
+ return 1;
+ }
+ }
+
+ if (g_nancy->getGameType() >= kGameTypeNancy21 && scumm_stricmp(name, "AllExceptTheme") == 0) {
+ pushSoundChannel(L, kChannelAllExceptTheme);
return 1;
}
}
@@ -893,26 +942,36 @@ static int soundChannelIndex(lua_State *L) {
// The channels a channel object stands for
static void getChannelRange(uint16 channel, uint16 &first, uint16 &last) {
+ const SoundChannelLayout &layout = getSoundChannelLayout();
+
switch (channel) {
case kChannelAll:
first = 0;
- last = kNumSoundChannels - 1;
+ last = layout.end - 1;
+ break;
+ case kChannelAllExceptTheme:
+ first = 1;
+ last = layout.end - 1;
break;
case kChannelAllMusic:
- first = kChannelFirstMusic;
- last = kChannelFirstAmbient - 1;
+ first = layout.firstMusic;
+ last = layout.firstGlobal - 1;
+ break;
+ case kChannelAllGlobal:
+ first = layout.firstGlobal;
+ last = layout.firstAmbient - 1;
break;
case kChannelAllAmbient:
- first = kChannelFirstAmbient;
- last = kChannelFirstFX - 1;
+ first = layout.firstAmbient;
+ last = layout.firstFX - 1;
break;
case kChannelAllFX:
- first = kChannelFirstFX;
- last = kChannelFirstVoice - 1;
+ first = layout.firstFX;
+ last = layout.firstVoice - 1;
break;
case kChannelAllVoice:
- first = kChannelFirstVoice;
- last = kNumSoundChannels - 1;
+ first = layout.firstVoice;
+ last = layout.end - 1;
break;
default:
first = last = channel;
diff --git a/engines/nancy/script/records.cpp b/engines/nancy/script/records.cpp
index 6f54235cc18..b333d633bcf 100644
--- a/engines/nancy/script/records.cpp
+++ b/engines/nancy/script/records.cpp
@@ -1275,6 +1275,10 @@ void SoundRecord::readTable(int tableIndex) {
}
}
+SoundRecord::SoundRecord(SceneContext &context) : Record(context, "ND.SoundAR") {
+ _channel = g_nancy->getGameType() >= kGameTypeNancy22 ? 16 : 14;
+}
+
// A sound that is playing while a movie gets skipped is cut short
void SoundRecord::onSkip() {
if (isActive() && hasStarted() && !_isLooping) {
@@ -1283,14 +1287,9 @@ void SoundRecord::onSkip() {
}
}
-// The channels speech plays on: NPCVoice, PlayerVoice, Voice1, Voice2, UIVoice
-// and EngineVoice
-static const uint16 kFirstVoiceChannel = 24;
-static const uint16 kLastVoiceChannel = 29;
-
bool SoundRecord::skipSpeech() {
if (!isActive() || !hasStarted() || _isLooping || !_isPlaying ||
- _channel < kFirstVoiceChannel || _channel > kLastVoiceChannel ||
+ !isVoiceChannel(_channel) ||
!g_nancy->_sound->isSoundPlaying(_sound)) {
return false;
}
diff --git a/engines/nancy/script/records.h b/engines/nancy/script/records.h
index cfeb87edfba..9b376891130 100644
--- a/engines/nancy/script/records.h
+++ b/engines/nancy/script/records.h
@@ -311,7 +311,7 @@ private:
// Plays a sound, picked at random when it has several
class SoundRecord : public Record {
public:
- SoundRecord(SceneContext &context) : Record(context, "ND.SoundAR") {}
+ SoundRecord(SceneContext &context);
void onSkip() override;
bool skipSpeech() override;
@@ -326,7 +326,7 @@ protected:
private:
Common::Array<Common::String> _names;
- uint16 _channel = 14;
+ uint16 _channel; // FX1 unless the table says otherwise
double _volume = 1.0;
bool _isLooping = false;
bool _usesCaption = true;
diff --git a/engines/nancy/ui/ndui/enginehandlers.cpp b/engines/nancy/ui/ndui/enginehandlers.cpp
index a9f0eb9e0a5..bb6032a3abf 100644
--- a/engines/nancy/ui/ndui/enginehandlers.cpp
+++ b/engines/nancy/ui/ndui/enginehandlers.cpp
@@ -37,9 +37,10 @@ namespace Nancy {
namespace UI {
namespace NDUI {
-// The Nancy19 channels the UI plays a sound on for the player to hear a new volume with
-static const uint16 kSampleChannelMusic = 4;
-static const uint16 kSampleChannelFX = 22;
+// The channels the UI plays a sound on for the player to hear a new volume with:
+// UIMusic, UIFX and UIVoice, which Nancy22 numbers differently
+static uint16 getSampleChannelMusic() { return g_nancy->getGameType() >= kGameTypeNancy22 ? 1 : 4; }
+static uint16 getSampleChannelFX() { return g_nancy->getGameType() >= kGameTypeNancy22 ? 24 : 22; }
static const uint16 kSampleChannelVoice = 28;
// The timer whose displays show the time of day
@@ -141,9 +142,9 @@ void Manager::takeEngineAction(const Action &action) {
} else if (action.target.equalsIgnoreCase("Engine_VoiceVolume")) {
onVolumeAction(action, "speech_volume", kSampleChannelVoice);
} else if (action.target.equalsIgnoreCase("Engine_FXVolume")) {
- onVolumeAction(action, "sfx_volume", kSampleChannelFX);
+ onVolumeAction(action, "sfx_volume", getSampleChannelFX());
} else if (action.target.equalsIgnoreCase("Engine_MusicVolume")) {
- onVolumeAction(action, "music_volume", kSampleChannelMusic);
+ onVolumeAction(action, "music_volume", getSampleChannelMusic());
} else if (action.target.equalsIgnoreCase("Engine_Flags")) {
onFlagsAction(action);
} else if (action.target.equalsIgnoreCase("Engine_Sound")) {
Commit: 24f78980e73ba28f33cf888413a6fa71fdf7c360
https://github.com/scummvm/scummvm/commit/24f78980e73ba28f33cf888413a6fa71fdf7c360
Author: Filippos Karapetis (bluegr at gmail.com)
Date: 2026-10-31T10:42:04+02:00
Commit Message:
NANCY: NANCY22: Remove loadstring and setfenv from the Lua scripts
Nancy22 removes these two functions, so its scripts can't compile code
from strings or change the environment of functions. Older games still
have them.
Changed paths:
engines/nancy/script/luastate.cpp
diff --git a/engines/nancy/script/luastate.cpp b/engines/nancy/script/luastate.cpp
index 7cc132a248a..fe754abdac5 100644
--- a/engines/nancy/script/luastate.cpp
+++ b/engines/nancy/script/luastate.cpp
@@ -196,6 +196,11 @@ LuaState::LuaState(SceneContext *context) {
removeGlobal(_state, "loadfile");
removeGlobal(_state, "print");
+ if (g_nancy->getGameType() >= kGameTypeNancy22) {
+ removeGlobal(_state, "loadstring");
+ removeGlobal(_state, "setfenv");
+ }
+
// The random numbers of the library come from one generator that all
// states share, so it is seeded with the first one
static bool isSeeded = false;
Commit: 4d62b2cb5fae3b66658ea91e619d1e2b8570a308
https://github.com/scummvm/scummvm/commit/4d62b2cb5fae3b66658ea91e619d1e2b8570a308
Author: Filippos Karapetis (bluegr at gmail.com)
Date: 2026-10-31T10:42:06+02:00
Commit Message:
NANCY: NANCY22: Run the environment scripts in a single stream
Nancy22 runs the ambient script of the current environment in one
stream, EnvStream. Changing the environment switches that stream to
the next environment's script, or ends it if there is none. Nancy22
also names this script "sceneName" instead of "onEnterScene".
Changed paths:
engines/nancy/script/bootapi.cpp
engines/nancy/state/scenestream.cpp
engines/nancy/state/scenestream.h
diff --git a/engines/nancy/script/bootapi.cpp b/engines/nancy/script/bootapi.cpp
index 866e07d5a4d..a2a95574a42 100644
--- a/engines/nancy/script/bootapi.cpp
+++ b/engines/nancy/script/bootapi.cpp
@@ -220,8 +220,12 @@ static int envCreate(lua_State *L) {
luaL_error(L, "Environments must specify the 'fullName' field");
}
+ // Nancy22 calls the script of the environment its "sceneName"
Common::String name;
- readField(L, env, "onEnterScene", name);
+ if (!readField(L, env, "onEnterScene", name)) {
+ readField(L, env, "sceneName", name);
+ }
+
environment.ambientScriptName = Common::Path(name);
name.clear();
diff --git a/engines/nancy/state/scenestream.cpp b/engines/nancy/state/scenestream.cpp
index 53e46b25bd2..c9e47826e20 100644
--- a/engines/nancy/state/scenestream.cpp
+++ b/engines/nancy/state/scenestream.cpp
@@ -329,6 +329,9 @@ void SceneStream::clearScene() {
static const char *const kMainStreamName = "MainStream";
static const char *const kUIStreamName = "UIStream";
+// Nancy22: the stream with the scripts of the environments
+static const char *const kEnvStreamName = "EnvStream";
+
const char *SceneStreamManager::getMainStreamName() {
return kMainStreamName;
}
@@ -668,6 +671,11 @@ void SceneStreamManager::changeEnvironment(const Common::String &newEnvironment)
return;
}
+ if (g_nancy->getGameType() >= kGameTypeNancy22) {
+ changeEnvironmentStream(*envs, newEnvironment);
+ return;
+ }
+
for (const ENVS::Environment &env : envs->environments) {
if (env.code.equalsIgnoreCase(_environment)) {
end(env.code + "_Enter_Stream");
@@ -691,6 +699,28 @@ void SceneStreamManager::changeEnvironment(const Common::String &newEnvironment)
}
}
+// Nancy22 runs the script of every environment in the same stream, which moves
+// on to the script of the next environment, and ends in one without a script
+void SceneStreamManager::changeEnvironmentStream(const ENVS &envs, const Common::String &newEnvironment) {
+ _environment = newEnvironment;
+
+ Common::String sceneName;
+ for (const ENVS::Environment &env : envs.environments) {
+ if (env.code.equalsIgnoreCase(newEnvironment)) {
+ sceneName = env.ambientScriptName.toString();
+ break;
+ }
+ }
+
+ if (sceneName.empty()) {
+ end(kEnvStreamName);
+ } else if (find(kEnvStreamName)) {
+ changeScene(kEnvStreamName, sceneName, 0);
+ } else {
+ begin(kEnvStreamName, sceneName, 0, StreamFlags());
+ }
+}
+
bool SceneStreamManager::receiveMessage(const Script::Message &message, bool &wasTaken) {
bool hasReceiver = false;
wasTaken = false;
diff --git a/engines/nancy/state/scenestream.h b/engines/nancy/state/scenestream.h
index 4fabf53ea19..6e9dae5f9e1 100644
--- a/engines/nancy/state/scenestream.h
+++ b/engines/nancy/state/scenestream.h
@@ -41,6 +41,7 @@ class SeekableReadStream;
namespace Nancy {
+struct ENVS;
struct NancyInput;
namespace UI {
@@ -240,6 +241,7 @@ public:
private:
void endChildren(const Common::Array<SceneStream::Child> &children);
+ void changeEnvironmentStream(const ENVS &envs, const Common::String &newEnvironment);
// Every stream in the order they run and get input in. The main stream is
// the scene itself, and takes part as a null entry.
Commit: d12ec8c3e1c7e73997acc5fd16c88d40aef83762
https://github.com/scummvm/scummvm/commit/d12ec8c3e1c7e73997acc5fd16c88d40aef83762
Author: Filippos Karapetis (bluegr at gmail.com)
Date: 2026-10-31T10:42:09+02:00
Commit Message:
NANCY: NANCY22: Add SetMessagingName to Override records
In Nancy22, an Override record can register the name that messages
are sent to. Only one record can have a name at a time. A record can
take over a name that another record already has, if the script asks
for that. The conversations and the managers of Nancy22 get their
messages this way.
Changed paths:
engines/nancy/nancy.h
engines/nancy/script/records.cpp
engines/nancy/script/records.h
diff --git a/engines/nancy/nancy.h b/engines/nancy/nancy.h
index a743df8a05e..eae864dfe54 100644
--- a/engines/nancy/nancy.h
+++ b/engines/nancy/nancy.h
@@ -98,6 +98,10 @@ namespace State {
class State;
}
+namespace Script {
+class OverrideRecord;
+}
+
class NancyEngine : public Engine {
public:
NancyEngine(OSystem *syst, const NancyGameDescription *gd);
@@ -175,6 +179,12 @@ public:
// Used to check whether we need to show the SaveDialog
bool _hasJustSaved;
+ // Nancy22: the records that took a name with SetMessagingName. Each name
+ // goes to one record at a time; records without one go by the
+ // "messagingName" a script stored in them.
+ typedef Common::HashMap<Common::String, Script::OverrideRecord *, Common::IgnoreCase_Hash, Common::IgnoreCase_EqualTo> MessagingNameMap;
+ MessagingNameMap _messagingNames;
+
protected:
Common::Error run() override;
void pauseEngineIntern(bool pause) override;
diff --git a/engines/nancy/script/records.cpp b/engines/nancy/script/records.cpp
index b333d633bcf..6d5848ead4a 100644
--- a/engines/nancy/script/records.cpp
+++ b/engines/nancy/script/records.cpp
@@ -735,9 +735,40 @@ static bool isOverrideFunctionName(const Common::String &name) {
}
OverrideRecord::~OverrideRecord() {
+ setMessagingName(Common::String(), true);
delete _canvas;
}
+bool OverrideRecord::setMessagingName(const Common::String &name, bool takeOver) {
+ if (name.equalsIgnoreCase(_messagingName) && !name.empty()) {
+ return true;
+ }
+
+ NancyEngine::MessagingNameMap &names = g_nancy->_messagingNames;
+
+ if (!_messagingName.empty()) {
+ NancyEngine::MessagingNameMap::iterator it = names.find(_messagingName);
+ if (it != names.end() && it->_value == this) {
+ names.erase(it);
+ }
+ }
+
+ _messagingName.clear();
+
+ if (name.empty()) {
+ return true;
+ }
+
+ if (!takeOver && names.contains(name)) {
+ warning("Name '%s' already registered for messaging.", name.c_str());
+ return false;
+ }
+
+ names.setVal(name, this);
+ _messagingName = name;
+ return true;
+}
+
void OverrideRecord::readTable(int tableIndex) {
lua_State *L = getLua();
@@ -752,6 +783,12 @@ void OverrideRecord::readTable(int tableIndex) {
}
bool OverrideRecord::hasMessagingName(const Common::String &name) {
+ const NancyEngine::MessagingNameMap &names = g_nancy->_messagingNames;
+ NancyEngine::MessagingNameMap::const_iterator it = names.find(name);
+ if (it != names.end()) {
+ return it->_value == this;
+ }
+
lua_State *L = getLua();
pushStoredValue("messagingName");
@@ -814,12 +851,29 @@ static int overrideDone(lua_State *L) {
return 0;
}
+// this:SetMessagingName(name[, takeOver]), Nancy22: the name the record gets
+// messages under from now on; an empty one for none. A name that another record
+// has stays with it unless the record takes it over. Gives whether it got the name.
+static int overrideSetMessagingName(lua_State *L) {
+ OverrideRecord *record = dynamic_cast<OverrideRecord *>(checkRecord(L, 1));
+ const char *name = luaL_checkstring(L, 2);
+ const bool takeOver = lua_gettop(L) > 2 && lua_toboolean(L, 3);
+
+ lua_pushboolean(L, record && record->setMessagingName(name, takeOver));
+ return 1;
+}
+
bool OverrideRecord::getField(const Common::String &key) {
if (key == "Done") {
lua_pushcfunction(getLua(), overrideDone);
return true;
}
+ if (key == "SetMessagingName" && g_nancy->getGameType() >= kGameTypeNancy22) {
+ lua_pushcfunction(getLua(), overrideSetMessagingName);
+ return true;
+ }
+
return false;
}
diff --git a/engines/nancy/script/records.h b/engines/nancy/script/records.h
index 9b376891130..b227023f774 100644
--- a/engines/nancy/script/records.h
+++ b/engines/nancy/script/records.h
@@ -212,6 +212,9 @@ public:
void onDie() override { callFunction("OnDie"); }
bool hasMessagingName(const Common::String &name) override;
+ // Nancy22: takes a name to get messages under, or gives it up with an empty one
+ bool setMessagingName(const Common::String &name, bool takeOver);
+
protected:
void readTable(int tableIndex) override;
bool prepareReset() override { return true; }
@@ -225,6 +228,8 @@ protected:
private:
// What the "Render" function draws on, for the records that have one
RecordGraphic *_canvas = nullptr;
+
+ Common::String _messagingName; // Nancy22, from SetMessagingName
};
// Shows a part of an image
Commit: 4779c113102146da881c667d260464843558569d
https://github.com/scummvm/scummvm/commit/4779c113102146da881c667d260464843558569d
Author: Filippos Karapetis (bluegr at gmail.com)
Date: 2026-10-31T10:42:17+02:00
Commit Message:
NANCY: NANCY22: Start the manager scripts with the game
Nancy22 has manager scripts for the music, the phone, the photos and
more. They run in their own stream, ManagerStream, for the whole game.
The stream now starts before the first scene of a new or a loaded game.
Also adds Log:ShowWarning and Log:AddManager, which these scripts call.
The original shows the state of each manager that AddManager registers
in its cheat dialog; here, the new list_managers console command does.
Changed paths:
engines/nancy/console.cpp
engines/nancy/console.h
engines/nancy/script/gameapi.cpp
engines/nancy/script/scenecontext.cpp
engines/nancy/script/scenecontext.h
engines/nancy/state/scene.cpp
engines/nancy/state/scene.h
engines/nancy/state/scenestream.cpp
engines/nancy/state/scenestream.h
diff --git a/engines/nancy/console.cpp b/engines/nancy/console.cpp
index ebe120857f6..5c63dbafb0b 100644
--- a/engines/nancy/console.cpp
+++ b/engines/nancy/console.cpp
@@ -69,6 +69,7 @@ NancyConsole::NancyConsole() : GUI::Debugger() {
#ifdef ENABLE_NANCY_V4
registerCmd("list_records", WRAP_METHOD(NancyConsole, Cmd_listRecords));
registerCmd("script_export", WRAP_METHOD(NancyConsole, Cmd_scriptExport));
+ registerCmd("list_managers", WRAP_METHOD(NancyConsole, Cmd_listManagers));
#endif
registerCmd("actionrecord_export", WRAP_METHOD(NancyConsole, Cmd_actionRecordExport));
registerCmd("scan_ar_type", WRAP_METHOD(NancyConsole, Cmd_scanForActionRecordType));
@@ -800,6 +801,54 @@ bool NancyConsole::Cmd_listRecords(int argc, const char **argv) {
return true;
}
+// Nancy22: the managers the scripts registered with Log:AddManager, or what one
+// of them gives about itself. The original shows these in its cheat dialog.
+bool NancyConsole::Cmd_listManagers(int argc, const char **argv) {
+ if (argc > 2) {
+ debugPrintf("Lists the managers of the scripts, in Nancy22 and later.\n");
+ debugPrintf("Usage: %s [manager name]\n", argv[0]);
+ debugPrintf("With a name, prints what the manager says about itself.\n");
+ return true;
+ }
+
+ if (g_nancy->getGameType() < kGameTypeNancy22) {
+ debugPrintf("Managers are used from Nancy22 onwards\n");
+ return true;
+ }
+
+ if (g_nancy->getState() != NancyState::kScene) {
+ debugPrintf("Not in the kScene state\n");
+ return true;
+ }
+
+ // The managers all run in a stream of their own
+ State::SceneStream *stream = NancySceneState.getStreams().find(State::SceneStreamManager::getManagerStreamName());
+ Script::SceneContext *context = stream ? stream->getScriptScene() : nullptr;
+ if (!context) {
+ debugPrintf("No running stream %s\n", State::SceneStreamManager::getManagerStreamName());
+ return true;
+ }
+
+ if (argc == 2) {
+ Common::String text;
+ if (context->describeManager(argv[1], text)) {
+ debugPrintf("%s\n", text.c_str());
+ } else {
+ debugPrintf("No manager %s\n", argv[1]);
+ }
+
+ return true;
+ }
+
+ Common::Array<Common::String> names;
+ context->getManagerNames(names);
+ for (const Common::String &name : names) {
+ debugPrintf("%s\n", name.c_str());
+ }
+
+ return true;
+}
+
// Writes a script as it is, compiled, to a file
bool NancyConsole::Cmd_scriptExport(int argc, const char **argv) {
if (argc != 2) {
diff --git a/engines/nancy/console.h b/engines/nancy/console.h
index ccea1b1229e..f18ff04c16d 100644
--- a/engines/nancy/console.h
+++ b/engines/nancy/console.h
@@ -59,6 +59,7 @@ private:
#ifdef ENABLE_NANCY_V4
bool Cmd_listRecords(int argc, const char **argv);
bool Cmd_scriptExport(int argc, const char **argv);
+ bool Cmd_listManagers(int argc, const char **argv);
#endif
bool Cmd_actionRecordExport(int argc, const char **argv);
bool Cmd_scanForActionRecordType(int argc, const char **argv);
diff --git a/engines/nancy/script/gameapi.cpp b/engines/nancy/script/gameapi.cpp
index 10ebb8390e3..4089a0956bc 100644
--- a/engines/nancy/script/gameapi.cpp
+++ b/engines/nancy/script/gameapi.cpp
@@ -1804,12 +1804,38 @@ static int logClear(lua_State *L) {
return 0;
}
+// Log:ShowWarning(text), Nancy22: a warning the original shows in its debug output
+static int logShowWarning(lua_State *L) {
+ debugC(1, kDebugScene, "Script warning: %s", luaL_checkstring(L, 2));
+ return 0;
+}
+
+// Log:AddManager(name, function), Nancy22: a function that describes a manager,
+// which the original shows in its cheat dialog, and list_managers prints here
+static int logAddManager(lua_State *L) {
+ const char *name = luaL_checkstring(L, 2);
+ SceneContext *context = LuaState::getContext(L);
+ if (!context) {
+ return luaL_error(L, "Tried to add a manager from a non-scene Lua environment");
+ }
+
+ luaL_checktype(L, 3, LUA_TFUNCTION);
+ lua_settop(L, 3);
+ if (!context->addManager(name)) {
+ return luaL_error(L, "Manager name %s already taken", name);
+ }
+
+ return 0;
+}
+
static const luaL_Reg kLogFunctions[] = {
{ "__index", indexFunctions },
{ "Write", logWrite },
{ "Assert", logAssert },
{ "Watch", logWatch },
{ "Clear", logClear },
+ { "ShowWarning", logShowWarning },
+ { "AddManager", logAddManager },
{ nullptr, nullptr }
};
diff --git a/engines/nancy/script/scenecontext.cpp b/engines/nancy/script/scenecontext.cpp
index 25cc9cdf68d..37dc52a9280 100644
--- a/engines/nancy/script/scenecontext.cpp
+++ b/engines/nancy/script/scenecontext.cpp
@@ -212,6 +212,49 @@ void SceneContext::setSceneFunction(const char *name) {
lua_pop(L, 1);
}
+bool SceneContext::addManager(const Common::String &name) {
+ for (const ManagerFunction &manager : _managers) {
+ if (manager.name.equalsIgnoreCase(name)) {
+ return false;
+ }
+ }
+
+ ManagerFunction manager;
+ manager.name = name;
+ manager.reference = luaL_ref(getLua(), LUA_REGISTRYINDEX);
+ _managers.push_back(manager);
+ return true;
+}
+
+void SceneContext::getManagerNames(Common::Array<Common::String> &names) const {
+ for (const ManagerFunction &manager : _managers) {
+ names.push_back(manager.name);
+ }
+}
+
+bool SceneContext::describeManager(const Common::String &name, Common::String &text) {
+ for (const ManagerFunction &manager : _managers) {
+ if (!manager.name.equalsIgnoreCase(name)) {
+ continue;
+ }
+
+ lua_State *L = getLua();
+ lua_rawgeti(L, LUA_REGISTRYINDEX, manager.reference);
+ if (lua_pcall(L, 0, 1, 0) != 0) {
+ text = Common::String::format("Error in manager stringize function: %s", lua_tostring(L, -1));
+ } else if (!lua_isstring(L, -1)) {
+ text = Common::String::format("Return value from manager %s is not a string", manager.name.c_str());
+ } else {
+ text = lua_tostring(L, -1);
+ }
+
+ lua_pop(L, 1);
+ return true;
+ }
+
+ return false;
+}
+
bool SceneContext::callSceneFunction(const char *name, int numArgs) {
lua_State *L = getLua();
diff --git a/engines/nancy/script/scenecontext.h b/engines/nancy/script/scenecontext.h
index c00df002896..d51f50c6418 100644
--- a/engines/nancy/script/scenecontext.h
+++ b/engines/nancy/script/scenecontext.h
@@ -152,6 +152,15 @@ public:
// on the "Scene" object. Takes the function at the top of the stack.
void setSceneFunction(const char *name);
+ // Nancy22: keeps the function at the top of the stack, which describes the
+ // manager of that name for the debugger. Returns false when the name is taken.
+ bool addManager(const Common::String &name);
+ void getManagerNames(Common::Array<Common::String> &names) const;
+
+ // What the function of a manager gives, or the error it ran into. Returns
+ // false when the scene has no manager of that name.
+ bool describeManager(const Common::String &name, Common::String &text);
+
// Where the mouse is in the viewport. Returns whether it is inside of it.
static bool getViewportMouse(const NancyInput &input, ScriptPoint &point);
@@ -184,6 +193,13 @@ private:
Common::HashMap<Common::String, RefImage *, Common::IgnoreCase_Hash, Common::IgnoreCase_EqualTo> _refs;
Common::HashMap<Common::String, bool, Common::IgnoreCase_Hash, Common::IgnoreCase_EqualTo> _includedNames;
+ struct ManagerFunction {
+ Common::String name;
+ int reference; // in the registry
+ };
+
+ Common::Array<ManagerFunction> _managers;
+
double _time = 0.0;
double _elapsedTime = 0.0;
bool _hasRunOnce = false;
diff --git a/engines/nancy/state/scene.cpp b/engines/nancy/state/scene.cpp
index 96a3ca92e13..5d9ed8cb528 100644
--- a/engines/nancy/state/scene.cpp
+++ b/engines/nancy/state/scene.cpp
@@ -1966,6 +1966,12 @@ void Scene::synchronize(Common::Serializer &ser) {
}
if (g_nancy->getGameType() >= kGameTypeNancy19) {
+ // Nancy22's managers answer the scripts of every scene, the one that
+ // loads now included
+ if (g_nancy->getGameType() >= kGameTypeNancy22) {
+ beginManagers();
+ }
+
load(true);
}
@@ -2056,6 +2062,10 @@ void Scene::init() {
} else {
// Normal boot, load default first scene
_state = kLoad;
+
+ if (g_nancy->getGameType() >= kGameTypeNancy22) {
+ beginManagers();
+ }
// Make sure the nancy8+ save menu doesn't display a save name on new game
ConfMan.removeKey("display_slot", Common::ConfigManager::kTransientDomain);
}
@@ -3186,6 +3196,13 @@ void Scene::initUI() {
_ndui->registerGraphics();
}
+// Nancy22 begins the stream of the managers along with the game. They keep what
+// the scripts of every scene ask them for, and send each other messages.
+void Scene::beginManagers() {
+ _streams.begin(SceneStreamManager::getManagerStreamName(), "ManagerMain_SC", 0, StreamFlags());
+ _streams.loadNow(SceneStreamManager::getManagerStreamName());
+}
+
#ifdef ENABLE_NANCY_V4
void Scene::beginPlayerScript(const Common::Path &sceneName) {
if (sceneName.empty()) {
diff --git a/engines/nancy/state/scene.h b/engines/nancy/state/scene.h
index 3c687fb78b1..48cfe370239 100644
--- a/engines/nancy/state/scene.h
+++ b/engines/nancy/state/scene.h
@@ -420,6 +420,7 @@ private:
void initStaticData();
void initUI();
+ void beginManagers();
void loadUIPrepRecords(const Common::Path &name);
void clearSceneData(bool nextIsNoArt = false);
diff --git a/engines/nancy/state/scenestream.cpp b/engines/nancy/state/scenestream.cpp
index c9e47826e20..db69913f864 100644
--- a/engines/nancy/state/scenestream.cpp
+++ b/engines/nancy/state/scenestream.cpp
@@ -329,8 +329,10 @@ void SceneStream::clearScene() {
static const char *const kMainStreamName = "MainStream";
static const char *const kUIStreamName = "UIStream";
-// Nancy22: the stream with the scripts of the environments
+// Nancy22: the stream with the scripts of the environments, and the one with the
+// managers, which the scripts of every scene call on
static const char *const kEnvStreamName = "EnvStream";
+static const char *const kManagerStreamName = "ManagerStream";
const char *SceneStreamManager::getMainStreamName() {
return kMainStreamName;
@@ -340,6 +342,10 @@ const char *SceneStreamManager::getUIStreamName() {
return kUIStreamName;
}
+const char *SceneStreamManager::getManagerStreamName() {
+ return kManagerStreamName;
+}
+
#ifdef ENABLE_NANCY_V4
const Script::ScriptMatrix *SceneStreamManager::getTransform(const Common::String &name) {
if (name.equalsIgnoreCase(kMainStreamName)) {
diff --git a/engines/nancy/state/scenestream.h b/engines/nancy/state/scenestream.h
index 6e9dae5f9e1..c232b966327 100644
--- a/engines/nancy/state/scenestream.h
+++ b/engines/nancy/state/scenestream.h
@@ -209,6 +209,7 @@ public:
static const char *getMainStreamName();
static const char *getUIStreamName();
+ static const char *getManagerStreamName(); // Nancy22
// Nancy19: hands a message to the scenes of the streams it is for. Returns
// false when there is none.
Commit: 06ec7497423d72d7c90a223415b87573f83f91df
https://github.com/scummvm/scummvm/commit/06ec7497423d72d7c90a223415b87573f83f91df
Author: Filippos Karapetis (bluegr at gmail.com)
Date: 2026-10-31T10:42:20+02:00
Commit Message:
NANCY: NANCY22: Add Game.loadName and Game.fastConvo
- Game.loadName holds the name of the saved game while it is being
loaded, and is nil otherwise. The scripts check it to clean up what
was running when the game was saved, such as conversations.
- Game.fastConvo is a cheat of the original that lets a click skip the
current line of a conversation. It is always off here, since Esc
already skips what the characters are saying in ScummVM.
Changed paths:
engines/nancy/nancy.cpp
engines/nancy/script/gameapi.cpp
engines/nancy/state/scene.cpp
engines/nancy/state/scene.h
diff --git a/engines/nancy/nancy.cpp b/engines/nancy/nancy.cpp
index 06559155651..2c2e04f2573 100644
--- a/engines/nancy/nancy.cpp
+++ b/engines/nancy/nancy.cpp
@@ -124,7 +124,16 @@ Common::Error NancyEngine::loadGameState(int slot) {
ConfMan.setInt("display_slot", slot, Common::ConfigManager::kTransientDomain);
}
+ // Nancy22's scripts know when a game is being loaded, by its name
+ if (State::Scene::hasInstance()) {
+ NancySceneState.setLoadName(save.isValid() && !save.getDescription().empty() ? save.getDescription() : "Saved game");
+ }
+
Common::Error result = Engine::loadGameState(slot);
+ if (State::Scene::hasInstance() && result.getCode() != Common::kNoError) {
+ NancySceneState.setLoadName("");
+ }
+
if (result.getCode() == Common::kNoError) {
if (_gameFlow.curState != NancyState::kScene)
destroyState(_gameFlow.curState);
diff --git a/engines/nancy/script/gameapi.cpp b/engines/nancy/script/gameapi.cpp
index 4089a0956bc..7575b631c3d 100644
--- a/engines/nancy/script/gameapi.cpp
+++ b/engines/nancy/script/gameapi.cpp
@@ -416,6 +416,26 @@ static int gameIndex(lua_State *L) {
return 1;
}
+ // Nancy22: the name of the saved game that is being loaded, or nil
+ if (key == "loadName") {
+ const Common::String &name = NancySceneState.getLoadName();
+ if (name.empty()) {
+ lua_pushnil(L);
+ } else {
+ lua_pushstring(L, name.c_str());
+ }
+
+ return 1;
+ }
+
+ // Nancy22: a cheat of the original, toggled with F in its cheat mode, with
+ // which a click skips the current line of a conversation. Always off here,
+ // since Esc already skips what the characters are saying.
+ if (key == "fastConvo") {
+ lua_pushboolean(L, false);
+ return 1;
+ }
+
lua_pushnil(L);
return 1;
}
diff --git a/engines/nancy/state/scene.cpp b/engines/nancy/state/scene.cpp
index 5d9ed8cb528..4c4293bf601 100644
--- a/engines/nancy/state/scene.cpp
+++ b/engines/nancy/state/scene.cpp
@@ -2436,6 +2436,9 @@ void Scene::run() {
_streams.process();
+ // The scenes of a loaded game have all started by now
+ _loadName.clear();
+
// The records a skipped cinematic set off have started by now; its dialogue
// shouldn't go on without it
if (_hasSkippedMovie) {
diff --git a/engines/nancy/state/scene.h b/engines/nancy/state/scene.h
index 48cfe370239..607d2c8b29b 100644
--- a/engines/nancy/state/scene.h
+++ b/engines/nancy/state/scene.h
@@ -131,6 +131,11 @@ public:
// chance save instead, once the current records have run
void loadSecondChance() { _isLoadingSecondChance = true; }
+ // Nancy22: the name of the saved game that is being loaded, until the scenes
+ // of all the streams have started. Empty at any other time.
+ void setLoadName(const Common::String &name) { _loadName = name; }
+ const Common::String &getLoadName() const { return _loadName; }
+
// Nancy16: lists of movies left under the name of the movie or puzzle that plays
// them, e.g. the commands given to the wolf. Taking a list forgets it; returns false
// when there is none.
@@ -558,6 +563,7 @@ private:
bool _hasSkippedMovie = false;
bool _isLoadingSecondChance = false;
+ Common::String _loadName;
Common::HashMap<Common::String, Common::Array<Common::String>, Common::IgnoreCase_Hash, Common::IgnoreCase_EqualTo> _moviePlaylists;
Commit: ee8db3855607af6075e5e0e6c62720005dc749cb
https://github.com/scummvm/scummvm/commit/ee8db3855607af6075e5e0e6c62720005dc749cb
Author: Filippos Karapetis (bluegr at gmail.com)
Date: 2026-10-31T10:42:22+02:00
Commit Message:
NANCY: NANCY22: Add Restart to the records
Restart works like Reset, but also makes the record active. The
scripts of Nancy22 use it to play sounds and animations again.
Changed paths:
engines/nancy/script/record.cpp
engines/nancy/script/record.h
diff --git a/engines/nancy/script/record.cpp b/engines/nancy/script/record.cpp
index 328b9523112..715cad3a145 100644
--- a/engines/nancy/script/record.cpp
+++ b/engines/nancy/script/record.cpp
@@ -261,6 +261,12 @@ bool Record::reset() {
return true;
}
+bool Record::restart() {
+ _isActive = true;
+ _hasActiveFunction = false;
+ return reset();
+}
+
bool Record::callFunction(const char *name, int numArgs, int numResults) {
lua_State *L = getLua();
@@ -595,6 +601,15 @@ static int recordReset(lua_State *L) {
return 0;
}
+// ar:Restart(), Nancy22
+static int recordRestart(lua_State *L) {
+ if (!checkRecord(L, 1)->restart()) {
+ return luaL_error(L, "Cannot reset AR");
+ }
+
+ return 0;
+}
+
// ar:Render()
static int recordRender(lua_State *L) {
checkRecord(L, 1)->render();
@@ -687,6 +702,7 @@ static const luaL_Reg kRecordFunctions[] = {
{ "__newindex", recordNewIndex },
{ "__eq", recordEquals },
{ "Reset", recordReset },
+ { "Restart", recordRestart },
{ "Run", recordRun },
{ "Render", recordRender },
{ "OnMouseMove", recordOnMouseMove },
diff --git a/engines/nancy/script/record.h b/engines/nancy/script/record.h
index eecc2f9bb96..90bbb05b64c 100644
--- a/engines/nancy/script/record.h
+++ b/engines/nancy/script/record.h
@@ -98,6 +98,9 @@ public:
// Makes a record that ran start over. Only some kinds can.
bool reset();
+ // Nancy22: works like reset(), but makes the record active as well
+ bool restart();
+
// Draws an active record right away, where its transform puts it on the
// screen. Scripts do this for what hangs off the cursor.
void render();
Commit: e056c086ca5a0fd78d7c835b23b245a55b3ea478
https://github.com/scummvm/scummvm/commit/e056c086ca5a0fd78d7c835b23b245a55b3ea478
Author: Filippos Karapetis (bluegr at gmail.com)
Date: 2026-10-31T10:42:24+02:00
Commit Message:
NANCY: NANCY22: Add Scene:Change and Scene:Attach
Scene:Change is another name for Scene:ChangeScene. Scene:Attach
detaches a record from the Transformer record it was attached to, and
it back directly under the scene. Both are available since puts
Nancy19, but they're used by game scripts from Nancy22 onwards.
Changed paths:
engines/nancy/script/gameapi.cpp
diff --git a/engines/nancy/script/gameapi.cpp b/engines/nancy/script/gameapi.cpp
index 7575b631c3d..125bc1e15cc 100644
--- a/engines/nancy/script/gameapi.cpp
+++ b/engines/nancy/script/gameapi.cpp
@@ -1240,6 +1240,14 @@ static int sceneTransferChild(lua_State *L) {
return 0;
}
+// Scene:Attach(record), Nancy22: puts a record back under the scene, out of
+// the Transformer record it was attached to
+static int sceneAttach(lua_State *L) {
+ checkContext(L);
+ checkRecord(L, 2)->setParentNode(nullptr);
+ return 0;
+}
+
// Scene:EndStream(name)
static int sceneEndStream(lua_State *L) {
checkContext(L);
@@ -1299,6 +1307,9 @@ static const luaL_Reg kSceneFunctions[] = {
{ "ChangeScene", sceneChangeScene },
{ "GraphNode", sceneGraphNode },
{ "TransferChild", sceneTransferChild },
+ // Available since Nancy19, but used by game scripts from Nancy22 onwards
+ { "Change", sceneChangeScene },
+ { "Attach", sceneAttach },
{ nullptr, nullptr }
};
Commit: 76080528c2da25407ce125c2b9cb6f0d847d939e
https://github.com/scummvm/scummvm/commit/76080528c2da25407ce125c2b9cb6f0d847d939e
Author: Filippos Karapetis (bluegr at gmail.com)
Date: 2026-10-31T10:42:26+02:00
Commit Message:
NANCY: NANCY22: Add Rect.size
rect.size gives the width and the height of a rectangle as a point.
Changed paths:
engines/nancy/script/types.cpp
diff --git a/engines/nancy/script/types.cpp b/engines/nancy/script/types.cpp
index 90a80db78f7..6aa955c5a0f 100644
--- a/engines/nancy/script/types.cpp
+++ b/engines/nancy/script/types.cpp
@@ -141,6 +141,9 @@ static int rectIndex(lua_State *L) {
center.v[0] = rect.left + rect.width() * 0.5f;
center.v[1] = rect.top + rect.height() * 0.5f;
pushVector(L, center);
+ } else if (key == "size") {
+ // Nancy22: the width and the height as a point
+ pushPoint(L, ScriptPoint(rect.width(), rect.height()));
} else if (key == "leftTop") {
pushPoint(L, ScriptPoint(rect.left, rect.top));
} else if (key == "rightTop") {
Commit: c2eb89a9dd9382dfec74237bb630b9dff3876be3
https://github.com/scummvm/scummvm/commit/c2eb89a9dd9382dfec74237bb630b9dff3876be3
Author: Filippos Karapetis (bluegr at gmail.com)
Date: 2026-10-31T10:42:30+02:00
Commit Message:
NANCY: NANCY22: Add Player.curViewableStream
Player.curViewableStream gives the name of the stream that shows the
inventory item the player is looking at, or "" when there is none.
The scripts of Nancy22 end that stream when the inventory closes.
Changed paths:
engines/nancy/script/gameapi.cpp
diff --git a/engines/nancy/script/gameapi.cpp b/engines/nancy/script/gameapi.cpp
index 125bc1e15cc..ebb6bc82ac5 100644
--- a/engines/nancy/script/gameapi.cpp
+++ b/engines/nancy/script/gameapi.cpp
@@ -44,6 +44,7 @@
#include "engines/nancy/state/scene.h"
+#include "engines/nancy/ui/ndui/button.h"
#include "engines/nancy/ui/ndui/common.h"
#include "engines/nancy/ui/ndui/manager.h"
@@ -1617,6 +1618,24 @@ static int playerIndex(lua_State *L) {
return 1;
}
+ // Nancy22: the stream of the item that is being looked at, or ""
+ if (key == "curViewableStream") {
+ Common::String streamName;
+ const INVD *items = GetEngineData(INVD);
+ if (items) {
+ for (const INVD::Item &item : items->items) {
+ if (item.kind == UI::NDUI::InvButton::kItemView &&
+ NancySceneState.getStreams().isRunning(UI::NDUI::InvButton::getStreamName(item.name))) {
+ streamName = UI::NDUI::InvButton::getStreamName(item.name);
+ break;
+ }
+ }
+ }
+
+ lua_pushstring(L, streamName.c_str());
+ return 1;
+ }
+
return indexFunctions(L);
}
Commit: 8132911020f0b60e0f87b858095cce7872f8e0ef
https://github.com/scummvm/scummvm/commit/8132911020f0b60e0f87b858095cce7872f8e0ef
Author: Filippos Karapetis (bluegr at gmail.com)
Date: 2026-10-31T10:42:32+02:00
Commit Message:
NANCY: NANCY21: Add Save:Attic and Load:Attic
These keep values apart from the saved games. The original stores
them in a file of their own; here they last for as long as the game
runs. Both exist from Nancy21 on, but only the scripts of Nancy22 use
them, for playtest statistics that the game logs only when a debug
flag is set.
Changed paths:
engines/nancy/nancy.h
engines/nancy/script/gameapi.cpp
diff --git a/engines/nancy/nancy.h b/engines/nancy/nancy.h
index eae864dfe54..810aa919b3b 100644
--- a/engines/nancy/nancy.h
+++ b/engines/nancy/nancy.h
@@ -23,6 +23,7 @@
#define NANCY_H
#include "common/file.h"
+#include "common/hashmap.h"
#include "common/str.h"
#include "common/ptr.h"
@@ -185,6 +186,11 @@ public:
typedef Common::HashMap<Common::String, Script::OverrideRecord *, Common::IgnoreCase_Hash, Common::IgnoreCase_EqualTo> MessagingNameMap;
MessagingNameMap _messagingNames;
+ // Nancy21: what the scripts keep apart from the saved games, packed the way
+ // Save:Data packs it. The original writes it to a file of its own; here it
+ // lasts for as long as the game runs.
+ Common::HashMap<Common::String, Common::Array<byte> > _scriptAttic;
+
protected:
Common::Error run() override;
void pauseEngineIntern(bool pause) override;
diff --git a/engines/nancy/script/gameapi.cpp b/engines/nancy/script/gameapi.cpp
index ebb6bc82ac5..5c93de33a50 100644
--- a/engines/nancy/script/gameapi.cpp
+++ b/engines/nancy/script/gameapi.cpp
@@ -794,6 +794,34 @@ static int loadData(lua_State *L) {
return 1;
}
+// Save:Attic(name, value) and Load:Attic(name), Nancy21: values that are kept
+// apart from the saved games. Only the scripts of Nancy22 use them, for playtest
+// statistics that the game logs only when a debug flag is set.
+static int saveAttic(lua_State *L) {
+ const char *name = luaL_checkstring(L, 2);
+ luaL_checkany(L, 3);
+
+ Common::Array<byte> packed;
+ if (!writeSavedValue(L, 3, packed, 0)) {
+ return luaL_error(L, "Save:Attic can only save tables, numbers, booleans, strings and nils");
+ }
+
+ g_nancy->_scriptAttic.setVal(name, packed);
+ return 0;
+}
+
+static int loadAttic(lua_State *L) {
+ const char *name = luaL_checkstring(L, 2);
+ if (!g_nancy->_scriptAttic.contains(name)) {
+ lua_pushnil(L);
+ return 1;
+ }
+
+ uint pos = 0;
+ readSavedValue(L, g_nancy->_scriptAttic[name], pos);
+ return 1;
+}
+
// Save:Game(name), which saves the game under a name of the scripts' choosing
static int saveGame(lua_State *L) {
const char *name = luaL_checkstring(L, 2);
@@ -844,6 +872,7 @@ static int saveScreenshot(lua_State *L) {
static const luaL_Reg kSaveFunctions[] = {
{ "__index", indexFunctions },
{ "Data", saveData },
+ { "Attic", saveAttic },
{ "Game", saveGame },
{ "Screenshot", saveScreenshot },
{ nullptr, nullptr }
@@ -852,6 +881,7 @@ static const luaL_Reg kSaveFunctions[] = {
static const luaL_Reg kLoadFunctions[] = {
{ "__index", indexFunctions },
{ "Data", loadData },
+ { "Attic", loadAttic },
{ nullptr, nullptr }
};
Commit: 69bc7bdd9e9c9279912ac9aa391463c19cbd1281
https://github.com/scummvm/scummvm/commit/69bc7bdd9e9c9279912ac9aa391463c19cbd1281
Author: Filippos Karapetis (bluegr at gmail.com)
Date: 2026-10-31T10:42:34+02:00
Commit Message:
NANCY: NANCY22: Add Save:GetScreenshotNames and name pictures _SSPIC
Save:GetScreenshotNames gives the names of the pictures taken with the
cell phone camera. Nancy22 also names new pictures "<time>_SSPIC",
instead of the "<time>_OVL" of Nancy21.
Changed paths:
engines/nancy/script/gameapi.cpp
diff --git a/engines/nancy/script/gameapi.cpp b/engines/nancy/script/gameapi.cpp
index 5c93de33a50..52ec34cfa54 100644
--- a/engines/nancy/script/gameapi.cpp
+++ b/engines/nancy/script/gameapi.cpp
@@ -822,6 +822,21 @@ static int loadAttic(lua_State *L) {
return 1;
}
+// Save:GetScreenshotNames(), Nancy22: the names of the pictures the camera of
+// the cell phone took
+static int saveGetScreenshotNames(lua_State *L) {
+ const ScriptPictureData *pictures = (const ScriptPictureData *)NancySceneState.getPuzzleData(ScriptPictureData::getTag());
+
+ lua_createtable(L, pictures->pictures.size(), 0);
+ int index = 1;
+ for (const auto &picture : pictures->pictures) {
+ lua_pushstring(L, picture._key.c_str());
+ lua_rawseti(L, -2, index++);
+ }
+
+ return 1;
+}
+
// Save:Game(name), which saves the game under a name of the scripts' choosing
static int saveGame(lua_State *L) {
const char *name = luaL_checkstring(L, 2);
@@ -840,7 +855,9 @@ static int saveGame(lua_State *L) {
// it couldn't be taken.
static int saveScreenshot(lua_State *L) {
const ScriptRect &rect = checkRect(L, 2);
- const Common::String name = lua_gettop(L) > 2 ? Common::String(luaL_checkstring(L, 3)) : Common::String::format("%u_OVL", g_system->getMillis());
+ // Nancy22 names the pictures it takes "<time>_SSPIC"
+ const char *suffix = g_nancy->getGameType() >= kGameTypeNancy22 ? "_SSPIC" : "_OVL";
+ const Common::String name = lua_gettop(L) > 2 ? Common::String(luaL_checkstring(L, 3)) : Common::String::format("%u%s", g_system->getMillis(), suffix);
// The viewport as it was drawn last, before it got scaled onto the screen
const Graphics::ManagedSurface &image = g_nancy->_graphics->getGameImage();
@@ -875,6 +892,7 @@ static const luaL_Reg kSaveFunctions[] = {
{ "Attic", saveAttic },
{ "Game", saveGame },
{ "Screenshot", saveScreenshot },
+ { "GetScreenshotNames", saveGetScreenshotNames },
{ nullptr, nullptr }
};
Commit: 9ce4b411f1ae4dd70b6d84bbf3fe65fc7c13103b
https://github.com/scummvm/scummvm/commit/9ce4b411f1ae4dd70b6d84bbf3fe65fc7c13103b
Author: Filippos Karapetis (bluegr at gmail.com)
Date: 2026-10-31T10:42:36+02:00
Commit Message:
NANCY: NANCY22: Add the source field to AnimOverlay records
animOverlay.source gives the part of the image that the current frame
shows. The scripts of Nancy22 use it to measure what they lay out.
Changed paths:
engines/nancy/script/records.cpp
diff --git a/engines/nancy/script/records.cpp b/engines/nancy/script/records.cpp
index 6d5848ead4a..41ae6d847c1 100644
--- a/engines/nancy/script/records.cpp
+++ b/engines/nancy/script/records.cpp
@@ -1268,6 +1268,9 @@ bool AnimOverlayRecord::getField(const Common::String &key) {
lua_pushinteger(L, _sources.size());
} else if (key == "fps") {
lua_pushnumber(L, _framesPerSecond);
+ } else if (key == "source") {
+ // Nancy22: the part of the image that shows now
+ pushRect(L, _frame >= 1 && _frame <= (int)_sources.size() ? _sources[_frame - 1] : ScriptRect());
} else {
return false;
}
Commit: e6d429015904f0107193ee359f0381ed497ddba8
https://github.com/scummvm/scummvm/commit/e6d429015904f0107193ee359f0381ed497ddba8
Author: Filippos Karapetis (bluegr at gmail.com)
Date: 2026-10-31T10:42:39+02:00
Commit Message:
NANCY: NANCY22: Remove game check from the SetMessagingName Override
The scripts of older games never call it, so it needs no game check.
Changed paths:
engines/nancy/script/records.cpp
diff --git a/engines/nancy/script/records.cpp b/engines/nancy/script/records.cpp
index 41ae6d847c1..a4396ad38ea 100644
--- a/engines/nancy/script/records.cpp
+++ b/engines/nancy/script/records.cpp
@@ -869,7 +869,8 @@ bool OverrideRecord::getField(const Common::String &key) {
return true;
}
- if (key == "SetMessagingName" && g_nancy->getGameType() >= kGameTypeNancy22) {
+ // Nancy22
+ if (key == "SetMessagingName") {
lua_pushcfunction(getLua(), overrideSetMessagingName);
return true;
}
Commit: 0ee30329a11b38f0ec1fa7078e14c1dfa212ec28
https://github.com/scummvm/scummvm/commit/0ee30329a11b38f0ec1fa7078e14c1dfa212ec28
Author: Filippos Karapetis (bluegr at gmail.com)
Date: 2026-10-31T10:42:41+02:00
Commit Message:
NANCY: NANCY19: Add UI:CreateObject and UI:DestroyObject
These add controls to the UI panels from a template, and remove them.
They exist from Nancy19 on, but only the scripts of Nancy22 use them,
e.g. for the responses of the conversations.
Changed paths:
engines/nancy/script/gameapi.cpp
engines/nancy/ui/ndui/manager.cpp
engines/nancy/ui/ndui/manager.h
diff --git a/engines/nancy/script/gameapi.cpp b/engines/nancy/script/gameapi.cpp
index 52ec34cfa54..d3e948b7dd7 100644
--- a/engines/nancy/script/gameapi.cpp
+++ b/engines/nancy/script/gameapi.cpp
@@ -1937,6 +1937,38 @@ static const luaL_Reg kLogFunctions[] = {
{ nullptr, nullptr }
};
+// UI, Nancy19: makes and takes away the controls of the panels. The scripts of
+// a panel make the controls that come from a template themselves. Only the
+// scripts of Nancy22 use it, e.g. for the responses of the conversations.
+
+// UI:CreateObject(panel, name, template[, loadName[, ...]]), which gives whether
+// the control was made
+static int uiCreateObject(lua_State *L) {
+ const char *parentName = luaL_checkstring(L, 2);
+ const char *name = luaL_checkstring(L, 3);
+ const char *templateName = luaL_checkstring(L, 4);
+
+ UI::NDUI::Manager *ui = NancySceneState.getNDUI();
+ lua_pushboolean(L, ui && ui->createObject(name, templateName, parentName));
+ return 1;
+}
+
+// UI:DestroyObject(name)
+static int uiDestroyObject(lua_State *L) {
+ const char *name = luaL_checkstring(L, 2);
+
+ UI::NDUI::Manager *ui = NancySceneState.getNDUI();
+ lua_pushboolean(L, ui && ui->destroyObject(name));
+ return 1;
+}
+
+static const luaL_Reg kUIFunctions[] = {
+ { "__index", indexFunctions },
+ { "CreateObject", uiCreateObject },
+ { "DestroyObject", uiDestroyObject },
+ { nullptr, nullptr }
+};
+
// Autotext, for the captions
// Autotext:RemoveCC(anything) takes down the caption that shows. The original
@@ -2048,6 +2080,7 @@ void registerGameAPI(lua_State *L) {
registerGlobal(L, "Save", "ND.Save", kSaveFunctions);
registerGlobal(L, "Load", "ND.Load", kLoadFunctions);
registerGlobal(L, "Log", "ND.Log", kLogFunctions);
+ registerGlobal(L, "UI", "ND.UIMgr", kUIFunctions);
}
} // End of namespace Script
diff --git a/engines/nancy/ui/ndui/manager.cpp b/engines/nancy/ui/ndui/manager.cpp
index f6672e1861e..c89d21bfc16 100644
--- a/engines/nancy/ui/ndui/manager.cpp
+++ b/engines/nancy/ui/ndui/manager.cpp
@@ -225,21 +225,22 @@ Manager::Request Manager::takeRequest() {
return request;
}
-void Manager::createObject(const Common::String &name, const Common::String &templateName, const Common::String &parentName) {
+bool Manager::createObject(const Common::String &name, const Common::String &templateName, const Common::String &parentName) {
Panel *parent = findPanel(parentName);
// Nancy19 has the script of the panel make the control
if (parent && g_nancy->getGameType() >= kGameTypeNancy19) {
if (!parent->createObject(name, templateName)) {
warning("Couldn't create UI object %s from %s in %s", name.c_str(), templateName.c_str(), parentName.c_str());
+ return false;
}
- return;
+ return true;
}
if (!parent || !_templates.contains(templateName)) {
warning("Couldn't create UI object %s from %s in %s", name.c_str(), templateName.c_str(), parentName.c_str());
- return;
+ return false;
}
const Common::Array<byte> &data = _templates[templateName];
@@ -250,14 +251,17 @@ void Manager::createObject(const Common::String &name, const Common::String &tem
Control *control = parent->addNewControl(type, stream);
control->setName(name);
parent->arrangeControls();
+ return true;
}
-void Manager::destroyObject(const Common::String &name) {
+bool Manager::destroyObject(const Common::String &name) {
for (Panel *panel : _panels) {
if (panel->removeControl(name)) {
- return;
+ return true;
}
}
+
+ return false;
}
bool Manager::isItemButton(const Common::String &name) const {
diff --git a/engines/nancy/ui/ndui/manager.h b/engines/nancy/ui/ndui/manager.h
index 298ad80ca75..2950a14fca8 100644
--- a/engines/nancy/ui/ndui/manager.h
+++ b/engines/nancy/ui/ndui/manager.h
@@ -123,8 +123,8 @@ public:
const Graphics::ManagedSurface *getTexture(const Common::String &name);
// Creates a control from a template, as the last one of a panel
- void createObject(const Common::String &name, const Common::String &templateName, const Common::String &parentName);
- void destroyObject(const Common::String &name);
+ bool createObject(const Common::String &name, const Common::String &templateName, const Common::String &parentName);
+ bool destroyObject(const Common::String &name);
// Engine state shown by the UI
void update();
Commit: bcfc55986978d97d77e02d7bf37e1a324601b7e2
https://github.com/scummvm/scummvm/commit/bcfc55986978d97d77e02d7bf37e1a324601b7e2
Author: Filippos Karapetis (bluegr at gmail.com)
Date: 2026-10-31T10:42:44+02:00
Commit Message:
NANCY: NANCY19: Move the XSheet code out of the conversations
The code that plays an XSheet, which puts together the movies of a
character, moves into a class of its own. The conversations keep
working as before, and the Xsheet record of Nancy22 can use the same
code.
Changed paths:
A engines/nancy/script/xsheet.cpp
A engines/nancy/script/xsheet.h
engines/nancy/module.mk
engines/nancy/script/convo.cpp
engines/nancy/script/convo.h
diff --git a/engines/nancy/module.mk b/engines/nancy/module.mk
index d6fdbbab523..5e215459128 100644
--- a/engines/nancy/module.mk
+++ b/engines/nancy/module.mk
@@ -231,7 +231,8 @@ MODULE_OBJS += \
script/ref.o \
script/scenecontext.o \
script/types.o \
- script/uiapi.o
+ script/uiapi.o \
+ script/xsheet.o
endif
# This module can be built as a plugin
diff --git a/engines/nancy/script/convo.cpp b/engines/nancy/script/convo.cpp
index f5c52daa631..db7c44dd29d 100644
--- a/engines/nancy/script/convo.cpp
+++ b/engines/nancy/script/convo.cpp
@@ -19,14 +19,10 @@
*
*/
-#include "common/archive.h"
-#include "common/stream.h"
#include "common/textconsole.h"
-#include "engines/nancy/graphics.h"
#include "engines/nancy/nancy.h"
#include "engines/nancy/sound.h"
-#include "engines/nancy/util.h"
#include "engines/nancy/script/api.h"
#include "engines/nancy/script/convo.h"
@@ -46,11 +42,6 @@ static const uint16 kCharacterChannel = 24;
static const uint16 kPlayerChannel = 25;
static const uint16 kConvoVolume = 85;
-// The parts of an XSheet
-static const uint kXSheetFrameCountOffset = 0x22;
-static const uint kXSheetMaxTrees = 4;
-//static const uint kXSheetNameSize = 33;
-
// The sound of a video conversation is named after its XSheet. In Nancy20 the
// two names end differently: GFL01_XS goes with the sound GFL01_SFX.
static Common::String xsheetToSoundName(const Common::String &xsheetName) {
@@ -96,10 +87,6 @@ ConvoRecord::~ConvoRecord() {
ui->removeEngineTarget("Engine_Convo");
ui->endConversation();
}
-
- for (Tree *tree : _trees) {
- delete tree;
- }
}
void ConvoRecord::readTable(int tableIndex) {
@@ -153,130 +140,12 @@ void ConvoRecord::readTable(int tableIndex) {
}
}
-bool ConvoRecord::loadXSheet(const Common::String &name) {
- Common::SeekableReadStream *xsheet = SearchMan.createReadStreamForMember(Common::Path(name));
- if (!xsheet) {
- warning("Could not open XSheet file %s", name.c_str());
- return false;
- }
-
- xsheet->seek(kXSheetFrameCountOffset);
- _numFrames = xsheet->readUint16LE();
- const uint numTrees = MIN<uint>(xsheet->readUint16LE(), kXSheetMaxTrees);
-
- Common::Array<Common::String> treeNames(kXSheetMaxTrees);
- for (Common::String &treeName : treeNames) {
- readFilename(*xsheet, treeName);
- }
-
- // Nancy20 lines the rectangles up on four bytes
- if (g_nancy->getGameType() >= kGameTypeNancy20) {
- xsheet->skip(2);
- }
-
- // Where each part goes in the viewport; the right and bottom edge are left out
- Common::Array<Common::Rect> treeRects;
- readRectArray(*xsheet, treeRects, kXSheetMaxTrees);
-
- _framesPerSecond = xsheet->readUint32LE();
-
- for (uint i = 0; i < numTrees; ++i) {
- Tree *tree = new Tree();
- tree->frames.resize(_numFrames);
- _trees.push_back(tree);
- }
-
- // Every frame has a movie frame for each of the parts there can be
- for (uint frame = 0; frame < _numFrames; ++frame) {
- for (uint i = 0; i < kXSheetMaxTrees; ++i) {
- const int32 movieFrame = xsheet->readSint32LE();
- if (i < numTrees) {
- _trees[i]->frames[frame] = movieFrame;
- }
- }
-
- xsheet->skip(8);
- }
-
- delete xsheet;
-
- for (uint i = 0; i < numTrees; ++i) {
- Tree &tree = *_trees[i];
- Common::Rect dest = treeRects[i];
- if (!dest.isEmpty()) {
- --dest.right;
- --dest.bottom;
- }
-
- if (dest.isEmpty() || !tree.player.loadFile(Common::Path(treeNames[i]))) {
- warning("Could not load conversation movie %s of XSheet %s", treeNames[i].c_str(), name.c_str());
- return false;
- }
-
- // The movies come with an alpha plane, which they are drawn by
- tree.dest = dest;
- tree.graphic.init();
- tree.graphic.moveTo(dest);
- tree.graphic.setTransparent(false);
- tree.graphic.setVisible(false);
- tree.graphic.registerGraphics();
-
- showMovieFrame(tree, (tree.frames.empty() || isTreeFreeRunning(tree)) ? 0 : tree.frames[0]);
- }
-
- onZChanged();
- return true;
-}
-
-// The first part is drawn over the ones after it
void ConvoRecord::onZChanged() {
- for (uint i = 0; i < _trees.size(); ++i) {
- _trees[i]->graphic.setScriptZ(getZ() + (i == 0 ? 1 : 0), getContext());
- }
+ _xsheet.setZ(getZ(), getContext());
}
void ConvoRecord::updateGraphics() {
- for (Tree *tree : _trees) {
- tree->graphic.setVisible(hasStarted());
- }
-}
-
-// The movies are padded to a multiple of 16 pixels; the picture itself is as
-// large as the place it goes to
-void ConvoRecord::drawTree(Tree &tree, const Graphics::Surface &frame) {
- const Common::Rect picture(MIN<int>(frame.w, tree.dest.width()), MIN<int>(frame.h, tree.dest.height()));
- GraphicsManager::copyToManaged(frame.getSubArea(picture), tree.graphic._drawSurface);
- tree.graphic.setNeedsRedraw(true);
-}
-
-void ConvoRecord::showMovieFrame(Tree &tree, int32 movieFrame) {
- if (movieFrame == tree.shownFrame) {
- return;
- }
-
- const Graphics::Surface *frame = tree.player.decodeNextFrame(movieFrame);
- if (frame) {
- drawTree(tree, *frame);
- tree.shownFrame = movieFrame;
- }
-}
-
-bool ConvoRecord::isTreeFreeRunning(const Tree &tree) const {
- return _frame < tree.frames.size() && tree.frames[_frame] == kFreeRunning;
-}
-
-void ConvoRecord::showFrame(uint frame) {
- if (frame == _frame) {
- return;
- }
-
- _frame = frame;
-
- for (Tree *tree : _trees) {
- if (frame < tree->frames.size() && tree->frames[frame] != kFreeRunning) {
- showMovieFrame(*tree, tree->frames[frame]);
- }
- }
+ _xsheet.setVisible(hasStarted());
}
// The line is over once the XSheet has reached its last frame, and the parts
@@ -286,13 +155,11 @@ bool ConvoRecord::isVideoDone() const {
return true;
}
- for (const Tree *tree : _trees) {
- if (isTreeFreeRunning(*tree) && !tree->player.endOfVideo()) {
- return false;
- }
+ if (!_xsheet.isFreeRunningDone()) {
+ return false;
}
- return _numFrames == 0 || _frame == _numFrames - 1;
+ return _xsheet.getNumFrames() == 0 || _xsheet.getFrame() == _xsheet.getNumFrames() - 1;
}
// The character stops talking, and the video goes to the end of the line, where
@@ -314,18 +181,11 @@ bool ConvoRecord::skipSpeech() {
_isLineSkipped = true;
// The parts that play by themselves, like the head that moves its lips,
- // stop on their last frame, so they stay together with the rest
- for (Tree *tree : _trees) {
- if (isTreeFreeRunning(*tree) && tree->player.getFrameCount() > 0) {
- const Graphics::Surface *movieFrame = tree->player.decodeNextFrame(tree->player.getFrameCount() - 1);
- if (movieFrame) {
- drawTree(*tree, *movieFrame);
- }
- }
- }
+ // stop on their last frame
+ _xsheet.parkFreeRunning();
- if (_isVideo && _numFrames > 0) {
- showFrame(_numFrames - 1);
+ if (_isVideo && _xsheet.getNumFrames() > 0) {
+ _xsheet.showFrame(_xsheet.getNumFrames() - 1);
}
return true;
@@ -382,7 +242,8 @@ void ConvoRecord::runOnce() {
context.setConvo(this);
if (_isVideo) {
- loadXSheet(soundToXSheetName(_soundNames[0]));
+ _xsheet.load(soundToXSheetName(_soundNames[0]));
+ onZChanged();
}
// The scripts named by the record add the responses they have to its own
@@ -457,33 +318,23 @@ void ConvoRecord::run(double sceneTime, double elapsedTime) {
}
_lineStartTime = sceneTime;
- for (Tree *tree : _trees) {
- // The parts that play by themselves keep their own time
- if (isTreeFreeRunning(*tree)) {
- tree->player.start();
- }
- }
-
+ _xsheet.startFreeRunning();
_state = kPlayLine;
break;
case kPlayLine: {
- for (Tree *tree : _trees) {
- if (!_isLineSkipped && isTreeFreeRunning(*tree) && tree->player.needsUpdate()) {
- const Graphics::Surface *movieFrame = tree->player.decodeNextFrame();
- if (movieFrame) {
- drawTree(*tree, *movieFrame);
- }
- }
+ if (!_isLineSkipped) {
+ _xsheet.updateFreeRunning();
}
- if (_isVideo && _numFrames > 0 && !_isLineSkipped) {
+ const uint numFrames = _xsheet.getNumFrames();
+ if (_isVideo && numFrames > 0 && !_isLineSkipped) {
// The frames keep up with the sound, and go on one at a time after it
- uint frame = _frame + 1;
+ uint frame = _xsheet.getFrame() + 1;
if (isSoundPlaying) {
- frame = (uint)MAX(0.0, (sceneTime - _lineStartTime) * _framesPerSecond);
+ frame = (uint)MAX(0.0, (sceneTime - _lineStartTime) * _xsheet.getFramesPerSecond());
}
- showFrame(MIN<uint>(frame, _numFrames - 1));
+ _xsheet.showFrame(MIN<uint>(frame, numFrames - 1));
}
// The player has to pick a response before anything else happens. The
diff --git a/engines/nancy/script/convo.h b/engines/nancy/script/convo.h
index 5cdad22c8ef..90045b050f7 100644
--- a/engines/nancy/script/convo.h
+++ b/engines/nancy/script/convo.h
@@ -26,9 +26,9 @@
#include "common/str.h"
#include "engines/nancy/commontypes.h"
-#include "engines/nancy/movieplayer.h"
#include "engines/nancy/script/records.h"
+#include "engines/nancy/script/xsheet.h"
#include "engines/nancy/ui/ndui/manager.h"
@@ -49,10 +49,8 @@ struct ConvoResponse {
// runs, which as a rule moves on to the scene with the next line. A line without
// responses runs its default record when it is over.
//
-// A video conversation shows the character with movies, one for each part of it
-// (body, head). An XSheet with the name of the line's sound lists the parts, and
-// the frame of each part's movie to show over time; a part without a frame number
-// plays through by itself. A sound conversation plays its sounds one after another.
+// A video conversation shows the character with the XSheet that has the name of
+// the line's sound. A sound conversation plays its sounds one after another.
//
// Only one conversation runs in a scene: the ones that turn active afterwards are
// done at once. Its responses stay up until the scene goes away.
@@ -89,22 +87,6 @@ private:
kPlayResponse
};
- // One part of the character
- struct Tree {
- MoviePlayer player;
- RecordGraphic graphic;
- Common::Rect dest;
- Common::Array<int32> frames; // the movie frame to show at each frame of the XSheet
- int32 shownFrame = -1;
- };
-
- static const int32 kFreeRunning = -1;
-
- bool loadXSheet(const Common::String &name);
- void showFrame(uint frame);
- void showMovieFrame(Tree &tree, int32 movieFrame);
- void drawTree(Tree &tree, const Graphics::Surface &frame);
- bool isTreeFreeRunning(const Tree &tree) const;
bool isVideoDone() const;
void playSound(const Common::String &name, uint16 channel);
@@ -117,10 +99,7 @@ private:
Common::Array<ConvoResponse *> _responses;
Record *_default = nullptr;
- Common::Array<Tree *> _trees;
- uint _numFrames = 0;
- uint32 _framesPerSecond = 0;
- uint _frame = 0;
+ XSheet _xsheet;
State _state = kStartLine;
uint _curSound = 0;
diff --git a/engines/nancy/script/xsheet.cpp b/engines/nancy/script/xsheet.cpp
new file mode 100644
index 00000000000..de3fede1010
--- /dev/null
+++ b/engines/nancy/script/xsheet.cpp
@@ -0,0 +1,223 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+#include "common/archive.h"
+#include "common/stream.h"
+#include "common/textconsole.h"
+
+#include "engines/nancy/graphics.h"
+#include "engines/nancy/nancy.h"
+#include "engines/nancy/util.h"
+
+#include "engines/nancy/script/xsheet.h"
+
+namespace Nancy {
+namespace Script {
+
+// The parts of an XSheet
+static const uint kXSheetFrameCountOffset = 0x22;
+static const uint kXSheetMaxTrees = 4;
+
+bool XSheet::load(const Common::String &name) {
+ clear();
+
+ Common::SeekableReadStream *xsheet = SearchMan.createReadStreamForMember(Common::Path(name));
+ if (!xsheet) {
+ warning("Could not open XSheet file %s", name.c_str());
+ return false;
+ }
+
+ xsheet->seek(kXSheetFrameCountOffset);
+ _numFrames = xsheet->readUint16LE();
+ const uint numTrees = MIN<uint>(xsheet->readUint16LE(), kXSheetMaxTrees);
+
+ Common::Array<Common::String> treeNames(kXSheetMaxTrees);
+ for (Common::String &treeName : treeNames) {
+ readFilename(*xsheet, treeName);
+ }
+
+ // Nancy20 lines the rectangles up on four bytes
+ if (g_nancy->getGameType() >= kGameTypeNancy20) {
+ xsheet->skip(2);
+ }
+
+ // Where each part goes in the viewport; the right and bottom edge are left out
+ Common::Array<Common::Rect> treeRects;
+ readRectArray(*xsheet, treeRects, kXSheetMaxTrees);
+
+ _framesPerSecond = xsheet->readUint32LE();
+
+ for (uint i = 0; i < numTrees; ++i) {
+ Tree *tree = new Tree();
+ tree->frames.resize(_numFrames);
+ _trees.push_back(tree);
+ }
+
+ // Every frame has a movie frame for each of the parts there can be
+ for (uint frame = 0; frame < _numFrames; ++frame) {
+ for (uint i = 0; i < kXSheetMaxTrees; ++i) {
+ const int32 movieFrame = xsheet->readSint32LE();
+ if (i < numTrees) {
+ _trees[i]->frames[frame] = movieFrame;
+ }
+ }
+
+ xsheet->skip(8);
+ }
+
+ delete xsheet;
+
+ _name = name;
+ _frame = 0;
+
+ for (uint i = 0; i < numTrees; ++i) {
+ Tree &tree = *_trees[i];
+ Common::Rect dest = treeRects[i];
+ if (!dest.isEmpty()) {
+ --dest.right;
+ --dest.bottom;
+ }
+
+ if (dest.isEmpty() || !tree.player.loadFile(Common::Path(treeNames[i]))) {
+ warning("Could not load conversation movie %s of XSheet %s", treeNames[i].c_str(), name.c_str());
+ clear();
+ return false;
+ }
+
+ // The movies come with an alpha plane, which they are drawn by
+ tree.dest = dest;
+ tree.graphic.init();
+ tree.graphic.moveTo(dest);
+ tree.graphic.setTransparent(false);
+ tree.graphic.setVisible(false);
+ tree.graphic.registerGraphics();
+
+ showMovieFrame(tree, (tree.frames.empty() || isTreeFreeRunning(tree)) ? 0 : tree.frames[0]);
+ }
+
+ return true;
+}
+
+void XSheet::clear() {
+ for (Tree *tree : _trees) {
+ delete tree;
+ }
+
+ _trees.clear();
+ _name.clear();
+ _numFrames = 0;
+ _framesPerSecond = 0;
+ _frame = 0;
+}
+
+bool XSheet::isTreeFreeRunning(const Tree &tree) const {
+ return _frame < tree.frames.size() && tree.frames[_frame] == kFreeRunning;
+}
+
+// The movies are padded to a multiple of 16 pixels; the picture itself is as
+// large as the place it goes to
+void XSheet::drawTree(Tree &tree, const Graphics::Surface &frame) {
+ const Common::Rect picture(MIN<int>(frame.w, tree.dest.width()), MIN<int>(frame.h, tree.dest.height()));
+ GraphicsManager::copyToManaged(frame.getSubArea(picture), tree.graphic._drawSurface);
+ tree.graphic.setNeedsRedraw(true);
+}
+
+void XSheet::showMovieFrame(Tree &tree, int32 movieFrame) {
+ if (movieFrame == tree.shownFrame) {
+ return;
+ }
+
+ const Graphics::Surface *frame = tree.player.decodeNextFrame(movieFrame);
+ if (frame) {
+ drawTree(tree, *frame);
+ tree.shownFrame = movieFrame;
+ }
+}
+
+void XSheet::showFrame(uint frame) {
+ if (frame == _frame) {
+ return;
+ }
+
+ _frame = frame;
+
+ for (Tree *tree : _trees) {
+ if (frame < tree->frames.size() && tree->frames[frame] != kFreeRunning) {
+ showMovieFrame(*tree, tree->frames[frame]);
+ }
+ }
+}
+
+void XSheet::startFreeRunning() {
+ for (Tree *tree : _trees) {
+ // The parts that play by themselves keep their own time
+ if (isTreeFreeRunning(*tree)) {
+ tree->player.start();
+ }
+ }
+}
+
+void XSheet::updateFreeRunning() {
+ for (Tree *tree : _trees) {
+ if (isTreeFreeRunning(*tree) && tree->player.needsUpdate()) {
+ const Graphics::Surface *movieFrame = tree->player.decodeNextFrame();
+ if (movieFrame) {
+ drawTree(*tree, *movieFrame);
+ }
+ }
+ }
+}
+
+bool XSheet::isFreeRunningDone() const {
+ for (const Tree *tree : _trees) {
+ if (isTreeFreeRunning(*tree) && !tree->player.endOfVideo()) {
+ return false;
+ }
+ }
+
+ return true;
+}
+
+void XSheet::parkFreeRunning() {
+ for (Tree *tree : _trees) {
+ if (isTreeFreeRunning(*tree) && tree->player.getFrameCount() > 0) {
+ const Graphics::Surface *movieFrame = tree->player.decodeNextFrame(tree->player.getFrameCount() - 1);
+ if (movieFrame) {
+ drawTree(*tree, *movieFrame);
+ }
+ }
+ }
+}
+
+void XSheet::setVisible(bool isVisible) {
+ for (Tree *tree : _trees) {
+ tree->graphic.setVisible(isVisible);
+ }
+}
+
+void XSheet::setZ(double z, const SceneContext &context) {
+ for (uint i = 0; i < _trees.size(); ++i) {
+ _trees[i]->graphic.setScriptZ(z + (i == 0 ? 1 : 0), context);
+ }
+}
+
+} // End of namespace Script
+} // End of namespace Nancy
diff --git a/engines/nancy/script/xsheet.h b/engines/nancy/script/xsheet.h
new file mode 100644
index 00000000000..ce253050148
--- /dev/null
+++ b/engines/nancy/script/xsheet.h
@@ -0,0 +1,94 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+#ifndef NANCY_SCRIPT_XSHEET_H
+#define NANCY_SCRIPT_XSHEET_H
+
+#include "common/array.h"
+#include "common/str.h"
+
+#include "engines/nancy/movieplayer.h"
+
+#include "engines/nancy/script/records.h"
+
+namespace Nancy {
+namespace Script {
+
+// A character in a conversation is put together from movies, one for each part
+// of it (body, head). An XSheet lists the parts, where each goes in the
+// viewport, and the frame of each part's movie to show at each of its own
+// frames. A part without a frame number plays through by itself.
+class XSheet {
+public:
+ ~XSheet() { clear(); }
+
+ // Shows the first frame
+ bool load(const Common::String &name);
+ void clear();
+
+ bool isLoaded() const { return !_trees.empty(); }
+ const Common::String &getName() const { return _name; }
+ uint getNumFrames() const { return _numFrames; }
+ uint32 getFramesPerSecond() const { return _framesPerSecond; }
+ uint getFrame() const { return _frame; }
+
+ void showFrame(uint frame);
+
+ // The parts that play by themselves at the frame that shows
+ void startFreeRunning();
+ void updateFreeRunning();
+ bool isFreeRunningDone() const;
+
+ // Puts the parts that play by themselves on their last frame, so they stay
+ // together with the rest
+ void parkFreeRunning();
+
+ void setVisible(bool isVisible);
+
+ // The first part is drawn over the ones after it
+ void setZ(double z, const SceneContext &context);
+
+private:
+ static const int32 kFreeRunning = -1;
+
+ struct Tree {
+ MoviePlayer player;
+ RecordGraphic graphic;
+ Common::Rect dest;
+ Common::Array<int32> frames; // the movie frame to show at each frame of the XSheet
+ int32 shownFrame = -1;
+ };
+
+ bool isTreeFreeRunning(const Tree &tree) const;
+ void showMovieFrame(Tree &tree, int32 movieFrame);
+ void drawTree(Tree &tree, const Graphics::Surface &frame);
+
+ Common::String _name;
+ Common::Array<Tree *> _trees;
+ uint _numFrames = 0;
+ uint32 _framesPerSecond = 0;
+ uint _frame = 0;
+};
+
+} // End of namespace Script
+} // End of namespace Nancy
+
+#endif // NANCY_SCRIPT_XSHEET_H
Commit: 325d2c29baf86228a47baa90ebfa6d5c0275ccea
https://github.com/scummvm/scummvm/commit/325d2c29baf86228a47baa90ebfa6d5c0275ccea
Author: Filippos Karapetis (bluegr at gmail.com)
Date: 2026-10-31T10:42:48+02:00
Commit Message:
NANCY: NANCY22: Add the Xsheet record
Nancy22 runs its conversations from the scripts, which show the
characters with Xsheet records. An Xsheet record plays an XSheet,
pauses on its last frame and calls OnPause. Scripts can pause it, move
it to a frame or give it another XSheet. As an enhancement, Esc skips
to the end of the line the character is saying.
Changed paths:
engines/nancy/script/api.h
engines/nancy/script/gameapi.cpp
engines/nancy/script/record.h
engines/nancy/script/records.cpp
engines/nancy/script/records.h
engines/nancy/script/xsheet.cpp
engines/nancy/script/xsheet.h
diff --git a/engines/nancy/script/api.h b/engines/nancy/script/api.h
index 08157fc415f..47dec31b017 100644
--- a/engines/nancy/script/api.h
+++ b/engines/nancy/script/api.h
@@ -110,8 +110,9 @@ void registerRefAPI(lua_State *L);
void pushSoundChannel(lua_State *L, uint16 channel);
uint16 checkSoundChannel(lua_State *L, int index);
-// Whether a channel is one of those speech plays on
+// Whether a channel is one of those speech plays on, and whether any of them plays
bool isVoiceChannel(uint16 channel);
+bool isVoicePlaying();
} // End of namespace Script
} // End of namespace Nancy
diff --git a/engines/nancy/script/gameapi.cpp b/engines/nancy/script/gameapi.cpp
index d3e948b7dd7..a71487f0b16 100644
--- a/engines/nancy/script/gameapi.cpp
+++ b/engines/nancy/script/gameapi.cpp
@@ -981,6 +981,17 @@ bool isVoiceChannel(uint16 channel) {
return channel >= layout.firstVoice && channel < layout.end;
}
+bool isVoicePlaying() {
+ const SoundChannelLayout &layout = getSoundChannelLayout();
+ for (uint16 channel = layout.firstVoice; channel < layout.end; ++channel) {
+ if (g_nancy->_sound->isSoundPlaying(channel)) {
+ return true;
+ }
+ }
+
+ return false;
+}
+
static int soundChannelIndex(lua_State *L) {
const char *name = luaL_checkstring(L, 2);
diff --git a/engines/nancy/script/record.h b/engines/nancy/script/record.h
index 90bbb05b64c..7bada4de5e6 100644
--- a/engines/nancy/script/record.h
+++ b/engines/nancy/script/record.h
@@ -123,6 +123,7 @@ public:
bool isActive() const { return _isActive && !_isDone; }
bool isDone() const { return _isDone; }
bool hasStarted() const { return _hasStarted; }
+ bool hasRunOnce() const { return _hasRunOnce; }
// Counted from the node the record is under, when it is under one
double getZ() const;
diff --git a/engines/nancy/script/records.cpp b/engines/nancy/script/records.cpp
index a4396ad38ea..e500833376c 100644
--- a/engines/nancy/script/records.cpp
+++ b/engines/nancy/script/records.cpp
@@ -42,6 +42,7 @@
#include "engines/nancy/script/ref.h"
#include "engines/nancy/script/scenecontext.h"
#include "engines/nancy/script/types.h"
+#include "engines/nancy/script/xsheet.h"
#include "engines/nancy/state/scene.h"
@@ -68,7 +69,8 @@ static const RecordKindNames kRecordKindNames[kNumRecordKinds] = {
{ "Override", "ND.OverrideAR" },
{ "Particle", "ND.ParticleAR" },
{ "AnimOverlay", "ND.AnimOvlAR" },
- { "Physics", "ND.PhysicsAR" }
+ { "Physics", "ND.PhysicsAR" },
+ { "Xsheet", "ND.XsheetAR" }
};
const char *getRecordKindName(RecordKind kind) {
@@ -105,6 +107,8 @@ Record *makeRecord(RecordKind kind, SceneContext &context) {
return new ParticleRecord(context);
case kRecordPhysics:
return new PhysicsRecord(context);
+ case kRecordXsheet:
+ return new XsheetRecord(context);
default:
return nullptr;
}
diff --git a/engines/nancy/script/records.h b/engines/nancy/script/records.h
index b227023f774..5b47fe86b05 100644
--- a/engines/nancy/script/records.h
+++ b/engines/nancy/script/records.h
@@ -57,8 +57,9 @@ enum RecordKind {
kRecordParticle = 9,
kRecordAnimOverlay = 10,
kRecordPhysics = 11, // Nancy21
+ kRecordXsheet = 12, // Nancy22
- kNumRecordKinds = 12
+ kNumRecordKinds = 13
};
// What scripts call the kind ("NavLogic"), and the type of its objects ("ND.NavLogic")
diff --git a/engines/nancy/script/xsheet.cpp b/engines/nancy/script/xsheet.cpp
index de3fede1010..c61c967bc91 100644
--- a/engines/nancy/script/xsheet.cpp
+++ b/engines/nancy/script/xsheet.cpp
@@ -27,6 +27,8 @@
#include "engines/nancy/nancy.h"
#include "engines/nancy/util.h"
+#include "engines/nancy/script/api.h"
+#include "engines/nancy/script/luabind.h"
#include "engines/nancy/script/xsheet.h"
namespace Nancy {
@@ -219,5 +221,160 @@ void XSheet::setZ(double z, const SceneContext &context) {
}
}
+// Xsheet
+
+void XsheetRecord::readTable(int tableIndex) {
+ lua_State *L = getLua();
+ lua_getfield(L, tableIndex, "xsheet");
+ if (!lua_isstring(L, -1)) {
+ luaL_error(L, "Field %s must be a string", "xsheet");
+ }
+
+ _xsheetName = lua_tostring(L, -1);
+ lua_pop(L, 1);
+
+ load();
+}
+
+// An XSheet is only loaded when it is another one, and there is none to load
+// for an empty name
+void XsheetRecord::load() {
+ if (_xsheetName.empty() || _xsheetName.equalsIgnoreCase(_xsheet.getName())) {
+ return;
+ }
+
+ if (!_xsheet.load(_xsheetName)) {
+ return;
+ }
+
+ // The counter keeps its time, and goes at the pace of the new XSheet
+ _framesPerSecond = _xsheet.getFramesPerSecond();
+ if (_framesPerSecond > 0.0) {
+ _frame = MAX<int>(0, (int)(_time * _framesPerSecond));
+ if (_lastFrame > 0) {
+ _hasEnded = _frame > _lastFrame;
+ _frame = MIN(_frame, _lastFrame);
+ }
+ }
+
+ const int lastFrame = (int)_xsheet.getNumFrames() - 1;
+ if (lastFrame > 0) {
+ _lastFrame = lastFrame;
+ setFrame(MIN(_frame, _lastFrame));
+ } else {
+ _lastFrame = 0;
+ }
+
+ onZChanged();
+ updateGraphics();
+}
+
+void XsheetRecord::setFrame(int frame) {
+ if (frame == _frame || _framesPerSecond == 0.0) {
+ return;
+ }
+
+ _frame = MAX(frame, 0);
+ if (_lastFrame > 0) {
+ _frame = MIN(frame, _lastFrame);
+ _hasEnded = _frame == _lastFrame;
+ }
+
+ _time = _frame / _framesPerSecond;
+}
+
+void XsheetRecord::advance(double seconds) {
+ _time += seconds;
+ if (_framesPerSecond == 0.0) {
+ return;
+ }
+
+ _frame = MAX<int>(0, (int)(_time * _framesPerSecond));
+ if (_lastFrame > 0) {
+ _hasEnded = _frame > _lastFrame;
+ _frame = MIN(_frame, _lastFrame);
+ }
+}
+
+void XsheetRecord::run(double sceneTime, double elapsedTime) {
+ if (!_isPaused) {
+ advance(elapsedTime);
+ }
+
+ _xsheet.showFrame((uint)_frame);
+
+ if (_hasEnded && !_isPaused) {
+ _isPaused = true;
+ callFunction("OnPause");
+ }
+}
+
+// Restarting goes back to the first frame, and loads an XSheet that was handed
+// over in the meantime
+bool XsheetRecord::prepareReset() {
+ setFrame(0);
+ _xsheet.showFrame(0);
+ _isPaused = false;
+ load();
+ return true;
+}
+
+bool XsheetRecord::skipSpeech() {
+ if (!isActive() || !hasStarted() || _isPaused || _lastFrame <= 0 || !isVoicePlaying()) {
+ return false;
+ }
+
+ setFrame(_lastFrame);
+ _xsheet.showFrame((uint)_frame);
+ return true;
+}
+
+void XsheetRecord::onZChanged() {
+ _xsheet.setZ(getZ(), getContext());
+}
+
+void XsheetRecord::updateGraphics() {
+ _xsheet.setVisible(isActive() && hasStarted());
+}
+
+bool XsheetRecord::getField(const Common::String &key) {
+ lua_State *L = getLua();
+
+ if (key == "paused") {
+ lua_pushboolean(L, _isPaused);
+ } else if (key == "frame") {
+ lua_pushinteger(L, _frame);
+ } else if (key == "lastFrame") {
+ // One before the last frame of the counter, as in the original
+ lua_pushinteger(L, _lastFrame - 1);
+ } else if (key == "xsheet") {
+ lua_pushstring(L, _xsheetName.c_str());
+ } else {
+ return false;
+ }
+
+ return true;
+}
+
+bool XsheetRecord::setField(const Common::String &key) {
+ lua_State *L = getLua();
+
+ if (key == "paused") {
+ _isPaused = lua_toboolean(L, 3) != 0;
+ } else if (key == "frame") {
+ setFrame((int)luaL_checkinteger(L, 3));
+ _xsheet.showFrame((uint)_frame);
+ } else if (key == "xsheet") {
+ _xsheetName = luaL_checkstring(L, 3);
+ if (!hasRunOnce()) {
+ load();
+ }
+ } else {
+ return false;
+ }
+
+ return true;
+}
+
} // End of namespace Script
} // End of namespace Nancy
diff --git a/engines/nancy/script/xsheet.h b/engines/nancy/script/xsheet.h
index ce253050148..e6303f1368e 100644
--- a/engines/nancy/script/xsheet.h
+++ b/engines/nancy/script/xsheet.h
@@ -88,6 +88,49 @@ private:
uint _frame = 0;
};
+// Nancy22 plays the characters of its conversations with a record of their own,
+// which the scripts of the conversations drive. It goes through the frames of
+// an XSheet at its pace, and stops on the last one, which is when its "OnPause"
+// gets called. Scripts can pause it, put it at another frame or hand it another
+// XSheet. A record that has run picks up a new XSheet once it is restarted.
+class XsheetRecord : public Record {
+public:
+ XsheetRecord(SceneContext &context) : Record(context, "ND.XsheetAR") {}
+
+ void updateGraphics() override;
+
+ // Enhancement: the character goes to the end of what it says along with
+ // the voice
+ bool skipSpeech() override;
+
+protected:
+ void readTable(int tableIndex) override;
+ void runOnce() override { load(); }
+ void run(double sceneTime, double elapsedTime) override;
+ void onZChanged() override;
+ bool prepareReset() override;
+ bool getField(const Common::String &key) override;
+ bool setField(const Common::String &key) override;
+
+private:
+ void load();
+
+ // The frame counter of the original: the frame follows the time, and the
+ // end is reached once the time goes past the last frame
+ void setFrame(int frame);
+ void advance(double seconds);
+
+ Common::String _xsheetName;
+ XSheet _xsheet;
+
+ double _time = 0.0;
+ double _framesPerSecond = 0.0;
+ int _frame = 0;
+ int _lastFrame = 0;
+ bool _hasEnded = false;
+ bool _isPaused = false;
+};
+
} // End of namespace Script
} // End of namespace Nancy
Commit: d7bc1dd8fac88d4a2a816481e4f6c06d8d91169b
https://github.com/scummvm/scummvm/commit/d7bc1dd8fac88d4a2a816481e4f6c06d8d91169b
Author: Filippos Karapetis (bluegr at gmail.com)
Date: 2026-10-31T10:42:53+02:00
Commit Message:
NANCY: NANCY22: Add the Transformer record
A Transformer record moves, rotates and scales the records attached
to it. Its transform is made of stages, and each stage can blend to a
new value over time. The puzzles, the map and the driving game of
Nancy22 are built on them.
Changed paths:
A engines/nancy/script/transformer.cpp
A engines/nancy/script/transformer.h
engines/nancy/module.mk
engines/nancy/script/graphnode.cpp
engines/nancy/script/graphnode.h
engines/nancy/script/record.h
engines/nancy/script/records.cpp
engines/nancy/script/records.h
diff --git a/engines/nancy/module.mk b/engines/nancy/module.mk
index 5e215459128..3d5cd2edaf6 100644
--- a/engines/nancy/module.mk
+++ b/engines/nancy/module.mk
@@ -230,6 +230,7 @@ MODULE_OBJS += \
script/records.o \
script/ref.o \
script/scenecontext.o \
+ script/transformer.o \
script/types.o \
script/uiapi.o \
script/xsheet.o
diff --git a/engines/nancy/script/graphnode.cpp b/engines/nancy/script/graphnode.cpp
index 5e3d2b8f711..e6e7b9af1de 100644
--- a/engines/nancy/script/graphnode.cpp
+++ b/engines/nancy/script/graphnode.cpp
@@ -37,6 +37,20 @@ ScriptMatrix GraphNode::getTransform() const {
return _parent ? _transform * _parent->getTransform() : _transform;
}
+void GraphNode::setZ(double z) {
+ if (z != _z) {
+ _z = z;
+ _context.onGraphNodeChanged(this);
+ }
+}
+
+void GraphNode::setTransform(const ScriptMatrix &transform) {
+ if (transform != _transform) {
+ _transform = transform;
+ _context.onGraphNodeChanged(this);
+ }
+}
+
void GraphNode::setParent(GraphNode *parent) {
// A node can't go under itself
if (parent && parent->isUnder(this)) {
diff --git a/engines/nancy/script/graphnode.h b/engines/nancy/script/graphnode.h
index 796acd587b3..ac8f994bb91 100644
--- a/engines/nancy/script/graphnode.h
+++ b/engines/nancy/script/graphnode.h
@@ -35,7 +35,8 @@ class SceneContext;
// Scene:GraphNode(). A record that was handed to a node with node:TransferChild()
// is moved by the transform of the node on top of its own, and its z counts from
// the one of the node. The tray of puzzle pieces scrolls its pieces that way.
-// Nodes can be put under other nodes as well.
+// Nodes can be put under other nodes as well. In Nancy22, every Transformer
+// record is such a node.
class GraphNode {
public:
GraphNode(SceneContext &context) : _context(context) {}
@@ -46,6 +47,10 @@ public:
double getZ() const;
ScriptMatrix getTransform() const;
+ // The node's own, which Nancy22's Transformer records set
+ void setZ(double z);
+ void setTransform(const ScriptMatrix &transform);
+
GraphNode *getParent() const { return _parent; }
void setParent(GraphNode *parent);
diff --git a/engines/nancy/script/record.h b/engines/nancy/script/record.h
index 7bada4de5e6..9b874f67619 100644
--- a/engines/nancy/script/record.h
+++ b/engines/nancy/script/record.h
@@ -126,6 +126,7 @@ public:
bool hasRunOnce() const { return _hasRunOnce; }
// Counted from the node the record is under, when it is under one
double getZ() const;
+ double getLocalZ() const { return _z; }
// Puts the record no closer to the player than the given z
void limitZ(double z);
diff --git a/engines/nancy/script/records.cpp b/engines/nancy/script/records.cpp
index e500833376c..60a88050207 100644
--- a/engines/nancy/script/records.cpp
+++ b/engines/nancy/script/records.cpp
@@ -41,6 +41,7 @@
#include "engines/nancy/script/records.h"
#include "engines/nancy/script/ref.h"
#include "engines/nancy/script/scenecontext.h"
+#include "engines/nancy/script/transformer.h"
#include "engines/nancy/script/types.h"
#include "engines/nancy/script/xsheet.h"
@@ -70,7 +71,8 @@ static const RecordKindNames kRecordKindNames[kNumRecordKinds] = {
{ "Particle", "ND.ParticleAR" },
{ "AnimOverlay", "ND.AnimOvlAR" },
{ "Physics", "ND.PhysicsAR" },
- { "Xsheet", "ND.XsheetAR" }
+ { "Xsheet", "ND.XsheetAR" },
+ { "Transformer", "ND.TransformerAR" }
};
const char *getRecordKindName(RecordKind kind) {
@@ -109,6 +111,8 @@ Record *makeRecord(RecordKind kind, SceneContext &context) {
return new PhysicsRecord(context);
case kRecordXsheet:
return new XsheetRecord(context);
+ case kRecordTransformer:
+ return new TransformerRecord(context);
default:
return nullptr;
}
diff --git a/engines/nancy/script/records.h b/engines/nancy/script/records.h
index 5b47fe86b05..b610dfa9400 100644
--- a/engines/nancy/script/records.h
+++ b/engines/nancy/script/records.h
@@ -58,8 +58,9 @@ enum RecordKind {
kRecordAnimOverlay = 10,
kRecordPhysics = 11, // Nancy21
kRecordXsheet = 12, // Nancy22
+ kRecordTransformer = 13, // Nancy22
- kNumRecordKinds = 13
+ kNumRecordKinds = 14
};
// What scripts call the kind ("NavLogic"), and the type of its objects ("ND.NavLogic")
diff --git a/engines/nancy/script/transformer.cpp b/engines/nancy/script/transformer.cpp
new file mode 100644
index 00000000000..d543dd1dbd4
--- /dev/null
+++ b/engines/nancy/script/transformer.cpp
@@ -0,0 +1,388 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+#include "common/textconsole.h"
+
+#include "engines/nancy/script/graphnode.h"
+#include "engines/nancy/script/luabind.h"
+#include "engines/nancy/script/scenecontext.h"
+#include "engines/nancy/script/transformer.h"
+
+namespace Nancy {
+namespace Script {
+
+static const double kMinBlendTime = 0.001;
+
+TransformerRecord::TransformerRecord(SceneContext &context) :
+ Record(context, "ND.TransformerAR"),
+ _node(context.createGraphNode()) {}
+
+void TransformerRecord::readTable(int tableIndex) {
+ readField(getLua(), tableIndex, "sinLerp", _isSineLerp);
+ _node->setZ(getLocalZ());
+}
+
+// The node goes wherever the record gets attached to
+void TransformerRecord::onZChanged() {
+ if (_node->getParent() != getParentNode()) {
+ _node->setParent(getParentNode());
+ }
+
+ _node->setZ(getLocalZ());
+}
+
+TransformerRecord::Stage *TransformerRecord::findStage(const Common::String &name) {
+ for (Stage &stage : _stages) {
+ if (stage.name == name) {
+ return &stage;
+ }
+ }
+
+ return nullptr;
+}
+
+TransformerRecord::Stage &TransformerRecord::checkStage(lua_State *L, int index) {
+ const char *name = luaL_checkstring(L, index);
+ Stage *stage = findStage(name);
+ if (!stage) {
+ luaL_argerror(L, index, Common::String::format("Transformer AR does not have a stage by the name '%s'", name).c_str());
+ }
+
+ return *stage;
+}
+
+// An angle, or x and y: a vector, a point, or two numbers
+void TransformerRecord::readValue(lua_State *L, int index, StageKind kind, double value[2]) {
+ if (kind == kRotation) {
+ value[0] = luaL_checknumber(L, index);
+ return;
+ }
+
+ if (!lua_istable(L, index) && !lua_isuserdata(L, index)) {
+ value[0] = luaL_checknumber(L, index);
+ value[1] = luaL_checknumber(L, index + 1);
+ return;
+ }
+
+ lua_getfield(L, index, "x");
+ lua_getfield(L, index, "y");
+ if (!lua_isnumber(L, -2) || !lua_isnumber(L, -1)) {
+ luaL_argerror(L, index, "Table must have 'x' and 'y' fields");
+ }
+
+ value[0] = lua_tonumber(L, -2);
+ value[1] = lua_tonumber(L, -1);
+ lua_pop(L, 2);
+}
+
+ScriptMatrix TransformerRecord::makeMatrix(StageKind kind, const double value[2]) {
+ ScriptMatrix matrix;
+
+ switch (kind) {
+ case kTranslation:
+ matrix.m[3][0] = value[0];
+ matrix.m[3][1] = value[1];
+ break;
+ case kRotation:
+ // D3DXMatrixRotationZ
+ matrix.m[0][0] = cos(value[0]);
+ matrix.m[0][1] = sin(value[0]);
+ matrix.m[1][0] = -sin(value[0]);
+ matrix.m[1][1] = cos(value[0]);
+ break;
+ case kScale:
+ matrix.m[0][0] = value[0];
+ matrix.m[1][1] = value[1];
+ break;
+ }
+
+ return matrix;
+}
+
+void TransformerRecord::pushValue(const Stage &stage) {
+ lua_State *L = getLua();
+
+ if (stage.kind == kRotation) {
+ lua_pushnumber(L, stage.current[0]);
+ return;
+ }
+
+ // A translation goes nowhere in depth, and a scale keeps it
+ ScriptVector vector(stage.current[0], stage.current[1], stage.kind == kScale ? 1.0 : 0.0);
+ Script::pushVector(L, vector);
+}
+
+void TransformerRecord::setStage(Stage &stage, const double value[2]) {
+ for (int i = 0; i < 2; ++i) {
+ stage.start[i] = stage.current[i] = stage.target[i] = value[i];
+ }
+
+ stage.matrix = stage.blended = makeMatrix(stage.kind, value);
+}
+
+void TransformerRecord::applyProgress(Stage &stage, double progress) {
+ for (int i = 0; i < 2; ++i) {
+ stage.current[i] = stage.start[i] + (stage.target[i] - stage.start[i]) * progress;
+ }
+
+ stage.matrix = makeMatrix(stage.kind, stage.current);
+}
+
+bool TransformerRecord::advanceStage(Stage &stage, double seconds) {
+ if (!stage.isBlending()) {
+ return false;
+ }
+
+ lua_State *L = getLua();
+ stage.time += seconds;
+ double progress = CLIP(stage.time / stage.duration, 0.0, 1.0);
+
+ // The scripts can bend the progress; otherwise it slows down towards the end
+ lua_pushnumber(L, progress);
+ if (callFunction((stage.name + "AffectLerp").c_str(), 1, 1)) {
+ if (!lua_isnumber(L, -1)) {
+ warning("TransformerAR::AffectLerp: Value returned was not a number");
+ }
+
+ progress = lua_tonumber(L, -1);
+ lua_pop(L, 1);
+ } else if (_isSineLerp) {
+ progress = sin(progress * M_PI * 0.5);
+ }
+
+ applyProgress(stage, CLIP(progress, 0.0, 1.0));
+
+ if (!stage.isBlending()) {
+ for (int i = 0; i < 2; ++i) {
+ stage.start[i] = stage.current[i] = stage.target[i];
+ }
+
+ stage.matrix = stage.blended;
+
+ // The stage may go away along with the record in there
+ const Common::String doneName = stage.name + "Done";
+ callFunction(doneName.c_str());
+ }
+
+ return true;
+}
+
+// The stages make the transform in the order they were pushed in
+void TransformerRecord::updateTransform() {
+ ScriptMatrix transform;
+ ScriptMatrix blendedTransform;
+ for (const Stage &stage : _stages) {
+ transform = transform * stage.matrix;
+ blendedTransform = blendedTransform * stage.blended;
+ }
+
+ _blendedTransform = blendedTransform;
+ _node->setTransform(transform);
+}
+
+void TransformerRecord::run(double sceneTime, double elapsedTime) {
+ bool hasChanged = false;
+ for (uint i = 0; i < _stages.size(); ++i) {
+ hasChanged |= advanceStage(_stages[i], elapsedTime);
+ }
+
+ if (hasChanged) {
+ updateTransform();
+ }
+}
+
+// transformer:Push<Translation|Rotation|Scale>(name, value)
+int TransformerRecord::pushStage(lua_State *L, StageKind kind) {
+ const char *name = luaL_checkstring(L, 2);
+ if (findStage(name)) {
+ return luaL_argerror(L, 2, Common::String::format("Transformer AR already has a stage by the name '%s'", name).c_str());
+ }
+
+ Stage stage;
+ stage.name = name;
+ stage.kind = kind;
+
+ double value[2];
+ readValue(L, 3, kind, value);
+ setStage(stage, value);
+
+ _stages.push_back(stage);
+ updateTransform();
+ return 0;
+}
+
+// transformer:Blend(name, seconds, value)
+int TransformerRecord::blend(lua_State *L) {
+ Stage &stage = checkStage(L, 2);
+ const double duration = luaL_checknumber(L, 3);
+
+ readValue(L, 4, stage.kind, stage.target);
+ stage.blended = makeMatrix(stage.kind, stage.target);
+ for (int i = 0; i < 2; ++i) {
+ stage.start[i] = stage.current[i];
+ }
+
+ stage.duration = MAX(kMinBlendTime, duration);
+ stage.time = 0.0;
+
+ updateTransform();
+ return 0;
+}
+
+// transformer:FinishBlend([name]) puts a stage where it is going right away, or
+// all of them
+int TransformerRecord::finishBlend(lua_State *L) {
+ Common::String name;
+ if (lua_gettop(L) > 1) {
+ name = checkStage(L, 2).name;
+ }
+
+ for (uint i = 0; i < _stages.size(); ++i) {
+ if (name.empty() || _stages[i].name == name) {
+ advanceStage(_stages[i], _stages[i].duration - _stages[i].time);
+ }
+ }
+
+ updateTransform();
+ return 0;
+}
+
+// transformer:IsBlending(name)
+int TransformerRecord::isBlending(lua_State *L) {
+ lua_pushboolean(L, checkStage(L, 2).isBlending());
+ return 1;
+}
+
+// transformer:Attach(record, ...)
+int TransformerRecord::attach(lua_State *L) {
+ for (int i = 2; i <= lua_gettop(L); ++i) {
+ GraphNode *node = testGraphNode(L, i);
+ if (node) {
+ node->setParent(_node);
+ } else {
+ checkRecord(L, i)->setParentNode(_node);
+ }
+ }
+
+ return 0;
+}
+
+static TransformerRecord *checkTransformer(lua_State *L) {
+ TransformerRecord *transformer = dynamic_cast<TransformerRecord *>(checkRecord(L, 1));
+ if (!transformer) {
+ luaL_typerror(L, 1, "ND.TransformerAR");
+ }
+
+ return transformer;
+}
+
+static int transformerPushTranslation(lua_State *L) {
+ return checkTransformer(L)->pushStage(L, TransformerRecord::kTranslation);
+}
+
+static int transformerPushRotation(lua_State *L) {
+ return checkTransformer(L)->pushStage(L, TransformerRecord::kRotation);
+}
+
+static int transformerPushScale(lua_State *L) {
+ return checkTransformer(L)->pushStage(L, TransformerRecord::kScale);
+}
+
+static int transformerBlend(lua_State *L) {
+ return checkTransformer(L)->blend(L);
+}
+
+static int transformerFinishBlend(lua_State *L) {
+ return checkTransformer(L)->finishBlend(L);
+}
+
+static int transformerIsBlending(lua_State *L) {
+ return checkTransformer(L)->isBlending(L);
+}
+
+static int transformerAttach(lua_State *L) {
+ return checkTransformer(L)->attach(L);
+}
+
+static const luaL_Reg kTransformerFunctions[] = {
+ { "Attach", transformerAttach },
+ { "Blend", transformerBlend },
+ { "FinishBlend", transformerFinishBlend },
+ { "IsBlending", transformerIsBlending },
+ { "PushTranslation", transformerPushTranslation },
+ { "PushRotation", transformerPushRotation },
+ { "PushScale", transformerPushScale },
+ { nullptr, nullptr }
+};
+
+bool TransformerRecord::getField(const Common::String &key) {
+ lua_State *L = getLua();
+
+ if (key == "transform") {
+ pushMatrix(L, _node->getTransform());
+ return true;
+ } else if (key == "blendedTransform") {
+ pushMatrix(L, _blendedTransform);
+ return true;
+ }
+
+ for (const luaL_Reg *function = kTransformerFunctions; function->name; ++function) {
+ if (key == function->name) {
+ lua_pushcfunction(L, function->func);
+ return true;
+ }
+ }
+
+ const Stage *stage = findStage(key);
+ if (stage) {
+ pushValue(*stage);
+ return true;
+ }
+
+ return false;
+}
+
+// Setting a stage puts it at the value at once
+bool TransformerRecord::setField(const Common::String &key) {
+ lua_State *L = getLua();
+
+ Stage *stage = findStage(key);
+ if (stage) {
+ if (stage->isBlending()) {
+ luaL_error(L, "Stage %s is in the midst of blending. It cannot be overridden.", key.c_str());
+ }
+
+ double value[2];
+ readValue(L, 3, stage->kind, value);
+ setStage(*stage, value);
+ updateTransform();
+ return true;
+ }
+
+ if (key == "transform" || key == "blendedTransform") {
+ luaL_error(L, "You cannot set the transform or blendedTransform fields of a transformer AR directly");
+ }
+
+ return false;
+}
+
+} // End of namespace Script
+} // End of namespace Nancy
diff --git a/engines/nancy/script/transformer.h b/engines/nancy/script/transformer.h
new file mode 100644
index 00000000000..064f0ea049e
--- /dev/null
+++ b/engines/nancy/script/transformer.h
@@ -0,0 +1,120 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+#ifndef NANCY_SCRIPT_TRANSFORMER_H
+#define NANCY_SCRIPT_TRANSFORMER_H
+
+#include "common/array.h"
+#include "common/str.h"
+
+#include "engines/nancy/script/record.h"
+
+namespace Nancy {
+namespace Script {
+
+class GraphNode;
+
+// Nancy22 moves, turns and resizes what a scene shows with Transformer records.
+// The records a Transformer gets with Attach() are moved by its transform on top
+// of their own, and so are other Transformers attached to it:
+//
+// piece = AR:Transformer({})
+// piece:PushTranslation("t", Vector:New(100, 50))
+// piece:PushRotation("r", 0)
+// piece:Attach(pieceOVL)
+// piece:Blend("r", 0.5, math.pi) -- turns it half around in half a second
+//
+// The transform is made of named stages, in the order they were pushed. Setting
+// the field of a stage's name puts it at a value right away; Blend() takes it
+// there over a time, slowly at the end unless the table said sinLerp = false.
+// While a stage blends, a function "<stage>AffectLerp" of the record can bend
+// the progress from 0 to 1, and "<stage>Done" gets called once it is there.
+class TransformerRecord : public Record {
+public:
+ TransformerRecord(SceneContext &context);
+
+ GraphNode *getNode() const { return _node; }
+
+ enum StageKind {
+ kTranslation,
+ kRotation,
+ kScale
+ };
+
+ // The functions of the scripts, which return their number of results
+ int pushStage(lua_State *L, StageKind kind);
+ int blend(lua_State *L);
+ int finishBlend(lua_State *L);
+ int isBlending(lua_State *L);
+ int attach(lua_State *L);
+
+protected:
+ void readTable(int tableIndex) override;
+ void run(double sceneTime, double elapsedTime) override;
+ void onZChanged() override;
+ bool getField(const Common::String &key) override;
+ bool setField(const Common::String &key) override;
+
+private:
+ struct Stage {
+ Common::String name;
+ StageKind kind = kTranslation;
+
+ // x and y; a rotation has its angle in x
+ double start[2] = { 0.0, 0.0 };
+ double current[2] = { 0.0, 0.0 };
+ double target[2] = { 0.0, 0.0 };
+
+ double time = 0.0;
+ double duration = 0.0;
+
+ ScriptMatrix matrix; // of the current value
+ ScriptMatrix blended; // of the target
+
+ bool isBlending() const { return duration > time; }
+ };
+
+ Stage *findStage(const Common::String &name);
+ Stage &checkStage(lua_State *L, int index);
+
+ static void readValue(lua_State *L, int index, StageKind kind, double value[2]);
+ static ScriptMatrix makeMatrix(StageKind kind, const double value[2]);
+ void pushValue(const Stage &stage);
+
+ // Puts a stage at a value at once
+ void setStage(Stage &stage, const double value[2]);
+ void applyProgress(Stage &stage, double progress);
+
+ // Moves a stage on in its blend. Returns whether it was blending.
+ bool advanceStage(Stage &stage, double seconds);
+
+ void updateTransform();
+
+ Common::Array<Stage> _stages;
+ bool _isSineLerp = true;
+ ScriptMatrix _blendedTransform; // where the stages are going
+ GraphNode *_node;
+};
+
+} // End of namespace Script
+} // End of namespace Nancy
+
+#endif // NANCY_SCRIPT_TRANSFORMER_H
Commit: d45c728f65cff8a828dfcd695d8968994a4acc24
https://github.com/scummvm/scummvm/commit/d45c728f65cff8a828dfcd695d8968994a4acc24
Author: Filippos Karapetis (bluegr at gmail.com)
Date: 2026-10-31T10:42:56+02:00
Commit Message:
NANCY: NANCY22: Add the facade and enableUturn fields to summaries
With facade set, a scene keeps what the viewport showed when it
started as its background, e.g. the character after a conversation.
With enableUturn set to false, the player can't turn around in the
scene.
Changed paths:
engines/nancy/script/records.cpp
engines/nancy/script/records.h
diff --git a/engines/nancy/script/records.cpp b/engines/nancy/script/records.cpp
index 60a88050207..cbb9c87edbd 100644
--- a/engines/nancy/script/records.cpp
+++ b/engines/nancy/script/records.cpp
@@ -300,8 +300,11 @@ void SummaryRecord::readTable(int tableIndex) {
lua_pop(L, 1);
- // Whether turning goes on past the first and the last frame
+ // Whether turning goes on past the first and the last frame, and Nancy22:
+ // whether the player can turn around
readField(L, tableIndex, "wrap", _wraps);
+ readField(L, tableIndex, "enableUturn", _hasUturn);
+ readField(L, tableIndex, "facade", _isFacade);
// The background is behind everything else
limitZ(kBackgroundScriptZ);
@@ -361,6 +364,29 @@ void SummaryRecord::updateTheme(double sceneTime) {
void SummaryRecord::runOnce() {
playTheme();
+
+ if (_isFacade) {
+ showFacade();
+ }
+}
+
+// Nancy22: a scene with a facade keeps what the viewport showed when it started
+// as its background, e.g. the character after a conversation is over
+void SummaryRecord::showFacade() {
+ const Graphics::ManagedSurface &image = g_nancy->_graphics->getGameImage();
+ Common::Rect area = NancySceneState.getViewport().getScreenPosition();
+ area.clip(Common::Rect(image.w, image.h));
+ if (area.isEmpty()) {
+ return;
+ }
+
+ _facade._drawSurface.copyFrom(image.rawSurface().getSubArea(area));
+ _facade.init();
+ _facade.moveTo(Common::Rect(area.width(), area.height()));
+ _facade.setTransparent(false);
+ _facade.setScriptZ(kBackgroundScriptZ, getContext());
+ _facade.setVisible(true);
+ _facade.registerGraphics();
}
void SummaryRecord::setBackground(UI::Viewport *background) {
@@ -394,7 +420,7 @@ SummaryRecord::Turn SummaryRecord::getTurnAt(const ScriptPoint &point, bool inVi
} else if (boot->rightNodeHotspot.contains(place)) {
return canTurn(kTurnRight) ? kTurnRight : kNoTurn;
} else if (boot->uturnNodeHotspot.contains(place)) {
- return kTurnAround;
+ return _hasUturn ? kTurnAround : kNoTurn;
}
return kNoTurn;
diff --git a/engines/nancy/script/records.h b/engines/nancy/script/records.h
index b610dfa9400..b476d5e1526 100644
--- a/engines/nancy/script/records.h
+++ b/engines/nancy/script/records.h
@@ -128,6 +128,7 @@ private:
void setFrame(uint frame);
void playTheme();
void updateTheme(double sceneTime);
+ void showFacade();
Common::String _environment;
Common::String _backgroundName;
@@ -147,6 +148,9 @@ private:
double _sceneTime = 0.0;
bool _wraps = true;
+ bool _hasUturn = true;
+ bool _isFacade = false;
+ RecordGraphic _facade;
};
// Changes the scene and sets flags, either right away or when its hotspot gets clicked
Commit: 98c89fb7ee661b0073b4f5b77257efd81785a4dc
https://github.com/scummvm/scummvm/commit/98c89fb7ee661b0073b4f5b77257efd81785a4dc
Author: Filippos Karapetis (bluegr at gmail.com)
Date: 2026-10-31T10:43:00+02:00
Commit Message:
NANCY: NANCY22: Let NavLogic hotspots act like buttons
With mouseMode set to "OnDownAndUp", a NavLogic hotspot works like a
button. It calls OnDown when the mouse button is pressed over it, and
OnUp and OnDown when the mouse leaves it and comes back while the
button is held. It goes off when the button is released over it. The
new "down" field tells whether it is held.
Changed paths:
engines/nancy/script/records.cpp
engines/nancy/script/records.h
diff --git a/engines/nancy/script/records.cpp b/engines/nancy/script/records.cpp
index cbb9c87edbd..3742d299079 100644
--- a/engines/nancy/script/records.cpp
+++ b/engines/nancy/script/records.cpp
@@ -600,6 +600,19 @@ void NavLogicRecord::readTable(int tableIndex) {
readField(L, tableIndex, "rightClick", _isRightClick);
+ // Nancy22: a hotspot can act like a button, which goes off when the button
+ // of the mouse that went down over it comes up over it again
+ Common::String mouseMode;
+ if (readField(L, tableIndex, "mouseMode", mouseMode)) {
+ if (mouseMode == "OnClick") {
+ _isPressedAndReleased = false;
+ } else if (mouseMode == "OnDownAndUp") {
+ _isPressedAndReleased = true;
+ } else {
+ luaL_error(L, "Mouse mode set to unrecognized value '%s'", mouseMode.c_str());
+ }
+ }
+
// The flags to set, by name
if (pushField(L, tableIndex, "flags")) {
luaL_checktype(L, -1, LUA_TTABLE);
@@ -656,8 +669,17 @@ bool NavLogicRecord::isOver(const ScriptPoint &point) const {
return _hasRefColor ? pixel == _refColor : (pixel >> 24) != 0;
}
+// A hotspot that is held down tells its scripts when the mouse leaves it and
+// comes back, with OnUp and OnDown
void NavLogicRecord::onMouseMove(const ScriptPoint &point, bool inViewport) {
+ const bool wasMouseOver = _isMouseOver;
_isMouseOver = inViewport && isOver(point);
+
+ if (_isDown && _isMouseOver && !wasMouseOver) {
+ callFunction("OnDown");
+ } else if (_isDown && !_isMouseOver && wasMouseOver) {
+ callFunction("OnUp");
+ }
}
bool NavLogicRecord::getCursor(const ScriptPoint &point, bool inViewport, uint &cursorType, bool &isHot) {
@@ -671,6 +693,24 @@ bool NavLogicRecord::getCursor(const ScriptPoint &point, bool inViewport, uint &
}
bool NavLogicRecord::onMouseEvent(RecordEvent event, const ScriptPoint &point, bool inViewport) {
+ if (_isPressedAndReleased) {
+ const RecordEvent downEvent = _isRightClick ? kEventRightDown : kEventLeftDown;
+ const RecordEvent upEvent = _isRightClick ? kEventRightUp : kEventLeftUp;
+
+ if (event == downEvent && _isMouseOver) {
+ callFunction("OnDown");
+ _isDown = true;
+ } else if (event == upEvent) {
+ const bool wasDown = _isDown;
+ _isDown = false;
+ if (wasDown && _isMouseOver) {
+ trigger();
+ }
+ }
+
+ return false;
+ }
+
const RecordEvent clickEvent = _isRightClick ? kEventRightClick : kEventLeftClick;
if (event != clickEvent || !isOver(point)) {
return false;
@@ -680,6 +720,11 @@ bool NavLogicRecord::onMouseEvent(RecordEvent event, const ScriptPoint &point, b
return true;
}
+bool NavLogicRecord::prepareReset() {
+ _isDown = false;
+ return true;
+}
+
void NavLogicRecord::trigger() {
for (const Flag &flag : _flags) {
if (!setFlagByName(flag.name, flag.value)) {
@@ -707,6 +752,8 @@ bool NavLogicRecord::getField(const Common::String &key) {
pushRect(L, _hotspot);
} else if (key == "mouseOver") {
lua_pushboolean(L, _isMouseOver);
+ } else if (key == "down") {
+ lua_pushboolean(L, _isDown);
} else if (key == "refColor" && _hasRefColor) {
pushColor(L, _refColor);
} else if (key == "source") {
diff --git a/engines/nancy/script/records.h b/engines/nancy/script/records.h
index b476d5e1526..145348b07c4 100644
--- a/engines/nancy/script/records.h
+++ b/engines/nancy/script/records.h
@@ -161,7 +161,7 @@ public:
protected:
void readTable(int tableIndex) override;
void run(double sceneTime, double elapsedTime) override;
- bool prepareReset() override { return true; }
+ bool prepareReset() override;
bool hasTransform() const override { return true; }
bool getField(const Common::String &key) override;
bool setField(const Common::String &key) override;
@@ -202,6 +202,8 @@ private:
bool _isRightClick = false; // Nancy20: the right button clicks it, not the left
bool _isMouseOver = false;
+ bool _isPressedAndReleased = false; // Nancy22: goes off when the button comes up
+ bool _isDown = false;
Common::Array<Flag> _flags;
};
Commit: 3b5dea61f4713bee8f3aa715c8aac690b3f7b82d
https://github.com/scummvm/scummvm/commit/3b5dea61f4713bee8f3aa715c8aac690b3f7b82d
Author: Filippos Karapetis (bluegr at gmail.com)
Date: 2026-10-31T10:43:02+02:00
Commit Message:
NANCY: NANCY22: Add the physics of the driving game
In Nancy22, the physics world takes fixed steps, 60 a second unless
the scene sets another time step, and calls OnStep after each one.
Nancy22 also spells the corners of a polygon "vertices".
For all games, OnContactResolved now tells how hard two shapes pushed
each other, which Nancy21 already does, and body:DestroyShape removes
a shape. Bodies can be turned and placed, and shapes give their
corners and body and take a collision filter. Only the scripts of
Nancy22 use these.
Changed paths:
engines/nancy/script/physics.cpp
engines/nancy/script/physics.h
diff --git a/engines/nancy/script/physics.cpp b/engines/nancy/script/physics.cpp
index 9c65537549c..934a104982d 100644
--- a/engines/nancy/script/physics.cpp
+++ b/engines/nancy/script/physics.cpp
@@ -26,6 +26,8 @@
#include "engines/nancy/box2d/Dynamics/Contacts/b2Contact.h"
#include "engines/nancy/box2d/Dynamics/Joints/b2MouseJoint.h"
+#include "engines/nancy/nancy.h"
+
#include "engines/nancy/script/luabind.h"
#include "engines/nancy/script/mathtypes.h"
#include "engines/nancy/script/physics.h"
@@ -57,6 +59,11 @@ void PhysicsContactListener::Add(const b2ContactPoint *point) {
_record->onContact(point->shape1, point->shape2, point->position.x, point->position.y);
}
+void PhysicsContactListener::Result(const b2ContactResult *point) {
+ _record->onContactResolved(point->shape1, point->shape2, point->position.x, point->position.y,
+ point->normalImpulse + point->tangentImpulse);
+}
+
void PhysicsDestructionListener::SayGoodbye(b2Joint *joint) {
_record->forgetJoint(joint);
}
@@ -109,6 +116,10 @@ b2Body *PhysicsRecord::findBody(uint id) const {
return _bodies.getValOrDefault(id, nullptr);
}
+b2Shape *PhysicsRecord::findShape(uint id) const {
+ return _shapes.getValOrDefault(id, nullptr);
+}
+
b2MouseJoint *PhysicsRecord::findJoint(uint id) const {
return (b2MouseJoint *)_joints.getValOrDefault(id, nullptr);
}
@@ -218,16 +229,34 @@ void PhysicsRecord::readTable(int tableIndex) {
readFloat(L, tableIndex, "timeStep", _timeStep);
readField(L, tableIndex, "iterationCount", _numIterations);
+
+ if (_timeStep > 0.0f && pushField(L, tableIndex, "timeStep")) {
+ lua_pop(L, 1);
+ _stepsPerSecond = 1.0 / _timeStep;
+ }
}
void PhysicsRecord::run(double sceneTime, double elapsedTime) {
- _world->Step((float32)elapsedTime, _numIterations);
+ if (g_nancy->getGameType() < kGameTypeNancy22) {
+ _world->Step((float32)elapsedTime, _numIterations);
+ return;
+ }
+
+ // The steps that are due by now
+ _stepClock += elapsedTime;
+ const int numSteps = (int)(_stepClock * _stepsPerSecond);
+ const float32 stepTime = (float32)(1.0 / _stepsPerSecond);
+
+ for (; _numSteps < numSteps; ++_numSteps) {
+ _world->Step(stepTime, _numIterations);
+
+ lua_pushnumber(getLua(), stepTime);
+ callFunction("OnStep", 1);
+ }
}
// OnContact(this, shape, shape, point) gets called for every new point at which
// two shapes touch, while the world steps
-// TODO: OnContactResolved, which the original calls after the contacts are
-// solved, and which no script sets
void PhysicsRecord::onContact(b2Shape *a, b2Shape *b, double x, double y) {
pushShape(a);
pushShape(b);
@@ -235,6 +264,17 @@ void PhysicsRecord::onContact(b2Shape *a, b2Shape *b, double x, double y) {
callFunction("OnContact", 3);
}
+// OnContactResolved(this, shape, shape, point, impulse), Nancy21: how hard the
+// shapes pushed each other apart at a point. Only the scripts of Nancy22 set
+// it, for the damage to the car of the driving game.
+void PhysicsRecord::onContactResolved(b2Shape *a, b2Shape *b, double x, double y, double impulse) {
+ pushShape(a);
+ pushShape(b);
+ pushPhysicsVector(getLua(), x, y);
+ lua_pushnumber(getLua(), impulse);
+ callFunction("OnContactResolved", 4);
+}
+
// world:CreateBody({ position, angle, linearDampening, angularDampening, fixedAngle,
// fastMoving, asleep, inactiveSleep })
// TODO: "massData", which no script sets
@@ -350,7 +390,7 @@ bool PhysicsRecord::getField(const Common::String &key) {
}
if (key == "timeStep") {
- lua_pushnumber(getLua(), _timeStep);
+ lua_pushnumber(getLua(), g_nancy->getGameType() >= kGameTypeNancy22 ? 1.0 / _stepsPerSecond : _timeStep);
return true;
} else if (key == "iterationCount") {
lua_pushinteger(getLua(), _numIterations);
@@ -400,8 +440,8 @@ static void readShapeDef(lua_State *L, int tableIndex, b2ShapeDef &def) {
// body:CreateShape({ radius, center } or { verticies }, with the fields of
// readShapeDef() and computeMass). The corners of a polygon go around it
-// counterclockwise, eight at the most.
-// TODO: "box", which no script uses, and body:DestroyShape(), which no script calls
+// counterclockwise, eight at the most. Nancy22 spells them "vertices".
+// TODO: "box", which no script uses
static int bodyCreateShape(lua_State *L) {
PhysicsRecord *record;
b2Body *body = checkBody(L, 1, record);
@@ -414,7 +454,7 @@ static int bodyCreateShape(lua_State *L) {
if (readFloat(L, 2, "radius", circle.radius)) {
readPhysicsVector(L, 2, "center", circle.localPosition);
def = &circle;
- } else if (pushField(L, 2, "verticies")) {
+ } else if (pushField(L, 2, g_nancy->getGameType() >= kGameTypeNancy22 ? "vertices" : "verticies")) {
for (int i = 1; polygon.vertexCount < b2_maxPolygonVertices; ++i) {
lua_rawgeti(L, -1, i);
if (lua_isnil(L, -1)) {
@@ -447,6 +487,28 @@ static int bodyCreateShape(lua_State *L) {
return 1;
}
+// body:DestroyShape(shape[, computeMass]), Nancy21, which works the mass of
+// the body out again unless told otherwise. Only the scripts of Nancy22 call it.
+static int bodyDestroyShape(lua_State *L) {
+ PhysicsRecord *record;
+ b2Body *body = checkBody(L, 1, record);
+
+ uint id;
+ if (PhysicsRecord::checkOwner(L, 2, kShapeType, id) == record) {
+ b2Shape *shape = record->findShape(id);
+ if (shape) {
+ record->forgetShape(shape);
+ body->DestroyShape(shape);
+ }
+ }
+
+ if (!lua_isboolean(L, 3) || lua_toboolean(L, 3)) {
+ body->SetMassFromShapes();
+ }
+
+ return 0;
+}
+
// body:ApplyForce(force, point), for the next step
static int bodyApplyForce(lua_State *L) {
PhysicsRecord *record;
@@ -468,21 +530,38 @@ static int bodyIndex(lua_State *L) {
const b2Vec2 velocity = body->GetLinearVelocity();
pushPhysicsVector(L, velocity.x, velocity.y);
return 1;
+ } else if (key == "angularVelocity") {
+ // Nancy22
+ lua_pushnumber(L, body->GetAngularVelocity());
+ return 1;
+ } else if (key == "angle") {
+ // Nancy22
+ lua_pushnumber(L, body->GetAngle());
+ return 1;
}
return indexFunctions(L);
}
+// A body's velocity can be set, and its turning speed, place and angle, which
+// only the scripts of Nancy22 set
static int bodyNewIndex(lua_State *L) {
PhysicsRecord *record;
b2Body *body = checkBody(L, 1, record);
const Common::String key = luaL_checkstring(L, 2);
- if (key != "velocity") {
+ if (key == "velocity") {
+ body->SetLinearVelocity(checkPhysicsVector(L, 3));
+ } else if (key == "angularVelocity") {
+ body->SetAngularVelocity((float32)luaL_checknumber(L, 3));
+ } else if (key == "position") {
+ body->SetXForm(checkPhysicsVector(L, 3), body->GetAngle());
+ } else if (key == "angle") {
+ body->SetXForm(body->GetPosition(), (float32)luaL_checknumber(L, 3));
+ } else {
return luaL_error(L, "PhysicsBody does not have assignable field: %s.", key.c_str());
}
- body->SetLinearVelocity(checkPhysicsVector(L, 3));
return 0;
}
@@ -494,8 +573,74 @@ static int handleEquals(lua_State *L) {
return 1;
}
+static b2Shape *checkShape(lua_State *L, int index, PhysicsRecord *&record) {
+ uint id;
+ record = PhysicsRecord::checkOwner(L, index, kShapeType, id);
+ b2Shape *shape = record->findShape(id);
+ if (!shape) {
+ luaL_error(L, "The PhysicsShape was destroyed");
+ }
+
+ return shape;
+}
+
+// Nancy22: the corners of a polygon, around the body, and the body of a shape
+static int shapeIndex(lua_State *L) {
+ PhysicsRecord *record;
+ b2Shape *shape = checkShape(L, 1, record);
+ const Common::String key = luaL_checkstring(L, 2);
+
+ if (key == "vertices") {
+ if (shape->GetType() != e_polygonShape) {
+ return luaL_error(L, "Shape is not of the polygon type and has no vertices");
+ }
+
+ const b2PolygonShape *polygon = (const b2PolygonShape *)shape;
+ const b2Vec2 *vertices = polygon->GetVertices();
+ lua_createtable(L, polygon->GetVertexCount(), 0);
+ for (int i = 0; i < polygon->GetVertexCount(); ++i) {
+ pushPhysicsVector(L, vertices[i].x, vertices[i].y);
+ lua_rawseti(L, -2, i + 1);
+ }
+
+ return 1;
+ } else if (key == "body") {
+ record->pushBody(shape->GetBody());
+ return 1;
+ }
+
+ return indexFunctions(L);
+}
+
+// Nancy22: shape.filter = { category, mask, group }, of which the fields left
+// out stay as they were
static int shapeNewIndex(lua_State *L) {
- return luaL_error(L, "PhysicsShape does not have assignable fields");
+ const Common::String key = luaL_checkstring(L, 2);
+ if (key != "filter") {
+ return luaL_error(L, "PhysicsShape does not have assignable fields");
+ }
+
+ PhysicsRecord *record;
+ b2Shape *shape = checkShape(L, 1, record);
+ luaL_checktype(L, 3, LUA_TTABLE);
+
+ b2FilterData filter = shape->GetFilterData();
+ int value;
+ if (readField(L, 3, "category", value)) {
+ filter.categoryBits = (uint16)value;
+ }
+
+ if (readField(L, 3, "mask", value)) {
+ filter.maskBits = (uint16)value;
+ }
+
+ if (readField(L, 3, "group", value)) {
+ filter.groupIndex = (int16)value;
+ }
+
+ // The original changes the filter without looking at the contacts again
+ shape->SetFilterData(filter);
+ return 0;
}
// joint:SetTarget(point)
@@ -520,12 +665,13 @@ void registerPhysicsAPI(lua_State *L) {
{ "__newindex", bodyNewIndex },
{ "__eq", handleEquals },
{ "CreateShape", bodyCreateShape },
+ { "DestroyShape", bodyDestroyShape },
{ "ApplyForce", bodyApplyForce },
{ nullptr, nullptr }
};
static const luaL_Reg kShapeFunctions[] = {
- { "__index", indexFunctions },
+ { "__index", shapeIndex },
{ "__newindex", shapeNewIndex },
{ "__eq", handleEquals },
{ nullptr, nullptr }
diff --git a/engines/nancy/script/physics.h b/engines/nancy/script/physics.h
index a332bb62535..99a1ba40aa3 100644
--- a/engines/nancy/script/physics.h
+++ b/engines/nancy/script/physics.h
@@ -39,11 +39,13 @@ namespace Script {
class PhysicsRecord;
-// Hands the shapes that begin to touch to the record, while the world steps
+// Hands the shapes that begin to touch to the record, while the world steps,
+// and the push they got
class PhysicsContactListener : public b2ContactListener {
public:
PhysicsContactListener(PhysicsRecord *record) : _record(record) {}
void Add(const b2ContactPoint *point) override;
+ void Result(const b2ContactResult *point) override;
private:
PhysicsRecord *_record;
@@ -70,7 +72,9 @@ private:
// OnContact is called with the two shapes whenever they begin to touch.
//
// The world is Box2D 2.0.1, which the original has built in, too. Each frame
-// takes one step of the world, as long as the frame took.
+// takes one step of the world, as long as the frame took. Nancy22 steps the
+// world sixty times a second instead, unless the table says otherwise, and calls
+// OnStep after every step. OnContactResolved tells how hard two shapes pushed.
class PhysicsRecord : public Record {
public:
PhysicsRecord(SceneContext &context);
@@ -89,6 +93,7 @@ public:
// Null when it was destroyed
b2Body *findBody(uint id) const;
+ b2Shape *findShape(uint id) const;
b2MouseJoint *findJoint(uint id) const;
// Pushes the objects that stand for these
@@ -100,6 +105,7 @@ public:
static PhysicsRecord *checkOwner(lua_State *L, int index, const char *typeName, uint &id);
void onContact(b2Shape *a, b2Shape *b, double x, double y);
+ void onContactResolved(b2Shape *a, b2Shape *b, double x, double y, double impulse);
protected:
void readTable(int tableIndex) override;
@@ -114,6 +120,11 @@ private:
float _timeStep = 1.0f / 60.0f; // what the mouse joints soften their pull by
int _numIterations = 10;
+ // Nancy22: the steps the world takes a second, and how far it got
+ double _stepsPerSecond = 60.0;
+ double _stepClock = 0.0;
+ int _numSteps = 0;
+
uint _nextID = 1;
Common::HashMap<uint, b2Body *> _bodies;
Common::HashMap<uint, b2Shape *> _shapes;
Commit: 9a190e87df91399b3e0cbe0a7e0957361790d105
https://github.com/scummvm/scummvm/commit/9a190e87df91399b3e0cbe0a7e0957361790d105
Author: Filippos Karapetis (bluegr at gmail.com)
Date: 2026-10-31T10:43:05+02:00
Commit Message:
NANCY: NANCY20: Add the Path object
A path is a list of places with times, and path:GetPosition gives
where it is at a given time, moving in a straight line between the
places. Path exists from Nancy20 on, but only the scripts of Nancy22
use it, for the car of the driving game that replays a recorded
drive.
Changed paths:
engines/nancy/script/mathtypes.cpp
diff --git a/engines/nancy/script/mathtypes.cpp b/engines/nancy/script/mathtypes.cpp
index 4551b10c319..3f439bc707c 100644
--- a/engines/nancy/script/mathtypes.cpp
+++ b/engines/nancy/script/mathtypes.cpp
@@ -885,6 +885,116 @@ static const luaL_Reg kQuaternionHelperFunctions[] = {
{ nullptr, nullptr }
};
+// Path, Nancy20: places to be at certain times. Only the scripts of Nancy22 use
+// it, for the car of the driving game that plays back a recorded drive.
+// Path:New{ { x, y, time }, ... } takes them in the order of their times.
+// TODO: The curves through the places that path:GetPosition(time, false) gives,
+// and AddPoint, RemovePoint, GetGuides and SetGuides, which no script uses
+static const char *const kPathType = "ND.Path";
+static const char *const kPathHelperType = "ND.PathHelper";
+
+struct PathPoint {
+ double x;
+ double y;
+ double time;
+};
+
+// The points follow the count in the object
+struct PathHeader {
+ uint32 numPoints;
+ uint32 padding;
+};
+
+static const PathPoint *checkPath(lua_State *L, int index, uint32 &numPoints) {
+ const PathHeader *header = (const PathHeader *)checkUserData(L, index, kPathType);
+ numPoints = header->numPoints;
+ return (const PathPoint *)(header + 1);
+}
+
+static int pathNew(lua_State *L) {
+ luaL_checktype(L, 2, LUA_TTABLE);
+ const uint32 numPoints = (uint32)lua_objlen(L, 2);
+
+ PathHeader *header = (PathHeader *)pushUserData(L, sizeof(PathHeader) + numPoints * sizeof(PathPoint), kPathType);
+ header->numPoints = numPoints;
+ header->padding = 0;
+
+ PathPoint *points = (PathPoint *)(header + 1);
+ for (uint32 i = 0; i < numPoints; ++i) {
+ lua_rawgeti(L, 2, i + 1);
+ lua_getfield(L, -1, "x");
+ lua_getfield(L, -2, "y");
+ lua_getfield(L, -3, "time");
+ points[i].x = luaL_checknumber(L, -3);
+ points[i].y = luaL_checknumber(L, -2);
+ points[i].time = luaL_checknumber(L, -1);
+ lua_pop(L, 4);
+ }
+
+ return 1;
+}
+
+// path:GetPosition(time[, straight[, loops]]): where the path is at a time, in a
+// straight line between the places around it. A path that loops starts over
+// after its last place; one that doesn't stays at its ends.
+static int pathGetPosition(lua_State *L) {
+ uint32 numPoints;
+ const PathPoint *points = checkPath(L, 1, numPoints);
+ double time = luaL_checknumber(L, 2);
+ const bool loops = lua_isboolean(L, 4) && lua_toboolean(L, 4);
+
+ if (numPoints == 0) {
+ return luaL_error(L, "Path is empty");
+ }
+
+ ScriptVector position;
+ position.size = 2;
+
+ const double lastTime = points[numPoints - 1].time;
+ const PathPoint *at = nullptr;
+ if (numPoints == 1) {
+ at = &points[0];
+ } else if ((time > lastTime || time < 0.0) && (!loops || lastTime == 0.0)) {
+ at = time > lastTime ? &points[numPoints - 1] : &points[0];
+ } else if (time > lastTime || time < 0.0) {
+ time -= floor(time / lastTime) * lastTime;
+ }
+
+ if (at) {
+ position.v[0] = at->x;
+ position.v[1] = at->y;
+ pushVector(L, position);
+ return 1;
+ }
+
+ uint32 next = 1;
+ while (next + 1 < numPoints && time > points[next].time) {
+ ++next;
+ }
+
+ const PathPoint &from = points[next - 1];
+ const PathPoint &to = points[next];
+ const double span = to.time - from.time;
+ const double progress = span != 0.0 ? (time - from.time) / span : 0.0;
+
+ position.v[0] = from.x + (to.x - from.x) * progress;
+ position.v[1] = from.y + (to.y - from.y) * progress;
+ pushVector(L, position);
+ return 1;
+}
+
+static const luaL_Reg kPathFunctions[] = {
+ { "__index", indexFunctions },
+ { "GetPosition", pathGetPosition },
+ { nullptr, nullptr }
+};
+
+static const luaL_Reg kPathHelperFunctions[] = {
+ { "__index", indexFunctions },
+ { "New", pathNew },
+ { nullptr, nullptr }
+};
+
// rect:Transform(matrix)
static int rectTransform(lua_State *L) {
pushRect(L, transformRect(checkRect(L, 1), checkMatrix(L, 2)));
@@ -901,6 +1011,9 @@ void registerMathTypes(lua_State *L) {
registerType(L, kQuaternionType, kQuaternionFunctions);
registerGlobal(L, "Quaternion", kQuaternionHelperType, kQuaternionHelperFunctions);
+ registerType(L, kPathType, kPathFunctions);
+ registerGlobal(L, "Path", kPathHelperType, kPathHelperFunctions);
+
// Rectangles can be moved by a matrix as well
luaL_getmetatable(L, "ND.Rect");
lua_pushcfunction(L, rectTransform);
Commit: 0a5fc93c433d9ca2cd0d8461388e46a036d3e312
https://github.com/scummvm/scummvm/commit/0a5fc93c433d9ca2cd0d8461388e46a036d3e312
Author: Filippos Karapetis (bluegr at gmail.com)
Date: 2026-10-31T10:43:07+02:00
Commit Message:
NANCY: NANCY22: Transform rectangles and vectors like Nancy22 does
In Nancy22, rect:Transform returns two vectors, the smallest and the
largest of the transformed corners, instead of a rectangle.
vector:Transform also accepts 2D vectors, and always returns a 3D one.
The driving game of Nancy22 relies on both.
Changed paths:
engines/nancy/script/mathtypes.cpp
diff --git a/engines/nancy/script/mathtypes.cpp b/engines/nancy/script/mathtypes.cpp
index 3f439bc707c..53847e02d07 100644
--- a/engines/nancy/script/mathtypes.cpp
+++ b/engines/nancy/script/mathtypes.cpp
@@ -464,10 +464,22 @@ static int pushTransformedVector(lua_State *L, const ScriptVector &vector, const
return 1;
}
-// vector:Transform(kind, matrix)
+// vector:Transform(kind, matrix). Nancy22 moves any vector by its x, y and z,
+// with no z for a 2D one, and gives a 3D vector back.
static int vectorTransform(lua_State *L) {
const ScriptVector &vector = checkVector(L, 1);
const char *kind = luaL_checkstring(L, 2);
+
+ if (g_nancy->getGameType() >= kGameTypeNancy22) {
+ ScriptVector place = vector;
+ if (place.size < 3) {
+ place.v[2] = 0.0;
+ }
+
+ place.size = 3;
+ return pushTransformedVector(L, place, checkMatrix(L, 3), kind);
+ }
+
return pushTransformedVector(L, vector, checkMatrix(L, 3), kind);
}
@@ -995,10 +1007,41 @@ static const luaL_Reg kPathHelperFunctions[] = {
{ nullptr, nullptr }
};
-// rect:Transform(matrix)
+// rect:Transform(matrix). Nancy22 moves all four corners, and gives the
+// smallest and the largest of them as two vectors.
static int rectTransform(lua_State *L) {
- pushRect(L, transformRect(checkRect(L, 1), checkMatrix(L, 2)));
- return 1;
+ const ScriptRect &rect = checkRect(L, 1);
+ const ScriptMatrix &matrix = checkMatrix(L, 2);
+
+ if (g_nancy->getGameType() < kGameTypeNancy22) {
+ pushRect(L, transformRect(rect, matrix));
+ return 1;
+ }
+
+ const double corners[4][2] = {
+ { (double)rect.left, (double)rect.top }, { (double)rect.right, (double)rect.top },
+ { (double)rect.left, (double)rect.bottom }, { (double)rect.right, (double)rect.bottom }
+ };
+
+ ScriptVector minimum(1e300, 1e300, 1e300);
+ ScriptVector maximum(-1e300, -1e300, -1e300);
+ for (const double *corner : corners) {
+ // D3DXVec3TransformCoord, of a point at no depth
+ double point[4];
+ for (int i = 0; i < 4; ++i) {
+ point[i] = corner[0] * matrix.m[0][i] + corner[1] * matrix.m[1][i] + matrix.m[3][i];
+ }
+
+ for (int i = 0; i < 3; ++i) {
+ const double value = point[3] != 0.0 ? point[i] / point[3] : point[i];
+ minimum.v[i] = MIN(minimum.v[i], value);
+ maximum.v[i] = MAX(maximum.v[i], value);
+ }
+ }
+
+ pushVector(L, minimum);
+ pushVector(L, maximum);
+ return 2;
}
void registerMathTypes(lua_State *L) {
Commit: a62e023d1425c2d92f626d9bae6ea91f239490a4
https://github.com/scummvm/scummvm/commit/a62e023d1425c2d92f626d9bae6ea91f239490a4
Author: Filippos Karapetis (bluegr at gmail.com)
Date: 2026-10-31T10:43:09+02:00
Commit Message:
NANCY: NANCY22: Add the rain, hail and dust particles
Particle records get the position and planeCollision stages, and
turbulence can leave out some of the axes. A Particle record without a
perspective now places its particles in the pixels of the viewport,
instead of projecting them. The snow of Nancy21 sets a perspective, so
it is drawn as before.
Changed paths:
engines/nancy/script/particles.cpp
engines/nancy/script/particles.h
diff --git a/engines/nancy/script/particles.cpp b/engines/nancy/script/particles.cpp
index e3a3f0cce6e..136fad0cf43 100644
--- a/engines/nancy/script/particles.cpp
+++ b/engines/nancy/script/particles.cpp
@@ -430,17 +430,23 @@ private:
};
// "turbulence": every step, every particle gets pushed by "factor" along one of
-// the axes, either way, or not at all
+// the axes, either way, or not at all. Nancy22 can leave axes out with "x", "y"
+// or "z" set to false; a push along those does nothing.
class ParticleTurbulenceStage : public ParticleStage {
public:
ParticleTurbulenceStage(ParticleRecord &record, lua_State *L, int tableIndex) : ParticleStage(record) {
readField(L, tableIndex, "factor", _factor);
+
+ static const char *const kAxisNames[3] = { "x", "y", "z" };
+ for (int i = 0; i < 3; ++i) {
+ readField(L, tableIndex, kAxisNames[i], _isOnAxis[i]);
+ }
}
void update(uint first, uint count) override {
for (uint i = first; i < first + count; ++i) {
const uint push = g_nancy->_randomSource->getRandomNumber(7);
- if (push < 6) {
+ if (push < 6 && _isOnAxis[push / 2]) {
_record.getParticle(i).acceleration[push / 2] += (push & 1) ? -_factor : _factor;
}
}
@@ -448,9 +454,97 @@ public:
private:
double _factor = 0.95;
+ bool _isOnAxis[3] = { true, true, true };
};
-// TODO: The "position" and "script" stages, which no script uses
+// "position", Nancy22: a place anywhere between "min" and "max"
+class ParticlePositionStage : public ParticleStage {
+public:
+ ParticlePositionStage(ParticleRecord &record, lua_State *L, int tableIndex) : ParticleStage(record) {
+ readPicked(L, tableIndex);
+ readVectorField(L, tableIndex, "min", _min, 3);
+ readVectorField(L, tableIndex, "max", _max, 3);
+ }
+
+protected:
+ void initParticles(uint first, uint count) override {
+ for (uint i = first; i < first + count; ++i) {
+ Particle &particle = _record.getParticle(i);
+ for (int j = 0; j < 3; ++j) {
+ particle.position[j] = lerp(_min[j], _max[j], randomFraction());
+ }
+ }
+ }
+
+private:
+ double _min[3] = { 0.0, 0.0, 0.0 };
+ double _max[3] = { 0.0, 0.0, 0.0 };
+};
+
+// "planeCollision", Nancy22: the particles bounce off a plane through "position"
+// that faces along "normal". They keep "elasticity" of their speed towards the
+// plane, and lose "friction" of the speed along it.
+class ParticlePlaneCollisionStage : public ParticleStage {
+public:
+ ParticlePlaneCollisionStage(ParticleRecord &record, lua_State *L, int tableIndex) : ParticleStage(record) {
+ readVectorField(L, tableIndex, "position", _position, 3);
+
+ if (readVectorField(L, tableIndex, "normal", _normal, 3)) {
+ const double length = sqrt(_normal[0] * _normal[0] + _normal[1] * _normal[1] + _normal[2] * _normal[2]);
+ if (length > 0.0) {
+ for (int i = 0; i < 3; ++i) {
+ _normal[i] /= length;
+ }
+ }
+ }
+
+ double elasticity = 0.5;
+ readField(L, tableIndex, "elasticity", elasticity);
+ _bounce = 1.0 + CLIP(elasticity, 0.0, 1.0);
+
+ if (readField(L, tableIndex, "friction", _friction)) {
+ _friction = CLIP(_friction, 0.0, 1.0);
+ }
+ }
+
+ void update(uint first, uint count) override {
+ for (uint i = first; i < first + count; ++i) {
+ Particle &particle = _record.getParticle(i);
+
+ const double depth = dot(particle.position, _normal, _position);
+ if (depth >= 0.0) {
+ continue;
+ }
+
+ // Back onto the plane, and off it again
+ const double speed = dot(particle.velocity, _normal, nullptr);
+ for (int j = 0; j < 3; ++j) {
+ particle.position[j] -= _normal[j] * depth;
+
+ const double along = particle.velocity[j] - _normal[j] * speed;
+ particle.velocity[j] -= along * _friction + _normal[j] * speed * _bounce;
+ }
+ }
+ }
+
+private:
+ // Of a vector, or of a place measured from another
+ double dot(const double *vector, const double *normal, const double *origin) const {
+ double result = 0.0;
+ for (int i = 0; i < 3; ++i) {
+ result += (vector[i] - (origin ? origin[i] : 0.0)) * normal[i];
+ }
+
+ return result;
+ }
+
+ double _position[3] = { 0.0, 0.0, 0.0 };
+ double _normal[3] = { 0.0, 1.0, 0.0 };
+ double _bounce = 1.5;
+ double _friction = 0.0;
+};
+
+// TODO: The "script" and "revolve" stages, which no script uses
static ParticleStage *makeStage(ParticleRecord &record, lua_State *L, int tableIndex) {
Common::String name;
if (!readField(L, tableIndex, "name", name)) {
@@ -459,6 +553,10 @@ static ParticleStage *makeStage(ParticleRecord &record, lua_State *L, int tableI
if (name == "positionPerspective") {
return new ParticlePerspectivePositionStage(record, L, tableIndex);
+ } else if (name == "position") {
+ return new ParticlePositionStage(record, L, tableIndex);
+ } else if (name == "planeCollision") {
+ return new ParticlePlaneCollisionStage(record, L, tableIndex);
} else if (name == "velocity") {
return new ParticleVelocityStage(record, L, tableIndex);
} else if (name == "angle") {
@@ -513,6 +611,7 @@ void ParticleRecord::readTable(int tableIndex) {
if (pushField(L, tableIndex, "perspective")) {
_perspective = checkMatrix(L, -1);
+ _hasPerspective = true;
lua_pop(L, 1);
}
@@ -718,13 +817,20 @@ void ParticleRecord::updateGraphics() {
}
// Where a corner of a particle ends up in the viewport. Returns false when it is
-// behind the camera.
-static bool projectCorner(double x, double y, const ScriptMatrix &matrix, int width, int height, double &outX, double &outY) {
+// behind the camera. Without a projection, the particles are placed in the
+// pixels of the viewport.
+static bool projectCorner(double x, double y, const ScriptMatrix &matrix, bool isProjected, int width, int height, double &outX, double &outY) {
double point[4];
for (int i = 0; i < 4; ++i) {
point[i] = x * matrix.m[0][i] + y * matrix.m[1][i] + matrix.m[3][i];
}
+ if (!isProjected) {
+ outX = point[0];
+ outY = point[1];
+ return true;
+ }
+
if (point[3] <= 0.0) {
return false;
}
@@ -760,9 +866,9 @@ void ParticleRecord::drawParticle(const Particle &particle, const ScriptMatrix &
// The top left, top right and bottom left corners
double x0, y0, x1, y1, x2, y2;
- if (!projectCorner(-0.5, 0.5, matrix, target.w, target.h, x0, y0) ||
- !projectCorner(0.5, 0.5, matrix, target.w, target.h, x1, y1) ||
- !projectCorner(-0.5, -0.5, matrix, target.w, target.h, x2, y2)) {
+ if (!projectCorner(-0.5, 0.5, matrix, _hasPerspective, target.w, target.h, x0, y0) ||
+ !projectCorner(0.5, 0.5, matrix, _hasPerspective, target.w, target.h, x1, y1) ||
+ !projectCorner(-0.5, -0.5, matrix, _hasPerspective, target.w, target.h, x2, y2)) {
return;
}
diff --git a/engines/nancy/script/particles.h b/engines/nancy/script/particles.h
index dfd7d5b935b..7546cd99d6e 100644
--- a/engines/nancy/script/particles.h
+++ b/engines/nancy/script/particles.h
@@ -53,8 +53,9 @@ struct Particle {
uint32 color = 0; // 0xAARRGGBB
};
-// Nancy21's falling snow. A Particle record keeps making particles out of parts
-// of an image, which it moves along and draws until their life is over:
+// Nancy21's falling snow, and Nancy22's rain, hail and dust. A Particle record
+// keeps making particles out of parts of an image, which it moves along and
+// draws until their life is over:
//
// AR:Particle({ ovl = "Flakes_OVL", frequency = 50, life = 6, perspective = ...,
// stages = { { name = "velocity", minSpeed = 300, ... }, ... } })
@@ -111,6 +112,7 @@ private:
double _frequency = 0.0; // particles a second
double _life = 0.0; // seconds
ScriptMatrix _perspective;
+ bool _hasPerspective = false; // Nancy22 has particles without one
double _stepTime = 0.0;
int _numSteps = 0;
Commit: 33b2cc7f84719db3aebe48570a6f28b084cde86b
https://github.com/scummvm/scummvm/commit/33b2cc7f84719db3aebe48570a6f28b084cde86b
Author: Filippos Karapetis (bluegr at gmail.com)
Date: 2026-10-31T10:43:11+02:00
Commit Message:
NANCY: NANCY22: Change to unstable - the game now starts
Changed paths:
engines/nancy/detection_tables.h
diff --git a/engines/nancy/detection_tables.h b/engines/nancy/detection_tables.h
index cb5f899bbd7..5e5988b17ba 100644
--- a/engines/nancy/detection_tables.h
+++ b/engines/nancy/detection_tables.h
@@ -1075,7 +1075,7 @@ static const NancyGameDescription gameDescriptions[] = {
AD_ENTRY1s("ciftree.dat", "2aa05fbc4f06f71ed98d092b60043c0e", 109670993),
Common::EN_ANY,
Common::kPlatformWindows,
- ADGF_UNSUPPORTED | ADGF_DROPPLATFORM,
+ ADGF_UNSTABLE | ADGF_DROPPLATFORM,
NANCY8_GUIOPTIONS
},
kGameTypeNancy22
Commit: ef2e13d6c3741e0aa2cd1971da10b684f9643e51
https://github.com/scummvm/scummvm/commit/ef2e13d6c3741e0aa2cd1971da10b684f9643e51
Author: Filippos Karapetis (bluegr at gmail.com)
Date: 2026-10-31T10:43:14+02:00
Commit Message:
NANCY: Share the XSheet reader between both conversation systems
The conversations of the action records and those of the Nancy19+
scripts each read XSheet files with code of their own. Both now use
one reader. Nothing changes in the games.
Changed paths:
A engines/nancy/xsheetfile.cpp
A engines/nancy/xsheetfile.h
engines/nancy/action/conversation.cpp
engines/nancy/module.mk
engines/nancy/script/xsheet.cpp
diff --git a/engines/nancy/action/conversation.cpp b/engines/nancy/action/conversation.cpp
index 1ceb487502b..d62751a10ef 100644
--- a/engines/nancy/action/conversation.cpp
+++ b/engines/nancy/action/conversation.cpp
@@ -31,6 +31,7 @@
#include "engines/nancy/graphics.h"
#include "engines/nancy/resource.h"
#include "engines/nancy/iff.h"
+#include "engines/nancy/xsheetfile.h"
#include "engines/nancy/action/conversation.h"
#include "engines/nancy/action/actionmanager.h"
@@ -1280,96 +1281,25 @@ void ConversationCel::readCelDataNancy13(Common::SeekableReadStream &stream) {
}
void ConversationCel::readXSheet(Common::SeekableReadStream &stream, const Common::String &xsheetName) {
- Common::SeekableReadStream *xsheet = SearchMan.createReadStreamForMember(Common::Path(xsheetName));
- const bool isNancy13 = g_nancy->getGameType() >= kGameTypeNancy13;
- const uint kNameSize = 33;
- const uint kFrameRecordSize = 140;
-
- // Read the xsheet and load all images into the arrays
- // Completely unoptimized, the original engine uses a buffer
- xsheet->seek(0);
- const uint16 sigLength = g_nancy->getGameType() <= kGameTypeNancy11 ? 18 : 22;
- Common::String signature = xsheet->readString('\0', sigLength);
- if (signature != "XSHEET WayneSikes" && signature != "XSHEET HerInteractive") {
- warning("XSHEET signature doesn't match!");
+ XSheetFile xsheet;
+ if (!xsheet.load(xsheetName)) {
return;
}
- xsheet->seek(0x22);
- const uint16 numFrames = xsheet->readUint16LE();
- uint16 numTrees = 4;
-
- if (isNancy13) {
- // Nancy13 moved the cel tree / .cal names into the XSheet header, which
- // reserves a fixed kMaxTrees name slots followed by a 32-bit frame time;
- // the frame data begins right after. Each frame is likewise a fixed-size
- // block of kMaxTrees name slots. Earlier games keep the tree names in the
- // AR data and use a 16-bit frame time.
- const uint kMaxTrees = 4;
-
- numTrees = xsheet->readUint16LE();
-
- _treeNames.resize(numTrees);
- for (uint j = 0; j < numTrees; ++j) {
- readFilename(*xsheet, _treeNames[j]);
- }
-
- // Skip any unused tree-name slots so the frame time is read from its fixed
- // offset regardless of numTrees.
- xsheet->skip((kMaxTrees - numTrees) * kNameSize);
-
- // Nancy15 inserted a destination rect per tree slot ahead of the frame time.
- // It is only filled in for trees that name a movie instead of a cel archive.
- if (g_nancy->getGameType() >= kGameTypeNancy15) {
- readRectArray(*xsheet, _treeRects, kMaxTrees);
- }
-
- // Nancy17 leaves the right and bottom edge out of the rect
- if (g_nancy->getGameType() >= kGameTypeNancy17) {
- for (Common::Rect &rect : _treeRects) {
- if (!rect.isEmpty()) {
- --rect.right;
- --rect.bottom;
- }
- }
- }
-
- _frameTime = xsheet->readUint32LE();
- } else {
- xsheet->skip(2);
- _frameTime = xsheet->readUint16LE();
- xsheet->skip(2);
+ // Earlier games name the trees in the record
+ if (g_nancy->getGameType() >= kGameTypeNancy13) {
+ _treeNames = xsheet.treeNames;
}
- _celNames.resize(numTrees, Common::Array<Common::Path>(numFrames));
-
- if (g_nancy->getGameType() >= kGameTypeNancy16) {
- // The frame records name a movie frame per tree slot instead of a cel
- const uint kMaxTrees = 4;
-
- _treeMovieFrames.resize(numTrees, Common::Array<int32>(numFrames));
- for (uint i = 0; i < numFrames; ++i) {
- for (uint j = 0; j < kMaxTrees; ++j) {
- const int32 movieFrame = xsheet->readSint32LE();
- if (j < numTrees) {
- _treeMovieFrames[j][i] = movieFrame;
- }
- }
- xsheet->skip(8);
- }
-
- delete xsheet;
- return;
- }
+ _treeRects = xsheet.treeRects;
+ _frameTime = xsheet.frameTiming;
+ _celNames = xsheet.celNames;
+ _treeMovieFrames = xsheet.movieFrames;
- for (uint i = 0; i < numFrames; ++i) {
- for (uint j = 0; j < numTrees; ++j) {
- readFilename(*xsheet, _celNames[j][i]);
- }
- xsheet->skip(kFrameRecordSize - numTrees * kNameSize);
+ // The frames are counted by the cels, which Nancy16 and up have no names for
+ if (_celNames.empty()) {
+ _celNames.resize(_treeMovieFrames.size(), Common::Array<Common::Path>(xsheet.numFrames));
}
-
- delete xsheet;
}
bool ConversationCel::isVideoDonePlaying() {
diff --git a/engines/nancy/module.mk b/engines/nancy/module.mk
index 3d5cd2edaf6..87db4b48141 100644
--- a/engines/nancy/module.mk
+++ b/engines/nancy/module.mk
@@ -180,7 +180,8 @@ MODULE_OBJS = \
sound.o \
sound_vorbis.o \
util.o \
- video.o
+ video.o \
+ xsheetfile.o
# Nancy19 and newer, whose scenes are Lua scripts
ifdef ENABLE_NANCY_V4
diff --git a/engines/nancy/script/xsheet.cpp b/engines/nancy/script/xsheet.cpp
index c61c967bc91..9a9d62f49c4 100644
--- a/engines/nancy/script/xsheet.cpp
+++ b/engines/nancy/script/xsheet.cpp
@@ -19,13 +19,10 @@
*
*/
-#include "common/archive.h"
-#include "common/stream.h"
#include "common/textconsole.h"
#include "engines/nancy/graphics.h"
-#include "engines/nancy/nancy.h"
-#include "engines/nancy/util.h"
+#include "engines/nancy/xsheetfile.h"
#include "engines/nancy/script/api.h"
#include "engines/nancy/script/luabind.h"
@@ -34,72 +31,31 @@
namespace Nancy {
namespace Script {
-// The parts of an XSheet
-static const uint kXSheetFrameCountOffset = 0x22;
-static const uint kXSheetMaxTrees = 4;
-
bool XSheet::load(const Common::String &name) {
clear();
- Common::SeekableReadStream *xsheet = SearchMan.createReadStreamForMember(Common::Path(name));
- if (!xsheet) {
- warning("Could not open XSheet file %s", name.c_str());
+ XSheetFile xsheet;
+ if (!xsheet.load(name)) {
return false;
}
- xsheet->seek(kXSheetFrameCountOffset);
- _numFrames = xsheet->readUint16LE();
- const uint numTrees = MIN<uint>(xsheet->readUint16LE(), kXSheetMaxTrees);
-
- Common::Array<Common::String> treeNames(kXSheetMaxTrees);
- for (Common::String &treeName : treeNames) {
- readFilename(*xsheet, treeName);
- }
-
- // Nancy20 lines the rectangles up on four bytes
- if (g_nancy->getGameType() >= kGameTypeNancy20) {
- xsheet->skip(2);
- }
-
- // Where each part goes in the viewport; the right and bottom edge are left out
- Common::Array<Common::Rect> treeRects;
- readRectArray(*xsheet, treeRects, kXSheetMaxTrees);
+ _numFrames = xsheet.numFrames;
+ _framesPerSecond = xsheet.frameTiming;
- _framesPerSecond = xsheet->readUint32LE();
-
- for (uint i = 0; i < numTrees; ++i) {
+ for (uint i = 0; i < xsheet.movieFrames.size(); ++i) {
Tree *tree = new Tree();
- tree->frames.resize(_numFrames);
+ tree->frames = xsheet.movieFrames[i];
_trees.push_back(tree);
}
- // Every frame has a movie frame for each of the parts there can be
- for (uint frame = 0; frame < _numFrames; ++frame) {
- for (uint i = 0; i < kXSheetMaxTrees; ++i) {
- const int32 movieFrame = xsheet->readSint32LE();
- if (i < numTrees) {
- _trees[i]->frames[frame] = movieFrame;
- }
- }
-
- xsheet->skip(8);
- }
-
- delete xsheet;
-
_name = name;
_frame = 0;
- for (uint i = 0; i < numTrees; ++i) {
+ for (uint i = 0; i < _trees.size(); ++i) {
Tree &tree = *_trees[i];
- Common::Rect dest = treeRects[i];
- if (!dest.isEmpty()) {
- --dest.right;
- --dest.bottom;
- }
-
- if (dest.isEmpty() || !tree.player.loadFile(Common::Path(treeNames[i]))) {
- warning("Could not load conversation movie %s of XSheet %s", treeNames[i].c_str(), name.c_str());
+ const Common::Rect &dest = xsheet.treeRects[i];
+ if (dest.isEmpty() || !tree.player.loadFile(Common::Path(xsheet.treeNames[i]))) {
+ warning("Could not load conversation movie %s of XSheet %s", xsheet.treeNames[i].c_str(), name.c_str());
clear();
return false;
}
diff --git a/engines/nancy/xsheetfile.cpp b/engines/nancy/xsheetfile.cpp
new file mode 100644
index 00000000000..be6c01fbce3
--- /dev/null
+++ b/engines/nancy/xsheetfile.cpp
@@ -0,0 +1,121 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+#include "common/archive.h"
+#include "common/stream.h"
+#include "common/textconsole.h"
+
+#include "engines/nancy/nancy.h"
+#include "engines/nancy/util.h"
+#include "engines/nancy/xsheetfile.h"
+
+namespace Nancy {
+
+static const uint kXSheetFrameCountOffset = 0x22;
+static const uint kXSheetNameSize = 33;
+static const uint kXSheetCelRecordSize = 140;
+
+bool XSheetFile::load(const Common::String &name) {
+ Common::SeekableReadStream *xsheet = SearchMan.createReadStreamForMember(Common::Path(name));
+ if (!xsheet) {
+ warning("Could not open XSheet file %s", name.c_str());
+ return false;
+ }
+
+ const uint16 signatureLength = g_nancy->getGameType() <= kGameTypeNancy11 ? 18 : 22;
+ const Common::String signature = xsheet->readString('\0', signatureLength);
+ if (signature != "XSHEET WayneSikes" && signature != "XSHEET HerInteractive") {
+ warning("XSheet %s has an unknown signature", name.c_str());
+ delete xsheet;
+ return false;
+ }
+
+ xsheet->seek(kXSheetFrameCountOffset);
+ numFrames = xsheet->readUint16LE();
+ uint numTrees = kMaxTrees;
+
+ if (g_nancy->getGameType() >= kGameTypeNancy13) {
+ // Nancy13 moved the names of the trees into the XSheet, in slots for
+ // as many trees as there can be
+ numTrees = MIN<uint>(xsheet->readUint16LE(), kMaxTrees);
+
+ treeNames.resize(numTrees);
+ for (Common::String &treeName : treeNames) {
+ readFilename(*xsheet, treeName);
+ }
+
+ xsheet->skip((kMaxTrees - numTrees) * kXSheetNameSize);
+
+ if (g_nancy->getGameType() >= kGameTypeNancy15) {
+ // Nancy20 lines the rectangles up on four bytes
+ if (g_nancy->getGameType() >= kGameTypeNancy20) {
+ xsheet->skip(2);
+ }
+
+ readRectArray(*xsheet, treeRects, kMaxTrees);
+
+ // Nancy17 leaves the right and bottom edge out of the rect
+ if (g_nancy->getGameType() >= kGameTypeNancy17) {
+ for (Common::Rect &rect : treeRects) {
+ if (!rect.isEmpty()) {
+ --rect.right;
+ --rect.bottom;
+ }
+ }
+ }
+ }
+
+ frameTiming = xsheet->readUint32LE();
+ } else {
+ xsheet->skip(2);
+ frameTiming = xsheet->readUint16LE();
+ xsheet->skip(2);
+ }
+
+ if (g_nancy->getGameType() >= kGameTypeNancy16) {
+ // Every frame has a movie frame for each of the slots
+ movieFrames.resize(numTrees, Common::Array<int32>(numFrames));
+ for (uint frame = 0; frame < numFrames; ++frame) {
+ for (uint tree = 0; tree < kMaxTrees; ++tree) {
+ const int32 movieFrame = xsheet->readSint32LE();
+ if (tree < numTrees) {
+ movieFrames[tree][frame] = movieFrame;
+ }
+ }
+
+ xsheet->skip(8);
+ }
+ } else {
+ celNames.resize(numTrees, Common::Array<Common::Path>(numFrames));
+ for (uint frame = 0; frame < numFrames; ++frame) {
+ for (uint tree = 0; tree < numTrees; ++tree) {
+ readFilename(*xsheet, celNames[tree][frame]);
+ }
+
+ xsheet->skip(kXSheetCelRecordSize - numTrees * kXSheetNameSize);
+ }
+ }
+
+ delete xsheet;
+ return true;
+}
+
+} // End of namespace Nancy
diff --git a/engines/nancy/xsheetfile.h b/engines/nancy/xsheetfile.h
new file mode 100644
index 00000000000..a4464180ea8
--- /dev/null
+++ b/engines/nancy/xsheetfile.h
@@ -0,0 +1,59 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+#ifndef NANCY_XSHEETFILE_H
+#define NANCY_XSHEETFILE_H
+
+#include "common/array.h"
+#include "common/path.h"
+#include "common/rect.h"
+#include "common/str.h"
+
+namespace Nancy {
+
+// An XSheet puts a character in a conversation together from parts, its trees:
+// cels, or movies from Nancy15 on. For each of its frames, it names the cel or
+// the movie frame that every tree shows.
+struct XSheetFile {
+ static const uint kMaxTrees = 4;
+
+ // Nancy13 and up; earlier games name the trees in their conversations
+ Common::Array<Common::String> treeNames;
+
+ // Nancy15 and up: where the trees that are movies go, one for each slot
+ Common::Array<Common::Rect> treeRects;
+
+ // Milliseconds a frame up to Nancy18, frames a second from Nancy19 on
+ uint32 frameTiming = 0;
+
+ uint numFrames = 0;
+
+ // For each tree, the cel of every frame before Nancy16, and the movie frame
+ // of every frame from Nancy16 on
+ Common::Array<Common::Array<Common::Path>> celNames;
+ Common::Array<Common::Array<int32>> movieFrames;
+
+ bool load(const Common::String &name);
+};
+
+} // End of namespace Nancy
+
+#endif // NANCY_XSHEETFILE_H
Commit: 1b66f042d032c9db164c01aca238b2f3301bfea0
https://github.com/scummvm/scummvm/commit/1b66f042d032c9db164c01aca238b2f3301bfea0
Author: Filippos Karapetis (bluegr at gmail.com)
Date: 2026-10-31T10:43:17+02:00
Commit Message:
NANCY: NANCY20: Add Game.cheatMode and the cheat_mode console command
The scripts of Nancy20 and later ask whether the cheat mode of the
original is on, to show views made for debugging the puzzles: the
physics shapes of the Nancy22 driving game (Q), or the areas a photo
has to cover with the Nancy1New phone camera. The new console command
cheat_mode turns it on and off.
Changed paths:
engines/nancy/console.cpp
engines/nancy/console.h
engines/nancy/script/gameapi.cpp
engines/nancy/state/scene.h
diff --git a/engines/nancy/console.cpp b/engines/nancy/console.cpp
index 5c63dbafb0b..a96c9d5646e 100644
--- a/engines/nancy/console.cpp
+++ b/engines/nancy/console.cpp
@@ -70,6 +70,7 @@ NancyConsole::NancyConsole() : GUI::Debugger() {
registerCmd("list_records", WRAP_METHOD(NancyConsole, Cmd_listRecords));
registerCmd("script_export", WRAP_METHOD(NancyConsole, Cmd_scriptExport));
registerCmd("list_managers", WRAP_METHOD(NancyConsole, Cmd_listManagers));
+ registerCmd("cheat_mode", WRAP_METHOD(NancyConsole, Cmd_cheatMode));
#endif
registerCmd("actionrecord_export", WRAP_METHOD(NancyConsole, Cmd_actionRecordExport));
registerCmd("scan_ar_type", WRAP_METHOD(NancyConsole, Cmd_scanForActionRecordType));
@@ -801,6 +802,27 @@ bool NancyConsole::Cmd_listRecords(int argc, const char **argv) {
return true;
}
+// Nancy20: the cheat mode of the original, which the scripts ask for with
+// Game.cheatMode. It turns on views made for debugging the puzzles, like the
+// physics shapes of the Nancy22 driving game (Q).
+bool NancyConsole::Cmd_cheatMode(int argc, const char **argv) {
+ bool isOn = !NancySceneState.isCheatMode();
+ if (argc == 2 && !scumm_stricmp(argv[1], "on")) {
+ isOn = true;
+ } else if (argc == 2 && !scumm_stricmp(argv[1], "off")) {
+ isOn = false;
+ } else if (argc != 1) {
+ debugPrintf("Turns the cheat mode of the scripts of Nancy20 and later on or off.\n");
+ debugPrintf("Usage: %s [on|off]\n", argv[0]);
+ debugPrintf("Without an argument, toggles it.\n");
+ return true;
+ }
+
+ NancySceneState.setCheatMode(isOn);
+ debugPrintf("Cheat mode is %s\n", isOn ? "on" : "off");
+ return true;
+}
+
// Nancy22: the managers the scripts registered with Log:AddManager, or what one
// of them gives about itself. The original shows these in its cheat dialog.
bool NancyConsole::Cmd_listManagers(int argc, const char **argv) {
diff --git a/engines/nancy/console.h b/engines/nancy/console.h
index f18ff04c16d..066926c575e 100644
--- a/engines/nancy/console.h
+++ b/engines/nancy/console.h
@@ -60,6 +60,7 @@ private:
bool Cmd_listRecords(int argc, const char **argv);
bool Cmd_scriptExport(int argc, const char **argv);
bool Cmd_listManagers(int argc, const char **argv);
+ bool Cmd_cheatMode(int argc, const char **argv);
#endif
bool Cmd_actionRecordExport(int argc, const char **argv);
bool Cmd_scanForActionRecordType(int argc, const char **argv);
diff --git a/engines/nancy/script/gameapi.cpp b/engines/nancy/script/gameapi.cpp
index a71487f0b16..ebe20a933be 100644
--- a/engines/nancy/script/gameapi.cpp
+++ b/engines/nancy/script/gameapi.cpp
@@ -437,6 +437,13 @@ static int gameIndex(lua_State *L) {
return 1;
}
+ // Nancy20: whether the cheat mode of the original is on, which scripts use
+ // for views made for debugging. The console command cheat_mode sets it.
+ if (key == "cheatMode") {
+ lua_pushboolean(L, NancySceneState.isCheatMode());
+ return 1;
+ }
+
lua_pushnil(L);
return 1;
}
diff --git a/engines/nancy/state/scene.h b/engines/nancy/state/scene.h
index 607d2c8b29b..366324c3fb8 100644
--- a/engines/nancy/state/scene.h
+++ b/engines/nancy/state/scene.h
@@ -136,6 +136,11 @@ public:
void setLoadName(const Common::String &name) { _loadName = name; }
const Common::String &getLoadName() const { return _loadName; }
+ // Nancy20: the cheat mode of the original, which the scripts use for views
+ // made for debugging the puzzles. Only the console turns it on.
+ void setCheatMode(bool isOn) { _isCheatMode = isOn; }
+ bool isCheatMode() const { return _isCheatMode; }
+
// Nancy16: lists of movies left under the name of the movie or puzzle that plays
// them, e.g. the commands given to the wolf. Taking a list forgets it; returns false
// when there is none.
@@ -564,6 +569,7 @@ private:
bool _isLoadingSecondChance = false;
Common::String _loadName;
+ bool _isCheatMode = false;
Common::HashMap<Common::String, Common::Array<Common::String>, Common::IgnoreCase_Hash, Common::IgnoreCase_EqualTo> _moviePlaylists;
Commit: 07fcfe278bd365810f02db048a29109823c72e88
https://github.com/scummvm/scummvm/commit/07fcfe278bd365810f02db048a29109823c72e88
Author: Filippos Karapetis (bluegr at gmail.com)
Date: 2026-10-31T10:43:19+02:00
Commit Message:
NANCY: NANCY16: Type into the edit box that was clicked
A panel with several edit boxes now sends what gets typed to the one
that was clicked last, and only that one shows the caret. Until then
the first box gets the keyboard, as before.
Changed paths:
engines/nancy/ui/ndui/editbox.cpp
engines/nancy/ui/ndui/panel.cpp
engines/nancy/ui/ndui/panel.h
diff --git a/engines/nancy/ui/ndui/editbox.cpp b/engines/nancy/ui/ndui/editbox.cpp
index 4424b3e44ef..b3569780bde 100644
--- a/engines/nancy/ui/ndui/editbox.cpp
+++ b/engines/nancy/ui/ndui/editbox.cpp
@@ -234,7 +234,7 @@ void EditBox::draw(Graphics::ManagedSurface &surface, const Common::Point &offse
argbToColor(area.format, _selectedTextColor | 0xFF000000));
}
- if (_isCaretShown) {
+ if (_isCaretShown && _panel->getKeyboardFocus() == this) {
int caretX = x + getCharX(_caret);
Common::Rect caret(caretX - 1, 0, caretX + 1, area.h);
caret.clip(Common::Rect(area.w, area.h));
@@ -243,6 +243,7 @@ void EditBox::draw(Graphics::ManagedSurface &surface, const Common::Point &offse
}
bool EditBox::onMouseDown(const Common::Point &pos) {
+ _panel->setKeyboardFocus(this);
moveCaret(getCharAt(pos.x), false);
return true;
}
diff --git a/engines/nancy/ui/ndui/panel.cpp b/engines/nancy/ui/ndui/panel.cpp
index c3c6527e27a..b497b24cf6e 100644
--- a/engines/nancy/ui/ndui/panel.cpp
+++ b/engines/nancy/ui/ndui/panel.cpp
@@ -648,6 +648,10 @@ bool Panel::removeControl(const Common::String &name) {
}
}
+ if (_focus == control) {
+ _focus = nullptr;
+ }
+
if (_capture == control) {
_capture = nullptr;
}
@@ -665,6 +669,10 @@ EditBox *Panel::getKeyboardFocus() const {
return nullptr;
}
+ if (_focus && _focus->isVisible() && _focus->isEnabled()) {
+ return _focus;
+ }
+
for (EditBox *editBox : _editBoxes) {
if (editBox->isVisible() && editBox->isEnabled()) {
return editBox;
diff --git a/engines/nancy/ui/ndui/panel.h b/engines/nancy/ui/ndui/panel.h
index 0a6c2226b2c..ba1b9964d89 100644
--- a/engines/nancy/ui/ndui/panel.h
+++ b/engines/nancy/ui/ndui/panel.h
@@ -123,8 +123,10 @@ public:
InvButton *findItemButton(int16 itemID) const;
bool isItemButton(const Common::String &name) const;
- // The edit box that gets typed into, when the panel is up
+ // The edit box that gets typed into, when the panel is up: the one that was
+ // clicked last, or else the first one
EditBox *getKeyboardFocus() const;
+ void setKeyboardFocus(EditBox *editBox) { _focus = editBox; }
// Places the visible controls one after another, when the panel asks for it
void arrangeControls();
@@ -163,6 +165,7 @@ private:
Common::Array<Control *> _arrangeOrder;
Common::Array<RadioButton *> _radioButtons;
Common::Array<EditBox *> _editBoxes;
+ EditBox *_focus = nullptr;
int _nextID = 1;
Arrangement _arrangement = kArrangeNone;
Commit: b323161dfe1e043bc92cb884eb4fd7a288d7fa7f
https://github.com/scummvm/scummvm/commit/b323161dfe1e043bc92cb884eb4fd7a288d7fa7f
Author: Filippos Karapetis (bluegr at gmail.com)
Date: 2026-10-31T10:43:22+02:00
Commit Message:
NANCY: NANCY22: Add the cycleFocus message
The message moves the keyboard of a panel to its next edit box. On
the login screen of the teacher's lounge computer in Nancy1New, Enter
moves from the first of its two boxes to the second this way.
Changed paths:
engines/nancy/script/gameapi.cpp
engines/nancy/ui/ndui/common.h
engines/nancy/ui/ndui/panel.cpp
engines/nancy/ui/ndui/panel.h
diff --git a/engines/nancy/script/gameapi.cpp b/engines/nancy/script/gameapi.cpp
index ebe20a933be..17e7083e12f 100644
--- a/engines/nancy/script/gameapi.cpp
+++ b/engines/nancy/script/gameapi.cpp
@@ -1803,7 +1803,8 @@ static const MessageActionName kMessageActionNames[] = {
{ "toggleCollapsed", UI::NDUI::kActionToggleCollapsed },
{ "getValue", UI::NDUI::kActionQuery },
{ "showItem", UI::NDUI::kActionShowItem },
- { "hideItem", UI::NDUI::kActionHideItem }
+ { "hideItem", UI::NDUI::kActionHideItem },
+ { "cycleFocus", UI::NDUI::kActionCycleFocus }
};
// Message:Send(action, target[, value[, text[, isTextKey]]])
diff --git a/engines/nancy/ui/ndui/common.h b/engines/nancy/ui/ndui/common.h
index 920ae990257..126230b1db7 100644
--- a/engines/nancy/ui/ndui/common.h
+++ b/engines/nancy/ui/ndui/common.h
@@ -120,7 +120,8 @@ enum ActionType {
kActionSetImage = 15, // Nancy21: a texture and a source rect, in one
kActionQuery = 30, // asks the engine to send its value back with kActionSetValue
kActionShowItem = 40, // inventory panels
- kActionHideItem = 41
+ kActionHideItem = 41,
+ kActionCycleFocus = 42 // gives the next edit box of a panel the keyboard
};
struct Action {
diff --git a/engines/nancy/ui/ndui/panel.cpp b/engines/nancy/ui/ndui/panel.cpp
index b497b24cf6e..ef735625867 100644
--- a/engines/nancy/ui/ndui/panel.cpp
+++ b/engines/nancy/ui/ndui/panel.cpp
@@ -508,6 +508,9 @@ bool Panel::takeAction(const Action &action) {
showItem((int16)action.value, action.type == kActionShowItem);
break;
+ case kActionCycleFocus:
+ cycleFocus();
+ break;
default:
return false;
}
@@ -682,6 +685,27 @@ EditBox *Panel::getKeyboardFocus() const {
return nullptr;
}
+// The edit box after the focused one, going around to the first
+void Panel::cycleFocus() {
+ EditBox *current = getKeyboardFocus();
+ if (!current) {
+ return;
+ }
+
+ uint start = 0;
+ while (_editBoxes[start] != current) {
+ ++start;
+ }
+
+ for (uint i = 1; i <= _editBoxes.size(); ++i) {
+ EditBox *editBox = _editBoxes[(start + i) % _editBoxes.size()];
+ if (editBox->isVisible() && editBox->isEnabled()) {
+ _focus = editBox;
+ break;
+ }
+ }
+}
+
bool Panel::isItemButton(const Common::String &name) const {
if (_kind != kObjectInvPanel) {
return false;
diff --git a/engines/nancy/ui/ndui/panel.h b/engines/nancy/ui/ndui/panel.h
index ba1b9964d89..197f552fb0e 100644
--- a/engines/nancy/ui/ndui/panel.h
+++ b/engines/nancy/ui/ndui/panel.h
@@ -124,7 +124,7 @@ public:
bool isItemButton(const Common::String &name) const;
// The edit box that gets typed into, when the panel is up: the one that was
- // clicked last, or else the first one
+ // clicked or cycled to last, or else the first one
EditBox *getKeyboardFocus() const;
void setKeyboardFocus(EditBox *editBox) { _focus = editBox; }
@@ -149,6 +149,7 @@ private:
void redraw();
Control *getControlAt(const Common::Point &pos) const;
void showItem(int16 itemID, bool show);
+ void cycleFocus();
Manager *_manager;
byte _kind;
Commit: 2a321daad02bb7ae2e71a488be4d968d4c255cf8
https://github.com/scummvm/scummvm/commit/2a321daad02bb7ae2e71a488be4d968d4c255cf8
Author: Filippos Karapetis (bluegr at gmail.com)
Date: 2026-10-31T10:43:26+02:00
Commit Message:
NANCY: NANCY1NEW: Add the variable lists and the text variables
Nancy1New lists the number variables of its scripts (VarTable) in a
boot script, e.g. the quarters Nancy carries for the soda machine and
the jukebox of the diner. It also keeps text variables (StrTable) in
a second list, e.g. the song picked on that jukebox. A script that
uses a name missing from the lists gets an error, as in the original.
Saved games keep the values of the text variables, like those of the
number variables.
Changed paths:
engines/nancy/enginedata.h
engines/nancy/nancy.cpp
engines/nancy/puzzledata.cpp
engines/nancy/puzzledata.h
engines/nancy/script/bootapi.cpp
engines/nancy/script/gameapi.cpp
diff --git a/engines/nancy/enginedata.h b/engines/nancy/enginedata.h
index e9019cf724a..8df80eb44d3 100644
--- a/engines/nancy/enginedata.h
+++ b/engines/nancy/enginedata.h
@@ -1166,6 +1166,12 @@ struct ScriptBootData : public EngineData {
Common::Array<FontColor> fontColors;
Common::Array<Player> players; // in the order of PCUI::characters
+
+ // Nancy1New names every value (VarTable) and text (StrTable) the scripts
+ // keep beforehand; using any other name is an error
+ typedef Common::HashMap<Common::String, bool, Common::IgnoreCase_Hash, Common::IgnoreCase_EqualTo> NameSet;
+ NameSet valueNames;
+ NameSet textNames;
};
} // End of namespace Nancy
diff --git a/engines/nancy/nancy.cpp b/engines/nancy/nancy.cpp
index 2c2e04f2573..aa04a2d6de7 100644
--- a/engines/nancy/nancy.cpp
+++ b/engines/nancy/nancy.cpp
@@ -967,6 +967,14 @@ void NancyEngine::bootScriptedGameEngine() {
flagTables.flags = flags;
runRequiredBootScript("Flags", flagTables);
+ // Nancy1New names the values and texts the scripts keep
+ if (getGameType() >= kGameTypeNancy1New) {
+ Script::BootTables tableTables;
+ tableTables.boot = boot;
+ runRequiredBootScript("Vars", tableTables);
+ runRequiredBootScript("Strs", tableTables);
+ }
+
Script::BootTables inventoryTables;
inventoryTables.inventory = inventory;
inventoryTables.boot = boot;
diff --git a/engines/nancy/puzzledata.cpp b/engines/nancy/puzzledata.cpp
index bccb4775c1f..90f16354238 100644
--- a/engines/nancy/puzzledata.cpp
+++ b/engines/nancy/puzzledata.cpp
@@ -1039,6 +1039,26 @@ void ScriptValueData::synchronize(Common::Serializer &ser) {
}
}
+void ScriptTextData::synchronize(Common::Serializer &ser) {
+ uint16 numTexts = texts.size();
+ ser.syncAsUint16LE(numTexts);
+
+ Common::Array<Common::String> names;
+ if (ser.isSaving()) {
+ for (auto &entry : texts) {
+ names.push_back(entry._key);
+ }
+ } else {
+ texts.clear();
+ names.resize(numTexts);
+ }
+
+ for (Common::String &name : names) {
+ ser.syncString(name);
+ ser.syncString(texts[name]);
+ }
+}
+
void ScriptSavedData::synchronize(Common::Serializer &ser) {
uint16 numValues = values.size();
ser.syncAsUint16LE(numValues);
@@ -1134,6 +1154,8 @@ PuzzleData *makePuzzleData(const uint32 tag) {
return new SavedStateData();
case ScriptValueData::getTag():
return new ScriptValueData();
+ case ScriptTextData::getTag():
+ return new ScriptTextData();
case ScriptSavedData::getTag():
return new ScriptSavedData();
case ScriptJournalData::getTag():
diff --git a/engines/nancy/puzzledata.h b/engines/nancy/puzzledata.h
index d65e735e36b..66f91936af2 100644
--- a/engines/nancy/puzzledata.h
+++ b/engines/nancy/puzzledata.h
@@ -726,6 +726,14 @@ struct ScriptValueData : public PuzzleData {
Common::HashMap<Common::String, int32, Common::IgnoreCase_Hash, Common::IgnoreCase_EqualTo> values;
};
+// Nancy1New. The texts the scripts keep by name, next to the values
+struct ScriptTextData : public PuzzleData {
+ static constexpr uint32 getTag() { return MKTAG('S', 'C', 'S', 'T'); }
+ virtual void synchronize(Common::Serializer &ser);
+
+ Common::HashMap<Common::String, Common::String, Common::IgnoreCase_Hash, Common::IgnoreCase_EqualTo> texts;
+};
+
// Nancy19. What the scripts ask to have kept under a name: a number, a text,
// or a table of those, already packed into bytes
struct ScriptSavedData : public PuzzleData {
diff --git a/engines/nancy/script/bootapi.cpp b/engines/nancy/script/bootapi.cpp
index a2a95574a42..8222a329c11 100644
--- a/engines/nancy/script/bootapi.cpp
+++ b/engines/nancy/script/bootapi.cpp
@@ -286,6 +286,29 @@ static int flagsCreate(lua_State *L) {
return 0;
}
+// VarTableInit and StrTableInit, Nancy1New: the names of the values and the
+// texts the scripts keep
+
+static void readNames(lua_State *L, ScriptBootData::NameSet &names) {
+ Common::Array<Common::String> list;
+ readStringList(L, 2, list);
+ for (const Common::String &name : list) {
+ names.setVal(name, true);
+ }
+}
+
+static int varTableCreate(lua_State *L) {
+ checkCreateArguments(L, "ND.VarTableInit", s_tables && s_tables->boot);
+ readNames(L, s_tables->boot->valueNames);
+ return 0;
+}
+
+static int strTableCreate(lua_State *L) {
+ checkCreateArguments(L, "ND.StrTableInit", s_tables && s_tables->boot);
+ readNames(L, s_tables->boot->textNames);
+ return 0;
+}
+
// InventoryInit
static int inventoryCreate(lua_State *L) {
@@ -565,6 +588,8 @@ static const InitObject kInitObjects[] = {
{ "LoadSaveInit", "ND.LoadSaveInit", loadSaveCreate },
{ "ViewportInit", "ND.ViewportInit", viewportCreate },
{ "FlagsInit", "ND.FlagsInit", flagsCreate },
+ { "VarTableInit", "ND.VarTableInit", varTableCreate },
+ { "StrTableInit", "ND.StrTableInit", strTableCreate },
{ "InventoryInit", "ND.InventoryInit", inventoryCreate },
{ "FontsInit", "ND.FontsInit", fontsCreate },
{ "ColorsInit", "ND.ColorsInit", colorsCreate },
diff --git a/engines/nancy/script/gameapi.cpp b/engines/nancy/script/gameapi.cpp
index 17e7083e12f..6eb3c0bdb83 100644
--- a/engines/nancy/script/gameapi.cpp
+++ b/engines/nancy/script/gameapi.cpp
@@ -115,10 +115,24 @@ static const luaL_Reg kFlagsFunctions[] = {
{ nullptr, nullptr }
};
-// VarTable.<name>, the whole numbers scripts keep by name
+// VarTable.<name>, the whole numbers scripts keep by name, and from Nancy1New
+// on StrTable.<name>, the texts. Nancy1New names them all in its boot scripts.
+
+static void checkTableName(lua_State *L, bool isText, const char *name) {
+ if (g_nancy->getGameType() < kGameTypeNancy1New) {
+ return;
+ }
+
+ const ScriptBootData *boot = GetEngineData(ScriptBootData);
+ const ScriptBootData::NameSet &names = isText ? boot->textNames : boot->valueNames;
+ if (!names.contains(name)) {
+ luaL_error(L, "%s does not have variable %s", isText ? "StrTable" : "VarTable", name);
+ }
+}
static int varTableIndex(lua_State *L) {
const char *name = luaL_checkstring(L, 2);
+ checkTableName(L, false, name);
ScriptValueData *values = (ScriptValueData *)NancySceneState.getPuzzleData(ScriptValueData::getTag());
lua_pushnumber(L, values->values.getValOrDefault(name, 0));
@@ -128,6 +142,7 @@ static int varTableIndex(lua_State *L) {
static int varTableNewIndex(lua_State *L) {
const char *name = luaL_checkstring(L, 2);
const int32 value = (int32)luaL_checknumber(L, 3);
+ checkTableName(L, false, name);
ScriptValueData *values = (ScriptValueData *)NancySceneState.getPuzzleData(ScriptValueData::getTag());
values->values.setVal(name, value);
@@ -140,6 +155,31 @@ static const luaL_Reg kVarTableFunctions[] = {
{ nullptr, nullptr }
};
+static int strTableIndex(lua_State *L) {
+ const char *name = luaL_checkstring(L, 2);
+ checkTableName(L, true, name);
+
+ ScriptTextData *texts = (ScriptTextData *)NancySceneState.getPuzzleData(ScriptTextData::getTag());
+ lua_pushstring(L, texts->texts.getValOrDefault(name).c_str());
+ return 1;
+}
+
+static int strTableNewIndex(lua_State *L) {
+ const char *name = luaL_checkstring(L, 2);
+ const char *text = luaL_checkstring(L, 3);
+ checkTableName(L, true, name);
+
+ ScriptTextData *texts = (ScriptTextData *)NancySceneState.getPuzzleData(ScriptTextData::getTag());
+ texts->texts.setVal(name, text);
+ return 0;
+}
+
+static const luaL_Reg kStrTableFunctions[] = {
+ { "__index", strTableIndex },
+ { "__newindex", strTableNewIndex },
+ { nullptr, nullptr }
+};
+
// Z, which makes the numbers records are ordered by. Higher is closer to the player;
// both functions can take the number to count from in place of the middle.
@@ -2054,6 +2094,9 @@ static const luaL_Reg kAutotextFunctions[] = {
void registerGameAPI(lua_State *L) {
registerGlobal(L, "Flags", "ND.Flags", kFlagsFunctions);
registerGlobal(L, "VarTable", "ND.VarTable", kVarTableFunctions);
+ if (g_nancy->getGameType() >= kGameTypeNancy1New) {
+ registerGlobal(L, "StrTable", "ND.StrTable", kStrTableFunctions);
+ }
registerGlobal(L, "Z", "ND.ZHelper", kZFunctions);
luaL_getmetatable(L, "ND.ZHelper");
Commit: e1a90c3ddfb5895b65a5ba6a4ebb01ac90d716e3
https://github.com/scummvm/scummvm/commit/e1a90c3ddfb5895b65a5ba6a4ebb01ac90d716e3
Author: Filippos Karapetis (bluegr at gmail.com)
Date: 2026-10-31T10:43:27+02:00
Commit Message:
NANCY: NANCY1NEW: Change to unstable - the game now starts
Changed paths:
engines/nancy/detection_tables.h
diff --git a/engines/nancy/detection_tables.h b/engines/nancy/detection_tables.h
index 5e5988b17ba..18d9577f6cd 100644
--- a/engines/nancy/detection_tables.h
+++ b/engines/nancy/detection_tables.h
@@ -1086,7 +1086,7 @@ static const NancyGameDescription gameDescriptions[] = {
AD_ENTRY1s("ciftree.dat", "27dc04f52f2022c7eae8028b0b0dd215", 15296357),
Common::EN_ANY,
Common::kPlatformWindows,
- ADGF_UNSUPPORTED | ADGF_DROPPLATFORM,
+ ADGF_UNSTABLE | ADGF_DROPPLATFORM,
NANCY8_GUIOPTIONS
},
kGameTypeNancy1New
Commit: 2d02d8194e6ae438d7ab04a71a253c4527cf41b9
https://github.com/scummvm/scummvm/commit/2d02d8194e6ae438d7ab04a71a253c4527cf41b9
Author: Filippos Karapetis (bluegr at gmail.com)
Date: 2026-10-31T10:43:29+02:00
Commit Message:
NANCY: Keep movies in time with their sounds
Movies now show every frame at its own time from the start, so a frame
that comes a little late no longer holds back the rest. Since the game
draws 60 times a second, 15 fps movies fell behind their sounds, e.g.
the cutscene in Nancy23 scene 1708
Changed paths:
engines/nancy/movieplayer.cpp
engines/nancy/movieplayer.h
diff --git a/engines/nancy/movieplayer.cpp b/engines/nancy/movieplayer.cpp
index 18595f82f87..3a6ca0c6e2d 100644
--- a/engines/nancy/movieplayer.cpp
+++ b/engines/nancy/movieplayer.cpp
@@ -290,10 +290,13 @@ void MoviePlayer::goToFrame(int frameNr) {
_decoder->setReverse(false);
_decoder->seekToFrame(frameNr);
storeCurrentFrame();
+}
- int frameCount = _decoder->getFrameCount();
- uint32 durationMs = _decoder->getDuration().msecs();
- _frameDelayMs = (frameCount > 0 && durationMs > 0) ? (durationMs / frameCount) : 66;
+// How long a frame shows, from the length of the movie
+double MoviePlayer::getFrameMillis() const {
+ const int frameCount = _decoder->getFrameCount();
+ const uint32 durationMs = _decoder->getDuration().msecs();
+ return (frameCount > 0 && durationMs > 0) ? (double)durationMs / frameCount : 1000.0 / 15.0;
}
void MoviePlayer::playRange(int first, int last) {
@@ -310,7 +313,8 @@ void MoviePlayer::playRange(int first, int last) {
_decoder->seekToFrame(first);
storeCurrentFrame();
_rangePlaying = (first != last);
- _lastFrameTime = g_system->getMillis();
+ _frameMillis = getFrameMillis();
+ _nextFrameTime = g_system->getMillis() + _frameMillis;
}
bool MoviePlayer::update() {
@@ -318,14 +322,22 @@ bool MoviePlayer::update() {
return false;
}
- // Own the frame timing (one frame per delay, never skipping), so playback
+ // Own the frame timing (one frame at a time, never skipping), so playback
// starts immediately and stays smooth even when the decoder's own timing
- // would stall after a seek.
- uint32 now = g_system->getMillis();
- if (now - _lastFrameTime < _frameDelayMs) {
+ // would stall after a seek. Every frame is due at its own time, so frames
+ // that show a little late, as the game only draws 60 times a second, don't
+ // hold back the ones after them and leave the movie behind its sound.
+ const uint32 now = g_system->getMillis();
+ if (now < _nextFrameTime) {
return false;
}
- _lastFrameTime = now;
+
+ _nextFrameTime += _frameMillis;
+
+ // A movie that is more than a frame late times the frames after it from now
+ if (_nextFrameTime < now) {
+ _nextFrameTime = now + _frameMillis;
+ }
if (_decoder->endOfVideo() ||
(_step > 0 && _decoder->getCurFrame() >= _rangeLast) ||
diff --git a/engines/nancy/movieplayer.h b/engines/nancy/movieplayer.h
index 29e854551fc..7c75419f709 100644
--- a/engines/nancy/movieplayer.h
+++ b/engines/nancy/movieplayer.h
@@ -141,14 +141,16 @@ private:
Common::SharedPtr<DeferredLoader> _cacheLoader;
uint _cacheFillNext = 0;
+ double getFrameMillis() const;
+
// Simple frame-range player state. _currentSurface points at the decoder's
// last-decoded frame (owned by it, valid until the next decode).
const Graphics::Surface *_currentSurface = nullptr;
int _rangeLast = 0;
int _step = 1;
bool _rangePlaying = false;
- uint32 _lastFrameTime = 0;
- uint32 _frameDelayMs = 66;
+ double _nextFrameTime = 0.0; // when the next frame is due, in milliseconds
+ double _frameMillis = 1000.0 / 15.0;
};
} // End of namespace Nancy
Commit: c87d950eba654f55faddf933b09bc78848028cde
https://github.com/scummvm/scummvm/commit/c87d950eba654f55faddf933b09bc78848028cde
Author: Filippos Karapetis (bluegr at gmail.com)
Date: 2026-10-31T10:43:32+02:00
Commit Message:
NANCY: NANCY1NEW: Let the scripts use loadstring again
Only Nancy22 takes loadstring away from its scripts. Nancy1New and
later have it, and QueryTable_SC builds its small functions with it,
e.g. for the calligraphy puzzle in Nancy23 scene 3199.
Changed paths:
engines/nancy/script/luastate.cpp
diff --git a/engines/nancy/script/luastate.cpp b/engines/nancy/script/luastate.cpp
index fe754abdac5..ca76ac366e3 100644
--- a/engines/nancy/script/luastate.cpp
+++ b/engines/nancy/script/luastate.cpp
@@ -196,8 +196,12 @@ LuaState::LuaState(SceneContext *context) {
removeGlobal(_state, "loadfile");
removeGlobal(_state, "print");
- if (g_nancy->getGameType() >= kGameTypeNancy22) {
+ // Nancy1New has loadstring again, which QueryTable_SC builds its lambdas with
+ if (g_nancy->getGameType() == kGameTypeNancy22) {
removeGlobal(_state, "loadstring");
+ }
+
+ if (g_nancy->getGameType() >= kGameTypeNancy22) {
removeGlobal(_state, "setfenv");
}
Commit: a419595913d7eec408f238b28c06359aba7c3d40
https://github.com/scummvm/scummvm/commit/a419595913d7eec408f238b28c06359aba7c3d40
Author: Filippos Karapetis (bluegr at gmail.com)
Date: 2026-10-31T10:43:36+02:00
Commit Message:
NANCY: NANCY21: Allow scene summaries without a background
>From Nancy21 on, a scene can leave out its background, e.g. the
Nancy23 scene after the conversation in the lobby, which keeps the
picture of the scene before it.
Changed paths:
engines/nancy/script/records.cpp
diff --git a/engines/nancy/script/records.cpp b/engines/nancy/script/records.cpp
index 3742d299079..d2cad46e5e3 100644
--- a/engines/nancy/script/records.cpp
+++ b/engines/nancy/script/records.cpp
@@ -285,7 +285,9 @@ void SummaryRecord::readTable(int tableIndex) {
luaL_error(L, "No environment specified");
}
- if (!readField(L, tableIndex, "bg", _backgroundName)) {
+ // Nancy21 can leave the background out, e.g. for a scene that keeps the
+ // picture of the one before as its facade
+ if (!readField(L, tableIndex, "bg", _backgroundName) && g_nancy->getGameType() < kGameTypeNancy21) {
luaL_error(L, "No background specified");
}
Commit: b99c46f02dfda329c4462bfe22ef0ca1aa7b3436
https://github.com/scummvm/scummvm/commit/b99c46f02dfda329c4462bfe22ef0ca1aa7b3436
Author: Filippos Karapetis (bluegr at gmail.com)
Date: 2026-10-31T10:43:39+02:00
Commit Message:
NANCY: NANCY19: Send messages to scenes that are still loading
A scene whose script runs for the first time now gets the messages it
sends too. Nancy23's ManagerMain_SC makes the managers, then includes
scripts that call them right away, so its timers failed to start.
Changed paths:
engines/nancy/script/gameapi.cpp
engines/nancy/script/scenecontext.cpp
engines/nancy/script/scenecontext.h
diff --git a/engines/nancy/script/gameapi.cpp b/engines/nancy/script/gameapi.cpp
index 6eb3c0bdb83..1c4716d72bf 100644
--- a/engines/nancy/script/gameapi.cpp
+++ b/engines/nancy/script/gameapi.cpp
@@ -1504,15 +1504,23 @@ static bool deliverMessage(lua_State *L, const char *actionName, UI::NDUI::Actio
message.text = action.text;
message.value = action.value;
- const SceneContext *context = LuaState::getContext(L);
+ SceneContext *context = LuaState::getContext(L);
if (context && !context->getStreamName().equalsIgnoreCase(State::SceneStreamManager::getUIStreamName())) {
message.sender = context->getSceneName();
} else {
message.sender = action.sender;
}
+ // A scene whose script is running for the first time doesn't belong to its
+ // stream yet, but its records get messages too: Nancy23's ManagerMain_SC
+ // makes the managers, then includes scripts that call on them
bool wasTaken = false;
- if (!NancySceneState.receiveMessage(message, wasTaken) && ui) {
+ bool hasReceiver = context && context->isLoading() && context->receiveMessage(message, wasTaken);
+ if (!wasTaken) {
+ hasReceiver |= NancySceneState.receiveMessage(message, wasTaken);
+ }
+
+ if (!hasReceiver && ui) {
ui->takeAction(action);
}
diff --git a/engines/nancy/script/scenecontext.cpp b/engines/nancy/script/scenecontext.cpp
index 37dc52a9280..6c020d8ce34 100644
--- a/engines/nancy/script/scenecontext.cpp
+++ b/engines/nancy/script/scenecontext.cpp
@@ -115,7 +115,10 @@ bool SceneContext::load() {
}
}
- if (!_lua->runScript(_sceneName)) {
+ _isLoading = true;
+ const bool hasRun = _lua->runScript(_sceneName);
+ _isLoading = false;
+ if (!hasRun) {
return false;
}
diff --git a/engines/nancy/script/scenecontext.h b/engines/nancy/script/scenecontext.h
index d51f50c6418..973c6260d43 100644
--- a/engines/nancy/script/scenecontext.h
+++ b/engines/nancy/script/scenecontext.h
@@ -60,6 +60,10 @@ public:
// doesn't begin with a summary.
bool load();
+ // Whether the script of the scene is running for the first time, before
+ // the scene belongs to its stream
+ bool isLoading() const { return _isLoading; }
+
// One frame, which lasted the given number of seconds
void run(double elapsedTime);
void handleInput(NancyInput &input);
@@ -178,6 +182,7 @@ private:
Common::String _streamName;
Common::String _sceneName;
bool _isEnding = false;
+ bool _isLoading = false;
uint _frame;
int32 _zOffset;
Commit: 34a9c54a5b36ea30f9a5dcd338e935f7d74d2cf1
https://github.com/scummvm/scummvm/commit/34a9c54a5b36ea30f9a5dcd338e935f7d74d2cf1
Author: Filippos Karapetis (bluegr at gmail.com)
Date: 2026-10-31T10:43:41+02:00
Commit Message:
NANCY: NANCY22: Keep Xsheet records on screen when restarted
The idle animations in conversations restart their Xsheet in the
middle of a frame, which hid it until the next frame and made the
character blink, e.g. in Nancy23 scene 1062.
Changed paths:
engines/nancy/script/xsheet.cpp
engines/nancy/script/xsheet.h
diff --git a/engines/nancy/script/xsheet.cpp b/engines/nancy/script/xsheet.cpp
index 9a9d62f49c4..658e0bd7265 100644
--- a/engines/nancy/script/xsheet.cpp
+++ b/engines/nancy/script/xsheet.cpp
@@ -289,8 +289,12 @@ void XsheetRecord::onZChanged() {
_xsheet.setZ(getZ(), getContext());
}
+// A restart doesn't hide the XSheet until the record runs again: the
+// conversation fidgets restart theirs in the middle of a frame, which made the
+// character blink every time
void XsheetRecord::updateGraphics() {
- _xsheet.setVisible(isActive() && hasStarted());
+ _hasShown |= hasStarted();
+ _xsheet.setVisible(isActive() && _hasShown);
}
bool XsheetRecord::getField(const Common::String &key) {
diff --git a/engines/nancy/script/xsheet.h b/engines/nancy/script/xsheet.h
index e6303f1368e..9392d567afe 100644
--- a/engines/nancy/script/xsheet.h
+++ b/engines/nancy/script/xsheet.h
@@ -129,6 +129,7 @@ private:
int _lastFrame = 0;
bool _hasEnded = false;
bool _isPaused = false;
+ bool _hasShown = false; // stays on screen when restarted
};
} // End of namespace Script
Commit: 76233ae4e4ce0c49fc43e7d21d802a431858f027
https://github.com/scummvm/scummvm/commit/76233ae4e4ce0c49fc43e7d21d802a431858f027
Author: Filippos Karapetis (bluegr at gmail.com)
Date: 2026-10-31T10:43:43+02:00
Commit Message:
NANCY: NANCY19: Let Esc skip movies that stop on their last frame
Esc now also skips a movie that stays on its last frame, and leaves
that frame showing. Nancy23's cutscenes are made of such movies, each
one starting when the one before reaches its end, e.g. in scene 1708.
Changed paths:
engines/nancy/script/records.cpp
diff --git a/engines/nancy/script/records.cpp b/engines/nancy/script/records.cpp
index d2cad46e5e3..fed87622ddd 100644
--- a/engines/nancy/script/records.cpp
+++ b/engines/nancy/script/records.cpp
@@ -1894,9 +1894,15 @@ void MovieRecord::runOnce() {
drawFrame();
}
-// A movie that plays through and ends; one that loops forever never does
+// A movie that plays through and ends; one that loops forever never does. One
+// that stops on its last frame can be skipped until it gets there: Nancy23's
+// cinematics are made of those, each starting when the one before is done.
bool MovieRecord::isSkippable() const {
- return isActive() && hasStarted() && !_isPaused && !_pausesOnLastFrame && _numLoops != 0;
+ if (!isActive() || !hasStarted() || _isPaused || _numLoops == 0) {
+ return false;
+ }
+
+ return !_pausesOnLastFrame || (_player.isRangePlaying() && !_hasCalledOnPause);
}
void MovieRecord::run(double sceneTime, double elapsedTime) {
@@ -1916,10 +1922,18 @@ void MovieRecord::run(double sceneTime, double elapsedTime) {
--_skipFrame;
}
- // The movie stays at its last frame for the scripts until it starts over
+ // The movie stays at its last frame for the scripts until it starts over.
+ // One that stops there shows it, as the next movie takes over from it.
if (_skipFrame == _lastFrame) {
- _endTime = sceneTime;
- finish();
+ if (_pausesOnLastFrame) {
+ _player.goToFrame(_lastFrame);
+ drawFrame();
+ _hasCalledOnPause = true;
+ callFunction("OnPause");
+ } else {
+ _endTime = sceneTime;
+ finish();
+ }
}
return;
Commit: cac30326f685a3a3f1137de85f5d4be8ad977ba4
https://github.com/scummvm/scummvm/commit/cac30326f685a3a3f1137de85f5d4be8ad977ba4
Author: Filippos Karapetis (bluegr at gmail.com)
Date: 2026-10-31T10:43:46+02:00
Commit Message:
NANCY: NANCY20: Add Rect:RightBottomSet and the number of a Color
rect:RightBottomSet(place) moves a rectangle so that its bottom right
corner is at the place, and color.number holds all four parts of a
color in one number. The scripts of Nancy23 use both.
Changed paths:
engines/nancy/script/types.cpp
diff --git a/engines/nancy/script/types.cpp b/engines/nancy/script/types.cpp
index 6aa955c5a0f..1c91df0e890 100644
--- a/engines/nancy/script/types.cpp
+++ b/engines/nancy/script/types.cpp
@@ -269,6 +269,15 @@ static int rectLeftBottomSet(lua_State *L) {
return 1;
}
+// rect:RightBottomSet(place), Nancy20
+static int rectRightBottomSet(lua_State *L) {
+ const ScriptRect &rect = checkRect(L, 1);
+ double x, y;
+ checkPlaceArguments(L, 2, x, y);
+ pushRect(L, ScriptRect((int32)(x - rect.width()), (int32)(y - rect.height()), (int32)x, (int32)y));
+ return 1;
+}
+
static const luaL_Reg kRectFunctions[] = {
{ "__index", rectIndex },
{ "__newindex", rectNewIndex },
@@ -281,6 +290,7 @@ static const luaL_Reg kRectFunctions[] = {
{ "CenterSet", rectCenterSet },
{ "LeftTopSet", rectLeftTopSet },
{ "LeftBottomSet", rectLeftBottomSet },
+ { "RightBottomSet", rectRightBottomSet },
{ nullptr, nullptr }
};
@@ -455,9 +465,16 @@ static int colorNew(lua_State *L) {
return 1;
}
+// color.number, Nancy20: all four components in one number, as a signed one
static int colorIndex(lua_State *L) {
uint32 color = checkColor(L, 1);
- int shift = getColorComponentShift(luaL_checkstring(L, 2));
+ const char *key = luaL_checkstring(L, 2);
+ if (strcmp(key, "number") == 0) {
+ lua_pushnumber(L, (int32)color);
+ return 1;
+ }
+
+ int shift = getColorComponentShift(key);
if (shift < 0) {
return indexFunctions(L);
}
@@ -469,6 +486,11 @@ static int colorIndex(lua_State *L) {
static int colorNewIndex(lua_State *L) {
uint32 *color = (uint32 *)checkUserData(L, 1, kColorType);
const char *key = luaL_checkstring(L, 2);
+ if (strcmp(key, "number") == 0) {
+ *color = (uint32)(int32)luaL_checknumber(L, 3);
+ return 0;
+ }
+
uint32 value = (uint32)(int32)luaL_checknumber(L, 3) & 0xFF;
int shift = getColorComponentShift(key);
Commit: bfdec0ab163175de2f866deb94f219865abcf286
https://github.com/scummvm/scummvm/commit/bfdec0ab163175de2f866deb94f219865abcf286
Author: Filippos Karapetis (bluegr at gmail.com)
Date: 2026-10-31T10:43:48+02:00
Commit Message:
NANCY: NANCY20: Add Path:AddPoint
path:AddPoint adds a point to a path that already exists. A path is a
list of points to pass at given times, so the new point goes in among
the others by its time. The metro map of Nancy23 (scene 4300) builds
the route of the train this way.
Changed paths:
engines/nancy/script/mathtypes.cpp
diff --git a/engines/nancy/script/mathtypes.cpp b/engines/nancy/script/mathtypes.cpp
index 53847e02d07..21d53bb9b70 100644
--- a/engines/nancy/script/mathtypes.cpp
+++ b/engines/nancy/script/mathtypes.cpp
@@ -19,6 +19,7 @@
*
*/
+#include "common/array.h"
#include "common/scummsys.h"
#include "common/util.h"
@@ -897,11 +898,12 @@ static const luaL_Reg kQuaternionHelperFunctions[] = {
{ nullptr, nullptr }
};
-// Path, Nancy20: places to be at certain times. Only the scripts of Nancy22 use
-// it, for the car of the driving game that plays back a recorded drive.
+// Path, Nancy20: places to be at certain times. The scripts of Nancy22 use it
+// for the car of the driving game that plays back a recorded drive, and Nancy23
+// for the dot that moves along the metro map.
// Path:New{ { x, y, time }, ... } takes them in the order of their times.
// TODO: The curves through the places that path:GetPosition(time, false) gives,
-// and AddPoint, RemovePoint, GetGuides and SetGuides, which no script uses
+// and RemovePoint, GetGuides and SetGuides, which no script uses
static const char *const kPathType = "ND.Path";
static const char *const kPathHelperType = "ND.PathHelper";
@@ -911,27 +913,23 @@ struct PathPoint {
double time;
};
-// The points follow the count in the object
-struct PathHeader {
- uint32 numPoints;
- uint32 padding;
-};
+typedef Common::Array<PathPoint> PathPoints;
+
+// A path object holds the places, which go away with it
+static PathPoints *&getPathPoints(lua_State *L, int index) {
+ return *(PathPoints **)checkUserData(L, index, kPathType);
+}
-static const PathPoint *checkPath(lua_State *L, int index, uint32 &numPoints) {
- const PathHeader *header = (const PathHeader *)checkUserData(L, index, kPathType);
- numPoints = header->numPoints;
- return (const PathPoint *)(header + 1);
+static PathPoints &checkPath(lua_State *L, int index) {
+ return *getPathPoints(L, index);
}
static int pathNew(lua_State *L) {
luaL_checktype(L, 2, LUA_TTABLE);
const uint32 numPoints = (uint32)lua_objlen(L, 2);
- PathHeader *header = (PathHeader *)pushUserData(L, sizeof(PathHeader) + numPoints * sizeof(PathPoint), kPathType);
- header->numPoints = numPoints;
- header->padding = 0;
-
- PathPoint *points = (PathPoint *)(header + 1);
+ PathPoints &points = **pushValue(L, kPathType, new PathPoints());
+ points.resize(numPoints);
for (uint32 i = 0; i < numPoints; ++i) {
lua_rawgeti(L, 2, i + 1);
lua_getfield(L, -1, "x");
@@ -946,12 +944,44 @@ static int pathNew(lua_State *L) {
return 1;
}
+static int pathCollect(lua_State *L) {
+ PathPoints *&points = getPathPoints(L, 1);
+ delete points;
+ points = nullptr;
+ return 0;
+}
+
+// path:AddPoint({ x, y, time }) or path:AddPoint(x, y, time), Nancy20, which
+// puts the place after the ones up to its time
+static int pathAddPoint(lua_State *L) {
+ PathPoints &points = checkPath(L, 1);
+
+ PathPoint point = { 0.0, 0.0, 0.0 };
+ if (lua_istable(L, 2)) {
+ readField(L, 2, "x", point.x);
+ readField(L, 2, "y", point.y);
+ readField(L, 2, "time", point.time);
+ } else {
+ point.x = luaL_checknumber(L, 2);
+ point.y = luaL_checknumber(L, 3);
+ point.time = luaL_checknumber(L, 4);
+ }
+
+ uint index = 0;
+ while (index < points.size() && points[index].time <= point.time) {
+ ++index;
+ }
+
+ points.insert_at(index, point);
+ return 0;
+}
+
// path:GetPosition(time[, straight[, loops]]): where the path is at a time, in a
// straight line between the places around it. A path that loops starts over
// after its last place; one that doesn't stays at its ends.
static int pathGetPosition(lua_State *L) {
- uint32 numPoints;
- const PathPoint *points = checkPath(L, 1, numPoints);
+ const PathPoints &points = checkPath(L, 1);
+ const uint32 numPoints = points.size();
double time = luaL_checknumber(L, 2);
const bool loops = lua_isboolean(L, 4) && lua_toboolean(L, 4);
@@ -997,7 +1027,9 @@ static int pathGetPosition(lua_State *L) {
static const luaL_Reg kPathFunctions[] = {
{ "__index", indexFunctions },
+ { "__gc", pathCollect },
{ "GetPosition", pathGetPosition },
+ { "AddPoint", pathAddPoint },
{ nullptr, nullptr }
};
Commit: c65f95592e2817dae94a00d95e2d1303347a85e3
https://github.com/scummvm/scummvm/commit/c65f95592e2817dae94a00d95e2d1303347a85e3
Author: Filippos Karapetis (bluegr at gmail.com)
Date: 2026-10-31T10:43:50+02:00
Commit Message:
NANCY: NANCY20: Implement Ref:SampleArea
A Ref is an image that the scripts look colors up in, without showing
it. ref:SampleArea(rect) counts how many pixels of each color there
are in a part of it. The strings puzzle of Nancy23 paints every area
in a color of its own, and finds out which areas a cut joins this way.
Changed paths:
engines/nancy/script/ref.cpp
diff --git a/engines/nancy/script/ref.cpp b/engines/nancy/script/ref.cpp
index 8dd84dc42e6..41d5967d4f4 100644
--- a/engines/nancy/script/ref.cpp
+++ b/engines/nancy/script/ref.cpp
@@ -19,6 +19,8 @@
*
*/
+#include "common/hashmap.h"
+
#include "engines/nancy/nancy.h"
#include "engines/nancy/resource.h"
@@ -179,6 +181,7 @@ static int refNew(lua_State *L) {
ScriptRef::Layer *layer = new ScriptRef::Layer();
layer->image.edgeMode = ref->edgeMode;
g_nancy->_resource->loadImage(Common::Path(imageName), layer->image.image);
+ layer->rect = ScriptRect(0, 0, layer->image.image.w, layer->image.image.h);
ref->layers.push_back(layer);
}
@@ -303,6 +306,53 @@ static int refIsOpaqueInArea(lua_State *L) {
return 1;
}
+// ref:SampleArea(rect): how many pixels of every color there are in the
+// rectangle, as a table of counts with Colors for keys. The places none of the
+// images cover count as the border color. The strings puzzle of Nancy23 finds
+// out which areas a cut joins with it.
+static int refSampleArea(lua_State *L) {
+ const ScriptRef *ref = checkRef(L, 1);
+ const ScriptRect area = checkRect(L, 2);
+
+ Common::HashMap<uint32, int> counts;
+ int numUncovered = area.width() * area.height();
+
+ for (const ScriptRef::Layer *layer : ref->layers) {
+ const ScriptRect &rect = layer->rect;
+ const int left = MAX(rect.left, area.left);
+ const int top = MAX(rect.top, area.top);
+ const int right = MIN(rect.right, area.right);
+ const int bottom = MIN(rect.bottom, area.bottom);
+ if (left >= right || top >= bottom) {
+ continue;
+ }
+
+ for (int y = top; y < bottom; ++y) {
+ for (int x = left; x < right; ++x) {
+ uint32 pixel;
+ if (layer->image.getPixel(x - rect.left, y - rect.top, pixel)) {
+ ++counts[pixel];
+ }
+ }
+ }
+
+ numUncovered -= (right - left) * (bottom - top);
+ }
+
+ if (numUncovered > 0) {
+ counts[ref->borderColor] += numUncovered;
+ }
+
+ lua_createtable(L, 0, counts.size());
+ for (const auto &count : counts) {
+ pushColor(L, count._key);
+ lua_pushinteger(L, count._value);
+ lua_settable(L, -3);
+ }
+
+ return 1;
+}
+
void registerRefAPI(lua_State *L) {
static const luaL_Reg kRefFunctions[] = {
{ "__index", indexFunctions },
@@ -314,6 +364,7 @@ void registerRefAPI(lua_State *L) {
{ "IsOpaqueAt", refIsOpaqueAt },
{ "IsInArea", refIsInArea },
{ "IsOpaqueInArea", refIsOpaqueInArea },
+ { "SampleArea", refSampleArea },
{ nullptr, nullptr }
};
Commit: ad6bdad64bffa22c7aa62325014f927137f0efe6
https://github.com/scummvm/scummvm/commit/ad6bdad64bffa22c7aa62325014f927137f0efe6
Author: Filippos Karapetis (bluegr at gmail.com)
Date: 2026-10-31T10:43:51+02:00
Commit Message:
NANCY: NANCY21: Count particles from the last one made
Particle records (the snow, rain and dust of the later games) worked
out how many particles to make from the time since they started,
times their frequency. A script that raised the frequency got all the
particles the new one would have made so far at once. Now they count
from the last particle made, as the original does.
Changed paths:
engines/nancy/script/particles.cpp
engines/nancy/script/particles.h
diff --git a/engines/nancy/script/particles.cpp b/engines/nancy/script/particles.cpp
index 136fad0cf43..e38d0479ab5 100644
--- a/engines/nancy/script/particles.cpp
+++ b/engines/nancy/script/particles.cpp
@@ -653,30 +653,36 @@ void ParticleRecord::run(double sceneTime, double elapsedTime) {
simulate(elapsedTime);
}
-// Steps through the given time, 30 steps a second
+// Steps through the given time, 30 steps a second. What is left over counts
+// toward the next step.
void ParticleRecord::simulate(double seconds) {
- _stepTime += seconds;
- const int numSteps = (int)(_stepTime * kStepsPerSecond);
- const int newSteps = numSteps - _numSteps;
- _numSteps = numSteps;
+ _stepClock += seconds;
+ const int numSteps = MAX<int>((int)(_stepClock * kStepsPerSecond), 0);
+ _stepClock -= numSteps / kStepsPerSecond;
- for (int i = 0; i < newSteps; ++i) {
+ for (int i = 0; i < numSteps; ++i) {
step();
}
}
void ParticleRecord::step() {
- const int numSpawned = _numSpawned;
_spawnTime += 1.0 / kStepsPerSecond;
- _numSpawned = (int)(_spawnTime * _frequency);
+
+ // A record that makes no particles keeps no time toward the next one
+ int numSpawned = 0;
+ if (_frequency > 0.0) {
+ _spawnClock += 1.0 / kStepsPerSecond;
+ numSpawned = MAX<int>((int)(_spawnClock * _frequency), 0);
+ _spawnClock -= numSpawned / _frequency;
+ }
// The particles that lived long enough go
while (!_batches.empty() && _batches.front().time + _life <= _spawnTime) {
dropOldestBatch();
}
- if (_numSpawned > numSpawned) {
- spawn(_numSpawned - numSpawned);
+ if (numSpawned > 0) {
+ spawn(numSpawned);
}
runStages(_first, _count, false);
diff --git a/engines/nancy/script/particles.h b/engines/nancy/script/particles.h
index 7546cd99d6e..843d2d340e8 100644
--- a/engines/nancy/script/particles.h
+++ b/engines/nancy/script/particles.h
@@ -114,10 +114,10 @@ private:
ScriptMatrix _perspective;
bool _hasPerspective = false; // Nancy22 has particles without one
- double _stepTime = 0.0;
- int _numSteps = 0;
- double _spawnTime = 0.0;
- int _numSpawned = 0;
+ // Both keep what is left of the time after the last whole step or particle
+ double _stepClock = 0.0;
+ double _spawnClock = 0.0;
+ double _spawnTime = 0.0; // when the newest particles were made
RecordGraphic *_canvas = nullptr;
};
Commit: 0fe23733997e53cb312fd87a48fc099022d390f6
https://github.com/scummvm/scummvm/commit/0fe23733997e53cb312fd87a48fc099022d390f6
Author: Filippos Karapetis (bluegr at gmail.com)
Date: 2026-10-31T10:43:54+02:00
Commit Message:
NANCY: NANCY22: Let Save:Data keep Rects
Save:Data keeps a value of the scripts under a name, and Load:Data gets
it back. Besides numbers, texts and tables, they now also take Rects,
the only objects the original can keep. The managers of Nancy23 get
handed what they are called with through Save:Data, and the calligraphy
puzzle (scene 3199) calls the photo manager with Rects.
Changed paths:
engines/nancy/script/gameapi.cpp
diff --git a/engines/nancy/script/gameapi.cpp b/engines/nancy/script/gameapi.cpp
index 1c4716d72bf..870917dbc80 100644
--- a/engines/nancy/script/gameapi.cpp
+++ b/engines/nancy/script/gameapi.cpp
@@ -678,7 +678,8 @@ enum SavedValueTag {
kSavedTrue = 2,
kSavedNumber = 3,
kSavedString = 4,
- kSavedTable = 5
+ kSavedTable = 5,
+ kSavedRect = 6
};
static void writeSavedUint32(Common::Array<byte> &out, uint32 value) {
@@ -748,6 +749,21 @@ static bool writeSavedValue(lua_State *L, int index, Common::Array<byte> &out, i
out.push_back(pairs);
return true;
}
+ case LUA_TUSERDATA: {
+ // Rects are the only objects that can be kept, e.g. the parts of the
+ // screen Nancy23's photo manager gets handed
+ const ScriptRect *rect = testRect(L, index);
+ if (!rect) {
+ return false;
+ }
+
+ out.push_back(kSavedRect);
+ writeSavedUint32(out, (uint32)rect->left);
+ writeSavedUint32(out, (uint32)rect->top);
+ writeSavedUint32(out, (uint32)rect->right);
+ writeSavedUint32(out, (uint32)rect->bottom);
+ return true;
+ }
default:
return false;
}
@@ -805,6 +821,15 @@ static void readSavedValue(lua_State *L, const Common::Array<byte> &in, uint &po
break;
}
+ case kSavedRect: {
+ ScriptRect rect;
+ rect.left = (int32)readSavedUint32(in, pos);
+ rect.top = (int32)readSavedUint32(in, pos);
+ rect.right = (int32)readSavedUint32(in, pos);
+ rect.bottom = (int32)readSavedUint32(in, pos);
+ pushRect(L, rect);
+ break;
+ }
default:
lua_pushnil(L);
break;
Commit: 6bc3baea3b99d28202711dbf1e938fcd29171c3b
https://github.com/scummvm/scummvm/commit/6bc3baea3b99d28202711dbf1e938fcd29171c3b
Author: Filippos Karapetis (bluegr at gmail.com)
Date: 2026-10-31T10:43:57+02:00
Commit Message:
NANCY: NANCY22: Add the beginFlash and endFlash messages
A button that is sent beginFlash blinks between how it looks under the
mouse and how it looks disabled, as many times as asked or until it is
sent endFlash. Nancy23 flashes the inventory and phone buttons.
Changed paths:
engines/nancy/script/gameapi.cpp
engines/nancy/ui/ndui/button.cpp
engines/nancy/ui/ndui/common.h
engines/nancy/ui/ndui/control.cpp
engines/nancy/ui/ndui/control.h
engines/nancy/ui/ndui/element.cpp
engines/nancy/ui/ndui/element.h
diff --git a/engines/nancy/script/gameapi.cpp b/engines/nancy/script/gameapi.cpp
index 870917dbc80..817b7cfdf82 100644
--- a/engines/nancy/script/gameapi.cpp
+++ b/engines/nancy/script/gameapi.cpp
@@ -1877,7 +1877,9 @@ static const MessageActionName kMessageActionNames[] = {
{ "getValue", UI::NDUI::kActionQuery },
{ "showItem", UI::NDUI::kActionShowItem },
{ "hideItem", UI::NDUI::kActionHideItem },
- { "cycleFocus", UI::NDUI::kActionCycleFocus }
+ { "cycleFocus", UI::NDUI::kActionCycleFocus },
+ { "beginFlash", UI::NDUI::kActionBeginFlash },
+ { "endFlash", UI::NDUI::kActionEndFlash }
};
// Message:Send(action, target[, value[, text[, isTextKey]]])
diff --git a/engines/nancy/ui/ndui/button.cpp b/engines/nancy/ui/ndui/button.cpp
index 28ecb5831f9..5b0df891b8a 100644
--- a/engines/nancy/ui/ndui/button.cpp
+++ b/engines/nancy/ui/ndui/button.cpp
@@ -57,11 +57,12 @@ ControlState Button::getButtonState() const {
return kStatePressed;
}
- return _isMouseOver ? kStateMouseOver : kStateNormal;
+ return _isMouseOver ? kStateMouseOver : getFlashState();
}
// Buttons keep being drawn after they get hidden, until they have faded out
bool Button::update(float seconds) {
+ updateFlash();
ControlState state = getButtonState();
float rate = state == kStatePressed ? 0.0f : kControlBlendRate;
diff --git a/engines/nancy/ui/ndui/common.h b/engines/nancy/ui/ndui/common.h
index 126230b1db7..d31f4e8aeb4 100644
--- a/engines/nancy/ui/ndui/common.h
+++ b/engines/nancy/ui/ndui/common.h
@@ -118,6 +118,8 @@ enum ActionType {
kActionSetValue = 13,
kActionSetTexture = 14,
kActionSetImage = 15, // Nancy21: a texture and a source rect, in one
+ kActionBeginFlash = 16, // a control blinks, as many times as the value says or for good...
+ kActionEndFlash = 17, // ...until this
kActionQuery = 30, // asks the engine to send its value back with kActionSetValue
kActionShowItem = 40, // inventory panels
kActionHideItem = 41,
diff --git a/engines/nancy/ui/ndui/control.cpp b/engines/nancy/ui/ndui/control.cpp
index 64d032372e2..45442cb1078 100644
--- a/engines/nancy/ui/ndui/control.cpp
+++ b/engines/nancy/ui/ndui/control.cpp
@@ -103,6 +103,17 @@ bool Control::doAction(const Action &action) {
case kActionToggleEnabled:
setEnabled(!_enabled);
break;
+ case kActionBeginFlash:
+ if (_numFlashes <= 0) {
+ _isFlashOn = true;
+ }
+
+ // Without a number of flashes, it flashes until told to stop
+ _numFlashes = action.value > 0 ? (int)action.value : INT_MAX;
+ break;
+ case kActionEndFlash:
+ _numFlashes = 0;
+ break;
default:
return false;
}
@@ -110,6 +121,29 @@ bool Control::doAction(const Action &action) {
return true;
}
+void Control::updateFlash() {
+ if (_numFlashes <= 0) {
+ return;
+ }
+
+ if (_isFlashOn) {
+ if (_elements[0].hasReached(kStateMouseOver)) {
+ _isFlashOn = false;
+ }
+ } else if (_elements[0].hasReached(kStateDisabled)) {
+ --_numFlashes;
+ _isFlashOn = true;
+ }
+}
+
+ControlState Control::getFlashState() const {
+ if (_numFlashes <= 0) {
+ return kStateNormal;
+ }
+
+ return _isFlashOn ? kStateMouseOver : kStateDisabled;
+}
+
void Control::setVisible(bool visible) {
if (_visible != visible) {
_visible = visible;
diff --git a/engines/nancy/ui/ndui/control.h b/engines/nancy/ui/ndui/control.h
index d1bd3269fa9..9557a132093 100644
--- a/engines/nancy/ui/ndui/control.h
+++ b/engines/nancy/ui/ndui/control.h
@@ -95,6 +95,12 @@ protected:
ControlState getState() const;
+ // Nancy22: a control that was told to flash goes back and forth between
+ // looking hovered over and looking disabled. Its resting state is the one
+ // it is heading for, which turns around once the colors get there.
+ void updateFlash();
+ ControlState getFlashState() const;
+
// Nancy21: what a "setImage" action asks for. A text picks another texture,
// and a value above 0 a source rect.
void setImage(uint element, const Action &action);
@@ -115,6 +121,8 @@ protected:
bool _visible = true;
bool _enabled = true;
bool _autoHeight = false; // controls without a height are as tall as their text
+ int _numFlashes = 0; // flashes left
+ bool _isFlashOn = false;
Common::Array<Action> _events;
EventHandler *_eventHandler = nullptr;
Common::Array<Element> _elements;
diff --git a/engines/nancy/ui/ndui/element.cpp b/engines/nancy/ui/ndui/element.cpp
index 3bd2e9daedb..f33a72a0c0d 100644
--- a/engines/nancy/ui/ndui/element.cpp
+++ b/engines/nancy/ui/ndui/element.cpp
@@ -166,6 +166,12 @@ bool Element::blend(ControlState state, float seconds, float rate) {
return changed;
}
+bool Element::hasReached(ControlState state) const {
+ const uint32 current = ((uint32)colorChannelToByte(_current[0]) << 24) | ((uint32)colorChannelToByte(_current[1]) << 16) |
+ ((uint32)colorChannelToByte(_current[2]) << 8) | colorChannelToByte(_current[3]);
+ return current == _colors[state];
+}
+
// The texture is stretched to fill the destination, and tinted by the current color
void Element::drawSprite(Graphics::ManagedSurface &surface, const Common::Rect &src, const Common::Rect &dest, const Graphics::ManagedSurface &texture) const {
byte tintA = colorChannelToByte(_current[0]);
diff --git a/engines/nancy/ui/ndui/element.h b/engines/nancy/ui/ndui/element.h
index 88d728be28d..514eba6fea4 100644
--- a/engines/nancy/ui/ndui/element.h
+++ b/engines/nancy/ui/ndui/element.h
@@ -57,6 +57,9 @@ public:
void drawText(Graphics::ManagedSurface &surface, const Common::String &text, const Common::Rect &dest, const float *color, ControlState state, bool shadow) const;
uint32 getFontColor(ControlState state) const { return _fontColors[state]; }
+
+ // Whether the colors that get drawn are those of a state
+ bool hasReached(ControlState state) const;
int getFontHeight() const;
// The height the text takes up when it gets wrapped to the given width
Commit: 0cd85aa17e37894774193591d2dde1ef385601c0
https://github.com/scummvm/scummvm/commit/0cd85aa17e37894774193591d2dde1ef385601c0
Author: Filippos Karapetis (bluegr at gmail.com)
Date: 2026-10-31T10:43:59+02:00
Commit Message:
NANCY: NANCY1NEW: Add the stages of particle records by name
>From Nancy1New on, scripts make a particle record first and then add
its stages with record:Add<Stage>(name, table), e.g. AddVelocity.
Nancy23 makes its snow this way.
- fastForward waits until the record starts, after the stages
- The fade stage goes from the alpha1 to the alpha2 it is given
Changed paths:
engines/nancy/script/particles.cpp
engines/nancy/script/particles.h
diff --git a/engines/nancy/script/particles.cpp b/engines/nancy/script/particles.cpp
index e38d0479ab5..558a4662e38 100644
--- a/engines/nancy/script/particles.cpp
+++ b/engines/nancy/script/particles.cpp
@@ -350,18 +350,25 @@ private:
};
// "fade": the particles fade in or out once they are "start" into their life,
-// over "duration" of it
+// over "duration" of it. From Nancy1New on, they go from "alpha1" to "alpha2"
+// (0 to 255 unless set); before, they fade out unless "in" is set.
class ParticleFadeStage : public ParticleStage {
public:
ParticleFadeStage(ParticleRecord &record, lua_State *L, int tableIndex) : ParticleStage(record) {
readField(L, tableIndex, "start", _start);
readField(L, tableIndex, "duration", _duration);
- _isFadingIn = readTruth(L, tableIndex, "in");
+
+ if (g_nancy->getGameType() >= kGameTypeNancy1New) {
+ readAlpha(L, tableIndex, "alpha1", _fromAlpha);
+ readAlpha(L, tableIndex, "alpha2", _toAlpha);
+ } else if (!readTruth(L, tableIndex, "in")) {
+ _fromAlpha = 255;
+ _toAlpha = 0;
+ }
}
void update(uint first, uint count) override {
- const double from = _isFadingIn ? 0.0 : 255.0;
- const double change = _isFadingIn ? 255.0 : -255.0;
+ const double change = _toAlpha - _fromAlpha;
// The oldest particles come first, so the ones after one that hasn't
// started fading haven't either
@@ -373,16 +380,24 @@ public:
}
if (fraction <= 1.0) {
- const uint32 alpha = (uint32)CLIP<int>((int)floor(fraction * change + from + 0.5), 0, 255);
+ const uint32 alpha = (uint32)CLIP<int>((int)floor(fraction * change + _fromAlpha + 0.5), 0, 255);
particle.color = (particle.color & 0xFFFFFF) | (alpha << 24);
}
}
}
private:
+ static void readAlpha(lua_State *L, int tableIndex, const char *name, int &alpha) {
+ double value;
+ if (readField(L, tableIndex, name, value)) {
+ alpha = (int)value;
+ }
+ }
+
double _start = 0.0;
double _duration = 1.0;
- bool _isFadingIn = false;
+ int _fromAlpha = 0;
+ int _toAlpha = 255;
};
// "drag": slows the particles down by a factor every step
@@ -545,12 +560,7 @@ private:
};
// TODO: The "script" and "revolve" stages, which no script uses
-static ParticleStage *makeStage(ParticleRecord &record, lua_State *L, int tableIndex) {
- Common::String name;
- if (!readField(L, tableIndex, "name", name)) {
- luaL_error(L, "name must be set to a string at each stage");
- }
-
+static ParticleStage *makeStage(ParticleRecord &record, lua_State *L, int tableIndex, const Common::String &name) {
if (name == "positionPerspective") {
return new ParticlePerspectivePositionStage(record, L, tableIndex);
} else if (name == "position") {
@@ -629,18 +639,25 @@ void ParticleRecord::readTable(int tableIndex) {
}
luaL_checktype(L, -1, LUA_TTABLE);
- addStage(makeStage(*this, L, absoluteIndex(L, -1)));
+ const int stageIndex = absoluteIndex(L, -1);
+
+ Common::String name;
+ if (!readField(L, stageIndex, "name", name)) {
+ luaL_error(L, "name must be set to a string at each stage");
+ }
+
+ addStage(makeStage(*this, L, stageIndex, name));
lua_pop(L, 1);
}
lua_pop(L, 1);
}
- // The particles can be there before the record is
- double fastForward = 0.0;
- readField(L, tableIndex, "fastForward", fastForward);
- if (fastForward > 0.0) {
- simulate(fastForward);
+ // The particles can be there before the record is. From Nancy1New on, that
+ // waits until the record starts, after the stages have been added.
+ readField(L, tableIndex, "fastForward", _fastForward);
+ if (g_nancy->getGameType() < kGameTypeNancy1New && _fastForward > 0.0) {
+ simulate(_fastForward);
}
}
@@ -649,6 +666,23 @@ void ParticleRecord::addStage(ParticleStage *stage) {
stage->onAdded();
}
+void ParticleRecord::addNamedStage(const Common::String &kind, const Common::String &name, int tableIndex) {
+ lua_State *L = getLua();
+ if (_namedStages.contains(name)) {
+ luaL_error(L, "Particle AR already has a stage by the name '%s'", name.c_str());
+ }
+
+ ParticleStage *stage = makeStage(*this, L, tableIndex, kind);
+ addStage(stage);
+ _namedStages[name] = stage;
+}
+
+void ParticleRecord::runOnce() {
+ if (g_nancy->getGameType() >= kGameTypeNancy1New && _fastForward > 0.0) {
+ simulate(_fastForward);
+ }
+}
+
void ParticleRecord::run(double sceneTime, double elapsedTime) {
simulate(elapsedTime);
}
@@ -760,27 +794,63 @@ void ParticleRecord::onZChanged() {
}
}
+// record:Add<Stage>(name, table), Nancy1New; the kind of stage is the upvalue
+static int particleAddStage(lua_State *L) {
+ ParticleRecord *record = (ParticleRecord *)checkRecord(L, 1);
+ const Common::String name = luaL_checkstring(L, 2);
+ luaL_checktype(L, 3, LUA_TTABLE);
+
+ record->addNamedStage(lua_tostring(L, lua_upvalueindex(1)), name, 3);
+ return 0;
+}
+
+static const char *const kParticleStageKinds[][2] = {
+ { "AddAngle", "angle" },
+ { "AddColor", "color" },
+ { "AddDrag", "drag" },
+ { "AddFade", "fade" },
+ { "AddForce", "force" },
+ { "AddPlaneCollision", "planeCollision" },
+ { "AddPosition", "position" },
+ { "AddPositionPerspective", "positionPerspective" },
+ { "AddScale", "scale" },
+ { "AddSources", "sources" },
+ { "AddTurbulence", "turbulence" },
+ { "AddVelocity", "velocity" }
+};
+
bool ParticleRecord::getField(const Common::String &key) {
lua_State *L = getLua();
if (key == "frequency") {
lua_pushnumber(L, _frequency);
- return true;
} else if (key == "count") {
lua_pushinteger(L, _count);
- return true;
+ } else {
+ for (const auto &kind : kParticleStageKinds) {
+ if (key == kind[0]) {
+ lua_pushstring(L, kind[1]);
+ lua_pushcclosure(L, particleAddStage, 1);
+ return true;
+ }
+ }
+
+ return false;
}
- return false;
+ return true;
}
bool ParticleRecord::setField(const Common::String &key) {
+ lua_State *L = getLua();
+
if (key == "frequency") {
- _frequency = luaL_checknumber(getLua(), 3);
- return true;
+ _frequency = MAX(luaL_checknumber(L, 3), 0.0);
+ } else {
+ return false;
}
- return false;
+ return true;
}
// The particles are drawn on a picture as large as the viewport, which is
diff --git a/engines/nancy/script/particles.h b/engines/nancy/script/particles.h
index 843d2d340e8..ebdab36c87c 100644
--- a/engines/nancy/script/particles.h
+++ b/engines/nancy/script/particles.h
@@ -23,6 +23,7 @@
#define NANCY_SCRIPT_PARTICLES_H
#include "common/array.h"
+#include "common/hashmap.h"
#include "common/list.h"
#include "graphics/managed_surface.h"
@@ -65,6 +66,11 @@ struct Particle {
// what it gives every particle once, when the record is made, instead of every
// time a particle is made. The particles go through the "perspective"
// projection, so they get smaller further off.
+//
+// From Nancy1New on, the stages are added after the record is made, under names
+// of the scripts' choosing:
+//
+// snow:AddVelocity("velocityStage", { minSpeed = 300, ... })
class ParticleRecord : public Record {
public:
ParticleRecord(SceneContext &context) : Record(context, "ND.ParticleAR") {}
@@ -78,8 +84,13 @@ public:
double getLife() const { return _life; }
const Graphics::ManagedSurface &getImage() const { return _image; }
+ // Adds a stage of a kind ("velocity", "fade"...) under a name, read from the
+ // table at the given index
+ void addNamedStage(const Common::String &kind, const Common::String &name, int tableIndex);
+
protected:
void readTable(int tableIndex) override;
+ void runOnce() override;
void run(double sceneTime, double elapsedTime) override;
void onZChanged() override;
bool hasTransform() const override { return true; }
@@ -114,11 +125,15 @@ private:
ScriptMatrix _perspective;
bool _hasPerspective = false; // Nancy22 has particles without one
+ Common::HashMap<Common::String, ParticleStage *> _namedStages;
+
// Both keep what is left of the time after the last whole step or particle
double _stepClock = 0.0;
double _spawnClock = 0.0;
double _spawnTime = 0.0; // when the newest particles were made
+ double _fastForward = 0.0; // seconds to run through when the record starts
+
RecordGraphic *_canvas = nullptr;
};
Commit: 0505d9ca2a3c33d6494e23ae42045f08d87cae12
https://github.com/scummvm/scummvm/commit/0505d9ca2a3c33d6494e23ae42045f08d87cae12
Author: Filippos Karapetis (bluegr at gmail.com)
Date: 2026-10-31T10:44:10+02:00
Commit Message:
NANCY: NANCY23: Add Streams:GetTime
Streams:GetTime(stream) gives how long the scene of a stream has been
running, or -1 when there is none. The area manager of Nancy23 uses it
to tell whether the player is still in a place.
Changed paths:
engines/nancy/script/gameapi.cpp
engines/nancy/state/scenestream.cpp
engines/nancy/state/scenestream.h
diff --git a/engines/nancy/script/gameapi.cpp b/engines/nancy/script/gameapi.cpp
index 817b7cfdf82..04c64e6aafb 100644
--- a/engines/nancy/script/gameapi.cpp
+++ b/engines/nancy/script/gameapi.cpp
@@ -1466,6 +1466,13 @@ static int streamsGetScene(lua_State *L) {
return 1;
}
+// Streams:GetTime(stream), Nancy23: how long the scene of the stream has been
+// running, or -1 when there is none
+static int streamsGetTime(lua_State *L) {
+ lua_pushnumber(L, NancySceneState.getStreams().getSceneTime(luaL_checkstring(L, 2)));
+ return 1;
+}
+
// Streams:GetStreams(withUI), Nancy21: the names of the running streams, the
// main stream among them. The one of the UI is only in there when asked for.
static int streamsGetStreams(lua_State *L) {
@@ -1505,6 +1512,7 @@ static int streamsSetTransform(lua_State *L) {
static const luaL_Reg kStreamsFunctions[] = {
{ "__index", streamsIndex },
{ "GetScene", streamsGetScene },
+ { "GetTime", streamsGetTime },
{ "GetStreams", streamsGetStreams },
{ "GetZ", streamsGetZ },
{ "GetTransform", streamsGetTransform },
diff --git a/engines/nancy/state/scenestream.cpp b/engines/nancy/state/scenestream.cpp
index db69913f864..aacb02c2af5 100644
--- a/engines/nancy/state/scenestream.cpp
+++ b/engines/nancy/state/scenestream.cpp
@@ -551,6 +551,24 @@ Common::String SceneStreamManager::getSceneName(const Common::String &name) cons
return stream ? stream->getSceneName() : Common::String();
}
+double SceneStreamManager::getSceneTime(const Common::String &name) const {
+#ifdef ENABLE_NANCY_V4
+ const Script::SceneContext *scene = nullptr;
+ if (name.equalsIgnoreCase(kMainStreamName)) {
+ scene = NancySceneState.getScriptScene();
+ } else {
+ const SceneStream *stream = name.empty() ? _running : find(name);
+ scene = stream ? stream->getScriptScene() : nullptr;
+ }
+
+ if (scene) {
+ return scene->getTime();
+ }
+#endif
+
+ return -1.0;
+}
+
// Nancy17 takes an item out of the inventory while its scene is up, in a stream
// named after it. The item's scene doesn't put it back: the stream ending does.
static void returnViewedItem(const Common::String &streamName) {
diff --git a/engines/nancy/state/scenestream.h b/engines/nancy/state/scenestream.h
index c232b966327..9d71ae9251e 100644
--- a/engines/nancy/state/scenestream.h
+++ b/engines/nancy/state/scenestream.h
@@ -185,6 +185,11 @@ public:
void changeScene(const Common::String &name, const SceneChangeDescription &sceneDescription);
void changeScene(const Common::String &name, const Common::String &sceneName, uint16 frameID);
Common::String getSceneName(const Common::String &name) const;
+
+ // Nancy23: how long the scene the stream is in has been running, or -1 when
+ // there is none
+ double getSceneTime(const Common::String &name) const;
+
bool isRunning(const Common::String &name) const { return find(name) != nullptr; }
// The stream whose records are running or getting input; null for the main one
Commit: da3627ede703a202f85f732d59dce8b0d53ad7c7
https://github.com/scummvm/scummvm/commit/da3627ede703a202f85f732d59dce8b0d53ad7c7
Author: Filippos Karapetis (bluegr at gmail.com)
Date: 2026-10-31T10:44:12+02:00
Commit Message:
NANCY: NANCY19: Add Game.time
Game.time is how long the game has been played, as days, hours,
minutes, seconds and totalSeconds. Nancy23 uses it to tell the timers
of its text messages apart.
Changed paths:
engines/nancy/script/gameapi.cpp
diff --git a/engines/nancy/script/gameapi.cpp b/engines/nancy/script/gameapi.cpp
index 04c64e6aafb..da1e5b09db4 100644
--- a/engines/nancy/script/gameapi.cpp
+++ b/engines/nancy/script/gameapi.cpp
@@ -443,7 +443,6 @@ static const luaL_Reg kKeyFunctions[] = {
};
// Game
-// TODO: Game.time
// The two levels the game can be played at
static const uint kDifficultyJunior = 0;
@@ -457,6 +456,24 @@ static int gameIndex(lua_State *L) {
return 1;
}
+ // How long the game has been played, as { days, hours, minutes, seconds,
+ // totalSeconds }; the seconds have fractions
+ if (key == "time") {
+ const uint32 time = (uint32)NancySceneState._timers.lastTotalTime;
+ lua_createtable(L, 0, 5);
+ lua_pushinteger(L, time / 86400000);
+ lua_setfield(L, -2, "days");
+ lua_pushinteger(L, time / 3600000 % 24);
+ lua_setfield(L, -2, "hours");
+ lua_pushinteger(L, time / 60000 % 60);
+ lua_setfield(L, -2, "minutes");
+ lua_pushnumber(L, (time % 60000) / 1000.0);
+ lua_setfield(L, -2, "seconds");
+ lua_pushnumber(L, time / 1000.0);
+ lua_setfield(L, -2, "totalSeconds");
+ return 1;
+ }
+
// Nancy22: the name of the saved game that is being loaded, or nil
if (key == "loadName") {
const Common::String &name = NancySceneState.getLoadName();
Commit: 26a43c461b000d7f6b59c82a91a7ad9f28893bff
https://github.com/scummvm/scummvm/commit/26a43c461b000d7f6b59c82a91a7ad9f28893bff
Author: Filippos Karapetis (bluegr at gmail.com)
Date: 2026-10-31T10:44:13+02:00
Commit Message:
NANCY: NANCY23: Add Game.hourFormat
Game.hourFormat says whether the clock of the cell phone shows 12 or
24 hours. The original reads it from its INI file, where it is 12
unless changed, so it is 12 here.
Changed paths:
engines/nancy/script/gameapi.cpp
diff --git a/engines/nancy/script/gameapi.cpp b/engines/nancy/script/gameapi.cpp
index da1e5b09db4..89c5fd38d7f 100644
--- a/engines/nancy/script/gameapi.cpp
+++ b/engines/nancy/script/gameapi.cpp
@@ -474,6 +474,13 @@ static int gameIndex(lua_State *L) {
return 1;
}
+ // Nancy23: whether the clock of the cell phone shows 12 or 24 hours. The
+ // original takes it from ClockFormat in its INI file, which is 12 by default.
+ if (key == "hourFormat") {
+ lua_pushinteger(L, 12);
+ return 1;
+ }
+
// Nancy22: the name of the saved game that is being loaded, or nil
if (key == "loadName") {
const Common::String &name = NancySceneState.getLoadName();
Commit: c6a2fbbf458b4461baad19dca4149e447f53eeea
https://github.com/scummvm/scummvm/commit/c6a2fbbf458b4461baad19dca4149e447f53eeea
Author: Filippos Karapetis (bluegr at gmail.com)
Date: 2026-10-31T10:44:15+02:00
Commit Message:
NANCY: NANCY23: Implement Sound:StopIfPlaying
sound:StopIfPlaying() stops the channel of a Sound record, unless
another sound has started on it since. The sound system of Nancy23
stops the sounds it is done with this way.
Changed paths:
engines/nancy/script/records.cpp
engines/nancy/script/records.h
diff --git a/engines/nancy/script/records.cpp b/engines/nancy/script/records.cpp
index fed87622ddd..3b2abf01441 100644
--- a/engines/nancy/script/records.cpp
+++ b/engines/nancy/script/records.cpp
@@ -1537,10 +1537,25 @@ bool SoundRecord::setField(const Common::String &key) {
return true;
}
+// sound:StopIfPlaying(), Nancy23: stops the channel, unless another sound has
+// started on it since this one did
+static int soundStopIfPlaying(lua_State *L) {
+ ((SoundRecord *)checkRecord(L, 1))->stopIfPlaying();
+ return 0;
+}
+
+void SoundRecord::stopIfPlaying() {
+ if (_isPlaying && g_nancy->_sound->getChannelSerial(_channel) == _channelSerial) {
+ g_nancy->_sound->stopSound(_sound);
+ }
+}
+
bool SoundRecord::getField(const Common::String &key) {
lua_State *L = getLua();
- if (key == "channel") {
+ if (key == "StopIfPlaying") {
+ lua_pushcfunction(L, soundStopIfPlaying);
+ } else if (key == "channel") {
pushSoundChannel(L, _channel);
} else if (key == "volume") {
lua_pushnumber(L, _volume);
diff --git a/engines/nancy/script/records.h b/engines/nancy/script/records.h
index 145348b07c4..b0cb1834e7d 100644
--- a/engines/nancy/script/records.h
+++ b/engines/nancy/script/records.h
@@ -328,6 +328,7 @@ public:
void onSkip() override;
bool skipSpeech() override;
+ void stopIfPlaying();
protected:
void readTable(int tableIndex) override;
Commit: 91eedf66bbef06aa3172c4c3b1068ea7e6781ad1
https://github.com/scummvm/scummvm/commit/91eedf66bbef06aa3172c4c3b1068ea7e6781ad1
Author: Filippos Karapetis (bluegr at gmail.com)
Date: 2026-10-31T10:44:21+02:00
Commit Message:
NANCY: NANCY23: Add FastForward to Physics records
world:FastForward(seconds) takes the steps of that much time at once.
The bento box puzzle of Nancy23 shakes up its hint tiles with it
before the player sees them.
Changed paths:
engines/nancy/script/physics.cpp
engines/nancy/script/physics.h
diff --git a/engines/nancy/script/physics.cpp b/engines/nancy/script/physics.cpp
index 934a104982d..4758060c038 100644
--- a/engines/nancy/script/physics.cpp
+++ b/engines/nancy/script/physics.cpp
@@ -242,8 +242,12 @@ void PhysicsRecord::run(double sceneTime, double elapsedTime) {
return;
}
- // The steps that are due by now
- _stepClock += elapsedTime;
+ advance(elapsedTime);
+}
+
+// Takes the steps that are due after that much more time
+void PhysicsRecord::advance(double seconds) {
+ _stepClock += seconds;
const int numSteps = (int)(_stepClock * _stepsPerSecond);
const float32 stepTime = (float32)(1.0 / _stepsPerSecond);
@@ -373,12 +377,21 @@ static int physicsDestroyJoint(lua_State *L) {
return 0;
}
+// world:FastForward(seconds), Nancy23, takes the steps of that much time at
+// once. The puzzle with the bento box shakes up its hint tiles with it.
+static int physicsFastForward(lua_State *L) {
+ PhysicsRecord *record = (PhysicsRecord *)checkRecord(L, 1);
+ record->advance(luaL_checknumber(L, 2));
+ return 0;
+}
+
bool PhysicsRecord::getField(const Common::String &key) {
static const luaL_Reg kWorldFunctions[] = {
{ "CreateBody", physicsCreateBody },
{ "DestroyBody", physicsDestroyBody },
{ "CreateJoint", physicsCreateJoint },
{ "DestroyJoint", physicsDestroyJoint },
+ { "FastForward", physicsFastForward },
{ nullptr, nullptr }
};
diff --git a/engines/nancy/script/physics.h b/engines/nancy/script/physics.h
index 99a1ba40aa3..2868a70a133 100644
--- a/engines/nancy/script/physics.h
+++ b/engines/nancy/script/physics.h
@@ -107,6 +107,9 @@ public:
void onContact(b2Shape *a, b2Shape *b, double x, double y);
void onContactResolved(b2Shape *a, b2Shape *b, double x, double y, double impulse);
+ // Nancy22: the world steps a fixed number of times a second
+ void advance(double seconds);
+
protected:
void readTable(int tableIndex) override;
void run(double sceneTime, double elapsedTime) override;
Commit: 413ffea46c893266e4c07c05746f5b2924906b3a
https://github.com/scummvm/scummvm/commit/413ffea46c893266e4c07c05746f5b2924906b3a
Author: Filippos Karapetis (bluegr at gmail.com)
Date: 2026-10-31T10:44:24+02:00
Commit Message:
NANCY: NANCY23: Load the font files that come with the game
FontsInit:CustomFonts names font files of the game folder. A font of
the scripts whose Windows name is the name of such a file now uses
it, e.g. Nancy23's Digital Display2.ttf.
Changed paths:
engines/nancy/enginedata.h
engines/nancy/font.cpp
engines/nancy/font.h
engines/nancy/graphics.cpp
engines/nancy/script/bootapi.cpp
diff --git a/engines/nancy/enginedata.h b/engines/nancy/enginedata.h
index 8df80eb44d3..e7d7a76781e 100644
--- a/engines/nancy/enginedata.h
+++ b/engines/nancy/enginedata.h
@@ -1165,6 +1165,10 @@ struct ScriptBootData : public EngineData {
Common::Array<SystemFont> fonts;
Common::Array<FontColor> fontColors;
+ // Nancy23: font files of the game folder, which the fonts named like them
+ // use in place of a Windows font
+ Common::Array<Common::String> customFontFiles;
+
Common::Array<Player> players; // in the order of PCUI::characters
// Nancy1New names every value (VarTable) and text (StrTable) the scripts
diff --git a/engines/nancy/font.cpp b/engines/nancy/font.cpp
index 24c77501a6c..2a8f23361bd 100644
--- a/engines/nancy/font.cpp
+++ b/engines/nancy/font.cpp
@@ -19,6 +19,8 @@
*
*/
+#include "common/file.h"
+
#include "graphics/fontman.h"
#include "graphics/fonts/ttf.h"
@@ -196,12 +198,28 @@ void Font::readSystemFont(Common::SeekableReadStream &stream, bool bold) {
setSystemFont(name, faceName, height, weight);
}
-void Font::setSystemFont(const Common::String &name, const Common::String &faceName, int32 height, int32 weight) {
+void Font::setSystemFont(const Common::String &name, const Common::String &faceName, int32 height, int32 weight, const Common::Path &fileName) {
_description = name;
+#ifdef USE_FREETYPE2
+ // A font file that comes with the game takes the place of the Windows font
+ if (!fileName.empty()) {
+ Common::File *file = new Common::File();
+ if (file->open(fileName)) {
+ _systemFont.reset(Graphics::loadTTFFont(file, DisposeAfterUse::YES, height, Graphics::kTTFSizeModeCell), DisposeAfterUse::YES);
+ } else {
+ delete file;
+ }
+
+ if (_systemFont) {
+ return;
+ }
+
+ warning("Could not load font file %s", fileName.toString().c_str());
+ }
+
// None of the Windows fonts the game asks for (Tahoma, Arial, Lucida Handwriting)
// ship with ScummVM, so they all get replaced with the same sans-serif font
-#ifdef USE_FREETYPE2
const int32 kBoldWeight = 700;
const char *substitute = weight >= kBoldWeight ? "LiberationSans-Bold.ttf" : "LiberationSans-Regular.ttf";
_systemFont.reset(Graphics::loadTTFFontFromArchive(substitute, height, Graphics::kTTFSizeModeCell), DisposeAfterUse::YES);
diff --git a/engines/nancy/font.h b/engines/nancy/font.h
index f342b570cda..626ee16eaed 100644
--- a/engines/nancy/font.h
+++ b/engines/nancy/font.h
@@ -22,6 +22,7 @@
#define NANCY_FONT_H
#include "common/array.h"
+#include "common/path.h"
#include "common/ptr.h"
#include "graphics/font.h"
@@ -48,7 +49,8 @@ public:
// The color passed when drawing is then a font color ID. Every font also
// comes in bold, which gets "_Bold" added to its name.
void readSystemFont(Common::SeekableReadStream &stream, bool bold);
- void setSystemFont(const Common::String &name, const Common::String &faceName, int32 height, int32 weight);
+ // A font file of the game folder stands in for the Windows font when given
+ void setSystemFont(const Common::String &name, const Common::String &faceName, int32 height, int32 weight, const Common::Path &fileName = Common::Path());
const Common::String &getName() const { return _description; }
// Nancy16+: the substitute font, for drawing with an explicit color instead of a color ID
const Graphics::Font *getSystemFont() const { return _systemFont.get(); }
diff --git a/engines/nancy/graphics.cpp b/engines/nancy/graphics.cpp
index be0e6e4af6d..6cf4abdd77b 100644
--- a/engines/nancy/graphics.cpp
+++ b/engines/nancy/graphics.cpp
@@ -449,6 +449,24 @@ void GraphicsManager::loadSystemFonts(const IFF &fontIFF) {
}
}
+// The font file of the game folder a face is in, if any. The face in the one
+// file Nancy23 has, "Digital Display2.ttf", is named after the file.
+static Common::Path findCustomFontFile(const ScriptBootData &boot, const Common::String &faceName) {
+ for (const Common::String &fileName : boot.customFontFiles) {
+ Common::String baseName = fileName;
+ const size_t dot = baseName.findLastOf('.');
+ if (dot != Common::String::npos) {
+ baseName.erase(dot);
+ }
+
+ if (baseName.equalsIgnoreCase(faceName)) {
+ return Common::Path(fileName);
+ }
+ }
+
+ return Common::Path();
+}
+
void GraphicsManager::loadSystemFonts(const ScriptBootData &boot) {
const int32 kNormalWeight = 400;
const int32 kBoldWeight = 700;
@@ -462,13 +480,15 @@ void GraphicsManager::loadSystemFonts(const ScriptBootData &boot) {
_fonts.resize(font.id + 1);
}
- _fonts[font.id].setSystemFont(font.name, font.faceName, font.height, font.isBold ? kBoldWeight : kNormalWeight);
+ _fonts[font.id].setSystemFont(font.name, font.faceName, font.height, font.isBold ? kBoldWeight : kNormalWeight,
+ findCustomFontFile(boot, font.faceName));
}
// Every font also comes in bold, after the ones with a number of their own
for (const ScriptBootData::SystemFont &font : boot.fonts) {
_fonts.resize(_fonts.size() + 1);
- _fonts.back().setSystemFont(font.name + "_Bold", font.faceName, font.height, kBoldWeight);
+ _fonts.back().setSystemFont(font.name + "_Bold", font.faceName, font.height, kBoldWeight,
+ findCustomFontFile(boot, font.faceName));
}
for (const ScriptBootData::FontColor &color : boot.fontColors) {
diff --git a/engines/nancy/script/bootapi.cpp b/engines/nancy/script/bootapi.cpp
index 8222a329c11..bf69bc454d0 100644
--- a/engines/nancy/script/bootapi.cpp
+++ b/engines/nancy/script/bootapi.cpp
@@ -521,6 +521,27 @@ static int fontsCreate(lua_State *L) {
return 0;
}
+// FontsInit:CustomFonts({ file, ... }), Nancy23, which makes the fonts in the
+// files known before the fonts get made
+static int fontsCustomFonts(lua_State *L) {
+ checkUserData(L, 1, "ND.FontsInit");
+ if (!lua_istable(L, 2)) {
+ luaL_argerror(L, 2, "Expected parameter to be a table");
+ }
+
+ if (!s_tables || !s_tables->boot) {
+ luaL_error(L, "ND.FontsInit cannot be used by this script");
+ }
+
+ lua_pushnil(L);
+ while (lua_next(L, 2)) {
+ s_tables->boot->customFontFiles.push_back(luaL_checkstring(L, -1));
+ lua_pop(L, 1);
+ }
+
+ return 0;
+}
+
static uint32 readColorField(lua_State *L, int tableIndex, const char *name) {
uint32 color = 0;
if (pushField(L, tableIndex, name)) {
@@ -591,7 +612,6 @@ static const InitObject kInitObjects[] = {
{ "VarTableInit", "ND.VarTableInit", varTableCreate },
{ "StrTableInit", "ND.StrTableInit", strTableCreate },
{ "InventoryInit", "ND.InventoryInit", inventoryCreate },
- { "FontsInit", "ND.FontsInit", fontsCreate },
{ "ColorsInit", "ND.ColorsInit", colorsCreate },
{ "AutotextInit", "ND.AutotextInit", autotextCreate }
};
@@ -634,6 +654,15 @@ void registerBootAPI(lua_State *L) {
};
registerGlobal(L, "CursorInit", "ND.CursorInit", kCursorInitFunctions);
+
+ static const luaL_Reg kFontsInitFunctions[] = {
+ { "__index", indexFunctions },
+ { "Create", fontsCreate },
+ { "CustomFonts", fontsCustomFonts },
+ { nullptr, nullptr }
+ };
+
+ registerGlobal(L, "FontsInit", "ND.FontsInit", kFontsInitFunctions);
}
} // End of namespace Script
Commit: 32c7361c4098b67372dc9d7e400e6f01ad0c9910
https://github.com/scummvm/scummvm/commit/32c7361c4098b67372dc9d7e400e6f01ad0c9910
Author: Filippos Karapetis (bluegr at gmail.com)
Date: 2026-10-31T10:44:27+02:00
Commit Message:
NANCY: NANCY23: Let Ref:Add load pictures the camera took
ref:Add now takes the tree of the image too, so a Ref can hold a
picture the camera took. The calligraphy puzzle of Nancy23 looks at a
picture of what the player drew this way.
Changed paths:
engines/nancy/script/records.cpp
engines/nancy/script/records.h
engines/nancy/script/ref.cpp
diff --git a/engines/nancy/script/records.cpp b/engines/nancy/script/records.cpp
index 3b2abf01441..7acc4faff3a 100644
--- a/engines/nancy/script/records.cpp
+++ b/engines/nancy/script/records.cpp
@@ -978,7 +978,7 @@ bool OverrideRecord::setField(const Common::String &key) {
// the saved game
static const char *const kPictureTreeName = "LOADSAVE";
-static bool loadOverlayImage(const Common::String &name, const Common::String &treeName, Graphics::ManagedSurface &image) {
+bool loadTreeImage(const Common::String &name, const Common::String &treeName, Graphics::ManagedSurface &image) {
if (!treeName.equalsIgnoreCase(kPictureTreeName)) {
return g_nancy->_resource->loadImage(Common::Path(name), image, treeName);
}
@@ -1019,7 +1019,7 @@ void OverlayRecord::readTable(int tableIndex) {
Common::String treeName;
readField(L, tableIndex, "tree", treeName);
- if (!loadOverlayImage(imageName, treeName, _image)) {
+ if (!loadTreeImage(imageName, treeName, _image)) {
luaL_error(L, "Could not load overlay %s", imageName.c_str());
}
@@ -1222,7 +1222,7 @@ void AnimOverlayRecord::readTable(int tableIndex) {
Common::String treeName;
readField(L, tableIndex, "tree", treeName);
- if (!loadOverlayImage(imageName, treeName, _image)) {
+ if (!loadTreeImage(imageName, treeName, _image)) {
luaL_error(L, "Could not load overlay %s", imageName.c_str());
}
diff --git a/engines/nancy/script/records.h b/engines/nancy/script/records.h
index b0cb1834e7d..d0ab1a6a437 100644
--- a/engines/nancy/script/records.h
+++ b/engines/nancy/script/records.h
@@ -240,6 +240,9 @@ private:
Common::String _messagingName; // Nancy22, from SetMessagingName
};
+// Loads an image from a tree, or a picture the camera took from the "LOADSAVE" one
+bool loadTreeImage(const Common::String &name, const Common::String &treeName, Graphics::ManagedSurface &image);
+
// Shows a part of an image
class OverlayRecord : public Record {
public:
diff --git a/engines/nancy/script/ref.cpp b/engines/nancy/script/ref.cpp
index 41d5967d4f4..2f037c99860 100644
--- a/engines/nancy/script/ref.cpp
+++ b/engines/nancy/script/ref.cpp
@@ -26,6 +26,7 @@
#include "engines/nancy/script/api.h"
#include "engines/nancy/script/luabind.h"
+#include "engines/nancy/script/records.h"
#include "engines/nancy/script/ref.h"
#include "engines/nancy/script/types.h"
@@ -108,10 +109,10 @@ static ScriptRef *checkRef(lua_State *L, int index) {
// Puts an image into a Nancy20 Ref, unless it would overlap one that is in it
// already. An empty rectangle stands for the size of the image.
-static bool addRefLayer(ScriptRef &ref, const Common::String &imageName, const ScriptRect &rect) {
+static bool addRefLayer(ScriptRef &ref, const Common::String &imageName, const Common::String &treeName, const ScriptRect &rect) {
ScriptRef::Layer *layer = new ScriptRef::Layer();
layer->image.edgeMode = ref.edgeMode;
- if (!g_nancy->_resource->loadImage(Common::Path(imageName), layer->image.image)) {
+ if (!loadTreeImage(imageName, treeName, layer->image.image)) {
warning("Could not load Ref %s", imageName.c_str());
}
@@ -166,7 +167,7 @@ static int refNew(lua_State *L) {
Common::String imageName;
if (readField(L, 2, "ref", imageName)) {
- addRefLayer(*ref, imageName, ScriptRect());
+ addRefLayer(*ref, imageName, Common::String(), ScriptRect());
}
} else {
const char *imageName = luaL_checkstring(L, 2);
@@ -198,13 +199,22 @@ static int refCollect(lua_State *L) {
}
// ref:Add(image, rect), Nancy20. Returns false when the image would overlap
-// one that is in the Ref already.
+// one that is in the Ref already. Nancy23 names the tree of the image too,
+// ref:Add(image, tree, rect), which lets the calligraphy puzzle look at a
+// picture the camera took of what the player drew.
static int refAdd(lua_State *L) {
ScriptRef *ref = checkRef(L, 1);
const char *imageName = luaL_checkstring(L, 2);
- const ScriptRect &rect = checkRect(L, 3);
- lua_pushboolean(L, addRefLayer(*ref, imageName, rect));
+ Common::String treeName;
+ int rectIndex = 3;
+ if (g_nancy->getGameType() >= kGameTypeNancy23) {
+ treeName = luaL_checkstring(L, 3);
+ rectIndex = 4;
+ }
+
+ const ScriptRect &rect = checkRect(L, rectIndex);
+ lua_pushboolean(L, addRefLayer(*ref, imageName, treeName, rect));
return 1;
}
Commit: 739d79bbfb62b3929364cf4948e195ec84b21337
https://github.com/scummvm/scummvm/commit/739d79bbfb62b3929364cf4948e195ec84b21337
Author: Filippos Karapetis (bluegr at gmail.com)
Date: 2026-10-31T10:44:29+02:00
Commit Message:
NANCY: NANCY23: Implement Ref:Difference
ref:Difference compares a picture of what the player drew with the
empty paper, and counts where they match and differ against the
solution. Nancy23 grades the strokes of its calligraphy puzzle
(scene 3199) with it.
Changed paths:
engines/nancy/script/ref.cpp
diff --git a/engines/nancy/script/ref.cpp b/engines/nancy/script/ref.cpp
index 2f037c99860..c3958335036 100644
--- a/engines/nancy/script/ref.cpp
+++ b/engines/nancy/script/ref.cpp
@@ -363,6 +363,148 @@ static int refSampleArea(lua_State *L) {
return 1;
}
+// The one image of a Ref that the rectangle is in, for Difference
+static const RefImage *findDifferenceImage(const ScriptRef &ref, const ScriptRect &rect) {
+ if (ref.layers.size() != 1) {
+ return nullptr;
+ }
+
+ const ScriptRect &layerRect = ref.layers[0]->rect;
+ if (rect.left < layerRect.left || rect.top < layerRect.top || rect.right > layerRect.right || rect.bottom > layerRect.bottom) {
+ return nullptr;
+ }
+
+ return &ref.layers[0]->image;
+}
+
+// The pixel of an image at a place, taking the nearest one for those outside it
+static uint32 getClampedPixel(const RefImage &image, int x, int y) {
+ uint32 pixel = 0;
+ const Graphics::ManagedSurface &surface = image.image;
+ if (surface.w > 0 && surface.h > 0) {
+ byte a, r, g, b;
+ surface.format.colorToARGB(surface.getPixel(CLIP<int>(x, 0, surface.w - 1), CLIP<int>(y, 0, surface.h - 1)), a, r, g, b);
+ pixel = ((uint32)a << 24) | ((uint32)r << 16) | ((uint32)g << 8) | b;
+ }
+
+ return pixel;
+}
+
+// ref:Difference({ source, before, beforeRect, beforeColor, after, afterRect,
+// afterColor, tolerance }), Nancy23, which grades a stroke of the calligraphy
+// puzzle. This Ref is the solution: where it has the before color, the "before"
+// image (the empty paper) and the "after" one (a picture of what the player
+// drew) have to match; where it has the after color, they have to differ. Two
+// pixels differ when three times the difference of their blue is over the
+// tolerance. Gives back { beforePass, beforeFail, afterPass, afterFail }, the
+// counts of the pixels that did and didn't.
+static int refDifference(lua_State *L) {
+ const ScriptRef *ref = checkRef(L, 1);
+ luaL_checktype(L, 2, LUA_TTABLE);
+
+ ScriptRect rects[3];
+ static const char *const kRectNames[3] = { "beforeRect", "afterRect", "source" };
+ for (int i = 0; i < 3; ++i) {
+ const ScriptRect *rect = pushField(L, 2, kRectNames[i]) ? testRect(L, -1) : nullptr;
+ if (!rect) {
+ return luaL_error(L, "Table must have an '%s' field that is a Rect", kRectNames[i]);
+ }
+
+ rects[i] = *rect;
+ lua_pop(L, 1);
+ }
+
+ const ScriptRef *refs[2];
+ static const char *const kRefNames[2] = { "before", "after" };
+ for (int i = 0; i < 2; ++i) {
+ ScriptRef **object = pushField(L, 2, kRefNames[i]) ? (ScriptRef **)testUserData(L, -1, kRefType) : nullptr;
+ if (!object) {
+ return luaL_error(L, "Table must have a '%s' field that is a Ref", kRefNames[i]);
+ }
+
+ refs[i] = *object;
+ lua_pop(L, 1);
+ }
+
+ uint32 colors[2];
+ static const char *const kColorNames[2] = { "beforeColor", "afterColor" };
+ for (int i = 0; i < 2; ++i) {
+ const uint32 *color = pushField(L, 2, kColorNames[i]) ? testColor(L, -1) : nullptr;
+ if (!color) {
+ return luaL_error(L, "Table must have a '%s' field that is a Color", kColorNames[i]);
+ }
+
+ colors[i] = *color & 0xFFFFFF;
+ lua_pop(L, 1);
+ }
+
+ if (!pushField(L, 2, "tolerance") || !lua_isnumber(L, -1)) {
+ return luaL_argerror(L, 2, "Table must have a 'tolerance' field that is a number");
+ }
+
+ const double tolerance = lua_tonumber(L, -1);
+ lua_pop(L, 1);
+
+ const ScriptRect &beforeRect = rects[0];
+ const ScriptRect &afterRect = rects[1];
+ const ScriptRect &source = rects[2];
+ if (source.width() != beforeRect.width() || source.height() != beforeRect.height() ||
+ source.width() != afterRect.width() || source.height() != afterRect.height()) {
+ return luaL_argerror(L, 2, "source, beforeRect and afterRect rects must have same width/height");
+ }
+
+ const RefImage *solution = findDifferenceImage(*ref, source);
+ if (!solution) {
+ return luaL_argerror(L, 2, "Ref object must have one tile that contains the source rect");
+ }
+
+ const RefImage *before = findDifferenceImage(*refs[0], beforeRect);
+ if (!before) {
+ return luaL_argerror(L, 2, "'before' ref object must have one tile that contains the beforeRect rect");
+ }
+
+ const RefImage *after = findDifferenceImage(*refs[1], afterRect);
+ if (!after) {
+ return luaL_argerror(L, 2, "'after' ref object must have one tile that contains the afterRect rect");
+ }
+
+ // The places are in the pixels of the images themselves
+ int beforePass = 0, beforeFail = 0, afterPass = 0, afterFail = 0;
+ for (int y = 0; y < source.height(); ++y) {
+ for (int x = 0; x < source.width(); ++x) {
+ const uint32 expected = getClampedPixel(*solution, source.left + x, source.top + y) & 0xFFFFFF;
+ const int blueBefore = getClampedPixel(*before, beforeRect.left + x, beforeRect.top + y) & 0xFF;
+ const int blueAfter = getClampedPixel(*after, afterRect.left + x, afterRect.top + y) & 0xFF;
+ const bool differs = ABS(blueBefore - blueAfter) * 3 > tolerance;
+
+ if (expected == colors[0]) {
+ if (differs) {
+ ++beforeFail;
+ } else {
+ ++beforePass;
+ }
+ } else if (expected == colors[1]) {
+ if (differs) {
+ ++afterPass;
+ } else {
+ ++afterFail;
+ }
+ }
+ }
+ }
+
+ lua_createtable(L, 0, 4);
+ lua_pushinteger(L, beforePass);
+ lua_setfield(L, -2, "beforePass");
+ lua_pushinteger(L, beforeFail);
+ lua_setfield(L, -2, "beforeFail");
+ lua_pushinteger(L, afterPass);
+ lua_setfield(L, -2, "afterPass");
+ lua_pushinteger(L, afterFail);
+ lua_setfield(L, -2, "afterFail");
+ return 1;
+}
+
void registerRefAPI(lua_State *L) {
static const luaL_Reg kRefFunctions[] = {
{ "__index", indexFunctions },
@@ -375,6 +517,7 @@ void registerRefAPI(lua_State *L) {
{ "IsInArea", refIsInArea },
{ "IsOpaqueInArea", refIsOpaqueInArea },
{ "SampleArea", refSampleArea },
+ { "Difference", refDifference },
{ nullptr, nullptr }
};
Commit: 98dbec6a04d9eb387703b68f75d456c334dc468a
https://github.com/scummvm/scummvm/commit/98dbec6a04d9eb387703b68f75d456c334dc468a
Author: Filippos Karapetis (bluegr at gmail.com)
Date: 2026-10-31T10:44:31+02:00
Commit Message:
NANCY: NANCY23: Draw the calligraphy with particles
The calligraphy puzzle of Nancy23 (scene 3199) draws the ink with a
particle record that stands still, and moves it on whenever the brush
moves. The new path stage makes particles along the line from where it
was to where it is now, so the brush leaves a trail of ink.
- The record hands a stage back by its name, and the position, scale
and alpha of the path stage can be read and set
- paused stops the record, and FastForward(seconds) runs it at once
- timestep is the length of a step of the simulation
Changed paths:
engines/nancy/script/api.cpp
engines/nancy/script/particles.cpp
engines/nancy/script/particles.h
diff --git a/engines/nancy/script/api.cpp b/engines/nancy/script/api.cpp
index f8ef2ddc117..cbedf48ff89 100644
--- a/engines/nancy/script/api.cpp
+++ b/engines/nancy/script/api.cpp
@@ -27,6 +27,7 @@
#include "engines/nancy/script/graphnode.h"
#include "engines/nancy/script/luabind.h"
#include "engines/nancy/script/mathtypes.h"
+#include "engines/nancy/script/particles.h"
#include "engines/nancy/script/physics.h"
#include "engines/nancy/script/record.h"
#include "engines/nancy/script/types.h"
@@ -85,6 +86,7 @@ void registerAPI(lua_State *L) {
registerGameAPI(L);
registerGraphNodeAPI(L);
registerPhysicsAPI(L);
+ registerParticleAPI(L);
registerUIAPI(L);
registerConvoAPI(L);
registerRecordAPI(L);
diff --git a/engines/nancy/script/particles.cpp b/engines/nancy/script/particles.cpp
index 558a4662e38..db31565718b 100644
--- a/engines/nancy/script/particles.cpp
+++ b/engines/nancy/script/particles.cpp
@@ -85,6 +85,11 @@ public:
virtual void update(uint first, uint count) {}
+ // The fields scripts can read and set on a stage they got back by name; the
+ // new value of a set is at the top of the stack
+ virtual bool getField(lua_State *L, const Common::String &key) { return false; }
+ virtual bool setField(lua_State *L, const Common::String &key) { return false; }
+
protected:
virtual void initParticles(uint first, uint count) {}
@@ -559,6 +564,94 @@ private:
double _friction = 0.0;
};
+// "path", Nancy23: the particles are made along the line from where the stage
+// was before to where it is now, spread evenly, with sizes and alphas (0 to 1)
+// in between too. Setting one of the three moves its current value to the one
+// before, so a script that keeps moving the stage leaves a trail of particles.
+class ParticlePathStage : public ParticleStage {
+public:
+ ParticlePathStage(ParticleRecord &record, lua_State *L, int tableIndex) : ParticleStage(record) {
+ if (readVectorField(L, tableIndex, "position", _position[1], 3)) {
+ memcpy(_position[0], _position[1], sizeof(_position[0]));
+ }
+
+ if (readField(L, tableIndex, "scale", _scale[1])) {
+ _scale[0] = _scale[1];
+ }
+
+ if (readField(L, tableIndex, "alpha", _alpha[1])) {
+ _alpha[0] = _alpha[1];
+ }
+ }
+
+ bool getField(lua_State *L, const Common::String &key) override {
+ if (key == "position") {
+ pushVector(L, ScriptVector(_position[1][0], _position[1][1], _position[1][2]));
+ } else if (key == "scale") {
+ lua_pushnumber(L, _scale[1]);
+ } else if (key == "alpha") {
+ lua_pushnumber(L, _alpha[1]);
+ } else {
+ return false;
+ }
+
+ return true;
+ }
+
+ bool setField(lua_State *L, const Common::String &key) override {
+ if (key == "position") {
+ const ScriptVector *vector = testVector(L, -1);
+ if (!vector) {
+ luaL_typerror(L, -1, "Vector");
+ }
+
+ memcpy(_position[0], _position[1], sizeof(_position[0]));
+ for (int i = 0; i < 3; ++i) {
+ _position[1][i] = vector->v[i];
+ }
+ } else if (key == "scale") {
+ _scale[0] = _scale[1];
+ _scale[1] = luaL_checknumber(L, -1);
+ } else if (key == "alpha") {
+ _alpha[0] = _alpha[1];
+ _alpha[1] = luaL_checknumber(L, -1);
+ } else {
+ return false;
+ }
+
+ return true;
+ }
+
+protected:
+ // The last of the new particles is at the current place
+ void initParticles(uint first, uint count) override {
+ const double step = 1.0 / MAX<uint>(count, 1);
+ const int fromAlpha = (int)floor(_alpha[0] * 255.0 + 0.5);
+ const int toAlpha = (int)floor(_alpha[1] * 255.0 + 0.5);
+
+ double fraction = 0.0;
+ for (uint i = first; i < first + count; ++i) {
+ fraction += step;
+
+ Particle &particle = _record.getParticle(i);
+ for (int j = 0; j < 3; ++j) {
+ particle.position[j] = lerp(_position[0][j], _position[1][j], fraction);
+ }
+
+ particle.scale = lerp(_scale[0], _scale[1], fraction);
+
+ const int weight = (int)floor(fraction * 255.0 + 0.5);
+ const uint32 alpha = (uint32)CLIP<int>(((255 - weight) * fromAlpha + weight * toAlpha) >> 8, 0, 255);
+ particle.color = (particle.color & 0xFFFFFF) | (alpha << 24);
+ }
+ }
+
+private:
+ double _position[2][3] = { { 0.0, 0.0, 0.0 }, { 0.0, 0.0, 0.0 } }; // before and now
+ double _scale[2] = { 1.0, 1.0 };
+ double _alpha[2] = { 1.0, 1.0 };
+};
+
// TODO: The "script" and "revolve" stages, which no script uses
static ParticleStage *makeStage(ParticleRecord &record, lua_State *L, int tableIndex, const Common::String &name) {
if (name == "positionPerspective") {
@@ -585,6 +678,8 @@ static ParticleStage *makeStage(ParticleRecord &record, lua_State *L, int tableI
return new ParticleForceStage(record, L, tableIndex);
} else if (name == "turbulence") {
return new ParticleTurbulenceStage(record, L, tableIndex);
+ } else if (name == "path") {
+ return new ParticlePathStage(record, L, tableIndex);
}
luaL_error(L, "Stage name '%s' does not match a known stage", name.c_str());
@@ -659,6 +754,8 @@ void ParticleRecord::readTable(int tableIndex) {
if (g_nancy->getGameType() < kGameTypeNancy1New && _fastForward > 0.0) {
simulate(_fastForward);
}
+
+ readField(L, tableIndex, "paused", _isPaused);
}
void ParticleRecord::addStage(ParticleStage *stage) {
@@ -678,13 +775,15 @@ void ParticleRecord::addNamedStage(const Common::String &kind, const Common::Str
}
void ParticleRecord::runOnce() {
- if (g_nancy->getGameType() >= kGameTypeNancy1New && _fastForward > 0.0) {
+ if (g_nancy->getGameType() >= kGameTypeNancy1New && _fastForward > 0.0 && !_isPaused) {
simulate(_fastForward);
}
}
void ParticleRecord::run(double sceneTime, double elapsedTime) {
- simulate(elapsedTime);
+ if (!_isPaused) {
+ simulate(elapsedTime);
+ }
}
// Steps through the given time, 30 steps a second. What is left over counts
@@ -794,6 +893,21 @@ void ParticleRecord::onZChanged() {
}
}
+// What a stage that a script got back by name holds
+struct ParticleStageHandle {
+ ParticleStage *stage;
+};
+
+static const char *const kParticleStageType = "ND.ParticleStage";
+
+// record:FastForward(seconds), Nancy23, runs the simulation through that time
+// at once, even while the record is paused
+static int particleFastForward(lua_State *L) {
+ ParticleRecord *record = (ParticleRecord *)checkRecord(L, 1);
+ record->simulate(luaL_checknumber(L, 2));
+ return 0;
+}
+
// record:Add<Stage>(name, table), Nancy1New; the kind of stage is the upvalue
static int particleAddStage(lua_State *L) {
ParticleRecord *record = (ParticleRecord *)checkRecord(L, 1);
@@ -816,7 +930,8 @@ static const char *const kParticleStageKinds[][2] = {
{ "AddScale", "scale" },
{ "AddSources", "sources" },
{ "AddTurbulence", "turbulence" },
- { "AddVelocity", "velocity" }
+ { "AddVelocity", "velocity" },
+ { "AddPath", "path" }
};
bool ParticleRecord::getField(const Common::String &key) {
@@ -826,6 +941,13 @@ bool ParticleRecord::getField(const Common::String &key) {
lua_pushnumber(L, _frequency);
} else if (key == "count") {
lua_pushinteger(L, _count);
+ } else if (key == "paused") {
+ lua_pushboolean(L, _isPaused);
+ } else if (key == "timestep") {
+ // Nancy23: the length of a step of the simulation
+ lua_pushnumber(L, 1.0 / kStepsPerSecond);
+ } else if (key == "FastForward") {
+ lua_pushcfunction(L, particleFastForward);
} else {
for (const auto &kind : kParticleStageKinds) {
if (key == kind[0]) {
@@ -835,7 +957,14 @@ bool ParticleRecord::getField(const Common::String &key) {
}
}
- return false;
+ ParticleStage *stage = _namedStages.getValOrDefault(key, nullptr);
+ if (!stage) {
+ return false;
+ }
+
+ ParticleStageHandle handle;
+ handle.stage = stage;
+ pushValue(L, kParticleStageType, handle);
}
return true;
@@ -846,6 +975,8 @@ bool ParticleRecord::setField(const Common::String &key) {
if (key == "frequency") {
_frequency = MAX(luaL_checknumber(L, 3), 0.0);
+ } else if (key == "paused") {
+ _isPaused = lua_toboolean(L, 3) != 0;
} else {
return false;
}
@@ -853,6 +984,39 @@ bool ParticleRecord::setField(const Common::String &key) {
return true;
}
+static int particleStageIndex(lua_State *L) {
+ const ParticleStageHandle &handle = *(const ParticleStageHandle *)checkUserData(L, 1, kParticleStageType);
+ const Common::String key = luaL_checkstring(L, 2);
+
+ if (!handle.stage->getField(L, key)) {
+ return luaL_error(L, "Object %s does not have field '%s'", kParticleStageType, key.c_str());
+ }
+
+ return 1;
+}
+
+static int particleStageNewIndex(lua_State *L) {
+ const ParticleStageHandle &handle = *(const ParticleStageHandle *)checkUserData(L, 1, kParticleStageType);
+ const Common::String key = luaL_checkstring(L, 2);
+
+ lua_settop(L, 3);
+ if (!handle.stage->setField(L, key)) {
+ return luaL_error(L, "Object %s does not have field '%s'", kParticleStageType, key.c_str());
+ }
+
+ return 0;
+}
+
+void registerParticleAPI(lua_State *L) {
+ static const luaL_Reg kParticleStageFunctions[] = {
+ { "__index", particleStageIndex },
+ { "__newindex", particleStageNewIndex },
+ { nullptr, nullptr }
+ };
+
+ registerType(L, kParticleStageType, kParticleStageFunctions);
+}
+
// The particles are drawn on a picture as large as the viewport, which is
// started over every frame
void ParticleRecord::updateGraphics() {
diff --git a/engines/nancy/script/particles.h b/engines/nancy/script/particles.h
index ebdab36c87c..5a351e304f4 100644
--- a/engines/nancy/script/particles.h
+++ b/engines/nancy/script/particles.h
@@ -68,9 +68,13 @@ struct Particle {
// projection, so they get smaller further off.
//
// From Nancy1New on, the stages are added after the record is made, under names
-// of the scripts' choosing:
+// of the scripts' choosing, and the record hands them back by those names:
//
// snow:AddVelocity("velocityStage", { minSpeed = 300, ... })
+// snow.velocityStage
+//
+// Nancy23 draws the calligraphy puzzle with particles: a paused record whose
+// "path" stage follows the brush, and that the script steps with FastForward.
class ParticleRecord : public Record {
public:
ParticleRecord(SceneContext &context) : Record(context, "ND.ParticleAR") {}
@@ -84,6 +88,9 @@ public:
double getLife() const { return _life; }
const Graphics::ManagedSurface &getImage() const { return _image; }
+ // Runs the simulation through the given time at once
+ void simulate(double seconds);
+
// Adds a stage of a kind ("velocity", "fade"...) under a name, read from the
// table at the given index
void addNamedStage(const Common::String &kind, const Common::String &name, int tableIndex);
@@ -105,7 +112,6 @@ private:
};
void addStage(ParticleStage *stage);
- void simulate(double seconds);
void step();
void spawn(uint count);
void grow();
@@ -132,11 +138,15 @@ private:
double _spawnClock = 0.0;
double _spawnTime = 0.0; // when the newest particles were made
+ bool _isPaused = false; // Nancy23
double _fastForward = 0.0; // seconds to run through when the record starts
RecordGraphic *_canvas = nullptr;
};
+// The stages scripts get back from a record by name
+void registerParticleAPI(lua_State *L);
+
} // End of namespace Script
} // End of namespace Nancy
Commit: 7478f4d05fa3a71426660a8b0d9baca8993c74d5
https://github.com/scummvm/scummvm/commit/7478f4d05fa3a71426660a8b0d9baca8993c74d5
Author: Filippos Karapetis (bluegr at gmail.com)
Date: 2026-10-31T10:44:34+02:00
Commit Message:
NANCY: NANCY23: Add detection entry and set it to unstable
The game starts, and is playable
Changed paths:
engines/nancy/detection_tables.h
diff --git a/engines/nancy/detection_tables.h b/engines/nancy/detection_tables.h
index 18d9577f6cd..4e1f84caf89 100644
--- a/engines/nancy/detection_tables.h
+++ b/engines/nancy/detection_tables.h
@@ -1102,6 +1102,17 @@ static const NancyGameDescription gameDescriptions[] = {
},
kGameTypeNancy1New
},
+ { // MD5 by bluegr
+ {
+ "nancy23", nullptr,
+ AD_ENTRY1s("ciftree.dat", "f4924338a66dd2cf65953c2d6856ca40", 65354322),
+ Common::EN_ANY,
+ Common::kPlatformWindows,
+ ADGF_UNSTABLE | ADGF_DROPPLATFORM,
+ NANCY8_GUIOPTIONS
+ },
+ kGameTypeNancy23
+ },
// Do not delete
{ AD_TABLE_END_MARKER, kGameTypeNone }
Commit: 794ea9baf3bb46a991a2bef0f02db754d9afe4e1
https://github.com/scummvm/scummvm/commit/794ea9baf3bb46a991a2bef0f02db754d9afe4e1
Author: Filippos Karapetis (bluegr at gmail.com)
Date: 2026-10-31T10:44:37+02:00
Commit Message:
NANCY: Simplify game detection entries
The game type is calculated dynamically from the game ID now, and has
been removed from all the detection entries
Changed paths:
engines/nancy/detection.cpp
engines/nancy/detection.h
engines/nancy/detection_tables.h
engines/nancy/metaengine.cpp
engines/nancy/nancy.cpp
engines/nancy/nancy.h
diff --git a/engines/nancy/detection.cpp b/engines/nancy/detection.cpp
index 35e4b3ca71c..5aa3e1af34c 100644
--- a/engines/nancy/detection.cpp
+++ b/engines/nancy/detection.cpp
@@ -43,7 +43,7 @@ static const DebugChannelDef debugFlagList[] = {
DEBUG_CHANNEL_END
};
-class NancyMetaEngineDetection : public AdvancedMetaEngineDetection<Nancy::NancyGameDescription> {
+class NancyMetaEngineDetection : public AdvancedMetaEngineDetection<ADGameDescription> {
public:
NancyMetaEngineDetection() : AdvancedMetaEngineDetection(Nancy::gameDescriptions, Nancy::nancyGames) {
_maxScanDepth = 2;
diff --git a/engines/nancy/detection.h b/engines/nancy/detection.h
index a7977106844..228be04a2a6 100644
--- a/engines/nancy/detection.h
+++ b/engines/nancy/detection.h
@@ -66,13 +66,49 @@ enum GameType {
// Mystery of the Seven Keys was made with Unity
};
-struct NancyGameDescription {
- AD_GAME_DESCRIPTION_HELPERS(desc);
-
- ADGameDescription desc;
+struct GameIdToType {
+ const char *gameId;
GameType gameType;
};
+static const GameIdToType gameIdToType[] = {
+ {"vampire", kGameTypeVampire },
+ { "nancy1", kGameTypeNancy1 },
+ { "nancy2", kGameTypeNancy2 },
+ { "nancy3", kGameTypeNancy3 },
+ { "nancy4", kGameTypeNancy4 },
+ { "nancy5", kGameTypeNancy5 },
+ { "nancy6", kGameTypeNancy6 },
+ { "nancy7", kGameTypeNancy7 },
+ { "nancy8", kGameTypeNancy8 },
+ { "nancy9", kGameTypeNancy9 },
+ { "nancy10", kGameTypeNancy10 },
+ { "nancy11", kGameTypeNancy11 },
+ { "nancy12", kGameTypeNancy12 },
+ { "nancy13", kGameTypeNancy13 },
+ { "nancy14", kGameTypeNancy14 },
+ { "nancy15", kGameTypeNancy15 },
+ { "nancy16", kGameTypeNancy16 },
+ { "nancy17", kGameTypeNancy17 },
+ { "nancy18", kGameTypeNancy18 },
+ { "nancy19", kGameTypeNancy19 },
+ { "nancy20", kGameTypeNancy20 },
+ { "nancy21", kGameTypeNancy21 },
+ { "nancy22", kGameTypeNancy22 },
+ { "nancy1new", kGameTypeNancy1New },
+ { "nancy23", kGameTypeNancy23 },
+ { "nancy24", kGameTypeNancy24 },
+ { "nancy25", kGameTypeNancy25 },
+ { "nancy26", kGameTypeNancy26 },
+ { "nancy27", kGameTypeNancy27 },
+ { "nancy28", kGameTypeNancy28 },
+ { "nancy29", kGameTypeNancy29 },
+ { "nancy30", kGameTypeNancy30 },
+ { "nancy31", kGameTypeNancy31 },
+ { "nancy32", kGameTypeNancy32 },
+ { nullptr, kGameTypeNone }
+};
+
enum NancyDebugChannels {
kDebugEngine = 1,
kDebugActionRecord,
diff --git a/engines/nancy/detection_tables.h b/engines/nancy/detection_tables.h
index 4e1f84caf89..0d3b427d23e 100644
--- a/engines/nancy/detection_tables.h
+++ b/engines/nancy/detection_tables.h
@@ -65,1057 +65,828 @@ static const PlainGameDescriptor nancyGames[] = {
};
#define VAMPIRE_GUIOPTIONS GUIO4(GUIO_NOLANG, GAMEOPTION_PLAYER_SPEECH, GAMEOPTION_CHARACTER_SPEECH, GAMEOPTION_ORIGINAL_SAVELOAD)
-#define NANCY_GUIOPTIONS GUIO3(GAMEOPTION_PLAYER_SPEECH, GAMEOPTION_CHARACTER_SPEECH, GAMEOPTION_ORIGINAL_SAVELOAD)
+#define NANCY1_GUIOPTIONS GUIO3(GAMEOPTION_PLAYER_SPEECH, GAMEOPTION_CHARACTER_SPEECH, GAMEOPTION_ORIGINAL_SAVELOAD)
#define NANCY2_GUIOPTIONS GUIO5(GAMEOPTION_PLAYER_SPEECH, GAMEOPTION_CHARACTER_SPEECH, GAMEOPTION_FIX_SOFTLOCKS, GAMEOPTION_NANCY2_TIMER, GAMEOPTION_ORIGINAL_SAVELOAD)
#define NANCY5_GUIOPTIONS GUIO4(GAMEOPTION_PLAYER_SPEECH, GAMEOPTION_CHARACTER_SPEECH, GAMEOPTION_FIX_SOFTLOCKS, GAMEOPTION_ORIGINAL_SAVELOAD)
#define NANCY6_7_GUIOPTIONS GUIO3(GAMEOPTION_AUTO_MOVE, GAMEOPTION_FIX_SOFTLOCKS, GAMEOPTION_ORIGINAL_SAVELOAD)
-#define NANCY8_GUIOPTIONS GUIO2(GAMEOPTION_AUTO_MOVE, GAMEOPTION_ORIGINAL_SAVELOAD)
-
-static const NancyGameDescription gameDescriptions[] = {
+#define NANCY_GUIOPTIONS GUIO2(GAMEOPTION_AUTO_MOVE, GAMEOPTION_ORIGINAL_SAVELOAD)
+static const ADGameDescription gameDescriptions[] = {
{ // MD5 by fracturehill
- {
- "vampirediaries", nullptr,
- AD_ENTRY1s("boot.iff", "66d3b6fe9a90d35de7a28950870719ec", 20340),
- Common::EN_ANY,
- Common::kPlatformWindows,
- ADGF_DROPLANGUAGE | ADGF_DROPPLATFORM,
- VAMPIRE_GUIOPTIONS
- },
- kGameTypeVampire
+ "vampirediaries", nullptr,
+ AD_ENTRY1s("boot.iff", "66d3b6fe9a90d35de7a28950870719ec", 20340),
+ Common::EN_ANY,
+ Common::kPlatformWindows,
+ ADGF_DROPLANGUAGE | ADGF_DROPPLATFORM,
+ VAMPIRE_GUIOPTIONS
},
{ // MD5 by waltervn
- {
- "nancy1", nullptr,
- AD_ENTRY1s("ciftree.dat", "9f89e0b53717515ae0eb82d14ffe0e88", 4317962),
- Common::EN_ANY,
- Common::kPlatformWindows,
- ADGF_DROPPLATFORM,
- NANCY_GUIOPTIONS
- },
- kGameTypeNancy1
+ "nancy1", nullptr,
+ AD_ENTRY1s("ciftree.dat", "9f89e0b53717515ae0eb82d14ffe0e88", 4317962),
+ Common::EN_ANY,
+ Common::kPlatformWindows,
+ ADGF_DROPPLATFORM,
+ NANCY1_GUIOPTIONS
},
{ // MD5 by fracturehill
- {
- "nancy1", nullptr,
- AD_ENTRY1s("ciftree.dat", "e1cd21841ab1b83a0ea0755ce0254cbc", 4480956),
- Common::RU_RUS,
- Common::kPlatformWindows,
- ADGF_DROPPLATFORM,
- NANCY_GUIOPTIONS
- },
- kGameTypeNancy1
+ "nancy1", nullptr,
+ AD_ENTRY1s("ciftree.dat", "e1cd21841ab1b83a0ea0755ce0254cbc", 4480956),
+ Common::RU_RUS,
+ Common::kPlatformWindows,
+ ADGF_DROPPLATFORM,
+ NANCY1_GUIOPTIONS
},
{ // MD5 by fracturehill
+ "nancy1", nullptr,
{
- "nancy1", nullptr,
- {
- { "data1.hdr", 0, "39b33ad649d3e7261508d3c6907f237f", 139814 },
- { "data1.cab", 0, "f900861c47b0cb88191f5c6189db6cb1", 1916153 },
- { "data2.cab", 0, "9c652edb9846a721839cb7e1dcc94a3e", 462008320 },
- { "data3.cab", 0, "3053edb46a2574e118c4d4347a25a949", 626903743 },
- { "is:data1.cab:ciftree.dat", 0, "A:e1cd21841ab1b83a0ea0755ce0254cbc", 4480956 },
- AD_LISTEND
- },
- Common::RU_RUS,
- Common::kPlatformWindows,
- ADGF_DROPPLATFORM,
- NANCY_GUIOPTIONS
+ { "data1.hdr", 0, "39b33ad649d3e7261508d3c6907f237f", 139814 },
+ { "data1.cab", 0, "f900861c47b0cb88191f5c6189db6cb1", 1916153 },
+ { "data2.cab", 0, "9c652edb9846a721839cb7e1dcc94a3e", 462008320 },
+ { "data3.cab", 0, "3053edb46a2574e118c4d4347a25a949", 626903743 },
+ { "is:data1.cab:ciftree.dat", 0, "A:e1cd21841ab1b83a0ea0755ce0254cbc", 4480956 },
+ AD_LISTEND
},
- kGameTypeNancy1
+ Common::RU_RUS,
+ Common::kPlatformWindows,
+ ADGF_DROPPLATFORM,
+ NANCY1_GUIOPTIONS
},
{ // MD5 by waltervn
- {
- "nancy2", nullptr,
- AD_ENTRY1s("ciftree.dat", "fa4293d728a1b31407961cd82e86a015", 7784516),
- Common::EN_ANY,
- Common::kPlatformWindows,
- ADGF_DROPPLATFORM,
- NANCY2_GUIOPTIONS
- },
- kGameTypeNancy2
+ "nancy2", nullptr,
+ AD_ENTRY1s("ciftree.dat", "fa4293d728a1b31407961cd82e86a015", 7784516),
+ Common::EN_ANY,
+ Common::kPlatformWindows,
+ ADGF_DROPPLATFORM,
+ NANCY2_GUIOPTIONS
},
{ // MD5 by fracturehill
- {
- "nancy2", nullptr,
- AD_ENTRY1s("ciftree.dat", "c19f4a1193b58939ab1a7e314e9a550e", 7756789),
- Common::RU_RUS,
- Common::kPlatformWindows,
- ADGF_DROPPLATFORM,
- NANCY2_GUIOPTIONS
- },
- kGameTypeNancy2
+ "nancy2", nullptr,
+ AD_ENTRY1s("ciftree.dat", "c19f4a1193b58939ab1a7e314e9a550e", 7756789),
+ Common::RU_RUS,
+ Common::kPlatformWindows,
+ ADGF_DROPPLATFORM,
+ NANCY2_GUIOPTIONS
},
{ // MD5 by fracturehill
+ "nancy2", nullptr,
{
- "nancy2", nullptr,
- {
- { "data1.hdr", 0, "af916152b6cbf1810076517897585f62", 227999 },
- { "data1.cab", 0, "8139908ecba23f6cf58711ebd59c5b8b", 3854339 },
- { "data2.cab", 0, "99926a30ced5af845220a96d3b657498", 459982848 },
- { "data3.cab", 0, "39d396865ab10f908d55eb2ec733cb45", 60604580 },
- { "is:data1.cab:ciftree.dat", 0, "A:c19f4a1193b58939ab1a7e314e9a550e", 7756789 },
- },
- Common::RU_RUS,
- Common::kPlatformWindows,
- ADGF_DROPPLATFORM,
- NANCY2_GUIOPTIONS
+ { "data1.hdr", 0, "af916152b6cbf1810076517897585f62", 227999 },
+ { "data1.cab", 0, "8139908ecba23f6cf58711ebd59c5b8b", 3854339 },
+ { "data2.cab", 0, "99926a30ced5af845220a96d3b657498", 459982848 },
+ { "data3.cab", 0, "39d396865ab10f908d55eb2ec733cb45", 60604580 },
+ { "is:data1.cab:ciftree.dat", 0, "A:c19f4a1193b58939ab1a7e314e9a550e", 7756789 },
},
- kGameTypeNancy2
+ Common::RU_RUS,
+ Common::kPlatformWindows,
+ ADGF_DROPPLATFORM,
+ NANCY2_GUIOPTIONS
},
{ // MD5 by waltervn
- {
- "nancy3", nullptr,
- AD_ENTRY1s("ciftree.dat", "ee5f8832226567c3610556497c451b09", 16256355),
- Common::EN_ANY,
- Common::kPlatformWindows,
- ADGF_DROPPLATFORM,
- NANCY_GUIOPTIONS
- },
- kGameTypeNancy3
+ "nancy3", nullptr,
+ AD_ENTRY1s("ciftree.dat", "ee5f8832226567c3610556497c451b09", 16256355),
+ Common::EN_ANY,
+ Common::kPlatformWindows,
+ ADGF_DROPPLATFORM,
+ NANCY1_GUIOPTIONS
},
{ // Steam version
- {
- "nancy3", nullptr,
- AD_ENTRY1s("ciftree.dat", "6b379f9d8edfb2d439062122e08f785c", 16161115),
- Common::EN_ANY,
- Common::kPlatformWindows,
- ADGF_DROPPLATFORM,
- NANCY_GUIOPTIONS
- },
- kGameTypeNancy3
+ "nancy3", nullptr,
+ AD_ENTRY1s("ciftree.dat", "6b379f9d8edfb2d439062122e08f785c", 16161115),
+ Common::EN_ANY,
+ Common::kPlatformWindows,
+ ADGF_DROPPLATFORM,
+ NANCY1_GUIOPTIONS
},
{ // MD5 by fracturehill
+ "nancy3", nullptr,
{
- "nancy3", nullptr,
- {
- { "data1.hdr", 0, "f05167f20c11972f17e6abf7db0034b3", 207514 },
- { "data1.cab", 0, "cb5d147affbd1f2f70b436c166d35e5b", 1595638 },
- { "data2.cab", 0, "1ea22dabe4a5cff022dac123577188e7", 137304516 },
- { "is:data1.cab:ciftree.dat", 0, "A:6b379f9d8edfb2d439062122e08f785c", 16161115 },
- AD_LISTEND
- },
- Common::EN_ANY,
- Common::kPlatformWindows,
- ADGF_DROPPLATFORM,
- NANCY_GUIOPTIONS
+ { "data1.hdr", 0, "f05167f20c11972f17e6abf7db0034b3", 207514 },
+ { "data1.cab", 0, "cb5d147affbd1f2f70b436c166d35e5b", 1595638 },
+ { "data2.cab", 0, "1ea22dabe4a5cff022dac123577188e7", 137304516 },
+ { "is:data1.cab:ciftree.dat", 0, "A:6b379f9d8edfb2d439062122e08f785c", 16161115 },
+ AD_LISTEND
},
- kGameTypeNancy3
+ Common::EN_ANY,
+ Common::kPlatformWindows,
+ ADGF_DROPPLATFORM,
+ NANCY1_GUIOPTIONS
},
{ // MD5 by waltervn
+ "nancy3", nullptr,
{
- "nancy3", nullptr,
- {
- { "data1.hdr", 0, "44906f3d2242f73f16feb8eb6a5161cb", 207327 },
- { "data1.cab", 0, "e258cc871e5de5ae004d03c4e31431c7", 1555916 },
- { "data2.cab", 0, "364dfd25677026da505f1fa6edd5571f", 137373135 },
- { "is:data1.cab:ciftree.dat", 0, "A:ee5f8832226567c3610556497c451b09", 16256355 },
- AD_LISTEND
- },
- Common::EN_ANY,
- Common::kPlatformWindows,
- ADGF_DROPPLATFORM,
- NANCY_GUIOPTIONS
+ { "data1.hdr", 0, "44906f3d2242f73f16feb8eb6a5161cb", 207327 },
+ { "data1.cab", 0, "e258cc871e5de5ae004d03c4e31431c7", 1555916 },
+ { "data2.cab", 0, "364dfd25677026da505f1fa6edd5571f", 137373135 },
+ { "is:data1.cab:ciftree.dat", 0, "A:ee5f8832226567c3610556497c451b09", 16256355 },
+ AD_LISTEND
},
- kGameTypeNancy3
+ Common::EN_ANY,
+ Common::kPlatformWindows,
+ ADGF_DROPPLATFORM,
+ NANCY1_GUIOPTIONS
},
{ // MD5 by fracturehill
- {
- "nancy3", nullptr,
- AD_ENTRY1s("ciftree.dat", "6b379f9d8edfb2d439062122e08f785c", 16161148),
- Common::RU_RUS,
- Common::kPlatformWindows,
- ADGF_DROPPLATFORM,
- NANCY_GUIOPTIONS
- },
- kGameTypeNancy3
+ "nancy3", nullptr,
+ AD_ENTRY1s("ciftree.dat", "6b379f9d8edfb2d439062122e08f785c", 16161148),
+ Common::RU_RUS,
+ Common::kPlatformWindows,
+ ADGF_DROPPLATFORM,
+ NANCY1_GUIOPTIONS
},
{ // MD5 by fracturehill
+ "nancy3", nullptr,
{
- "nancy3", nullptr,
- {
- { "data1.hdr", 0, "9da72fec24e1ca4f8f6b563bbdab3276", 237686 },
- { "data1.cab", 0, "a7a259e45ae643aed63fa958531cc318", 3473219 },
- { "data2.cab", 0, "cb709fba73605814f9dda823b1cfaf85", 433625036 },
- { "is:data1.cab:ciftree.dat", 0, "A:6b379f9d8edfb2d439062122e08f785c", 16161148 },
- AD_LISTEND
- },
- Common::RU_RUS,
- Common::kPlatformWindows,
- ADGF_DROPPLATFORM,
- NANCY_GUIOPTIONS
+ { "data1.hdr", 0, "9da72fec24e1ca4f8f6b563bbdab3276", 237686 },
+ { "data1.cab", 0, "a7a259e45ae643aed63fa958531cc318", 3473219 },
+ { "data2.cab", 0, "cb709fba73605814f9dda823b1cfaf85", 433625036 },
+ { "is:data1.cab:ciftree.dat", 0, "A:6b379f9d8edfb2d439062122e08f785c", 16161148 },
+ AD_LISTEND
},
- kGameTypeNancy3
+ Common::RU_RUS,
+ Common::kPlatformWindows,
+ ADGF_DROPPLATFORM,
+ NANCY1_GUIOPTIONS
},
{ // MD5 by waltervn
- {
- "nancy4", nullptr,
- AD_ENTRY1s("ciftree.dat", "e9d45f7db453b0d8f37d202fc979537c", 8742289),
- Common::EN_ANY,
- Common::kPlatformWindows,
- ADGF_DROPPLATFORM,
- NANCY_GUIOPTIONS
- },
- kGameTypeNancy4
+ "nancy4", nullptr,
+ AD_ENTRY1s("ciftree.dat", "e9d45f7db453b0d8f37d202fc979537c", 8742289),
+ Common::EN_ANY,
+ Common::kPlatformWindows,
+ ADGF_DROPPLATFORM,
+ NANCY1_GUIOPTIONS
},
{ // Steam version
- {
- "nancy4", nullptr,
- AD_ENTRY1s("ciftree.dat", "3ad55cd8f9a3b010a19de44ff4ce7edf", 8786300),
- Common::EN_ANY,
- Common::kPlatformWindows,
- ADGF_DROPPLATFORM,
- NANCY_GUIOPTIONS
- },
- kGameTypeNancy4
+ "nancy4", nullptr,
+ AD_ENTRY1s("ciftree.dat", "3ad55cd8f9a3b010a19de44ff4ce7edf", 8786300),
+ Common::EN_ANY,
+ Common::kPlatformWindows,
+ ADGF_DROPPLATFORM,
+ NANCY1_GUIOPTIONS
},
{ // MD5 by fracturehill
+ "nancy4", nullptr,
{
- "nancy4", nullptr,
- {
- { "data1.hdr", 0, "1cfe79efba356d1b5545f9b0cca99f31", 256336 },
- { "data1.cab", 0, "31ad655a6de1f16c8990b94f4f094cc2", 1598815 },
- { "data2.cab", 0, "9e134ed2dd0ce262b1c93bc91ce67d95", 59466427 },
- { "is:data1.cab:ciftree.dat", 0, "A:3ad55cd8f9a3b010a19de44ff4ce7edf", 8786300 },
- AD_LISTEND
- },
- Common::EN_ANY,
- Common::kPlatformWindows,
- ADGF_DROPPLATFORM,
- NANCY_GUIOPTIONS
+ { "data1.hdr", 0, "1cfe79efba356d1b5545f9b0cca99f31", 256336 },
+ { "data1.cab", 0, "31ad655a6de1f16c8990b94f4f094cc2", 1598815 },
+ { "data2.cab", 0, "9e134ed2dd0ce262b1c93bc91ce67d95", 59466427 },
+ { "is:data1.cab:ciftree.dat", 0, "A:3ad55cd8f9a3b010a19de44ff4ce7edf", 8786300 },
+ AD_LISTEND
},
- kGameTypeNancy4
+ Common::EN_ANY,
+ Common::kPlatformWindows,
+ ADGF_DROPPLATFORM,
+ NANCY1_GUIOPTIONS
},
{ // MD5 by waltervn
+ "nancy4", nullptr,
{
- "nancy4", nullptr,
- {
- { "data1.hdr", 0, "fa4e7a1c411053557169a7731f287012", 263443 },
- { "data1.cab", 0, "8f689f92fcca443d6a03faa5de7e2f1c", 1568756 },
- { "data2.cab", 0, "5525aa428041f3f1421a6fb5d1b8dba1", 140518758 },
- { "is:data1.cab:ciftree.dat", 0, "A:e9d45f7db453b0d8f37d202fc979537c", 8742289 },
- AD_LISTEND
- },
- Common::EN_ANY,
- Common::kPlatformWindows,
- ADGF_DROPPLATFORM,
- NANCY_GUIOPTIONS
+ { "data1.hdr", 0, "fa4e7a1c411053557169a7731f287012", 263443 },
+ { "data1.cab", 0, "8f689f92fcca443d6a03faa5de7e2f1c", 1568756 },
+ { "data2.cab", 0, "5525aa428041f3f1421a6fb5d1b8dba1", 140518758 },
+ { "is:data1.cab:ciftree.dat", 0, "A:e9d45f7db453b0d8f37d202fc979537c", 8742289 },
+ AD_LISTEND
},
- kGameTypeNancy4
+ Common::EN_ANY,
+ Common::kPlatformWindows,
+ ADGF_DROPPLATFORM,
+ NANCY1_GUIOPTIONS
},
{ // MD5 by eriktorbjorn
+ "nancy4", nullptr,
{
- "nancy4", nullptr,
- {
- { "data1.hdr", 0, "9febd79adc61148088b464140a124172", 263445 },
- { "data1.cab", 0, "af5e06e381473fdc3ff6f7cac5619e32", 1569396 },
- { "data2.cab", 0, "ed0ca7ba3cc315f705e48fe604d53523", 140562769 },
- { "is:data1.cab:ciftree.dat", 0, "A:3ad55cd8f9a3b010a19de44ff4ce7edf", 8786300 },
- AD_LISTEND
- },
- Common::EN_ANY,
- Common::kPlatformWindows,
- ADGF_DROPPLATFORM,
- NANCY_GUIOPTIONS
+ { "data1.hdr", 0, "9febd79adc61148088b464140a124172", 263445 },
+ { "data1.cab", 0, "af5e06e381473fdc3ff6f7cac5619e32", 1569396 },
+ { "data2.cab", 0, "ed0ca7ba3cc315f705e48fe604d53523", 140562769 },
+ { "is:data1.cab:ciftree.dat", 0, "A:3ad55cd8f9a3b010a19de44ff4ce7edf", 8786300 },
+ AD_LISTEND
},
- kGameTypeNancy4
+ Common::EN_ANY,
+ Common::kPlatformWindows,
+ ADGF_DROPPLATFORM,
+ NANCY1_GUIOPTIONS
},
{ // MD5 by fracturehill
- {
- "nancy4", nullptr,
- AD_ENTRY1s("ciftree.dat", "a1090497f5fefce17494804bd1d624e1", 9991442),
- Common::RU_RUS,
- Common::kPlatformWindows,
- ADGF_DROPPLATFORM,
- NANCY_GUIOPTIONS
- },
- kGameTypeNancy4
+ "nancy4", nullptr,
+ AD_ENTRY1s("ciftree.dat", "a1090497f5fefce17494804bd1d624e1", 9991442),
+ Common::RU_RUS,
+ Common::kPlatformWindows,
+ ADGF_DROPPLATFORM,
+ NANCY1_GUIOPTIONS
},
{ // MD5 by fracturehill
+ "nancy4", nullptr,
{
- "nancy4", nullptr,
- {
- { "data1.hdr", 0, "694d11d7ebdf2c96cd395f4baf938c10", 256535 },
- { "data1.cab", 0, "9c9c9c60c5344e877e033e54564c6e6e", 4892300 },
- { "data2.cab", 0, "05ef8fac76a227f829479719f40522b5", 458917888 },
- { "data3.cab", 0, "9b266564726664befe1770754150f5d8", 65795720 },
- { "is:data1.cab:ciftree.dat", 0, "A:a1090497f5fefce17494804bd1d624e1", 9991442 },
- AD_LISTEND
- },
- Common::RU_RUS,
- Common::kPlatformWindows,
- ADGF_DROPPLATFORM,
- NANCY_GUIOPTIONS
+ { "data1.hdr", 0, "694d11d7ebdf2c96cd395f4baf938c10", 256535 },
+ { "data1.cab", 0, "9c9c9c60c5344e877e033e54564c6e6e", 4892300 },
+ { "data2.cab", 0, "05ef8fac76a227f829479719f40522b5", 458917888 },
+ { "data3.cab", 0, "9b266564726664befe1770754150f5d8", 65795720 },
+ { "is:data1.cab:ciftree.dat", 0, "A:a1090497f5fefce17494804bd1d624e1", 9991442 },
+ AD_LISTEND
},
- kGameTypeNancy4
+ Common::RU_RUS,
+ Common::kPlatformWindows,
+ ADGF_DROPPLATFORM,
+ NANCY1_GUIOPTIONS
},
{ // MD5 by waltervn
- {
- "nancy5", nullptr,
- AD_ENTRY1s("ciftree.dat", "21fa81f322595c3100d8d58d100852d5", 8187692),
- Common::EN_ANY,
- Common::kPlatformWindows,
- ADGF_DROPPLATFORM,
- NANCY5_GUIOPTIONS
- },
- kGameTypeNancy5
+ "nancy5", nullptr,
+ AD_ENTRY1s("ciftree.dat", "21fa81f322595c3100d8d58d100852d5", 8187692),
+ Common::EN_ANY,
+ Common::kPlatformWindows,
+ ADGF_DROPPLATFORM,
+ NANCY5_GUIOPTIONS
},
{ // MD5 by waltervn
+ "nancy5", nullptr,
{
- "nancy5", nullptr,
- {
- { "data1.hdr", 0, "261105fba2a1226eedb090c2ce79fd35", 284091 },
- { "data1.cab", 0, "7d27bb947ef7305831f1faaf1512a598", 1446301 },
- { "data2.cab", 0, "00719c86cab733c1094b27079ce030f3", 145857935 },
- { "is:data1.cab:ciftree.dat", 0, "A:21fa81f322595c3100d8d58d100852d5", 8187692 },
- AD_LISTEND
- },
- Common::EN_ANY,
- Common::kPlatformWindows,
- ADGF_DROPPLATFORM,
- NANCY5_GUIOPTIONS
+ { "data1.hdr", 0, "261105fba2a1226eedb090c2ce79fd35", 284091 },
+ { "data1.cab", 0, "7d27bb947ef7305831f1faaf1512a598", 1446301 },
+ { "data2.cab", 0, "00719c86cab733c1094b27079ce030f3", 145857935 },
+ { "is:data1.cab:ciftree.dat", 0, "A:21fa81f322595c3100d8d58d100852d5", 8187692 },
+ AD_LISTEND
},
- kGameTypeNancy5
+ Common::EN_ANY,
+ Common::kPlatformWindows,
+ ADGF_DROPPLATFORM,
+ NANCY5_GUIOPTIONS
},
{ // MD5 by fracturehill
+ "nancy5", nullptr,
{
- "nancy5", nullptr,
- {
- { "data1.hdr", 0, "0db3fb5bc002eb875eebb872969a22ca", 278505 },
- { "data1.cab", 0, "b5d2d218ded5683b5ca2eafcdc1ed76e", 1720654 },
- { "data2.cab", 0, "d379a879fb23b3013f78537927ac6cfe", 548761463 },
- { "is:data1.cab:ciftree.dat", 0, "A:21fa81f322595c3100d8d58d100852d5", 8187692 },
- AD_LISTEND
- },
- Common::EN_ANY,
- Common::kPlatformWindows,
- ADGF_DROPPLATFORM,
- NANCY5_GUIOPTIONS
+ { "data1.hdr", 0, "0db3fb5bc002eb875eebb872969a22ca", 278505 },
+ { "data1.cab", 0, "b5d2d218ded5683b5ca2eafcdc1ed76e", 1720654 },
+ { "data2.cab", 0, "d379a879fb23b3013f78537927ac6cfe", 548761463 },
+ { "is:data1.cab:ciftree.dat", 0, "A:21fa81f322595c3100d8d58d100852d5", 8187692 },
+ AD_LISTEND
},
- kGameTypeNancy5
+ Common::EN_ANY,
+ Common::kPlatformWindows,
+ ADGF_DROPPLATFORM,
+ NANCY5_GUIOPTIONS
},
/* Temporarily disabled; needs ciftree.dat
{ // MD5 by clone2727
+ "nancy5", nullptr,
{
- "nancy5", nullptr,
- {
- { "data1.hdr", 0, "258e27792fa7cc7a7125fd74d89f8487", 284091 },
- { "data1.cab", 0, "70433b30b6114031d54d0c991ad44577", 1446301 },
- { "data2.cab", 0, "66f47e4f5e6d431f815aa5250eb044bc", 145857937 },
- AD_LISTEND
- },
- Common::EN_ANY,
- Common::kPlatformWindows,
- ADGF_DROPPLATFORM,
- NANCY5_GUIOPTIONS
+ { "data1.hdr", 0, "258e27792fa7cc7a7125fd74d89f8487", 284091 },
+ { "data1.cab", 0, "70433b30b6114031d54d0c991ad44577", 1446301 },
+ { "data2.cab", 0, "66f47e4f5e6d431f815aa5250eb044bc", 145857937 },
+ AD_LISTEND
},
- kGameTypeNancy5
+ Common::EN_ANY,
+ Common::kPlatformWindows,
+ ADGF_DROPPLATFORM,
+ NANCY5_GUIOPTIONS
},*/
{ // MD5 by fracturehill
- {
- "nancy5", nullptr,
- AD_ENTRY1s("ciftree.dat", "8645fad8c3fb8c0ee13e7a0a75902782", 9714463),
- Common::RU_RUS,
- Common::kPlatformWindows,
- ADGF_DROPPLATFORM,
- NANCY5_GUIOPTIONS
- },
- kGameTypeNancy5
+ "nancy5", nullptr,
+ AD_ENTRY1s("ciftree.dat", "8645fad8c3fb8c0ee13e7a0a75902782", 9714463),
+ Common::RU_RUS,
+ Common::kPlatformWindows,
+ ADGF_DROPPLATFORM,
+ NANCY5_GUIOPTIONS
},
{ // MD5 by fracturehill
+ "nancy5", nullptr,
{
- "nancy5", nullptr,
- {
- { "data1.hdr", 0, "229ab8e318a0fd0f0db366d854be2a20", 277512 },
- { "data1.cab", 0, "156a26646f48e73c578373694cfd632d", 3466411 },
- { "data2.cab", 0, "3db8fcd5414be1b704bef52d300a7fc1", 460324864 },
- { "data3.cab", 0, "8e40909e6946cd45aa949e3db1b970ac", 127118355 },
- { "is:data1.cab:ciftree.dat", 0, "A:8645fad8c3fb8c0ee13e7a0a75902782", 9714463 },
- AD_LISTEND
- },
- Common::RU_RUS,
- Common::kPlatformWindows,
- ADGF_DROPPLATFORM,
- NANCY5_GUIOPTIONS
+ { "data1.hdr", 0, "229ab8e318a0fd0f0db366d854be2a20", 277512 },
+ { "data1.cab", 0, "156a26646f48e73c578373694cfd632d", 3466411 },
+ { "data2.cab", 0, "3db8fcd5414be1b704bef52d300a7fc1", 460324864 },
+ { "data3.cab", 0, "8e40909e6946cd45aa949e3db1b970ac", 127118355 },
+ { "is:data1.cab:ciftree.dat", 0, "A:8645fad8c3fb8c0ee13e7a0a75902782", 9714463 },
+ AD_LISTEND
},
- kGameTypeNancy5
+ Common::RU_RUS,
+ Common::kPlatformWindows,
+ ADGF_DROPPLATFORM,
+ NANCY5_GUIOPTIONS
},
{ // MD5 by Strangerke
+ "nancy6", nullptr,
{
- "nancy6", nullptr,
- {
- { "ciftree.dat", 0, "a97b848651fdcf38f5cad7092d98e4a1", 28888006 },
- { "amfid.avf", 0, "5f39a351a9fdd13fc24efbcb841cb059", 207695 },
- AD_LISTEND
- },
- Common::EN_ANY,
- Common::kPlatformWindows,
- ADGF_DROPPLATFORM,
- NANCY6_7_GUIOPTIONS
+ { "ciftree.dat", 0, "a97b848651fdcf38f5cad7092d98e4a1", 28888006 },
+ { "amfid.avf", 0, "5f39a351a9fdd13fc24efbcb841cb059", 207695 },
+ AD_LISTEND
},
- kGameTypeNancy6
+ Common::EN_ANY,
+ Common::kPlatformWindows,
+ ADGF_DROPPLATFORM,
+ NANCY6_7_GUIOPTIONS
},
{ // MD5 by eriktorbjorn
+ "nancy6", nullptr,
{
- "nancy6", nullptr,
- {
- { "data1.hdr", 0, "6a45cdf632301ae1b55fd7474bec3650", 298551 },
- { "data1.cab", 0, "399b83b188bfc05077d81cc1eadd456c", 4470086 },
- { "data2.cab", 0, "30ca94b596f6b5971a22c111b24d6764", 206382511 },
- { "is:data1.cab:ciftree.dat", 0, "A:a97b848651fdcf38f5cad7092d98e4a1", 28888006 },
- AD_LISTEND
- },
- Common::EN_ANY,
- Common::kPlatformWindows,
- ADGF_DROPPLATFORM,
- NANCY6_7_GUIOPTIONS
+ { "data1.hdr", 0, "6a45cdf632301ae1b55fd7474bec3650", 298551 },
+ { "data1.cab", 0, "399b83b188bfc05077d81cc1eadd456c", 4470086 },
+ { "data2.cab", 0, "30ca94b596f6b5971a22c111b24d6764", 206382511 },
+ { "is:data1.cab:ciftree.dat", 0, "A:a97b848651fdcf38f5cad7092d98e4a1", 28888006 },
+ AD_LISTEND
},
- kGameTypeNancy6
+ Common::EN_ANY,
+ Common::kPlatformWindows,
+ ADGF_DROPPLATFORM,
+ NANCY6_7_GUIOPTIONS
},
{
+ "nancy6", nullptr,
{
- "nancy6", nullptr,
- {
- { "data1.hdr", 0, "9c8b51b33a652b2faeec0d952bd4675a", 298551 },
- { "data1.cab", 0, "f9aea73829703169a5200c7c9def06b0", 4470086 },
- { "data2.cab", 0, "6b25be9f6aab19d5f6f95d45b47ea73d", 206382676 },
- { "is:data1.cab:ciftree.dat", 0, "A:a97b848651fdcf38f5cad7092d98e4a1", 28888006 },
- AD_LISTEND
- },
- Common::EN_ANY,
- Common::kPlatformWindows,
- ADGF_DROPPLATFORM,
- NANCY6_7_GUIOPTIONS
+ { "data1.hdr", 0, "9c8b51b33a652b2faeec0d952bd4675a", 298551 },
+ { "data1.cab", 0, "f9aea73829703169a5200c7c9def06b0", 4470086 },
+ { "data2.cab", 0, "6b25be9f6aab19d5f6f95d45b47ea73d", 206382676 },
+ { "is:data1.cab:ciftree.dat", 0, "A:a97b848651fdcf38f5cad7092d98e4a1", 28888006 },
+ AD_LISTEND
},
- kGameTypeNancy6
+ Common::EN_ANY,
+ Common::kPlatformWindows,
+ ADGF_DROPPLATFORM,
+ NANCY6_7_GUIOPTIONS
},
{ // MD5 by fracturehill
+ "nancy6", nullptr,
{
- "nancy6", nullptr,
- {
- { "data1.hdr", 0, "fe9ccf3ac298dfdba50c27971eb17758", 275738 },
- { "data1.cab", 0, "44379edf93cc7132e69800558c84c1a5", 4470232 },
- { "data2.cab", 0, "e0552258607ac7d8ed89890768b705ae", 404327022 },
- { "ciftree.dat", 0, "a97b848651fdcf38f5cad7092d98e4a1", 28888006 }, // ciftree is outside of cabfiles
- AD_LISTEND
- },
- Common::EN_ANY,
- Common::kPlatformWindows,
- ADGF_DROPPLATFORM,
- NANCY6_7_GUIOPTIONS
+ { "data1.hdr", 0, "fe9ccf3ac298dfdba50c27971eb17758", 275738 },
+ { "data1.cab", 0, "44379edf93cc7132e69800558c84c1a5", 4470232 },
+ { "data2.cab", 0, "e0552258607ac7d8ed89890768b705ae", 404327022 },
+ { "ciftree.dat", 0, "a97b848651fdcf38f5cad7092d98e4a1", 28888006 }, // ciftree is outside of cabfiles
+ AD_LISTEND
},
- kGameTypeNancy6
+ Common::EN_ANY,
+ Common::kPlatformWindows,
+ ADGF_DROPPLATFORM,
+ NANCY6_7_GUIOPTIONS
},
{ // MD5 by fracturehill
- {
- "nancy6", nullptr,
- AD_ENTRY1s("ciftree.dat", "e1a4db8cbac3de50d8e808f06d673b36", 29643931),
- Common::RU_RUS,
- Common::kPlatformWindows,
- ADGF_DROPPLATFORM,
- NANCY6_7_GUIOPTIONS
- },
- kGameTypeNancy6
+ "nancy6", nullptr,
+ AD_ENTRY1s("ciftree.dat", "e1a4db8cbac3de50d8e808f06d673b36", 29643931),
+ Common::RU_RUS,
+ Common::kPlatformWindows,
+ ADGF_DROPPLATFORM,
+ NANCY6_7_GUIOPTIONS
},
{ // MD5 by fracturehill
+ "nancy6", nullptr,
{
- "nancy6", nullptr,
- {
- { "data1.hdr", 0, "4a95296bcc54c1376661496d17f2eeb1", 276630 },
- { "data1.cab", 0, "67f1f05f7ddfae3f63fc2f208e7b6e5d", 6634156 },
- { "data2.cab", 0, "299c8165f5f7dacfcb6e625ffeac47b4", 457154560 },
- { "is:data1.cab:ciftree.dat", 0, "A:e1a4db8cbac3de50d8e808f06d673b36", 29643931 },
- AD_LISTEND
- },
- Common::RU_RUS,
- Common::kPlatformWindows,
- ADGF_DROPPLATFORM,
- NANCY6_7_GUIOPTIONS
+ { "data1.hdr", 0, "4a95296bcc54c1376661496d17f2eeb1", 276630 },
+ { "data1.cab", 0, "67f1f05f7ddfae3f63fc2f208e7b6e5d", 6634156 },
+ { "data2.cab", 0, "299c8165f5f7dacfcb6e625ffeac47b4", 457154560 },
+ { "is:data1.cab:ciftree.dat", 0, "A:e1a4db8cbac3de50d8e808f06d673b36", 29643931 },
+ AD_LISTEND
},
- kGameTypeNancy6
+ Common::RU_RUS,
+ Common::kPlatformWindows,
+ ADGF_DROPPLATFORM,
+ NANCY6_7_GUIOPTIONS
},
{ // MD5 by fracturehill
- {
- "nancy7", nullptr,
- AD_ENTRY1s("ciftree.dat", "e49e6f56a47c363e2651bd19a70ff557", 55835579),
- Common::EN_ANY,
- Common::kPlatformWindows,
- ADGF_DROPPLATFORM,
- NANCY6_7_GUIOPTIONS
- },
- kGameTypeNancy7
+ "nancy7", nullptr,
+ AD_ENTRY1s("ciftree.dat", "e49e6f56a47c363e2651bd19a70ff557", 55835579),
+ Common::EN_ANY,
+ Common::kPlatformWindows,
+ ADGF_DROPPLATFORM,
+ NANCY6_7_GUIOPTIONS
},
{ // MD5 by eriktorbjorn
+ "nancy7", nullptr,
{
- "nancy7", nullptr,
- {
- { "data1.hdr", 0, "f58175e4647e635e96d73dde49deb871", 335485 },
- { "data1.cab", 0, "6b48a626a8c6c12c9d7f68ee6c80212a", 4693602 },
- { "data2.cab", 0, "0aec46d4a59ea0279228ab25bfb3fcd5", 144613827 },
- { "is:data1.cab:ciftree.dat", 0, "A:e49e6f56a47c363e2651bd19a70ff557", 55835579 },
- AD_LISTEND
- },
- Common::EN_ANY,
- Common::kPlatformWindows,
- ADGF_DROPPLATFORM,
- NANCY6_7_GUIOPTIONS
+ { "data1.hdr", 0, "f58175e4647e635e96d73dde49deb871", 335485 },
+ { "data1.cab", 0, "6b48a626a8c6c12c9d7f68ee6c80212a", 4693602 },
+ { "data2.cab", 0, "0aec46d4a59ea0279228ab25bfb3fcd5", 144613827 },
+ { "is:data1.cab:ciftree.dat", 0, "A:e49e6f56a47c363e2651bd19a70ff557", 55835579 },
+ AD_LISTEND
},
- kGameTypeNancy7
+ Common::EN_ANY,
+ Common::kPlatformWindows,
+ ADGF_DROPPLATFORM,
+ NANCY6_7_GUIOPTIONS
},
{
+ "nancy7", nullptr,
{
- "nancy7", nullptr,
- {
- { "data1.hdr", 0, "5a46f9e4ca159c86081b6c72020be14a", 335873 },
- { "data1.cab", 0, "09af417c0e8d8456596b6240a4fe7e64", 4693602 },
- { "data2.cab", 0, "8bc09053961e51f7d0a0b2cac9ccecee", 144617595 },
- { "is:data1.cab:ciftree.dat", 0, "A:e49e6f56a47c363e2651bd19a70ff557", 55835579 },
- AD_LISTEND
- },
- Common::EN_ANY,
- Common::kPlatformWindows,
- ADGF_DROPPLATFORM,
- NANCY6_7_GUIOPTIONS
+ { "data1.hdr", 0, "5a46f9e4ca159c86081b6c72020be14a", 335873 },
+ { "data1.cab", 0, "09af417c0e8d8456596b6240a4fe7e64", 4693602 },
+ { "data2.cab", 0, "8bc09053961e51f7d0a0b2cac9ccecee", 144617595 },
+ { "is:data1.cab:ciftree.dat", 0, "A:e49e6f56a47c363e2651bd19a70ff557", 55835579 },
+ AD_LISTEND
},
- kGameTypeNancy7
+ Common::EN_ANY,
+ Common::kPlatformWindows,
+ ADGF_DROPPLATFORM,
+ NANCY6_7_GUIOPTIONS
},
{ // MD5 by fracturehill
- {
- "nancy7", nullptr,
- AD_ENTRY1s("ciftree.dat", "a2001796b82a88d36693d087b15526e1", 56580014),
- Common::RU_RUS,
- Common::kPlatformWindows,
- ADGF_DROPPLATFORM,
- NANCY6_7_GUIOPTIONS
- },
- kGameTypeNancy7
+ "nancy7", nullptr,
+ AD_ENTRY1s("ciftree.dat", "a2001796b82a88d36693d087b15526e1", 56580014),
+ Common::RU_RUS,
+ Common::kPlatformWindows,
+ ADGF_DROPPLATFORM,
+ NANCY6_7_GUIOPTIONS
},
{ // MD5 by fracturehill
+ "nancy7", nullptr,
{
- "nancy7", nullptr,
- {
- { "data1.hdr", 0, "32708e36d0250cfd031a82b7534aebb9", 327394 },
- { "data1.cab", 0, "41681a27e35123a5edfcf45a58101295", 4805355 },
- { "data2.cab", 0, "4e5644ac2e0d523f5aaf343d115889a7", 460975235 },
- { "is:data1.cab:ciftree.dat", 0, "A:a2001796b82a88d36693d087b15526e1", 56580014 },
- AD_LISTEND
- },
- Common::RU_RUS,
- Common::kPlatformWindows,
- ADGF_DROPPLATFORM,
- NANCY6_7_GUIOPTIONS
+ { "data1.hdr", 0, "32708e36d0250cfd031a82b7534aebb9", 327394 },
+ { "data1.cab", 0, "41681a27e35123a5edfcf45a58101295", 4805355 },
+ { "data2.cab", 0, "4e5644ac2e0d523f5aaf343d115889a7", 460975235 },
+ { "is:data1.cab:ciftree.dat", 0, "A:a2001796b82a88d36693d087b15526e1", 56580014 },
+ AD_LISTEND
},
- kGameTypeNancy7
+ Common::RU_RUS,
+ Common::kPlatformWindows,
+ ADGF_DROPPLATFORM,
+ NANCY6_7_GUIOPTIONS
},
{ // MD5 by fracturehill
- {
- "nancy8", nullptr,
- AD_ENTRY1s("ciftree.dat", "d85192a942a207017ebf0a19207ac698", 19498032),
- Common::EN_ANY,
- Common::kPlatformWindows,
- ADGF_DROPPLATFORM,
- NANCY8_GUIOPTIONS
- },
- kGameTypeNancy8
+ "nancy8", nullptr,
+ AD_ENTRY1s("ciftree.dat", "d85192a942a207017ebf0a19207ac698", 19498032),
+ Common::EN_ANY,
+ Common::kPlatformWindows,
+ ADGF_DROPPLATFORM,
+ NANCY_GUIOPTIONS
},
{ // MD5 by fracturehill
+ "nancy8", nullptr,
{
- "nancy8", nullptr,
- {
- { "data1.hdr", 0, "463f68bd7b09bafcfed40c7875b775cc", 318378 },
- { "data1.cab", 0, "6dd3805a1e2f5dd4c81726acf77e3869", 5451563 },
- { "data2.cab", 0, "14dde9855a10ed9ee6622aea53477ba6", 159239822 },
- { "is:data1.cab:ciftree.dat", 0, "A:d85192a942a207017ebf0a19207ac698", 19498032 },
- AD_LISTEND
- },
- Common::EN_ANY,
- Common::kPlatformWindows,
- ADGF_DROPPLATFORM,
- NANCY8_GUIOPTIONS
+ { "data1.hdr", 0, "463f68bd7b09bafcfed40c7875b775cc", 318378 },
+ { "data1.cab", 0, "6dd3805a1e2f5dd4c81726acf77e3869", 5451563 },
+ { "data2.cab", 0, "14dde9855a10ed9ee6622aea53477ba6", 159239822 },
+ { "is:data1.cab:ciftree.dat", 0, "A:d85192a942a207017ebf0a19207ac698", 19498032 },
+ AD_LISTEND
},
- kGameTypeNancy8
+ Common::EN_ANY,
+ Common::kPlatformWindows,
+ ADGF_DROPPLATFORM,
+ NANCY_GUIOPTIONS
},
{ // MD5 by fracturehill
- {
- "nancy8", nullptr,
- AD_ENTRY1s("ciftree.dat", "9ed40f0bcc1d9e3e38e127bfbc6797d7", 20358011),
- Common::RU_RUS,
- Common::kPlatformWindows,
- ADGF_DROPPLATFORM,
- NANCY8_GUIOPTIONS
- },
- kGameTypeNancy8
+ "nancy8", nullptr,
+ AD_ENTRY1s("ciftree.dat", "9ed40f0bcc1d9e3e38e127bfbc6797d7", 20358011),
+ Common::RU_RUS,
+ Common::kPlatformWindows,
+ ADGF_DROPPLATFORM,
+ NANCY_GUIOPTIONS
},
{ // MD5 by fracturehill
+ "nancy8", nullptr,
{
- "nancy8", nullptr,
- {
- { "data1.cab", 0, "d9cc1694249e2084ccf5afa2a2398f80", 3297523 },
- { "data1.hdr", 0, "e2440f9e2ce02bc1aace6a376c9a9939", 303244 },
- { "data2.cab", 0, "448974e37758bd91f81f92f508cbffd5", 379253931 },
- { "is:data1.cab:ciftree.dat", 0, "A:9ed40f0bcc1d9e3e38e127bfbc6797d7", 20358011 },
- AD_LISTEND
- },
- Common::RU_RUS,
- Common::kPlatformWindows,
- ADGF_DROPPLATFORM,
- NANCY8_GUIOPTIONS
+ { "data1.cab", 0, "d9cc1694249e2084ccf5afa2a2398f80", 3297523 },
+ { "data1.hdr", 0, "e2440f9e2ce02bc1aace6a376c9a9939", 303244 },
+ { "data2.cab", 0, "448974e37758bd91f81f92f508cbffd5", 379253931 },
+ { "is:data1.cab:ciftree.dat", 0, "A:9ed40f0bcc1d9e3e38e127bfbc6797d7", 20358011 },
+ AD_LISTEND
},
- kGameTypeNancy8
+ Common::RU_RUS,
+ Common::kPlatformWindows,
+ ADGF_DROPPLATFORM,
+ NANCY_GUIOPTIONS
},
{ // MD5 by fracturehill
+ "nancy9", nullptr,
{
- "nancy9", nullptr,
- {
- { "ciftree.dat", 0, "3a756e09631f4a2c8f48bf316e77b5d5", 26610718 },
- { "andyfid.avf", 0, "4e11e5237e6776e342df6262fc930142", 1171821 },
- AD_LISTEND
- },
- Common::EN_ANY,
- Common::kPlatformWindows,
- ADGF_DROPPLATFORM,
- NANCY8_GUIOPTIONS
+ { "ciftree.dat", 0, "3a756e09631f4a2c8f48bf316e77b5d5", 26610718 },
+ { "andyfid.avf", 0, "4e11e5237e6776e342df6262fc930142", 1171821 },
+ AD_LISTEND
},
- kGameTypeNancy9
+ Common::EN_ANY,
+ Common::kPlatformWindows,
+ ADGF_DROPPLATFORM,
+ NANCY_GUIOPTIONS
},
{ // MD5 by fracturehill
+ "nancy9", nullptr,
{
- "nancy9", nullptr,
- {
- { "data1.hdr", 0, "6dcc79a737b5275d431087b36fb81c88", 403996 },
- { "data1.cab", 0, "1b1c1067b46ead0771485948bcfd8320", 6874331 },
- { "data2.cab", 0, "d0c4a054d38de8dc85e9fde9667fff31", 115877879 },
- { "ciftree.dat", 0, "3a756e09631f4a2c8f48bf316e77b5d5", 26610718 }, // ciftree is outside of cabfiles
- AD_LISTEND
- },
- Common::EN_ANY,
- Common::kPlatformWindows,
- ADGF_DROPPLATFORM,
- NANCY8_GUIOPTIONS
+ { "data1.hdr", 0, "6dcc79a737b5275d431087b36fb81c88", 403996 },
+ { "data1.cab", 0, "1b1c1067b46ead0771485948bcfd8320", 6874331 },
+ { "data2.cab", 0, "d0c4a054d38de8dc85e9fde9667fff31", 115877879 },
+ { "ciftree.dat", 0, "3a756e09631f4a2c8f48bf316e77b5d5", 26610718 }, // ciftree is outside of cabfiles
+ AD_LISTEND
},
- kGameTypeNancy9
+ Common::EN_ANY,
+ Common::kPlatformWindows,
+ ADGF_DROPPLATFORM,
+ NANCY_GUIOPTIONS
},
{ // MD5 by BacchusEmperor
+ "nancy9", nullptr,
{
- "nancy9", nullptr,
- {
- {"ciftree.dat", 0, "aa4148aa2f443b9c73ae6a86d2d4c524", 27850353},
- {"andyfid.avf", 0, "4e11e5237e6776e342df6262fc930142", 1171821},
- AD_LISTEND
- },
- Common::RU_RUS,
- Common::kPlatformWindows,
- ADGF_DROPPLATFORM,
- NANCY8_GUIOPTIONS
+ {"ciftree.dat", 0, "aa4148aa2f443b9c73ae6a86d2d4c524", 27850353},
+ {"andyfid.avf", 0, "4e11e5237e6776e342df6262fc930142", 1171821},
+ AD_LISTEND
},
- kGameTypeNancy9
+ Common::RU_RUS,
+ Common::kPlatformWindows,
+ ADGF_DROPPLATFORM,
+ NANCY_GUIOPTIONS
},
{
+ "nancy10", nullptr,
{
- "nancy10", nullptr,
- {
- { "ciftree.dat", 0, "270133c5e89b8538caef08041598d049", 29413095 },
- { "den_cal_back16.avf", 0, "ee6c779d1bc61a6483f9166aa20e4545", 324644 },
- AD_LISTEND
- },
- Common::EN_ANY,
- Common::kPlatformWindows,
- ADGF_TESTING | ADGF_DROPPLATFORM,
- NANCY8_GUIOPTIONS
+ { "ciftree.dat", 0, "270133c5e89b8538caef08041598d049", 29413095 },
+ { "den_cal_back16.avf", 0, "ee6c779d1bc61a6483f9166aa20e4545", 324644 },
+ AD_LISTEND
},
- kGameTypeNancy10
+ Common::EN_ANY,
+ Common::kPlatformWindows,
+ ADGF_TESTING | ADGF_DROPPLATFORM,
+ NANCY_GUIOPTIONS
},
{
+ "nancy10", nullptr,
{
- "nancy10", nullptr,
- {
- { "data1.hdr", 0, "fb73756ee951627e97f859ff27182e6f", 394467 },
- { "data1.cab", 0, "d72b503642cb2533bcc6ce2b0ca463ac", 7510894 },
- { "data2.cab", 0, "63b9d6400a241fc0777ec8ad3e3c4076", 150997862 },
- { "ciftree.dat", 0, "270133c5e89b8538caef08041598d049", 29413095 }, // ciftree is outside of cabfiles
- AD_LISTEND
- },
- Common::EN_ANY,
- Common::kPlatformWindows,
- ADGF_TESTING | ADGF_DROPPLATFORM,
- NANCY8_GUIOPTIONS
+ { "data1.hdr", 0, "fb73756ee951627e97f859ff27182e6f", 394467 },
+ { "data1.cab", 0, "d72b503642cb2533bcc6ce2b0ca463ac", 7510894 },
+ { "data2.cab", 0, "63b9d6400a241fc0777ec8ad3e3c4076", 150997862 },
+ { "ciftree.dat", 0, "270133c5e89b8538caef08041598d049", 29413095 }, // ciftree is outside of cabfiles
+ AD_LISTEND
},
- kGameTypeNancy10
+ Common::EN_ANY,
+ Common::kPlatformWindows,
+ ADGF_TESTING | ADGF_DROPPLATFORM,
+ NANCY_GUIOPTIONS
},
{ // v1.01, MD5 by eientei95
+ "nancy10", nullptr,
{
- "nancy10", nullptr,
- {
- { "data1.hdr", 0, "f8a023c14d04ffdae08f1a0bb8a1fd2a", 394956 },
- { "data1.cab", 0, "829ab79c4a5c49f918b7c22186eb7365", 7510894 },
- { "data2.cab", 0, "a4af0fb92bd2d91d5ec7b2f9233a7355", 150997862 },
- { "ciftree.dat", 0, "270133c5e89b8538caef08041598d049", 29413095 }, // ciftree is outside of cabfiles
- AD_LISTEND
- },
- Common::EN_ANY,
- Common::kPlatformWindows,
- ADGF_TESTING | ADGF_DROPPLATFORM,
- NANCY8_GUIOPTIONS
+ { "data1.hdr", 0, "f8a023c14d04ffdae08f1a0bb8a1fd2a", 394956 },
+ { "data1.cab", 0, "829ab79c4a5c49f918b7c22186eb7365", 7510894 },
+ { "data2.cab", 0, "a4af0fb92bd2d91d5ec7b2f9233a7355", 150997862 },
+ { "ciftree.dat", 0, "270133c5e89b8538caef08041598d049", 29413095 }, // ciftree is outside of cabfiles
+ AD_LISTEND
},
- kGameTypeNancy10
+ Common::EN_ANY,
+ Common::kPlatformWindows,
+ ADGF_TESTING | ADGF_DROPPLATFORM,
+ NANCY_GUIOPTIONS
},
{ // v1.01 from Nancy Drew: Ultimate Dare, MD5 by eientei95
+ "nancy10", nullptr,
{
- "nancy10", nullptr,
- {
- { "data1.hdr", 0, "0f9223c701af38398f101e4c29c71d27", 392284 },
- { "data1.cab", 0, "752ccf625189520d8221eafd5c896845", 7513583 },
- { "data2.cab", 0, "8b481aac1b07838bdb4d578a8aeb9676", 574477161 },
- AD_LISTEND
- },
- Common::EN_ANY,
- Common::kPlatformWindows,
- ADGF_TESTING | ADGF_DROPPLATFORM,
- NANCY8_GUIOPTIONS
+ { "data1.hdr", 0, "0f9223c701af38398f101e4c29c71d27", 392284 },
+ { "data1.cab", 0, "752ccf625189520d8221eafd5c896845", 7513583 },
+ { "data2.cab", 0, "8b481aac1b07838bdb4d578a8aeb9676", 574477161 },
+ AD_LISTEND
},
- kGameTypeNancy10
+ Common::EN_ANY,
+ Common::kPlatformWindows,
+ ADGF_TESTING | ADGF_DROPPLATFORM,
+ NANCY_GUIOPTIONS
},
{ // MD5 by BacchusEmperor
+ "nancy10", nullptr,
{
- "nancy10", nullptr,
- {
- { "ciftree.dat", 0, "67dcb5e1e4c92fc0676fd388dac54a3a", 30400802 },
- { "den_cal_back16.avf", 0, "ee6c779d1bc61a6483f9166aa20e4545", 324644 },
- AD_LISTEND
- },
- Common::RU_RUS,
- Common::kPlatformWindows,
- ADGF_TESTING | ADGF_DROPPLATFORM,
- NANCY8_GUIOPTIONS
+ { "ciftree.dat", 0, "67dcb5e1e4c92fc0676fd388dac54a3a", 30400802 },
+ { "den_cal_back16.avf", 0, "ee6c779d1bc61a6483f9166aa20e4545", 324644 },
+ AD_LISTEND
},
- kGameTypeNancy10
+ Common::RU_RUS,
+ Common::kPlatformWindows,
+ ADGF_TESTING | ADGF_DROPPLATFORM,
+ NANCY_GUIOPTIONS
},
{ // MD5 by bluegr
+ "nancy10", nullptr,
{
- "nancy10", nullptr,
- {
- { "data1.hdr", 0, "7abaa03cb0cf1a064c0e729ca42792a8", 421564 },
- { "data1.cab", 0, "897a74f32eb8720685f53f7cbbab3456", 3204160 },
- { "data2.cab", 0, "45ec22fa05a0b80589bca9bcde8f2196", 612636835 },
- {"is:data1.cab:ciftree.dat", 0, "A:67dcb5e1e4c92fc0676fd388dac54a3a", 30400802},
- AD_LISTEND
- },
- Common::RU_RUS,
- Common::kPlatformWindows,
- ADGF_TESTING | ADGF_DROPPLATFORM,
- NANCY8_GUIOPTIONS
+ { "data1.hdr", 0, "7abaa03cb0cf1a064c0e729ca42792a8", 421564 },
+ { "data1.cab", 0, "897a74f32eb8720685f53f7cbbab3456", 3204160 },
+ { "data2.cab", 0, "45ec22fa05a0b80589bca9bcde8f2196", 612636835 },
+ {"is:data1.cab:ciftree.dat", 0, "A:67dcb5e1e4c92fc0676fd388dac54a3a", 30400802},
+ AD_LISTEND
},
- kGameTypeNancy10
+ Common::RU_RUS,
+ Common::kPlatformWindows,
+ ADGF_TESTING | ADGF_DROPPLATFORM,
+ NANCY_GUIOPTIONS
},
{
+ "nancy11", nullptr,
{
- "nancy11", nullptr,
- {
- { "ciftree.dat", 0, "3c406d4f391b6536982c6081f2dd1f4e", 55960641 },
- { "gre_oil_cinematic.bik", 0, "28a2b6f939f1c7795e47a99337d7343a", 21514180 },
- AD_LISTEND
- },
- Common::EN_ANY,
- Common::kPlatformWindows,
- ADGF_TESTING | ADGF_DROPPLATFORM,
- NANCY8_GUIOPTIONS
+ { "ciftree.dat", 0, "3c406d4f391b6536982c6081f2dd1f4e", 55960641 },
+ { "gre_oil_cinematic.bik", 0, "28a2b6f939f1c7795e47a99337d7343a", 21514180 },
+ AD_LISTEND
},
- kGameTypeNancy11
+ Common::EN_ANY,
+ Common::kPlatformWindows,
+ ADGF_TESTING | ADGF_DROPPLATFORM,
+ NANCY_GUIOPTIONS
},
{
+ "nancy11", nullptr,
{
- "nancy11", nullptr,
- {
- { "data1.hdr", 0, "ac8c62e5db77edff6265d80238c0f2c5", 375104 },
- { "data1.cab", 0, "17aed043f3f1247a97f32ce950ec1cab", 8055234 },
- { "data2.cab", 0, "42756dd5c89779d03bfcf4636912ef73", 149200126 },
- { "ciftree.dat", 0, "3c406d4f391b6536982c6081f2dd1f4e", 55960641 }, // ciftree is outside of cabfiles
- AD_LISTEND
- },
- Common::EN_ANY,
- Common::kPlatformWindows,
- ADGF_TESTING | ADGF_DROPPLATFORM,
- NANCY8_GUIOPTIONS
+ { "data1.hdr", 0, "ac8c62e5db77edff6265d80238c0f2c5", 375104 },
+ { "data1.cab", 0, "17aed043f3f1247a97f32ce950ec1cab", 8055234 },
+ { "data2.cab", 0, "42756dd5c89779d03bfcf4636912ef73", 149200126 },
+ { "ciftree.dat", 0, "3c406d4f391b6536982c6081f2dd1f4e", 55960641 }, // ciftree is outside of cabfiles
+ AD_LISTEND
},
- kGameTypeNancy11
+ Common::EN_ANY,
+ Common::kPlatformWindows,
+ ADGF_TESTING | ADGF_DROPPLATFORM,
+ NANCY_GUIOPTIONS
},
{ // MD5 by BacchusEmperor
+ "nancy11", nullptr,
{
- "nancy11", nullptr,
- {
- { "ciftree.dat", 0, "8998deb416fc243a6dd9b19a776919dc", 57486384 },
- { "gre_oil_cinematic.bik", 0, "28a2b6f939f1c7795e47a99337d7343a", 21514180 },
- AD_LISTEND
- },
- Common::RU_RUS,
- Common::kPlatformWindows,
- ADGF_TESTING | ADGF_DROPPLATFORM,
- NANCY8_GUIOPTIONS
+ { "ciftree.dat", 0, "8998deb416fc243a6dd9b19a776919dc", 57486384 },
+ { "gre_oil_cinematic.bik", 0, "28a2b6f939f1c7795e47a99337d7343a", 21514180 },
+ AD_LISTEND
},
- kGameTypeNancy11
+ Common::RU_RUS,
+ Common::kPlatformWindows,
+ ADGF_TESTING | ADGF_DROPPLATFORM,
+ NANCY_GUIOPTIONS
},
{ // MD5 by bluegr
- {
- "nancy12", nullptr,
- AD_ENTRY1s("ciftree.dat", "b71cc174ce0481be835360395864eeb1", 43101199),
- Common::EN_ANY,
- Common::kPlatformWindows,
- ADGF_TESTING | ADGF_DROPPLATFORM,
- NANCY8_GUIOPTIONS
- },
- kGameTypeNancy12
+ "nancy12", nullptr,
+ AD_ENTRY1s("ciftree.dat", "b71cc174ce0481be835360395864eeb1", 43101199),
+ Common::EN_ANY,
+ Common::kPlatformWindows,
+ ADGF_TESTING | ADGF_DROPPLATFORM,
+ NANCY_GUIOPTIONS
},
{ // MD5 by tunnelsociety from bug #17000
- {
- "nancy12", nullptr,
- AD_ENTRY1s("ciftree.dat", "816db22b5c4d5211336b742fee8ea080", 45822011),
- Common::FR_FRA,
- Common::kPlatformWindows,
- ADGF_TESTING | ADGF_DROPPLATFORM,
- NANCY8_GUIOPTIONS
- },
- kGameTypeNancy12
+ "nancy12", nullptr,
+ AD_ENTRY1s("ciftree.dat", "816db22b5c4d5211336b742fee8ea080", 45822011),
+ Common::FR_FRA,
+ Common::kPlatformWindows,
+ ADGF_TESTING | ADGF_DROPPLATFORM,
+ NANCY_GUIOPTIONS
},
{ // MD5 by BacchusEmperor
- {
- "nancy12", nullptr,
- AD_ENTRY1s("ciftree.dat", "e8c66d9f9569bf35bf77ca5bdfd8423f", 40988114),
- Common::RU_RUS,
- Common::kPlatformWindows,
- ADGF_TESTING | ADGF_DROPPLATFORM,
- NANCY8_GUIOPTIONS
- },
- kGameTypeNancy12
+ "nancy12", nullptr,
+ AD_ENTRY1s("ciftree.dat", "e8c66d9f9569bf35bf77ca5bdfd8423f", 40988114),
+ Common::RU_RUS,
+ Common::kPlatformWindows,
+ ADGF_TESTING | ADGF_DROPPLATFORM,
+ NANCY_GUIOPTIONS
},
{ // MD5 by bluegr
- {
- "nancy13", nullptr,
- AD_ENTRY1s("ciftree.dat", "9d39bd2ff549c83a8300fae70e057593", 58580545),
- Common::EN_ANY,
- Common::kPlatformWindows,
- ADGF_TESTING | ADGF_DROPPLATFORM,
- NANCY8_GUIOPTIONS
- },
- kGameTypeNancy13
+ "nancy13", nullptr,
+ AD_ENTRY1s("ciftree.dat", "9d39bd2ff549c83a8300fae70e057593", 58580545),
+ Common::EN_ANY,
+ Common::kPlatformWindows,
+ ADGF_TESTING | ADGF_DROPPLATFORM,
+ NANCY_GUIOPTIONS
},
{ // MD5 by owow126 from bug #17262 - version from Big Fish Games
- {
- "nancy13", nullptr,
- AD_ENTRY1s("ciftree.dat", "c8eb114bff0b700c3ab805f02a2f0d0f", 58578828),
- Common::EN_ANY,
- Common::kPlatformWindows,
- ADGF_TESTING | ADGF_DROPPLATFORM,
- NANCY8_GUIOPTIONS
- },
- kGameTypeNancy13
+ "nancy13", nullptr,
+ AD_ENTRY1s("ciftree.dat", "c8eb114bff0b700c3ab805f02a2f0d0f", 58578828),
+ Common::EN_ANY,
+ Common::kPlatformWindows,
+ ADGF_TESTING | ADGF_DROPPLATFORM,
+ NANCY_GUIOPTIONS
},
{ // MD5 by webangel3 from bug #17397
- {
- "nancy13", nullptr,
- AD_ENTRY1s("ciftree.dat", "9d39bd2ff549c83a8300fae70e057593", 58580611),
- Common::EN_ANY,
- Common::kPlatformWindows,
- ADGF_TESTING | ADGF_DROPPLATFORM,
- NANCY8_GUIOPTIONS
- },
- kGameTypeNancy13
+ "nancy13", nullptr,
+ AD_ENTRY1s("ciftree.dat", "9d39bd2ff549c83a8300fae70e057593", 58580611),
+ Common::EN_ANY,
+ Common::kPlatformWindows,
+ ADGF_TESTING | ADGF_DROPPLATFORM,
+ NANCY_GUIOPTIONS
},
{ // MD5 by BacchusEmperor from bug #17316
- {
- "nancy13", nullptr,
- AD_ENTRY1s("ciftree.dat", "7d79b72e58d942f2fce00e90fb9b5dc3", 72327850),
- Common::RU_RUS,
- Common::kPlatformWindows,
- ADGF_TESTING | ADGF_DROPPLATFORM,
- NANCY8_GUIOPTIONS
- },
- kGameTypeNancy13
+ "nancy13", nullptr,
+ AD_ENTRY1s("ciftree.dat", "7d79b72e58d942f2fce00e90fb9b5dc3", 72327850),
+ Common::RU_RUS,
+ Common::kPlatformWindows,
+ ADGF_TESTING | ADGF_DROPPLATFORM,
+ NANCY_GUIOPTIONS
},
{ // MD5 by bluegr
- {
- "nancy14", nullptr,
- AD_ENTRY1s("ciftree.dat", "731ae1a9e194757c6d23fda799142bd7", 44679840),
- Common::EN_ANY,
- Common::kPlatformWindows,
- ADGF_TESTING | ADGF_DROPPLATFORM,
- NANCY8_GUIOPTIONS
- },
- kGameTypeNancy14
+ "nancy14", nullptr,
+ AD_ENTRY1s("ciftree.dat", "731ae1a9e194757c6d23fda799142bd7", 44679840),
+ Common::EN_ANY,
+ Common::kPlatformWindows,
+ ADGF_TESTING | ADGF_DROPPLATFORM,
+ NANCY_GUIOPTIONS
},
{ // MD5 by BacchusEmperor from bug #17317
- {
- "nancy14", nullptr,
- AD_ENTRY1s("ciftree.dat", "e0743aa7285852d10e95ca2480260e59", 48288815),
- Common::RU_RUS,
- Common::kPlatformWindows,
- ADGF_TESTING | ADGF_DROPPLATFORM,
- NANCY8_GUIOPTIONS
- },
- kGameTypeNancy14
+ "nancy14", nullptr,
+ AD_ENTRY1s("ciftree.dat", "e0743aa7285852d10e95ca2480260e59", 48288815),
+ Common::RU_RUS,
+ Common::kPlatformWindows,
+ ADGF_TESTING | ADGF_DROPPLATFORM,
+ NANCY_GUIOPTIONS
},
{ // MD5 by bluegr
- {
- "nancy15", nullptr,
- AD_ENTRY1s("ciftree.dat", "9c5af8a00225a528fe03f52d3664740d", 38659635),
- Common::EN_ANY,
- Common::kPlatformWindows,
- ADGF_TESTING | ADGF_DROPPLATFORM,
- NANCY8_GUIOPTIONS
- },
- kGameTypeNancy15
+ "nancy15", nullptr,
+ AD_ENTRY1s("ciftree.dat", "9c5af8a00225a528fe03f52d3664740d", 38659635),
+ Common::EN_ANY,
+ Common::kPlatformWindows,
+ ADGF_TESTING | ADGF_DROPPLATFORM,
+ NANCY_GUIOPTIONS
},
{ // MD5 by bluegr
+ "nancy15", nullptr,
{
- "nancy15", nullptr,
- {
- {"data1.cab", 0, "64a4c8a731ca8e66f3ce09ca54511c77", 10632067},
- {"data1.hdr", 0, "5ab2f3e387907796e8c177c0d15b92c3", 444368},
- {"data2.cab", 0, "5c6e80b06e9fb2387002cdc48585fad0", 669384704},
- {"data3.cab", 0, "2a8515f92971875f847dbaf58cc3f7e5", 344245326},
- {"is:data1.cab:ciftree.dat", 0, "A:9c5af8a00225a528fe03f52d3664740d", 38659635},
- },
- Common::EN_ANY,
- Common::kPlatformWindows,
- ADGF_TESTING | ADGF_DROPPLATFORM,
- NANCY8_GUIOPTIONS
+ {"data1.cab", 0, "64a4c8a731ca8e66f3ce09ca54511c77", 10632067},
+ {"data1.hdr", 0, "5ab2f3e387907796e8c177c0d15b92c3", 444368},
+ {"data2.cab", 0, "5c6e80b06e9fb2387002cdc48585fad0", 669384704},
+ {"data3.cab", 0, "2a8515f92971875f847dbaf58cc3f7e5", 344245326},
+ {"is:data1.cab:ciftree.dat", 0, "A:9c5af8a00225a528fe03f52d3664740d", 38659635},
},
- kGameTypeNancy15
+ Common::EN_ANY,
+ Common::kPlatformWindows,
+ ADGF_TESTING | ADGF_DROPPLATFORM,
+ NANCY_GUIOPTIONS
},
{ // MD5 by BacchusEmperor from bug #17318
- {
- "nancy15", nullptr,
- AD_ENTRY1s("ciftree.dat", "981b1d2c25be2de48cd09d42329acd1f", 90838797),
- Common::RU_RUS,
- Common::kPlatformWindows,
- ADGF_TESTING | ADGF_DROPPLATFORM,
- NANCY8_GUIOPTIONS
- },
- kGameTypeNancy15
+ "nancy15", nullptr,
+ AD_ENTRY1s("ciftree.dat", "981b1d2c25be2de48cd09d42329acd1f", 90838797),
+ Common::RU_RUS,
+ Common::kPlatformWindows,
+ ADGF_TESTING | ADGF_DROPPLATFORM,
+ NANCY_GUIOPTIONS
},
{ // MD5 by bluegr
- {
- "nancy16", nullptr,
- AD_ENTRY1s("ciftree.dat", "4014eba84276281456cdba1fa9c03389", 45713842),
- Common::EN_ANY,
- Common::kPlatformWindows,
- ADGF_UNSTABLE | ADGF_DROPPLATFORM,
- NANCY8_GUIOPTIONS
- },
- kGameTypeNancy16
+ "nancy16", nullptr,
+ AD_ENTRY1s("ciftree.dat", "4014eba84276281456cdba1fa9c03389", 45713842),
+ Common::EN_ANY,
+ Common::kPlatformWindows,
+ ADGF_UNSTABLE | ADGF_DROPPLATFORM,
+ NANCY_GUIOPTIONS
},
{ // MD5 by eientei95
- {
- "nancy16", nullptr,
- AD_ENTRY1s("ciftree.dat", "dcc8ab339061dbd855ff158548543dcc", 1257169),
- Common::EN_ANY,
- Common::kPlatformWii,
- ADGF_UNSUPPORTED | ADGF_DROPPLATFORM,
- NANCY8_GUIOPTIONS
- },
- kGameTypeNancy16
+ "nancy16", nullptr,
+ AD_ENTRY1s("ciftree.dat", "dcc8ab339061dbd855ff158548543dcc", 1257169),
+ Common::EN_ANY,
+ Common::kPlatformWii,
+ ADGF_UNSUPPORTED | ADGF_DROPPLATFORM,
+ NANCY_GUIOPTIONS
},
{ // MD5 by bluegr
- {
- "nancy17", nullptr,
- AD_ENTRY1s("ciftree.dat", "039950bfb8d1d614727ace5359ba6e20", 55775218),
- Common::EN_ANY,
- Common::kPlatformWindows,
- ADGF_UNSTABLE | ADGF_DROPPLATFORM,
- NANCY8_GUIOPTIONS
- },
- kGameTypeNancy17
+ "nancy17", nullptr,
+ AD_ENTRY1s("ciftree.dat", "039950bfb8d1d614727ace5359ba6e20", 55775218),
+ Common::EN_ANY,
+ Common::kPlatformWindows,
+ ADGF_UNSTABLE | ADGF_DROPPLATFORM,
+ NANCY_GUIOPTIONS
},
{ // MD5 by bluegr
- {
- "nancy18", nullptr,
- AD_ENTRY1s("ciftree.dat", "f414a802b64d3a9e28ba8e69e953a2b8", 50123969),
- Common::EN_ANY,
- Common::kPlatformWindows,
- ADGF_UNSTABLE | ADGF_DROPPLATFORM,
- NANCY8_GUIOPTIONS
- },
- kGameTypeNancy18
+ "nancy18", nullptr,
+ AD_ENTRY1s("ciftree.dat", "f414a802b64d3a9e28ba8e69e953a2b8", 50123969),
+ Common::EN_ANY,
+ Common::kPlatformWindows,
+ ADGF_UNSTABLE | ADGF_DROPPLATFORM,
+ NANCY_GUIOPTIONS
},
{ // MD5 by bluegr
- {
- "nancy19", nullptr,
- AD_ENTRY1s("ciftree.dat", "e1d50b6fc3b72335863a45fdaf6f3da7", 53613856),
- Common::EN_ANY,
- Common::kPlatformWindows,
- ADGF_UNSTABLE | ADGF_DROPPLATFORM,
- NANCY8_GUIOPTIONS
- },
- kGameTypeNancy19
+ "nancy19", nullptr,
+ AD_ENTRY1s("ciftree.dat", "e1d50b6fc3b72335863a45fdaf6f3da7", 53613856),
+ Common::EN_ANY,
+ Common::kPlatformWindows,
+ ADGF_UNSTABLE | ADGF_DROPPLATFORM,
+ NANCY_GUIOPTIONS
},
{ // MD5 by bluegr
- {
- "nancy20", nullptr,
- AD_ENTRY1s("ciftree.dat", "02d56eb098f317a02ed9a675f40a4468", 91315479),
- Common::EN_ANY,
- Common::kPlatformWindows,
- ADGF_UNSTABLE | ADGF_DROPPLATFORM,
- NANCY8_GUIOPTIONS
- },
- kGameTypeNancy20
+ "nancy20", nullptr,
+ AD_ENTRY1s("ciftree.dat", "02d56eb098f317a02ed9a675f40a4468", 91315479),
+ Common::EN_ANY,
+ Common::kPlatformWindows,
+ ADGF_UNSTABLE | ADGF_DROPPLATFORM,
+ NANCY_GUIOPTIONS
},
{ // MD5 by bluegr
- {
- "nancy21", nullptr,
- AD_ENTRY1s("ciftree.dat", "25249fabe11f2b865203284e798b8c09", 58348182),
- Common::EN_ANY,
- Common::kPlatformWindows,
- ADGF_UNSTABLE | ADGF_DROPPLATFORM,
- NANCY8_GUIOPTIONS
- },
- kGameTypeNancy21
+ "nancy21", nullptr,
+ AD_ENTRY1s("ciftree.dat", "25249fabe11f2b865203284e798b8c09", 58348182),
+ Common::EN_ANY,
+ Common::kPlatformWindows,
+ ADGF_UNSTABLE | ADGF_DROPPLATFORM,
+ NANCY_GUIOPTIONS
},
{ // MD5 by bluegr
- {
- "nancy22", nullptr,
- AD_ENTRY1s("ciftree.dat", "2aa05fbc4f06f71ed98d092b60043c0e", 109670993),
- Common::EN_ANY,
- Common::kPlatformWindows,
- ADGF_UNSTABLE | ADGF_DROPPLATFORM,
- NANCY8_GUIOPTIONS
- },
- kGameTypeNancy22
+ "nancy22", nullptr,
+ AD_ENTRY1s("ciftree.dat", "2aa05fbc4f06f71ed98d092b60043c0e", 109670993),
+ Common::EN_ANY,
+ Common::kPlatformWindows,
+ ADGF_UNSTABLE | ADGF_DROPPLATFORM,
+ NANCY_GUIOPTIONS
},
{ // MD5 by bluegr
- {
- "nancy1new", nullptr,
- AD_ENTRY1s("ciftree.dat", "27dc04f52f2022c7eae8028b0b0dd215", 15296357),
- Common::EN_ANY,
- Common::kPlatformWindows,
- ADGF_UNSTABLE | ADGF_DROPPLATFORM,
- NANCY8_GUIOPTIONS
- },
- kGameTypeNancy1New
+ "nancy1new", nullptr,
+ AD_ENTRY1s("ciftree.dat", "27dc04f52f2022c7eae8028b0b0dd215", 15296357),
+ Common::EN_ANY,
+ Common::kPlatformWindows,
+ ADGF_UNSTABLE | ADGF_DROPPLATFORM,
+ NANCY_GUIOPTIONS
},
{ // MD5 by mmogas
- {
- "nancy1new", nullptr,
- AD_ENTRY1s("ciftree.dat", "2f0c77c84bb5533f5bc6ec824ddf4c31", 14936536),
- Common::ES_ESP,
- Common::kPlatformWindows,
- ADGF_UNSUPPORTED | ADGF_DROPPLATFORM,
- NANCY8_GUIOPTIONS
- },
- kGameTypeNancy1New
+ "nancy1new", nullptr,
+ AD_ENTRY1s("ciftree.dat", "2f0c77c84bb5533f5bc6ec824ddf4c31", 14936536),
+ Common::ES_ESP,
+ Common::kPlatformWindows,
+ ADGF_UNSUPPORTED | ADGF_DROPPLATFORM,
+ NANCY_GUIOPTIONS
},
{ // MD5 by bluegr
- {
- "nancy23", nullptr,
- AD_ENTRY1s("ciftree.dat", "f4924338a66dd2cf65953c2d6856ca40", 65354322),
- Common::EN_ANY,
- Common::kPlatformWindows,
- ADGF_UNSTABLE | ADGF_DROPPLATFORM,
- NANCY8_GUIOPTIONS
- },
- kGameTypeNancy23
+ "nancy23", nullptr,
+ AD_ENTRY1s("ciftree.dat", "f4924338a66dd2cf65953c2d6856ca40", 65354322),
+ Common::EN_ANY,
+ Common::kPlatformWindows,
+ ADGF_UNSTABLE | ADGF_DROPPLATFORM,
+ NANCY_GUIOPTIONS
},
// Do not delete
- { AD_TABLE_END_MARKER, kGameTypeNone }
+ AD_TABLE_END_MARKER
};
} // End of namespace Nancy
diff --git a/engines/nancy/metaengine.cpp b/engines/nancy/metaengine.cpp
index 1a809f26a11..48f915eb4a4 100644
--- a/engines/nancy/metaengine.cpp
+++ b/engines/nancy/metaengine.cpp
@@ -21,6 +21,7 @@
#include "engines/advancedDetector.h"
+#include "engines/nancy/detection.h"
#include "engines/nancy/nancy.h"
#include "engines/nancy/graphics.h"
#include "engines/nancy/input.h"
@@ -112,14 +113,14 @@ static const ADExtraGuiOptionsMap optionsList[] = {
AD_EXTRA_GUI_OPTIONS_TERMINATOR
};
-class NancyMetaEngine : public AdvancedMetaEngine<Nancy::NancyGameDescription> {
+class NancyMetaEngine : public AdvancedMetaEngine<ADGameDescription> {
public:
const char *getName() const override {
return "nancy";
}
bool hasFeature(MetaEngineFeature f) const override;
- Common::Error createInstance(OSystem *syst, Engine **engine, const Nancy::NancyGameDescription *gd) const override;
+ Common::Error createInstance(OSystem *syst, Engine **engine, const ADGameDescription *gd) const override;
int getMaximumSaveSlot() const override;
SaveStateDescriptor querySaveMetaInfos(const char *target, int slot) const override;
@@ -131,6 +132,8 @@ public:
void registerDefaultSettings(const Common::String &target) const override;
const ADExtraGuiOptionsMap *getAdvancedExtraGuiOptions() const override;
+
+ Nancy::GameType getGameType(const char *gameId) const;
};
Common::KeymapArray NancyMetaEngine::initKeymaps(const char *target) const {
@@ -145,21 +148,39 @@ bool NancyMetaEngine::hasFeature(MetaEngineFeature f) const {
checkExtendedSaves(f);
}
-Common::Error NancyMetaEngine::createInstance(OSystem *syst, Engine **engine, const Nancy::NancyGameDescription *gd) const {
+Nancy::GameType NancyMetaEngine::getGameType(const char *gameId) const {
+ const Nancy::GameIdToType *gameInfo = Nancy::gameIdToType;
+
+ while (gameInfo->gameId != nullptr) {
+ if (!strcmp(gameId, gameInfo->gameId))
+ return gameInfo->gameType;
+ gameInfo++;
+ }
+
+ error("Unknown game ID: %s", gameId);
+}
+
+Common::Error NancyMetaEngine::createInstance(OSystem *syst, Engine **engine, const ADGameDescription *gd) const {
+ if (!gd) {
+ return Common::Error(Common::kUnsupportedGameidError, _s("Game description is null"));
+ }
+
+ Nancy::GameType gameType = getGameType(gd->gameId);
+
#ifndef ENABLE_NANCY_V3A
- if (gd && gd->gameType == Nancy::kGameTypeNancy18) {
+ if (gameType == Nancy::kGameTypeNancy18) {
return Common::Error(Common::kUnsupportedGameidError, _s("Support for Nancy Drew 18 is not compiled in"));
}
#endif
#ifndef ENABLE_NANCY_V4
- if (gd && gd->gameType >= Nancy::kGameTypeNancy19) {
+ if (gameType >= Nancy::kGameTypeNancy19) {
return Common::Error(Common::kUnsupportedGameidError, _s("Support for Nancy Drew 19 and newer is not compiled in"));
}
#endif
if (gd) {
- *engine = Nancy::NancyEngine::create(gd->gameType, syst, gd);
+ *engine = Nancy::NancyEngine::create(gameType, syst, gd);
}
if (gd) {
diff --git a/engines/nancy/nancy.cpp b/engines/nancy/nancy.cpp
index aa04a2d6de7..84bc9d250d3 100644
--- a/engines/nancy/nancy.cpp
+++ b/engines/nancy/nancy.cpp
@@ -61,14 +61,15 @@ namespace Nancy {
NancyEngine *g_nancy;
-NancyEngine::NancyEngine(OSystem *syst, const NancyGameDescription *gd) :
+NancyEngine::NancyEngine(GameType type, OSystem *syst, const ADGameDescription *gd) :
Engine(syst),
_gameDescription(gd),
+ _gameType(type),
_system(syst),
_datFileMajorVersion(1),
_datFileMinorVersion(0),
- _false(gd->gameType <= kGameTypeNancy2 ? 1 : 0),
- _true(gd->gameType <= kGameTypeNancy2 ? 2 : 1) {
+ _false(type <= kGameTypeNancy2 ? 1 : 0),
+ _true(type <= kGameTypeNancy2 ? 2 : 1) {
g_nancy = this;
@@ -109,9 +110,9 @@ NancyEngine::~NancyEngine() {
}
}
-NancyEngine *NancyEngine::create(GameType type, OSystem *syst, const NancyGameDescription *gd) {
+NancyEngine *NancyEngine::create(GameType type, OSystem *syst, const ADGameDescription *gd) {
if (type >= kGameTypeVampire && type <= kGameTypeNancy32) {
- return new NancyEngine(syst, gd);
+ return new NancyEngine(type, syst, gd);
}
error("Unknown GameType");
@@ -207,23 +208,23 @@ const char *NancyEngine::getCopyrightString() const {
}
uint32 NancyEngine::getGameFlags() const {
- return _gameDescription->desc.flags;
+ return _gameDescription->flags;
}
const char *NancyEngine::getGameId() const {
- return _gameDescription->desc.gameId;
+ return _gameDescription->gameId;
}
GameType NancyEngine::getGameType() const {
- return _gameDescription->gameType;
+ return _gameType;
}
Common::Language NancyEngine::getGameLanguage() const {
- return _gameDescription->desc.language;
+ return _gameDescription->language;
}
Common::Platform NancyEngine::getPlatform() const {
- return _gameDescription->desc.platform;
+ return _gameDescription->platform;
}
const StaticData &NancyEngine::getStaticData() const {
@@ -1173,7 +1174,7 @@ void NancyEngine::readDatFile() {
uint32 nextGameOffset = gameType == numGames ? datFile->size() : datFile->readUint32LE();
datFile->seek(thisGameOffset);
- _staticData.readData(*datFile, _gameDescription->desc.language, nextGameOffset, major, minor);
+ _staticData.readData(*datFile, _gameDescription->language, nextGameOffset, major, minor);
delete datFile;
}
diff --git a/engines/nancy/nancy.h b/engines/nancy/nancy.h
index 810aa919b3b..ba3b3e3f6d2 100644
--- a/engines/nancy/nancy.h
+++ b/engines/nancy/nancy.h
@@ -83,8 +83,6 @@ namespace Nancy {
// protagonists each carry their own cell phone
static const int kSavegameVersion = 12;
-struct NancyGameDescription;
-
class ResourceManager;
class IFF;
class InputManager;
@@ -105,10 +103,10 @@ class OverrideRecord;
class NancyEngine : public Engine {
public:
- NancyEngine(OSystem *syst, const NancyGameDescription *gd);
+ NancyEngine(GameType type, OSystem *syst, const ADGameDescription *gd);
~NancyEngine();
- static NancyEngine *create(GameType type, OSystem *syst, const NancyGameDescription *gd);
+ static NancyEngine *create(GameType type, OSystem *syst, const ADGameDescription *gd);
void errorString(const char *buf_input, char *buf_output, int buf_output_size) override;
bool hasFeature(EngineFeature f) const override;
@@ -234,7 +232,8 @@ private:
GameFlow _gameFlow;
OSystem *_system;
- const NancyGameDescription *_gameDescription;
+ const ADGameDescription *_gameDescription;
+ const GameType _gameType;
Common::Array<Common::WeakPtr<DeferredLoader>> _deferredLoaderObjects;
};
Commit: b36b31560c987f2c29b42556f369f5f972610daa
https://github.com/scummvm/scummvm/commit/b36b31560c987f2c29b42556f369f5f972610daa
Author: Filippos Karapetis (bluegr at gmail.com)
Date: 2026-10-31T10:45:22+02:00
Commit Message:
NANCY: Move all resource-related code inside the new resource folder
Changed paths:
A engines/nancy/resource/cif.cpp
A engines/nancy/resource/cif.h
A engines/nancy/resource/decompress.cpp
A engines/nancy/resource/decompress.h
A engines/nancy/resource/iff.cpp
A engines/nancy/resource/iff.h
A engines/nancy/resource/resource.cpp
A engines/nancy/resource/resource.h
A engines/nancy/resource/sound_vorbis.cpp
A engines/nancy/resource/sound_vorbis.h
A engines/nancy/resource/video.cpp
A engines/nancy/resource/video.h
A engines/nancy/resource/xsheetfile.cpp
A engines/nancy/resource/xsheetfile.h
R engines/nancy/cif.cpp
R engines/nancy/cif.h
R engines/nancy/decompress.cpp
R engines/nancy/decompress.h
R engines/nancy/iff.cpp
R engines/nancy/iff.h
R engines/nancy/resource.cpp
R engines/nancy/resource.h
R engines/nancy/sound_vorbis.cpp
R engines/nancy/sound_vorbis.h
R engines/nancy/video.cpp
R engines/nancy/video.h
R engines/nancy/xsheetfile.cpp
R engines/nancy/xsheetfile.h
engines/nancy/action/autotext.cpp
engines/nancy/action/cameraaction.cpp
engines/nancy/action/conversation.cpp
engines/nancy/action/interactivevideo.cpp
engines/nancy/action/inventoryrecords.cpp
engines/nancy/action/miscrecords.cpp
engines/nancy/action/overlay.cpp
engines/nancy/action/puzzle/adjustpuzzle.cpp
engines/nancy/action/puzzle/angletosspuzzle.cpp
engines/nancy/action/puzzle/arcadepuzzle.cpp
engines/nancy/action/puzzle/assemblypuzzle.cpp
engines/nancy/action/puzzle/bballpuzzle.cpp
engines/nancy/action/puzzle/beadpuzzle.cpp
engines/nancy/action/puzzle/blockingpuzzle.cpp
engines/nancy/action/puzzle/blockspuzzle.cpp
engines/nancy/action/puzzle/boardgamepuzzle.cpp
engines/nancy/action/puzzle/bombpuzzle.cpp
engines/nancy/action/puzzle/buildpuzzle.cpp
engines/nancy/action/puzzle/bulpuzzle.cpp
engines/nancy/action/puzzle/cardgamepuzzle.cpp
engines/nancy/action/puzzle/collisionpuzzle.cpp
engines/nancy/action/puzzle/cookingpuzzle.cpp
engines/nancy/action/puzzle/cubepuzzle.cpp
engines/nancy/action/puzzle/cuttingpuzzle.cpp
engines/nancy/action/puzzle/dotconnectpuzzle.cpp
engines/nancy/action/puzzle/drivingpuzzle.cpp
engines/nancy/action/puzzle/dropsortpuzzle.cpp
engines/nancy/action/puzzle/escapegridpuzzle.cpp
engines/nancy/action/puzzle/fishingpuzzle.cpp
engines/nancy/action/puzzle/flashmemorypuzzle.cpp
engines/nancy/action/puzzle/gridmappuzzle.cpp
engines/nancy/action/puzzle/hamradiopuzzle.cpp
engines/nancy/action/puzzle/hangmanpuzzle.cpp
engines/nancy/action/puzzle/lettergridpuzzle.cpp
engines/nancy/action/puzzle/leverpuzzle.cpp
engines/nancy/action/puzzle/magicboxpuzzle.cpp
engines/nancy/action/puzzle/magnetmazepuzzle.cpp
engines/nancy/action/puzzle/matchpuzzle.cpp
engines/nancy/action/puzzle/mazechasepuzzle.cpp
engines/nancy/action/puzzle/memorypuzzle.cpp
engines/nancy/action/puzzle/mindpuzzle.cpp
engines/nancy/action/puzzle/minesweeperpuzzle.cpp
engines/nancy/action/puzzle/minigolfpuzzle.cpp
engines/nancy/action/puzzle/mirrorlightpuzzle.cpp
engines/nancy/action/puzzle/mouselightpuzzle.cpp
engines/nancy/action/puzzle/multibuildpuzzle.cpp
engines/nancy/action/puzzle/necklacepuzzle.cpp
engines/nancy/action/puzzle/onebuildpuzzle.cpp
engines/nancy/action/puzzle/orderingpuzzle.cpp
engines/nancy/action/puzzle/overridelockpuzzle.cpp
engines/nancy/action/puzzle/pachinkopuzzle.cpp
engines/nancy/action/puzzle/paintpuzzle.cpp
engines/nancy/action/puzzle/peepholepuzzle.cpp
engines/nancy/action/puzzle/pegspuzzle.cpp
engines/nancy/action/puzzle/raycastpuzzle.cpp
engines/nancy/action/puzzle/riddlepuzzle.cpp
engines/nancy/action/puzzle/rippedletterpuzzle.cpp
engines/nancy/action/puzzle/rotatinglockpuzzle.cpp
engines/nancy/action/puzzle/safedialpuzzle.cpp
engines/nancy/action/puzzle/scalepuzzle.cpp
engines/nancy/action/puzzle/scopapuzzle.cpp
engines/nancy/action/puzzle/sentrypuzzle.cpp
engines/nancy/action/puzzle/setplayerclock.cpp
engines/nancy/action/puzzle/sewingmachinepuzzle.cpp
engines/nancy/action/puzzle/sliderpuzzle.cpp
engines/nancy/action/puzzle/snowmobilepuzzle.cpp
engines/nancy/action/puzzle/sortpuzzle.cpp
engines/nancy/action/puzzle/soundequalizerpuzzle.cpp
engines/nancy/action/puzzle/soundmatchpuzzle.cpp
engines/nancy/action/puzzle/spigotpuzzle.cpp
engines/nancy/action/puzzle/stakeoutpuzzle.cpp
engines/nancy/action/puzzle/stepobjectspuzzle.cpp
engines/nancy/action/puzzle/tangrampuzzle.cpp
engines/nancy/action/puzzle/telephone.cpp
engines/nancy/action/puzzle/towerpuzzle.cpp
engines/nancy/action/puzzle/turningpuzzle.cpp
engines/nancy/action/puzzle/twodialpuzzle.cpp
engines/nancy/action/puzzle/typingquizpuzzle.cpp
engines/nancy/action/puzzle/weightsortpuzzle.cpp
engines/nancy/action/puzzle/whalesurvivorpuzzle.cpp
engines/nancy/action/puzzle/wordfindpuzzle.cpp
engines/nancy/action/puzzlerecord.cpp
engines/nancy/action/secondarymovie.cpp
engines/nancy/commontypes.cpp
engines/nancy/console.cpp
engines/nancy/cursor.cpp
engines/nancy/font.cpp
engines/nancy/graphics.cpp
engines/nancy/misc/hypertext.cpp
engines/nancy/module.mk
engines/nancy/movieplayer.cpp
engines/nancy/nancy.cpp
engines/nancy/script/luastate.cpp
engines/nancy/script/particles.cpp
engines/nancy/script/records.cpp
engines/nancy/script/ref.cpp
engines/nancy/script/scenecontext.cpp
engines/nancy/script/xsheet.cpp
engines/nancy/sound.cpp
engines/nancy/state/credits.cpp
engines/nancy/state/designselect.cpp
engines/nancy/state/loadsave.cpp
engines/nancy/state/scene.cpp
engines/nancy/state/scenestream.cpp
engines/nancy/ui/fullscreenimage.cpp
engines/nancy/ui/inventorybox.cpp
engines/nancy/ui/ndui/manager.cpp
engines/nancy/ui/taskbar/camera.cpp
engines/nancy/ui/taskbar/cellphonepopup.cpp
engines/nancy/ui/taskbar/conversationpopup.cpp
engines/nancy/ui/taskbar/inventorypopup.cpp
engines/nancy/ui/taskbar/notebookpopup.cpp
engines/nancy/ui/taskbar/scrolltextbox.cpp
engines/nancy/ui/taskbar/taskbar.cpp
diff --git a/engines/nancy/action/autotext.cpp b/engines/nancy/action/autotext.cpp
index f724f15ca91..9971a08c6af 100644
--- a/engines/nancy/action/autotext.cpp
+++ b/engines/nancy/action/autotext.cpp
@@ -25,7 +25,7 @@
#include "engines/nancy/util.h"
#include "engines/nancy/graphics.h"
#include "engines/nancy/nancy.h"
-#include "engines/nancy/resource.h"
+#include "engines/nancy/resource/resource.h"
namespace Nancy {
namespace Action {
diff --git a/engines/nancy/action/cameraaction.cpp b/engines/nancy/action/cameraaction.cpp
index 3336b387163..845227a2148 100644
--- a/engines/nancy/action/cameraaction.cpp
+++ b/engines/nancy/action/cameraaction.cpp
@@ -24,7 +24,7 @@
#include "engines/nancy/graphics.h"
#include "engines/nancy/input.h"
#include "engines/nancy/puzzledata.h"
-#include "engines/nancy/resource.h"
+#include "engines/nancy/resource/resource.h"
#include "engines/nancy/util.h"
#include "engines/nancy/action/cameraaction.h"
diff --git a/engines/nancy/action/conversation.cpp b/engines/nancy/action/conversation.cpp
index d62751a10ef..3f513f78b7b 100644
--- a/engines/nancy/action/conversation.cpp
+++ b/engines/nancy/action/conversation.cpp
@@ -29,9 +29,9 @@
#include "engines/nancy/input.h"
#include "engines/nancy/util.h"
#include "engines/nancy/graphics.h"
-#include "engines/nancy/resource.h"
-#include "engines/nancy/iff.h"
-#include "engines/nancy/xsheetfile.h"
+#include "engines/nancy/resource/resource.h"
+#include "engines/nancy/resource/iff.h"
+#include "engines/nancy/resource/xsheetfile.h"
#include "engines/nancy/action/conversation.h"
#include "engines/nancy/action/actionmanager.h"
diff --git a/engines/nancy/action/interactivevideo.cpp b/engines/nancy/action/interactivevideo.cpp
index 571f3485ed3..bc1b37df4b8 100644
--- a/engines/nancy/action/interactivevideo.cpp
+++ b/engines/nancy/action/interactivevideo.cpp
@@ -21,8 +21,8 @@
#include "engines/nancy/nancy.h"
#include "engines/nancy/util.h"
-#include "engines/nancy/resource.h"
-#include "engines/nancy/video.h"
+#include "engines/nancy/resource/resource.h"
+#include "engines/nancy/resource/video.h"
#include "engines/nancy/input.h"
#include "engines/nancy/action/interactivevideo.h"
diff --git a/engines/nancy/action/inventoryrecords.cpp b/engines/nancy/action/inventoryrecords.cpp
index b42bce142b3..7472e1a8820 100644
--- a/engines/nancy/action/inventoryrecords.cpp
+++ b/engines/nancy/action/inventoryrecords.cpp
@@ -21,7 +21,7 @@
#include "engines/nancy/nancy.h"
#include "engines/nancy/util.h"
-#include "engines/nancy/resource.h"
+#include "engines/nancy/resource/resource.h"
#include "engines/nancy/sound.h"
#include "engines/nancy/action/inventoryrecords.h"
diff --git a/engines/nancy/action/miscrecords.cpp b/engines/nancy/action/miscrecords.cpp
index 72cb5cc5623..1a92523978f 100644
--- a/engines/nancy/action/miscrecords.cpp
+++ b/engines/nancy/action/miscrecords.cpp
@@ -21,7 +21,7 @@
#include "engines/nancy/nancy.h"
#include "engines/nancy/sound.h"
-#include "engines/nancy/resource.h"
+#include "engines/nancy/resource/resource.h"
#include "engines/nancy/graphics.h"
#include "engines/nancy/font.h"
#include "engines/nancy/cursor.h"
diff --git a/engines/nancy/action/overlay.cpp b/engines/nancy/action/overlay.cpp
index 462f6a3b9b7..7b1823b81ec 100644
--- a/engines/nancy/action/overlay.cpp
+++ b/engines/nancy/action/overlay.cpp
@@ -21,7 +21,7 @@
#include "engines/nancy/nancy.h"
#include "engines/nancy/sound.h"
-#include "engines/nancy/resource.h"
+#include "engines/nancy/resource/resource.h"
#include "engines/nancy/util.h"
#include "engines/nancy/input.h"
#include "engines/nancy/cursor.h"
diff --git a/engines/nancy/action/puzzle/adjustpuzzle.cpp b/engines/nancy/action/puzzle/adjustpuzzle.cpp
index 9be449b401f..94de8729d4d 100644
--- a/engines/nancy/action/puzzle/adjustpuzzle.cpp
+++ b/engines/nancy/action/puzzle/adjustpuzzle.cpp
@@ -25,7 +25,7 @@
#include "engines/nancy/cursor.h"
#include "engines/nancy/graphics.h"
#include "engines/nancy/input.h"
-#include "engines/nancy/resource.h"
+#include "engines/nancy/resource/resource.h"
#include "engines/nancy/util.h"
#include "engines/nancy/action/puzzle/adjustpuzzle.h"
diff --git a/engines/nancy/action/puzzle/angletosspuzzle.cpp b/engines/nancy/action/puzzle/angletosspuzzle.cpp
index 480c1d01b6f..7d64b413739 100644
--- a/engines/nancy/action/puzzle/angletosspuzzle.cpp
+++ b/engines/nancy/action/puzzle/angletosspuzzle.cpp
@@ -21,7 +21,7 @@
#include "engines/nancy/nancy.h"
#include "engines/nancy/graphics.h"
-#include "engines/nancy/resource.h"
+#include "engines/nancy/resource/resource.h"
#include "engines/nancy/sound.h"
#include "engines/nancy/input.h"
#include "engines/nancy/util.h"
diff --git a/engines/nancy/action/puzzle/arcadepuzzle.cpp b/engines/nancy/action/puzzle/arcadepuzzle.cpp
index 5459d9f364c..ebd1d5db1aa 100644
--- a/engines/nancy/action/puzzle/arcadepuzzle.cpp
+++ b/engines/nancy/action/puzzle/arcadepuzzle.cpp
@@ -24,7 +24,7 @@
#include "engines/nancy/nancy.h"
#include "engines/nancy/graphics.h"
-#include "engines/nancy/resource.h"
+#include "engines/nancy/resource/resource.h"
#include "engines/nancy/sound.h"
#include "engines/nancy/input.h"
#include "engines/nancy/util.h"
diff --git a/engines/nancy/action/puzzle/assemblypuzzle.cpp b/engines/nancy/action/puzzle/assemblypuzzle.cpp
index 8029533a0ed..09c5d812546 100644
--- a/engines/nancy/action/puzzle/assemblypuzzle.cpp
+++ b/engines/nancy/action/puzzle/assemblypuzzle.cpp
@@ -21,7 +21,7 @@
#include "engines/nancy/nancy.h"
#include "engines/nancy/graphics.h"
-#include "engines/nancy/resource.h"
+#include "engines/nancy/resource/resource.h"
#include "engines/nancy/sound.h"
#include "engines/nancy/input.h"
#include "engines/nancy/util.h"
diff --git a/engines/nancy/action/puzzle/bballpuzzle.cpp b/engines/nancy/action/puzzle/bballpuzzle.cpp
index 409370ae9ef..bbcb4eb3800 100644
--- a/engines/nancy/action/puzzle/bballpuzzle.cpp
+++ b/engines/nancy/action/puzzle/bballpuzzle.cpp
@@ -21,7 +21,7 @@
#include "engines/nancy/nancy.h"
#include "engines/nancy/graphics.h"
-#include "engines/nancy/resource.h"
+#include "engines/nancy/resource/resource.h"
#include "engines/nancy/sound.h"
#include "engines/nancy/input.h"
#include "engines/nancy/util.h"
diff --git a/engines/nancy/action/puzzle/beadpuzzle.cpp b/engines/nancy/action/puzzle/beadpuzzle.cpp
index 5563b063380..e134a470b1e 100644
--- a/engines/nancy/action/puzzle/beadpuzzle.cpp
+++ b/engines/nancy/action/puzzle/beadpuzzle.cpp
@@ -21,7 +21,7 @@
#include "engines/nancy/nancy.h"
#include "engines/nancy/graphics.h"
-#include "engines/nancy/resource.h"
+#include "engines/nancy/resource/resource.h"
#include "engines/nancy/sound.h"
#include "engines/nancy/input.h"
#include "engines/nancy/util.h"
diff --git a/engines/nancy/action/puzzle/blockingpuzzle.cpp b/engines/nancy/action/puzzle/blockingpuzzle.cpp
index 0f7ea1e69a1..7a377588d46 100644
--- a/engines/nancy/action/puzzle/blockingpuzzle.cpp
+++ b/engines/nancy/action/puzzle/blockingpuzzle.cpp
@@ -27,7 +27,7 @@
#include "engines/nancy/cursor.h"
#include "engines/nancy/input.h"
#include "engines/nancy/puzzledata.h"
-#include "engines/nancy/resource.h"
+#include "engines/nancy/resource/resource.h"
#include "engines/nancy/sound.h"
#include "engines/nancy/util.h"
diff --git a/engines/nancy/action/puzzle/blockspuzzle.cpp b/engines/nancy/action/puzzle/blockspuzzle.cpp
index 5f7211ce38d..6954ef86893 100644
--- a/engines/nancy/action/puzzle/blockspuzzle.cpp
+++ b/engines/nancy/action/puzzle/blockspuzzle.cpp
@@ -24,7 +24,7 @@
#include "engines/nancy/nancy.h"
#include "engines/nancy/graphics.h"
-#include "engines/nancy/resource.h"
+#include "engines/nancy/resource/resource.h"
#include "engines/nancy/sound.h"
#include "engines/nancy/input.h"
#include "engines/nancy/cursor.h"
diff --git a/engines/nancy/action/puzzle/boardgamepuzzle.cpp b/engines/nancy/action/puzzle/boardgamepuzzle.cpp
index afcf814739d..86f426f869c 100644
--- a/engines/nancy/action/puzzle/boardgamepuzzle.cpp
+++ b/engines/nancy/action/puzzle/boardgamepuzzle.cpp
@@ -21,7 +21,7 @@
#include "engines/nancy/nancy.h"
#include "engines/nancy/graphics.h"
-#include "engines/nancy/resource.h"
+#include "engines/nancy/resource/resource.h"
#include "engines/nancy/sound.h"
#include "engines/nancy/input.h"
#include "engines/nancy/cursor.h"
diff --git a/engines/nancy/action/puzzle/bombpuzzle.cpp b/engines/nancy/action/puzzle/bombpuzzle.cpp
index 4debe05342e..1c282f26041 100644
--- a/engines/nancy/action/puzzle/bombpuzzle.cpp
+++ b/engines/nancy/action/puzzle/bombpuzzle.cpp
@@ -21,7 +21,7 @@
#include "engines/nancy/nancy.h"
#include "engines/nancy/graphics.h"
-#include "engines/nancy/resource.h"
+#include "engines/nancy/resource/resource.h"
#include "engines/nancy/sound.h"
#include "engines/nancy/input.h"
#include "engines/nancy/util.h"
diff --git a/engines/nancy/action/puzzle/buildpuzzle.cpp b/engines/nancy/action/puzzle/buildpuzzle.cpp
index 50afd961340..962348746c0 100644
--- a/engines/nancy/action/puzzle/buildpuzzle.cpp
+++ b/engines/nancy/action/puzzle/buildpuzzle.cpp
@@ -23,7 +23,7 @@
#include "engines/nancy/cursor.h"
#include "engines/nancy/graphics.h"
#include "engines/nancy/input.h"
-#include "engines/nancy/resource.h"
+#include "engines/nancy/resource/resource.h"
#include "engines/nancy/sound.h"
#include "engines/nancy/util.h"
diff --git a/engines/nancy/action/puzzle/bulpuzzle.cpp b/engines/nancy/action/puzzle/bulpuzzle.cpp
index 0495e625629..4ca69464e2d 100644
--- a/engines/nancy/action/puzzle/bulpuzzle.cpp
+++ b/engines/nancy/action/puzzle/bulpuzzle.cpp
@@ -21,7 +21,7 @@
#include "engines/nancy/nancy.h"
#include "engines/nancy/graphics.h"
-#include "engines/nancy/resource.h"
+#include "engines/nancy/resource/resource.h"
#include "engines/nancy/sound.h"
#include "engines/nancy/input.h"
#include "engines/nancy/util.h"
diff --git a/engines/nancy/action/puzzle/cardgamepuzzle.cpp b/engines/nancy/action/puzzle/cardgamepuzzle.cpp
index 3ea772ab471..2fee0bcd050 100644
--- a/engines/nancy/action/puzzle/cardgamepuzzle.cpp
+++ b/engines/nancy/action/puzzle/cardgamepuzzle.cpp
@@ -25,7 +25,7 @@
#include "engines/nancy/cursor.h"
#include "engines/nancy/graphics.h"
#include "engines/nancy/input.h"
-#include "engines/nancy/resource.h"
+#include "engines/nancy/resource/resource.h"
#include "engines/nancy/sound.h"
#include "engines/nancy/util.h"
diff --git a/engines/nancy/action/puzzle/collisionpuzzle.cpp b/engines/nancy/action/puzzle/collisionpuzzle.cpp
index 0c8a724d988..b7bbe6005e8 100644
--- a/engines/nancy/action/puzzle/collisionpuzzle.cpp
+++ b/engines/nancy/action/puzzle/collisionpuzzle.cpp
@@ -21,7 +21,7 @@
#include "engines/nancy/nancy.h"
#include "engines/nancy/graphics.h"
-#include "engines/nancy/resource.h"
+#include "engines/nancy/resource/resource.h"
#include "engines/nancy/sound.h"
#include "engines/nancy/input.h"
#include "engines/nancy/util.h"
diff --git a/engines/nancy/action/puzzle/cookingpuzzle.cpp b/engines/nancy/action/puzzle/cookingpuzzle.cpp
index 2e495bbc964..881873f32ab 100644
--- a/engines/nancy/action/puzzle/cookingpuzzle.cpp
+++ b/engines/nancy/action/puzzle/cookingpuzzle.cpp
@@ -25,7 +25,7 @@
#include "engines/nancy/nancy.h"
#include "engines/nancy/graphics.h"
-#include "engines/nancy/resource.h"
+#include "engines/nancy/resource/resource.h"
#include "engines/nancy/sound.h"
#include "engines/nancy/input.h"
#include "engines/nancy/font.h"
diff --git a/engines/nancy/action/puzzle/cubepuzzle.cpp b/engines/nancy/action/puzzle/cubepuzzle.cpp
index 029b22477c9..8c6672ff839 100644
--- a/engines/nancy/action/puzzle/cubepuzzle.cpp
+++ b/engines/nancy/action/puzzle/cubepuzzle.cpp
@@ -21,7 +21,7 @@
#include "engines/nancy/nancy.h"
#include "engines/nancy/graphics.h"
-#include "engines/nancy/resource.h"
+#include "engines/nancy/resource/resource.h"
#include "engines/nancy/sound.h"
#include "engines/nancy/input.h"
#include "engines/nancy/util.h"
diff --git a/engines/nancy/action/puzzle/cuttingpuzzle.cpp b/engines/nancy/action/puzzle/cuttingpuzzle.cpp
index 995722297fb..62dcca41f7a 100644
--- a/engines/nancy/action/puzzle/cuttingpuzzle.cpp
+++ b/engines/nancy/action/puzzle/cuttingpuzzle.cpp
@@ -21,7 +21,7 @@
#include "engines/nancy/nancy.h"
#include "engines/nancy/graphics.h"
-#include "engines/nancy/resource.h"
+#include "engines/nancy/resource/resource.h"
#include "engines/nancy/sound.h"
#include "engines/nancy/input.h"
#include "engines/nancy/util.h"
diff --git a/engines/nancy/action/puzzle/dotconnectpuzzle.cpp b/engines/nancy/action/puzzle/dotconnectpuzzle.cpp
index 3a57c7d50f7..30c03d2ec25 100644
--- a/engines/nancy/action/puzzle/dotconnectpuzzle.cpp
+++ b/engines/nancy/action/puzzle/dotconnectpuzzle.cpp
@@ -21,7 +21,7 @@
#include "engines/nancy/nancy.h"
#include "engines/nancy/graphics.h"
-#include "engines/nancy/resource.h"
+#include "engines/nancy/resource/resource.h"
#include "engines/nancy/sound.h"
#include "engines/nancy/input.h"
#include "engines/nancy/util.h"
diff --git a/engines/nancy/action/puzzle/drivingpuzzle.cpp b/engines/nancy/action/puzzle/drivingpuzzle.cpp
index da0ee931ff2..5889080bae7 100644
--- a/engines/nancy/action/puzzle/drivingpuzzle.cpp
+++ b/engines/nancy/action/puzzle/drivingpuzzle.cpp
@@ -25,7 +25,7 @@
#include "engines/nancy/nancy.h"
#include "engines/nancy/enginedata.h"
#include "engines/nancy/graphics.h"
-#include "engines/nancy/resource.h"
+#include "engines/nancy/resource/resource.h"
#include "engines/nancy/sound.h"
#include "engines/nancy/input.h"
#include "engines/nancy/util.h"
diff --git a/engines/nancy/action/puzzle/dropsortpuzzle.cpp b/engines/nancy/action/puzzle/dropsortpuzzle.cpp
index 0e48a7968e1..9710a13e41b 100644
--- a/engines/nancy/action/puzzle/dropsortpuzzle.cpp
+++ b/engines/nancy/action/puzzle/dropsortpuzzle.cpp
@@ -26,7 +26,7 @@
#include "engines/nancy/nancy.h"
#include "engines/nancy/graphics.h"
-#include "engines/nancy/resource.h"
+#include "engines/nancy/resource/resource.h"
#include "engines/nancy/sound.h"
#include "engines/nancy/input.h"
#include "engines/nancy/cursor.h"
diff --git a/engines/nancy/action/puzzle/escapegridpuzzle.cpp b/engines/nancy/action/puzzle/escapegridpuzzle.cpp
index c02b6df21d4..3ee1274b7a5 100644
--- a/engines/nancy/action/puzzle/escapegridpuzzle.cpp
+++ b/engines/nancy/action/puzzle/escapegridpuzzle.cpp
@@ -23,7 +23,7 @@
#include "engines/nancy/nancy.h"
#include "engines/nancy/graphics.h"
-#include "engines/nancy/resource.h"
+#include "engines/nancy/resource/resource.h"
#include "engines/nancy/sound.h"
#include "engines/nancy/input.h"
#include "engines/nancy/cursor.h"
diff --git a/engines/nancy/action/puzzle/fishingpuzzle.cpp b/engines/nancy/action/puzzle/fishingpuzzle.cpp
index 2121dafc17d..e9e396c362d 100644
--- a/engines/nancy/action/puzzle/fishingpuzzle.cpp
+++ b/engines/nancy/action/puzzle/fishingpuzzle.cpp
@@ -22,7 +22,7 @@
#include "common/random.h"
#include "engines/nancy/nancy.h"
-#include "engines/nancy/resource.h"
+#include "engines/nancy/resource/resource.h"
#include "engines/nancy/sound.h"
#include "engines/nancy/input.h"
#include "engines/nancy/util.h"
diff --git a/engines/nancy/action/puzzle/flashmemorypuzzle.cpp b/engines/nancy/action/puzzle/flashmemorypuzzle.cpp
index 89e3f6bee61..2ccd731af36 100644
--- a/engines/nancy/action/puzzle/flashmemorypuzzle.cpp
+++ b/engines/nancy/action/puzzle/flashmemorypuzzle.cpp
@@ -24,7 +24,7 @@
#include "engines/nancy/nancy.h"
#include "engines/nancy/graphics.h"
#include "engines/nancy/input.h"
-#include "engines/nancy/resource.h"
+#include "engines/nancy/resource/resource.h"
#include "engines/nancy/util.h"
#include "engines/nancy/state/scene.h"
diff --git a/engines/nancy/action/puzzle/gridmappuzzle.cpp b/engines/nancy/action/puzzle/gridmappuzzle.cpp
index f2f7ef7080f..8680cb535d2 100644
--- a/engines/nancy/action/puzzle/gridmappuzzle.cpp
+++ b/engines/nancy/action/puzzle/gridmappuzzle.cpp
@@ -21,7 +21,7 @@
#include "engines/nancy/nancy.h"
#include "engines/nancy/graphics.h"
-#include "engines/nancy/resource.h"
+#include "engines/nancy/resource/resource.h"
#include "engines/nancy/sound.h"
#include "engines/nancy/input.h"
#include "engines/nancy/util.h"
diff --git a/engines/nancy/action/puzzle/hamradiopuzzle.cpp b/engines/nancy/action/puzzle/hamradiopuzzle.cpp
index 3c95146178f..2f9bc6dc979 100644
--- a/engines/nancy/action/puzzle/hamradiopuzzle.cpp
+++ b/engines/nancy/action/puzzle/hamradiopuzzle.cpp
@@ -24,7 +24,7 @@
#include "engines/nancy/nancy.h"
#include "engines/nancy/graphics.h"
-#include "engines/nancy/resource.h"
+#include "engines/nancy/resource/resource.h"
#include "engines/nancy/sound.h"
#include "engines/nancy/input.h"
#include "engines/nancy/util.h"
diff --git a/engines/nancy/action/puzzle/hangmanpuzzle.cpp b/engines/nancy/action/puzzle/hangmanpuzzle.cpp
index a4ad0b3d379..1e1e12b3308 100644
--- a/engines/nancy/action/puzzle/hangmanpuzzle.cpp
+++ b/engines/nancy/action/puzzle/hangmanpuzzle.cpp
@@ -26,7 +26,7 @@
#include "engines/nancy/cursor.h"
#include "engines/nancy/graphics.h"
#include "engines/nancy/input.h"
-#include "engines/nancy/resource.h"
+#include "engines/nancy/resource/resource.h"
#include "engines/nancy/sound.h"
#include "engines/nancy/util.h"
#include "engines/nancy/puzzledata.h"
diff --git a/engines/nancy/action/puzzle/lettergridpuzzle.cpp b/engines/nancy/action/puzzle/lettergridpuzzle.cpp
index 75c35af8e76..e39b928fac3 100644
--- a/engines/nancy/action/puzzle/lettergridpuzzle.cpp
+++ b/engines/nancy/action/puzzle/lettergridpuzzle.cpp
@@ -23,7 +23,7 @@
#include "engines/nancy/nancy.h"
#include "engines/nancy/graphics.h"
-#include "engines/nancy/resource.h"
+#include "engines/nancy/resource/resource.h"
#include "engines/nancy/cursor.h"
#include "engines/nancy/input.h"
#include "engines/nancy/puzzledata.h"
diff --git a/engines/nancy/action/puzzle/leverpuzzle.cpp b/engines/nancy/action/puzzle/leverpuzzle.cpp
index c0b6da98234..65b7839dcc6 100644
--- a/engines/nancy/action/puzzle/leverpuzzle.cpp
+++ b/engines/nancy/action/puzzle/leverpuzzle.cpp
@@ -20,7 +20,7 @@
*/
#include "engines/nancy/graphics.h"
-#include "engines/nancy/resource.h"
+#include "engines/nancy/resource/resource.h"
#include "engines/nancy/nancy.h"
#include "engines/nancy/sound.h"
#include "engines/nancy/input.h"
diff --git a/engines/nancy/action/puzzle/magicboxpuzzle.cpp b/engines/nancy/action/puzzle/magicboxpuzzle.cpp
index bdc9af3b618..72a2f666450 100644
--- a/engines/nancy/action/puzzle/magicboxpuzzle.cpp
+++ b/engines/nancy/action/puzzle/magicboxpuzzle.cpp
@@ -23,7 +23,7 @@
#include "engines/nancy/nancy.h"
#include "engines/nancy/graphics.h"
-#include "engines/nancy/resource.h"
+#include "engines/nancy/resource/resource.h"
#include "engines/nancy/sound.h"
#include "engines/nancy/input.h"
#include "engines/nancy/cursor.h"
diff --git a/engines/nancy/action/puzzle/magnetmazepuzzle.cpp b/engines/nancy/action/puzzle/magnetmazepuzzle.cpp
index 2b297711b69..4197e6aa98d 100644
--- a/engines/nancy/action/puzzle/magnetmazepuzzle.cpp
+++ b/engines/nancy/action/puzzle/magnetmazepuzzle.cpp
@@ -21,7 +21,7 @@
#include "engines/nancy/nancy.h"
#include "engines/nancy/graphics.h"
-#include "engines/nancy/resource.h"
+#include "engines/nancy/resource/resource.h"
#include "engines/nancy/sound.h"
#include "engines/nancy/input.h"
#include "engines/nancy/util.h"
diff --git a/engines/nancy/action/puzzle/matchpuzzle.cpp b/engines/nancy/action/puzzle/matchpuzzle.cpp
index fcea46e94d6..49655806ada 100644
--- a/engines/nancy/action/puzzle/matchpuzzle.cpp
+++ b/engines/nancy/action/puzzle/matchpuzzle.cpp
@@ -21,7 +21,7 @@
#include "engines/nancy/nancy.h"
#include "engines/nancy/graphics.h"
-#include "engines/nancy/resource.h"
+#include "engines/nancy/resource/resource.h"
#include "engines/nancy/sound.h"
#include "engines/nancy/input.h"
#include "engines/nancy/util.h"
diff --git a/engines/nancy/action/puzzle/mazechasepuzzle.cpp b/engines/nancy/action/puzzle/mazechasepuzzle.cpp
index 76ccfd5d3a2..462bf93ddb1 100644
--- a/engines/nancy/action/puzzle/mazechasepuzzle.cpp
+++ b/engines/nancy/action/puzzle/mazechasepuzzle.cpp
@@ -21,7 +21,7 @@
#include "engines/nancy/nancy.h"
#include "engines/nancy/graphics.h"
-#include "engines/nancy/resource.h"
+#include "engines/nancy/resource/resource.h"
#include "engines/nancy/sound.h"
#include "engines/nancy/input.h"
#include "engines/nancy/util.h"
diff --git a/engines/nancy/action/puzzle/memorypuzzle.cpp b/engines/nancy/action/puzzle/memorypuzzle.cpp
index 16eac8ed1f8..400db7f1105 100644
--- a/engines/nancy/action/puzzle/memorypuzzle.cpp
+++ b/engines/nancy/action/puzzle/memorypuzzle.cpp
@@ -23,7 +23,7 @@
#include "engines/nancy/nancy.h"
#include "engines/nancy/graphics.h"
-#include "engines/nancy/resource.h"
+#include "engines/nancy/resource/resource.h"
#include "engines/nancy/sound.h"
#include "engines/nancy/input.h"
#include "engines/nancy/util.h"
diff --git a/engines/nancy/action/puzzle/mindpuzzle.cpp b/engines/nancy/action/puzzle/mindpuzzle.cpp
index 1dce5611a83..64fe7afa34a 100644
--- a/engines/nancy/action/puzzle/mindpuzzle.cpp
+++ b/engines/nancy/action/puzzle/mindpuzzle.cpp
@@ -23,7 +23,7 @@
#include "engines/nancy/nancy.h"
#include "engines/nancy/graphics.h"
-#include "engines/nancy/resource.h"
+#include "engines/nancy/resource/resource.h"
#include "engines/nancy/sound.h"
#include "engines/nancy/input.h"
#include "engines/nancy/util.h"
diff --git a/engines/nancy/action/puzzle/minesweeperpuzzle.cpp b/engines/nancy/action/puzzle/minesweeperpuzzle.cpp
index 63efb5047df..04ea917e4f4 100644
--- a/engines/nancy/action/puzzle/minesweeperpuzzle.cpp
+++ b/engines/nancy/action/puzzle/minesweeperpuzzle.cpp
@@ -21,7 +21,7 @@
#include "engines/nancy/nancy.h"
#include "engines/nancy/graphics.h"
-#include "engines/nancy/resource.h"
+#include "engines/nancy/resource/resource.h"
#include "engines/nancy/sound.h"
#include "engines/nancy/input.h"
#include "engines/nancy/font.h"
diff --git a/engines/nancy/action/puzzle/minigolfpuzzle.cpp b/engines/nancy/action/puzzle/minigolfpuzzle.cpp
index 1e176bbff2a..213051d3f06 100644
--- a/engines/nancy/action/puzzle/minigolfpuzzle.cpp
+++ b/engines/nancy/action/puzzle/minigolfpuzzle.cpp
@@ -23,7 +23,7 @@
#include "engines/nancy/nancy.h"
#include "engines/nancy/graphics.h"
-#include "engines/nancy/resource.h"
+#include "engines/nancy/resource/resource.h"
#include "engines/nancy/sound.h"
#include "engines/nancy/input.h"
#include "engines/nancy/cursor.h"
diff --git a/engines/nancy/action/puzzle/mirrorlightpuzzle.cpp b/engines/nancy/action/puzzle/mirrorlightpuzzle.cpp
index 0a22dfcbb40..5dff86c563f 100644
--- a/engines/nancy/action/puzzle/mirrorlightpuzzle.cpp
+++ b/engines/nancy/action/puzzle/mirrorlightpuzzle.cpp
@@ -24,7 +24,7 @@
#include "engines/nancy/nancy.h"
#include "engines/nancy/graphics.h"
-#include "engines/nancy/resource.h"
+#include "engines/nancy/resource/resource.h"
#include "engines/nancy/sound.h"
#include "engines/nancy/input.h"
#include "engines/nancy/util.h"
diff --git a/engines/nancy/action/puzzle/mouselightpuzzle.cpp b/engines/nancy/action/puzzle/mouselightpuzzle.cpp
index 8b15e41853d..43a1ab19d49 100644
--- a/engines/nancy/action/puzzle/mouselightpuzzle.cpp
+++ b/engines/nancy/action/puzzle/mouselightpuzzle.cpp
@@ -21,7 +21,7 @@
#include "engines/nancy/nancy.h"
#include "engines/nancy/graphics.h"
-#include "engines/nancy/resource.h"
+#include "engines/nancy/resource/resource.h"
#include "engines/nancy/sound.h"
#include "engines/nancy/input.h"
#include "engines/nancy/util.h"
diff --git a/engines/nancy/action/puzzle/multibuildpuzzle.cpp b/engines/nancy/action/puzzle/multibuildpuzzle.cpp
index 47aa375660f..8caebda5a9a 100644
--- a/engines/nancy/action/puzzle/multibuildpuzzle.cpp
+++ b/engines/nancy/action/puzzle/multibuildpuzzle.cpp
@@ -21,7 +21,7 @@
#include "engines/nancy/nancy.h"
#include "engines/nancy/graphics.h"
-#include "engines/nancy/resource.h"
+#include "engines/nancy/resource/resource.h"
#include "engines/nancy/sound.h"
#include "engines/nancy/input.h"
#include "engines/nancy/util.h"
diff --git a/engines/nancy/action/puzzle/necklacepuzzle.cpp b/engines/nancy/action/puzzle/necklacepuzzle.cpp
index 1840512c44c..8d848dde038 100644
--- a/engines/nancy/action/puzzle/necklacepuzzle.cpp
+++ b/engines/nancy/action/puzzle/necklacepuzzle.cpp
@@ -26,7 +26,7 @@
#include "engines/nancy/nancy.h"
#include "engines/nancy/graphics.h"
-#include "engines/nancy/resource.h"
+#include "engines/nancy/resource/resource.h"
#include "engines/nancy/sound.h"
#include "engines/nancy/input.h"
#include "engines/nancy/cursor.h"
diff --git a/engines/nancy/action/puzzle/onebuildpuzzle.cpp b/engines/nancy/action/puzzle/onebuildpuzzle.cpp
index 770f45cee36..aca9a5e39dd 100644
--- a/engines/nancy/action/puzzle/onebuildpuzzle.cpp
+++ b/engines/nancy/action/puzzle/onebuildpuzzle.cpp
@@ -24,7 +24,7 @@
#include "engines/nancy/nancy.h"
#include "engines/nancy/graphics.h"
-#include "engines/nancy/resource.h"
+#include "engines/nancy/resource/resource.h"
#include "engines/nancy/sound.h"
#include "engines/nancy/input.h"
#include "engines/nancy/util.h"
diff --git a/engines/nancy/action/puzzle/orderingpuzzle.cpp b/engines/nancy/action/puzzle/orderingpuzzle.cpp
index 0e114210945..482e96cacfc 100644
--- a/engines/nancy/action/puzzle/orderingpuzzle.cpp
+++ b/engines/nancy/action/puzzle/orderingpuzzle.cpp
@@ -23,7 +23,7 @@
#include "engines/nancy/nancy.h"
#include "engines/nancy/graphics.h"
-#include "engines/nancy/resource.h"
+#include "engines/nancy/resource/resource.h"
#include "engines/nancy/input.h"
#include "engines/nancy/sound.h"
#include "engines/nancy/util.h"
diff --git a/engines/nancy/action/puzzle/overridelockpuzzle.cpp b/engines/nancy/action/puzzle/overridelockpuzzle.cpp
index aea502f8f4f..35c781b4e30 100644
--- a/engines/nancy/action/puzzle/overridelockpuzzle.cpp
+++ b/engines/nancy/action/puzzle/overridelockpuzzle.cpp
@@ -21,7 +21,7 @@
#include "engines/nancy/nancy.h"
#include "engines/nancy/graphics.h"
-#include "engines/nancy/resource.h"
+#include "engines/nancy/resource/resource.h"
#include "engines/nancy/sound.h"
#include "engines/nancy/input.h"
#include "engines/nancy/util.h"
diff --git a/engines/nancy/action/puzzle/pachinkopuzzle.cpp b/engines/nancy/action/puzzle/pachinkopuzzle.cpp
index efe95122eb0..2672857c78e 100644
--- a/engines/nancy/action/puzzle/pachinkopuzzle.cpp
+++ b/engines/nancy/action/puzzle/pachinkopuzzle.cpp
@@ -23,7 +23,7 @@
#include "engines/nancy/nancy.h"
#include "engines/nancy/graphics.h"
-#include "engines/nancy/resource.h"
+#include "engines/nancy/resource/resource.h"
#include "engines/nancy/sound.h"
#include "engines/nancy/input.h"
#include "engines/nancy/cursor.h"
diff --git a/engines/nancy/action/puzzle/paintpuzzle.cpp b/engines/nancy/action/puzzle/paintpuzzle.cpp
index 9e1f4970727..df3a765e6d7 100644
--- a/engines/nancy/action/puzzle/paintpuzzle.cpp
+++ b/engines/nancy/action/puzzle/paintpuzzle.cpp
@@ -25,7 +25,7 @@
#include "engines/nancy/cursor.h"
#include "engines/nancy/graphics.h"
#include "engines/nancy/input.h"
-#include "engines/nancy/resource.h"
+#include "engines/nancy/resource/resource.h"
#include "engines/nancy/sound.h"
#include "engines/nancy/util.h"
diff --git a/engines/nancy/action/puzzle/peepholepuzzle.cpp b/engines/nancy/action/puzzle/peepholepuzzle.cpp
index 981ff11fcb2..6aaf5246057 100644
--- a/engines/nancy/action/puzzle/peepholepuzzle.cpp
+++ b/engines/nancy/action/puzzle/peepholepuzzle.cpp
@@ -24,7 +24,7 @@
#include "engines/nancy/sound.h"
#include "engines/nancy/input.h"
#include "engines/nancy/util.h"
-#include "engines/nancy/resource.h"
+#include "engines/nancy/resource/resource.h"
#include "engines/nancy/action/puzzle/peepholepuzzle.h"
diff --git a/engines/nancy/action/puzzle/pegspuzzle.cpp b/engines/nancy/action/puzzle/pegspuzzle.cpp
index 745f971b4e2..2fda558318e 100644
--- a/engines/nancy/action/puzzle/pegspuzzle.cpp
+++ b/engines/nancy/action/puzzle/pegspuzzle.cpp
@@ -23,7 +23,7 @@
#include "engines/nancy/nancy.h"
#include "engines/nancy/graphics.h"
-#include "engines/nancy/resource.h"
+#include "engines/nancy/resource/resource.h"
#include "engines/nancy/sound.h"
#include "engines/nancy/input.h"
#include "engines/nancy/cursor.h"
diff --git a/engines/nancy/action/puzzle/raycastpuzzle.cpp b/engines/nancy/action/puzzle/raycastpuzzle.cpp
index 6da9a00abfd..f8fd447ef6f 100644
--- a/engines/nancy/action/puzzle/raycastpuzzle.cpp
+++ b/engines/nancy/action/puzzle/raycastpuzzle.cpp
@@ -25,7 +25,7 @@
#include "engines/nancy/input.h"
#include "engines/nancy/util.h"
#include "engines/nancy/enginedata.h"
-#include "engines/nancy/resource.h"
+#include "engines/nancy/resource/resource.h"
#include "engines/nancy/action/puzzle/raycastpuzzle.h"
#include "engines/nancy/state/scene.h"
diff --git a/engines/nancy/action/puzzle/riddlepuzzle.cpp b/engines/nancy/action/puzzle/riddlepuzzle.cpp
index 06d569cefa6..978cf3a83a8 100644
--- a/engines/nancy/action/puzzle/riddlepuzzle.cpp
+++ b/engines/nancy/action/puzzle/riddlepuzzle.cpp
@@ -21,7 +21,7 @@
#include "engines/nancy/nancy.h"
#include "engines/nancy/sound.h"
-#include "engines/nancy/resource.h"
+#include "engines/nancy/resource/resource.h"
#include "engines/nancy/util.h"
#include "engines/nancy/input.h"
#include "engines/nancy/graphics.h"
diff --git a/engines/nancy/action/puzzle/rippedletterpuzzle.cpp b/engines/nancy/action/puzzle/rippedletterpuzzle.cpp
index ab1b828ef67..ffc1e8e117e 100644
--- a/engines/nancy/action/puzzle/rippedletterpuzzle.cpp
+++ b/engines/nancy/action/puzzle/rippedletterpuzzle.cpp
@@ -21,7 +21,7 @@
#include "engines/nancy/util.h"
#include "engines/nancy/nancy.h"
-#include "engines/nancy/resource.h"
+#include "engines/nancy/resource/resource.h"
#include "engines/nancy/graphics.h"
#include "engines/nancy/sound.h"
#include "engines/nancy/input.h"
diff --git a/engines/nancy/action/puzzle/rotatinglockpuzzle.cpp b/engines/nancy/action/puzzle/rotatinglockpuzzle.cpp
index 21323173bd4..8fb5df15de5 100644
--- a/engines/nancy/action/puzzle/rotatinglockpuzzle.cpp
+++ b/engines/nancy/action/puzzle/rotatinglockpuzzle.cpp
@@ -22,7 +22,7 @@
#include "common/random.h"
#include "engines/nancy/nancy.h"
-#include "engines/nancy/resource.h"
+#include "engines/nancy/resource/resource.h"
#include "engines/nancy/graphics.h"
#include "engines/nancy/sound.h"
#include "engines/nancy/input.h"
diff --git a/engines/nancy/action/puzzle/safedialpuzzle.cpp b/engines/nancy/action/puzzle/safedialpuzzle.cpp
index cf54b4a9b9c..b430aec8c36 100644
--- a/engines/nancy/action/puzzle/safedialpuzzle.cpp
+++ b/engines/nancy/action/puzzle/safedialpuzzle.cpp
@@ -22,7 +22,7 @@
#include "common/random.h"
#include "engines/nancy/nancy.h"
-#include "engines/nancy/resource.h"
+#include "engines/nancy/resource/resource.h"
#include "engines/nancy/graphics.h"
#include "engines/nancy/sound.h"
#include "engines/nancy/input.h"
diff --git a/engines/nancy/action/puzzle/scalepuzzle.cpp b/engines/nancy/action/puzzle/scalepuzzle.cpp
index babe67f68bb..317db4a8ec8 100644
--- a/engines/nancy/action/puzzle/scalepuzzle.cpp
+++ b/engines/nancy/action/puzzle/scalepuzzle.cpp
@@ -24,7 +24,7 @@
#include "engines/nancy/nancy.h"
#include "engines/nancy/graphics.h"
-#include "engines/nancy/resource.h"
+#include "engines/nancy/resource/resource.h"
#include "engines/nancy/sound.h"
#include "engines/nancy/input.h"
#include "engines/nancy/cursor.h"
diff --git a/engines/nancy/action/puzzle/scopapuzzle.cpp b/engines/nancy/action/puzzle/scopapuzzle.cpp
index e0aecfffd62..d4c88be9a89 100644
--- a/engines/nancy/action/puzzle/scopapuzzle.cpp
+++ b/engines/nancy/action/puzzle/scopapuzzle.cpp
@@ -26,7 +26,7 @@
#include "engines/nancy/font.h"
#include "engines/nancy/graphics.h"
#include "engines/nancy/input.h"
-#include "engines/nancy/resource.h"
+#include "engines/nancy/resource/resource.h"
#include "engines/nancy/sound.h"
#include "engines/nancy/util.h"
#include "engines/nancy/puzzledata.h"
diff --git a/engines/nancy/action/puzzle/sentrypuzzle.cpp b/engines/nancy/action/puzzle/sentrypuzzle.cpp
index 66e9f665093..7f7839bf854 100644
--- a/engines/nancy/action/puzzle/sentrypuzzle.cpp
+++ b/engines/nancy/action/puzzle/sentrypuzzle.cpp
@@ -24,7 +24,7 @@
#include "engines/nancy/nancy.h"
#include "engines/nancy/graphics.h"
#include "engines/nancy/input.h"
-#include "engines/nancy/resource.h"
+#include "engines/nancy/resource/resource.h"
#include "engines/nancy/util.h"
#include "engines/nancy/puzzledata.h"
diff --git a/engines/nancy/action/puzzle/setplayerclock.cpp b/engines/nancy/action/puzzle/setplayerclock.cpp
index 757595d74a1..6e7cf339761 100644
--- a/engines/nancy/action/puzzle/setplayerclock.cpp
+++ b/engines/nancy/action/puzzle/setplayerclock.cpp
@@ -27,7 +27,7 @@
#include "engines/nancy/input.h"
#include "engines/nancy/graphics.h"
#include "engines/nancy/util.h"
-#include "engines/nancy/resource.h"
+#include "engines/nancy/resource/resource.h"
#include "engines/nancy/sound.h"
namespace Nancy {
diff --git a/engines/nancy/action/puzzle/sewingmachinepuzzle.cpp b/engines/nancy/action/puzzle/sewingmachinepuzzle.cpp
index ea2d0b7f48b..23dd7cc7b7c 100644
--- a/engines/nancy/action/puzzle/sewingmachinepuzzle.cpp
+++ b/engines/nancy/action/puzzle/sewingmachinepuzzle.cpp
@@ -23,7 +23,7 @@
#include "engines/nancy/nancy.h"
#include "engines/nancy/graphics.h"
-#include "engines/nancy/resource.h"
+#include "engines/nancy/resource/resource.h"
#include "engines/nancy/sound.h"
#include "engines/nancy/input.h"
#include "engines/nancy/util.h"
diff --git a/engines/nancy/action/puzzle/sliderpuzzle.cpp b/engines/nancy/action/puzzle/sliderpuzzle.cpp
index b9fc0be2b37..2a3baa2b69e 100644
--- a/engines/nancy/action/puzzle/sliderpuzzle.cpp
+++ b/engines/nancy/action/puzzle/sliderpuzzle.cpp
@@ -21,7 +21,7 @@
#include "engines/nancy/nancy.h"
#include "engines/nancy/graphics.h"
-#include "engines/nancy/resource.h"
+#include "engines/nancy/resource/resource.h"
#include "engines/nancy/sound.h"
#include "engines/nancy/input.h"
#include "engines/nancy/util.h"
diff --git a/engines/nancy/action/puzzle/snowmobilepuzzle.cpp b/engines/nancy/action/puzzle/snowmobilepuzzle.cpp
index 617dd8bd419..aa6d5544d3d 100644
--- a/engines/nancy/action/puzzle/snowmobilepuzzle.cpp
+++ b/engines/nancy/action/puzzle/snowmobilepuzzle.cpp
@@ -23,7 +23,7 @@
#include "engines/nancy/nancy.h"
#include "engines/nancy/graphics.h"
-#include "engines/nancy/resource.h"
+#include "engines/nancy/resource/resource.h"
#include "engines/nancy/sound.h"
#include "engines/nancy/input.h"
#include "engines/nancy/util.h"
diff --git a/engines/nancy/action/puzzle/sortpuzzle.cpp b/engines/nancy/action/puzzle/sortpuzzle.cpp
index 7c15b082006..9b2ee5b6247 100644
--- a/engines/nancy/action/puzzle/sortpuzzle.cpp
+++ b/engines/nancy/action/puzzle/sortpuzzle.cpp
@@ -23,7 +23,7 @@
#include "engines/nancy/nancy.h"
#include "engines/nancy/graphics.h"
-#include "engines/nancy/resource.h"
+#include "engines/nancy/resource/resource.h"
#include "engines/nancy/sound.h"
#include "engines/nancy/input.h"
#include "engines/nancy/util.h"
diff --git a/engines/nancy/action/puzzle/soundequalizerpuzzle.cpp b/engines/nancy/action/puzzle/soundequalizerpuzzle.cpp
index 7590df8dec8..bfb6fab973a 100644
--- a/engines/nancy/action/puzzle/soundequalizerpuzzle.cpp
+++ b/engines/nancy/action/puzzle/soundequalizerpuzzle.cpp
@@ -26,7 +26,7 @@
#include "engines/nancy/util.h"
#include "engines/nancy/nancy.h"
#include "engines/nancy/graphics.h"
-#include "engines/nancy/resource.h"
+#include "engines/nancy/resource/resource.h"
#include "engines/nancy/input.h"
#include "engines/nancy/sound.h"
#include "engines/nancy/puzzledata.h"
diff --git a/engines/nancy/action/puzzle/soundmatchpuzzle.cpp b/engines/nancy/action/puzzle/soundmatchpuzzle.cpp
index f7eab474923..a1d7190ac65 100644
--- a/engines/nancy/action/puzzle/soundmatchpuzzle.cpp
+++ b/engines/nancy/action/puzzle/soundmatchpuzzle.cpp
@@ -21,7 +21,7 @@
#include "engines/nancy/nancy.h"
#include "engines/nancy/graphics.h"
-#include "engines/nancy/resource.h"
+#include "engines/nancy/resource/resource.h"
#include "engines/nancy/sound.h"
#include "engines/nancy/input.h"
#include "engines/nancy/util.h"
diff --git a/engines/nancy/action/puzzle/spigotpuzzle.cpp b/engines/nancy/action/puzzle/spigotpuzzle.cpp
index 0c147446d9d..23e1442f24c 100644
--- a/engines/nancy/action/puzzle/spigotpuzzle.cpp
+++ b/engines/nancy/action/puzzle/spigotpuzzle.cpp
@@ -22,7 +22,7 @@
#include "engines/nancy/util.h"
#include "engines/nancy/nancy.h"
#include "engines/nancy/graphics.h"
-#include "engines/nancy/resource.h"
+#include "engines/nancy/resource/resource.h"
#include "engines/nancy/sound.h"
#include "engines/nancy/input.h"
#include "engines/nancy/puzzledata.h"
diff --git a/engines/nancy/action/puzzle/stakeoutpuzzle.cpp b/engines/nancy/action/puzzle/stakeoutpuzzle.cpp
index 78e304ab1ac..7c115fa49a0 100644
--- a/engines/nancy/action/puzzle/stakeoutpuzzle.cpp
+++ b/engines/nancy/action/puzzle/stakeoutpuzzle.cpp
@@ -24,7 +24,7 @@
#include "engines/nancy/nancy.h"
#include "engines/nancy/graphics.h"
#include "engines/nancy/input.h"
-#include "engines/nancy/resource.h"
+#include "engines/nancy/resource/resource.h"
#include "engines/nancy/sound.h"
#include "engines/nancy/util.h"
#include "engines/nancy/puzzledata.h"
diff --git a/engines/nancy/action/puzzle/stepobjectspuzzle.cpp b/engines/nancy/action/puzzle/stepobjectspuzzle.cpp
index b82a191b452..3fe45013833 100644
--- a/engines/nancy/action/puzzle/stepobjectspuzzle.cpp
+++ b/engines/nancy/action/puzzle/stepobjectspuzzle.cpp
@@ -23,7 +23,7 @@
#include "engines/nancy/nancy.h"
#include "engines/nancy/graphics.h"
-#include "engines/nancy/resource.h"
+#include "engines/nancy/resource/resource.h"
#include "engines/nancy/sound.h"
#include "engines/nancy/input.h"
#include "engines/nancy/cursor.h"
diff --git a/engines/nancy/action/puzzle/tangrampuzzle.cpp b/engines/nancy/action/puzzle/tangrampuzzle.cpp
index db72ae85c06..e638e396532 100644
--- a/engines/nancy/action/puzzle/tangrampuzzle.cpp
+++ b/engines/nancy/action/puzzle/tangrampuzzle.cpp
@@ -22,7 +22,7 @@
#include "engines/nancy/util.h"
#include "engines/nancy/nancy.h"
#include "engines/nancy/graphics.h"
-#include "engines/nancy/resource.h"
+#include "engines/nancy/resource/resource.h"
#include "engines/nancy/sound.h"
#include "engines/nancy/input.h"
#include "engines/nancy/puzzledata.h"
diff --git a/engines/nancy/action/puzzle/telephone.cpp b/engines/nancy/action/puzzle/telephone.cpp
index b81534697d0..25d6e8767cf 100644
--- a/engines/nancy/action/puzzle/telephone.cpp
+++ b/engines/nancy/action/puzzle/telephone.cpp
@@ -21,7 +21,7 @@
#include "engines/nancy/nancy.h"
#include "engines/nancy/graphics.h"
-#include "engines/nancy/resource.h"
+#include "engines/nancy/resource/resource.h"
#include "engines/nancy/sound.h"
#include "engines/nancy/input.h"
#include "engines/nancy/util.h"
diff --git a/engines/nancy/action/puzzle/towerpuzzle.cpp b/engines/nancy/action/puzzle/towerpuzzle.cpp
index 907e9532e6e..f6eaed4c8bc 100644
--- a/engines/nancy/action/puzzle/towerpuzzle.cpp
+++ b/engines/nancy/action/puzzle/towerpuzzle.cpp
@@ -22,7 +22,7 @@
#include "engines/nancy/util.h"
#include "engines/nancy/nancy.h"
#include "engines/nancy/graphics.h"
-#include "engines/nancy/resource.h"
+#include "engines/nancy/resource/resource.h"
#include "engines/nancy/sound.h"
#include "engines/nancy/input.h"
#include "engines/nancy/puzzledata.h"
diff --git a/engines/nancy/action/puzzle/turningpuzzle.cpp b/engines/nancy/action/puzzle/turningpuzzle.cpp
index 693966d9696..f4917900f6e 100644
--- a/engines/nancy/action/puzzle/turningpuzzle.cpp
+++ b/engines/nancy/action/puzzle/turningpuzzle.cpp
@@ -24,7 +24,7 @@
#include "engines/nancy/util.h"
#include "engines/nancy/nancy.h"
#include "engines/nancy/graphics.h"
-#include "engines/nancy/resource.h"
+#include "engines/nancy/resource/resource.h"
#include "engines/nancy/sound.h"
#include "engines/nancy/input.h"
#include "engines/nancy/cursor.h"
diff --git a/engines/nancy/action/puzzle/twodialpuzzle.cpp b/engines/nancy/action/puzzle/twodialpuzzle.cpp
index 1064b6d144a..5b6d5e6e11b 100644
--- a/engines/nancy/action/puzzle/twodialpuzzle.cpp
+++ b/engines/nancy/action/puzzle/twodialpuzzle.cpp
@@ -22,7 +22,7 @@
#include "engines/nancy/util.h"
#include "engines/nancy/nancy.h"
#include "engines/nancy/graphics.h"
-#include "engines/nancy/resource.h"
+#include "engines/nancy/resource/resource.h"
#include "engines/nancy/sound.h"
#include "engines/nancy/input.h"
#include "engines/nancy/puzzledata.h"
diff --git a/engines/nancy/action/puzzle/typingquizpuzzle.cpp b/engines/nancy/action/puzzle/typingquizpuzzle.cpp
index a3892545df3..9b8489d79ed 100644
--- a/engines/nancy/action/puzzle/typingquizpuzzle.cpp
+++ b/engines/nancy/action/puzzle/typingquizpuzzle.cpp
@@ -23,7 +23,7 @@
#include "engines/nancy/nancy.h"
#include "engines/nancy/graphics.h"
-#include "engines/nancy/resource.h"
+#include "engines/nancy/resource/resource.h"
#include "engines/nancy/sound.h"
#include "engines/nancy/input.h"
#include "engines/nancy/util.h"
diff --git a/engines/nancy/action/puzzle/weightsortpuzzle.cpp b/engines/nancy/action/puzzle/weightsortpuzzle.cpp
index 79bd222deb1..b630448f685 100644
--- a/engines/nancy/action/puzzle/weightsortpuzzle.cpp
+++ b/engines/nancy/action/puzzle/weightsortpuzzle.cpp
@@ -23,7 +23,7 @@
#include "engines/nancy/nancy.h"
#include "engines/nancy/graphics.h"
-#include "engines/nancy/resource.h"
+#include "engines/nancy/resource/resource.h"
#include "engines/nancy/sound.h"
#include "engines/nancy/input.h"
#include "engines/nancy/cursor.h"
diff --git a/engines/nancy/action/puzzle/whalesurvivorpuzzle.cpp b/engines/nancy/action/puzzle/whalesurvivorpuzzle.cpp
index ec39c644d2b..d21e1f80cf4 100644
--- a/engines/nancy/action/puzzle/whalesurvivorpuzzle.cpp
+++ b/engines/nancy/action/puzzle/whalesurvivorpuzzle.cpp
@@ -23,7 +23,7 @@
#include "engines/nancy/nancy.h"
#include "engines/nancy/graphics.h"
-#include "engines/nancy/resource.h"
+#include "engines/nancy/resource/resource.h"
#include "engines/nancy/sound.h"
#include "engines/nancy/input.h"
#include "engines/nancy/util.h"
diff --git a/engines/nancy/action/puzzle/wordfindpuzzle.cpp b/engines/nancy/action/puzzle/wordfindpuzzle.cpp
index 38e82c03e97..d40efe6d22d 100644
--- a/engines/nancy/action/puzzle/wordfindpuzzle.cpp
+++ b/engines/nancy/action/puzzle/wordfindpuzzle.cpp
@@ -21,7 +21,7 @@
#include "engines/nancy/nancy.h"
#include "engines/nancy/graphics.h"
-#include "engines/nancy/resource.h"
+#include "engines/nancy/resource/resource.h"
#include "engines/nancy/sound.h"
#include "engines/nancy/input.h"
#include "engines/nancy/cursor.h"
diff --git a/engines/nancy/action/puzzlerecord.cpp b/engines/nancy/action/puzzlerecord.cpp
index eac098ce61a..17b0df024e9 100644
--- a/engines/nancy/action/puzzlerecord.cpp
+++ b/engines/nancy/action/puzzlerecord.cpp
@@ -25,7 +25,7 @@
#include "engines/nancy/cursor.h"
#include "engines/nancy/graphics.h"
#include "engines/nancy/input.h"
-#include "engines/nancy/resource.h"
+#include "engines/nancy/resource/resource.h"
#include "engines/nancy/sound.h"
#include "engines/nancy/util.h"
diff --git a/engines/nancy/action/secondarymovie.cpp b/engines/nancy/action/secondarymovie.cpp
index 965145b5083..099d0d76768 100644
--- a/engines/nancy/action/secondarymovie.cpp
+++ b/engines/nancy/action/secondarymovie.cpp
@@ -23,10 +23,10 @@
#include "engines/nancy/graphics.h"
#include "engines/nancy/input.h"
#include "engines/nancy/nancy.h"
-#include "engines/nancy/resource.h"
+#include "engines/nancy/resource/resource.h"
#include "engines/nancy/sound.h"
#include "engines/nancy/util.h"
-#include "engines/nancy/video.h"
+#include "engines/nancy/resource/video.h"
#include "engines/nancy/action/secondarymovie.h"
#include "engines/nancy/state/scene.h"
diff --git a/engines/nancy/commontypes.cpp b/engines/nancy/commontypes.cpp
index c3fbaac91b9..e19f89db811 100644
--- a/engines/nancy/commontypes.cpp
+++ b/engines/nancy/commontypes.cpp
@@ -22,8 +22,8 @@
#include "engines/nancy/commontypes.h"
#include "engines/nancy/util.h"
#include "engines/nancy/nancy.h"
-#include "engines/nancy/cif.h"
-#include "engines/nancy/resource.h"
+#include "engines/nancy/resource/cif.h"
+#include "engines/nancy/resource/resource.h"
#include "engines/nancy/sound.h"
#include "engines/nancy/state/scene.h"
diff --git a/engines/nancy/console.cpp b/engines/nancy/console.cpp
index a96c9d5646e..17bb8d482d9 100644
--- a/engines/nancy/console.cpp
+++ b/engines/nancy/console.cpp
@@ -32,10 +32,10 @@
#include "engines/nancy/movieplayer.h"
#include "engines/nancy/nancy.h"
#include "engines/nancy/console.h"
-#include "engines/nancy/resource.h"
+#include "engines/nancy/resource/resource.h"
#include "engines/nancy/sound.h"
-#include "engines/nancy/cif.h"
-#include "engines/nancy/iff.h"
+#include "engines/nancy/resource/cif.h"
+#include "engines/nancy/resource/iff.h"
#include "engines/nancy/input.h"
#include "engines/nancy/graphics.h"
diff --git a/engines/nancy/cursor.cpp b/engines/nancy/cursor.cpp
index 099b1424a54..3d88a90d523 100644
--- a/engines/nancy/cursor.cpp
+++ b/engines/nancy/cursor.cpp
@@ -25,7 +25,7 @@
#include "engines/nancy/nancy.h"
#include "engines/nancy/cursor.h"
#include "engines/nancy/graphics.h"
-#include "engines/nancy/resource.h"
+#include "engines/nancy/resource/resource.h"
#include "engines/nancy/util.h"
namespace Nancy {
diff --git a/engines/nancy/font.cpp b/engines/nancy/font.cpp
index 2a8f23361bd..6fea5ec50e4 100644
--- a/engines/nancy/font.cpp
+++ b/engines/nancy/font.cpp
@@ -26,7 +26,7 @@
#include "engines/nancy/font.h"
#include "engines/nancy/nancy.h"
-#include "engines/nancy/resource.h"
+#include "engines/nancy/resource/resource.h"
#include "engines/nancy/graphics.h"
#include "engines/nancy/util.h"
#include "engines/nancy/enginedata.h"
diff --git a/engines/nancy/graphics.cpp b/engines/nancy/graphics.cpp
index 6cf4abdd77b..2c732df91d6 100644
--- a/engines/nancy/graphics.cpp
+++ b/engines/nancy/graphics.cpp
@@ -25,9 +25,9 @@
#include "engines/nancy/nancy.h"
#include "engines/nancy/graphics.h"
-#include "engines/nancy/iff.h"
+#include "engines/nancy/resource/iff.h"
#include "engines/nancy/renderobject.h"
-#include "engines/nancy/resource.h"
+#include "engines/nancy/resource/resource.h"
#include "engines/nancy/cursor.h"
#include "engines/nancy/state/scene.h"
diff --git a/engines/nancy/misc/hypertext.cpp b/engines/nancy/misc/hypertext.cpp
index f9a20534377..059a60a5b83 100644
--- a/engines/nancy/misc/hypertext.cpp
+++ b/engines/nancy/misc/hypertext.cpp
@@ -22,7 +22,7 @@
#include "engines/nancy/nancy.h"
#include "engines/nancy/graphics.h"
-#include "engines/nancy/resource.h"
+#include "engines/nancy/resource/resource.h"
#include "engines/nancy/font.h"
#include "engines/nancy/misc/hypertext.h"
diff --git a/engines/nancy/module.mk b/engines/nancy/module.mk
index 87db4b48141..b12b2d9da1b 100644
--- a/engines/nancy/module.mk
+++ b/engines/nancy/module.mk
@@ -161,27 +161,27 @@ MODULE_OBJS = \
misc/lightning.o \
misc/specialeffect.o \
misc/viewportfader.o \
- cif.o \
+ resource/cif.o \
+ resource/decompress.o \
+ resource/iff.o \
+ resource/resource.o \
+ resource/sound_vorbis.o \
+ resource/video.o \
+ resource/xsheetfile.o \
commontypes.o \
console.o \
cursor.o \
- decompress.o \
enginedata.o \
font.o \
graphics.o \
- iff.o \
movieplayer.o \
input.o \
metaengine.o \
nancy.o \
puzzledata.o \
renderobject.o \
- resource.o \
sound.o \
- sound_vorbis.o \
- util.o \
- video.o \
- xsheetfile.o
+ util.o
# Nancy19 and newer, whose scenes are Lua scripts
ifdef ENABLE_NANCY_V4
diff --git a/engines/nancy/movieplayer.cpp b/engines/nancy/movieplayer.cpp
index 3a6ca0c6e2d..0527ae41b0c 100644
--- a/engines/nancy/movieplayer.cpp
+++ b/engines/nancy/movieplayer.cpp
@@ -25,7 +25,7 @@
#include "video/bink_decoder.h"
#include "engines/nancy/nancy.h"
-#include "engines/nancy/video.h"
+#include "engines/nancy/resource/video.h"
#include "engines/nancy/graphics.h"
#include "engines/nancy/util.h"
#include "engines/nancy/commontypes.h"
diff --git a/engines/nancy/nancy.cpp b/engines/nancy/nancy.cpp
index 84bc9d250d3..d8ef7749287 100644
--- a/engines/nancy/nancy.cpp
+++ b/engines/nancy/nancy.cpp
@@ -31,9 +31,9 @@
#include "gui/message.h"
#include "engines/nancy/nancy.h"
-#include "engines/nancy/resource.h"
-#include "engines/nancy/cif.h"
-#include "engines/nancy/iff.h"
+#include "engines/nancy/resource/resource.h"
+#include "engines/nancy/resource/cif.h"
+#include "engines/nancy/resource/iff.h"
#include "engines/nancy/input.h"
#include "engines/nancy/sound.h"
#include "engines/nancy/graphics.h"
diff --git a/engines/nancy/cif.cpp b/engines/nancy/resource/cif.cpp
similarity index 99%
rename from engines/nancy/cif.cpp
rename to engines/nancy/resource/cif.cpp
index 1855b558a85..c169ea62a47 100644
--- a/engines/nancy/cif.cpp
+++ b/engines/nancy/resource/cif.cpp
@@ -19,8 +19,8 @@
*
*/
-#include "engines/nancy/cif.h"
-#include "engines/nancy/decompress.h"
+#include "engines/nancy/resource/cif.h"
+#include "engines/nancy/resource/decompress.h"
#include "engines/nancy/util.h"
#include "engines/nancy/nancy.h"
diff --git a/engines/nancy/cif.h b/engines/nancy/resource/cif.h
similarity index 98%
rename from engines/nancy/cif.h
rename to engines/nancy/resource/cif.h
index a7c6d02fc1f..116b1f14f6e 100644
--- a/engines/nancy/cif.h
+++ b/engines/nancy/resource/cif.h
@@ -19,8 +19,8 @@
*
*/
-#ifndef NANCY_CIF_H
-#define NANCY_CIF_H
+#ifndef NANCY_RESOURCE_CIF_H
+#define NANCY_RESOURCE_CIF_H
#include "common/archive.h"
#include "common/rect.h"
@@ -143,4 +143,4 @@ public:
} // End of namespace Nancy
-#endif // NANCY_CIF_H
+#endif // NANCY_RESOURCE_CIF_H
diff --git a/engines/nancy/decompress.cpp b/engines/nancy/resource/decompress.cpp
similarity index 98%
rename from engines/nancy/decompress.cpp
rename to engines/nancy/resource/decompress.cpp
index 303dab00f6e..ddf3f4b7184 100644
--- a/engines/nancy/decompress.cpp
+++ b/engines/nancy/resource/decompress.cpp
@@ -22,7 +22,7 @@
#include "common/memstream.h"
#include "common/textconsole.h"
-#include "engines/nancy/decompress.h"
+#include "engines/nancy/resource/decompress.h"
namespace Nancy {
diff --git a/engines/nancy/decompress.h b/engines/nancy/resource/decompress.h
similarity index 93%
rename from engines/nancy/decompress.h
rename to engines/nancy/resource/decompress.h
index 236a72618ae..f03ebfffde3 100644
--- a/engines/nancy/decompress.h
+++ b/engines/nancy/resource/decompress.h
@@ -19,8 +19,8 @@
*
*/
-#ifndef NANCY_DECOMPRESS_H
-#define NANCY_DECOMPRESS_H
+#ifndef NANCY_RESOURCE_DECOMPRESS_H
+#define NANCY_RESOURCE_DECOMPRESS_H
#include "common/scummsys.h"
@@ -64,4 +64,4 @@ private:
} // End of namespace Nancy
-#endif // NANCY_DECOMPRESS_H
+#endif // NANCY_RESOURCE_DECOMPRESS_H
diff --git a/engines/nancy/iff.cpp b/engines/nancy/resource/iff.cpp
similarity index 98%
rename from engines/nancy/iff.cpp
rename to engines/nancy/resource/iff.cpp
index ad63e103e65..b7af08c5bbd 100644
--- a/engines/nancy/iff.cpp
+++ b/engines/nancy/resource/iff.cpp
@@ -23,8 +23,8 @@
#include "common/formats/iff_container.h"
#include "engines/nancy/nancy.h"
-#include "engines/nancy/iff.h"
-#include "engines/nancy/resource.h"
+#include "engines/nancy/resource/iff.h"
+#include "engines/nancy/resource/resource.h"
#include "engines/nancy/util.h"
namespace Nancy {
diff --git a/engines/nancy/iff.h b/engines/nancy/resource/iff.h
similarity index 95%
rename from engines/nancy/iff.h
rename to engines/nancy/resource/iff.h
index 9db5069a47f..46a1c2eccae 100644
--- a/engines/nancy/iff.h
+++ b/engines/nancy/resource/iff.h
@@ -19,8 +19,8 @@
*
*/
-#ifndef NANCY_IFF_H
-#define NANCY_IFF_H
+#ifndef NANCY_RESOURCE_IFF_H
+#define NANCY_RESOURCE_IFF_H
#include "common/array.h"
#include "common/str.h"
@@ -70,4 +70,4 @@ private:
} // End of namespace Nancy
-#endif // NANCY_IFF_H
+#endif // NANCY_RESOURCE_IFF_H
diff --git a/engines/nancy/resource.cpp b/engines/nancy/resource/resource.cpp
similarity index 99%
rename from engines/nancy/resource.cpp
rename to engines/nancy/resource/resource.cpp
index 1233af6ebd7..40c36c68a1a 100644
--- a/engines/nancy/resource.cpp
+++ b/engines/nancy/resource/resource.cpp
@@ -26,11 +26,11 @@
#include "image/png.h"
#include "engines/nancy/nancy.h"
-#include "engines/nancy/resource.h"
-#include "engines/nancy/decompress.h"
+#include "engines/nancy/resource/resource.h"
+#include "engines/nancy/resource/decompress.h"
#include "engines/nancy/graphics.h"
#include "engines/nancy/util.h"
-#include "engines/nancy/iff.h"
+#include "engines/nancy/resource/iff.h"
static char treePrefix[] = "_tree_";
diff --git a/engines/nancy/resource.h b/engines/nancy/resource/resource.h
similarity index 95%
rename from engines/nancy/resource.h
rename to engines/nancy/resource/resource.h
index a21c47ec430..dac7961438b 100644
--- a/engines/nancy/resource.h
+++ b/engines/nancy/resource/resource.h
@@ -19,10 +19,10 @@
*
*/
-#ifndef NANCY_RESOURCE_H
-#define NANCY_RESOURCE_H
+#ifndef NANCY_RESOURCE_RESOURCE_H
+#define NANCY_RESOURCE_RESOURCE_H
-#include "engines/nancy/cif.h"
+#include "engines/nancy/resource/cif.h"
namespace Graphics {
struct Surface;
@@ -84,4 +84,4 @@ private:
} // End of namespace Nancy
-#endif // NANCY_RESOURCE_H
+#endif // NANCY_RESOURCE_RESOURCE_H
diff --git a/engines/nancy/sound_vorbis.cpp b/engines/nancy/resource/sound_vorbis.cpp
similarity index 98%
rename from engines/nancy/sound_vorbis.cpp
rename to engines/nancy/resource/sound_vorbis.cpp
index 6325831bf3e..d8bd26e8961 100644
--- a/engines/nancy/sound_vorbis.cpp
+++ b/engines/nancy/resource/sound_vorbis.cpp
@@ -24,7 +24,7 @@
#define FORBIDDEN_SYMBOL_EXCEPTION_FILE
#define FORBIDDEN_SYMBOL_EXCEPTION_fseek
-#include "engines/nancy/sound_vorbis.h"
+#include "engines/nancy/resource/sound_vorbis.h"
#include "audio/decoders/vorbis_intern.h"
#include "common/textconsole.h"
diff --git a/engines/nancy/sound_vorbis.h b/engines/nancy/resource/sound_vorbis.h
similarity index 91%
rename from engines/nancy/sound_vorbis.h
rename to engines/nancy/resource/sound_vorbis.h
index d5ef4c1566e..86d1d2c6774 100644
--- a/engines/nancy/sound_vorbis.h
+++ b/engines/nancy/resource/sound_vorbis.h
@@ -19,8 +19,8 @@
*
*/
-#ifndef NANCY_SOUND_VORBIS_H
-#define NANCY_SOUND_VORBIS_H
+#ifndef NANCY_RESOURCE_SOUND_VORBIS_H
+#define NANCY_RESOURCE_SOUND_VORBIS_H
#include "common/types.h"
@@ -40,4 +40,4 @@ Audio::SeekableAudioStream *makeHISVorbisStream(
} // End of namespace Nancy
-#endif // NANCY_SOUND_VORBIS_H
+#endif // NANCY_RESOURCE_SOUND_VORBIS_H
diff --git a/engines/nancy/video.cpp b/engines/nancy/resource/video.cpp
similarity index 99%
rename from engines/nancy/video.cpp
rename to engines/nancy/resource/video.cpp
index 1af2bb27c10..88611b3caed 100644
--- a/engines/nancy/video.cpp
+++ b/engines/nancy/resource/video.cpp
@@ -23,8 +23,8 @@
#include "common/substream.h"
#include "engines/nancy/nancy.h"
-#include "engines/nancy/video.h"
-#include "engines/nancy/decompress.h"
+#include "engines/nancy/resource/video.h"
+#include "engines/nancy/resource/decompress.h"
#include "engines/nancy/graphics.h"
#include "engines/nancy/util.h"
diff --git a/engines/nancy/video.h b/engines/nancy/resource/video.h
similarity index 97%
rename from engines/nancy/video.h
rename to engines/nancy/resource/video.h
index 2e6224a2d3c..30333ce48a4 100644
--- a/engines/nancy/video.h
+++ b/engines/nancy/resource/video.h
@@ -19,8 +19,8 @@
*
*/
-#ifndef NANCY_VIDEO_H
-#define NANCY_VIDEO_H
+#ifndef NANCY_RESOURCE_VIDEO_H
+#define NANCY_RESOURCE_VIDEO_H
#include "video/video_decoder.h"
@@ -108,4 +108,4 @@ private:
} // End of namespace Nancy
-#endif // NANCY_VIDEO_H
+#endif // NANCY_RESOURCE_VIDEO_H
diff --git a/engines/nancy/xsheetfile.cpp b/engines/nancy/resource/xsheetfile.cpp
similarity index 98%
rename from engines/nancy/xsheetfile.cpp
rename to engines/nancy/resource/xsheetfile.cpp
index be6c01fbce3..64980ea3909 100644
--- a/engines/nancy/xsheetfile.cpp
+++ b/engines/nancy/resource/xsheetfile.cpp
@@ -25,7 +25,7 @@
#include "engines/nancy/nancy.h"
#include "engines/nancy/util.h"
-#include "engines/nancy/xsheetfile.h"
+#include "engines/nancy/resource/xsheetfile.h"
namespace Nancy {
diff --git a/engines/nancy/xsheetfile.h b/engines/nancy/resource/xsheetfile.h
similarity index 94%
rename from engines/nancy/xsheetfile.h
rename to engines/nancy/resource/xsheetfile.h
index a4464180ea8..47345486127 100644
--- a/engines/nancy/xsheetfile.h
+++ b/engines/nancy/resource/xsheetfile.h
@@ -19,8 +19,8 @@
*
*/
-#ifndef NANCY_XSHEETFILE_H
-#define NANCY_XSHEETFILE_H
+#ifndef NANCY_RESOURCE_XSHEETFILE_H
+#define NANCY_RESOURCE_XSHEETFILE_H
#include "common/array.h"
#include "common/path.h"
@@ -56,4 +56,4 @@ struct XSheetFile {
} // End of namespace Nancy
-#endif // NANCY_XSHEETFILE_H
+#endif // NANCY_RESOURCE_XSHEETFILE_H
diff --git a/engines/nancy/script/luastate.cpp b/engines/nancy/script/luastate.cpp
index ca76ac366e3..dfec58c56cb 100644
--- a/engines/nancy/script/luastate.cpp
+++ b/engines/nancy/script/luastate.cpp
@@ -28,7 +28,7 @@
#include "common/lua/lualib.h"
#include "engines/nancy/nancy.h"
-#include "engines/nancy/resource.h"
+#include "engines/nancy/resource/resource.h"
#include "engines/nancy/script/api.h"
#include "engines/nancy/script/luastate.h"
diff --git a/engines/nancy/script/particles.cpp b/engines/nancy/script/particles.cpp
index db31565718b..0c8dc50e7c2 100644
--- a/engines/nancy/script/particles.cpp
+++ b/engines/nancy/script/particles.cpp
@@ -25,7 +25,7 @@
#include "engines/nancy/enginedata.h"
#include "engines/nancy/graphics.h"
#include "engines/nancy/nancy.h"
-#include "engines/nancy/resource.h"
+#include "engines/nancy/resource/resource.h"
#include "engines/nancy/script/luabind.h"
#include "engines/nancy/script/mathtypes.h"
diff --git a/engines/nancy/script/records.cpp b/engines/nancy/script/records.cpp
index 7acc4faff3a..0be661025f8 100644
--- a/engines/nancy/script/records.cpp
+++ b/engines/nancy/script/records.cpp
@@ -30,7 +30,7 @@
#include "engines/nancy/graphics.h"
#include "engines/nancy/nancy.h"
#include "engines/nancy/puzzledata.h"
-#include "engines/nancy/resource.h"
+#include "engines/nancy/resource/resource.h"
#include "engines/nancy/sound.h"
#include "engines/nancy/script/api.h"
diff --git a/engines/nancy/script/ref.cpp b/engines/nancy/script/ref.cpp
index c3958335036..72990493f93 100644
--- a/engines/nancy/script/ref.cpp
+++ b/engines/nancy/script/ref.cpp
@@ -22,7 +22,7 @@
#include "common/hashmap.h"
#include "engines/nancy/nancy.h"
-#include "engines/nancy/resource.h"
+#include "engines/nancy/resource/resource.h"
#include "engines/nancy/script/api.h"
#include "engines/nancy/script/luabind.h"
diff --git a/engines/nancy/script/scenecontext.cpp b/engines/nancy/script/scenecontext.cpp
index 6c020d8ce34..880721d865e 100644
--- a/engines/nancy/script/scenecontext.cpp
+++ b/engines/nancy/script/scenecontext.cpp
@@ -26,7 +26,7 @@
#include "engines/nancy/enginedata.h"
#include "engines/nancy/input.h"
#include "engines/nancy/nancy.h"
-#include "engines/nancy/resource.h"
+#include "engines/nancy/resource/resource.h"
#include "engines/nancy/util.h"
#include "engines/nancy/script/convo.h"
diff --git a/engines/nancy/script/xsheet.cpp b/engines/nancy/script/xsheet.cpp
index 658e0bd7265..0cad87f13f5 100644
--- a/engines/nancy/script/xsheet.cpp
+++ b/engines/nancy/script/xsheet.cpp
@@ -22,7 +22,7 @@
#include "common/textconsole.h"
#include "engines/nancy/graphics.h"
-#include "engines/nancy/xsheetfile.h"
+#include "engines/nancy/resource/xsheetfile.h"
#include "engines/nancy/script/api.h"
#include "engines/nancy/script/luabind.h"
diff --git a/engines/nancy/sound.cpp b/engines/nancy/sound.cpp
index db2e7b4ad70..ca4dc1909db 100644
--- a/engines/nancy/sound.cpp
+++ b/engines/nancy/sound.cpp
@@ -27,11 +27,11 @@
#include "audio/audiostream.h"
#include "audio/decoders/raw.h"
-#include "engines/nancy/sound_vorbis.h"
+#include "engines/nancy/resource/sound_vorbis.h"
#include "engines/nancy/nancy.h"
#include "engines/nancy/sound.h"
-#include "engines/nancy/iff.h"
+#include "engines/nancy/resource/iff.h"
#include "engines/nancy/state/scene.h"
#include "engines/nancy/state/map.h"
diff --git a/engines/nancy/state/credits.cpp b/engines/nancy/state/credits.cpp
index 48680d70d53..57f94367caa 100644
--- a/engines/nancy/state/credits.cpp
+++ b/engines/nancy/state/credits.cpp
@@ -20,7 +20,7 @@
*/
#include "engines/nancy/nancy.h"
-#include "engines/nancy/resource.h"
+#include "engines/nancy/resource/resource.h"
#include "engines/nancy/graphics.h"
#include "engines/nancy/sound.h"
#include "engines/nancy/input.h"
diff --git a/engines/nancy/state/designselect.cpp b/engines/nancy/state/designselect.cpp
index 89f1b81a01b..14785b13bb0 100644
--- a/engines/nancy/state/designselect.cpp
+++ b/engines/nancy/state/designselect.cpp
@@ -24,8 +24,8 @@
#include "engines/nancy/font.h"
#include "engines/nancy/graphics.h"
#include "engines/nancy/input.h"
-#include "engines/nancy/iff.h"
-#include "engines/nancy/resource.h"
+#include "engines/nancy/resource/iff.h"
+#include "engines/nancy/resource/resource.h"
#include "engines/nancy/sound.h"
#include "engines/nancy/state/designselect.h"
diff --git a/engines/nancy/state/loadsave.cpp b/engines/nancy/state/loadsave.cpp
index 9bc99bf336f..7d1fb2d7fa2 100644
--- a/engines/nancy/state/loadsave.cpp
+++ b/engines/nancy/state/loadsave.cpp
@@ -24,7 +24,7 @@
#include "engines/nancy/sound.h"
#include "engines/nancy/input.h"
#include "engines/nancy/util.h"
-#include "engines/nancy/resource.h"
+#include "engines/nancy/resource/resource.h"
#include "engines/nancy/graphics.h"
#include "engines/nancy/state/loadsave.h"
diff --git a/engines/nancy/state/scene.cpp b/engines/nancy/state/scene.cpp
index 4c4293bf601..119c8636616 100644
--- a/engines/nancy/state/scene.cpp
+++ b/engines/nancy/state/scene.cpp
@@ -25,13 +25,13 @@
#include "common/random.h"
#include "engines/nancy/nancy.h"
-#include "engines/nancy/iff.h"
+#include "engines/nancy/resource/iff.h"
#include "engines/nancy/input.h"
#include "engines/nancy/sound.h"
#include "engines/nancy/graphics.h"
#include "engines/nancy/cursor.h"
#include "engines/nancy/util.h"
-#include "engines/nancy/resource.h"
+#include "engines/nancy/resource/resource.h"
#include "engines/nancy/state/scene.h"
#include "engines/nancy/state/map.h"
diff --git a/engines/nancy/state/scenestream.cpp b/engines/nancy/state/scenestream.cpp
index aacb02c2af5..c75a4353db6 100644
--- a/engines/nancy/state/scenestream.cpp
+++ b/engines/nancy/state/scenestream.cpp
@@ -20,9 +20,9 @@
*/
#include "engines/nancy/nancy.h"
-#include "engines/nancy/iff.h"
+#include "engines/nancy/resource/iff.h"
#include "engines/nancy/input.h"
-#include "engines/nancy/resource.h"
+#include "engines/nancy/resource/resource.h"
#include "engines/nancy/sound.h"
#include "engines/nancy/util.h"
diff --git a/engines/nancy/ui/fullscreenimage.cpp b/engines/nancy/ui/fullscreenimage.cpp
index 31e0ed9c39b..dcf0261bb48 100644
--- a/engines/nancy/ui/fullscreenimage.cpp
+++ b/engines/nancy/ui/fullscreenimage.cpp
@@ -20,7 +20,7 @@
*/
#include "engines/nancy/nancy.h"
-#include "engines/nancy/resource.h"
+#include "engines/nancy/resource/resource.h"
#include "engines/nancy/graphics.h"
#include "engines/nancy/ui/fullscreenimage.h"
diff --git a/engines/nancy/ui/inventorybox.cpp b/engines/nancy/ui/inventorybox.cpp
index fcc7dbe3899..3e11cb39244 100644
--- a/engines/nancy/ui/inventorybox.cpp
+++ b/engines/nancy/ui/inventorybox.cpp
@@ -21,7 +21,7 @@
#include "engines/nancy/nancy.h"
#include "engines/nancy/graphics.h"
-#include "engines/nancy/resource.h"
+#include "engines/nancy/resource/resource.h"
#include "engines/nancy/cursor.h"
#include "engines/nancy/sound.h"
#include "engines/nancy/input.h"
diff --git a/engines/nancy/ui/ndui/manager.cpp b/engines/nancy/ui/ndui/manager.cpp
index c89d21bfc16..275b6d42445 100644
--- a/engines/nancy/ui/ndui/manager.cpp
+++ b/engines/nancy/ui/ndui/manager.cpp
@@ -24,8 +24,8 @@
#include "common/memstream.h"
#include "engines/nancy/nancy.h"
-#include "engines/nancy/resource.h"
-#include "engines/nancy/iff.h"
+#include "engines/nancy/resource/resource.h"
+#include "engines/nancy/resource/iff.h"
#include "engines/nancy/input.h"
#include "engines/nancy/cursor.h"
#include "engines/nancy/graphics.h"
diff --git a/engines/nancy/ui/taskbar/camera.cpp b/engines/nancy/ui/taskbar/camera.cpp
index 06a57454702..ae97ab1e765 100644
--- a/engines/nancy/ui/taskbar/camera.cpp
+++ b/engines/nancy/ui/taskbar/camera.cpp
@@ -26,7 +26,7 @@
#include "engines/nancy/graphics.h"
#include "engines/nancy/input.h"
#include "engines/nancy/puzzledata.h"
-#include "engines/nancy/resource.h"
+#include "engines/nancy/resource/resource.h"
#include "engines/nancy/sound.h"
#include "engines/nancy/util.h"
diff --git a/engines/nancy/ui/taskbar/cellphonepopup.cpp b/engines/nancy/ui/taskbar/cellphonepopup.cpp
index 55b59699da8..db14e591278 100644
--- a/engines/nancy/ui/taskbar/cellphonepopup.cpp
+++ b/engines/nancy/ui/taskbar/cellphonepopup.cpp
@@ -28,7 +28,7 @@
#include "engines/nancy/input.h"
#include "engines/nancy/nancy.h"
#include "engines/nancy/puzzledata.h"
-#include "engines/nancy/resource.h"
+#include "engines/nancy/resource/resource.h"
#include "engines/nancy/sound.h"
#include "engines/nancy/misc/hypertext.h"
diff --git a/engines/nancy/ui/taskbar/conversationpopup.cpp b/engines/nancy/ui/taskbar/conversationpopup.cpp
index 13732440efc..fe79e160588 100644
--- a/engines/nancy/ui/taskbar/conversationpopup.cpp
+++ b/engines/nancy/ui/taskbar/conversationpopup.cpp
@@ -23,7 +23,7 @@
#include "engines/nancy/graphics.h"
#include "engines/nancy/input.h"
#include "engines/nancy/nancy.h"
-#include "engines/nancy/resource.h"
+#include "engines/nancy/resource/resource.h"
#include "engines/nancy/state/scene.h"
diff --git a/engines/nancy/ui/taskbar/inventorypopup.cpp b/engines/nancy/ui/taskbar/inventorypopup.cpp
index 4761ba836c5..9cc716a088f 100644
--- a/engines/nancy/ui/taskbar/inventorypopup.cpp
+++ b/engines/nancy/ui/taskbar/inventorypopup.cpp
@@ -23,7 +23,7 @@
#include "engines/nancy/graphics.h"
#include "engines/nancy/input.h"
#include "engines/nancy/nancy.h"
-#include "engines/nancy/resource.h"
+#include "engines/nancy/resource/resource.h"
#include "engines/nancy/sound.h"
#include "engines/nancy/state/scene.h"
diff --git a/engines/nancy/ui/taskbar/notebookpopup.cpp b/engines/nancy/ui/taskbar/notebookpopup.cpp
index 10ca5f86740..cfc201cb1bc 100644
--- a/engines/nancy/ui/taskbar/notebookpopup.cpp
+++ b/engines/nancy/ui/taskbar/notebookpopup.cpp
@@ -28,7 +28,7 @@
#include "engines/nancy/input.h"
#include "engines/nancy/nancy.h"
#include "engines/nancy/puzzledata.h"
-#include "engines/nancy/resource.h"
+#include "engines/nancy/resource/resource.h"
#include "engines/nancy/sound.h"
#include "engines/nancy/state/scene.h"
diff --git a/engines/nancy/ui/taskbar/scrolltextbox.cpp b/engines/nancy/ui/taskbar/scrolltextbox.cpp
index 47a659be258..02e6aa19355 100644
--- a/engines/nancy/ui/taskbar/scrolltextbox.cpp
+++ b/engines/nancy/ui/taskbar/scrolltextbox.cpp
@@ -23,7 +23,7 @@
#include "engines/nancy/graphics.h"
#include "engines/nancy/input.h"
#include "engines/nancy/nancy.h"
-#include "engines/nancy/resource.h"
+#include "engines/nancy/resource/resource.h"
#include "engines/nancy/state/scene.h"
diff --git a/engines/nancy/ui/taskbar/taskbar.cpp b/engines/nancy/ui/taskbar/taskbar.cpp
index 56fbc95e76c..f47a600f779 100644
--- a/engines/nancy/ui/taskbar/taskbar.cpp
+++ b/engines/nancy/ui/taskbar/taskbar.cpp
@@ -27,7 +27,7 @@
#include "engines/nancy/graphics.h"
#include "engines/nancy/input.h"
#include "engines/nancy/puzzledata.h"
-#include "engines/nancy/resource.h"
+#include "engines/nancy/resource/resource.h"
#include "engines/nancy/sound.h"
#include "engines/nancy/state/scene.h"
More information about the Scummvm-git-logs
mailing list