aboutsummaryrefslogtreecommitdiff
path: root/backends/platform/android
diff options
context:
space:
mode:
authorPaul Gilbert2014-03-01 17:28:24 -0500
committerPaul Gilbert2014-03-01 17:28:24 -0500
commit7880ae0b18c3e2a25ed1c4a2bc42e22066d1ff3e (patch)
tree96de4f3470bd9bcc81bbae82a3e1c59f523a8edf /backends/platform/android
parentbadb8d97444767b7d8fea0f877ac044249696a5f (diff)
parent2218d14fb5276724c757406d5ac1ec581160721b (diff)
downloadscummvm-rg350-7880ae0b18c3e2a25ed1c4a2bc42e22066d1ff3e.tar.gz
scummvm-rg350-7880ae0b18c3e2a25ed1c4a2bc42e22066d1ff3e.tar.bz2
scummvm-rg350-7880ae0b18c3e2a25ed1c4a2bc42e22066d1ff3e.zip
Merge branch 'master' into mads
Diffstat (limited to 'backends/platform/android')
-rw-r--r--backends/platform/android/android.cpp6
-rw-r--r--backends/platform/android/android.h6
-rw-r--r--backends/platform/android/android.mk1
-rw-r--r--backends/platform/android/asset-archive.cpp4
-rw-r--r--backends/platform/android/asset-archive.h4
-rw-r--r--backends/platform/android/events.cpp6
-rw-r--r--backends/platform/android/gfx.cpp6
-rw-r--r--backends/platform/android/jni.cpp6
-rw-r--r--backends/platform/android/jni.h6
-rw-r--r--backends/platform/android/org/scummvm/scummvm/ScummVMActivity.java10
-rw-r--r--backends/platform/android/org/scummvm/scummvm/ScummVMEvents.java10
-rw-r--r--backends/platform/android/org/scummvm/scummvm/ScummVMEventsHoneycomb.java25
-rw-r--r--backends/platform/android/texture.cpp6
-rw-r--r--backends/platform/android/texture.h4
14 files changed, 63 insertions, 37 deletions
diff --git a/backends/platform/android/android.cpp b/backends/platform/android/android.cpp
index 5e3d1d0db6..3ff1b939ef 100644
--- a/backends/platform/android/android.cpp
+++ b/backends/platform/android/android.cpp
@@ -8,12 +8,12 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
diff --git a/backends/platform/android/android.h b/backends/platform/android/android.h
index 704ce12f60..28016f5e3e 100644
--- a/backends/platform/android/android.h
+++ b/backends/platform/android/android.h
@@ -8,12 +8,12 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
diff --git a/backends/platform/android/android.mk b/backends/platform/android/android.mk
index 915bf8ac60..7c4fe01d54 100644
--- a/backends/platform/android/android.mk
+++ b/backends/platform/android/android.mk
@@ -7,6 +7,7 @@ ANDROID_PLUGIN_VERSIONCODE = 6
JAVA_FILES = \
ScummVM.java \
ScummVMEvents.java \
+ ScummVMEventsHoneycomb.java \
ScummVMApplication.java \
ScummVMActivity.java \
EditableSurfaceView.java \
diff --git a/backends/platform/android/asset-archive.cpp b/backends/platform/android/asset-archive.cpp
index da378fb082..52c2c084bd 100644
--- a/backends/platform/android/asset-archive.cpp
+++ b/backends/platform/android/asset-archive.cpp
@@ -8,12 +8,12 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
diff --git a/backends/platform/android/asset-archive.h b/backends/platform/android/asset-archive.h
index c5e43555e0..6a0033d24e 100644
--- a/backends/platform/android/asset-archive.h
+++ b/backends/platform/android/asset-archive.h
@@ -8,12 +8,12 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
diff --git a/backends/platform/android/events.cpp b/backends/platform/android/events.cpp
index 5c42db9347..c60626ec36 100644
--- a/backends/platform/android/events.cpp
+++ b/backends/platform/android/events.cpp
@@ -8,12 +8,12 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
diff --git a/backends/platform/android/gfx.cpp b/backends/platform/android/gfx.cpp
index 9f6c759c75..92293493f0 100644
--- a/backends/platform/android/gfx.cpp
+++ b/backends/platform/android/gfx.cpp
@@ -8,12 +8,12 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
diff --git a/backends/platform/android/jni.cpp b/backends/platform/android/jni.cpp
index 2b738dd63f..764c84ce1c 100644
--- a/backends/platform/android/jni.cpp
+++ b/backends/platform/android/jni.cpp
@@ -8,12 +8,12 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
diff --git a/backends/platform/android/jni.h b/backends/platform/android/jni.h
index 52698e0f35..326869b1ee 100644
--- a/backends/platform/android/jni.h
+++ b/backends/platform/android/jni.h
@@ -8,12 +8,12 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
diff --git a/backends/platform/android/org/scummvm/scummvm/ScummVMActivity.java b/backends/platform/android/org/scummvm/scummvm/ScummVMActivity.java
index 5d041dafd2..5964d5bfde 100644
--- a/backends/platform/android/org/scummvm/scummvm/ScummVMActivity.java
+++ b/backends/platform/android/org/scummvm/scummvm/ScummVMActivity.java
@@ -4,6 +4,7 @@ import android.app.Activity;
import android.app.AlertDialog;
import android.content.DialogInterface;
import android.media.AudioManager;
+import android.os.Build;
import android.os.Bundle;
import android.os.Environment;
import android.util.DisplayMetrics;
@@ -169,7 +170,14 @@ public class ScummVMActivity extends Activity {
_mouseHelper.attach(main_surface);
}
- _events = new ScummVMEvents(this, _scummvm, _mouseHelper);
+ if (Build.VERSION.SDK_INT < Build.VERSION_CODES.HONEYCOMB_MR1)
+ {
+ _events = new ScummVMEvents(this, _scummvm, _mouseHelper);
+ }
+ else
+ {
+ _events = new ScummVMEventsHoneycomb(this, _scummvm, _mouseHelper);
+ }
main_surface.setOnKeyListener(_events);
main_surface.setOnTouchListener(_events);
diff --git a/backends/platform/android/org/scummvm/scummvm/ScummVMEvents.java b/backends/platform/android/org/scummvm/scummvm/ScummVMEvents.java
index 702215341b..32c65d3395 100644
--- a/backends/platform/android/org/scummvm/scummvm/ScummVMEvents.java
+++ b/backends/platform/android/org/scummvm/scummvm/ScummVMEvents.java
@@ -68,15 +68,7 @@ public class ScummVMEvents implements
return true;
}
- public boolean onGenericMotionEvent(final MotionEvent e) {
- if((e.getSource() & InputDevice.SOURCE_CLASS_JOYSTICK) != 0) {
- _scummvm.pushEvent(JE_JOYSTICK, e.getAction(),
- (int)(e.getAxisValue(MotionEvent.AXIS_X)*100),
- (int)(e.getAxisValue(MotionEvent.AXIS_Y)*100),
- 0, 0);
- return true;
- }
-
+ public boolean onGenericMotionEvent(MotionEvent e) {
return false;
}
diff --git a/backends/platform/android/org/scummvm/scummvm/ScummVMEventsHoneycomb.java b/backends/platform/android/org/scummvm/scummvm/ScummVMEventsHoneycomb.java
new file mode 100644
index 0000000000..ab85429040
--- /dev/null
+++ b/backends/platform/android/org/scummvm/scummvm/ScummVMEventsHoneycomb.java
@@ -0,0 +1,25 @@
+package org.scummvm.scummvm;
+
+import android.content.Context;
+import android.view.MotionEvent;
+import android.view.InputDevice;
+
+public class ScummVMEventsHoneycomb extends ScummVMEvents {
+
+ public ScummVMEventsHoneycomb(Context context, ScummVM scummvm, MouseHelper mouseHelper) {
+ super(context, scummvm, mouseHelper);
+ }
+
+ @Override
+ public boolean onGenericMotionEvent(MotionEvent e) {
+ if((e.getSource() & InputDevice.SOURCE_CLASS_JOYSTICK) != 0) {
+ _scummvm.pushEvent(JE_JOYSTICK, e.getAction(),
+ (int)(e.getAxisValue(MotionEvent.AXIS_X)*100),
+ (int)(e.getAxisValue(MotionEvent.AXIS_Y)*100),
+ 0, 0);
+ return true;
+ }
+
+ return false;
+ }
+}
diff --git a/backends/platform/android/texture.cpp b/backends/platform/android/texture.cpp
index 87fd2d976c..165396b82b 100644
--- a/backends/platform/android/texture.cpp
+++ b/backends/platform/android/texture.cpp
@@ -8,12 +8,12 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
diff --git a/backends/platform/android/texture.h b/backends/platform/android/texture.h
index 67f7343c98..4b05dfd5d4 100644
--- a/backends/platform/android/texture.h
+++ b/backends/platform/android/texture.h
@@ -8,12 +8,12 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.