aboutsummaryrefslogtreecommitdiff
path: root/engines/fullpipe/lift.cpp
diff options
context:
space:
mode:
authorEugene Sandulenko2014-01-28 21:30:08 +0200
committerEugene Sandulenko2014-01-28 21:30:33 +0200
commit00369347e03d801fad7be673f03512bc5ce5220c (patch)
tree11aca0c4ab7b69961ccc48fce4b1ff41afb36d15 /engines/fullpipe/lift.cpp
parent07568931cef05d609e4a2335593fb9ed53ecee57 (diff)
downloadscummvm-rg350-00369347e03d801fad7be673f03512bc5ce5220c.tar.gz
scummvm-rg350-00369347e03d801fad7be673f03512bc5ce5220c.tar.bz2
scummvm-rg350-00369347e03d801fad7be673f03512bc5ce5220c.zip
FULLPIPE: Implement lift_goAnimation()
Diffstat (limited to 'engines/fullpipe/lift.cpp')
-rw-r--r--engines/fullpipe/lift.cpp49
1 files changed, 47 insertions, 2 deletions
diff --git a/engines/fullpipe/lift.cpp b/engines/fullpipe/lift.cpp
index aa0c19e475..6484aca30a 100644
--- a/engines/fullpipe/lift.cpp
+++ b/engines/fullpipe/lift.cpp
@@ -29,6 +29,7 @@
#include "fullpipe/scene.h"
#include "fullpipe/statics.h"
#include "fullpipe/messages.h"
+#include "fullpipe/gameloader.h"
namespace Fullpipe {
@@ -234,8 +235,52 @@ void FullpipeEngine::lift_clickButton() {
lift_walkAndGo();
}
-void FullpipeEngine::lift_goAnimation() {
- warning("STUB: FullpipeEngine::lift_goAnimation()");
+void FullpipeEngine::lift_goAnimation() { if (_lastLiftButton) {
+ int parentId = _currentScene->_sceneId;
+ int buttonId = lift_getButtonIdN(_lastLiftButton->_statics->_staticsId);
+
+ if (!buttonId)
+ return;
+
+ int numItems = _gameLoader->_preloadItems.size();
+
+ for (int i = 0; i < numItems; i++) {
+ PreloadItem *pre = _gameLoader->_preloadItems[i];
+
+ if (pre->preloadId2 == buttonId && pre->preloadId1 == _currentScene->_sceneId) {
+ MessageQueue *mq = new MessageQueue(_globalMessageQueueList->compact());
+
+ ExCommand *ex = new ExCommand(ANI_MAN, 1, (pre->keyCode != LiftDown ? MV_MAN_LIFTDOWN : MV_MAN_LIFTUP), 0, 0, 0, 1, 0, 0, 0);
+
+ ex->_keyCode = -1;
+ ex->_field_24 = 1;
+ ex->_excFlags |= 2;
+
+ mq->addExCommandToEnd(ex);
+
+ ex = new ExCommand(parentId, 17, 61, 0, 0, 0, 1, 0, 0, 0);
+
+ ex->_keyCode = buttonId;
+ ex->_excFlags |= 3;
+
+ mq->addExCommandToEnd(ex);
+
+ _aniMan->_flags &= 0xFEFF;
+
+ if (!mq->chain(_aniMan))
+ delete mq;
+
+ _aniMan->_flags |= 1;
+ }
+ }
+ }
+
+ lift_exitSeq(0);
+
+ if (_lastLiftButton) {
+ _lastLiftButton->_statics = _lastLiftButton->getStaticsById(lift_getButtonIdN(_lastLiftButton->_statics->_staticsId));
+ _lastLiftButton = 0;
+ }
}
void FullpipeEngine::lift_sub1(StaticANIObject *ani) {