diff options
author | Andrei Karas <akaras@inbox.ru> | 2016-01-13 00:29:08 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2016-01-13 00:29:08 +0300 |
commit | 99208e8f8aba695a6fb0e4ed9f5c51108dd539f4 (patch) | |
tree | aa4bbc7dcb656259e94daf907d339d264f1bcaa0 /src/resources/db/palettedb.cpp | |
parent | 1cde3ae4001db3e9bd1d233c64b299a65d55b8b4 (diff) | |
download | plus-99208e8f8aba695a6fb0e4ed9f5c51108dd539f4.tar.gz plus-99208e8f8aba695a6fb0e4ed9f5c51108dd539f4.tar.bz2 plus-99208e8f8aba695a6fb0e4ed9f5c51108dd539f4.tar.xz plus-99208e8f8aba695a6fb0e4ed9f5c51108dd539f4.zip |
Add support for hex colors in dye palettes from GIMP file.
Diffstat (limited to 'src/resources/db/palettedb.cpp')
-rw-r--r-- | src/resources/db/palettedb.cpp | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/resources/db/palettedb.cpp b/src/resources/db/palettedb.cpp index 4da058d2a..a3caf62dc 100644 --- a/src/resources/db/palettedb.cpp +++ b/src/resources/db/palettedb.cpp @@ -34,7 +34,6 @@ namespace { bool mLoaded = false; std::map<std::string, DyeColor> mColors; - DyeColor mEmpty(0, 0, 0, 0); } void PaletteDB::load() @@ -113,11 +112,11 @@ void PaletteDB::unload() mColors.clear(); } -const DyeColor &PaletteDB::getColor(const std::string &name) +const DyeColor *PaletteDB::getColor(const std::string &name) { std::map<std::string, DyeColor>::const_iterator it = mColors.find(name); if (it != mColors.end()) - return (*it).second; + return &(*it).second; else - return mEmpty; + return nullptr; } |