[Scummvm-git-logs] scummvm master -> 4cae7953c2076831173a63bef70ace4e73451d3b
sev-
noreply at scummvm.org
Sun Jul 23 12:07:26 UTC 2023
This automated email contains information about 7 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
8a55400789 DIRECTOR: Inject empty score if VWSC block is missing
ea3d883f51 DIRECTOR: Fix off-by-one error in Movie::processEvent
2394440978 DIRECTOR: XOBJ: Add the first non-standard extension to FileIO
79568ed026 DIRECTOR: Fix debug output of text cast members
621c80355a DIRECTOR: XOBJ: Fix ManiacBg
ffa80f5aaf VIDEO: Add alias support to QuickTime parser
4cae7953c2 DIRECTOR: Add support for fetching alias path from MooV chunks
Commit: 8a554007898d7808a536a2a87907b5770caf4497
https://github.com/scummvm/scummvm/commit/8a554007898d7808a536a2a87907b5770caf4497
Author: Scott Percival (code at moral.net.au)
Date: 2023-07-23T14:07:20+02:00
Commit Message:
DIRECTOR: Inject empty score if VWSC block is missing
Games can load movies without a score; e.g. with a MovieScript
which performs a check then bounces to a different movie.
In these cases, we can reuse the frame loader code and inject
a Score with one empty frame.
Fixes the EXE movie in Maniac Sports.
Changed paths:
A engines/director/blank-score.h
engines/director/movie.cpp
engines/director/score.cpp
diff --git a/engines/director/blank-score.h b/engines/director/blank-score.h
new file mode 100644
index 00000000000..2c115bdf999
--- /dev/null
+++ b/engines/director/blank-score.h
@@ -0,0 +1,35 @@
+/* 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/>.
+ *
+ */
+
+static byte kBlankScoreD2[] = {
+ 0x00, 0x00, 0x00, 0x06, // _framesStreamSize
+ 0x00, 0x02 // frame with empty channel information
+};
+
+static byte kBlankScoreD4[] = {
+ 0x00, 0x00, 0x00, 0x12, // _framesStreamSize
+ 0x00, 0x00, 0x00, 0x10, // frame1Offset
+ 0x00, 0x00, 0x00, 0x01, // numOfFrames
+ 0x00, 0x07, // _framesVersion
+ 0x00, 0x00, // _numChannels
+ 0x00, 0x00, // skipped
+ 0x00, 0x02 // frame with empty channel information
+};
diff --git a/engines/director/movie.cpp b/engines/director/movie.cpp
index 378c386cb74..31afdc751f4 100644
--- a/engines/director/movie.cpp
+++ b/engines/director/movie.cpp
@@ -20,6 +20,7 @@
*/
#include "common/config-manager.h"
+#include "common/memstream.h"
#include "common/substream.h"
#include "director/types.h"
@@ -39,6 +40,8 @@
namespace Director {
+#include "director/blank-score.h"
+
Movie::Movie(Window *window) {
_window = window;
_vm = _window->getVM();
@@ -236,8 +239,14 @@ bool Movie::loadArchive() {
// Score
if (!(r = _movieArchive->getMovieResourceIfPresent(MKTAG('V', 'W', 'S', 'C')))) {
- warning("Movie::loadArchive(): Wrong movie format. VWSC resource missing");
- return false;
+ warning("Movie::loadArchive(): No VWSC resource, injecting a blank score with 1 frame");
+ if (_version < kFileVer400) {
+ r = new Common::MemoryReadStreamEndian(kBlankScoreD2, sizeof(kBlankScoreD2), true);
+ } else if (_version < kFileVer600) {
+ r = new Common::MemoryReadStreamEndian(kBlankScoreD4, sizeof(kBlankScoreD4), true);
+ } else {
+ error("Movie::loadArchive(): score format not yet supported for version %d", _version);
+ }
}
_score->loadFrames(*r, _version);
diff --git a/engines/director/score.cpp b/engines/director/score.cpp
index 0312a53b461..23f73cc59ea 100644
--- a/engines/director/score.cpp
+++ b/engines/director/score.cpp
@@ -1390,9 +1390,11 @@ void Score::loadFrames(Common::SeekableReadStreamEndian &stream, uint16 version)
_framesStream->readUint16(); // Skip
}
- warning("STUB: Score::loadFrames(): frame1Offset: %x, version: %x, spriteRecordSize: %x, numChannels: %x, numChannelsDisplayed: %x",
+ warning("STUB: Score::loadFrames(): frame1Offset: 0x%x, version: %d, spriteRecordSize: 0x%x, numChannels: %d, numChannelsDisplayed: %d",
frame1Offset, _framesVersion, spriteRecordSize, _numChannels, _numChannelsDisplayed);
// Unknown, some bytes - constant (refer to contuinity).
+ } else {
+ error("STUB: Score::loadFrames(): score not yet supported for version %d", version);
}
// partically by channels, hence we keep it and read the score from left to right
@@ -1503,7 +1505,7 @@ bool Score::readOneFrame() {
debugC(3, kDebugLoading, "++++++++++ score load frame %d (frameSize %d) saveOffset", _curFrameNumber, frameSize);
if (debugChannelSet(8, kDebugLoading)) {
- _framesStream->hexdump(frameSize);
+ _framesStream->hexdump(MAX(0, frameSize - 2));
}
if (frameSize > 0) {
frameSize -= 2;
Commit: ea3d883f51fed1db0ecd83f7c5beba0586ce9403
https://github.com/scummvm/scummvm/commit/ea3d883f51fed1db0ecd83f7c5beba0586ce9403
Author: Scott Percival (code at moral.net.au)
Date: 2023-07-23T14:07:20+02:00
Commit Message:
DIRECTOR: Fix off-by-one error in Movie::processEvent
Changed paths:
engines/director/events.cpp
diff --git a/engines/director/events.cpp b/engines/director/events.cpp
index 3b4d5df48a1..ba9c7e0b0c8 100644
--- a/engines/director/events.cpp
+++ b/engines/director/events.cpp
@@ -113,8 +113,8 @@ bool Window::processEvent(Common::Event &event) {
bool Movie::processEvent(Common::Event &event) {
Score *sc = getScore();
- if (sc->getCurrentFrameNum() >= sc->getFramesNum()) {
- warning("processEvents: request to access frame %d of %d", sc->getCurrentFrameNum(), sc->getFramesNum() - 1);
+ if (sc->getCurrentFrameNum() > sc->getFramesNum()) {
+ warning("processEvents: request to access frame %d of %d", sc->getCurrentFrameNum(), sc->getFramesNum());
return false;
}
uint16 spriteId = 0;
Commit: 23944409782eafd83797f9a57bc8a9af039f1401
https://github.com/scummvm/scummvm/commit/23944409782eafd83797f9a57bc8a9af039f1401
Author: Scott Percival (code at moral.net.au)
Date: 2023-07-23T14:07:20+02:00
Commit Message:
DIRECTOR: XOBJ: Add the first non-standard extension to FileIO
Macromedia provided the full source code of FileIO as an example for
XLib developers, so it stands to reason that people would make their
own build with extra functions.
Fixes the initial movie switch in Maniac Sports.
Changed paths:
engines/director/lingo/xlibs/fileio.cpp
engines/director/lingo/xlibs/fileio.h
diff --git a/engines/director/lingo/xlibs/fileio.cpp b/engines/director/lingo/xlibs/fileio.cpp
index 82ed013bed2..bb85b431a77 100644
--- a/engines/director/lingo/xlibs/fileio.cpp
+++ b/engines/director/lingo/xlibs/fileio.cpp
@@ -126,6 +126,12 @@ static MethodProto xlibMethods[] = {
{ "status", FileIO::m_status, 0, 0, 200 }, // D2
{ "writeChar", FileIO::m_writeChar, 1, 1, 200 }, // D2
{ "writeString", FileIO::m_writeString, 1, 1, 200 }, // D2
+
+ // Non-standard extensions
+ // - Used by Maniac Sports
+ // II +mSetOverrideDrive, driveLetter --Set override drive letter ('A' - 'Z') to use when loading linked castmembers. Use 0x00 to clear override.
+ { "setOverrideDrive", FileIO::m_setOverrideDrive, 1, 1, 300 }, // D3
+
{ nullptr, nullptr, 0, 0, 0 }
};
@@ -526,4 +532,7 @@ void FileIO::m_delete(int nargs) {
}
}
+// Non-standard extensions
+XOBJSTUBNR(FileIO::m_setOverrideDrive)
+
} // End of namespace Director
diff --git a/engines/director/lingo/xlibs/fileio.h b/engines/director/lingo/xlibs/fileio.h
index e0a19ba62e4..90cdb668b27 100644
--- a/engines/director/lingo/xlibs/fileio.h
+++ b/engines/director/lingo/xlibs/fileio.h
@@ -95,6 +95,8 @@ namespace FileIO {
void m_writeChar(int nargs);
void m_writeString(int nards);
+ void m_setOverrideDrive(int nargs);
+
} // End of namespace FileIO
} // End of namespace Director
Commit: 79568ed02615ac1ffafc61828fe6daddecb94ea7
https://github.com/scummvm/scummvm/commit/79568ed02615ac1ffafc61828fe6daddecb94ea7
Author: Scott Percival (code at moral.net.au)
Date: 2023-07-23T14:07:20+02:00
Commit Message:
DIRECTOR: Fix debug output of text cast members
Changed paths:
engines/director/castmember/text.cpp
engines/director/lingo/lingo.cpp
diff --git a/engines/director/castmember/text.cpp b/engines/director/castmember/text.cpp
index e9709c46908..94e88087f62 100644
--- a/engines/director/castmember/text.cpp
+++ b/engines/director/castmember/text.cpp
@@ -365,7 +365,7 @@ Common::String TextCastMember::formatInfo() {
_boundingRect.width(), _boundingRect.height(),
_boundingRect.left, _boundingRect.top,
getForeColor(), getBackColor(),
- _editable, format.c_str()
+ _editable, formatStringForDump(format).c_str()
);
}
diff --git a/engines/director/lingo/lingo.cpp b/engines/director/lingo/lingo.cpp
index 3c4b1a474bf..5724fd53228 100644
--- a/engines/director/lingo/lingo.cpp
+++ b/engines/director/lingo/lingo.cpp
@@ -344,7 +344,7 @@ Symbol Lingo::getHandler(const Common::String &name) {
void LingoArchive::addCode(const Common::U32String &code, ScriptType type, uint16 id, const char *scriptName, uint32 preprocFlags) {
debugC(1, kDebugCompile, "Add code for type %s(%d) with id %d in '%s%s'\n"
- "***********\n%s\n\n***********", scriptType2str(type), type, id, utf8ToPrintable(g_director->getCurrentPath()).c_str(), utf8ToPrintable(cast->getMacName()).c_str(), code.encode().c_str());
+ "***********\n%s\n\n***********", scriptType2str(type), type, id, utf8ToPrintable(g_director->getCurrentPath()).c_str(), utf8ToPrintable(cast->getMacName()).c_str(), formatStringForDump(code.encode()).c_str());
if (getScriptContext(type, id)) {
// Replace the pre-existing context but warn about it.
Commit: 621c80355a202918a97f30658597450d8bc0647c
https://github.com/scummvm/scummvm/commit/621c80355a202918a97f30658597450d8bc0647c
Author: Scott Percival (code at moral.net.au)
Date: 2023-07-23T14:07:20+02:00
Commit Message:
DIRECTOR: XOBJ: Fix ManiacBg
Game expects the XLib name to be "foremost", and for calls to isForeMost
to update the screen mid-script.
Fixes most video playback in Maniac Sports.
Changed paths:
engines/director/lingo/xlibs/maniacbg.cpp
diff --git a/engines/director/lingo/xlibs/maniacbg.cpp b/engines/director/lingo/xlibs/maniacbg.cpp
index 57f9d614db9..dc4ee34ef89 100644
--- a/engines/director/lingo/xlibs/maniacbg.cpp
+++ b/engines/director/lingo/xlibs/maniacbg.cpp
@@ -23,6 +23,7 @@
#include "director/director.h"
#include "director/lingo/lingo.h"
+#include "director/lingo/lingo-builtins.h"
#include "director/lingo/lingo-object.h"
#include "director/lingo/lingo-utils.h"
#include "director/lingo/xlibs/maniacbg.h"
@@ -44,7 +45,7 @@ I mIsForeMost --Is this Application foremost. 1=Yes, 0=No.
namespace Director {
-const char *ManiacBgXObj::xlibName = "maniacbg";
+const char *ManiacBgXObj::xlibName = "foremost";
const char *ManiacBgXObj::fileNames[] = {
"maniacbg",
nullptr
@@ -89,6 +90,12 @@ void ManiacBgXObj::m_new(int nargs) {
}
XOBJSTUBNR(ManiacBgXObj::m_dispose)
-XOBJSTUB(ManiacBgXObj::m_isForeMost, 1)
+
+void ManiacBgXObj::m_isForeMost(int nargs) {
+ // process events
+ LB::b_updateStage(0);
+ g_lingo->push(Datum(1));
+ return;
+}
}
Commit: ffa80f5aafa02c00c306a16679392cb65ed49685
https://github.com/scummvm/scummvm/commit/ffa80f5aafa02c00c306a16679392cb65ed49685
Author: Scott Percival (code at moral.net.au)
Date: 2023-07-23T14:07:20+02:00
Commit Message:
VIDEO: Add alias support to QuickTime parser
Changed paths:
common/formats/quicktime.cpp
common/formats/quicktime.h
video/qt_decoder.cpp
video/qt_decoder.h
diff --git a/common/formats/quicktime.cpp b/common/formats/quicktime.cpp
index 7b03529917c..75d73648543 100644
--- a/common/formats/quicktime.cpp
+++ b/common/formats/quicktime.cpp
@@ -140,7 +140,7 @@ void QuickTimeParser::init() {
void QuickTimeParser::initParseTable() {
static const ParseTable p[] = {
{ &QuickTimeParser::readDefault, MKTAG('d', 'i', 'n', 'f') },
- { &QuickTimeParser::readLeaf, MKTAG('d', 'r', 'e', 'f') },
+ { &QuickTimeParser::readDREF, MKTAG('d', 'r', 'e', 'f') },
{ &QuickTimeParser::readDefault, MKTAG('e', 'd', 't', 's') },
{ &QuickTimeParser::readELST, MKTAG('e', 'l', 's', 't') },
{ &QuickTimeParser::readHDLR, MKTAG('h', 'd', 'l', 'r') },
@@ -797,6 +797,77 @@ int QuickTimeParser::readSMI(Atom atom) {
return 0;
}
+int QuickTimeParser::readDREF(Atom atom) {
+ if (atom.size > 1) {
+ Track *track = _tracks.back();
+
+ _fd->hexdump(atom.size);
+ uint32 endPos = _fd->pos() + atom.size;
+ _fd->readUint32BE(); // version + flags
+ uint32 entries = _fd->readUint32BE();
+ for (uint32 i = 0; i < entries && _fd->pos() < endPos; i++) {
+ uint32 size = _fd->readUint32BE();
+ uint32 next = _fd->pos() + size - 4;
+ if (next > endPos) {
+ warning("DREF chunk overflows atom bounds");
+ return 1;
+ }
+ uint32 type = _fd->readUint32BE();
+ _fd->readUint32BE(); // version + flags
+ if (type == MKTAG('a', 'l', 'i', 's')) {
+ if (size < 150) {
+ _fd->seek(next, SEEK_SET);
+ continue;
+ }
+
+ // Macintosh alias record
+ _fd->seek(10, SEEK_CUR);
+
+ uint8 volumeSize = MIN((uint8)27, _fd->readByte());
+ track->volume = _fd->readString('\0', volumeSize);
+ _fd->seek(27 - volumeSize, SEEK_CUR);
+ _fd->seek(12, SEEK_CUR);
+
+ uint8 filenameSize = MIN((uint8)63, _fd->readByte());
+ track->filename = _fd->readString('\0', filenameSize);
+ _fd->seek(63 - filenameSize, SEEK_CUR);
+ _fd->seek(16, SEEK_CUR);
+ debug(5, "volume: %s, filename: %s", track->volume.c_str(), track->filename.c_str());
+
+ track->nlvlFrom = _fd->readSint16BE();
+ track->nlvlTo = _fd->readSint16BE();
+ _fd->seek(16, SEEK_CUR);
+ debug(5, "nlvlFrom: %d, nlvlTo: %d", track->nlvlFrom, track->nlvlTo);
+
+ for (int16 subType = 0; subType != -1 && _fd->pos() < endPos;) {
+ subType = _fd->readSint16BE();
+ uint16 subTypeSize = _fd->readUint16BE();
+ subTypeSize += subTypeSize & 1 ? 1 : 0;
+ if (subType == 2) { // Absolute path
+ track->path = _fd->readString('\0', subTypeSize);
+ if (track->path.substr(0, volumeSize) == track->volume) {
+ track->path = track->path.substr(volumeSize);
+ }
+ debug(5, "path: %s", track->path.c_str());
+ } else if (subType == 0) {
+ track->directory = _fd->readString('\0', subTypeSize);
+ debug(5, "directory: %s", track->directory.c_str());
+ } else {
+ _fd->seek(subTypeSize, SEEK_CUR);
+ }
+ }
+ } else {
+ warning("Unknown DREF type %s", tag2str(type));
+ _fd->seek(next, SEEK_SET);
+ }
+ }
+
+ _fd->seek(endPos, SEEK_SET);
+ }
+
+ return 0;
+}
+
void QuickTimeParser::close() {
for (uint32 i = 0; i < _tracks.size(); i++)
delete _tracks[i];
@@ -867,6 +938,8 @@ QuickTimeParser::Track::Track() {
frameCount = 0;
duration = 0;
mediaDuration = 0;
+ nlvlFrom = -1;
+ nlvlTo = -1;
}
QuickTimeParser::Track::~Track() {
diff --git a/common/formats/quicktime.h b/common/formats/quicktime.h
index d16a75b18fb..b80df22dbbe 100644
--- a/common/formats/quicktime.h
+++ b/common/formats/quicktime.h
@@ -174,6 +174,13 @@ protected:
uint32 mediaDuration; // media time
Rational scaleFactorX;
Rational scaleFactorY;
+
+ Common::String volume;
+ Common::String filename;
+ Common::String path;
+ Common::String directory;
+ int16 nlvlFrom;
+ int16 nlvlTo;
};
virtual SampleDesc *readSampleDesc(Track *track, uint32 format, uint32 descSize) = 0;
@@ -208,6 +215,7 @@ private:
int readDefault(Atom atom);
int readLeaf(Atom atom);
+ int readDREF(Atom atom);
int readELST(Atom atom);
int readHDLR(Atom atom);
int readMDHD(Atom atom);
diff --git a/video/qt_decoder.cpp b/video/qt_decoder.cpp
index 555f3d3a3a3..a0a28a72171 100644
--- a/video/qt_decoder.cpp
+++ b/video/qt_decoder.cpp
@@ -512,7 +512,7 @@ const Graphics::Surface *QuickTimeDecoder::VideoTrackHandler::decodeNextFrame()
}
enterNewEditListEntry(false);
-
+
if (isEmptyEdit()) {
return 0;
}
@@ -587,6 +587,15 @@ const Graphics::Surface *QuickTimeDecoder::VideoTrackHandler::decodeNextFrame()
return frame;
}
+Common::String QuickTimeDecoder::getAliasPath() {
+ const Common::Array<Common::QuickTimeParser::Track *> &tracks = Common::QuickTimeParser::_tracks;
+ for (uint32 i = 0; i < tracks.size(); i++) {
+ if (!tracks[i]->path.empty())
+ return tracks[i]->path;
+ }
+ return Common::String();
+}
+
Audio::Timestamp QuickTimeDecoder::VideoTrackHandler::getFrameTime(uint frame) const {
// TODO: This probably doesn't work right with edit lists
int cumulativeDuration = 0;
diff --git a/video/qt_decoder.h b/video/qt_decoder.h
index 4be74038fbc..adc106303da 100644
--- a/video/qt_decoder.h
+++ b/video/qt_decoder.h
@@ -71,6 +71,7 @@ public:
Audio::Timestamp getDuration() const { return Audio::Timestamp(0, _duration, _timeScale); }
void enableEditListBoundsCheckQuirk(bool enable) { _enableEditListBoundsCheckQuirk = enable; }
+ Common::String getAliasPath();
protected:
Common::QuickTimeParser::SampleDesc *readSampleDesc(Common::QuickTimeParser::Track *track, uint32 format, uint32 descSize);
Commit: 4cae7953c2076831173a63bef70ace4e73451d3b
https://github.com/scummvm/scummvm/commit/4cae7953c2076831173a63bef70ace4e73451d3b
Author: Scott Percival (code at moral.net.au)
Date: 2023-07-23T14:07:20+02:00
Commit Message:
DIRECTOR: Add support for fetching alias path from MooV chunks
Fixes most of the videos in Wallobee Jack.
Changed paths:
engines/director/cast.cpp
diff --git a/engines/director/cast.cpp b/engines/director/cast.cpp
index 9dbb0c956b1..ec3fb9adfff 100644
--- a/engines/director/cast.cpp
+++ b/engines/director/cast.cpp
@@ -29,6 +29,8 @@
#include "graphics/macgui/macfontmanager.h"
#include "graphics/macgui/macwindowmanager.h"
+#include "video/qt_decoder.h"
+
#include "director/director.h"
#include "director/cast.h"
#include "director/movie.h"
@@ -657,7 +659,13 @@ Common::String Cast::getVideoPath(int castId) {
res = directory + g_director->_dirSeparator + filename;
} else {
- warning("STUB: Cast::getVideoPath(%d): unsupported non-zero MooV block", castId);
+ Video::QuickTimeDecoder qt;
+ qt.loadStream(videoData);
+ videoData = nullptr;
+ res = qt.getAliasPath();
+ if (res.empty()) {
+ warning("STUB: Cast::getVideoPath(%d): unsupported non-alias MooV block found", castId);
+ }
}
if (videoData)
delete videoData;
More information about the Scummvm-git-logs
mailing list