aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--backends/platform/android/android.cpp9
-rw-r--r--backends/platform/android/gfx.cpp11
-rw-r--r--backends/platform/android/texture.cpp2
-rw-r--r--backends/platform/android/texture.h4
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<GLESTexture *>(_overlay_texture)
- : static_cast<GLESTexture *>(_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<int>(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;
}