[Scummvm-cvs-logs] scummvm master -> 19be66f15004e79ff7caa8dd64aee474c146098b
sev-
sev at scummvm.org
Fri Jun 17 12:47:26 CEST 2016
This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
19be66f150 ENGINES: Make splash more robust for non-standard screen sizes
Commit: 19be66f15004e79ff7caa8dd64aee474c146098b
https://github.com/scummvm/scummvm/commit/19be66f15004e79ff7caa8dd64aee474c146098b
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2016-06-17T12:47:00+02:00
Commit Message:
ENGINES: Make splash more robust for non-standard screen sizes
Changed paths:
engines/engine.cpp
diff --git a/engines/engine.cpp b/engines/engine.cpp
index d3b9b11..8fff99f 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;
More information about the Scummvm-git-logs
mailing list