aboutsummaryrefslogtreecommitdiff
path: root/backends/platform/android/events.cpp
diff options
context:
space:
mode:
authordhewg2011-04-03 20:26:27 +0200
committerdhewg2011-04-03 20:34:24 +0200
commitea4223d941ec9dcbcca0530ed633cf8b5d05be40 (patch)
tree7c368c987361763a8283af43695aa225d785940a /backends/platform/android/events.cpp
parentfba1c6360c0194e5cad6133dc312c1c8ae80ac39 (diff)
downloadscummvm-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/events.cpp')
-rw-r--r--backends/platform/android/events.cpp36
1 files changed, 10 insertions, 26 deletions
diff --git a/backends/platform/android/events.cpp b/backends/platform/android/events.cpp
index 2576287a83..ccb18dde89 100644
--- a/backends/platform/android/events.cpp
+++ b/backends/platform/android/events.cpp
@@ -696,35 +696,19 @@ bool OSystem_Android::pollEvent(Common::Event &event) {
if (pthread_self() == _main_thread) {
if (_screen_changeid != JNI::surface_changeid) {
if (JNI::egl_surface_width > 0 && JNI::egl_surface_height > 0) {
- if (_egl_surface_width > 0 && _egl_surface_height > 0) {
- // surface still alive but changed
- _screen_changeid = JNI::surface_changeid;
- _egl_surface_width = JNI::egl_surface_width;
- _egl_surface_height = JNI::egl_surface_height;
+ // surface changed
+ JNI::deinitSurface();
+ initSurface();
+ initViewport();
+ updateScreenRect();
+ updateEventScale();
- initViewport();
- updateScreenRect();
- updateEventScale();
+ // double buffered, flip twice
+ clearScreen(kClearUpdate, 2);
- // double buffered, flip twice
- clearScreen(kClearUpdate, 2);
+ event.type = Common::EVENT_SCREEN_CHANGED;
- event.type = Common::EVENT_SCREEN_CHANGED;
-
- return true;
- } else {
- // new surface
- initSurface();
- updateScreenRect();
- updateEventScale();
-
- // double buffered, flip twice
- clearScreen(kClearUpdate, 2);
-
- event.type = Common::EVENT_SCREEN_CHANGED;
-
- return true;
- }
+ return true;
} else {
// surface lost
deinitSurface();