diff options
author | dhewg | 2011-04-03 20:26:27 +0200 |
---|---|---|
committer | dhewg | 2011-04-03 20:34:24 +0200 |
commit | ea4223d941ec9dcbcca0530ed633cf8b5d05be40 (patch) | |
tree | 7c368c987361763a8283af43695aa225d785940a /backends/platform/android/gfx.cpp | |
parent | fba1c6360c0194e5cad6133dc312c1c8ae80ac39 (diff) | |
download | scummvm-rg350-ea4223d941ec9dcbcca0530ed633cf8b5d05be40.tar.gz scummvm-rg350-ea4223d941ec9dcbcca0530ed633cf8b5d05be40.tar.bz2 scummvm-rg350-ea4223d941ec9dcbcca0530ed633cf8b5d05be40.zip |
ANDROID: Always use the surface size for the overlay
When coming back from standby, there might be an indermediate surface
change
Diffstat (limited to 'backends/platform/android/gfx.cpp')
-rw-r--r-- | backends/platform/android/gfx.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/backends/platform/android/gfx.cpp b/backends/platform/android/gfx.cpp index ab7240e648..b2f5427f01 100644 --- a/backends/platform/android/gfx.cpp +++ b/backends/platform/android/gfx.cpp @@ -235,8 +235,10 @@ void OSystem_Android::initViewport() { } void OSystem_Android::initOverlay() { - int overlay_width = _egl_surface_width; - int overlay_height = _egl_surface_height; + // minimum of 320x200 + // (surface can get smaller when opening the virtual keyboard on *QVGA*) + int overlay_width = MAX(_egl_surface_width, 320); + int overlay_height = MAX(_egl_surface_height, 200); // the 'normal' theme layout uses a max height of 400 pixels. if the // surface is too big we use only a quarter of the size so that the widgets @@ -244,7 +246,7 @@ void OSystem_Android::initOverlay() { // enforces the 'lowres' layout, which will be scaled back up by factor 2x, // but this looks way better than the 'normal' layout scaled by some // calculated factors - if (overlay_height > 480) { + while (overlay_height > 480) { overlay_width /= 2; overlay_height /= 2; } |