[Scummvm-cvs-logs] scummvm master -> ea4223d941ec9dcbcca0530ed633cf8b5d05be40
dhewg
dhewg at wiibrew.org
Sun Apr 3 20:41:25 CEST 2011
This automated email contains information about 3 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
1692605b08 ANDROID: Helper define to debug hanging GLES calls
fba1c6360c ANDROID: Ignore unrelated surface changes
ea4223d941 ANDROID: Always use the surface size for the overlay
Commit: 1692605b0840cd869a83bd87055e9372acda0e76
https://github.com/scummvm/scummvm/commit/1692605b0840cd869a83bd87055e9372acda0e76
Author: dhewg (dhewg at wiibrew.org)
Date: 2011-04-03T11:34:14-07:00
Commit Message:
ANDROID: Helper define to debug hanging GLES calls
Changed paths:
backends/platform/android/android.h
diff --git a/backends/platform/android/android.h b/backends/platform/android/android.h
index 40dc0fe..76db012 100644
--- a/backends/platform/android/android.h
+++ b/backends/platform/android/android.h
@@ -48,6 +48,7 @@
// toggles start
//#define ANDROID_DEBUG_ENTER
//#define ANDROID_DEBUG_GL
+//#define ANDROID_DEBUG_GL_CALLS
// toggles end
extern const char *android_log_tag;
@@ -67,9 +68,23 @@ extern const char *android_log_tag;
#ifdef ANDROID_DEBUG_GL
extern void checkGlError(const char *expr, const char *file, int line);
+#ifdef ANDROID_DEBUG_GL_CALLS
+#define GLCALLLOG(x, before) \
+ do { \
+ if (before) \
+ LOGD("calling '%s' (%s:%d)", x, __FILE__, __LINE__); \
+ else \
+ LOGD("returned from '%s' (%s:%d)", x, __FILE__, __LINE__); \
+ } while (false)
+#else
+#define GLCALLLOG(x, before) do { } while (false)
+#endif
+
#define GLCALL(x) \
do { \
+ GLCALLLOG(#x, true); \
(x); \
+ GLCALLLOG(#x, false); \
checkGlError(#x, __FILE__, __LINE__); \
} while (false)
Commit: fba1c6360c0194e5cad6133dc312c1c8ae80ac39
https://github.com/scummvm/scummvm/commit/fba1c6360c0194e5cad6133dc312c1c8ae80ac39
Author: dhewg (dhewg at wiibrew.org)
Date: 2011-04-03T11:34:19-07:00
Commit Message:
ANDROID: Ignore unrelated surface changes
Changed paths:
backends/platform/android/org/inodes/gus/scummvm/ScummVM.java
diff --git a/backends/platform/android/org/inodes/gus/scummvm/ScummVM.java b/backends/platform/android/org/inodes/gus/scummvm/ScummVM.java
index fe225af..8bf40ac 100644
--- a/backends/platform/android/org/inodes/gus/scummvm/ScummVM.java
+++ b/backends/platform/android/org/inodes/gus/scummvm/ScummVM.java
@@ -75,6 +75,14 @@ public abstract class ScummVM implements SurfaceHolder.Callback, Runnable {
// SurfaceHolder callback
final public void surfaceChanged(SurfaceHolder holder, int format,
int width, int height) {
+ // the orientation may reset on standby mode and the theme manager
+ // could assert when using a portrait resolution. so lets not do that.
+ if (height > width) {
+ Log.d(LOG_TAG, String.format("Ignoring surfaceChanged: %dx%d (%d)",
+ width, height, format));
+ return;
+ }
+
Log.d(LOG_TAG, String.format("surfaceChanged: %dx%d (%d)",
width, height, format));
Commit: ea4223d941ec9dcbcca0530ed633cf8b5d05be40
https://github.com/scummvm/scummvm/commit/ea4223d941ec9dcbcca0530ed633cf8b5d05be40
Author: dhewg (dhewg at wiibrew.org)
Date: 2011-04-03T11:34:24-07:00
Commit Message:
ANDROID: Always use the surface size for the overlay
When coming back from standby, there might be an indermediate surface
change
Changed paths:
backends/platform/android/events.cpp
backends/platform/android/gfx.cpp
diff --git a/backends/platform/android/events.cpp b/backends/platform/android/events.cpp
index 2576287..ccb18dd 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();
diff --git a/backends/platform/android/gfx.cpp b/backends/platform/android/gfx.cpp
index ab7240e..b2f5427 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;
}
More information about the Scummvm-git-logs
mailing list