From e2d60401eaf55abe9e2251854f3174ffe0f4ad9e Mon Sep 17 00:00:00 2001 From: Jared Adams Date: Thu, 12 Mar 2009 06:44:16 -0600 Subject: Move emote sprite loading into EmoteDB --- src/being.cpp | 25 ++----------------------- 1 file changed, 2 insertions(+), 23 deletions(-) (limited to 'src/being.cpp') 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 Being::hairColors; -std::vector 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 -- cgit v1.2.3-70-g09d2