diff options
author | Kamil Zbrog | 2014-03-29 22:13:07 +0100 |
---|---|---|
committer | Kamil Zbrog | 2014-03-29 22:13:07 +0100 |
commit | 5ffa58dba7a941249af9ca8c1bd229c310fb296b (patch) | |
tree | 49faae8eb3424c32d890b4d3cd1eefeb11fc3cd9 /backends/platform/android | |
parent | 8eac80cfc59c34299899ebe18a3b0582ef76e0d2 (diff) | |
parent | 620411bfebe72fb0f60c4d8f64558be088cff58d (diff) | |
download | scummvm-rg350-5ffa58dba7a941249af9ca8c1bd229c310fb296b.tar.gz scummvm-rg350-5ffa58dba7a941249af9ca8c1bd229c310fb296b.tar.bz2 scummvm-rg350-5ffa58dba7a941249af9ca8c1bd229c310fb296b.zip |
Merge remote-tracking branch 'sync/master' into prince-malik
Diffstat (limited to 'backends/platform/android')
-rw-r--r-- | backends/platform/android/android.cpp | 6 | ||||
-rw-r--r-- | backends/platform/android/android.h | 6 | ||||
-rw-r--r-- | backends/platform/android/android.mk | 1 | ||||
-rw-r--r-- | backends/platform/android/asset-archive.cpp | 4 | ||||
-rw-r--r-- | backends/platform/android/asset-archive.h | 4 | ||||
-rw-r--r-- | backends/platform/android/events.cpp | 6 | ||||
-rw-r--r-- | backends/platform/android/gfx.cpp | 6 | ||||
-rw-r--r-- | backends/platform/android/jni.cpp | 6 | ||||
-rw-r--r-- | backends/platform/android/jni.h | 6 | ||||
-rw-r--r-- | backends/platform/android/org/scummvm/scummvm/ScummVM.java | 8 | ||||
-rw-r--r-- | backends/platform/android/org/scummvm/scummvm/ScummVMActivity.java | 10 | ||||
-rw-r--r-- | backends/platform/android/org/scummvm/scummvm/ScummVMEvents.java | 10 | ||||
-rw-r--r-- | backends/platform/android/org/scummvm/scummvm/ScummVMEventsHoneycomb.java | 25 | ||||
-rw-r--r-- | backends/platform/android/texture.cpp | 6 | ||||
-rw-r--r-- | backends/platform/android/texture.h | 4 |
15 files changed, 68 insertions, 40 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/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; + } +} 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. |