summaryrefslogtreecommitdiff
path: root/src/being.h
diff options
context:
space:
mode:
authorIra Rice <irarice@gmail.com>2009-02-10 12:26:57 -0700
committerIra Rice <irarice@gmail.com>2009-02-10 12:26:57 -0700
commit02e60b55b359002ae1f26f36b40f8fa78ea1a708 (patch)
tree0264392528cf174e2275bb79a84472b77c5245d2 /src/being.h
parenta8a992ade40c9d68c9faec1cc3a54e7f064fb9d5 (diff)
downloadmana-client-02e60b55b359002ae1f26f36b40f8fa78ea1a708.tar.gz
mana-client-02e60b55b359002ae1f26f36b40f8fa78ea1a708.tar.bz2
mana-client-02e60b55b359002ae1f26f36b40f8fa78ea1a708.tar.xz
mana-client-02e60b55b359002ae1f26f36b40f8fa78ea1a708.zip
Simplified target drawing so that it actually uses the SimpleAnimation
that it creates when initializing the target cursors in the first place. This behavior was carried over in the first place from the Viewport class. Also moved target drawing responsibility from the map to the being being targeted in the first place. This allows for assuring that targets are always drawn below the sprite being targeted (which the previous solution was designed to do, but didn't do correctly). Signed-off-by: Ira Rice <irarice@gmail.com>
Diffstat (limited to 'src/being.h')
-rw-r--r--src/being.h18
1 files changed, 14 insertions, 4 deletions
diff --git a/src/being.h b/src/being.h
index dcbd3553..ef02eeb2 100644
--- a/src/being.h
+++ b/src/being.h
@@ -50,6 +50,7 @@ class Map;
class Graphics;
class Particle;
class Position;
+class SimpleAnimation;
class SpeechBubble;
class Text;
@@ -112,7 +113,6 @@ class Being : public Sprite
NUM_TC
};
-
/**
* Directions, to be used as bitmask values
*/
@@ -359,6 +359,16 @@ class Being : public Sprite
*/
void controlParticle(Particle *particle);
+ /**
+ * Sets the target animation for this being.
+ */
+ void setTargetAnimation(SimpleAnimation* animation);
+
+ /**
+ * Untargets the being
+ */
+ void untarget() { mUsedTargetCursor = NULL; }
+
AnimatedSprite* getEmote(int index) { return emotionSet[index]; }
void setEmote(Uint8 emotion, Uint8 emote_time)
@@ -367,9 +377,6 @@ class Being : public Sprite
mEmotionTime = emote_time;
}
- // Target cursor being used by the being
- Image *mTargetCursor;
-
static int getHairColorsNr(void);
static int getHairStylesNr(void);
@@ -444,6 +451,9 @@ class Being : public Sprite
// Speech Bubble components
SpeechBubble *mSpeechBubble;
+ // Target cursor being used
+ SimpleAnimation* mUsedTargetCursor;
+
static int instances; /**< Number of Being instances */
static std::vector<AnimatedSprite*> emotionSet; /**< Emoticons used by beings */
};