[Scummvm-cvs-logs] SF.net SVN: scummvm: [26866] scummvm/trunk/engines/parallaction

peres001 at users.sourceforge.net peres001 at users.sourceforge.net
Fri May 18 22:05:09 CEST 2007


Revision: 26866
          http://scummvm.svn.sourceforge.net/scummvm/?rev=26866&view=rev
Author:   peres001
Date:     2007-05-18 13:05:08 -0700 (Fri, 18 May 2007)

Log Message:
-----------
Reverting my last change.

Modified Paths:
--------------
    scummvm/trunk/engines/parallaction/animation.cpp
    scummvm/trunk/engines/parallaction/commands.cpp
    scummvm/trunk/engines/parallaction/parallaction.cpp
    scummvm/trunk/engines/parallaction/zone.cpp
    scummvm/trunk/engines/parallaction/zone.h

Modified: scummvm/trunk/engines/parallaction/animation.cpp
===================================================================
--- scummvm/trunk/engines/parallaction/animation.cpp	2007-05-18 09:19:35 UTC (rev 26865)
+++ scummvm/trunk/engines/parallaction/animation.cpp	2007-05-18 20:05:08 UTC (rev 26866)
@@ -93,7 +93,7 @@
 			int16 _si = _zoneTypeNames->lookup(_tokens[1]);
 			if (_si != -1) {
 				vD0->_type |= 1 << (_si-1);
-				if ((vD0->type() != kZoneNone) && (vD0->type() != kZoneCommand)) {
+				if (((vD0->_type & 0xFFFF) != kZoneNone) && ((vD0->_type & 0xFFFF) != kZoneCommand)) {
 					parseZoneTypeBlock(script, vD0);
 				}
 			}

Modified: scummvm/trunk/engines/parallaction/commands.cpp
===================================================================
--- scummvm/trunk/engines/parallaction/commands.cpp	2007-05-18 09:19:35 UTC (rev 26865)
+++ scummvm/trunk/engines/parallaction/commands.cpp	2007-05-18 20:05:08 UTC (rev 26866)
@@ -283,7 +283,7 @@
 			if (u->_zone != NULL) {
 				u->_zone->_flags &= ~kFlagsRemove;
 				u->_zone->_flags |= kFlagsActive;
-				if (u->_zone->type() == kZoneGet) {
+				if ((u->_zone->_type & 0xFFFF) == kZoneGet) {
 					addJob(&jobDisplayDroppedItem, u->_zone, kPriority17 );
 				}
 			}

Modified: scummvm/trunk/engines/parallaction/parallaction.cpp
===================================================================
--- scummvm/trunk/engines/parallaction/parallaction.cpp	2007-05-18 09:19:35 UTC (rev 26865)
+++ scummvm/trunk/engines/parallaction/parallaction.cpp	2007-05-18 20:05:08 UTC (rev 26866)
@@ -561,7 +561,7 @@
 			return &_input;
 		}
 
-		if (((_mouseButtons == kMouseLeftUp) && (_activeItem._id == 0) && ((_engineFlags & kEngineWalking) == 0)) && ((z == NULL) || (z->type() != kZoneCommand))) {
+		if (((_mouseButtons == kMouseLeftUp) && (_activeItem._id == 0) && ((_engineFlags & kEngineWalking) == 0)) && ((z == NULL) || ((z->_type & 0xFFFF) != kZoneCommand))) {
 			_input._event = kEvWalk;
 			return &_input;
 		}
@@ -584,7 +584,7 @@
 			return &_input;
 		}
 
-		if ((_mouseButtons == kMouseLeftUp) && ((_activeItem._id != 0) || (z->type() == kZoneCommand))) {
+		if ((_mouseButtons == kMouseLeftUp) && ((_activeItem._id != 0) || ((z->_type & 0xFFFF) == kZoneCommand))) {
 
 			_input._zone = z;
 			if (z->_flags & kFlagsNoWalk) {

Modified: scummvm/trunk/engines/parallaction/zone.cpp
===================================================================
--- scummvm/trunk/engines/parallaction/zone.cpp	2007-05-18 09:19:35 UTC (rev 26865)
+++ scummvm/trunk/engines/parallaction/zone.cpp	2007-05-18 20:05:08 UTC (rev 26866)
@@ -121,8 +121,8 @@
 		// but we need to check it separately here. The same workaround is applied in hitZone.
 		if (((z->_top == -1) ||
 			((z->_left == -2) && (
-				((z->type() == kZoneMerge) && ((isItemInInventory(MAKE_INVENTORY_ID(z->u.merge->_obj1)) != 0) || (isItemInInventory(MAKE_INVENTORY_ID(z->u.merge->_obj2)) != 0))) ||
-				((z->type() == kZoneGet) && ((isItemInInventory(MAKE_INVENTORY_ID(z->u.get->_icon)) != 0)))
+				(((z->_type & 0xFFFF) == kZoneMerge) && ((isItemInInventory(MAKE_INVENTORY_ID(z->u.merge->_obj1)) != 0) || (isItemInInventory(MAKE_INVENTORY_ID(z->u.merge->_obj2)) != 0))) ||
+				(((z->_type & 0xFFFF) == kZoneGet) && ((isItemInInventory(MAKE_INVENTORY_ID(z->u.get->_icon)) != 0)))
 			))) &&
 			((_engineFlags & kEngineQuit) == 0)) {
 
@@ -152,7 +152,7 @@
 
 	TypeData *u = &z->u;
 
-	switch (z->type()) {
+	switch (z->_type & 0xFFFF) {
 	case kZoneExamine:	// examine Zone alloc
 		u->examine = new ExamineData;
 		break;
@@ -185,7 +185,7 @@
 
 	do {
 
-		switch (z->type()) {
+		switch (z->_type & 0xFFFF) {
 		case kZoneExamine: // examine Zone init
 			if (!scumm_stricmp(_tokens[0], "file")) {
 				u->examine->_filename = (char*)malloc(strlen(_tokens[1])+1);
@@ -374,9 +374,11 @@
 uint16 Parallaction::runZone(Zone *z) {
 	debugC(3, kDebugLocation, "runZone (%s)", z->_label._text);
 
-	debugC(3, kDebugLocation, "type = %x, id = %x",z->type(), z->boundId() >> 16);
-	switch(z->type()) {
+	uint16 subtype = z->_type & 0xFFFF;
 
+	debugC(3, kDebugLocation, "type = %x, object = %x", subtype, (z->_type & 0xFFFF0000) >> 16);
+	switch(subtype) {
+
 	case kZoneExamine:
 		if (z->u.examine->_filename) {
 			displayItemComment(z->u.examine);
@@ -542,15 +544,15 @@
 				// WORKAROUND: this huge condition is needed because we made TypeData a collection of structs
 				// instead of an union. So, merge->_obj1 and get->_icon were just aliases in the original engine,
 				// but we need to check it separately here. The same workaround is applied in freeZones.
-				if (((z->type() == kZoneMerge) && (((_si == z->u.merge->_obj1) && (_di == z->u.merge->_obj2)) || ((_si == z->u.merge->_obj2) && (_di == z->u.merge->_obj1)))) ||
-					((z->type() == kZoneGet) && ((_si == z->u.get->_icon) || (_di == z->u.get->_icon)))) {
+				if ((((z->_type & 0xFFFF) == kZoneMerge) && (((_si == z->u.merge->_obj1) && (_di == z->u.merge->_obj2)) || ((_si == z->u.merge->_obj2) && (_di == z->u.merge->_obj1)))) ||
+					(((z->_type & 0xFFFF) == kZoneGet) && ((_si == z->u.get->_icon) || (_di == z->u.get->_icon)))) {
 
 					// special Zone
-					if ((type == 0) && (z->boundId() == 0 == 0))
+					if ((type == 0) && ((z->_type & 0xFFFF0000) == 0))
 						return z;
 					if (z->_type == type)
 						return z;
-					if (z->boundId() == type)
+					if ((z->_type & 0xFFFF0000) == type)
 						return z;
 
 				}
@@ -570,11 +572,11 @@
 		}
 
 		// normal Zone
-		if ((type == 0) && (z->boundId() == 0))
+		if ((type == 0) && ((z->_type & 0xFFFF0000) == 0))
 			return z;
 		if (z->_type == type)
 			return z;
-		if (z->boundId() == type)
+		if ((z->_type & 0xFFFF0000) == type)
 			return z;
 
 	}
@@ -590,8 +592,8 @@
 		_f = ((_di >= a->_top + a->height()) || (_di <= a->_top)) ? 0 : 1;		// _f: vertical range
 
 		_b = ((type != 0) || (a->_type == kZoneYou)) ? 0 : 1; 										 // _b: (no type specified) AND (Animation is not the character)
-		_c = (a->boundId()) ? 0 : 1; 															// _c: Animation is not an object
-		_d = (a->boundId() != type) ? 0 : 1;													// _d: Animation is an object of the same type
+		_c = (a->_type & 0xFFFF0000) ? 0 : 1; 															// _c: Animation is not an object
+		_d = ((a->_type & 0xFFFF0000) != type) ? 0 : 1;													// _d: Animation is an object of the same type
 
 		if ((_a != 0 && _e != 0 && _f != 0) && ((_b != 0 && _c != 0) || (a->_type == type) || (_d != 0))) {
 
@@ -615,7 +617,7 @@
 Zone::~Zone() {
 //	printf("~Zone(%s)\n", _label._text);
 
-	switch (type()) {
+	switch (_type & 0xFFFF) {
 	case kZoneExamine:
 		free(u.examine->_filename);
 		free(u.examine->_description);

Modified: scummvm/trunk/engines/parallaction/zone.h
===================================================================
--- scummvm/trunk/engines/parallaction/zone.h	2007-05-18 09:19:35 UTC (rev 26865)
+++ scummvm/trunk/engines/parallaction/zone.h	2007-05-18 20:05:08 UTC (rev 26866)
@@ -48,6 +48,7 @@
 	kZoneCommand	   = 0x800
 };
 
+
 enum ZoneFlags {
 	kFlagsClosed		= 1,				// Zone: door is closed / switch is off
 	kFlagsActive		= 2,				// Zone/Animation: object is visible
@@ -63,6 +64,7 @@
 	kFlagsNoWalk		= 0x800 			// Zone: character doesn't need to walk towards object to interact
 };
 
+
 #define NUM_ANSWERS		 5
 
 struct Command;
@@ -212,13 +214,6 @@
 	void translate(int16 x, int16 y);
 	virtual uint16 width() const;
 	virtual uint16 height() const;
-
-	uint32 type() {
-		return _type & 0xFFFF;
-	}
-	uint32 boundId() {
-		return (_type & 0xFFFF0000);
-	}
 };
 
 typedef Zone* ZonePointer;


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the Scummvm-git-logs mailing list