diff options
author | Bjørn Lindeijer <bjorn@lindeijer.nl> | 2008-12-02 20:28:22 +0100 |
---|---|---|
committer | Bjørn Lindeijer <bjorn@lindeijer.nl> | 2008-12-02 20:32:15 +0100 |
commit | 07c2da75b7d994ab097e7c50d865bee929623685 (patch) | |
tree | 3b4285861a68d70b81f824036f15349a107ddbca /src/main.cpp | |
parent | 53ee2ec3a7efd6ff62bff3abdb87eccec6fbe5c9 (diff) | |
download | mana-07c2da75b7d994ab097e7c50d865bee929623685.tar.gz mana-07c2da75b7d994ab097e7c50d865bee929623685.tar.bz2 mana-07c2da75b7d994ab097e7c50d865bee929623685.tar.xz mana-07c2da75b7d994ab097e7c50d865bee929623685.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.
Diffstat (limited to 'src/main.cpp')
-rw-r--r-- | src/main.cpp | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/main.cpp b/src/main.cpp index 91ba4d53..7da504ec 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -758,7 +758,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(); |