FULLPIPE: Implement Floaters::genFlies()

This commit is contained in:
Eugene Sandulenko 2014-01-03 23:58:31 +02:00
parent 5d18c50168
commit ac0e6749ba
3 changed files with 47 additions and 3 deletions

View File

@ -25,6 +25,11 @@
namespace Fullpipe {
// Common
#define ANI_FLY 4916
#define MV_FLY_FLY 4917
#define ST_FLY_FLY 4918
#define ANI_BALLDROP 2685
#define ANI_BATUTA 737
#define ANI_BIGBALL 4923

View File

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

View File

@ -32,6 +32,8 @@ class ReactPolygonal;
struct FloaterArray1 {
int val1;
int val2;
FloaterArray1() { val1 = 0; val2 = 0; }
};
struct FloaterArray2 {
@ -49,6 +51,9 @@ struct FloaterArray2 {
int countdown;
int val15;
int fflags;
FloaterArray2() : ani(0), val2(0), val3(0), val4(0), val5(0), val6(0), val7(0), val8(0),
val9(0.0), val11(0.0), val13(0), countdown(0), val15(0), fflags(0) {}
};
class Floaters {
@ -60,7 +65,7 @@ public:
Floaters() { _hRgn = 0; }
~Floaters();
void init(GameVar *var);
void genFlies(Scene *sc, int x, int y, int a5, int a6);
void genFlies(Scene *sc, int x, int y, int priority, int flags);
void update();
void stopAll();
};