diff options
author | Bjørn Lindeijer <bjorn@lindeijer.nl> | 2005-04-02 10:39:33 +0000 |
---|---|---|
committer | Bjørn Lindeijer <bjorn@lindeijer.nl> | 2005-04-02 10:39:33 +0000 |
commit | e89ecd460dd2aa14aa7fd01292628fb74cb34692 (patch) | |
tree | e92c24b0677d30e81e6532b874b6afb0a363a63f /src/gui/progressbar.cpp | |
parent | 4e668b287b3c32d4f586febdd259983f2f0504c3 (diff) | |
download | mana-e89ecd460dd2aa14aa7fd01292628fb74cb34692.tar.gz mana-e89ecd460dd2aa14aa7fd01292628fb74cb34692.tar.bz2 mana-e89ecd460dd2aa14aa7fd01292628fb74cb34692.tar.xz mana-e89ecd460dd2aa14aa7fd01292628fb74cb34692.zip |
Less Image::setAlpha calls.
Diffstat (limited to 'src/gui/progressbar.cpp')
-rw-r--r-- | src/gui/progressbar.cpp | 24 |
1 files changed, 6 insertions, 18 deletions
diff --git a/src/gui/progressbar.cpp b/src/gui/progressbar.cpp index 8b051cbb..e84c235e 100644 --- a/src/gui/progressbar.cpp +++ b/src/gui/progressbar.cpp @@ -35,7 +35,7 @@ ProgressBar::ProgressBar(float progress, int x, int y, int width, int height, setY(y); setWidth(width); setHeight(height); - + // Load dialog title bar image ResourceManager *resman = ResourceManager::getInstance(); Image *dBorders = resman->getImage("graphics/gui/vscroll_grey.png"); @@ -45,24 +45,12 @@ ProgressBar::ProgressBar(float progress, int x, int y, int width, int height, dLeftBorder = dBorders->getSubImage(0, 4, 4, 10); dRightBorder = dBorders->getSubImage(7, 4, 4, 10); dBottomBorder = dBorders->getSubImage(4, 15, 3, 4); - + dTopLeftBorder = dBorders->getSubImage(0, 0, 4, 4); dTopRightBorder = dBorders->getSubImage(7, 0, 4, 4); dBottomRightBorder = dBorders->getSubImage(7, 15, 4, 4); dBottomLeftBorder = dBorders->getSubImage(0, 15, 4, 4); - - dBackground->setAlpha(1.0f); - - dTopBorder->setAlpha(1.0f); - dBottomBorder->setAlpha(1.0f); - dLeftBorder->setAlpha(1.0f); - dRightBorder->setAlpha(1.0f); - - dTopLeftBorder->setAlpha(1.0f); - dTopRightBorder->setAlpha(1.0f); - dBottomLeftBorder->setAlpha(1.0f); - dBottomRightBorder->setAlpha(1.0f); - + colorBar = Image::create(getWidth() - 8, getHeight() - 8); if (colorBar) { colorBar->fillWithColor(red, green, blue); @@ -81,7 +69,7 @@ void ProgressBar::draw(gcn::Graphics *graphics) { int absx, absy; getAbsolutePosition(absx, absy); - + // We're drawing the bar itself first // Background dBackground->drawPattern(screen, @@ -94,7 +82,7 @@ void ProgressBar::draw(gcn::Graphics *graphics) dBottomLeftBorder->draw(screen, absx, absy + getHeight() - 4); dBottomRightBorder->draw(screen, absx+getWidth() - 4, absy+getHeight() - 4); - + // The borders dTopBorder->drawPattern(screen, absx + 4, absy, getWidth() - 8, 4); dBottomBorder->drawPattern(screen, absx + 4, absy + getHeight() - 4, @@ -104,7 +92,7 @@ void ProgressBar::draw(gcn::Graphics *graphics) 4, getHeight() - 8); if (colorBar) { - colorBar->draw(screen, 0, 0, absx + 4, absy + 4, + colorBar->draw(screen, 0, 0, absx + 4, absy + 4, (int)(progress * float(getWidth() - 4)), getHeight() - 8); } } |