aboutsummaryrefslogtreecommitdiff
path: root/engines/fullpipe/lift.cpp
diff options
context:
space:
mode:
authorEugene Sandulenko2014-01-26 16:52:33 +0200
committerEugene Sandulenko2014-01-26 16:53:08 +0200
commitb2438f8d013ff75bab2d55d7d868fe53441a115e (patch)
treecab4591d11ebc6f075ef0f6bb17c17941b63a21e /engines/fullpipe/lift.cpp
parent05ab84924776d49ffee786a21e98cd95fd096e06 (diff)
downloadscummvm-rg350-b2438f8d013ff75bab2d55d7d868fe53441a115e.tar.gz
scummvm-rg350-b2438f8d013ff75bab2d55d7d868fe53441a115e.tar.bz2
scummvm-rg350-b2438f8d013ff75bab2d55d7d868fe53441a115e.zip
FULLPIPE: Implement lift_init()
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 81d7d2dc1c..4a5b124d02 100644
--- a/engines/fullpipe/lift.cpp
+++ b/engines/fullpipe/lift.cpp
@@ -25,8 +25,10 @@
#include "fullpipe/objects.h"
#include "fullpipe/objectnames.h"
#include "fullpipe/constants.h"
+
#include "fullpipe/scene.h"
#include "fullpipe/statics.h"
+#include "fullpipe/messages.h"
namespace Fullpipe {
@@ -168,8 +170,51 @@ void FullpipeEngine::lift_setButton(const char *name, int state) {
var->setSubVarAsInt(name, state);
}
-void FullpipeEngine::lift_sub5(Scene *sc, int qu1, int qu2) {
- warning("STUB: FullpipeEngine::lift_sub5()");
+void FullpipeEngine::lift_init(Scene *sc, int enterSeq, int exitSeq) {
+ _lastLiftButton = 0;
+
+ _liftEnterMQ = sc->getMessageQueueById(enterSeq);
+ if (!_liftEnterMQ)
+ return;
+
+ _liftExitMQ = sc->getMessageQueueById(exitSeq);
+
+ if (!_liftExitMQ)
+ return;
+
+ ExCommand *ex = _liftEnterMQ->getExCommandByIndex(0);
+
+ if (!ex)
+ return;
+
+ _liftX = ex->_x;
+ _liftY = ex->_y;
+
+ _lift = sc->getStaticANIObject1ById(ANI_LIFT, -1);
+
+ for (uint i = 0; i < sc->_staticANIObjectList1.size(); i++) {
+ StaticANIObject *ani = (StaticANIObject *)sc->_staticANIObjectList1[i];
+
+ if (ani->_id == ANI_LIFTBUTTON)
+ ani->_statics = ani->getStaticsById(lift_getButtonIdP(ani->_statics->_staticsId));
+ }
+
+ GameVar *var = getGameLoaderGameVar()->getSubVarByName("OBJSTATES")->getSubVarByName(sO_LiftButtons);
+ if (var) {
+ for (var = var->_subVars; var; var = var->_nextVarObj) {
+ for (uint i = 0; i < sc->_staticANIObjectList1.size(); i++) {
+ StaticANIObject *ani = (StaticANIObject *)sc->_staticANIObjectList1[i];
+
+ if (ani->_id == ANI_LIFTBUTTON) {
+ int id = lift_getButtonIdN(ani->_statics->_staticsId);
+
+ if (id == var->_value.intValue)
+ ani->_statics = ani->getStaticsById(id);
+ }
+
+ }
+ }
+ }
}
void FullpipeEngine::lift_exitSeq(ExCommand *ex) {