summaryrefslogtreecommitdiff
path: root/src/being.cpp
diff options
context:
space:
mode:
authorJared Adams <jaxad0127@gmail.com>2009-03-12 06:44:16 -0600
committerJared Adams <jaxad0127@gmail.com>2009-03-12 06:44:16 -0600
commite2d60401eaf55abe9e2251854f3174ffe0f4ad9e (patch)
tree99be0ae61a6b4c97cafeb6458491f38cb7904d8a /src/being.cpp
parent2eb027b0f7a67706df68fe29e605c5be7fc1d5c9 (diff)
downloadmana-e2d60401eaf55abe9e2251854f3174ffe0f4ad9e.tar.gz
mana-e2d60401eaf55abe9e2251854f3174ffe0f4ad9e.tar.bz2
mana-e2d60401eaf55abe9e2251854f3174ffe0f4ad9e.tar.xz
mana-e2d60401eaf55abe9e2251854f3174ffe0f4ad9e.zip
Move emote sprite loading into EmoteDB
Diffstat (limited to 'src/being.cpp')
-rw-r--r--src/being.cpp25
1 files changed, 2 insertions, 23 deletions
diff --git a/src/being.cpp b/src/being.cpp
index bf49e852..60fb8d13 100644
--- a/src/being.cpp
+++ b/src/being.cpp
@@ -61,7 +61,6 @@
int Being::mNumberOfHairColors = 1;
int Being::mNumberOfHairstyles = 1;
std::vector<std::string> Being::hairColors;
-std::vector<AnimatedSprite*> Being::emotionSet;
static const int X_SPEECH_OFFSET = 18;
static const int Y_SPEECH_OFFSET = 60;
@@ -487,7 +486,7 @@ void Being::drawEmotion(Graphics *graphics, int offsetX, int offsetY)
const int emotionIndex = mEmotion - 1;
if (emotionIndex >= 0 && emotionIndex <= EmoteDB::getLast())
- emotionSet[emotionIndex]->draw(graphics, px, py);
+ EmoteDB::getAnimation(emotionIndex)->draw(graphics, px, py);
}
void Being::drawSpeech(int offsetX, int offsetY)
@@ -770,7 +769,7 @@ std::string Being::getHairColor(int index)
return hairColors[index];
}
-void Being::initializeHair()
+void Being::load()
{
// Hairstyles are encoded as negative numbers. Count how far negative
// we can go.
@@ -809,23 +808,3 @@ void Being::initializeHair()
}
}
}
-
-void Being::load()
-{
- // Setup emote sprites
- for (int i = 0; i <= EmoteDB::getLast(); i++)
- {
- EmoteInfo info = EmoteDB::get(i);
-
- std::string file = "graphics/sprites/" + info.sprites.front()->sprite;
- int variant = info.sprites.front()->variant;
- emotionSet.push_back(AnimatedSprite::load(file, variant));
- }
-
- initializeHair();
-}
-
-void Being::cleanup()
-{
- delete_all(emotionSet);
-} \ No newline at end of file