summaryrefslogtreecommitdiff
path: root/src/resources/db
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2016-01-13 00:29:08 +0300
committerAndrei Karas <akaras@inbox.ru>2016-01-13 00:29:08 +0300
commit99208e8f8aba695a6fb0e4ed9f5c51108dd539f4 (patch)
treeaa4bbc7dcb656259e94daf907d339d264f1bcaa0 /src/resources/db
parent1cde3ae4001db3e9bd1d233c64b299a65d55b8b4 (diff)
downloadplus-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')
-rw-r--r--src/resources/db/palettedb.cpp7
-rw-r--r--src/resources/db/palettedb.h2
2 files changed, 4 insertions, 5 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;
}
diff --git a/src/resources/db/palettedb.h b/src/resources/db/palettedb.h
index 6043d14b7..349f863f5 100644
--- a/src/resources/db/palettedb.h
+++ b/src/resources/db/palettedb.h
@@ -32,7 +32,7 @@ namespace PaletteDB
void load();
void unload();
void loadPalette();
- const DyeColor &getColor(const std::string &name);
+ const DyeColor *getColor(const std::string &name);
} // namespace PaletteDB