summaryrefslogtreecommitdiff
path: root/src/guichan/color.cpp
diff options
context:
space:
mode:
authorReid <reidyaro@gmail.com>2012-03-01 22:03:01 +0100
committerReid <reidyaro@gmail.com>2012-03-01 22:03:01 +0100
commit490862919d79369112c75955a9c36ff8a081efd3 (patch)
tree6fe89466b9c53ba811f298174e6d787bbae71e09 /src/guichan/color.cpp
parentdff814619d63496acd3c4e8730b828b5d4d931fb (diff)
parentd873da3e8e57480016596f714845c1bc7e712e68 (diff)
downloadmv-490862919d79369112c75955a9c36ff8a081efd3.tar.gz
mv-490862919d79369112c75955a9c36ff8a081efd3.tar.bz2
mv-490862919d79369112c75955a9c36ff8a081efd3.tar.xz
mv-490862919d79369112c75955a9c36ff8a081efd3.zip
Merge branch 'master' of gitorious.org:manaplus/manaplus
Diffstat (limited to 'src/guichan/color.cpp')
-rw-r--r--src/guichan/color.cpp18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/guichan/color.cpp b/src/guichan/color.cpp
index d3dc7a738..f58e7b58e 100644
--- a/src/guichan/color.cpp
+++ b/src/guichan/color.cpp
@@ -97,23 +97,23 @@ namespace gcn
b - color.b,
255);
- result.r = (result.r>255?255:(result.r<0?0:result.r));
- result.g = (result.g>255?255:(result.g<0?0:result.g));
- result.b = (result.b>255?255:(result.b<0?0:result.b));
+ result.r = (result.r > 255 ? 255 : (result.r < 0 ? 0 : result.r));
+ result.g = (result.g > 255 ? 255 : (result.g < 0 ? 0 : result.g));
+ result.b = (result.b > 255 ? 255 : (result.b < 0 ? 0 : result.b));
return result;
}
Color Color::operator*(float value) const
{
- Color result((int)(r * value),
- (int)(g * value),
- (int)(b * value),
+ Color result(static_cast<int>(r * value),
+ static_cast<int>(g * value),
+ static_cast<int>(b * value),
a);
- result.r = (result.r>255?255:(result.r<0?0:result.r));
- result.g = (result.g>255?255:(result.g<0?0:result.g));
- result.b = (result.b>255?255:(result.b<0?0:result.b));
+ result.r = (result.r > 255 ? 255 : (result.r < 0 ? 0 : result.r));
+ result.g = (result.g > 255 ? 255 : (result.g < 0 ? 0 : result.g));
+ result.b = (result.b > 255 ? 255 : (result.b < 0 ? 0 : result.b));
return result;
}