diff options
author | Yohann Ferreira <bertram@cegetel.net> | 2005-02-27 01:06:17 +0000 |
---|---|---|
committer | Yohann Ferreira <bertram@cegetel.net> | 2005-02-27 01:06:17 +0000 |
commit | 5410d1613e6f0c8a8b91fffea18387c39bd5f9f5 (patch) | |
tree | 658cce1b5aa4d2158758fa40655e82854bc2512b /src/gui/progressbar.cpp | |
parent | e7af59e38e0b66db5adc4b40d213066b52cb47f2 (diff) | |
download | mana-5410d1613e6f0c8a8b91fffea18387c39bd5f9f5.tar.gz mana-5410d1613e6f0c8a8b91fffea18387c39bd5f9f5.tar.bz2 mana-5410d1613e6f0c8a8b91fffea18387c39bd5f9f5.tar.xz mana-5410d1613e6f0c8a8b91fffea18387c39bd5f9f5.zip |
Little setColor Optimization.
Diffstat (limited to 'src/gui/progressbar.cpp')
-rw-r--r-- | src/gui/progressbar.cpp | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/src/gui/progressbar.cpp b/src/gui/progressbar.cpp index 211f2fc5..aa396a70 100644 --- a/src/gui/progressbar.cpp +++ b/src/gui/progressbar.cpp @@ -117,7 +117,14 @@ float ProgressBar::getProgress() void ProgressBar::setColor(unsigned char MyRed, unsigned char MyGreen, unsigned char MyBlue) { - Red = MyRed; Green = MyGreen; Blue = MyBlue; - colorBar->fillWithColor(Red, Green, Blue); - colorBar->setAlpha(0.7f); + if ( (Red == MyRed) && (Green == MyGreen) && (Blue == MyBlue) ) + { + // Nothing + } + else + { + Red = MyRed; Green = MyGreen; Blue = MyBlue; + colorBar->fillWithColor(Red, Green, Blue); + colorBar->setAlpha(0.7f); + } } |