[Scummvm-cvs-logs] CVS: scummvm/simon intern.h,1.36,1.37 items.cpp,1.124,1.125 res.cpp,1.33,1.34 saveload.cpp,1.13,1.14 simon.cpp,1.510,1.511 simon.h,1.140,1.141

kirben kirben at users.sourceforge.net
Mon Oct 3 07:10:53 CEST 2005


Update of /cvsroot/scummvm/scummvm/simon
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9560/simon

Modified Files:
	intern.h items.cpp res.cpp saveload.cpp simon.cpp simon.h 
Log Message:

Cleanup


Index: intern.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/simon/intern.h,v
retrieving revision 1.36
retrieving revision 1.37
diff -u -d -r1.36 -r1.37
--- intern.h	30 Jul 2005 21:11:35 -0000	1.36
+++ intern.h	3 Oct 2005 14:08:07 -0000	1.37
@@ -54,11 +54,10 @@
 	uint16 parent;
 	uint16 child;
 	uint16 sibling;
-	int16 unk1;
-	int16 unk2;
-	int16 unk3;										/* signed int */
-	uint16 unk4;
-	uint16 xxx_1;									/* unused? */
+	int16 noun;
+	int16 adjective;
+	int16 state;										/* signed int */
+	uint16 classFlags;
 	Child *children;
 
 	Item() { memset(this, 0, sizeof(*this)); }

Index: items.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/simon/items.cpp,v
retrieving revision 1.124
retrieving revision 1.125
diff -u -d -r1.124 -r1.125
--- items.cpp	30 Jul 2005 21:11:35 -0000	1.124
+++ items.cpp	3 Oct 2005 14:08:07 -0000	1.125
@@ -159,9 +159,9 @@
 			}
 			break;
 
-		case 27:{									/* item unk3 is */
+		case 27:{									/* item state is */
 				Item *item = getNextItemPtr();
-				condition = ((uint) item->unk3 == getVarOrWord());
+				condition = ((uint) item->state == getVarOrWord());
 			}
 			break;
 
@@ -311,28 +311,28 @@
 			}
 			break;
 
