aboutsummaryrefslogtreecommitdiff
path: root/engines/fullpipe/interaction.cpp
diff options
context:
space:
mode:
authorEugene Sandulenko2013-09-07 22:57:56 +0300
committerEugene Sandulenko2013-09-07 22:57:56 +0300
commit940c686858d9a0bf92c1473b9a81653a9937b88a (patch)
tree95a2b343ac811c365c55a7d34a42c5d394554993 /engines/fullpipe/interaction.cpp
parentec650efb477d9b5df159d37a6b16d628166bab9c (diff)
downloadscummvm-rg350-940c686858d9a0bf92c1473b9a81653a9937b88a.tar.gz
scummvm-rg350-940c686858d9a0bf92c1473b9a81653a9937b88a.tar.bz2
scummvm-rg350-940c686858d9a0bf92c1473b9a81653a9937b88a.zip
FULLPIPE: Implement CInteraction::isOverlapping()
Diffstat (limited to 'engines/fullpipe/interaction.cpp')
-rw-r--r--engines/fullpipe/interaction.cpp17
1 files changed, 13 insertions, 4 deletions
diff --git a/engines/fullpipe/interaction.cpp b/engines/fullpipe/interaction.cpp
index 231fe57afa..f9ea41b2ae 100644
--- a/engines/fullpipe/interaction.cpp
+++ b/engines/fullpipe/interaction.cpp
@@ -72,10 +72,8 @@ void CInteractionController::sortInteractions(int sceneId) {
Common::sort(_interactions.begin(), _interactions.end(), CInteractionController::compareInteractions);
}
-int CInteractionController::handleInteraction(GameObject *subject, GameObject *object, int invId) {
- warning("STUB: CInteractionController::handleInteraction()");
-
- return 0;
+bool CInteractionController::handleInteraction(GameObject *subj, GameObject *obj, int invId) {
+ return true;
}
CInteraction::CInteraction() {
@@ -172,6 +170,17 @@ bool CInteraction::canInteract(GameObject *obj1, GameObject *obj2, int invId) {
return true;
}
+bool CInteraction::isOverlapping(StaticANIObject *subj, StaticANIObject *obj) {
+ if (abs(_xOffs + obj->_ox - subj->_ox) <= 1
+ && abs(obj->_oy + _yOffs - subj->_oy) <= 1) {
+ if (!this->_staticsId2 || subj->_statics != 0 && subj->_statics->_staticsId == _staticsId2) {
+ if (!_staticsId1 || !(_flags & 1) || obj->_statics != 0 && obj->_statics->_staticsId == _staticsId1)
+ return true;
+ }
+ }
+ return false;
+}
+
bool EntranceInfo::load(MfcArchive &file) {
debug(5, "EntranceInfo::load()");