diff options
-rw-r--r-- | src/gui/progressbar.cpp | 19 | ||||
-rw-r--r-- | src/gui/progressbar.h | 5 | ||||
-rw-r--r-- | src/main.h | 1 |
3 files changed, 16 insertions, 9 deletions
diff --git a/src/gui/progressbar.cpp b/src/gui/progressbar.cpp index c8d0194a..25a3da01 100644 --- a/src/gui/progressbar.cpp +++ b/src/gui/progressbar.cpp @@ -59,6 +59,17 @@ ProgressBar::~ProgressBar() { } +void ProgressBar::logic() +{ + // Smoothly changing the color for a nicer effect. + if (redToGo > red) red++; + if (redToGo < red) red--; + if (greenToGo > green) green++; + if (greenToGo < green) green--; + if (blueToGo > blue) blue++; + if (blueToGo < blue) blue--; +} + void ProgressBar::draw(gcn::Graphics *graphics) { int absx, absy; @@ -87,14 +98,6 @@ void ProgressBar::draw(gcn::Graphics *graphics) // The bar if (progress > 0) { - // Smoothly changing the color for a nicer effect. - if (redToGo > red ) red++; - if (redToGo < red ) red--; - if (greenToGo > green ) green++; - if (greenToGo < green ) green--; - if (blueToGo > blue ) blue++; - if (blueToGo < blue ) blue--; - graphics->setColor(gcn::Color(red, green, blue, 200)); graphics->fillRectangle(gcn::Rectangle(4, 4, (int)(progress * (getWidth() - 8)), getHeight() - 8)); diff --git a/src/gui/progressbar.h b/src/gui/progressbar.h index d39ae0f9..3e751459 100644 --- a/src/gui/progressbar.h +++ b/src/gui/progressbar.h @@ -47,6 +47,11 @@ class ProgressBar : public gcn::Widget { ~ProgressBar(); /** + * Performs progress bar logic (fading colors) + */ + void logic(); + + /** * Draws the progress bar. */ void draw(gcn::Graphics *graphics); @@ -72,6 +72,5 @@ extern Sound sound; extern int screenW, screenH, bitDepth, displayFlags; extern bool useOpenGL; extern char *homeDir; -extern Configuration config; #endif |