From bd7e3e9bb20dada6d40143557c473fabd373b5ed Mon Sep 17 00:00:00 2001 From: dhewg Date: Tue, 1 Mar 2011 22:16:10 +0100 Subject: ANDROID: cleanup --- backends/platform/android/android.cpp | 9 ++++++--- backends/platform/android/gfx.cpp | 11 +++-------- backends/platform/android/texture.cpp | 2 +- backends/platform/android/texture.h | 4 ---- 4 files changed, 10 insertions(+), 16 deletions(-) diff --git a/backends/platform/android/android.cpp b/backends/platform/android/android.cpp index 2af367e903..a61f7daee3 100644 --- a/backends/platform/android/android.cpp +++ b/backends/platform/android/android.cpp @@ -442,9 +442,12 @@ bool OSystem_Android::pollEvent(Common::Event &event) { } else { // Touchscreen events need to be converted // from device to game coords first. - const GLESTexture *tex = _show_overlay - ? static_cast(_overlay_texture) - : static_cast(_game_texture); + const GLESTexture *tex; + if (_show_overlay) + tex = _overlay_texture; + else + tex = _game_texture; + event.mouse.x = scalef(event.mouse.x, tex->width(), _egl_surface_width); event.mouse.y = scalef(event.mouse.y, tex->height(), diff --git a/backends/platform/android/gfx.cpp b/backends/platform/android/gfx.cpp index 49f3d40e39..7fbe896d82 100644 --- a/backends/platform/android/gfx.cpp +++ b/backends/platform/android/gfx.cpp @@ -128,8 +128,8 @@ void OSystem_Android::initSize(uint width, uint height, _game_texture->allocBuffer(width, height); - GLuint overlay_width = _egl_surface_width; - GLuint overlay_height = _egl_surface_height; + int overlay_width = _egl_surface_width; + int overlay_height = _egl_surface_height; // 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 @@ -290,13 +290,8 @@ void OSystem_Android::updateScreen() { int res = JNI::swapBuffers(); - if (res) { + if (res) warning("swapBuffers returned 0x%x", res); -#if 0 - JNI::initSurface(); - setupSurface(); -#endif - } } Graphics::Surface *OSystem_Android::lockScreen() { diff --git a/backends/platform/android/texture.cpp b/backends/platform/android/texture.cpp index c5cba97dcd..9840e7d5c5 100644 --- a/backends/platform/android/texture.cpp +++ b/backends/platform/android/texture.cpp @@ -154,7 +154,7 @@ void GLESTexture::updateBuffer(GLuint x, GLuint y, GLuint w, GLuint h, GLCALL(glBindTexture(GL_TEXTURE_2D, _texture_name)); GLCALL(glPixelStorei(GL_UNPACK_ALIGNMENT, 1)); - setDirtyRect(Common::Rect(x, y, x+w, y+h)); + setDirtyRect(Common::Rect(x, y, x + w, y + h)); if (static_cast(w) * bytesPerPixel() == pitch) { GLCALL(glTexSubImage2D(GL_TEXTURE_2D, 0, x, y, w, h, diff --git a/backends/platform/android/texture.h b/backends/platform/android/texture.h index 050eafa073..12274621a1 100644 --- a/backends/platform/android/texture.h +++ b/backends/platform/android/texture.h @@ -59,10 +59,6 @@ public: return _surface.h; } - inline GLuint texture_name() const { - return _texture_name; - } - inline const Graphics::Surface *surface_const() const { return &_surface; } -- cgit v1.2.3