aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorwhiterandrek2018-06-11 23:30:50 +0300
committerEugene Sandulenko2018-06-28 23:51:32 +0200
commit471840514f148a1730dd7a7c281a062bcab5eeed (patch)
tree881355aac82f7feb780f4a9e09d411a32e5351f4
parent2fb268b155357c999499460bf98431a4e3761564 (diff)
downloadscummvm-rg350-471840514f148a1730dd7a7c281a062bcab5eeed.tar.gz
scummvm-rg350-471840514f148a1730dd7a7c281a062bcab5eeed.tar.bz2
scummvm-rg350-471840514f148a1730dd7a7c281a062bcab5eeed.zip
PINK: fix determination of Actor by point
-rw-r--r--engines/pink/director.cpp3
-rw-r--r--engines/pink/objects/actors/actor.h2
-rw-r--r--engines/pink/objects/actors/cursor_actor.h4
3 files changed, 9 insertions, 0 deletions
diff --git a/engines/pink/director.cpp b/engines/pink/director.cpp
index 14993ec7f9..e5af9905f9 100644
--- a/engines/pink/director.cpp
+++ b/engines/pink/director.cpp
@@ -27,6 +27,7 @@
#include "pink/director.h"
#include "pink/objects/actions/action_sound.h"
#include "pink/objects/actions/action_cel.h"
+#include "pink/objects/actors/actor.h"
namespace Pink {
Director::Director()
@@ -111,6 +112,8 @@ void Director::loadStage() {
Actor *Director::getActorByPoint(const Common::Point point) {
for (int i = _sprites.size() - 1; i >= 0; --i) {
+ if (_sprites[i]->getActor()->isCursor())
+ continue;
CelDecoder *decoder = _sprites[i]->getDecoder();
const Graphics::Surface *frame = decoder->getCurrentFrame();
const Common::Rect &rect = _sprites[i]->getBounds();
diff --git a/engines/pink/objects/actors/actor.h b/engines/pink/objects/actors/actor.h
index 2d42f37705..668186217d 100644
--- a/engines/pink/objects/actors/actor.h
+++ b/engines/pink/objects/actors/actor.h
@@ -57,6 +57,8 @@ public:
void endAction() { _isActionEnded = true; }
+ virtual bool isCursor() { return false; }
+
virtual bool isLeftClickHandlers() { return false; }
virtual bool isUseClickHandlers(InventoryItem *item) { return false; }
diff --git a/engines/pink/objects/actors/cursor_actor.h b/engines/pink/objects/actors/cursor_actor.h
index 8446b76e45..2d5eb281e8 100644
--- a/engines/pink/objects/actors/cursor_actor.h
+++ b/engines/pink/objects/actors/cursor_actor.h
@@ -39,6 +39,10 @@ public:
_actions[i]->toConsole();
}
}
+
+ bool isCursor() override {
+ return true;
+ }
};
} // End of namespace Pink