diff options
author | dhewg | 2011-03-02 19:48:29 +0100 |
---|---|---|
committer | dhewg | 2011-03-02 23:18:35 +0100 |
commit | ccfe427eb542235070e8576b4cc47217d92046fd (patch) | |
tree | e5dc74d43a16d083880b8be1732b826a8e303bf0 /backends/platform | |
parent | d6e838e1b38a568869ffd655a9bebd225593ffad (diff) | |
download | scummvm-rg350-ccfe427eb542235070e8576b4cc47217d92046fd.tar.gz scummvm-rg350-ccfe427eb542235070e8576b4cc47217d92046fd.tar.bz2 scummvm-rg350-ccfe427eb542235070e8576b4cc47217d92046fd.zip |
ANDROID: Check for a surface in updateScreen()
Diffstat (limited to 'backends/platform')
-rw-r--r-- | backends/platform/android/android.cpp | 2 | ||||
-rw-r--r-- | backends/platform/android/gfx.cpp | 3 | ||||
-rw-r--r-- | backends/platform/android/jni.h | 5 |
3 files changed, 8 insertions, 2 deletions
diff --git a/backends/platform/android/android.cpp b/backends/platform/android/android.cpp index a61f7daee3..484f6886ec 100644 --- a/backends/platform/android/android.cpp +++ b/backends/platform/android/android.cpp @@ -400,8 +400,6 @@ bool OSystem_Android::pollEvent(Common::Event &event) { _screen_changeid = JNI::surface_changeid; JNI::deinitSurface(); - - // TODO prevent swapBuffers } } diff --git a/backends/platform/android/gfx.cpp b/backends/platform/android/gfx.cpp index 96ba5e729a..15e517a07f 100644 --- a/backends/platform/android/gfx.cpp +++ b/backends/platform/android/gfx.cpp @@ -198,6 +198,9 @@ void OSystem_Android::updateScreen() { GLTHREADCHECK; + if (!JNI::haveSurface()) + return; + if (!_force_redraw && !_game_texture->dirty() && !_overlay_texture->dirty() && diff --git a/backends/platform/android/jni.h b/backends/platform/android/jni.h index 2a1405dfcc..d2bc89e3d1 100644 --- a/backends/platform/android/jni.h +++ b/backends/platform/android/jni.h @@ -60,6 +60,7 @@ public: static void showVirtualKeyboard(bool enable); static void addSysArchivesToSearchSet(Common::SearchSet &s, int priority); + static inline bool haveSurface(); static inline bool swapBuffers(); static bool initSurface(); static void deinitSurface(); @@ -130,6 +131,10 @@ private: static void enableZoning(JNIEnv *env, jobject self, jboolean enable); }; +inline bool JNI::haveSurface() { + return _jobj_egl_surface != 0; +} + inline bool JNI::swapBuffers() { JNIEnv *env = JNI::getEnv(); |