From 05af5dfe21f59c16f6a76c12448b85d69a936314 Mon Sep 17 00:00:00 2001 From: fgenesis Date: Mon, 14 May 2012 15:48:01 +0200 Subject: [PATCH] Replace magic animlayer numbers with an enum (cosmetical change only) --- Aquaria/Avatar.cpp | 15 +++++---------- Aquaria/Avatar.h | 10 ++++++++++ 2 files changed, 15 insertions(+), 10 deletions(-) diff --git a/Aquaria/Avatar.cpp b/Aquaria/Avatar.cpp index afdb7ee..c2d43f5 100644 --- a/Aquaria/Avatar.cpp +++ b/Aquaria/Avatar.cpp @@ -44,8 +44,6 @@ bool lastJumpOutFromWaterBubble = false; bool useSpiritDistance = true; bool inSpiritWorld = false; -const int LAYER_FLOURISH = 3; - const float MULT_DMG_CRABCOSTUME = 0.75; const float MULT_DMG_FISHFORM = 1.5; const float MULT_DMG_SEAHORSEARMOR = 0.6; @@ -134,9 +132,6 @@ bool _isUnderWater; //HRECORD avatarRecord = 0; -#define ANIMLAYER_OVERRIDE 4 -#define ANIMLAYER_UPPERBODYIDLE 6 -#define ANIMLAYER_HEADOVERRIDE 7 Vector Target::getWorldPosition() { @@ -843,7 +838,7 @@ void Avatar::startFlourish() flourishTimer.start(fanim->getAnimationLength()-0.2f); flourishPowerTimer.start(fanim->getAnimationLength()*0.5f); } - skeletalSprite.transitionAnimate(anim, 0.1, 0, LAYER_FLOURISH); + skeletalSprite.transitionAnimate(anim, 0.1, 0, ANIMLAYER_FLOURISH); flourish = true; float rotz = rotationOffset.z; @@ -2688,7 +2683,7 @@ bool Avatar::fireAtNearestValidEntity(const std::string &shot) - skeletalSprite.transitionAnimate("fireBlast", 0.1, 0, 5); + skeletalSprite.transitionAnimate("fireBlast", 0.1, 0, ANIMLAYER_ARMOVERRIDE); s->position = p; //s->damageType = dt; /* @@ -2918,7 +2913,7 @@ void Avatar::formAbility(int ability) else doShock("EnergyTendril"); if (!state.lockedToWall) - skeletalSprite.animate("energyChargeAttack", 0, 6); + skeletalSprite.animate("energyChargeAttack", 0, ANIMLAYER_UPPERBODYIDLE); /* if (core->afterEffectManager) @@ -3311,7 +3306,7 @@ void Avatar::doShock(const std::string &shotName) int thits = getNumShots(); /* - if (skeletalSprite.getAnimationLayer(LAYER_FLOURISH)->getCurrentAnimation()) + if (skeletalSprite.getAnimationLayer(ANIMLAYER_FLOURISH)->getCurrentAnimation()) { thits = maxTendrilHits; } @@ -8889,7 +8884,7 @@ void Avatar::onUpdate(float dt) std::ostringstream os; os << "swimExtra-" << anim; - skeletalSprite.transitionAnimate(os.str(), 0.5, 0, 6); + skeletalSprite.transitionAnimate(os.str(), 0.5, 0, ANIMLAYER_UPPERBODYIDLE); } } } diff --git a/Aquaria/Avatar.h b/Aquaria/Avatar.h index a77f7f8..fbd1448 100644 --- a/Aquaria/Avatar.h +++ b/Aquaria/Avatar.h @@ -59,6 +59,16 @@ enum EnableInputType AVATARINPUT_MAX }; +enum AvatarAnimLayers +{ + ANIMLAYER_FLOURISH = 3, + ANIMLAYER_OVERRIDE = 4, + ANIMLAYER_ARMOVERRIDE = 5, + ANIMLAYER_UPPERBODYIDLE = 6, + ANIMLAYER_HEADOVERRIDE = 7, + ANIMLAYER_MAX +}; + class SongIconParticle : public Quad { public: