diff options
author | Andrei Karas <akaras@inbox.ru> | 2014-03-16 14:14:29 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2014-03-16 14:14:29 +0300 |
commit | 46087564d4184b28740b0c45c1bac199ab1942ec (patch) | |
tree | 0591b36aba2ae392eb569828930f030850cbc769 /src/gui/theme.h | |
parent | cf9b1182f06b1336f0d1071c267ea36c990430fa (diff) | |
download | ManaVerse-46087564d4184b28740b0c45c1bac199ab1942ec.tar.gz ManaVerse-46087564d4184b28740b0c45c1bac199ab1942ec.tar.bz2 ManaVerse-46087564d4184b28740b0c45c1bac199ab1942ec.tar.xz ManaVerse-46087564d4184b28740b0c45c1bac199ab1942ec.zip |
Improve theme usage.
Removed instance method.
Diffstat (limited to 'src/gui/theme.h')
-rw-r--r-- | src/gui/theme.h | 20 |
1 files changed, 9 insertions, 11 deletions
diff --git a/src/gui/theme.h b/src/gui/theme.h index 86543ea64..5f902e206 100644 --- a/src/gui/theme.h +++ b/src/gui/theme.h @@ -40,9 +40,12 @@ class DyePalette; class Image; class ImageSet; +class Theme; const int THEME_PALETTES = 5; +extern Theme *theme; + struct ThemeInfo final { ThemeInfo() : @@ -176,11 +179,11 @@ class Skin final class Theme final : public Palette, public ConfigListener { public: - A_DELETE_COPY(Theme) + Theme(); - static Theme *instance() A_WARN_UNUSED; + ~Theme(); - static void deleteInstance(); + A_DELETE_COPY(Theme) static void prepareThemePath(); @@ -453,15 +456,15 @@ class Theme final : public Palette, public ConfigListener inline static const Color &getThemeColor(const int type, const int alpha = 255) A_WARN_UNUSED - { return mInstance->getColor(type, alpha); } + { return theme->getColor(type, alpha); } static const Color &getThemeCharColor(const signed char c, bool &valid) A_WARN_UNUSED - { return mInstance->getCharColor(c, valid); } + { return theme->getCharColor(c, valid); } static int getThemeIdByChar(const signed char c, bool &valid) A_WARN_UNUSED - { return mInstance->getIdByChar(c, valid); } + { return theme->getIdByChar(c, valid); } static Color getProgressColor(const int type, const float progress) A_WARN_UNUSED; @@ -513,10 +516,6 @@ class Theme final : public Palette, public ConfigListener static ThemeInfo *loadInfo(const std::string &themeName) A_WARN_UNUSED; private: - Theme(); - - ~Theme(); - Skin *readSkin(const std::string &filename0, const bool full) A_WARN_UNUSED; @@ -529,7 +528,6 @@ class Theme final : public Palette, public ConfigListener static std::string mThemePath; static std::string mThemeName; static std::string mScreenDensity; - static Theme *mInstance; static bool tryThemePath(const std::string &themePath) A_WARN_UNUSED; |