aboutsummaryrefslogtreecommitdiff
path: root/engines/fullpipe/gfx.cpp
diff options
context:
space:
mode:
authorEugene Sandulenko2013-09-05 00:13:16 +0300
committerEugene Sandulenko2013-09-06 14:51:25 +0300
commit6b242c0f9f02332697d36c6706df86cd674408ed (patch)
treeea11e51fc83fd92019787842443a78b08a6f2c7d /engines/fullpipe/gfx.cpp
parentf61b77e07e032b8ec672eb4daabe625b59d9292f (diff)
downloadscummvm-rg350-6b242c0f9f02332697d36c6706df86cd674408ed.tar.gz
scummvm-rg350-6b242c0f9f02332697d36c6706df86cd674408ed.tar.bz2
scummvm-rg350-6b242c0f9f02332697d36c6706df86cd674408ed.zip
FULLPIPE: Implement GameObject::canInteractAny()
Diffstat (limited to 'engines/fullpipe/gfx.cpp')
-rw-r--r--engines/fullpipe/gfx.cpp25
1 files changed, 23 insertions, 2 deletions
diff --git a/engines/fullpipe/gfx.cpp b/engines/fullpipe/gfx.cpp
index a38203375b..1cb6b85b34 100644
--- a/engines/fullpipe/gfx.cpp
+++ b/engines/fullpipe/gfx.cpp
@@ -26,6 +26,8 @@
#include "fullpipe/gfx.h"
#include "fullpipe/statics.h"
#include "fullpipe/scene.h"
+#include "fullpipe/interaction.h"
+#include "fullpipe/gameloader.h"
#include "common/memstream.h"
@@ -147,6 +149,7 @@ PictureObject::PictureObject() {
_ox2 = 0;
_oy2 = 0;
_pictureObject2List = 0;
+ _objtype = kObjTypePictureObject;
}
PictureObject::PictureObject(PictureObject *src) : GameObject(src) {
@@ -154,6 +157,7 @@ PictureObject::PictureObject(PictureObject *src) : GameObject(src) {
_ox2 = _ox;
_oy2 = _oy;
_pictureObject2List = src->_pictureObject2List;
+ _objtype = kObjTypePictureObject;
}
bool PictureObject::load(MfcArchive &file, bool bigPicture) {
@@ -339,8 +343,25 @@ void GameObject::renumPictures(CPtrList *lst) {
free(buf);
}
-bool GameObject::canInteractAny(GameObject *obj2, int a3) {
- warning("STUB: GameObject::canInteractAny()");
+bool GameObject::canInteractAny(GameObject *obj2, int invId) {
+ int sceneId = 0;
+
+ if (g_fullpipe->_currentScene)
+ sceneId = g_fullpipe->_currentScene->_sceneId;
+
+ CInteractionController *intC = getGameLoaderInteractionController();
+ for (CObList::iterator i = intC->_interactions.begin(); i != intC->_interactions.end(); ++i) {
+ CInteraction *intr = (CInteraction *)*i;
+
+ if (intr->_sceneId > 0 && intr->_sceneId != sceneId)
+ break;
+
+ if (invId == -3) {
+ invId = getGameLoaderInventory()->getSelectedItemId();
+ }
+ if (intr->canInteract(this, obj2, invId))
+ return true;
+ }
return false;
}