From 1eba9b1bbd2e2c5a75a71c5592069c73e106015f Mon Sep 17 00:00:00 2001 From: Bjørn Lindeijer Date: Sun, 7 Dec 2008 02:03:02 +0100 Subject: 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 --- src/main.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'src/main.cpp') 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(); -- cgit v1.2.3-60-g2f50