[Scummvm-git-logs] scummvm master -> 0d3267404945bfdb5f6cc78699f79422d9cff07e

ysj1173886760 42030331+ysj1173886760 at users.noreply.github.com
Fri Aug 6 13:35:38 UTC 2021


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
0d32674049 DIRECTOR: fix the implementation of loading startup scripts.


Commit: 0d3267404945bfdb5f6cc78699f79422d9cff07e
    https://github.com/scummvm/scummvm/commit/0d3267404945bfdb5f6cc78699f79422d9cff07e
Author: ysj1173886760 (1173886760 at qq.com)
Date: 2021-08-06T21:35:12+08:00

Commit Message:
DIRECTOR: fix the implementation of loading startup scripts.

Changed paths:
    engines/director/resource.cpp


diff --git a/engines/director/resource.cpp b/engines/director/resource.cpp
index b95f43053a..6c85870893 100644
--- a/engines/director/resource.cpp
+++ b/engines/director/resource.cpp
@@ -78,12 +78,19 @@ Common::Error Window::loadInitialMovie() {
 	// load startup movie
 	Common::String startupPath = g_director->getStartupPath();
 	if (!startupPath.empty()) {
-		Archive *arc = g_director->createArchive();
-		if (arc->openFile(startupPath)) {
-			_currentMovie->setArchive(arc);
-			_currentMovie->loadArchive();
+		Common::SeekableReadStream *const stream = SearchMan.createReadStreamForMember(startupPath);
+		if (stream) {
+			uint size = stream->size();
+			char *script = (char *)calloc(size + 1, 1);
+
+			stream->read(script, size);
+
+			LingoArchive *mainArchive = g_director->getCurrentMovie()->getMainLingoArch();
+			mainArchive->addCode(Common::U32String(script, Common::kMacRoman), kMovieScript, 65535);
+
+			free(script);
 		} else {
-			warning("Window::LoadInitialMovie: failed to load startup movie");
+			warning("Window::LoadInitialMovie: failed to load startup scripts");
 		}
 	}
 




More information about the Scummvm-git-logs mailing list