aboutsummaryrefslogtreecommitdiff
path: root/engines/pink/objects
diff options
context:
space:
mode:
Diffstat (limited to 'engines/pink/objects')
-rw-r--r--engines/pink/objects/actions/action_loop.cpp8
-rw-r--r--engines/pink/objects/actions/action_play.cpp2
-rw-r--r--engines/pink/objects/actions/action_play_with_sfx.cpp2
-rw-r--r--engines/pink/objects/actions/action_still.cpp8
-rw-r--r--engines/pink/objects/actions/action_still.h2
-rw-r--r--engines/pink/objects/actors/lead_actor.cpp5
-rw-r--r--engines/pink/objects/actors/lead_actor.h1
7 files changed, 20 insertions, 8 deletions
diff --git a/engines/pink/objects/actions/action_loop.cpp b/engines/pink/objects/actions/action_loop.cpp
index 500a001b4c..ca649b2caf 100644
--- a/engines/pink/objects/actions/action_loop.cpp
+++ b/engines/pink/objects/actions/action_loop.cpp
@@ -71,12 +71,12 @@ void ActionLoop::update() {
decodeNext();
} else {
_forward = false;
- setFrame(_stopFrame - 1);
+ ActionCEL::setFrame(_stopFrame - 1);
decodeNext();
}
} else {
if (frame > (int)_startFrame) {
- setFrame(frame - 1);
+ ActionCEL::setFrame(frame - 1);
} else {
_forward = true;
}
@@ -85,13 +85,13 @@ void ActionLoop::update() {
break;
case kRandom: {
Common::RandomSource &rnd = _actor->getPage()->getGame()->getRnd();
- setFrame(rnd.getRandomNumberRng(_startFrame, _stopFrame));
+ ActionCEL::setFrame(rnd.getRandomNumberRng(_startFrame, _stopFrame));
decodeNext();
break;
}
case kForward:
if (frame == _stopFrame) {
- setFrame(_startFrame);
+ ActionCEL::setFrame(_startFrame);
}
decodeNext();
break;
diff --git a/engines/pink/objects/actions/action_play.cpp b/engines/pink/objects/actions/action_play.cpp
index e86ff55c21..6d23a8accd 100644
--- a/engines/pink/objects/actions/action_play.cpp
+++ b/engines/pink/objects/actions/action_play.cpp
@@ -64,7 +64,7 @@ void ActionPlay::onStart() {
if (_stopFrame == -1 || _stopFrame >= frameCount)
_stopFrame = frameCount - 1;
assert(_startFrame < _decoder.getFrameCount());
- setFrame(_startFrame);
+ ActionCEL::setFrame(_startFrame);
// doesn't need to decode startFrame here. Update method will decode
}
diff --git a/engines/pink/objects/actions/action_play_with_sfx.cpp b/engines/pink/objects/actions/action_play_with_sfx.cpp
index be3f0cae7c..78c302208d 100644
--- a/engines/pink/objects/actions/action_play_with_sfx.cpp
+++ b/engines/pink/objects/actions/action_play_with_sfx.cpp
@@ -52,7 +52,7 @@ void ActionPlayWithSfx::toConsole() {
void ActionPlayWithSfx::update() {
int currFrame = _decoder.getCurFrame();
if (_isLoop && currFrame == _stopFrame) {
- setFrame(_startFrame);
+ ActionCEL::setFrame(_startFrame);
decodeNext();
} else
ActionPlay::update();
diff --git a/engines/pink/objects/actions/action_still.cpp b/engines/pink/objects/actions/action_still.cpp
index 5bd645b3cc..9c1ba083c9 100644
--- a/engines/pink/objects/actions/action_still.cpp
+++ b/engines/pink/objects/actions/action_still.cpp
@@ -52,8 +52,7 @@ void ActionStill::onStart() {
if (_startFrame >= _decoder.getFrameCount())
_startFrame = 0;
- setFrame(_startFrame); // seek to frame before startFrame
- decodeNext(); // decode startFrame
+ setFrame(_startFrame);
_decoder.setEndOfTrack();
assert(!_decoder.needsUpdate());
@@ -61,4 +60,9 @@ void ActionStill::onStart() {
_actor->endAction();
}
+void ActionStill::setFrame(uint frame) {
+ ActionCEL::setFrame(frame);
+ decodeNext();
+}
+
} // End of namespace Pink
diff --git a/engines/pink/objects/actions/action_still.h b/engines/pink/objects/actions/action_still.h
index a9b2d5209c..e3fb386c26 100644
--- a/engines/pink/objects/actions/action_still.h
+++ b/engines/pink/objects/actions/action_still.h
@@ -37,6 +37,8 @@ public:
void pause(bool paused) override;
+ void setFrame(uint frame);
+
protected:
void onStart() override;
diff --git a/engines/pink/objects/actors/lead_actor.cpp b/engines/pink/objects/actors/lead_actor.cpp
index 0ce5a5af1e..e74434a67c 100644
--- a/engines/pink/objects/actors/lead_actor.cpp
+++ b/engines/pink/objects/actors/lead_actor.cpp
@@ -244,6 +244,11 @@ void LeadActor::onLeftButtonClick(const Common::Point point) {
}
}
+void LeadActor::onLeftButtonUp(const Common::Point point) {
+ if (_state == kPDA)
+ _page->getGame()->getPdaMgr().onLeftButtonUp(point);
+}
+
void LeadActor::onRightButtonClick(const Common::Point point) {
if (_state == kReady || _state == kMoving) {
Actor *clickedActor = getActorByPoint(point);
diff --git a/engines/pink/objects/actors/lead_actor.h b/engines/pink/objects/actors/lead_actor.h
index ff38ef9bf4..543ee3f89b 100644
--- a/engines/pink/objects/actors/lead_actor.h
+++ b/engines/pink/objects/actors/lead_actor.h
@@ -70,6 +70,7 @@ public:
void onKeyboardButtonClick(Common::KeyCode code);
void onLeftButtonClick(const Common::Point point);
+ void onLeftButtonUp(const Common::Point point);
void onRightButtonClick(const Common::Point point);
void onMouseMove(const Common::Point point);