[Scummvm-git-logs] scummvm master -> 508610ad228466111a7b3af2c97f818b4d5ccc4c

elasota noreply at scummvm.org
Wed Jun 22 01:57:14 UTC 2022


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:
37ef659ed5 MTROPOLIS: Cleanup: Add some debug fields for tag decoding, remove extra tabs.
d3ec38242e MTROPOLIS: Remove unused read proxy code
508610ad22 MTROPOLIS: Cleanup. Remove unused type, remove IInterfaceBase from write interfaces to get rid of global destructor.


Commit: 37ef659ed526078e2ec49251abc09c051e90fd6c
    https://github.com/scummvm/scummvm/commit/37ef659ed526078e2ec49251abc09c051e90fd6c
Author: elasota (ejlasota at gmail.com)
Date: 2022-06-21T21:54:53-04:00

Commit Message:
MTROPOLIS: Cleanup: Add some debug fields for tag decoding, remove extra tabs.

Changed paths:
    engines/mtropolis/boot.cpp


diff --git a/engines/mtropolis/boot.cpp b/engines/mtropolis/boot.cpp
index e4c11bb7682..e40c144a3c4 100644
--- a/engines/mtropolis/boot.cpp
+++ b/engines/mtropolis/boot.cpp
@@ -52,11 +52,16 @@ enum FileCategory {
 };
 
 struct FileIdentification {
+	union Tag {
+		uint32 value;
+		char debug[4];
+	};
+
 	Common::String fileName;
 	FileCategory category;
 
-	uint32 macType;
-	uint32 macCreator;
+	Tag macType;
+	Tag macCreator;
 	Common::SharedPtr<Common::MacResManager> resMan;
 	Common::SharedPtr<Common::SeekableReadStream> stream;
 };
