[Scummvm-git-logs] scummvm master -> 1d8f9b2e76d9fd3d3ba7dc347528a60ae013bff0
fracturehill
noreply at scummvm.org
Thu Aug 10 21:12:25 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:
45efd63044 NANCY: Upgrade scan_ar_type console command
d99b1b1a9d NANCY: Fix looping secondary movies
1d8f9b2e76 NANCY: Fix MSVC build errors
Commit: 45efd6304453d7c4e080fdac63138120c838d736
https://github.com/scummvm/scummvm/commit/45efd6304453d7c4e080fdac63138120c838d736
Author: Kaloyan Chehlarski (strahy at outlook.com)
Date: 2023-08-11T00:08:57+03:00
Commit Message:
NANCY: Upgrade scan_ar_type console command
The scan_ar_type command can now scan for specific bytes
inside an action record's raw data.
Changed paths:
engines/nancy/console.cpp
diff --git a/engines/nancy/console.cpp b/engines/nancy/console.cpp
index 9c2cfd094ff..58ed01fc5ae 100644
--- a/engines/nancy/console.cpp
+++ b/engines/nancy/console.cpp
@@ -557,16 +557,43 @@ bool NancyConsole::Cmd_listActionRecords(int argc, const char **argv) {
}
bool NancyConsole::Cmd_scanForActionRecordType(int argc, const char **argv) {
- if (argc < 2) {
+ if (argc < 2 || argc % 2) {
debugPrintf("Scans all IFFs for ActionRecords of the provided type\n");
- debugPrintf("Usage: %s <typeID> [cal]\n", argv[0]);
+ debugPrintf("Optionally also scans inside the AR's data for matching bytes\n");
+ debugPrintf("Warning: can be quite slow, especially on archived game versions\n");
+ debugPrintf("Usage: %s <typeID> {[byte offset] [byte value]}...\n", argv[0]);
return true;
}
- byte typeID = atoi(argv[1]);
+ Common::Array<uint64> vals;
+ vals.push_back(0x30);
+
+ uint64 insertVal = 0;
+
+ for (int i = 1; i < argc; ++i) {
+ Common::String s(argv[i]);
+ insertVal = s.asUint64();
+
+ if (insertVal != 0 || s.firstChar() == '0') {
+ if (i % 2) {
+ if (insertVal > 255) {
+ debugPrintf("Invalid input: %u is a byte, value cannot be over 255!\n", (uint32)insertVal);
+ return true;
+ }
+ vals.push_back(insertVal);
+ } else {
+ vals.push_back(insertVal + 0x32);
+ }
+
+ } else {
+ debugPrintf("Invalid input: %s\n", argv[i]);
+ return true;
+ }
+ }
Common::Array<Common::String> list;
- g_nancy->_resource->list((argc == 2 ? "ciftree" : argv[2]), list, ResourceManager::kResTypeScript);
+ // Action records only appear in the ciftree
+ g_nancy->_resource->list("ciftree", list, ResourceManager::kResTypeScript);
char descBuf[0x30];
@@ -587,13 +614,27 @@ bool NancyConsole::Cmd_scanForActionRecordType(int argc, const char **argv) {
uint num = 0;
Common::SeekableReadStream *chunk = nullptr;
while (chunk = iff.getChunkStream("ACT", num), chunk != nullptr) {
- chunk->seek(0x30);
- if (chunk->readByte() == typeID) {
+ bool isSatisfied = true;
+ for (uint i = 0; i < vals.size(); i += 2) {
+ if ((int64)vals[i] >= chunk->size()) {
+ isSatisfied = false;
+ break;
+ }
+
+ chunk->seek(vals[i]);
+ if (chunk->readByte() != vals[i + 1]) {
+ isSatisfied = false;
+ break;
+ }
+ }
+
+ if (isSatisfied) {
chunk->seek(0);
chunk->read(descBuf, 0x30);
descBuf[0x2F] = '\0';
debugPrintf("%s: ACT chunk %u, %s\n", cifName.c_str(), num, descBuf);
}
+
++num;
delete chunk;
}
Commit: d99b1b1a9df5413ea9a35be92f486f041963e4a2
https://github.com/scummvm/scummvm/commit/d99b1b1a9df5413ea9a35be92f486f041963e4a2
Author: Kaloyan Chehlarski (strahy at outlook.com)
Date: 2023-08-11T00:08:57+03:00
Commit Message:
NANCY: Fix looping secondary movies
Secondary movies with the kRepeating flag would not get
properly reset, causing them to stop at the last frame. This
commit fixes the issue, though looping still causes the last
frame to play for double the length it should.
Changed paths:
engines/nancy/action/secondarymovie.cpp
diff --git a/engines/nancy/action/secondarymovie.cpp b/engines/nancy/action/secondarymovie.cpp
index fb04acad777..934f09c0b0b 100644
--- a/engines/nancy/action/secondarymovie.cpp
+++ b/engines/nancy/action/secondarymovie.cpp
@@ -86,28 +86,26 @@ void PlaySecondaryMovie::readData(Common::SeekableReadStream &stream) {
}
void PlaySecondaryMovie::init() {
- if (_decoder.isVideoLoaded()) {
- _decoder.close();
- }
-
- if (!_decoder.loadFile(_videoName + ".avf")) {
- error("Couldn't load video file %s", _videoName.c_str());
- }
+ if (!_decoder.isVideoLoaded()) {
+ if (!_decoder.loadFile(_videoName + ".avf")) {
+ error("Couldn't load video file %s", _videoName.c_str());
+ }
- _drawSurface.create(_decoder.getWidth(), _decoder.getHeight(), g_nancy->_graphicsManager->getInputPixelFormat());
+ _drawSurface.create(_decoder.getWidth(), _decoder.getHeight(), g_nancy->_graphicsManager->getInputPixelFormat());
- if (_paletteName.size()) {
- GraphicsManager::loadSurfacePalette(_fullFrame, _paletteName);
- GraphicsManager::loadSurfacePalette(_drawSurface, _paletteName);
- }
+ if (_paletteName.size()) {
+ GraphicsManager::loadSurfacePalette(_fullFrame, _paletteName);
+ GraphicsManager::loadSurfacePalette(_drawSurface, _paletteName);
+ }
- if (g_nancy->getGameType() == kGameTypeVampire) {
- setTransparent(true);
- _fullFrame.setTransparentColor(_drawSurface.getTransparentColor());
+ if (g_nancy->getGameType() == kGameTypeVampire) {
+ setTransparent(true);
+ _fullFrame.setTransparentColor(_drawSurface.getTransparentColor());
- // TVD uses empty video files during the endgame ceremony
- // This makes sure the screen doesn't go black while the sound is playing
- _drawSurface.clear(_drawSurface.getTransparentColor());
+ // TVD uses empty video files during the endgame ceremony
+ // This makes sure the screen doesn't go black while the sound is playing
+ _drawSurface.clear(_drawSurface.getTransparentColor());
+ }
}
_screenPosition = _drawSurface.getBounds();
@@ -159,7 +157,7 @@ void PlaySecondaryMovie::updateGraphics() {
// Stop the video and block it from starting again, but also wait for
// sound to end before changing state
- _decoder.stop();
+ _decoder.pauseVideo(true);
_isFinished = true;
if (!g_nancy->_sound->isSoundPlaying(_sound)) {
@@ -225,6 +223,14 @@ void PlaySecondaryMovie::execute() {
}
finishExecution();
+
+ // Allow looping
+ if (!_isDone) {
+ _isFinished = false;
+ _decoder.seek(0);
+ _decoder.pauseVideo(false);
+ }
+
break;
}
}
Commit: 1d8f9b2e76d9fd3d3ba7dc347528a60ae013bff0
https://github.com/scummvm/scummvm/commit/1d8f9b2e76d9fd3d3ba7dc347528a60ae013bff0
Author: Kaloyan Chehlarski (strahy at outlook.com)
Date: 2023-08-11T00:08:57+03:00
Commit Message:
NANCY: Fix MSVC build errors
Fixed a couple of mixed-type comparisons which would
produce an error on an MSVC build.
Changed paths:
engines/nancy/action/conversation.cpp
engines/nancy/action/recordtypes.cpp
diff --git a/engines/nancy/action/conversation.cpp b/engines/nancy/action/conversation.cpp
index d22da4909eb..abfe88cfd19 100644
--- a/engines/nancy/action/conversation.cpp
+++ b/engines/nancy/action/conversation.cpp
@@ -314,8 +314,8 @@ void ConversationSound::addConditionalDialogue() {
break;
case (byte)StaticDataConditionType::kDifficulty :
- if ( (NancySceneState.getDifficulty() != cond.label && cond.flag == true) ||
- (NancySceneState.getDifficulty() == cond.label && cond.flag == false) ) {
+ if ( (NancySceneState.getDifficulty() != cond.label && cond.flag != 0) ||
+ (NancySceneState.getDifficulty() == cond.label && cond.flag == 0) ) {
isSatisfied = false;
}
@@ -371,8 +371,8 @@ void ConversationSound::addGoodbye() {
break;
case (byte)StaticDataConditionType::kDifficulty :
- if ( (NancySceneState.getDifficulty() != cond.label && cond.flag == true) ||
- (NancySceneState.getDifficulty() == cond.label && cond.flag == false) ) {
+ if ( (NancySceneState.getDifficulty() != cond.label && cond.flag != 0) ||
+ (NancySceneState.getDifficulty() == cond.label && cond.flag == 0) ) {
isSatisfied = false;
}
diff --git a/engines/nancy/action/recordtypes.cpp b/engines/nancy/action/recordtypes.cpp
index 23ae84a2a7e..f01f4ef3b4f 100644
--- a/engines/nancy/action/recordtypes.cpp
+++ b/engines/nancy/action/recordtypes.cpp
@@ -729,8 +729,8 @@ void HintSystem::selectHint() {
break;
case (byte)StaticDataConditionType::kDifficulty :
- if ( (NancySceneState.getDifficulty() != cond.label && cond.flag == true) ||
- (NancySceneState.getDifficulty() == cond.label && cond.flag == false) ) {
+ if ( (NancySceneState.getDifficulty() != cond.label && cond.flag != 0) ||
+ (NancySceneState.getDifficulty() == cond.label && cond.flag == 0) ) {
isSatisfied = false;
}
More information about the Scummvm-git-logs
mailing list