diff options
Diffstat (limited to 'src/resources/dye.cpp')
-rw-r--r-- | src/resources/dye.cpp | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/src/resources/dye.cpp b/src/resources/dye.cpp index 50972c6d6..78ad8137a 100644 --- a/src/resources/dye.cpp +++ b/src/resources/dye.cpp @@ -228,6 +228,29 @@ void DyePalette::replaceColor(Uint8 *color) const } } +void DyePalette::replaceOGLColor(Uint8 *color) const +{ + std::vector<Color>::const_iterator it = mColors.begin(); + std::vector<Color>::const_iterator it_end = mColors.end(); + while (it != it_end) + { + const Color &col = *it; + ++ it; + if (it == it_end) + return; + const Color &col2 = *it; + if (color[2] == col.value[0] && color[1] == col.value[1] + && color[0] == col.value[2]) + { + color[0] = col2.value[0]; + color[1] = col2.value[1]; + color[2] = col2.value[2]; + return; + } + ++ it; + } +} + Dye::Dye(const std::string &description) { for (int i = 0; i < dyePalateSize; ++i) |