[Scummvm-git-logs] scummvm master -> 71558e8503483874833e1c61c73d7d289da017f5
fracturehill
noreply at scummvm.org
Thu Dec 28 21:58:47 UTC 2023
This automated email contains information about 3 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
586225d614 NANCY: JANITORIAL: Spaces to tabs / double spaces
caf29003bd NANCY: Retain AssemblyPuzzle solve state
71558e8503 NANCY: Fix nancy1 telephone hints
Commit: 586225d614aa25ac51cbd65ccc6ed433704febe2
https://github.com/scummvm/scummvm/commit/586225d614aa25ac51cbd65ccc6ed433704febe2
Author: Kaloyan Chehlarski (strahy at outlook.com)
Date: 2023-12-28T23:58:17+02:00
Commit Message:
NANCY: JANITORIAL: Spaces to tabs / double spaces
Fixed all cases where spaces were used instead of tabs, and
all cases where a space was erroneously doubled.
Changed paths:
engines/nancy/action/puzzle/bulpuzzle.cpp
engines/nancy/action/puzzle/collisionpuzzle.cpp
engines/nancy/action/puzzle/raycastpuzzle.h
engines/nancy/action/puzzle/soundequalizerpuzzle.cpp
engines/nancy/action/puzzle/tangrampuzzle.cpp
engines/nancy/console.cpp
engines/nancy/cursor.cpp
engines/nancy/detection.cpp
engines/nancy/nancy.cpp
engines/nancy/sound.cpp
engines/nancy/state/scene.cpp
engines/nancy/ui/scrollbar.cpp
engines/nancy/ui/scrollbar.h
engines/nancy/video.cpp
diff --git a/engines/nancy/action/puzzle/bulpuzzle.cpp b/engines/nancy/action/puzzle/bulpuzzle.cpp
index 71964ee8be2..040a760da69 100644
--- a/engines/nancy/action/puzzle/bulpuzzle.cpp
+++ b/engines/nancy/action/puzzle/bulpuzzle.cpp
@@ -157,9 +157,9 @@ void BulPuzzle::updateGraphics() {
_needsRedraw = true;
}
- if (g_nancy->_sound->isSoundPlaying(_rollSound) ||
- g_nancy->_sound->isSoundPlaying(_resetSound) ||
- g_nancy->_sound->isSoundPlaying(_passSound)) {
+ if (g_nancy->_sound->isSoundPlaying(_rollSound) ||
+ g_nancy->_sound->isSoundPlaying(_passSound) ||
+ g_nancy->_sound->isSoundPlaying(_resetSound)) {
return;
}
diff --git a/engines/nancy/action/puzzle/collisionpuzzle.cpp b/engines/nancy/action/puzzle/collisionpuzzle.cpp
index 6171bfb669e..e7bb12a3a02 100644
--- a/engines/nancy/action/puzzle/collisionpuzzle.cpp
+++ b/engines/nancy/action/puzzle/collisionpuzzle.cpp
@@ -484,7 +484,7 @@ void CollisionPuzzle::drawGrid() {
dest.x += (cellRect.width() - _horizontalWallSrc.width()) / 2;
dest.y = cellRect.bottom - 1 + _lineWidth / 6;
- if (_lineWidth != 6) { // Improvement
+ if (_lineWidth != 6) { // Improvement
++dest.y;
}
@@ -496,7 +496,7 @@ void CollisionPuzzle::drawGrid() {
continue;
}
- if (_lineWidth == 6) { // Improvement
+ if (_lineWidth == 6) { // Improvement
dest.x -= 1;
} else {
dest.x += 1;
diff --git a/engines/nancy/action/puzzle/raycastpuzzle.h b/engines/nancy/action/puzzle/raycastpuzzle.h
index bb9be7d6254..d5600e5e6b1 100644
--- a/engines/nancy/action/puzzle/raycastpuzzle.h
+++ b/engines/nancy/action/puzzle/raycastpuzzle.h
@@ -38,7 +38,7 @@ class RaycastPuzzle : public RenderActionRecord {
friend class RaycastDeferredLoader;
friend class RaycastLevelBuilder;
public:
- RaycastPuzzle() : RenderActionRecord(7), _map(7) {}
+ RaycastPuzzle() : RenderActionRecord(7), _map(7) {}
~RaycastPuzzle() override {}
void init() override;
diff --git a/engines/nancy/action/puzzle/soundequalizerpuzzle.cpp b/engines/nancy/action/puzzle/soundequalizerpuzzle.cpp
index c6ec181a398..d342f5833fc 100644
--- a/engines/nancy/action/puzzle/soundequalizerpuzzle.cpp
+++ b/engines/nancy/action/puzzle/soundequalizerpuzzle.cpp
@@ -40,18 +40,18 @@ public:
Scrollbar(zOrder, srcBounds, srcSurf, topPosition, scrollDistance, isVertical) {}
virtual ~ViewportScrollbar() = default;
- bool handleInput(NancyInput &input) {
- if (_screenPosition.contains(input.mousePos)) {
- input.input &= (~NancyInput::kRightMouseButtonUp);
+ bool handleInput(NancyInput &input) {
+ if (_screenPosition.contains(input.mousePos)) {
+ input.input &= (~NancyInput::kRightMouseButtonUp);
- Scrollbar::handleInput(input);
+ Scrollbar::handleInput(input);
- g_nancy->_cursorManager->setCursorType(CursorManager::kHotspot);
+ g_nancy->_cursorManager->setCursorType(CursorManager::kHotspot);
return true;
- }
+ }
return false;
- }
+ }
};
SoundEqualizerPuzzle::~SoundEqualizerPuzzle() {
diff --git a/engines/nancy/action/puzzle/tangrampuzzle.cpp b/engines/nancy/action/puzzle/tangrampuzzle.cpp
index cf68b9549ea..caacfd2f7ab 100644
--- a/engines/nancy/action/puzzle/tangrampuzzle.cpp
+++ b/engines/nancy/action/puzzle/tangrampuzzle.cpp
@@ -383,7 +383,7 @@ void TangramPuzzle::redrawBuffer(const Common::Rect &rect) {
memset(dest, -1, rect.width());
}
- for (uint z = _z + 1; z < _z + _tiles.size(); ++z) {
+ for (uint z = _z + 1; z < _z + _tiles.size(); ++z) {
for (uint i = 0; i < _tiles.size() - 1; ++i) {
Tile &tile = _tiles[i];
if (tile._z == z) {
diff --git a/engines/nancy/console.cpp b/engines/nancy/console.cpp
index 7b8e5e8f4de..d1a700d40e6 100644
--- a/engines/nancy/console.cpp
+++ b/engines/nancy/console.cpp
@@ -681,7 +681,7 @@ bool NancyConsole::Cmd_scanForActionRecordType(int argc, const char **argv) {
insertVal = s.asUint64();
if (insertVal != 0 || s.firstChar() == '0') {
- if (i % 2) {
+ if (i % 2) {
if (insertVal > 255) {
debugPrintf("Invalid input: %u is a byte, value cannot be over 255!\n", (uint32)insertVal);
return true;
diff --git a/engines/nancy/cursor.cpp b/engines/nancy/cursor.cpp
index 2032ba604ed..2bf89968474 100644
--- a/engines/nancy/cursor.cpp
+++ b/engines/nancy/cursor.cpp
@@ -30,7 +30,7 @@
namespace Nancy {
-CursorManager::CursorManager() :
+CursorManager::CursorManager() :
_isInitialized(false),
_curItemID(-1),
_curCursorType(kNormal),
diff --git a/engines/nancy/detection.cpp b/engines/nancy/detection.cpp
index dce067d6fd1..249d43f437d 100644
--- a/engines/nancy/detection.cpp
+++ b/engines/nancy/detection.cpp
@@ -221,7 +221,7 @@ static const Nancy::NancyGameDescription gameDescriptions[] = {
"nancy3", nullptr,
{
{ "data1.hdr", 0, "9da72fec24e1ca4f8f6b563bbdab3276", 237686 },
- { "data1.cab", 0, "a7a259e45ae643aed63fa958531cc318", 3473219 },
+ { "data1.cab", 0, "a7a259e45ae643aed63fa958531cc318", 3473219 },
{ "data2.cab", 0, "cb709fba73605814f9dda823b1cfaf85", 433625036 },
{ "is:data1.cab:ciftree.dat", 0, "A:6b379f9d8edfb2d439062122e08f785c", 16161148 },
AD_LISTEND
@@ -322,7 +322,7 @@ static const Nancy::NancyGameDescription gameDescriptions[] = {
"nancy4", nullptr,
{
{ "data1.hdr", 0, "694d11d7ebdf2c96cd395f4baf938c10", 256535 },
- { "data1.cab", 0, "9c9c9c60c5344e877e033e54564c6e6e", 4892300 },
+ { "data1.cab", 0, "9c9c9c60c5344e877e033e54564c6e6e", 4892300 },
{ "data2.cab", 0, "05ef8fac76a227f829479719f40522b5", 458917888 },
{ "data3.cab", 0, "9b266564726664befe1770754150f5d8", 65795720 },
{ "is:data1.cab:ciftree.dat", 0, "A:a1090497f5fefce17494804bd1d624e1", 9991442 },
@@ -370,7 +370,7 @@ static const Nancy::NancyGameDescription gameDescriptions[] = {
{ "data1.hdr", 0, "0db3fb5bc002eb875eebb872969a22ca", 278505 },
{ "data1.cab", 0, "b5d2d218ded5683b5ca2eafcdc1ed76e", 1720654 },
{ "data2.cab", 0, "d379a879fb23b3013f78537927ac6cfe", 548761463 },
- { "is:data1.cab:ciftree.dat", 0, "A:21fa81f322595c3100d8d58d100852d5", 8187692 },
+ { "is:data1.cab:ciftree.dat", 0, "A:21fa81f322595c3100d8d58d100852d5", 8187692 },
AD_LISTEND
},
Common::EN_ANY,
diff --git a/engines/nancy/nancy.cpp b/engines/nancy/nancy.cpp
index 8b97ead58d3..81a98bf0b5a 100644
--- a/engines/nancy/nancy.cpp
+++ b/engines/nancy/nancy.cpp
@@ -160,7 +160,7 @@ void NancyEngine::errorString(const char *buf_input, char *buf_output, int buf_o
}
bool NancyEngine::hasFeature(EngineFeature f) const {
- return (f == kSupportsReturnToLauncher) ||
+ return (f == kSupportsReturnToLauncher) ||
(f == kSupportsLoadingDuringRuntime) ||
(f == kSupportsSavingDuringRuntime) ||
(f == kSupportsChangingOptionsDuringRuntime) ||
diff --git a/engines/nancy/sound.cpp b/engines/nancy/sound.cpp
index 596da39a6a2..a896c7b4387 100644
--- a/engines/nancy/sound.cpp
+++ b/engines/nancy/sound.cpp
@@ -754,14 +754,14 @@ void SoundManager::soundEffectMaintenance(uint16 channelID, bool force) {
Math::Quaternion quat;
switch (chan.effectData->rotateMoveAxis) {
case kRotateAroundX:
- quat = Math::Quaternion::xAxis(360.0 / chan.effectData->numMoveSteps);
- break;
+ quat = Math::Quaternion::xAxis(360.0 / chan.effectData->numMoveSteps);
+ break;
case kRotateAroundY:
- quat = Math::Quaternion::yAxis(360.0 / chan.effectData->numMoveSteps);
- break;
+ quat = Math::Quaternion::yAxis(360.0 / chan.effectData->numMoveSteps);
+ break;
case kRotateAroundZ:
- quat = Math::Quaternion::zAxis(360.0 / chan.effectData->numMoveSteps);
- break;
+ quat = Math::Quaternion::zAxis(360.0 / chan.effectData->numMoveSteps);
+ break;
}
quat.transform(chan.position);
diff --git a/engines/nancy/state/scene.cpp b/engines/nancy/state/scene.cpp
index dc399037586..85a7ba88220 100644
--- a/engines/nancy/state/scene.cpp
+++ b/engines/nancy/state/scene.cpp
@@ -132,7 +132,7 @@ Scene::Scene() :
_isRunningAd(false),
_hotspotDebug(50) {}
-Scene::~Scene() {
+Scene::~Scene() {
delete _helpButton;
delete _menuButton;
delete _viewportOrnaments;
@@ -336,7 +336,7 @@ void Scene::removeItemFromInventory(uint16 id, bool pickUp) {
}
}
-void Scene::setHeldItem(int16 id) {
+void Scene::setHeldItem(int16 id) {
_flags.heldItem = id; g_nancy->_cursorManager->setCursorItemID(id);
}
diff --git a/engines/nancy/ui/scrollbar.cpp b/engines/nancy/ui/scrollbar.cpp
index 54c7d6b22a3..3b28febebcb 100644
--- a/engines/nancy/ui/scrollbar.cpp
+++ b/engines/nancy/ui/scrollbar.cpp
@@ -30,7 +30,7 @@ namespace Nancy {
namespace UI {
Scrollbar::Scrollbar(uint16 zOrder, const Common::Rect &srcBounds, const Common::Point &topPosition, uint16 scrollDistance, bool isVertical) :
- Scrollbar(zOrder, srcBounds, g_nancy->_graphicsManager->_object0, topPosition, scrollDistance, isVertical) {}
+ Scrollbar(zOrder, srcBounds, g_nancy->_graphicsManager->_object0, topPosition, scrollDistance, isVertical) {}
Scrollbar::Scrollbar(uint16 zOrder, const Common::Rect &srcBounds, Graphics::ManagedSurface &srcSurf, const Common::Point &topPosition, uint16 scrollDistance, bool isVertical) :
RenderObject(zOrder),
@@ -112,7 +112,7 @@ void Scrollbar::handleInput(NancyInput &input) {
}
void Scrollbar::setPosition(float pos) {
- _currentPosition = pos;
+ _currentPosition = pos;
if (_isVertical) {
moveTo(Common::Point(_screenPosition.left, _startPosition.y + (_maxDist * pos)));
} else {
diff --git a/engines/nancy/ui/scrollbar.h b/engines/nancy/ui/scrollbar.h
index b85f6938aac..07a0ee72760 100644
--- a/engines/nancy/ui/scrollbar.h
+++ b/engines/nancy/ui/scrollbar.h
@@ -43,7 +43,7 @@ public:
void resetPosition();
float getPos() const { return _currentPosition; }
- void setPosition(float pos);
+ void setPosition(float pos);
void calculatePosition();
Common::Point _startPosition;
diff --git a/engines/nancy/video.cpp b/engines/nancy/video.cpp
index 209944e8be5..6f55f7706f2 100644
--- a/engines/nancy/video.cpp
+++ b/engines/nancy/video.cpp
@@ -272,7 +272,7 @@ bool AVFDecoder::AVFVideoTrack::decode(byte *outBuf, uint32 frameSize, Common::R
return true;
}
-const Graphics::Surface *AVFDecoder::AVFVideoTrack::decodeFrame(uint frameNr) {
+const Graphics::Surface *AVFDecoder::AVFVideoTrack::decodeFrame(uint frameNr) {
if (frameNr < _frameCache.size() && _frameCache[frameNr].getPixels()) {
// Frame is cached, return a pointer to it
return &_frameCache[frameNr];
Commit: caf29003bd2612d1b5569e60e55255c15297b32a
https://github.com/scummvm/scummvm/commit/caf29003bd2612d1b5569e60e55255c15297b32a
Author: Kaloyan Chehlarski (strahy at outlook.com)
Date: 2023-12-28T23:58:17+02:00
Commit Message:
NANCY: Retain AssemblyPuzzle solve state
Added a PuzzleData struct for AssemblyPuzzle, which ensures
that loading the puzzle again after it's solved will show the
assembled state, instead of restarting the puzzle.
Changed paths:
engines/nancy/action/puzzle/assemblypuzzle.cpp
engines/nancy/action/puzzle/assemblypuzzle.h
engines/nancy/puzzledata.cpp
engines/nancy/puzzledata.h
diff --git a/engines/nancy/action/puzzle/assemblypuzzle.cpp b/engines/nancy/action/puzzle/assemblypuzzle.cpp
index 94ed2b009ec..5ead404fb33 100644
--- a/engines/nancy/action/puzzle/assemblypuzzle.cpp
+++ b/engines/nancy/action/puzzle/assemblypuzzle.cpp
@@ -39,13 +39,16 @@ void AssemblyPuzzle::init() {
for (uint i = 0; i < _pieces.size(); ++i) {
Piece &piece = _pieces[i];
- piece.curRotation = 0;
+ piece.curRotation = piece.placed ? piece.correctRotation : 0;
piece._drawSurface.create(_image, piece.srcRects[piece.curRotation]);
piece.setVisible(true);
piece.setTransparent(true);
- piece.moveTo(piece.placed ? piece.destRects[0] : piece.startRect);
+ piece.moveTo(piece.placed ? piece.destRects[piece.curRotation] : piece.startRect);
piece.setZ(_z + i + _pieces.size());
}
+
+ rotateBase(true);
+ rotateBase(false);
}
void AssemblyPuzzle::registerGraphics() {
@@ -55,6 +58,9 @@ void AssemblyPuzzle::registerGraphics() {
}
void AssemblyPuzzle::readData(Common::SeekableReadStream &stream) {
+ _puzzleState = (AssemblyPuzzleData *)NancySceneState.getPuzzleData(AssemblyPuzzleData::getTag());
+ assert(_puzzleState);
+
readFilename(stream, _imageName);
uint16 numPieces = stream.readUint16LE();
@@ -74,6 +80,10 @@ void AssemblyPuzzle::readData(Common::SeekableReadStream &stream) {
piece.correctRotation = stream.readUint16LE();
piece.layer = stream.readUint16LE();
piece.placed = stream.readUint16LE();
+
+ if (_puzzleState->solvedPuzzle) {
+ piece.placed = true;
+ }
}
stream.skip((12 - numPieces) * 150);
@@ -137,6 +147,7 @@ void AssemblyPuzzle::execute() {
}
if (_completed) {
+ _puzzleState->solvedPuzzle = true;
NancySceneState.changeScene(_solveScene._sceneChange);
} else {
_exitScene.execute();
diff --git a/engines/nancy/action/puzzle/assemblypuzzle.h b/engines/nancy/action/puzzle/assemblypuzzle.h
index 90d27639f78..162e47fb7f0 100644
--- a/engines/nancy/action/puzzle/assemblypuzzle.h
+++ b/engines/nancy/action/puzzle/assemblypuzzle.h
@@ -26,6 +26,9 @@
#include "engines/nancy/misc/mousefollow.h"
namespace Nancy {
+
+class AssemblyPuzzleData;
+
namespace Action {
// Minigame where the player is provided with the broken pieces of something
@@ -91,6 +94,8 @@ protected:
int _curRotation = 0;
uint _layersAssembled = 0;
bool _completed = false;
+
+ AssemblyPuzzleData *_puzzleState = nullptr;
};
} // End of namespace Action
diff --git a/engines/nancy/puzzledata.cpp b/engines/nancy/puzzledata.cpp
index 54549363457..4cdfb6f8072 100644
--- a/engines/nancy/puzzledata.cpp
+++ b/engines/nancy/puzzledata.cpp
@@ -106,6 +106,14 @@ void SoundEqualizerPuzzleData::synchronize(Common::Serializer &ser) {
ser.syncArray(sliderValues.data(), 6, Common::Serializer::Byte);
}
+SimplePuzzleData::SimplePuzzleData() {
+ solvedPuzzle = false;
+}
+
+void SimplePuzzleData::synchronize(Common::Serializer &ser) {
+ ser.syncAsByte(solvedPuzzle);
+}
+
void JournalData::synchronize(Common::Serializer &ser) {
uint16 numEntries = journalEntries.size();
ser.syncAsUint16LE(numEntries);
@@ -166,6 +174,8 @@ PuzzleData *makePuzzleData(const uint32 tag) {
return new RiddlePuzzleData();
case SoundEqualizerPuzzleData::getTag():
return new SoundEqualizerPuzzleData();
+ case AssemblyPuzzleData::getTag():
+ return new AssemblyPuzzleData();
case JournalData::getTag():
return new JournalData();
case TableData::getTag():
diff --git a/engines/nancy/puzzledata.h b/engines/nancy/puzzledata.h
index 95a89ee7230..6f28e995363 100644
--- a/engines/nancy/puzzledata.h
+++ b/engines/nancy/puzzledata.h
@@ -93,6 +93,20 @@ struct SoundEqualizerPuzzleData : public PuzzleData {
Common::Array<byte> sliderValues;
};
+// Contains a single bool indicating whether the puzzle was solved
+struct SimplePuzzleData : public PuzzleData {
+ SimplePuzzleData();
+ virtual ~SimplePuzzleData() {}
+
+ virtual void synchronize(Common::Serializer &ser);
+
+ bool solvedPuzzle;
+};
+
+struct AssemblyPuzzleData : public SimplePuzzleData {
+ static constexpr uint32 getTag() { return MKTAG('A', 'S', 'M', 'B'); }
+};
+
struct JournalData : public PuzzleData {
JournalData() {}
virtual ~JournalData() {}
Commit: 71558e8503483874833e1c61c73d7d289da017f5
https://github.com/scummvm/scummvm/commit/71558e8503483874833e1c61c73d7d289da017f5
Author: Kaloyan Chehlarski (strahy at outlook.com)
Date: 2023-12-28T23:58:17+02:00
Commit Message:
NANCY: Fix nancy1 telephone hints
A fix for some broken nancy3 phone calls resulted in
the nancy1 hint system not working. This commit makes
sure the fix only applies to later games, which do not use
the HintSystem action record.
Changed paths:
engines/nancy/action/puzzle/telephone.cpp
diff --git a/engines/nancy/action/puzzle/telephone.cpp b/engines/nancy/action/puzzle/telephone.cpp
index 30526200063..184ffb56aab 100644
--- a/engines/nancy/action/puzzle/telephone.cpp
+++ b/engines/nancy/action/puzzle/telephone.cpp
@@ -241,8 +241,10 @@ void Telephone::execute() {
break;
case kCall: {
PhoneCall &call = _calls[_selected];
- if (call.sceneChange._sceneChange.sceneID == kNoScene) {
- // Make sure we don't get stuck here. Happens in nancy3 when calling George's number
+
+ // Make sure we don't get stuck here. Happens in nancy3 when calling George's number
+ // Check ignored in nancy1 since the HintSystem AR is in the same scene as the Telephone
+ if (call.sceneChange._sceneChange.sceneID == kNoScene && g_nancy->getGameType() != kGameTypeNancy1) {
call.sceneChange._sceneChange = NancySceneState.getSceneInfo();
}
More information about the Scummvm-git-logs
mailing list