From 5410d1613e6f0c8a8b91fffea18387c39bd5f9f5 Mon Sep 17 00:00:00 2001 From: Yohann Ferreira Date: Sun, 27 Feb 2005 01:06:17 +0000 Subject: Little setColor Optimization. --- src/gui/progressbar.cpp | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'src/gui/progressbar.cpp') 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); + } } -- cgit v1.2.3-70-g09d2