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

bluegr noreply at scummvm.org
Sun May 8 12:12:44 UTC 2022


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

Summary:
760547eb52 TINSEL: Remove redundant cast
0b84a042d5 TINSEL: Fix regression with inventory objects in DW1 and DW2


Commit: 760547eb52284a3abaaae500dce37b72f1c0faa6
    https://github.com/scummvm/scummvm/commit/760547eb52284a3abaaae500dce37b72f1c0faa6
Author: Filippos Karapetis (bluegr at gmail.com)
Date: 2022-05-08T15:08:33+03:00

Commit Message:
TINSEL: Remove redundant cast

Changed paths:
    engines/tinsel/dialogs.cpp


diff --git a/engines/tinsel/dialogs.cpp b/engines/tinsel/dialogs.cpp
index 1dd6e74a0b5..170af0f7f16 100644
--- a/engines/tinsel/dialogs.cpp
+++ b/engines/tinsel/dialogs.cpp
@@ -5005,7 +5005,7 @@ void Dialogs::RegisterIcons(void *cptr, int num) {
 		_invObjects = (INV_OBJECT *)MemoryDeref(node);
 		assert(_invObjects);
 		byte *srcP = (byte *)cptr;
-		INV_OBJECT *destP = (INV_OBJECT *)_invObjects;
+		INV_OBJECT *destP = _invObjects;
 
 		for (int i = 0; i < num; ++i, ++destP, srcP += 12) {
 			memmove(destP, srcP, 12);


Commit: 0b84a042d5362e133bfb9cb36c07b80887b8dfbc
    https://github.com/scummvm/scummvm/commit/0b84a042d5362e133bfb9cb36c07b80887b8dfbc
Author: Filippos Karapetis (bluegr at gmail.com)
Date: 2022-05-08T15:12:31+03:00

Commit Message:
TINSEL: Fix regression with inventory objects in DW1 and DW2

Regression caused by 70d1dbb00f8afadc7e66d61c93efa0e48286ffbd.

This change will break the inventory changes done for DW3, and will
need to be fixed accordingly for it.

DW3 has two new fields in its INV_OBJECT struct. However, there are
variables in the code that are cast from memory blobs, so adding
these new fields breaks DW1 and DW2. We'll either need to add a new
structure for DW3, or read the struct members individually instead of
casting the memory blobs to this struct.

Changed paths:
    engines/tinsel/dialogs.h
    engines/tinsel/noir/notebook.cpp


diff --git a/engines/tinsel/dialogs.h b/engines/tinsel/dialogs.h
index 54252e5b393..bcd71187fc0 100644
--- a/engines/tinsel/dialogs.h
+++ b/engines/tinsel/dialogs.h
@@ -150,9 +150,15 @@ struct INV_OBJECT {
 	SCNHANDLE hScript;	// inventory objects event handling script
 	int32 attribute;		// inventory object's attribute
 
+	// TODO: Commented out because there are variables
+	// with this struct type that are cast from memory blobs,
+	// so this breaks DW1 and DW2. We need to read these
+	// struct members individually instead of casting the blobs
+	// to this struct
+
 	// Noir
-	int32 unknown;
-	int32 title;	// id of associated notebook title
+	//int32 unknown;
+	//int32 title;	// id of associated notebook title
 };
 
 struct INV_DEF {
diff --git a/engines/tinsel/noir/notebook.cpp b/engines/tinsel/noir/notebook.cpp
index 5237ab4dab0..22329e22be0 100644
--- a/engines/tinsel/noir/notebook.cpp
+++ b/engines/tinsel/noir/notebook.cpp
@@ -27,16 +27,22 @@ namespace Tinsel {
 
 void Notebook::AddHyperlink(int32 id1, int32 id2) {
 	INV_OBJECT *invObject = _vm->_dialogs->GetInvObject(id1);
+
+#if 0
 	if (invObject->title != 0) {
 		error("A clue can only be hyperlinked if it only has one title!");
 		return;
 	}
+#endif
 
 	invObject = _vm->_dialogs->GetInvObject(id2);
+
+#if 0
 	if (invObject->title != 0) {
 		error("A clue can only be hyperlinked if it only has one title!");
 		return;
 	}
+#endif
 
 	uint32 i;
 	for (i = 0; i < MAX_HYPERS; ++i) {




More information about the Scummvm-git-logs mailing list