[Scummvm-git-logs] scummvm master -> 96edfdb95e6ed73f040199349d8d63c026b4c6d9

sev- sev at scummvm.org
Mon Aug 29 10:12:02 CEST 2016


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:
96edfdb95e DIRECTOR: Started code on enlisting all movie files


Commit: 96edfdb95e6ed73f040199349d8d63c026b4c6d9
    https://github.com/scummvm/scummvm/commit/96edfdb95e6ed73f040199349d8d63c026b4c6d9
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2016-08-29T09:15:41+02:00

Commit Message:
DIRECTOR: Started code on enlisting all movie files

Changed paths:
    engines/director/director.cpp
    engines/director/director.h



diff --git a/engines/director/director.cpp b/engines/director/director.cpp
index cf66c85..7ce85c5 100644
--- a/engines/director/director.cpp
+++ b/engines/director/director.cpp
@@ -90,9 +90,6 @@ DirectorEngine::~DirectorEngine() {
 Common::Error DirectorEngine::run() {
 	debug("Starting v%d Director game", getVersion());
 
-	//FIXME
-	_sharedMMM = "SHARDCST.MMM";
-
 	_currentPalette = nullptr;
 
 	_macBinary = nullptr;
@@ -116,6 +113,8 @@ Common::Error DirectorEngine::run() {
 	//_mainArchive = new RIFFArchive();
 	//_mainArchive->openFile("bookshelf_example.mmm");
 
+	loadMMMNames(ConfMan.get("path"));
+
 	if (getPlatform() == Common::kPlatformWindows)
 		loadEXE();
 	else
@@ -133,6 +132,13 @@ Common::Error DirectorEngine::run() {
 Common::HashMap<Common::String, Score *> DirectorEngine::loadMMMNames(Common::String folder) {
 	Common::FSNode directory(folder);
 	Common::FSList movies;
+	const char *sharedMMMname;
+
+	if (getPlatform() == Common::kPlatformWindows)
+		sharedMMMname = "SHARDCST.MMM";
+	else
+		sharedMMMname = "Shared Cast*";
+
 
 	Common::HashMap<Common::String, Score *> nameMap;
 	if (!directory.getChildren(movies, Common::FSNode::kListFilesOnly))
@@ -140,12 +146,19 @@ Common::HashMap<Common::String, Score *> DirectorEngine::loadMMMNames(Common::St
 
 	if (!movies.empty()) {
 		for (Common::FSList::const_iterator i = movies.begin(); i != movies.end(); ++i) {
-			if (i->getName() == _sharedMMM) {
+			if (Common::matchString(i->getName().c_str(), sharedMMMname, true)) {
 				loadSharedCastsFrom(i->getPath());
 				continue;
 			}
 
-			RIFFArchive *arc = new RIFFArchive();
+			Archive *arc;
+
+			if (getVersion() < 4) {
+				arc = new RIFFArchive();
+			} else {
+				arc = new RIFXArchive();
+			}
+
 			arc->openFile(i->getPath());
 			Score *sc = new Score(this);
 			nameMap[sc->getMacName()] = sc;
diff --git a/engines/director/director.h b/engines/director/director.h
index 97f8a70..e0d5d82 100644
--- a/engines/director/director.h
+++ b/engines/director/director.h
@@ -108,7 +108,6 @@ private:
 
 	Common::String readPascalString(Common::SeekableReadStream &stream);
 
-	Common::String _sharedMMM;
 	Common::HashMap<int, Cast *> *_sharedCasts;
 	Common::HashMap<int, Common::SeekableSubReadStreamEndian *> *_sharedDIB;
 	Common::HashMap<int, Common::SeekableSubReadStreamEndian *> *_sharedSTXT;





More information about the Scummvm-git-logs mailing list