-		case 59:{									/* item inc unk3 */
+		case 59:{									/* item inc state */
 				Item *item = getNextItemPtr();
-				if (item->unk3 <= 30000)
-					setItemUnk3(item, item->unk3 + 1);
+				if (item->state <= 30000)
+					setItemState(item, item->state + 1);
 			}
 			break;
 
-		case 60:{									/* item dec unk3 */
+		case 60:{									/* item dec state */
 				Item *item = getNextItemPtr();
-				if (item->unk3 >= 0)
-					setItemUnk3(item, item->unk3 - 1);
+				if (item->state >= 0)
+					setItemState(item, item->state - 1);
 			}
 			break;
 
-		case 61:{									/* item set unk3 */
+		case 61:{									/* item set state */
 				Item *item = getNextItemPtr();
 				int value = getVarOrWord();
 				if (value < 0)
 					value = 0;
 				if (value > 30000)
 					value = 30000;
-				setItemUnk3(item, value);
+				setItemState(item, value);
 			}
 			break;
 
@@ -653,19 +653,19 @@
 
 		case 115:{									/* item has flag */
 				Item *item = getNextItemPtr();
-				condition = (item->unk4 & (1 << getVarOrByte())) != 0;
+				condition = (item->classFlags & (1 << getVarOrByte())) != 0;
 			}
 			break;
 
 		case 116:{									/* item set flag */
 				Item *item = getNextItemPtr();
-				item->unk4 |= (1 << getVarOrByte());
+				item->classFlags |= (1 << getVarOrByte());
 			}
 			break;
 
 		case 117:{									/* item clear flag */
 				Item *item = getNextItemPtr();
-				item->unk4 &= ~(1 << getVarOrByte());
+				item->classFlags &= ~(1 << getVarOrByte());
 			}
 			break;
 
@@ -761,7 +761,7 @@
 
 		case 136:{									/* set var to item unk3 */
 				Item *item = getNextItemPtr();
-				writeNextVarContents(item->unk3);
+				writeNextVarContents(item->state);
 			}
 			break;
 
@@ -918,7 +918,7 @@
 		case 165:{									/* item unk1 unk2 is */
 				Item *item = getNextItemPtr();
 				int16 a = getNextWord(), b = getNextWord();
-				condition = (item->unk2 == a && item->unk1 == b);
+				condition = (item->adjective == a && item->noun == b);
 			} break;
 
 		case 166:{									/* set bit2 */

Index: res.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/simon/res.cpp,v
retrieving revision 1.33
retrieving revision 1.34
diff -u -d -r1.33 -r1.34
--- res.cpp	24 Jun 2005 15:23:41 -0000	1.33
+++ res.cpp	3 Oct 2005 14:08:07 -0000	1.34
@@ -181,14 +181,14 @@
 void SimonEngine::readItemFromGamePc(Common::File *in, Item *item) {
 	uint32 type;
 
-	item->unk2 = in->readUint16BE();
-	item->unk1 = in->readUint16BE();
-	item->unk3 = in->readUint16BE();
+	item->adjective = in->readUint16BE();
+	item->noun = in->readUint16BE();
+	item->state = in->readUint16BE();
 	item->sibling = (uint16)fileReadItemID(in);
 	item->child = (uint16)fileReadItemID(in);
 	item->parent = (uint16)fileReadItemID(in);
 	in->readUint16BE();
-	item->unk4 = in->readUint16BE();
+	item->classFlags = in->readUint16BE();
 	item->children = NULL;
 
 	type = in->readUint32BE();

Index: saveload.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/simon/saveload.cpp,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -d -r1.13 -r1.14
--- saveload.cpp	30 Jul 2005 21:11:35 -0000	1.13
+++ saveload.cpp	3 Oct 2005 14:08:07 -0000	1.14
@@ -435,8 +435,8 @@
 
 		f->writeUint16BE(item->parent);
 		f->writeUint16BE(item->sibling);
-		f->writeUint16BE(item->unk3);
-		f->writeUint16BE(item->unk4);
+		f->writeUint16BE(item->state);
+		f->writeUint16BE(item->classFlags);
 
 		Child1 *child1 = (Child1 *)findChildOfType(item, 1);
 		if (child1) {
@@ -547,8 +547,8 @@
 			item->sibling = sibling;
 		}
 
-		item->unk3 = f->readUint16BE();
-		item->unk4 = f->readUint16BE();
+		item->state = f->readUint16BE();
+		item->classFlags = f->readUint16BE();
 
 		Child1 *child1 = (Child1 *)findChildOfType(item, 1);
 		if (child1 != NULL) {

Index: simon.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/simon/simon.cpp,v
retrieving revision 1.510
retrieving revision 1.511
diff -u -d -r1.510 -r1.511
--- simon.cpp	22 Sep 2005 22:55:01 -0000	1.510
+++ simon.cpp	3 Oct 2005 14:08:07 -0000	1.511
@@ -882,8 +882,8 @@
 	Child *child;
 
 	_item1 = _itemArrayPtr[1];
-	_item1->unk2 = -1;
-	_item1->unk1 = 10000;
+	_item1->adjective = -1;
+	_item1->noun = 10000;
 
 	child = (Child *)allocateChildBlock(_item1, 3, sizeof(Child));
 	if (child == NULL)
@@ -1050,8 +1050,8 @@
 	_tablesHeapPtr = (byte *)calloc(TABLES_MEM_SIZE, 1);
 }
 
-void SimonEngine::setItemUnk3(Item *item, int value) {
-	item->unk3 = value;
+void SimonEngine::setItemState(Item *item, int value) {
+	item->state = value;
 }
 
 int SimonEngine::getNextWord() {
@@ -1625,7 +1625,7 @@
 		_objectItem = derefItem(getItem1Ptr()->parent);
 
 	if (_objectItem != NULL) {
-		_scriptCondC = _objectItem->unk1;
+		_scriptCondC = _objectItem->noun;
 	} else {
 		_scriptCondC = -1;
 	}
@@ -1829,7 +1829,7 @@
 	while (item_ptr && unk1-- != 0) {
 		num_sibs_with_flag = 0;
 		while (item_ptr && width_div_3 > num_sibs_with_flag) {
-			if ((unk2 == 0 || item_ptr->unk4 & unk2) && has_item_childflag_0x10(item_ptr))
+			if ((unk2 == 0 || item_ptr->classFlags & unk2) && has_item_childflag_0x10(item_ptr))
 				if (!(_game & GF_SIMON2)) {
 					num_sibs_with_flag++;
 				} else {
@@ -1851,7 +1851,7 @@
 	j = 0;
 
 	while (item_ptr) {
-		if ((unk2 == 0 || item_ptr->unk4 & unk2) && has_item_childflag_0x10(item_ptr)) {
+		if ((unk2 == 0 || item_ptr->classFlags & unk2) && has_item_childflag_0x10(item_ptr)) {
 			if (item_again == false) {
 				fcs_ptr->fcs_data->e[k].item = item_ptr;
 				if (!(_game & GF_SIMON2)) {
@@ -2240,13 +2240,13 @@
 	}
 
 	if (_subjectItem) {
-		_scriptCondB = _subjectItem->unk1;
+		_scriptCondB = _subjectItem->noun;
 	} else {
 		_scriptCondB = -1;
 	}
 
 	if (_objectItem) {
-		_scriptCondC = _objectItem->unk1;
+		_scriptCondC = _objectItem->noun;
 	} else {
 		_scriptCondC = -1;
 	}
@@ -2981,7 +2981,7 @@
 	item = _vcItemArray[a];
 	if (item == NULL)
 		return true;
-	return item->unk3 == b;
+	return item->state == b;
 }
 
 // OK

Index: simon.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/simon/simon.h,v
retrieving revision 1.140
retrieving revision 1.141
diff -u -d -r1.140 -r1.141
--- simon.h	11 Aug 2005 18:08:55 -0000	1.140
+++ simon.h	3 Oct 2005 14:08:07 -0000	1.141
@@ -442,7 +442,7 @@
 	uint itemPtrToID(Item *id);
 
 	Item *derefItem(uint item);
-	void setItemUnk3(Item *item, int value);
+	void setItemState(Item *item, int value);
 
 	void showMessageFormat(const char *s, ...);
 	const byte *getStringPtrByID(uint string_id);





More information about the Scummvm-git-logs mailing list