[Scummvm-git-logs] scummvm master -> c28438d2a976c8174244120c26893110dd02734e

elasota noreply at scummvm.org
Fri May 24 18:43:35 UTC 2024


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:
c28438d2a9 MTROPOLIS: Support setting runtime version to deal with 1.1.2+ Windows plug-ins


Commit: c28438d2a976c8174244120c26893110dd02734e
    https://github.com/scummvm/scummvm/commit/c28438d2a976c8174244120c26893110dd02734e
Author: elasota (1137273+elasota at users.noreply.github.com)
Date: 2024-05-24T14:41:44-04:00

Commit Message:
MTROPOLIS: Support setting runtime version to deal with 1.1.2+ Windows plug-ins

Changed paths:
    engines/mtropolis/boot.cpp
    engines/mtropolis/core.h
    engines/mtropolis/data.cpp
    engines/mtropolis/data.h
    engines/mtropolis/miniscript.cpp
    engines/mtropolis/runtime.cpp
    engines/mtropolis/runtime.h


diff --git a/engines/mtropolis/boot.cpp b/engines/mtropolis/boot.cpp
index cb75ccca672..c58cb756cb0 100644
--- a/engines/mtropolis/boot.cpp
+++ b/engines/mtropolis/boot.cpp
@@ -1090,6 +1090,18 @@ public:
 		kBitDepth32
 	};
 
+	enum RuntimeVersion {
+		kRuntimeVersionAuto,
+
+		kRuntimeVersion100,
+
+		kRuntimeVersion110,
+		kRuntimeVersion111,
+		kRuntimeVersion112,
+
+		kRuntimeVersion200,
+	};
+
 	explicit BootScriptContext(bool isMac);
 
 	void bootObsidianRetailMacEn();
@@ -1113,6 +1125,7 @@ public:
 
 	BitDepth getBitDepth() const;
 	BitDepth getEnhancedBitDepth() const;
+	RuntimeVersion getRuntimeVersion() const;
 	const Common::Point &getResolution() const;
 
 private:
@@ -1136,6 +1149,7 @@ private:
 	void setResolution(uint width, uint height);
 	void setBitDepth(BitDepth bitDepth);
 	void setEnhancedBitDepth(BitDepth bitDepth);
+	void setRuntimeVersion(RuntimeVersion version);
 
 	void executeFunction(const Common::String &functionName, const Common::Array<Common::String> &paramTokens);
 
@@ -1159,9 +1173,10 @@ private:
 	Common::Point _preferredResolution;
 	BitDepth _bitDepth;
 	BitDepth _enhancedBitDepth;
+	RuntimeVersion _runtimeVersion;
 };
 
