From 3fae3f59aad1f1f2eee1e1bfa088672787bc9c78 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Sat, 5 Mar 2016 17:29:03 +0300 Subject: Move getNumOfHairstyles from being to itemdb. --- src/being/being.cpp | 24 ------------------------ src/being/being.h | 11 ----------- 2 files changed, 35 deletions(-) (limited to 'src/being') diff --git a/src/being/being.cpp b/src/being/being.cpp index a0add020e..49fb6a480 100644 --- a/src/being/being.cpp +++ b/src/being/being.cpp @@ -103,9 +103,6 @@ const unsigned int CACHE_SIZE = 50; -int Being::mNumberOfHairstyles = 1; -int Being::mNumberOfRaces = 1; - int Being::mUpdateConfigTime = 0; unsigned int Being::mConfLineLim = 0; int Being::mSpeechType = 0; @@ -2625,27 +2622,6 @@ void Being::dumpSprites() const restrict2 } } -void Being::load() -{ - // Hairstyles are encoded as negative numbers. Count how far negative - // we can go. - int hairstyles = 1; - while (ItemDB::get(-hairstyles).getSprite(Gender::MALE, - BeingTypeId_zero) != paths.getStringValue("spriteErrorFile")) - { - hairstyles ++; - } - mNumberOfHairstyles = hairstyles; - - int races = 100; - while (ItemDB::get(-races).getSprite(Gender::MALE, BeingTypeId_zero) != - paths.getStringValue("spriteErrorFile")) - { - races ++; - } - mNumberOfRaces = races - 100; -} - void Being::updateName() restrict2 { if (mShowName) diff --git a/src/being/being.h b/src/being/being.h index afcc61839..1fd7aa0ba 100644 --- a/src/being/being.h +++ b/src/being/being.h @@ -326,12 +326,6 @@ class Being notfinal : public ActorSprite, void setSpriteColor(const unsigned int slot, const std::string &restrict color = "") restrict2; - /** - * Get the number of hairstyles implemented - */ - static int getNumOfHairstyles() noexcept A_WARN_UNUSED - { return mNumberOfHairstyles; } - /** * Get the number of layers used to draw the being */ @@ -548,8 +542,6 @@ class Being notfinal : public ActorSprite, const int width, const int height) const restrict2 A_NONNULL(2); - static void load(); - void optionChanged(const std::string &restrict value) restrict2 override; @@ -1029,9 +1021,6 @@ class Being notfinal : public ActorSprite, /** Engine-related infos about weapon. */ const ItemInfo *restrict mEquippedWeapon; - static int mNumberOfHairstyles; /** Number of hair styles in use */ - static int mNumberOfRaces; /** Number of races in use */ - Path mPath; Text *restrict mText; const Color *restrict mTextColor; -- cgit v1.2.3-60-g2f50