summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBjørn Lindeijer <bjorn@lindeijer.nl>2008-12-02 20:28:22 +0100
committerIra Rice <irarice@gmail.com>2008-12-06 17:58:39 -0700
commit7f24abc455a407e84f13d75099e36db77fa8931d (patch)
tree81ce17fd2f1ca4bb3359fd1cb99edecd6aab021b
parentd9fe9f23bfef1371949409016139ece0851808bc (diff)
downloadmana-client-7f24abc455a407e84f13d75099e36db77fa8931d.tar.gz
mana-client-7f24abc455a407e84f13d75099e36db77fa8931d.tar.bz2
mana-client-7f24abc455a407e84f13d75099e36db77fa8931d.tar.xz
mana-client-7f24abc455a407e84f13d75099e36db77fa8931d.zip
Fix background on resolutions other than 800x600
The image is now centered and a gray background is drawn behind it so that parts that are not covered by the image don't show redrawing issues.
-rw-r--r--src/main.cpp11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/main.cpp b/src/main.cpp
index 8f256405..279bae71 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -815,7 +815,16 @@ int main(int argc, char *argv[])
progressBar->setProgress(0.0f);
}
- graphics->drawImage(login_wallpaper, 0, 0);
+ if (graphics->getWidth() > login_wallpaper->getWidth() ||
+ graphics->getHeight() > login_wallpaper->getHeight())
+ {
+ graphics->setColor(gcn::Color(64, 64, 64));
+ graphics->fillRectangle(gcn::Rectangle(
+ 0, 0, graphics->getWidth(), graphics->getHeight()));
+ }
+ graphics->drawImage(login_wallpaper,
+ (graphics->getWidth() - login_wallpaper->getWidth()) / 2,
+ (graphics->getHeight() - login_wallpaper->getHeight()) / 2);
gui->draw();
graphics->updateScreen();