[Scummvm-git-logs] scummvm master -> 03c780c4cde6b654ee55388c73cb672979159b6b
fracturehill
noreply at scummvm.org
Thu Sep 21 11:46:52 UTC 2023
This automated email contains information about 10 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
dd3e313c2b DEVTOOLS: Fix nancy4 data in nancy.dat
2889e714e2 NANCY: Do not allow conditional responses to repeat
4463da2c88 NANCY: Always re-enable cursor after movie end
a906eabe23 NANCY: Static overlay fix
ccf6673b3b NANCY: Add fix for a broken nancy4 string
de6603b814 NANCY: Fix incorrect timing of flag set
bd074bf6cd NANCY: Fix nancy4 SafeDialPuzzle
48de468c09 NANCY: Remove held item when entering puzzles
9f0904e8a3 NANCY: Make rotation cursors a special case
03c780c4cd NANCY: Support nancy6 scene flags
Commit: dd3e313c2bceb83aac6d8a21132766c93d9bf3af
https://github.com/scummvm/scummvm/commit/dd3e313c2bceb83aac6d8a21132766c93d9bf3af
Author: Kaloyan Chehlarski (strahy at outlook.com)
Date: 2023-09-21T14:46:15+03:00
Commit Message:
DEVTOOLS: Fix nancy4 data in nancy.dat
Fixed a couple of typos that would result in incorrect
dialogue.
Changed paths:
devtools/create_nancy/nancy4_data.h
diff --git a/devtools/create_nancy/nancy4_data.h b/devtools/create_nancy/nancy4_data.h
index debd446346c..1a3f60bacd4 100644
--- a/devtools/create_nancy/nancy4_data.h
+++ b/devtools/create_nancy/nancy4_data.h
@@ -48,7 +48,7 @@ const Common::Array<Common::Array<ConditionalDialogue>> _nancy4ConditionalDialog
{ 1, 1051, "NDE51",
{ { kEv, 249, true }, { kEv, 218, false }, { kEv, 246, false } } },
{ 2, 1052, "NDE52",
- { { kEv, 249, true }, { kEv, 70, false }, { kEv, 218, false } } },
+ { { kEv, 249, true }, { kEv, 70, false }, { kEv, 218, true } } },
{ 3, 1053, "NDE53",
{ { kEv, 249, true }, { kEv, 218, true }, { kEv, 116, true }, { kEv, 82, false } } },
{ 4, 1054, "NDE54",
@@ -62,7 +62,7 @@ const Common::Array<Common::Array<ConditionalDialogue>> _nancy4ConditionalDialog
{ 8, 1059, "NDE59",
{ { kEv, 262, true }, { kEv, 67, false } } },
{ 9, 1061, "NDE61",
- { { kEv, 275, true }, { kEv, 72, true }, { kEv, 81, false }, { kEv, 69, true }, { kEv, 61, false } } },
+ { { kEv, 275, true }, { kEv, 72, true }, { kEv, 81, true }, { kEv, 69, true }, { kEv, 61, false } } },
{ 10, 1062, "NDE62",
{ { kEv, 262, true }, { kEv, 60, false }, { kEv, 69, true } } },
{ 11, 1065, "NDE41b",
@@ -192,7 +192,7 @@ const Common::Array<Common::Array<ConditionalDialogue>> _nancy4ConditionalDialog
{ 65, 7025, "NDN25a",
{ { kEv, 259, true }, { kEv, 117, false }, { kEv, 202, false } } },
{ 66, 7026, "NDN26",
- { { kEv, 193, true }, { kEv, 195, false }, { kIn, 7, true }} },
+ { { kEv, 193, true }, { kEv, 195, false }, { kIn, 7, true } } },
{ 67, 7027, "NDN27",
{ { kEv, 265, true }, { kEv, 198, false } } },
{ 68, 7028, "NDN28",
Commit: 2889e714e28d7543ed8cc95b24e1ab3eae8575eb
https://github.com/scummvm/scummvm/commit/2889e714e28d7543ed8cc95b24e1ab3eae8575eb
Author: Kaloyan Chehlarski (strahy at outlook.com)
Date: 2023-09-21T14:46:15+03:00
Commit Message:
NANCY: Do not allow conditional responses to repeat
Fixed a (potential) issue where a conditional response
could get added twice to the same scene if it has multiple
ways to get triggered.
Changed paths:
engines/nancy/action/conversation.cpp
diff --git a/engines/nancy/action/conversation.cpp b/engines/nancy/action/conversation.cpp
index 0b07d70e926..bc2598cf147 100644
--- a/engines/nancy/action/conversation.cpp
+++ b/engines/nancy/action/conversation.cpp
@@ -351,6 +351,17 @@ void ConversationSound::addConditionalDialogue() {
newResponse.sceneChange.sceneID = res.sceneID;
newResponse.sceneChange.continueSceneSound = kContinueSceneSound;
+
+ // Check if the response is a repeat. This can happen when multiple condition combinations
+ // trigger the same response.
+ for (uint i = 0; i < _responses.size() - 1; ++i) {
+ if ( _responses[i].soundName == newResponse.soundName &&
+ _responses[i].text == newResponse.text &&
+ _responses[i].sceneChange.sceneID == newResponse.sceneChange.sceneID) {
+ _responses.pop_back();
+ break;
+ }
+ }
}
}
}
Commit: 4463da2c88c7eaf1b31872f06254b3bbbb6e801b
https://github.com/scummvm/scummvm/commit/4463da2c88c7eaf1b31872f06254b3bbbb6e801b
Author: Kaloyan Chehlarski (strahy at outlook.com)
Date: 2023-09-21T14:46:15+03:00
Commit Message:
NANCY: Always re-enable cursor after movie end
Fixed an edge case where a movie marked with the flag
that disables the mouse cursor may not reach its final frame,
and thus would never re-enable the mouse cursor.
Changed paths:
engines/nancy/action/secondarymovie.cpp
diff --git a/engines/nancy/action/secondarymovie.cpp b/engines/nancy/action/secondarymovie.cpp
index 61f0049dbe1..6637652c449 100644
--- a/engines/nancy/action/secondarymovie.cpp
+++ b/engines/nancy/action/secondarymovie.cpp
@@ -36,7 +36,7 @@ namespace Action {
PlaySecondaryMovie::~PlaySecondaryMovie() {
_decoder.close();
- if (_playerCursorAllowed == kNoPlayerCursorAllowed && _videoSceneChange == kMovieSceneChange) {
+ if (_playerCursorAllowed == kNoPlayerCursorAllowed) {
g_nancy->setMouseEnabled(true);
}
}
Commit: a906eabe23605410c4c3015cbc2c098b00b79515
https://github.com/scummvm/scummvm/commit/a906eabe23605410c4c3015cbc2c098b00b79515
Author: Kaloyan Chehlarski (strahy at outlook.com)
Date: 2023-09-21T14:46:15+03:00
Commit Message:
NANCY: Static overlay fix
This is yet another attempt at finally fixing the mess that
is the Overlay ActionRecord's static mode. This commit
fixes nancy4 scene 3500.
Changed paths:
engines/nancy/action/overlay.cpp
engines/nancy/action/overlay.h
diff --git a/engines/nancy/action/overlay.cpp b/engines/nancy/action/overlay.cpp
index a87f0509aaa..1d36a347522 100644
--- a/engines/nancy/action/overlay.cpp
+++ b/engines/nancy/action/overlay.cpp
@@ -275,7 +275,7 @@ Common::String Overlay::getRecordTypeName() const {
void Overlay::setFrame(uint frame) {
_currentFrame = frame;
- Common::Rect srcRect = _srcRects[frame];
+ Common::Rect srcRect;
if (_overlayType == kPlayOverlayAnimated) {
// Workaround for:
@@ -283,28 +283,47 @@ void Overlay::setFrame(uint frame) {
// - the fireplace in nancy2 scene 2491, where one of the rects is invalid.
// - the ball thing in nancy2 scene 1562, where one of the rects is twice as tall as it should be
// Assumes all rects in a single animation have the same dimensions
+ srcRect = _srcRects[frame];
if (!srcRect.isValidRect() || srcRect.width() != _srcRects[0].width() || srcRect.height() != _srcRects[0].height()) {
srcRect.setWidth(_srcRects[0].width());
srcRect.setHeight(_srcRects[0].height());
}
} else {
- // In static mode the animated srcRect above may or may not be valid.
- // The way the original engine seems to work is that it creates an intermediate surface using
- // the animation src bounds, and then copies from that surface to the screen using the static mode source
- // rect below (or the other way around). We can achieve the same results by just offsetting one
- // of the rects by the other's left/top coordinates, _provided they have the same dimensions_.
- // Test cases for the way the two rects interact are nancy3 scene 3070, nancy5 scenes 2056, 2075, and 2000
- for (uint i = 0; i < _blitDescriptions.size(); ++i) {
- if (_currentViewportFrame == _blitDescriptions[i].frameID) {
- Common::Rect staticSrc = _blitDescriptions[i].src;
-
- // If this assertion fails, we need to start using an intermediate surface
- assert((staticSrc.width() == srcRect.width() && staticSrc.height() == srcRect.height()) || srcRect.isEmpty());
-
- staticSrc.translate(srcRect.left, srcRect.top);
- srcRect = staticSrc;
+ if (_currentViewportFrame == -1) {
+ return;
+ }
+
+ // Static mode overlays are an absolute mess, and use both the general source rects (_srcRects),
+ // and the ones inside the blit description struct corresponding to the current scene background.
+
+ // Firstly, the order of the blit descriptions does not necessarily correspond to the order of
+ // the general rects, as the general rects are ordered based on the scene's background frame id,
+ // while the blit descriptions can be in arbitrary order.
+ // An example is nancy4 scene 3500, where the overlay appears on background frames 0, 1, 2, 18 and 19,
+ // while the blit descriptions are in order 18, 19, 0, 1, 2. Thus, if we don't do the counting below
+ // we get wildly inaccurate results.
+ uint srcID = 0;
+
+ for (int i = 0; i < _currentViewportFrame; ++i) {
+ for (uint j = 0; j < _blitDescriptions.size(); ++j) {
+ if (_blitDescriptions[j].frameID == i) {
+ ++srcID;
+ continue;
+ }
}
}
+
+ srcRect = _srcRects[srcID];
+
+ // Second, the general source rect we just got may also be completely empty (nancy5 scenes 2056, 2057),
+ // or have coordinates other than (0, 0) (nancy3 scene 3070, nancy5 scene 2000). Presumably,
+ // the general source rect was used for blitting to an (optional) intermediate surface, while the ones
+ // inside the blit description below were used for blitting from that intermediate surface to the screen.
+ // We can achieve the same results by doung the calculations below
+ Common::Rect staticSrc = _blitDescriptions[frame].src;
+ srcRect.translate(staticSrc.left, staticSrc.top);
+ srcRect.setWidth(staticSrc.width());
+ srcRect.setHeight(staticSrc.height());
}
_drawSurface.create(_fullSurface, srcRect);
diff --git a/engines/nancy/action/overlay.h b/engines/nancy/action/overlay.h
index b9b592de767..b71a7df15f6 100644
--- a/engines/nancy/action/overlay.h
+++ b/engines/nancy/action/overlay.h
@@ -82,6 +82,7 @@ protected:
void setFrame(uint frame);
Graphics::ManagedSurface _fullSurface;
+ Graphics::ManagedSurface _staticModeIntermediate;
};
} // End of namespace Action
Commit: ccf6673b3b9bda6589211031b05e847429037770
https://github.com/scummvm/scummvm/commit/ccf6673b3b9bda6589211031b05e847429037770
Author: Kaloyan Chehlarski (strahy at outlook.com)
Date: 2023-09-21T14:46:15+03:00
Commit Message:
NANCY: Add fix for a broken nancy4 string
Changed paths:
engines/nancy/font.cpp
diff --git a/engines/nancy/font.cpp b/engines/nancy/font.cpp
index 41f72b39ab4..a442a4f1b3d 100644
--- a/engines/nancy/font.cpp
+++ b/engines/nancy/font.cpp
@@ -285,6 +285,14 @@ Common::Rect Font::getCharacterSourceRect(char chr) const {
case '\xdf':
offset = _eszettOffset;
break;
+ case '\x92':
+ if (g_nancy->getGameType() == kGameTypeNancy4) {
+ // Improvement: we fix a specific broken string in nancy4 ("It's too dark..." when entering a dark staircase)
+ offset = _apostropheOffset;
+ } else {
+ offset = -1;
+ }
+ break;
default:
offset = -1;
break;
Commit: de6603b814bfa26ac21ede1aec7784abab78d47e
https://github.com/scummvm/scummvm/commit/de6603b814bfa26ac21ede1aec7784abab78d47e
Author: Kaloyan Chehlarski (strahy at outlook.com)
Date: 2023-09-21T14:46:15+03:00
Commit Message:
NANCY: Fix incorrect timing of flag set
Fixed a recently introduced execution error in PlayDigiSound.
This fixes some captions in nancy4.
Changed paths:
engines/nancy/action/soundrecords.cpp
engines/nancy/action/soundrecords.h
diff --git a/engines/nancy/action/soundrecords.cpp b/engines/nancy/action/soundrecords.cpp
index 24faa9afa4d..d480317b591 100644
--- a/engines/nancy/action/soundrecords.cpp
+++ b/engines/nancy/action/soundrecords.cpp
@@ -44,8 +44,8 @@ void PlayDigiSound::readData(Common::SeekableReadStream &stream) {
_sceneChange.readData(stream, g_nancy->getGameType() == kGameTypeVampire);
- _flagOnPlay.label = stream.readSint16LE();
- _flagOnPlay.flag = stream.readByte();
+ _flag.label = stream.readSint16LE();
+ _flag.flag = stream.readByte();
stream.skip(2); // VIDEO_STOP_RENDERING, VIDEO_CONTINUE_RENDERING
}
@@ -54,7 +54,6 @@ void PlayDigiSound::execute() {
case kBegin:
g_nancy->_sound->loadSound(_sound, &_soundEffect);
g_nancy->_sound->playSound(_sound);
- NancySceneState.setEventFlag(_flagOnPlay);
if (_changeSceneImmediately) {
NancySceneState.changeScene(_sceneChange);
@@ -71,9 +70,8 @@ void PlayDigiSound::execute() {
break;
case kActionTrigger:
- if (_sceneChange.sceneID != 9999) {
- NancySceneState.changeScene(_sceneChange);
- }
+ NancySceneState.changeScene(_sceneChange);
+ NancySceneState.setEventFlag(_flag);
g_nancy->_sound->stopSound(_sound);
diff --git a/engines/nancy/action/soundrecords.h b/engines/nancy/action/soundrecords.h
index 2811abf7158..747595107af 100644
--- a/engines/nancy/action/soundrecords.h
+++ b/engines/nancy/action/soundrecords.h
@@ -39,7 +39,7 @@ public:
SoundEffectDescription *_soundEffect = nullptr;
bool _changeSceneImmediately = false;
SceneChangeDescription _sceneChange;
- FlagDescription _flagOnPlay;
+ FlagDescription _flag;
protected:
Common::String getRecordTypeName() const override;
Commit: bd074bf6cd3970d43b2ca7cf430cdd7a0feaf276
https://github.com/scummvm/scummvm/commit/bd074bf6cd3970d43b2ca7cf430cdd7a0feaf276
Author: Kaloyan Chehlarski (strahy at outlook.com)
Date: 2023-09-21T14:46:15+03:00
Commit Message:
NANCY: Fix nancy4 SafeDialPuzzle
Fixed the non-sextant instances of the SafeDialPuzzle in
nancy4.
Changed paths:
engines/nancy/action/puzzle/safedialpuzzle.cpp
diff --git a/engines/nancy/action/puzzle/safedialpuzzle.cpp b/engines/nancy/action/puzzle/safedialpuzzle.cpp
index f117b97d761..7609e4d834a 100644
--- a/engines/nancy/action/puzzle/safedialpuzzle.cpp
+++ b/engines/nancy/action/puzzle/safedialpuzzle.cpp
@@ -92,6 +92,8 @@ void SafeDialPuzzle::readData(Common::SeekableReadStream &stream) {
readFilename(stream, _imageName2);
readFilename(stream, _resetImageName);
+ _numInbetweens = (_imageName2.size() ? 1 : 0);
+
uint16 num = 20;
if (g_nancy->getGameType() >= kGameTypeNancy4) {
num = stream.readUint16LE();
@@ -99,7 +101,7 @@ void SafeDialPuzzle::readData(Common::SeekableReadStream &stream) {
}
readRect(stream, _dialDest);
- readRectArray(stream, _dialSrcs, num, 20);
+ readRectArray(stream, _dialSrcs, num * (1 + _numInbetweens), 20);
readRect(stream, _resetDest);
readRect(stream, _resetSrc);
@@ -117,14 +119,18 @@ void SafeDialPuzzle::readData(Common::SeekableReadStream &stream) {
}
stream.skip((10 - solveSize) * 2);
+ readRect(stream, _ccwHotspot);
+ readRect(stream, _cwHotspot);
+
if (g_nancy->getGameType() >= kGameTypeNancy4) {
- readRect(stream, _cwHotspot); // swapped order
- readRect(stream, _ccwHotspot);
_useMoveArrows = stream.readByte();
- _numInbetweens = 0;
- } else {
- readRect(stream, _ccwHotspot);
- readRect(stream, _cwHotspot);
+ }
+
+ if (_useMoveArrows) {
+ // Swap the two hotspots
+ Common::Rect temp = _cwHotspot;
+ _cwHotspot = _ccwHotspot;
+ _ccwHotspot = temp;
}
_spinSound.readNormal(stream);
@@ -220,7 +226,7 @@ void SafeDialPuzzle::handleInput(NancyInput &input) {
}
drawDialFrame(_current * (1 + _numInbetweens) + (_numInbetweens ? 1 : 0));
- _nextAnim = g_nancy->getTotalPlayTime() + 250; // hardcoded
+ _nextAnim = g_nancy->getTotalPlayTime() + (g_nancy->getGameType() == kGameTypeNancy3 ? 250 : 500); // hardcoded
g_nancy->_sound->playSound(_spinSound);
_animState = kSpin;
@@ -237,7 +243,7 @@ void SafeDialPuzzle::handleInput(NancyInput &input) {
if (input.input & NancyInput::kLeftMouseButtonUp && _nextAnim < g_nancy->getTotalPlayTime() &&
_animState != kReset && _animState != kResetAnim) {
drawDialFrame(_current * (1 + _numInbetweens) + 1);
- _nextAnim = g_nancy->getTotalPlayTime() + 250; // hardcoded
+ _nextAnim = g_nancy->getTotalPlayTime() + (g_nancy->getGameType() == kGameTypeNancy3 ? 250 : 500); // hardcoded
if (_current == (_dialSrcs.size() / (1 + _numInbetweens)) - 1) {
_current = 0;
@@ -298,8 +304,8 @@ void SafeDialPuzzle::drawDialFrame(uint frame) {
}
void SafeDialPuzzle::pushSequence(uint id) {
- if (g_nancy->getGameType() <= kGameTypeNancy3 && id != 0) {
- // In nancy3, the ids in the correct sequence are in reverse order
+ if (!_useMoveArrows && id != 0) {
+ // When the puzzle is set to use rotation cursors, the ids in the correct sequence are in reverse order
id = (_dialSrcs.size() / (1 + _numInbetweens)) - id;
}
Commit: 48de468c0957634fff0025fc5642aebdc6572451
https://github.com/scummvm/scummvm/commit/48de468c0957634fff0025fc5642aebdc6572451
Author: Kaloyan Chehlarski (strahy at outlook.com)
Date: 2023-09-21T14:46:16+03:00
Commit Message:
NANCY: Remove held item when entering puzzles
Pretty much all puzzles (except the telephone and alarm
clock, which aren't actually puzzles) force the currently
held item back into the inventory when they start, which is
now implemented.
Changed paths:
engines/nancy/action/conversation.cpp
engines/nancy/action/puzzle/bombpuzzle.cpp
engines/nancy/action/puzzle/collisionpuzzle.cpp
engines/nancy/action/puzzle/leverpuzzle.cpp
engines/nancy/action/puzzle/orderingpuzzle.cpp
engines/nancy/action/puzzle/overridelockpuzzle.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/sliderpuzzle.cpp
engines/nancy/action/puzzle/soundequalizerpuzzle.cpp
engines/nancy/action/puzzle/tangrampuzzle.cpp
engines/nancy/action/puzzle/towerpuzzle.cpp
engines/nancy/action/puzzle/turningpuzzle.cpp
engines/nancy/state/scene.cpp
engines/nancy/state/scene.h
diff --git a/engines/nancy/action/conversation.cpp b/engines/nancy/action/conversation.cpp
index bc2598cf147..bf3de91a32f 100644
--- a/engines/nancy/action/conversation.cpp
+++ b/engines/nancy/action/conversation.cpp
@@ -139,11 +139,7 @@ void ConversationSound::execute() {
}
// Remove held item and re-add it to inventory
- int heldItem = NancySceneState.getHeldItem();
- if (heldItem != -1) {
- NancySceneState.addItemToInventory(heldItem);
- NancySceneState.setHeldItem(-1);
- }
+ NancySceneState.setNoHeldItem();
// Move the mouse to the default position defined in CURS
const Common::Point initialMousePos = g_nancy->_cursorManager->getPrimaryVideoInitialPos();
diff --git a/engines/nancy/action/puzzle/bombpuzzle.cpp b/engines/nancy/action/puzzle/bombpuzzle.cpp
index 847a55856ab..f167c0df5a1 100644
--- a/engines/nancy/action/puzzle/bombpuzzle.cpp
+++ b/engines/nancy/action/puzzle/bombpuzzle.cpp
@@ -187,6 +187,8 @@ void BombPuzzle::execute() {
g_nancy->_sound->loadSound(_snipSound);
g_nancy->_sound->loadSound(_noToolSound);
+ NancySceneState.setNoHeldItem();
+
_state = kRun;
break;
case kRun: {
diff --git a/engines/nancy/action/puzzle/collisionpuzzle.cpp b/engines/nancy/action/puzzle/collisionpuzzle.cpp
index 50a484ffdcc..6171bfb669e 100644
--- a/engines/nancy/action/puzzle/collisionpuzzle.cpp
+++ b/engines/nancy/action/puzzle/collisionpuzzle.cpp
@@ -241,6 +241,7 @@ void CollisionPuzzle::execute() {
g_nancy->_sound->loadSound(_moveSound);
g_nancy->_sound->loadSound(_wallHitSound);
g_nancy->_sound->loadSound(_homeSound);
+ NancySceneState.setNoHeldItem();
_state = kRun;
// fall through
case kRun :
diff --git a/engines/nancy/action/puzzle/leverpuzzle.cpp b/engines/nancy/action/puzzle/leverpuzzle.cpp
index 7572e4a236b..0499107b533 100644
--- a/engines/nancy/action/puzzle/leverpuzzle.cpp
+++ b/engines/nancy/action/puzzle/leverpuzzle.cpp
@@ -96,6 +96,8 @@ void LeverPuzzle::execute() {
g_nancy->_sound->loadSound(_moveSound);
g_nancy->_sound->loadSound(_noMoveSound);
+ NancySceneState.setNoHeldItem();
+
for (uint i = 0; i < 3; ++i) {
drawLever(i);
}
diff --git a/engines/nancy/action/puzzle/orderingpuzzle.cpp b/engines/nancy/action/puzzle/orderingpuzzle.cpp
index 6ea404b7cb5..cdf4a35360f 100644
--- a/engines/nancy/action/puzzle/orderingpuzzle.cpp
+++ b/engines/nancy/action/puzzle/orderingpuzzle.cpp
@@ -181,6 +181,9 @@ void OrderingPuzzle::execute() {
g_nancy->_sound->loadSound(_popUpSound);
}
}
+
+ NancySceneState.setNoHeldItem();
+
_state = kRun;
// fall through
case kRun:
diff --git a/engines/nancy/action/puzzle/overridelockpuzzle.cpp b/engines/nancy/action/puzzle/overridelockpuzzle.cpp
index d89e87dbba1..2e6182914bd 100644
--- a/engines/nancy/action/puzzle/overridelockpuzzle.cpp
+++ b/engines/nancy/action/puzzle/overridelockpuzzle.cpp
@@ -80,6 +80,8 @@ void OverrideLockPuzzle::execute() {
init();
registerGraphics();
+ NancySceneState.setNoHeldItem();
+
// Set the order of the button presses (always random)
// and of the lights (only random on expert difficulty)
uint numButtons = _buttonSrcs.size();
diff --git a/engines/nancy/action/puzzle/riddlepuzzle.cpp b/engines/nancy/action/puzzle/riddlepuzzle.cpp
index 242e230b9a2..c75e17d2d2c 100644
--- a/engines/nancy/action/puzzle/riddlepuzzle.cpp
+++ b/engines/nancy/action/puzzle/riddlepuzzle.cpp
@@ -134,6 +134,7 @@ void RiddlePuzzle::execute() {
NancySceneState.getTextbox().clear();
NancySceneState.getTextbox().setOverrideFont(_textboxTextFontID);
NancySceneState.getTextbox().addTextLine(_riddles[_riddleID].text);
+ NancySceneState.setNoHeldItem();
_state = kRun;
}
diff --git a/engines/nancy/action/puzzle/rippedletterpuzzle.cpp b/engines/nancy/action/puzzle/rippedletterpuzzle.cpp
index a7d186b938e..3d8cfd36f72 100644
--- a/engines/nancy/action/puzzle/rippedletterpuzzle.cpp
+++ b/engines/nancy/action/puzzle/rippedletterpuzzle.cpp
@@ -135,6 +135,9 @@ void RippedLetterPuzzle::execute() {
case kBegin:
init();
registerGraphics();
+
+ NancySceneState.setNoHeldItem();
+
if (!_puzzleState->playerHasTriedPuzzle) {
_puzzleState->order = _initOrder;
_puzzleState->rotations = _initRotations;
diff --git a/engines/nancy/action/puzzle/rotatinglockpuzzle.cpp b/engines/nancy/action/puzzle/rotatinglockpuzzle.cpp
index 83bdb17aa23..8e1c6c758aa 100644
--- a/engines/nancy/action/puzzle/rotatinglockpuzzle.cpp
+++ b/engines/nancy/action/puzzle/rotatinglockpuzzle.cpp
@@ -107,6 +107,8 @@ void RotatingLockPuzzle::execute() {
init();
registerGraphics();
+ NancySceneState.setNoHeldItem();
+
for (uint i = 0; i < _correctSequence.size(); ++i) {
_currentSequence.push_back(g_nancy->_randomSource->getRandomNumber(9));
drawDial(i);
diff --git a/engines/nancy/action/puzzle/safedialpuzzle.cpp b/engines/nancy/action/puzzle/safedialpuzzle.cpp
index 7609e4d834a..d72fc3a7224 100644
--- a/engines/nancy/action/puzzle/safedialpuzzle.cpp
+++ b/engines/nancy/action/puzzle/safedialpuzzle.cpp
@@ -154,6 +154,9 @@ void SafeDialPuzzle::execute() {
g_nancy->_sound->loadSound(_resetSound);
_current = 0;
drawDialFrame(_current);
+
+ NancySceneState.setNoHeldItem();
+
_state = kRun;
// fall through
case kRun :
diff --git a/engines/nancy/action/puzzle/sliderpuzzle.cpp b/engines/nancy/action/puzzle/sliderpuzzle.cpp
index 7d1c1bb29f3..f4907207273 100644
--- a/engines/nancy/action/puzzle/sliderpuzzle.cpp
+++ b/engines/nancy/action/puzzle/sliderpuzzle.cpp
@@ -119,6 +119,8 @@ void SliderPuzzle::execute() {
}
}
+ NancySceneState.setNoHeldItem();
+
g_nancy->_sound->loadSound(_clickSound);
_state = kRun;
// fall through
diff --git a/engines/nancy/action/puzzle/soundequalizerpuzzle.cpp b/engines/nancy/action/puzzle/soundequalizerpuzzle.cpp
index 54a05127ce0..c6ec181a398 100644
--- a/engines/nancy/action/puzzle/soundequalizerpuzzle.cpp
+++ b/engines/nancy/action/puzzle/soundequalizerpuzzle.cpp
@@ -204,6 +204,8 @@ void SoundEqualizerPuzzle::execute() {
updateSlider(i);
}
+ NancySceneState.setNoHeldItem();
+
_state = kRun;
break;
case kRun:
diff --git a/engines/nancy/action/puzzle/tangrampuzzle.cpp b/engines/nancy/action/puzzle/tangrampuzzle.cpp
index da92220b81c..9e89a2ddcf9 100644
--- a/engines/nancy/action/puzzle/tangrampuzzle.cpp
+++ b/engines/nancy/action/puzzle/tangrampuzzle.cpp
@@ -150,6 +150,9 @@ void TangramPuzzle::execute() {
g_nancy->_sound->loadSound(_pickUpSound);
g_nancy->_sound->loadSound(_putDownSound);
g_nancy->_sound->loadSound(_rotateSound);
+
+ NancySceneState.setNoHeldItem();
+
_state = kRun;
// fall through
case kRun :
diff --git a/engines/nancy/action/puzzle/towerpuzzle.cpp b/engines/nancy/action/puzzle/towerpuzzle.cpp
index 42973f20387..99b7ec735d0 100644
--- a/engines/nancy/action/puzzle/towerpuzzle.cpp
+++ b/engines/nancy/action/puzzle/towerpuzzle.cpp
@@ -119,6 +119,8 @@ void TowerPuzzle::execute() {
}
}
+ NancySceneState.setNoHeldItem();
+
g_nancy->_sound->loadSound(_takeSound);
g_nancy->_sound->loadSound(_dropSound);
diff --git a/engines/nancy/action/puzzle/turningpuzzle.cpp b/engines/nancy/action/puzzle/turningpuzzle.cpp
index 727187eaca9..e2a92e69532 100644
--- a/engines/nancy/action/puzzle/turningpuzzle.cpp
+++ b/engines/nancy/action/puzzle/turningpuzzle.cpp
@@ -196,6 +196,9 @@ void TurningPuzzle::execute() {
for (uint i = 0; i < _currentOrder.size(); ++i) {
drawObject(i, _currentOrder[i], 0);
}
+
+ NancySceneState.setNoHeldItem();
+
_state = kRun;
// fall through
case kRun :
diff --git a/engines/nancy/state/scene.cpp b/engines/nancy/state/scene.cpp
index 79f2b6e80aa..7a900e9ae0e 100644
--- a/engines/nancy/state/scene.cpp
+++ b/engines/nancy/state/scene.cpp
@@ -300,6 +300,12 @@ void Scene::setHeldItem(int16 id) {
_flags.heldItem = id; g_nancy->_cursorManager->setCursorItemID(id);
}
+void Scene::setNoHeldItem() {
+ if (getHeldItem() != -1) {
+ addItemToInventory(getHeldItem());
+ }
+}
+
void Scene::installInventorySoundOverride(byte command, const SoundDescription &sound, const Common::String &caption, uint16 itemID) {
InventorySoundOverride newOverride;
diff --git a/engines/nancy/state/scene.h b/engines/nancy/state/scene.h
index a16139e4587..81592c22e6a 100644
--- a/engines/nancy/state/scene.h
+++ b/engines/nancy/state/scene.h
@@ -135,6 +135,7 @@ public:
void removeItemFromInventory(uint16 id, bool pickUp = true);
int16 getHeldItem() const { return _flags.heldItem; }
void setHeldItem(int16 id);
+ void setNoHeldItem();
byte hasItem(int16 id) const { return _flags.items[id] || getHeldItem() == id; }
void installInventorySoundOverride(byte command, const SoundDescription &sound, const Common::String &caption, uint16 itemID);
Commit: 9f0904e8a30e4c35fb33f6dd68195f5cf0ad6df1
https://github.com/scummvm/scummvm/commit/9f0904e8a30e4c35fb33f6dd68195f5cf0ad6df1
Author: Kaloyan Chehlarski (strahy at outlook.com)
Date: 2023-09-21T14:46:16+03:00
Commit Message:
NANCY: Make rotation cursors a special case
Added the 'rotate (counter)clockwise' cursor types used in
some puzzles to the list of special cases that override
inventory cursors.
Changed paths:
engines/nancy/cursor.cpp
diff --git a/engines/nancy/cursor.cpp b/engines/nancy/cursor.cpp
index 345f9ba3b55..c6960649acf 100644
--- a/engines/nancy/cursor.cpp
+++ b/engines/nancy/cursor.cpp
@@ -214,6 +214,12 @@ void CursorManager::setCursor(CursorType type, int16 itemID) {
}
break;
+ case kRotateCW:
+ _curCursorID = kRotateCW;
+ return;
+ case kRotateCCW:
+ _curCursorID = kRotateCCW;
+ return;
case kSwivelLeft:
// Only valid for nancy6 and up, but we don't need a check for now
_curCursorID = kSwivelLeft;
Commit: 03c780c4cde6b654ee55388c73cb672979159b6b
https://github.com/scummvm/scummvm/commit/03c780c4cde6b654ee55388c73cb672979159b6b
Author: Kaloyan Chehlarski (strahy at outlook.com)
Date: 2023-09-21T14:46:16+03:00
Commit Message:
NANCY: Support nancy6 scene flags
Added support for two scene flags introduced in nancy6; one
disables the auto-move functionality on a per-scene basis,
and the other replaces the regular rotation cursors with
the newly-introduced inverted rotation ones.
Changed paths:
engines/nancy/commontypes.h
engines/nancy/cursor.cpp
engines/nancy/cursor.h
engines/nancy/ui/viewport.cpp
diff --git a/engines/nancy/commontypes.h b/engines/nancy/commontypes.h
index 6c22826044e..32b2aa57d10 100644
--- a/engines/nancy/commontypes.h
+++ b/engines/nancy/commontypes.h
@@ -67,6 +67,10 @@ static const byte kFlagCursor = 3;
static const byte kContinueSceneSound = 1;
static const byte kLoadSceneSound = 0;
+// Scene rotation special values
+static const uint16 kInvertedNode = 77;
+static const uint16 kNoAutoScroll = 333;
+
// Clock bump types
static const byte kAbsoluteClockBump = 1;
static const byte kRelativeClockBump = 2;
diff --git a/engines/nancy/cursor.cpp b/engines/nancy/cursor.cpp
index c6960649acf..80a9fb33e01 100644
--- a/engines/nancy/cursor.cpp
+++ b/engines/nancy/cursor.cpp
@@ -130,6 +130,14 @@ void CursorManager::setCursor(CursorType type, int16 itemID) {
}
return;
+ case kInvertedRotateLeft:
+ // Only valid for nancy6 and up
+ if (gameType >= kGameTypeNancy6) {
+ _curCursorID = kInvertedRotateLeft;
+ return;
+ }
+
+ // fall through
case kRotateLeft:
// Only valid for nancy6 and up
if (gameType >= kGameTypeNancy6) {
@@ -148,6 +156,14 @@ void CursorManager::setCursor(CursorType type, int16 itemID) {
}
break;
+ case kInvertedRotateRight:
+ // Only valid for nancy6 and up
+ if (gameType >= kGameTypeNancy6) {
+ _curCursorID = kInvertedRotateRight;
+ return;
+ }
+
+ // fall through
case kRotateRight:
// Only valid for nancy6 and up
if (gameType >= kGameTypeNancy6) {
@@ -220,14 +236,6 @@ void CursorManager::setCursor(CursorType type, int16 itemID) {
case kRotateCCW:
_curCursorID = kRotateCCW;
return;
- case kSwivelLeft:
- // Only valid for nancy6 and up, but we don't need a check for now
- _curCursorID = kSwivelLeft;
- return;
- case kSwivelRight:
- // Only valid for nancy6 and up, but we don't need a check for now
- _curCursorID = kSwivelRight;
- return;
default:
break;
}
diff --git a/engines/nancy/cursor.h b/engines/nancy/cursor.h
index 03558d12135..fad6b885ceb 100644
--- a/engines/nancy/cursor.h
+++ b/engines/nancy/cursor.h
@@ -35,22 +35,22 @@ class CursorManager {
public:
enum CursorType {
- kNormal = 0, // Eyeglass (except in TVD), non-highlighted
- kHotspot = 1, // Eyeglass (except in TVD), highlighted
- kMove = 2, // Used for movement in early games
- kExit = 3, // Used for movement, some games use it for exiting puzzles
- kRotateCW = 4, // Used in puzzles only
- kRotateCCW = 5, // Used in puzzles only
- kMoveLeft = 6, // Used for movement, some games used it for turning in 360 scenes
- kMoveRight = 7, // Used for movement, some games used it for turning in 360 scenes
- kMoveForward = 8, // Used for movement
- kMoveBackward = 9, // Used for movement, some games use it for exiting puzzles
- kMoveUp = 10, // Used for movement
- kMoveDown = 11, // Used for movement
- kRotateLeft = 12, // Used in 360 scenes in nancy6 and up
- kRotateRight = 13, // Used in 360 scenes in nancy6 and up
- kSwivelLeft = 14, // Not sure where this is used, subject to renaming
- kSwivelRight = 15, // Not sure where this is used, subject to renaming
+ kNormal = 0, // Eyeglass (except in TVD), non-highlighted
+ kHotspot = 1, // Eyeglass (except in TVD), highlighted
+ kMove = 2, // Used for movement in early games
+ kExit = 3, // Used for movement, some games use it for exiting puzzles
+ kRotateCW = 4, // Used in puzzles only
+ kRotateCCW = 5, // Used in puzzles only
+ kMoveLeft = 6, // Used for movement, some games used it for turning in 360 scenes
+ kMoveRight = 7, // Used for movement, some games used it for turning in 360 scenes
+ kMoveForward = 8, // Used for movement
+ kMoveBackward = 9, // Used for movement, some games use it for exiting puzzles
+ kMoveUp = 10, // Used for movement
+ kMoveDown = 11, // Used for movement
+ kRotateLeft = 12, // Used in 360 scenes in nancy6 and up
+ kRotateRight = 13, // Used in 360 scenes in nancy6 and up
+ kInvertedRotateLeft = 14, // Used in 360 scenes with inverted rotation; nancy6 and up
+ kInvertedRotateRight = 15, // Used in 360 scenes with inverted rotation; nancy6 and up
kNormalArrow,
kHotspotArrow
};
diff --git a/engines/nancy/ui/viewport.cpp b/engines/nancy/ui/viewport.cpp
index ab9b4501878..41ac65c4ec8 100644
--- a/engines/nancy/ui/viewport.cpp
+++ b/engines/nancy/ui/viewport.cpp
@@ -55,10 +55,16 @@ void Viewport::init() {
}
void Viewport::handleInput(NancyInput &input) {
+ const Nancy::State::Scene::SceneSummary &summary = NancySceneState.getSceneSummary();
Time systemTime = g_system->getMillis();
byte direction = 0;
- _autoMove = ConfMan.getBool("auto_move", ConfMan.getActiveDomainName());
+ if (summary.slowMoveTimeDelta == kNoAutoScroll) {
+ // Individual scenes may disable auto-move even when it's globally turned on
+ _autoMove = false;
+ } else {
+ _autoMove = ConfMan.getBool("auto_move", ConfMan.getActiveDomainName());
+ }
// Make cursor sticky when scrolling the viewport
if ( g_nancy->getGameType() != kGameTypeVampire &&
@@ -125,9 +131,19 @@ void Viewport::handleInput(NancyInput &input) {
if (direction) {
if (direction & kLeft) {
- g_nancy->_cursorManager->setCursorType(CursorManager::kRotateLeft);
+ if (summary.fastMoveTimeDelta == kInvertedNode) {
+ // Support nancy6+ inverted rotation scenes
+ g_nancy->_cursorManager->setCursorType(CursorManager::kInvertedRotateLeft);
+ } else {
+ g_nancy->_cursorManager->setCursorType(CursorManager::kRotateLeft);
+ }
} else if (direction & kRight) {
- g_nancy->_cursorManager->setCursorType(CursorManager::kRotateRight);
+ if (summary.fastMoveTimeDelta == kInvertedNode) {
+ // Support nancy6+ inverted rotation scenes
+ g_nancy->_cursorManager->setCursorType(CursorManager::kInvertedRotateRight);
+ } else {
+ g_nancy->_cursorManager->setCursorType(CursorManager::kRotateRight);
+ }
} else if (direction & kUp) {
g_nancy->_cursorManager->setCursorType(CursorManager::kMoveUp);
} else if (direction & kDown) {
@@ -165,7 +181,6 @@ void Viewport::handleInput(NancyInput &input) {
// Perform the movement
if (direction) {
- const Nancy::State::Scene::SceneSummary &summary = NancySceneState.getSceneSummary();
Time movementDelta = NancySceneState.getMovementTimeDelta(direction & kMoveFast);
if (systemTime > _nextMovementTime) {
More information about the Scummvm-git-logs
mailing list