From ac0e6749ba0f87e95f5b510998b62caac7857d45 Mon Sep 17 00:00:00 2001 From: Eugene Sandulenko Date: Fri, 3 Jan 2014 23:58:31 +0200 Subject: FULLPIPE: Implement Floaters::genFlies() --- engines/fullpipe/floaters.cpp | 38 ++++++++++++++++++++++++++++++++++++-- 1 file changed, 36 insertions(+), 2 deletions(-) (limited to 'engines/fullpipe/floaters.cpp') diff --git a/engines/fullpipe/floaters.cpp b/engines/fullpipe/floaters.cpp index 7e807ad1a5..9c4db80f01 100644 --- a/engines/fullpipe/floaters.cpp +++ b/engines/fullpipe/floaters.cpp @@ -25,6 +25,9 @@ #include "fullpipe/utils.h" #include "fullpipe/objects.h" #include "fullpipe/motion.h" +#include "fullpipe/statics.h" +#include "fullpipe/scene.h" +#include "fullpipe/constants.h" #include "fullpipe/objectnames.h" namespace Fullpipe { @@ -84,8 +87,39 @@ void Floaters::init(GameVar *var) { } } -void Floaters::genFlies(Scene *sc, int x, int y, int a5, int a6) { - warning("STUB: Floaters::genFlies()"); +void Floaters::genFlies(Scene *sc, int x, int y, int priority, int flags) { + StaticANIObject *ani = new StaticANIObject(g_fp->accessScene(SC_COMMON)->getStaticANIObject1ById(ANI_FLY, -1)); + + ani->_statics = ani->getStaticsById(ST_FLY_FLY); + ani->_movement = 0; + ani->setOXY(x, y); + ani->_flags |= 4; + ani->_priority = priority; + + sc->addStaticANIObject(ani, 1); + + ani->startAnim(MV_FLY_FLY, 0, -1); + + int nummoves; + + if (ani->_movement->_currMovement) + nummoves = ani->_movement->_currMovement->_dynamicPhases.size(); + else + nummoves = ani->_movement->_dynamicPhases.size(); + + ani->_movement->setDynamicPhaseIndex(g_fp->_rnd->getRandomNumber(nummoves)); + + FloaterArray2 *arr2 = new FloaterArray2; + + arr2->ani = ani; + arr2->val11 = 15.0; + arr2->val3 = y; + arr2->val5 = y; + arr2->val2 = x; + arr2->val4 = x; + arr2->fflags = flags; + + _array2.push_back(arr2); } void Floaters::update() { -- cgit v1.2.3