FULLPIPE: Implement Floaters::init()

This commit is contained in:
Eugene Sandulenko 2014-01-03 23:25:37 +02:00
parent b87d052d01
commit 5d18c50168
3 changed files with 61 additions and 2 deletions

View File

@ -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) {

View File

@ -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();

View File

@ -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);