diff --git a/Aquaria/Avatar.cpp b/Aquaria/Avatar.cpp index 68de83f..4f3d653 100644 --- a/Aquaria/Avatar.cpp +++ b/Aquaria/Avatar.cpp @@ -4738,29 +4738,6 @@ void Avatar::setHeadTexture(const std::string &name, float time) } } -void Avatar::chargeVisualEffect(const std::string &tex) -{ - float time = 0.4f; - Quad *chargeEffect = new Quad; - chargeEffect->setBlendType(BLEND_ADD); - chargeEffect->alpha.ensureData(); - chargeEffect->alpha.data->path.addPathNode(0, 0); - chargeEffect->alpha.data->path.addPathNode(0.6f, 0.1f); - chargeEffect->alpha.data->path.addPathNode(0.6f, 0.9f); - chargeEffect->alpha.data->path.addPathNode(0, 1); - chargeEffect->alpha.startPath(time); - chargeEffect->setTexture(tex); - //chargeEffect->positionSnapTo = &this->position; - chargeEffect->position = this->position; - chargeEffect->setPositionSnapTo(&position); - chargeEffect->setLife(1); - chargeEffect->setDecayRate(1.0f/time); - chargeEffect->scale = Vector(0.1f, 0.1f); - chargeEffect->scale.interpolateTo(Vector(1,1),time); - //chargeEffect->rotation.interpolateTo(Vector(0,0,360), time); - dsq->game->addRenderObject(chargeEffect, LR_PARTICLES); -} - void Avatar::updateFormVisualEffects(float dt) { switch (dsq->continuity.form) @@ -5928,7 +5905,6 @@ void Avatar::onUpdate(float dt) chargingEmitter->load("ChargingEnergy2"); - //chargeVisualEffect("particles/energy-charge-2"); } } break; diff --git a/Aquaria/Avatar.h b/Aquaria/Avatar.h index 1321bc8..2617bd8 100644 --- a/Aquaria/Avatar.h +++ b/Aquaria/Avatar.h @@ -218,7 +218,6 @@ public: float headTextureTimer; void updateDamageVisualEffects(); int chargeLevelAttained; - void chargeVisualEffect(const std::string &tex); void updateFormVisualEffects(float dt); bool isSinging(); bool isLockable(); diff --git a/Aquaria/DSQ.cpp b/Aquaria/DSQ.cpp index d68803a..491e317 100644 --- a/Aquaria/DSQ.cpp +++ b/Aquaria/DSQ.cpp @@ -3992,14 +3992,11 @@ void DSQ::playVisualEffect(int vfx, Vector position, Entity *target) { case VFX_SHOCK: { - - - core->sound->playSfx("ShockWave"); float t =1.0; - Quad *q = new Quad; + PauseQuad *q = new PauseQuad; q->position = position; q->scale = Vector(0,0); q->scale.interpolateTo(Vector(5,5),t); @@ -4013,7 +4010,7 @@ void DSQ::playVisualEffect(int vfx, Vector position, Entity *target) q->setBlendType(RenderObject::BLEND_ADD); q->setTexture("particles/EnergyRing"); if (target) - q->positionSnapTo = &target->position; + q->setPositionSnapTo(&target->position); game->addRenderObject(q, LR_PARTICLES); @@ -4023,7 +4020,7 @@ void DSQ::playVisualEffect(int vfx, Vector position, Entity *target) t = 0.75f; { - Quad *q = new Quad; + PauseQuad *q = new PauseQuad; q->position = position; q->scale = Vector(0.5,0.5); q->scale.interpolateTo(Vector(2,2),t); @@ -4036,7 +4033,7 @@ void DSQ::playVisualEffect(int vfx, Vector position, Entity *target) q->setBlendType(RenderObject::BLEND_ADD); q->setTexture("particles/EnergyPart"); if (target) - q->positionSnapTo = &target->position; + q->setPositionSnapTo(&target->position); q->rotation.z = rand()%360; game->addRenderObject(q, LR_PARTICLES); } diff --git a/BBGE/Quad.cpp b/BBGE/Quad.cpp index 69ba0e6..59f798c 100644 --- a/BBGE/Quad.cpp +++ b/BBGE/Quad.cpp @@ -622,16 +622,23 @@ void Quad::onSetTexture() } } -PauseQuad::PauseQuad() : Quad(), pauseLevel(0) +PauseQuad::PauseQuad() : Quad(), pauseLevel(0), positionSnapTo(0) { addType(SCO_PAUSEQUAD); } void PauseQuad::onUpdate(float dt) { + if (positionSnapTo) + this->position = *positionSnapTo; + if (core->particlesPaused <= pauseLevel) { Quad::onUpdate(dt); } } +void PauseQuad::setPositionSnapTo(InterpolatedVector *positionSnapTo) +{ + this->positionSnapTo = positionSnapTo; +} diff --git a/BBGE/Quad.h b/BBGE/Quad.h index c5844b2..f05c53a 100644 --- a/BBGE/Quad.h +++ b/BBGE/Quad.h @@ -128,7 +128,10 @@ class PauseQuad : public Quad public: PauseQuad(); int pauseLevel; + + void setPositionSnapTo(InterpolatedVector *positionSnapTo); protected: + InterpolatedVector *positionSnapTo; void onUpdate(float dt); }; diff --git a/BBGE/RenderObject.cpp b/BBGE/RenderObject.cpp index 9110b16..b8cff8b 100644 --- a/BBGE/RenderObject.cpp +++ b/BBGE/RenderObject.cpp @@ -151,9 +151,6 @@ RenderObject::RenderObject() pm = PM_NONE; - positionSnapTo = 0; - - blendEnabled = true; texture = 0; width = 0; @@ -576,12 +573,6 @@ void RenderObject::render() void RenderObject::renderCall() { - - - - if (positionSnapTo) - this->position = *positionSnapTo; - position += offset; @@ -1095,11 +1086,6 @@ StateData *RenderObject::getStateData() return stateData; } -void RenderObject::setPositionSnapTo(InterpolatedVector *positionSnapTo) -{ - this->positionSnapTo = positionSnapTo; -} - void RenderObject::setOverrideCullRadius(float ovr) { overrideCullRadiusSqr = ovr * ovr; diff --git a/BBGE/RenderObject.h b/BBGE/RenderObject.h index 49d1b05..29c4e3b 100644 --- a/BBGE/RenderObject.h +++ b/BBGE/RenderObject.h @@ -167,8 +167,6 @@ public: StateData *getStateData(); - void setPositionSnapTo(InterpolatedVector *positionSnapTo); - // HACK: This is defined in RenderObject_inline.h because it needs // the class Core definition. --achurch inline bool isOnScreen(); @@ -258,8 +256,6 @@ public: float updateCull; int layer; - InterpolatedVector *positionSnapTo; - typedef std::vector Children; Children children, childGarbage;