diff options
author | Jared Adams <jaxad0127@gmail.com> | 2010-03-20 19:01:02 -0600 |
---|---|---|
committer | Jared Adams <jaxad0127@gmail.com> | 2010-03-21 20:49:11 -0600 |
commit | fa058a891352ab4f85bafbf4e819c013ddfe4df7 (patch) | |
tree | e171acfceab0135a2b811338448681ad0408200c /src/resources/dye.h | |
parent | a8273ca217ee08f718e6acb3786f3197dff7915c (diff) | |
download | mana-fa058a891352ab4f85bafbf4e819c013ddfe4df7.tar.gz mana-fa058a891352ab4f85bafbf4e819c013ddfe4df7.tar.bz2 mana-fa058a891352ab4f85bafbf4e819c013ddfe4df7.tar.xz mana-fa058a891352ab4f85bafbf4e819c013ddfe4df7.zip |
Make the Dye class more flexible and fix an issue in it
After the last change, it could go over the end of the colors array.
Reviewed-by: Chuck Miller
Reviewed-by: Freeyorp
Diffstat (limited to 'src/resources/dye.h')
-rw-r--r-- | src/resources/dye.h | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/resources/dye.h b/src/resources/dye.h index 51d5d65c..e05f2d5e 100644 --- a/src/resources/dye.h +++ b/src/resources/dye.h @@ -44,10 +44,16 @@ class DyePalette void addLastColor(const int color[3]); /** - * Gets a pixel color depending on its intensity. + * Gets a pixel color depending on its intensity. First color is + * implicitly black (0, 0, 0). */ void getColor(int intensity, int color[3]) const; + /** + * Gets a pixel color depending on its intensity. + */ + void getColor(double intensity, int color[3]) const; + private: struct Color { unsigned char value[3]; }; |