summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorBjørn Lindeijer <bjorn@lindeijer.nl>2005-02-13 17:49:53 +0000
committerBjørn Lindeijer <bjorn@lindeijer.nl>2005-02-13 17:49:53 +0000
commitf3d3020c77e5b54601fe8fda9c61ab3d4e5cf1bd (patch)
tree7d27690efdc0c55cdac6c0f9547bea00947a230e /src
parentce19f175c806980c3970882d45b21e7c7bc9dcae (diff)
downloadmana-f3d3020c77e5b54601fe8fda9c61ab3d4e5cf1bd.tar.gz
mana-f3d3020c77e5b54601fe8fda9c61ab3d4e5cf1bd.tar.bz2
mana-f3d3020c77e5b54601fe8fda9c61ab3d4e5cf1bd.tar.xz
mana-f3d3020c77e5b54601fe8fda9c61ab3d4e5cf1bd.zip
Lock the screen surface before modifying pixels directly.
Diffstat (limited to 'src')
-rw-r--r--src/gui/progressbar.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/gui/progressbar.cpp b/src/gui/progressbar.cpp
index e3766913..09e05932 100644
--- a/src/gui/progressbar.cpp
+++ b/src/gui/progressbar.cpp
@@ -44,6 +44,9 @@ void ProgressBar::draw(gcn::Graphics *graphics)
{
int absx, absy;
getAbsolutePosition(absx, absy);
+
+ // We're modifying pixels so we have to lock the screen.
+ SDL_LockSurface(screen);
// outer bar
DrawLine(screen, absx+X+PROGRESSBAR_HEIGHT, absy+Y, absx+X+Width, absy+Y, abs(Red-70), abs(Green-70), abs(Blue-70));
@@ -70,8 +73,9 @@ void ProgressBar::draw(gcn::Graphics *graphics)
Temp = absx+X+int(float(Width)*progress)-2;
if ( Temp < (absx+X+PROGRESSBAR_HEIGHT+1) ) Temp = absx+X+PROGRESSBAR_HEIGHT;
DrawLine(screen, absx+X+PROGRESSBAR_HEIGHT+1, absy+Y+1, Temp, absy+Y+1, abs(Red-40), abs(Green-40), abs(Blue-40));
- DrawLine(screen, absx+X+PROGRESSBAR_HEIGHT, absy+Y+1, absx+X+2, absy+Y+PROGRESSBAR_HEIGHT-1, abs(Red-40), abs(Green-40), abs(Blue-40));
+ DrawLine(screen, absx+X+PROGRESSBAR_HEIGHT, absy+Y+1, absx+X+2, absy+Y+PROGRESSBAR_HEIGHT-1, abs(Red-40), abs(Green-40), abs(Blue-40));
+ SDL_UnlockSurface(screen);
}
void ProgressBar::setProgress(float progress)