@@ -196,8 +201,8 @@ void ObsidianGameDataHandler::unpackMacRetailInstaller(Common::Array<Common::Sha
 
 		FileIdentification ident;
 		ident.fileName = request.fileName;
-		ident.macCreator = request.creator;
-		ident.macType = request.type;
+		ident.macCreator.value = request.creator;
+		ident.macType.value = request.type;
 		ident.resMan = resMan;
 		ident.category = kFileCategoryUnknown;
 		files.push_back(ident);
@@ -210,8 +215,8 @@ void ObsidianGameDataHandler::unpackMacRetailInstaller(Common::Array<Common::Sha
 
 		FileIdentification ident;
 		ident.fileName = "Obsidian Data 1";
-		ident.macCreator = MKTAG('M', 'f', 'P', 'l');
-		ident.macType = MKTAG('M', 'F', 'm', 'm');
+		ident.macCreator.value = MKTAG('M', 'f', 'P', 'l');
+		ident.macType.value = MKTAG('M', 'F', 'm', 'm');
 		ident.category = kFileCategoryUnknown;
 		ident.stream = startupStream;
 		files.push_back(ident);
@@ -551,11 +556,11 @@ Common::SharedPtr<ProjectDescription> bootProject(const MTropolisGameDescription
 		const ADGameFileDescription *fileDesc = gameDesc.desc.filesDescriptions;
 		while (fileDesc->fileName) {
 			const char *fileName = fileDesc->fileName;
-			
+
 			Boot::FileIdentification ident;
 			ident.fileName = fileName;
 			ident.category = Boot::kFileCategoryUnknown;
-			if (!Boot::getMacTypesForFile(fileName, ident.macType, ident.macCreator))
+			if (!Boot::getMacTypesForFile(fileName, ident.macType.value, ident.macCreator.value))
 				error("Couldn't determine Mac file type code for file '%s'", fileName);
 
 			macFiles.push_back(ident);
@@ -580,7 +585,7 @@ Common::SharedPtr<ProjectDescription> bootProject(const MTropolisGameDescription
 
 		for (Boot::FileIdentification &macFile : macFiles) {
 			if (macFile.category == Boot::kFileCategoryUnknown) {
-				switch (macFile.macType) {
+				switch (macFile.macType.value) {
 				case MKTAG('M', 'F', 'm', 'm'):
 					haveAnyMFmm = true;
 					break;
@@ -601,12 +606,12 @@ Common::SharedPtr<ProjectDescription> bootProject(const MTropolisGameDescription
 
 		bool isMT2CrossPlatform = (haveAnyMFmx && !haveAnyMFmm);
 		if (isMT2CrossPlatform && haveAnyMFxm)
-			error("Unexpected combination of player file types");		
+			error("Unexpected combination of player file types");
 
 		// Identify unknown files
 		for (Boot::FileIdentification &macFile : macFiles) {
 			if (macFile.category == Boot::kFileCategoryUnknown) {
-				switch (macFile.macType) {
+				switch (macFile.macType.value) {
 				case MKTAG('M', 'F', 'm', 'm'):
 					macFile.category = Boot::kFileCategoryProjectMainSegment;
 					break;
@@ -676,7 +681,7 @@ Common::SharedPtr<ProjectDescription> bootProject(const MTropolisGameDescription
 			if (macFile.category == Boot::kFileCategoryPlayer)
 				Boot::loadCursorsMac(macFile, *cursorGraphics);
 		}
-		
+
 		for (Boot::FileIdentification &macFile : macFiles) {
 			if (macFile.category == Boot::kFileCategoryExtension)
 				Boot::loadCursorsMac(macFile, *cursorGraphics);
@@ -722,8 +727,8 @@ Common::SharedPtr<ProjectDescription> bootProject(const MTropolisGameDescription
 			Boot::FileIdentification ident;
 			ident.fileName = fileName;
 			ident.category = Boot::kFileCategoryUnknown;
-			ident.macType = 0;
-			ident.macCreator = 0;
+			ident.macType.value = 0;
+			ident.macCreator.value = 0;
 			winFiles.push_back(ident);
 
 			fileDesc++;


Commit: d3ec38242ecdc4cb92d5de5747372d7ba4e39318
    https://github.com/scummvm/scummvm/commit/d3ec38242ecdc4cb92d5de5747372d7ba4e39318
Author: elasota (ejlasota at gmail.com)
Date: 2022-06-21T21:54:53-04:00

Commit Message:
MTROPOLIS: Remove unused read proxy code

Changed paths:
    engines/mtropolis/miniscript.cpp
    engines/mtropolis/runtime.cpp
    engines/mtropolis/runtime.h


diff --git a/engines/mtropolis/miniscript.cpp b/engines/mtropolis/miniscript.cpp
index db79abb5b0a..4ad96e0e0a7 100644
--- a/engines/mtropolis/miniscript.cpp
+++ b/engines/mtropolis/miniscript.cpp
@@ -1899,14 +1899,6 @@ MiniscriptInstructionOutcome MiniscriptThread::dereferenceRValue(size_t offset,
 	case DynamicValueTypes::kWriteProxy:
 		this->error("Attempted to dereference an lvalue proxy");
 		return kMiniscriptInstructionOutcomeFailed;
-	case DynamicValueTypes::kReadProxy: {
-			const DynamicValueReadProxyPOD &readProxy = stackValue.value.getReadProxyPOD();
-			if (!readProxy.ifc->read(this, stackValue.value, readProxy.objectRef, readProxy.ptrOrOffset)) {
-				this->error("Failed to access a proxy value");
-				return kMiniscriptInstructionOutcomeFailed;
-			}
-		}
-		break;
 	case DynamicValueTypes::kList:
 			if (cloneLists)
 				stackValue.value.setList(stackValue.value.getList()->clone());
diff --git a/engines/mtropolis/runtime.cpp b/engines/mtropolis/runtime.cpp
index 8bf8309b19e..b12a23f7a81 100644
--- a/engines/mtropolis/runtime.cpp
+++ b/engines/mtropolis/runtime.cpp
@@ -953,9 +953,6 @@ bool DynamicList::changeToType(DynamicValueTypes::DynamicValueType type) {
 	case DynamicValueTypes::kObject:
 		_container = new DynamicListContainer<ObjectReference>();
 		break;
-	case DynamicValueTypes::kReadProxy:
-		// FIXME
-		break;
 	case DynamicValueTypes::kWriteProxy:
 		// FIXME
 		break;
@@ -1248,26 +1245,11 @@ const ObjectReference &DynamicValue::getObject() const {
 	return _obj;
 }
 
-const DynamicValueReadProxyPOD &DynamicValue::getReadProxyPOD() const {
-	assert(_type == DynamicValueTypes::kReadProxy);
-	return _value.asReadProxy;
-}
-
 const DynamicValueWriteProxyPOD &DynamicValue::getWriteProxyPOD() const {
 	assert(_type == DynamicValueTypes::kWriteProxy);
 	return _value.asWriteProxy;
 }
 
-
-DynamicValueReadProxy DynamicValue::getReadProxyTEMP() const {
-	assert(_type == DynamicValueTypes::kReadProxy);
-
-	DynamicValueReadProxy proxy;
-	proxy.pod = _value.asReadProxy;
-	proxy.containerList = _list;
-	return proxy;
-}
-
 DynamicValueWriteProxy DynamicValue::getWriteProxyTEMP() const {
 	assert(_type == DynamicValueTypes::kWriteProxy);
 
@@ -1277,11 +1259,6 @@ DynamicValueWriteProxy DynamicValue::getWriteProxyTEMP() const {
 	return proxy;
 }
 
-const Common::SharedPtr<DynamicList> &DynamicValue::getReadProxyContainer() const {
-	assert(_type == DynamicValueTypes::kReadProxy);
-	return _list;
-}
-
 const Common::SharedPtr<DynamicList> &DynamicValue::getWriteProxyContainer() const {
 	assert(_type == DynamicValueTypes::kWriteProxy);
 	return _list;
@@ -1367,15 +1344,6 @@ void DynamicValue::setList(const Common::SharedPtr<DynamicList> &value) {
 	_list = value;
 }
 
-void DynamicValue::setReadProxy(const DynamicValueReadProxy &readProxy) {
-	Common::SharedPtr<DynamicList> listRef = readProxy.containerList;	// Back up list ref in case this is a self-assign
-	if (_type != DynamicValueTypes::kReadProxy)
-		clear();
-	_type = DynamicValueTypes::kReadProxy;
-	_value.asReadProxy = readProxy.pod;
-	_list = listRef;
-}
-
 void DynamicValue::setWriteProxy(const DynamicValueWriteProxy &writeProxy) {
 	Common::SharedPtr<DynamicList> listRef = writeProxy.containerList; // Back up list ref in case this is a self-assign
 	if (_type != DynamicValueTypes::kWriteProxy)
diff --git a/engines/mtropolis/runtime.h b/engines/mtropolis/runtime.h
index 2cc7692e029..c2d74ed02ba 100644
--- a/engines/mtropolis/runtime.h
+++ b/engines/mtropolis/runtime.h
@@ -89,7 +89,6 @@ class VisualElement;
 class Window;
 class WorldManagerInterface;
 struct DynamicValue;
-struct DynamicValueReadProxy;
 struct DynamicValueWriteProxy;
 struct ICollider;
 struct ILoadUIProvider;
@@ -181,7 +180,6 @@ enum DynamicValueType {
 	kString,
 	kList,
 	kObject,
-	kReadProxy,
 	kWriteProxy,
 
 	kEmpty,
@@ -463,17 +461,6 @@ struct IDynamicValueWriteInterface : public IInterfaceBase {
 	virtual MiniscriptInstructionOutcome refAttribIndexed(MiniscriptThread *thread, DynamicValueWriteProxy &proxy, void *objectRef, uintptr ptrOrOffset, const Common::String &attrib, const DynamicValue &index) const = 0;
 };
 
-struct DynamicValueReadProxyPOD {
-	uintptr ptrOrOffset;
-	const void *objectRef;
-	IDynamicValueReadInterface *ifc;
-};
-
-struct DynamicValueReadProxy {
-	DynamicValueReadProxyPOD pod;
-	Common::SharedPtr<DynamicList> containerList;
-};
-
 struct DynamicValueWriteProxyPOD {
 	uintptr ptrOrOffset;
 	void *objectRef;
@@ -801,11 +788,8 @@ struct DynamicValue {
 	const bool &getBool() const;
 	const Common::SharedPtr<DynamicList> &getList() const;
 	const ObjectReference &getObject() const;
-	const DynamicValueReadProxyPOD &getReadProxyPOD() const;
 	const DynamicValueWriteProxyPOD &getWriteProxyPOD() const;
-	DynamicValueReadProxy getReadProxyTEMP() const;
 	DynamicValueWriteProxy getWriteProxyTEMP() const;
-	const Common::SharedPtr<DynamicList> &getReadProxyContainer() const;
 	const Common::SharedPtr<DynamicList> &getWriteProxyContainer() const;
 
 	void clear();
@@ -823,7 +807,6 @@ struct DynamicValue {
 	void setList(const Common::SharedPtr<DynamicList> &value);
 	void setObject(const ObjectReference &value);
 	void setObject(const Common::WeakPtr<RuntimeObject> &value);
-	void setReadProxy(const DynamicValueReadProxy &readProxy);
 	void setWriteProxy(const DynamicValueWriteProxy &writeProxy);
 
 	bool roundToInt(int32 &outInt) const;
@@ -850,7 +833,6 @@ private:
 		Event asEvent;
 		Point16POD asPoint;
 		bool asBool;
-		DynamicValueReadProxyPOD asReadProxy;
 		DynamicValueWriteProxyPOD asWriteProxy;
 	};
 


Commit: 508610ad228466111a7b3af2c97f818b4d5ccc4c
    https://github.com/scummvm/scummvm/commit/508610ad228466111a7b3af2c97f818b4d5ccc4c
Author: elasota (ejlasota at gmail.com)
Date: 2022-06-21T21:56:37-04:00

Commit Message:
MTROPOLIS: Cleanup. Remove unused type, remove IInterfaceBase from write interfaces to get rid of global destructor.

Changed paths:
    engines/mtropolis/runtime.h


diff --git a/engines/mtropolis/runtime.h b/engines/mtropolis/runtime.h
index c2d74ed02ba..86ddad15c9e 100644
--- a/engines/mtropolis/runtime.h
+++ b/engines/mtropolis/runtime.h
@@ -449,13 +449,7 @@ struct MessageFlags {
 struct DynamicValue;
 struct DynamicList;
 
-struct IDynamicValueReadInterface : public IInterfaceBase {
-	virtual MiniscriptInstructionOutcome read(MiniscriptThread *thread, DynamicValue &dest, const void *objectRef, uintptr ptrOrOffset) const = 0;
-	virtual MiniscriptInstructionOutcome readAttrib(MiniscriptThread *thread, DynamicValue &dest, const void *objectRef, uintptr ptrOrOffset, const Common::String &attrib) const = 0;
-	virtual MiniscriptInstructionOutcome readAttribIndexed(MiniscriptThread *thread, DynamicValue &dest, const void *objectRef, uintptr ptrOrOffset, const Common::String &attrib, const DynamicValue &index) const = 0;
-};
-
-struct IDynamicValueWriteInterface : public IInterfaceBase {
+struct IDynamicValueWriteInterface {
 	virtual MiniscriptInstructionOutcome write(MiniscriptThread *thread, const DynamicValue &dest, void *objectRef, uintptr ptrOrOffset) const = 0;
 	virtual MiniscriptInstructionOutcome refAttrib(MiniscriptThread *thread, DynamicValueWriteProxy &proxy, void *objectRef, uintptr ptrOrOffset, const Common::String &attrib) const = 0;
 	virtual MiniscriptInstructionOutcome refAttribIndexed(MiniscriptThread *thread, DynamicValueWriteProxy &proxy, void *objectRef, uintptr ptrOrOffset, const Common::String &attrib, const DynamicValue &index) const = 0;




More information about the Scummvm-git-logs mailing list