diff options
author | Eugene Sandulenko | 2016-06-17 12:47:00 +0200 |
---|---|---|
committer | Eugene Sandulenko | 2016-06-17 12:47:00 +0200 |
commit | 19be66f15004e79ff7caa8dd64aee474c146098b (patch) | |
tree | 83d1ba23c9548195eba4642dc5b72b44adb0a718 /engines | |
parent | 8f2a0eb662d50f441621de58278828ef6fb427d1 (diff) | |
download | scummvm-rg350-19be66f15004e79ff7caa8dd64aee474c146098b.tar.gz scummvm-rg350-19be66f15004e79ff7caa8dd64aee474c146098b.tar.bz2 scummvm-rg350-19be66f15004e79ff7caa8dd64aee474c146098b.zip |
ENGINES: Make splash more robust for non-standard screen sizes
Diffstat (limited to 'engines')
-rw-r--r-- | engines/engine.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/engines/engine.cpp b/engines/engine.cpp index d3b9b113cf..8fff99f3fc 100644 --- a/engines/engine.cpp +++ b/engines/engine.cpp @@ -269,8 +269,8 @@ void splashScreen() { // Load logo Graphics::Surface *logo = bitmap.getSurface()->convertTo(g_system->getOverlayFormat(), bitmap.getPalette()); - int lx = (g_system->getOverlayWidth() - logo->w) / 2; - int ly = (g_system->getOverlayHeight() - logo->h) / 2; + int lx = MAX((g_system->getOverlayWidth() - logo->w) / 2, 0); + int ly = MAX((g_system->getOverlayHeight() - logo->h) / 2, 0); // Print version information const Graphics::Font *font = FontMan.getFontByUsage(Graphics::FontManager::kConsoleFont); @@ -283,7 +283,10 @@ void splashScreen() { screen.free(); // Draw logo - g_system->copyRectToOverlay(logo->getPixels(), logo->pitch, lx, ly, logo->w, logo->h); + int lw = MIN<uint16>(logo->w, g_system->getOverlayWidth() - lx); + int lh = MIN<uint16>(logo->h, g_system->getOverlayHeight() - ly); + + g_system->copyRectToOverlay(logo->getPixels(), logo->pitch, lx, ly, lw, lh); logo->free(); delete logo; |