diff options
author | Eugene Sandulenko | 2014-01-03 23:25:37 +0200 |
---|---|---|
committer | Eugene Sandulenko | 2014-01-03 23:25:37 +0200 |
commit | 5d18c50168b24607ee24777692d3c7a7fb4156ea (patch) | |
tree | e0864963a5bdca312cb017e39d6846c27bb5ce98 | |
parent | b87d052d01adde493bc1af3c1b68c07a1623582b (diff) | |
download | scummvm-rg350-5d18c50168b24607ee24777692d3c7a7fb4156ea.tar.gz scummvm-rg350-5d18c50168b24607ee24777692d3c7a7fb4156ea.tar.bz2 scummvm-rg350-5d18c50168b24607ee24777692d3c7a7fb4156ea.zip |
FULLPIPE: Implement Floaters::init()
-rw-r--r-- | engines/fullpipe/floaters.cpp | 57 | ||||
-rw-r--r-- | engines/fullpipe/floaters.h | 5 | ||||
-rw-r--r-- | engines/fullpipe/motion.h | 1 |
3 files changed, 61 insertions, 2 deletions
diff --git a/engines/fullpipe/floaters.cpp b/engines/fullpipe/floaters.cpp index 384bfa2150..7e807ad1a5 100644 --- a/engines/fullpipe/floaters.cpp +++ b/engines/fullpipe/floaters.cpp @@ -22,11 +22,66 @@ #include "fullpipe/fullpipe.h" #include "fullpipe/floaters.h" +#include "fullpipe/utils.h" +#include "fullpipe/objects.h" +#include "fullpipe/motion.h" +#include "fullpipe/objectnames.h" namespace Fullpipe { +Floaters::~Floaters() { + delete _hRgn; +} + void Floaters::init(GameVar *var) { - warning("STUB: Floaters::init()"); + _array1.clear(); + _array2.clear(); + + GameVar *varFliers = var->getSubVarByName(sO_Fliers); + + if (!varFliers) + return; + + GameVar *sub = varFliers->getSubVarByName("flyIdleRegion"); + + if (sub) { + _hRgn = new ReactPolygonal(); + + _hRgn->_pointCount = sub->getSubVarsCount(); + _hRgn->_points = (Common::Point **)malloc(sizeof(Common::Point *) * _hRgn->_pointCount); + + sub = sub->_subVars; + + int idx = 0; + + while (sub) { + _hRgn->_points[idx] = new Common::Point; + _hRgn->_points[idx]->x = sub->_subVars->_value.intValue; + _hRgn->_points[idx]->y = sub->_subVars->_nextVarObj->_value.intValue; + + idx++; + sub = sub->_nextVarObj; + } + } + + sub = varFliers->getSubVarByName("flyIdlePath"); + + if (sub) { + _array1.reserve(sub->getSubVarsCount()); + + sub = sub->_subVars; + + int idx = 0; + + while (sub) { + _array1[idx]->val1 = sub->_subVars->_value.intValue; + _array1[idx]->val2 = sub->_subVars->_nextVarObj->_value.intValue; + + idx++; + sub = sub->_nextVarObj; + } + + } } void Floaters::genFlies(Scene *sc, int x, int y, int a5, int a6) { diff --git a/engines/fullpipe/floaters.h b/engines/fullpipe/floaters.h index a4d64dd79d..6611f4005c 100644 --- a/engines/fullpipe/floaters.h +++ b/engines/fullpipe/floaters.h @@ -27,6 +27,7 @@ namespace Fullpipe { class StaticANIObject; class Scene; +class ReactPolygonal; struct FloaterArray1 { int val1; @@ -52,10 +53,12 @@ struct FloaterArray2 { class Floaters { public: - //HRGN hRgn; + ReactPolygonal *_hRgn; Common::Array<FloaterArray1 *> _array1; Common::Array<FloaterArray2 *> _array2; + Floaters() { _hRgn = 0; } + ~Floaters(); void init(GameVar *var); void genFlies(Scene *sc, int x, int y, int a5, int a6); void update(); diff --git a/engines/fullpipe/motion.h b/engines/fullpipe/motion.h index 1c8f17e13c..6ca24a303f 100644 --- a/engines/fullpipe/motion.h +++ b/engines/fullpipe/motion.h @@ -29,6 +29,7 @@ class Statics; class Movement; class MctlConnectionPoint; class MovGraphLink; +class MessageQueue; int startWalkTo(int objId, int objKey, int x, int y, int a5); int doSomeAnimation(int objId, int objKey, int a3); |