From 37b812f2892a9b11a88abcbcde0b47aca76f4a71 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 | 30 +----------------------------- 1 file changed, 1 insertion(+), 29 deletions(-) (limited to 'src/being.cpp') diff --git a/src/being.cpp b/src/being.cpp index d94d50d9..54908b07 100644 --- a/src/being.cpp +++ b/src/being.cpp @@ -52,10 +52,8 @@ #include "utils/dtor.h" #include "utils/gettext.h" #include "utils/stringutils.h" -#include "utils/xml.h" int Being::mNumberOfHairstyles = 1; -std::vector Being::emotionSet; static const int X_SPEECH_OFFSET = 18; static const int Y_SPEECH_OFFSET = 60; @@ -461,7 +459,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) @@ -580,29 +578,3 @@ void Being::setTargetAnimation(SimpleAnimation* animation) mUsedTargetCursor->reset(); } -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)); - } - - // Hairstyles are encoded as negative numbers. Count how far negative - // we can go. - int hairstyles = 1; - while (ItemDB::get(-hairstyles).getSprite(GENDER_MALE) != "error.xml") - { - hairstyles++; - } - mNumberOfHairstyles = hairstyles; -} - -void Being::cleanup() -{ - delete_all(emotionSet); -} -- cgit v1.2.3-60-g2f50