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

peres001 at users.sourceforge.net peres001 at users.sourceforge.net
Mon Mar 23 23:34:47 CET 2009


Revision: 39648
          http://scummvm.svn.sourceforge.net/scummvm/?rev=39648&view=rev
Author:   peres001
Date:     2009-03-23 22:34:46 +0000 (Mon, 23 Mar 2009)

Log Message:
-----------
Turned ZoneTypes into a regular numeric id (no more a bitfield).

Modified Paths:
--------------
    scummvm/trunk/engines/parallaction/objects.h
    scummvm/trunk/engines/parallaction/parser.h
    scummvm/trunk/engines/parallaction/parser_br.cpp
    scummvm/trunk/engines/parallaction/parser_ns.cpp

Modified: scummvm/trunk/engines/parallaction/objects.h
===================================================================
--- scummvm/trunk/engines/parallaction/objects.h	2009-03-23 21:28:22 UTC (rev 39647)
+++ scummvm/trunk/engines/parallaction/objects.h	2009-03-23 22:34:46 UTC (rev 39648)
@@ -56,20 +56,20 @@
 enum ZoneTypes {
 	kZoneExamine	   = 1,					// zone displays comment if activated
 	kZoneDoor		   = 2,					// zone activated on click (after some walk if needed)
-	kZoneGet		   = 4,					// for pickable items
-	kZoneMerge		   = 8,					// tags items which can be merged in inventory
-	kZoneTaste		   = 0x10,				// NEVER USED
-	kZoneHear		   = 0x20,				// NEVER USED: they ran out of time before integrating sfx
-	kZoneFeel		   = 0x40,				// NEVER USED
-	kZoneSpeak		   = 0x80,				// tags NPCs the character can talk with
-	kZoneNone		   = 0x100,				// used to prevent parsing on peculiar Animations
-	kZoneTrap		   = 0x200,				// zone activated when character enters
-	kZoneYou		   = 0x400,				// marks the character
-	kZoneCommand	   = 0x800,
+	kZoneGet		   = 3,					// for pickable items
+	kZoneMerge		   = 4,					// tags items which can be merged in inventory
+	kZoneTaste		   = 5,				// NEVER USED
+	kZoneHear		   = 6,				// NEVER USED: they ran out of time before integrating sfx
+	kZoneFeel		   = 7,				// NEVER USED
+	kZoneSpeak		   = 8,				// tags NPCs the character can talk with
+	kZoneNone		   = 9,				// used to prevent parsing on peculiar Animations
+	kZoneTrap		   = 10,				// zone activated when character enters
+	kZoneYou		   = 11,				// marks the character
+	kZoneCommand	   = 12,
 
 	// BRA specific
-	kZonePath          = 0x1000,			// defines nodes for assisting walk calculation routines
-	kZoneBox           = 0x2000
+	kZonePath          = 13,			// defines nodes for assisting walk calculation routines
+	kZoneBox           = 14
 };
 
 

Modified: scummvm/trunk/engines/parallaction/parser.h
===================================================================
--- scummvm/trunk/engines/parallaction/parser.h	2009-03-23 21:28:22 UTC (rev 39647)
+++ scummvm/trunk/engines/parallaction/parser.h	2009-03-23 22:34:46 UTC (rev 39648)
@@ -196,6 +196,8 @@
 	void		parseAnswerBody(Answer *answer);
 	Question	*parseQuestion();
 
+	uint32		buildZoneType(const char *t0, const char* t1);
+
 	void		parseZone(ZoneList &list, char *name);
 	virtual void parseZoneTypeBlock(ZonePtr z);
 	void		parsePointList(PointList &list);

Modified: scummvm/trunk/engines/parallaction/parser_br.cpp
===================================================================
--- scummvm/trunk/engines/parallaction/parser_br.cpp	2009-03-23 21:28:22 UTC (rev 39647)
+++ scummvm/trunk/engines/parallaction/parser_br.cpp	2009-03-23 22:34:46 UTC (rev 39648)
@@ -737,15 +737,11 @@
 DECLARE_ZONE_PARSER(type)  {
 	debugC(7, kDebugParser, "ZONE_PARSER(type) ");
 
-	if (_tokens[2][0] != '\0') {
-		ctxt.z->_type = (4 + _vm->_objectsNames->lookup(_tokens[2])) << 16;
-	}
-	int16 _si = _zoneTypeNames->lookup(_tokens[1]);
-	if (_si != Table::notFound) {
-		ctxt.z->_type |= 1 << (_si - 1);
+	ctxt.z->_type = buildZoneType(_tokens[1], _tokens[2]);
+	if (ACTIONTYPE(ctxt.z) != 0) {
 		parseZoneTypeBlock(ctxt.z);
 
-//		if (ctxt.z->_type & kZoneHear) {
+//		if (ACTIONTYPE(ctxt.z) == kZoneHear) {
 //			_soundMan->sfxCommand(START...);
 //		}
 	}

Modified: scummvm/trunk/engines/parallaction/parser_ns.cpp
===================================================================
--- scummvm/trunk/engines/parallaction/parser_ns.cpp	2009-03-23 21:28:22 UTC (rev 39647)
+++ scummvm/trunk/engines/parallaction/parser_ns.cpp	2009-03-23 22:34:46 UTC (rev 39648)
@@ -211,16 +211,10 @@
 DECLARE_ANIM_PARSER(type)  {
 	debugC(7, kDebugParser, "ANIM_PARSER(type) ");
 
-	if (_tokens[2][0] != '\0') {
-		ctxt.a->_type = PACK_ZONETYPE(0, 4 + _vm->_objectsNames->lookup(_tokens[2]));
+	ctxt.a->_type = buildZoneType(_tokens[1], _tokens[2]);
+	if ((ACTIONTYPE(ctxt.a) != 0) && (ACTIONTYPE(ctxt.a) != kZoneCommand)) {
+		parseZoneTypeBlock(ctxt.a);
 	}
-	int16 _si = _zoneTypeNames->lookup(_tokens[1]);
-	if (_si != Table::notFound) {
-		ctxt.a->_type |= 1 << (_si-1);
-		if (/*(ACTIONTYPE(ctxt.a) != kZoneNone) &&*/ (ACTIONTYPE(ctxt.a) != kZoneCommand)) {
-			parseZoneTypeBlock(ctxt.a);
-		}
-	}
 
 	ctxt.a->_flags |= 0x1000000;
 
@@ -1314,16 +1308,21 @@
 	ctxt.z->_moveTo.y = atoi(_tokens[2]);
 }
 
+uint32 LocationParser_ns::buildZoneType(const char *t0, const char* t1) {
+	uint16 it = 0;
+	if (t1[0] != '\0') {
+		it = 4 + _vm->_objectsNames->lookup(t1);
+	}
+	uint16 zt = _zoneTypeNames->lookup(t0);
+	return PACK_ZONETYPE(zt, it);
+}
 
+
 DECLARE_ZONE_PARSER(type)  {
 	debugC(7, kDebugParser, "ZONE_PARSER(type) ");
 
-	if (_tokens[2][0] != '\0') {
-		ctxt.z->_type = (4 + _vm->_objectsNames->lookup(_tokens[2])) << 16;
-	}
-	int16 _si = _zoneTypeNames->lookup(_tokens[1]);
-	if (_si != Table::notFound) {
-		ctxt.z->_type |= 1 << (_si - 1);
+	ctxt.z->_type = buildZoneType(_tokens[1], _tokens[2]);
+	if (ACTIONTYPE(ctxt.z) != 0) {
 		parseZoneTypeBlock(ctxt.z);
 	}
 


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