-BootScriptContext::BootScriptContext(bool isMac) : _isMac(isMac), _preferredResolution(0, 0), _bitDepth(kBitDepthAuto), _enhancedBitDepth(kBitDepthAuto) {
+BootScriptContext::BootScriptContext(bool isMac) : _isMac(isMac), _preferredResolution(0, 0), _bitDepth(kBitDepthAuto), _enhancedBitDepth(kBitDepthAuto), _runtimeVersion(kRuntimeVersionAuto) {
 	_vfsLayout._pathSeparator = isMac ? ':' : '/';
 
 	VirtualFileSystemLayout::ArchiveJunction fsJunction;
@@ -1271,6 +1286,10 @@ void BootScriptContext::setEnhancedBitDepth(BitDepth bitDepth) {
 	_enhancedBitDepth = bitDepth;
 }
 
+void BootScriptContext::setRuntimeVersion(RuntimeVersion version) {
+	_runtimeVersion = version;
+}
+
 void BootScriptContext::bootObsidianRetailMacEn() {
 	addPlugIn(kPlugInObsidian);
 	addPlugIn(kPlugInMIDI);
@@ -1446,6 +1465,13 @@ void BootScriptContext::executeFunction(const Common::String &functionName, cons
 										   ENUM_BINDING(kArchiveTypeInstallShieldV3),
 										   ENUM_BINDING(kArchiveTypeInstallShieldCab)};
 
+	const EnumBinding runtimeVersionEnum[] = {ENUM_BINDING(kRuntimeVersionAuto),
+											  ENUM_BINDING(kRuntimeVersion100),
+											  ENUM_BINDING(kRuntimeVersion110),
+											  ENUM_BINDING(kRuntimeVersion111),
+											  ENUM_BINDING(kRuntimeVersion112),
+											  ENUM_BINDING(kRuntimeVersion200)};
+
 
 	Common::String str1, str2, str3, str4;
 	uint ui1 = 0;
@@ -1498,6 +1524,11 @@ void BootScriptContext::executeFunction(const Common::String &functionName, cons
 		parseEnum(functionName, paramTokens, 0, bitDepthEnum, ui1);
 
 		setEnhancedBitDepth(static_cast<BitDepth>(ui1));
+	} else if (functionName == "setRuntimeVersion") {
+		checkParams(functionName, paramTokens, 1);
+		parseEnum(functionName, paramTokens, 0, runtimeVersionEnum, ui1);
+
+		setRuntimeVersion(static_cast<RuntimeVersion>(ui1));
 	} else {
 		error("Unknown function '%s'", functionName.c_str());
 	}
@@ -1580,6 +1611,10 @@ BootScriptContext::BitDepth BootScriptContext::getEnhancedBitDepth() const {
 	return _enhancedBitDepth;
 }
 
+BootScriptContext::RuntimeVersion BootScriptContext::getRuntimeVersion() const {
+	return _runtimeVersion;
+}
+
 const Common::Point &BootScriptContext::getResolution() const {
 	return _preferredResolution;
 }
@@ -2168,8 +2203,9 @@ void safeResolveBitDepthAndResolutionFromPresentationSettings(Common::SeekableRe
 		error("Unknown main segment signature");
 
 	bool isBE = (sigType == kSegmentSignatureMacV1 || sigType == kSegmentSignatureMacV2);
+	bool isRuntimeV2 = (sigType == kSegmentSignatureMacV2 || sigType == kSegmentSignatureWinV2 || sigType == kSegmentSignatureCrossV2);
 
-	Data::DataReader catReader(kSignatureHeaderSize, mainSegmentStream, isBE ? Data::kDataFormatMacintosh : Data::kDataFormatWindows);
+	Data::DataReader catReader(kSignatureHeaderSize, mainSegmentStream, isBE ? Data::kDataFormatMacintosh : Data::kDataFormatWindows, isRuntimeV2 ? kRuntimeVersion200 : kRuntimeVersion100, true);
 
 	uint32 hdrUnknown = 0;
 
@@ -2249,7 +2285,7 @@ void safeResolveBitDepthAndResolutionFromPresentationSettings(Common::SeekableRe
 		error("Failed to seek to boot stream");
 
 	// NOTE: Endianness switches from isBE to isMac here!
-	Data::DataReader streamReader(bootStreamPos, mainSegmentStream, isMac ? Data::kDataFormatMacintosh : Data::kDataFormatWindows);
+	Data::DataReader streamReader(bootStreamPos, mainSegmentStream, isMac ? Data::kDataFormatMacintosh : Data::kDataFormatWindows, catReader.getRuntimeVersion(), catReader.isVersionAutoDetect());
 
 	uint32 shTypeID = 0;
 	uint16 shRevision = 0;
@@ -2484,7 +2520,35 @@ BootConfiguration bootProject(const MTropolisGameDescription &gameDesc) {
 
 	ProjectPlatform projectPlatform = (gameDesc.desc.platform == Common::kPlatformMacintosh) ? kProjectPlatformMacintosh : kProjectPlatformWindows;
 
-	desc.reset(new ProjectDescription(projectPlatform, isV2Project ? kProjectMajorVersion2 : kProjectMajorVersion1, vfs.get(), mainSegmentDirectory));
+	RuntimeVersion runtimeVersion = kRuntimeVersion100;
+	bool isAutoVersion = false;
+
+	switch (bootScriptContext.getRuntimeVersion()) {
+	case Boot::BootScriptContext::kRuntimeVersionAuto:
+		if (isV2Project)
+			runtimeVersion = kRuntimeVersion200;
+		isAutoVersion = true;
+		break;
+	case Boot::BootScriptContext::kRuntimeVersion100:
+		runtimeVersion = kRuntimeVersion100;
+		break;
+	case Boot::BootScriptContext::kRuntimeVersion110:
+		runtimeVersion = kRuntimeVersion110;
+		break;
+	case Boot::BootScriptContext::kRuntimeVersion111:
+		runtimeVersion = kRuntimeVersion111;
+		break;
+	case Boot::BootScriptContext::kRuntimeVersion112:
+		runtimeVersion = kRuntimeVersion112;
+		break;
+	case Boot::BootScriptContext::kRuntimeVersion200:
+		runtimeVersion = kRuntimeVersion200;
+		break;
+	default:
+		error("Boot script runtime version was not handled");
+	}
+
+	desc.reset(new ProjectDescription(projectPlatform, runtimeVersion, isAutoVersion, vfs.get(), mainSegmentDirectory));
 	desc->setCursorGraphics(cursorGraphics);
 
 	for (const Common::SharedPtr<PlugIn> &plugIn : plugIns)
diff --git a/engines/mtropolis/core.h b/engines/mtropolis/core.h
index 41ed0e1ab2c..42503dad365 100644
--- a/engines/mtropolis/core.h
+++ b/engines/mtropolis/core.h
@@ -34,6 +34,16 @@ struct IInterfaceBase {
 	virtual ~IInterfaceBase();
 };
 
+enum RuntimeVersion {
+	kRuntimeVersion100,
+
+	kRuntimeVersion110,
+	kRuntimeVersion111,
+	kRuntimeVersion112,
+
+	kRuntimeVersion200,
+};
+
 } // End of namespace MTropolis
 
 #endif /* MTROPOLIS_CORE_H */
diff --git a/engines/mtropolis/data.cpp b/engines/mtropolis/data.cpp
index 9135f1e3d66..4d23e87554d 100644
--- a/engines/mtropolis/data.cpp
+++ b/engines/mtropolis/data.cpp
@@ -157,8 +157,8 @@ bool isAsset(DataObjectType type) {
 
 } // End of namespace DataObjectTypes
 
-DataReader::DataReader(int64 globalPosition, Common::SeekableReadStream &stream, DataFormat dataFormat)
-	: _globalPosition(globalPosition), _stream(stream), _dataFormat(dataFormat), _permitDamagedStrings(false) {
+DataReader::DataReader(int64 globalPosition, Common::SeekableReadStream &stream, DataFormat dataFormat, RuntimeVersion runtimeVersion, bool autoDetectRuntimeVersion)
+	: _globalPosition(globalPosition), _stream(stream), _dataFormat(dataFormat), _permitDamagedStrings(false), _runtimeVersion(runtimeVersion), _autoDetect(autoDetectRuntimeVersion) {
 }
 
 bool DataReader::readU8(uint8 &value) {
@@ -286,6 +286,18 @@ void DataReader::setPermitDamagedStrings(bool permit) {
 	_permitDamagedStrings = permit;
 }
 
+bool DataReader::isVersionAutoDetect() const {
+	return _autoDetect;
+}
+
+RuntimeVersion DataReader::getRuntimeVersion() const {
+	return _runtimeVersion;
+}
+
+void DataReader::setRuntimeVersion(RuntimeVersion runtimeVersion) {
+	_runtimeVersion = runtimeVersion;
+}
+
 bool DataReader::checkErrorAndReset() {
 	const bool isFault = _stream.err() || _stream.eos();
 	if (isFault) {
@@ -422,7 +434,7 @@ bool InternalTypeTaggedValue::load(DataReader &reader) {
 
 	Common::MemoryReadStream contentsStream(contents, sizeof(contents));
 
-	DataReader valueReader(valueGlobalPos, contentsStream, reader.getDataFormat());
+	DataReader valueReader(valueGlobalPos, contentsStream, reader.getDataFormat(), reader.getRuntimeVersion(), reader.isVersionAutoDetect());
 
 	switch (type) {
 	case kNull:
@@ -469,6 +481,9 @@ bool InternalTypeTaggedValue::load(DataReader &reader) {
 		return false;
 	}
 
+	// Sync any version changes
+	reader.setRuntimeVersion(valueReader.getRuntimeVersion());
+
 	return true;
 }
 
@@ -1038,6 +1053,11 @@ DataReadErrorCode ProjectCatalog::load(DataReader &reader) {
 		return kDataReadErrorUnsupportedRevision;
 	}
 
+	if (_revision == 3 && reader.isVersionAutoDetect() && reader.getRuntimeVersion() < kRuntimeVersion111) {
+		debug(1, "Version auto-detect: Detected as 1.1.1 from revision 3 project catalog");
+		reader.setRuntimeVersion(kRuntimeVersion111);
+	}
+
 	uint16 numSegments;
 	uint16 numStreams;
 
@@ -1990,7 +2010,7 @@ DataReadErrorCode PlugInModifier::load(DataReader &reader) {
 	modifierName[16] = 0;
 
 	subObjectSize = codedSize;
-	if (reader.getDataFormat() == kDataFormatWindows) {
+	if (reader.getDataFormat() == kDataFormatWindows && reader.getRuntimeVersion() < kRuntimeVersion112) {
 		// This makes no sense but it's how it's stored...
 		if (subObjectSize < lengthOfName * 256u)
 			return kDataReadErrorReadFailed;
diff --git a/engines/mtropolis/data.h b/engines/mtropolis/data.h
index 24dff6be943..bde42236e55 100644
--- a/engines/mtropolis/data.h
+++ b/engines/mtropolis/data.h
@@ -260,7 +260,7 @@ namespace StructuralFlags {
 
 class DataReader {
 public:
-	DataReader(int64 globalPosition, Common::SeekableReadStream &stream, DataFormat dataFormat);
+	DataReader(int64 globalPosition, Common::SeekableReadStream &stream, DataFormat dataFormat, RuntimeVersion runtimeVersion, bool autoDetectVersion);
 
 	bool readU8(uint8 &value);
 	bool readU16(uint16 &value);
@@ -300,6 +300,10 @@ public:
 
 	void setPermitDamagedStrings(bool permit);
 
+	bool isVersionAutoDetect() const;
+	RuntimeVersion getRuntimeVersion() const;
+	void setRuntimeVersion(RuntimeVersion runtimeVersion);
+
 private:
 	bool checkErrorAndReset();
 
@@ -308,6 +312,9 @@ private:
 	int64 _globalPosition;
 
 	bool _permitDamagedStrings;
+
+	RuntimeVersion _runtimeVersion;	// NOTE: May change during parsing if auto-detecting
+	bool _autoDetect;
 };
 
 template<class... T>
diff --git a/engines/mtropolis/miniscript.cpp b/engines/mtropolis/miniscript.cpp
index 6afb5432b7e..b18122a0a18 100644
--- a/engines/mtropolis/miniscript.cpp
+++ b/engines/mtropolis/miniscript.cpp
@@ -380,7 +380,7 @@ bool MiniscriptParser::parse(const Data::MiniscriptProgram &program, Common::Sha
 	}
 
 	Common::MemoryReadStream stream(&program.bytecode[0], program.bytecode.size());
-	Data::DataReader reader(0, stream, program.dataFormat);
+	Data::DataReader reader(0, stream, program.dataFormat, kRuntimeVersion100, false);
 
 	Common::Array<InstructionData> rawInstructions;
 	rawInstructions.resize(program.numOfInstructions);
@@ -450,7 +450,7 @@ bool MiniscriptParser::parse(const Data::MiniscriptProgram &program, Common::Sha
 			dataLoc = &rawInstruction.contents[0];
 
 		Common::MemoryReadStream instrContentsStream(static_cast<const byte *>(dataLoc), rawInstruction.contents.size());
-		Data::DataReader instrContentsReader(0, instrContentsStream, reader.getDataFormat());
+		Data::DataReader instrContentsReader(0, instrContentsStream, reader.getDataFormat(), reader.getRuntimeVersion(), reader.isVersionAutoDetect());
 
 		if (!rawInstruction.instrFactory->create(&programData[baseOffset + rawInstruction.pdPosition], rawInstruction.flags, instrContentsReader, miniscriptInstructions[i], parserFeedback)) {
 			// Destroy any already-created instructions
diff --git a/engines/mtropolis/runtime.cpp b/engines/mtropolis/runtime.cpp
index 6f7cc7d3acf..6d8c0ac821f 100644
--- a/engines/mtropolis/runtime.cpp
+++ b/engines/mtropolis/runtime.cpp
@@ -2550,8 +2550,8 @@ Common::SharedPtr<CursorGraphic> CursorGraphicCollection::getGraphicByID(uint32
 	return nullptr;
 }
 
-ProjectDescription::ProjectDescription(ProjectPlatform platform, ProjectMajorVersion majorVersion, Common::Archive *rootArchive, const Common::Path &projectRootDir)
-	: _language(Common::EN_ANY), _platform(platform), _rootArchive(rootArchive), _projectRootDir(projectRootDir), _majorVersion(majorVersion) {
+ProjectDescription::ProjectDescription(ProjectPlatform platform, RuntimeVersion runtimeVersion, bool autoDetectVersion, Common::Archive *rootArchive, const Common::Path &projectRootDir)
+	: _language(Common::EN_ANY), _platform(platform), _rootArchive(rootArchive), _projectRootDir(projectRootDir), _runtimeVersion(runtimeVersion), _isRuntimeVersionAuto(autoDetectVersion) {
 }
 
 ProjectDescription::~ProjectDescription() {
@@ -2614,8 +2614,12 @@ ProjectPlatform ProjectDescription::getPlatform() const {
 	return _platform;
 }
 
-ProjectMajorVersion ProjectDescription::getMajorVersion() const {
-	return _majorVersion;
+RuntimeVersion ProjectDescription::getRuntimeVersion() const {
+	return _runtimeVersion;
+}
+
+bool ProjectDescription::isRuntimeVersionAuto() const {
+	return _isRuntimeVersionAuto;
 }
 
 Common::Archive *ProjectDescription::getRootArchive() const {
@@ -7012,7 +7016,7 @@ Project::Project(Runtime *runtime)
 	: Structural(runtime), _projectFormat(Data::kProjectFormatUnknown),
 	  _haveGlobalObjectInfo(false), _haveProjectStructuralDef(false), _playMediaSignaller(new PlayMediaSignaller()),
 	  _keyboardEventSignaller(new KeyboardEventSignaller()), _guessedVersion(MTropolisVersions::kMTropolisVersion1_0),
-	  _platform(kProjectPlatformUnknown), _rootArchive(nullptr), _majorVersion(kProjectMajorVersionUnknown) {
+	  _platform(kProjectPlatformUnknown), _rootArchive(nullptr), _runtimeVersion(kRuntimeVersion100) {
 }
 
 Project::~Project() {
@@ -7067,7 +7071,7 @@ void Project::loadFromDescription(const ProjectDescription &desc, const Hacks &h
 	_platform = desc.getPlatform();
 	_rootArchive = desc.getRootArchive();
 	_projectRootDir = desc.getProjectRootDir();
-	_majorVersion = desc.getMajorVersion();
+	_runtimeVersion = desc.getRuntimeVersion();
 
 	debug(1, "Loading new project...");
 
@@ -7113,7 +7117,7 @@ void Project::loadFromDescription(const ProjectDescription &desc, const Hacks &h
 
 	Common::SeekableSubReadStream stream(baseStream, 2, baseStream->size());
 
-	Data::DataReader catReader(2, stream, (_projectFormat == Data::kProjectFormatMacintosh) ? Data::kDataFormatMacintosh : Data::kDataFormatWindows);
+	Data::DataReader catReader(2, stream, (_projectFormat == Data::kProjectFormatMacintosh) ? Data::kDataFormatMacintosh : Data::kDataFormatWindows, desc.getRuntimeVersion(), desc.isRuntimeVersionAuto());
 
 	uint32 magic = 0;
 	uint32 hdr1 = 0;
@@ -7122,6 +7126,12 @@ void Project::loadFromDescription(const ProjectDescription &desc, const Hacks &h
 		error("Unrecognized project segment header (%x, %x, %d)", magic, hdr1, hdr2);
 	}
 
+	if (hdr1 == 0x2000000 && _isRuntimeVersionAutoDetect && _runtimeVersion < kRuntimeVersion200) {
+		debug(1, "Version auto-detect: Detected as 2.0.0 from V2 project header");
+		catReader.setRuntimeVersion(kRuntimeVersion200);
+		_runtimeVersion = kRuntimeVersion200;
+	}
+
 	Common::SharedPtr<Data::DataObject> dataObject;
 	Data::loadDataObject(_plugInRegistry.getDataLoaderRegistry(), catReader, dataObject);
 
@@ -7134,6 +7144,9 @@ void Project::loadFromDescription(const ProjectDescription &desc, const Hacks &h
 		error("Expected project catalog but found something else");
 	}
 
+	// Catalog version can update version auto-detect
+	_runtimeVersion = catReader.getRuntimeVersion();
+
 	Data::ProjectCatalog *catalog = static_cast<Data::ProjectCatalog *>(dataObject.get());
 
 	_segments.resize(catalog->segments.size());
@@ -7193,7 +7206,7 @@ void Project::loadSceneFromStream(const Common::SharedPtr<Structural> &scene, ui
 	openSegmentStream(segmentIndex);
 
 	Common::SeekableSubReadStream stream(_segments[segmentIndex].weakStream, streamDesc.pos, streamDesc.pos + streamDesc.size);
-	Data::DataReader reader(streamDesc.pos, stream, (_platform == kProjectPlatformMacintosh) ? Data::kDataFormatMacintosh : Data::kDataFormatWindows);
+	Data::DataReader reader(streamDesc.pos, stream, (_platform == kProjectPlatformMacintosh) ? Data::kDataFormatMacintosh : Data::kDataFormatWindows, _runtimeVersion, _isRuntimeVersionAutoDetect);
 
 	if (getRuntime()->getHacks().mtiHispaniolaDamagedStringHack && scene->getName() == "C01b : Main Deck Helm Kidnap")
 		reader.setPermitDamagedStrings(true);
@@ -7321,7 +7334,7 @@ void Project::forceLoadAsset(uint32 assetID, Common::Array<Common::SharedPtr<Ass
 	openSegmentStream(segmentIndex);
 
 	Common::SeekableSubReadStream stream(_segments[segmentIndex].weakStream, streamDesc.pos, streamDesc.pos + streamDesc.size);
-	Data::DataReader reader(streamDesc.pos, stream, (_projectFormat == Data::kProjectFormatMacintosh) ? Data::kDataFormatMacintosh : Data::kDataFormatWindows);
+	Data::DataReader reader(streamDesc.pos, stream, (_projectFormat == Data::kProjectFormatMacintosh) ? Data::kDataFormatMacintosh : Data::kDataFormatWindows, _runtimeVersion, _isRuntimeVersionAutoDetect);
 
 	const Data::PlugInModifierRegistry &plugInDataLoaderRegistry = _plugInRegistry.getDataLoaderRegistry();
 
@@ -7511,7 +7524,7 @@ void Project::loadBootStream(size_t streamIndex, const Hacks &hacks) {
 	openSegmentStream(segmentIndex);
 
 	Common::SeekableSubReadStream stream(_segments[segmentIndex].weakStream, streamDesc.pos, streamDesc.pos + streamDesc.size);
-	Data::DataReader reader(streamDesc.pos, stream, (_platform == kProjectPlatformMacintosh) ? Data::kDataFormatMacintosh : Data::kDataFormatWindows);
+	Data::DataReader reader(streamDesc.pos, stream, (_platform == kProjectPlatformMacintosh) ? Data::kDataFormatMacintosh : Data::kDataFormatWindows, _runtimeVersion, _isRuntimeVersionAutoDetect);
 
 	ChildLoaderStack loaderStack;
 	AssetDefLoaderContext assetDefLoader;
@@ -7820,12 +7833,12 @@ void Project::initAdditionalSegments(const Common::String &projectName) {
 		if (_projectFormat == Data::kProjectFormatNeutral) {
 			segmentName += ".mxx";
 		} else if (_projectFormat == Data::kProjectFormatWindows) {
-			if (_majorVersion == kProjectMajorVersion2)
+			if (_runtimeVersion >= kRuntimeVersion200)
 				segmentName += ".mxw";
 			else
 				segmentName += ".mpx";
 		} else if (_projectFormat == Data::kProjectFormatMacintosh) {
-			if (_majorVersion == kProjectMajorVersion2)
+			if (_runtimeVersion >= kRuntimeVersion200)
 				segmentName += ".mxm";
 		}
 
diff --git a/engines/mtropolis/runtime.h b/engines/mtropolis/runtime.h
index 034daae98e3..76f810e52e2 100644
--- a/engines/mtropolis/runtime.h
+++ b/engines/mtropolis/runtime.h
@@ -1263,16 +1263,9 @@ enum ProjectPlatform {
 	kProjectPlatformMacintosh,
 };
 
-enum ProjectMajorVersion {
-	kProjectMajorVersionUnknown,
-
-	kProjectMajorVersion1,
-	kProjectMajorVersion2,
-};
-
 class ProjectDescription {
 public:
-	ProjectDescription(ProjectPlatform platform, ProjectMajorVersion majorVersion, Common::Archive *rootArchive, const Common::Path &projectRootDir);
+	ProjectDescription(ProjectPlatform platform, RuntimeVersion runtimeVersion, bool autoDetectVersion, Common::Archive *rootArchive, const Common::Path &projectRootDir);
 	~ProjectDescription();
 
 	void addSegment(int volumeID, const char *filePath);
@@ -1292,7 +1285,8 @@ public:
 	const Common::Language &getLanguage() const;
 
 	ProjectPlatform getPlatform() const;
-	ProjectMajorVersion getMajorVersion() const;
+	RuntimeVersion getRuntimeVersion() const;
+	bool isRuntimeVersionAuto() const;
 
 	Common::Archive *getRootArchive() const;
 	const Common::Path &getProjectRootDir() const;
@@ -1300,8 +1294,6 @@ public:
 	const SubtitleTables &getSubtitles() const;
 	void setSubtitles(const SubtitleTables &subs);
 
-
-
 private:
 	Common::Array<SegmentDescription> _segments;
 	Common::Array<Common::SharedPtr<PlugIn> > _plugIns;
@@ -1310,7 +1302,8 @@ private:
 	Common::Language _language;
 	SubtitleTables _subtitles;
 	ProjectPlatform _platform;
-	ProjectMajorVersion _majorVersion;
+	RuntimeVersion _runtimeVersion;
+	bool _isRuntimeVersionAuto;
 
 	Common::Archive *_rootArchive;
 	Common::Path _projectRootDir;
@@ -2583,7 +2576,9 @@ private:
 
 	Common::Archive *_rootArchive;
 	Common::Path _projectRootDir;
-	ProjectMajorVersion _majorVersion;
+
+	RuntimeVersion _runtimeVersion;
+	bool _isRuntimeVersionAutoDetect;
 };
 
 class Section : public Structural {




More information about the Scummvm-git-logs mailing list