aboutsummaryrefslogtreecommitdiff
path: root/backends/platform/android/org
diff options
context:
space:
mode:
authorMarisa-Chan2014-06-13 21:43:04 +0700
committerMarisa-Chan2014-06-13 21:43:04 +0700
commit45589950c0fb1a449351e6a00ef10d42290d8bae (patch)
tree44e4eedcb7e69d5fc386155b000ed038af07251d /backends/platform/android/org
parent48360645dcd5f8fddb135b6e31ae5cae4be8d77f (diff)
parent5c005ad3a3f1df0bc968c85c1cf0fc48e36ab0b2 (diff)
downloadscummvm-rg350-45589950c0fb1a449351e6a00ef10d42290d8bae.tar.gz
scummvm-rg350-45589950c0fb1a449351e6a00ef10d42290d8bae.tar.bz2
scummvm-rg350-45589950c0fb1a449351e6a00ef10d42290d8bae.zip
Merge remote-tracking branch 'upstream/master' into zvision
Conflicts: engines/zvision/animation/rlf_animation.cpp engines/zvision/animation_control.h engines/zvision/core/console.cpp engines/zvision/core/events.cpp engines/zvision/cursors/cursor.cpp engines/zvision/cursors/cursor_manager.cpp engines/zvision/cursors/cursor_manager.h engines/zvision/fonts/truetype_font.cpp engines/zvision/graphics/render_manager.cpp engines/zvision/graphics/render_manager.h engines/zvision/inventory/inventory_manager.h engines/zvision/inventory_manager.h engines/zvision/meta_animation.h engines/zvision/module.mk engines/zvision/scripting/actions.cpp engines/zvision/scripting/control.h engines/zvision/scripting/controls/animation_control.cpp engines/zvision/scripting/controls/animation_control.h engines/zvision/scripting/controls/input_control.cpp engines/zvision/scripting/controls/lever_control.cpp engines/zvision/scripting/controls/timer_node.cpp engines/zvision/scripting/controls/timer_node.h engines/zvision/scripting/puzzle.h engines/zvision/scripting/scr_file_handling.cpp engines/zvision/scripting/script_manager.cpp engines/zvision/scripting/script_manager.h engines/zvision/sidefx.cpp engines/zvision/sound/zork_raw.cpp engines/zvision/sound/zork_raw.h engines/zvision/video/video.cpp engines/zvision/video/zork_avi_decoder.h engines/zvision/zvision.cpp engines/zvision/zvision.h
Diffstat (limited to 'backends/platform/android/org')
-rw-r--r--backends/platform/android/org/scummvm/scummvm/ScummVM.java8
-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
4 files changed, 40 insertions, 13 deletions
diff --git a/backends/platform/android/org/scummvm/scummvm/ScummVM.java b/backends/platform/android/org/scummvm/scummvm/ScummVM.java
index 3a25b54eeb..5047502e61 100644
--- a/backends/platform/android/org/scummvm/scummvm/ScummVM.java
+++ b/backends/platform/android/org/scummvm/scummvm/ScummVM.java
@@ -86,13 +86,15 @@ public abstract class ScummVM implements SurfaceHolder.Callback, Runnable {
Log.d(LOG_TAG, String.format("surfaceChanged: %dx%d (%d)",
width, height, format));
+ // store values for the native code
+ // make sure to do it before notifying the lock
+ // as it leads to a race condition otherwise
+ setSurface(width, height);
+
synchronized(_sem_surface) {
_surface_holder = holder;
_sem_surface.notifyAll();
}
-
- // store values for the native code
- setSurface(width, height);
}
// SurfaceHolder callback
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;
+ }
+}