summaryrefslogtreecommitdiff
path: root/src/main.cpp
diff options
context:
space:
mode:
authorBjørn Lindeijer <bjorn@lindeijer.nl>2008-12-07 02:03:02 +0100
committerBjørn Lindeijer <bjorn@lindeijer.nl>2008-12-07 02:03:02 +0100
commit1eba9b1bbd2e2c5a75a71c5592069c73e106015f (patch)
tree2baf0081710270bb551dadf58b501e6186b4cf0b /src/main.cpp
parentceb3ff6bba5a4133000142920a21899114e91cd1 (diff)
downloadmana-client-1eba9b1bbd2e2c5a75a71c5592069c73e106015f.tar.gz
mana-client-1eba9b1bbd2e2c5a75a71c5592069c73e106015f.tar.bz2
mana-client-1eba9b1bbd2e2c5a75a71c5592069c73e106015f.tar.xz
mana-client-1eba9b1bbd2e2c5a75a71c5592069c73e106015f.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. (cherry picked from eAthena commit 07c2da75b7d994ab097e7c50d865bee929623685) Conflicts: src/main.cpp
Diffstat (limited to 'src/main.cpp')
-rw-r--r--src/main.cpp11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/main.cpp b/src/main.cpp
index 700e5676..5159712e 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -920,7 +920,16 @@ int main(int argc, char *argv[])
}
}
- 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();