[Scummvm-cvs-logs] SF.net SVN: scummvm:[49145] scummvm/trunk/engines/parallaction
peres001 at users.sourceforge.net
peres001 at users.sourceforge.net
Sat May 22 19:59:33 CEST 2010
Revision: 49145
http://scummvm.svn.sourceforge.net/scummvm/?rev=49145&view=rev
Author: peres001
Date: 2010-05-22 17:59:33 +0000 (Sat, 22 May 2010)
Log Message:
-----------
Finish implementation of hitZone and related functions as from the original code.
Modified Paths:
--------------
scummvm/trunk/engines/parallaction/parallaction.cpp
scummvm/trunk/engines/parallaction/parallaction.h
Modified: scummvm/trunk/engines/parallaction/parallaction.cpp
===================================================================
--- scummvm/trunk/engines/parallaction/parallaction.cpp 2010-05-22 17:59:16 UTC (rev 49144)
+++ scummvm/trunk/engines/parallaction/parallaction.cpp 2010-05-22 17:59:33 UTC (rev 49145)
@@ -690,6 +690,35 @@
return false;
}
+bool Parallaction::checkZoneType(ZonePtr z, uint32 type) {
+ int gameType = getGameType();
+
+ if (gameType == GType_Nippon) {
+ if ((type == 0) && (ITEMTYPE(z) == 0))
+ return true;
+ }
+
+ if (gameType == GType_BRA) {
+ if (type == 0) {
+ if (ITEMTYPE(z) == 0) {
+ if (ACTIONTYPE(z) != kZonePath) {
+ return true;
+ }
+ }
+ if (ACTIONTYPE(z) == kZoneDoor) {
+ return true;
+ }
+ }
+ }
+
+ if (z->_type == type)
+ return true;
+ if (ITEMTYPE(z) == type)
+ return true;
+
+ return false;
+}
+
bool Parallaction::checkZoneBox(ZonePtr z, uint32 type, uint x, uint y) {
if (z->_flags & kFlagsRemove)
return false;
@@ -719,15 +748,7 @@
// we get here only if (x,y) hits the character and the zone is marked as self-use
}
- // normal Zone
- if ((type == 0) && (ITEMTYPE(z) == 0))
- return true;
- if (z->_type == type)
- return true;
- if (ITEMTYPE(z) == type)
- return true;
-
- return false;
+ return checkZoneType(z, type);
}
bool Parallaction::checkLinkedAnimBox(ZonePtr z, uint32 type, uint x, uint y) {
@@ -745,16 +766,7 @@
return false;
}
- // NOTE: the implementation of the following lines is a different in the
- // original... it is working so far, though
- if ((type == 0) && (ITEMTYPE(z) == 0))
- return true;
- if (z->_type == type)
- return true;
- if (ITEMTYPE(z) == type)
- return true;
-
- return false;
+ return checkZoneType(z, type);
}
/* NOTE: hitZone needs to be passed absolute game coordinates to work.
@@ -776,13 +788,22 @@
}
+ int gameType = getGameType();
+
int16 _a, _b, _c, _d;
bool _ef;
for (AnimationList::iterator ait = _location._animations.begin(); ait != _location._animations.end(); ++ait) {
AnimationPtr a = *ait;
- _a = (a->_flags & kFlagsActive) ? 1 : 0; // _a: active Animation
+ _a = (a->_flags & kFlagsActive) ? 1 : 0; // _a: active Animation
+
+ if (!_a) {
+ if (gameType == GType_BRA && ACTIONTYPE(a) != kZoneTrap) {
+ continue;
+ }
+ }
+
_ef = a->hitFrameRect(_si, _di);
_b = ((type != 0) || (a->_type == kZoneYou)) ? 0 : 1; // _b: (no type specified) AND (Animation is not the character)
Modified: scummvm/trunk/engines/parallaction/parallaction.h
===================================================================
--- scummvm/trunk/engines/parallaction/parallaction.h 2010-05-22 17:59:16 UTC (rev 49144)
+++ scummvm/trunk/engines/parallaction/parallaction.h 2010-05-22 17:59:33 UTC (rev 49145)
@@ -360,6 +360,7 @@
uint32 getLocationFlags();
bool checkSpecialZoneBox(ZonePtr z, uint32 type, uint x, uint y);
bool checkZoneBox(ZonePtr z, uint32 type, uint x, uint y);
+ bool checkZoneType(ZonePtr z, uint32 type);
bool checkLinkedAnimBox(ZonePtr z, uint32 type, uint x, uint y);
ZonePtr hitZone(uint32 type, uint16 x, uint16 y);
void runZone(ZonePtr 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