[Scummvm-cvs-logs] scummvm master -> d4d90b3f07bb379470a2090a8771e4c73be55ff8
digitall
dgturner at iee.org
Wed Oct 9 03:27:16 CEST 2013
This automated email contains information about 7 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
237ce0b89b CONFIGURE: Add --host=ouya to the special targets
9a888ed1c8 ANDROID: Add OUYA icon and intent
1b69f8aede ANDROID: Add gamepad button support
a50ede203b ANDROID: Add support for joystick motion
bb39cbcba4 ANDROID: Enter main menu on middle mouse press
7a1ffe8c59 ANDROID: Add some margins when screen is a TV
d4d90b3f07 Merge pull request #372 from zeldin/ouya
Commit: 237ce0b89bc20d85f9bb4702e5c9aec7cf647f28
https://github.com/scummvm/scummvm/commit/237ce0b89bc20d85f9bb4702e5c9aec7cf647f28
Author: Marcus Comstedt (marcus at mc.pp.se)
Date: 2013-08-07T07:54:40-07:00
Commit Message:
CONFIGURE: Add --host=ouya to the special targets
Changed paths:
configure
diff --git a/configure b/configure
index 1da7d7f..22e9653 100755
--- a/configure
+++ b/configure
@@ -862,6 +862,7 @@ Special configuration feature:
motomagx for MotoMAGX
n64 for Nintendo 64
openpandora for OpenPandora
+ ouya for OUYA
ps2 for PlayStation 2
ps3 for PlayStation 3
psp for PlayStation Portable
@@ -1256,7 +1257,7 @@ get_system_exe_extension $guessed_host
NATIVEEXEEXT=$_exeext
case $_host in
-android | android-v7a)
+android | android-v7a | ouya)
_host_os=android
_host_cpu=arm
_host_alias=arm-linux-androideabi
@@ -2038,6 +2039,12 @@ case $_host_os in
CXXFLAGS="$CXXFLAGS -mfpu=vfp"
LDFLAGS="$LDFLAGS -Wl,--fix-cortex-a8"
;;
+ ouya)
+ CXXFLAGS="$CXXFLAGS -march=armv7-a"
+ CXXFLAGS="$CXXFLAGS -mtune=cortex-a9"
+ CXXFLAGS="$CXXFLAGS -mfloat-abi=softfp"
+ CXXFLAGS="$CXXFLAGS -mfpu=neon"
+ ;;
esac
CXXFLAGS="$CXXFLAGS --sysroot=$ANDROID_NDK/platforms/android-4/arch-arm"
CXXFLAGS="$CXXFLAGS -fpic"
@@ -2308,7 +2315,7 @@ if test -n "$_host"; then
# Cross-compiling mode - add your target here if needed
echo "Cross-compiling to $_host"
case "$_host" in
- android | android-v7a)
+ android | android-v7a | ouya)
# we link a .so as default
LDFLAGS="$LDFLAGS -shared"
LDFLAGS="$LDFLAGS -Wl,-Bsymbolic,--no-undefined"
Commit: 9a888ed1c8b32a33a8dd91f0ff6c81ea7773e6ff
https://github.com/scummvm/scummvm/commit/9a888ed1c8b32a33a8dd91f0ff6c81ea7773e6ff
Author: Marcus Comstedt (marcus at mc.pp.se)
Date: 2013-08-07T08:19:24-07:00
Commit Message:
ANDROID: Add OUYA icon and intent
Changed paths:
A dists/android/res/drawable-xhdpi/ouya_icon.png
backends/platform/android/android.mk
dists/android/AndroidManifest.xml
dists/android/AndroidManifest.xml.in
diff --git a/backends/platform/android/android.mk b/backends/platform/android/android.mk
index f498c67..34c3a99 100644
--- a/backends/platform/android/android.mk
+++ b/backends/platform/android/android.mk
@@ -31,7 +31,8 @@ RESOURCES = \
$(PATH_RESOURCES)/layout/splash.xml \
$(PATH_RESOURCES)/drawable/gradient.xml \
$(PATH_RESOURCES)/drawable/scummvm.png \
- $(PATH_RESOURCES)/drawable/scummvm_big.png
+ $(PATH_RESOURCES)/drawable/scummvm_big.png \
+ $(PATH_RESOURCES)/drawable-xhdpi/ouya_icon.png
PLUGIN_RESOURCES = \
$(PATH_RESOURCES)/values/strings.xml \
diff --git a/dists/android/AndroidManifest.xml b/dists/android/AndroidManifest.xml
index 320ed16..16d1ee5 100644
--- a/dists/android/AndroidManifest.xml
+++ b/dists/android/AndroidManifest.xml
@@ -36,6 +36,7 @@
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
+ <category android:name="tv.ouya.intent.category.GAME"/>
</intent-filter>
</activity>
</application>
diff --git a/dists/android/AndroidManifest.xml.in b/dists/android/AndroidManifest.xml.in
index 8f7887e..bf45ffc 100644
--- a/dists/android/AndroidManifest.xml.in
+++ b/dists/android/AndroidManifest.xml.in
@@ -36,6 +36,7 @@
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
+ <category android:name="tv.ouya.intent.category.GAME"/>
</intent-filter>
</activity>
</application>
diff --git a/dists/android/res/drawable-xhdpi/ouya_icon.png b/dists/android/res/drawable-xhdpi/ouya_icon.png
new file mode 100644
index 0000000..42f9a2a
Binary files /dev/null and b/dists/android/res/drawable-xhdpi/ouya_icon.png differ
Commit: 1b69f8aedee240af79ea871c32a9caadc6a0dd98
https://github.com/scummvm/scummvm/commit/1b69f8aedee240af79ea871c32a9caadc6a0dd98
Author: Marcus Comstedt (marcus at mc.pp.se)
Date: 2013-08-08T05:08:30-07:00
Commit Message:
ANDROID: Add gamepad button support
Changed paths:
backends/platform/android/events.cpp
backends/platform/android/org/scummvm/scummvm/ScummVMEvents.java
diff --git a/backends/platform/android/events.cpp b/backends/platform/android/events.cpp
index db1261e..5ad9ed8 100644
--- a/backends/platform/android/events.cpp
+++ b/backends/platform/android/events.cpp
@@ -64,6 +64,7 @@ enum {
JE_RMB_DOWN = 11,
JE_RMB_UP = 12,
JE_MOUSE_MOVE = 13,
+ JE_GAMEPAD = 14,
JE_QUIT = 0x1000
};
@@ -109,6 +110,25 @@ enum {
JKEYCODE_DPAD_CENTER = 23
};
+// gamepad
+enum {
+ JKEYCODE_BUTTON_A = 96,
+ JKEYCODE_BUTTON_B = 97,
+ JKEYCODE_BUTTON_C = 98,
+ JKEYCODE_BUTTON_X = 99,
+ JKEYCODE_BUTTON_Y = 100,
+ JKEYCODE_BUTTON_Z = 101,
+ JKEYCODE_BUTTON_L1 = 102,
+ JKEYCODE_BUTTON_R1 = 103,
+ JKEYCODE_BUTTON_L2 = 104,
+ JKEYCODE_BUTTON_R2 = 105,
+ JKEYCODE_BUTTON_THUMBL = 106,
+ JKEYCODE_BUTTON_THUMBR = 107,
+ JKEYCODE_BUTTON_START = 108,
+ JKEYCODE_BUTTON_SELECT = 109,
+ JKEYCODE_BUTTON_MODE = 110,
+};
+
// meta modifier
enum {
JMETA_SHIFT = 0x01,
@@ -827,6 +847,55 @@ void OSystem_Android::pushEvent(int type, int arg1, int arg2, int arg3,
return;
+ case JE_GAMEPAD:
+ switch (arg1) {
+ case JACTION_DOWN:
+ e.type = Common::EVENT_KEYDOWN;
+ break;
+ case JACTION_UP:
+ e.type = Common::EVENT_KEYUP;
+ break;
+ default:
+ LOGE("unhandled jaction on gamepad key: %d", arg1);
+ return;
+ }
+
+ switch (arg2) {
+ case JKEYCODE_BUTTON_A:
+ case JKEYCODE_BUTTON_B:
+ switch (arg1) {
+ case JACTION_DOWN:
+ e.type = (arg2 == JKEYCODE_BUTTON_A?
+ Common::EVENT_LBUTTONDOWN :
+ Common::EVENT_RBUTTONDOWN);
+ break;
+ case JACTION_UP:
+ e.type = (arg2 == JKEYCODE_BUTTON_A?
+ Common::EVENT_LBUTTONUP :
+ Common::EVENT_RBUTTONUP);
+ break;
+ }
+
+ e.mouse = getEventManager()->getMousePos();
+
+ break;
+
+ case JKEYCODE_BUTTON_X:
+ e.kbd.keycode = Common::KEYCODE_ESCAPE;
+ e.kbd.ascii = Common::ASCII_ESCAPE;
+ break;
+
+ default:
+ LOGW("unmapped gamepad key: %d", arg2);
+ return;
+ }
+
+ lockMutex(_event_queue_lock);
+ _event_queue.push(e);
+ unlockMutex(_event_queue_lock);
+
+ break;
+
case JE_QUIT:
e.type = Common::EVENT_QUIT;
diff --git a/backends/platform/android/org/scummvm/scummvm/ScummVMEvents.java b/backends/platform/android/org/scummvm/scummvm/ScummVMEvents.java
index 5f51ffa..9278e7f 100644
--- a/backends/platform/android/org/scummvm/scummvm/ScummVMEvents.java
+++ b/backends/platform/android/org/scummvm/scummvm/ScummVMEvents.java
@@ -31,6 +31,7 @@ public class ScummVMEvents implements
public static final int JE_RMB_DOWN = 11;
public static final int JE_RMB_UP = 12;
public static final int JE_MOUSE_MOVE = 13;
+ public static final int JE_GAMEPAD = 14;
public static final int JE_QUIT = 0x1000;
final protected Context _context;
@@ -177,6 +178,25 @@ public class ScummVMEvents implements
(int)(e.getEventTime() - e.getDownTime()),
e.getRepeatCount(), 0);
return true;
+ case KeyEvent.KEYCODE_BUTTON_A:
+ case KeyEvent.KEYCODE_BUTTON_B:
+ case KeyEvent.KEYCODE_BUTTON_C:
+ case KeyEvent.KEYCODE_BUTTON_X:
+ case KeyEvent.KEYCODE_BUTTON_Y:
+ case KeyEvent.KEYCODE_BUTTON_Z:
+ case KeyEvent.KEYCODE_BUTTON_L1:
+ case KeyEvent.KEYCODE_BUTTON_R1:
+ case KeyEvent.KEYCODE_BUTTON_L2:
+ case KeyEvent.KEYCODE_BUTTON_R2:
+ case KeyEvent.KEYCODE_BUTTON_THUMBL:
+ case KeyEvent.KEYCODE_BUTTON_THUMBR:
+ case KeyEvent.KEYCODE_BUTTON_START:
+ case KeyEvent.KEYCODE_BUTTON_SELECT:
+ case KeyEvent.KEYCODE_BUTTON_MODE:
+ _scummvm.pushEvent(JE_GAMEPAD, action, keyCode,
+ (int)(e.getEventTime() - e.getDownTime()),
+ e.getRepeatCount(), 0);
+ return true;
}
_scummvm.pushEvent(JE_KEY, action, keyCode,
Commit: a50ede203b0424d800d2a1d4460121f9f1de8e7a
https://github.com/scummvm/scummvm/commit/a50ede203b0424d800d2a1d4460121f9f1de8e7a
Author: Marcus Comstedt (marcus at mc.pp.se)
Date: 2013-08-08T05:53:36-07:00
Commit Message:
ANDROID: Add support for joystick motion
Changed paths:
backends/platform/android/android.cpp
backends/platform/android/android.h
backends/platform/android/events.cpp
backends/platform/android/org/scummvm/scummvm/ScummVMActivity.java
backends/platform/android/org/scummvm/scummvm/ScummVMEvents.java
diff --git a/backends/platform/android/android.cpp b/backends/platform/android/android.cpp
index ad80ea7..5e3d1d0 100644
--- a/backends/platform/android/android.cpp
+++ b/backends/platform/android/android.cpp
@@ -146,7 +146,8 @@ OSystem_Android::OSystem_Android(int audio_sample_rate, int audio_buffer_size) :
_touchpad_scale(66),
_dpad_scale(4),
_fingersDown(0),
- _trackball_scale(2) {
+ _trackball_scale(2),
+ _joystick_scale(10) {
_fsFactory = new POSIXFilesystemFactory();
diff --git a/backends/platform/android/android.h b/backends/platform/android/android.h
index b4813b3..704ce12 100644
--- a/backends/platform/android/android.h
+++ b/backends/platform/android/android.h
@@ -231,6 +231,7 @@ private:
int _touchpad_scale;
int _trackball_scale;
int _dpad_scale;
+ int _joystick_scale;
int _fingersDown;
void clipMouse(Common::Point &p);
diff --git a/backends/platform/android/events.cpp b/backends/platform/android/events.cpp
index 5ad9ed8..4d7ef9c 100644
--- a/backends/platform/android/events.cpp
+++ b/backends/platform/android/events.cpp
@@ -65,6 +65,7 @@ enum {
JE_RMB_UP = 12,
JE_MOUSE_MOVE = 13,
JE_GAMEPAD = 14,
+ JE_JOYSTICK = 15,
JE_QUIT = 0x1000
};
@@ -896,6 +897,31 @@ void OSystem_Android::pushEvent(int type, int arg1, int arg2, int arg3,
break;
+ case JE_JOYSTICK:
+ e.mouse = getEventManager()->getMousePos();
+
+ switch (arg1) {
+ case JACTION_MULTIPLE:
+ e.type = Common::EVENT_MOUSEMOVE;
+
+ // already multiplied by 100
+ e.mouse.x += arg2 * _joystick_scale / _eventScaleX;
+ e.mouse.y += arg3 * _joystick_scale / _eventScaleY;
+
+ clipMouse(e.mouse);
+
+ break;
+ default:
+ LOGE("unhandled jaction on joystick: %d", arg1);
+ return;
+ }
+
+ lockMutex(_event_queue_lock);
+ _event_queue.push(e);
+ unlockMutex(_event_queue_lock);
+
+ return;
+
case JE_QUIT:
e.type = Common::EVENT_QUIT;
diff --git a/backends/platform/android/org/scummvm/scummvm/ScummVMActivity.java b/backends/platform/android/org/scummvm/scummvm/ScummVMActivity.java
index 829a948..5d041da 100644
--- a/backends/platform/android/org/scummvm/scummvm/ScummVMActivity.java
+++ b/backends/platform/android/org/scummvm/scummvm/ScummVMActivity.java
@@ -240,6 +240,14 @@ public class ScummVMActivity extends Activity {
return false;
}
+ @Override
+ public boolean onGenericMotionEvent(final MotionEvent e) {
+ if (_events != null)
+ return _events.onGenericMotionEvent(e);
+
+ return false;
+ }
+
private void showKeyboard(boolean show) {
SurfaceView main_surface = (SurfaceView)findViewById(R.id.main_surface);
InputMethodManager imm = (InputMethodManager)
diff --git a/backends/platform/android/org/scummvm/scummvm/ScummVMEvents.java b/backends/platform/android/org/scummvm/scummvm/ScummVMEvents.java
index 9278e7f..21f177f 100644
--- a/backends/platform/android/org/scummvm/scummvm/ScummVMEvents.java
+++ b/backends/platform/android/org/scummvm/scummvm/ScummVMEvents.java
@@ -9,6 +9,7 @@ import android.view.MotionEvent;
import android.view.View;
import android.view.ViewConfiguration;
import android.view.GestureDetector;
+import android.view.InputDevice;
import android.view.inputmethod.InputMethodManager;
public class ScummVMEvents implements
@@ -32,6 +33,7 @@ public class ScummVMEvents implements
public static final int JE_RMB_UP = 12;
public static final int JE_MOUSE_MOVE = 13;
public static final int JE_GAMEPAD = 14;
+ public static final int JE_JOYSTICK = 15;
public static final int JE_QUIT = 0x1000;
final protected Context _context;
@@ -64,6 +66,18 @@ 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;
+ }
+
+ return false;
+ }
+
final static int MSG_MENU_LONG_PRESS = 1;
final private Handler keyHandler = new Handler() {
Commit: bb39cbcba4a3ca8d16b1589e2d07a4325076b01b
https://github.com/scummvm/scummvm/commit/bb39cbcba4a3ca8d16b1589e2d07a4325076b01b
Author: Marcus Comstedt (marcus at mc.pp.se)
Date: 2013-08-08T06:16:06-07:00
Commit Message:
ANDROID: Enter main menu on middle mouse press
Changed paths:
backends/platform/android/events.cpp
backends/platform/android/org/scummvm/scummvm/MouseHelper.java
backends/platform/android/org/scummvm/scummvm/ScummVMEvents.java
diff --git a/backends/platform/android/events.cpp b/backends/platform/android/events.cpp
index 4d7ef9c..5c42db9 100644
--- a/backends/platform/android/events.cpp
+++ b/backends/platform/android/events.cpp
@@ -66,6 +66,8 @@ enum {
JE_MOUSE_MOVE = 13,
JE_GAMEPAD = 14,
JE_JOYSTICK = 15,
+ JE_MMB_DOWN = 16,
+ JE_MMB_UP = 17,
JE_QUIT = 0x1000
};
@@ -922,6 +924,20 @@ void OSystem_Android::pushEvent(int type, int arg1, int arg2, int arg3,
return;
+ case JE_MMB_DOWN:
+ e.type = Common::EVENT_MAINMENU;
+
+ lockMutex(_event_queue_lock);
+ _event_queue.push(e);
+ unlockMutex(_event_queue_lock);
+
+ return;
+
+ case JE_MMB_UP:
+ // No action
+
+ return;
+
case JE_QUIT:
e.type = Common::EVENT_QUIT;
diff --git a/backends/platform/android/org/scummvm/scummvm/MouseHelper.java b/backends/platform/android/org/scummvm/scummvm/MouseHelper.java
index 9998155..8990515 100644
--- a/backends/platform/android/org/scummvm/scummvm/MouseHelper.java
+++ b/backends/platform/android/org/scummvm/scummvm/MouseHelper.java
@@ -14,6 +14,7 @@ public class MouseHelper {
private long _rmbGuardTime;
private boolean _rmbPressed;
private boolean _lmbPressed;
+ private boolean _mmbPressed;
/**
* Class initialization fails when this throws an exception.
@@ -114,6 +115,23 @@ public class MouseHelper {
_rmbPressed = false;
}
+ boolean mmbDown = (buttonState & MotionEvent.BUTTON_TERTIARY) == MotionEvent.BUTTON_TERTIARY;
+ if (mmbDown) {
+ if (!_mmbPressed) {
+ // middle mouse button was pressed just now
+ _scummvm.pushEvent(ScummVMEvents.JE_MMB_DOWN, (int)e.getX(), (int)e.getY(), e.getButtonState(), 0, 0);
+ }
+
+ _mmbPressed = true;
+ } else {
+ if (_mmbPressed) {
+ // middle mouse button was released just now
+ _scummvm.pushEvent(ScummVMEvents.JE_MMB_UP, (int)e.getX(), (int)e.getY(), e.getButtonState(), 0, 0);
+ }
+
+ _mmbPressed = false;
+ }
+
return true;
}
diff --git a/backends/platform/android/org/scummvm/scummvm/ScummVMEvents.java b/backends/platform/android/org/scummvm/scummvm/ScummVMEvents.java
index 21f177f..7022153 100644
--- a/backends/platform/android/org/scummvm/scummvm/ScummVMEvents.java
+++ b/backends/platform/android/org/scummvm/scummvm/ScummVMEvents.java
@@ -34,6 +34,8 @@ public class ScummVMEvents implements
public static final int JE_MOUSE_MOVE = 13;
public static final int JE_GAMEPAD = 14;
public static final int JE_JOYSTICK = 15;
+ public static final int JE_MMB_DOWN = 16;
+ public static final int JE_MMB_UP = 17;
public static final int JE_QUIT = 0x1000;
final protected Context _context;
Commit: 7a1ffe8c59964a502c0168264f9b2872afb94122
https://github.com/scummvm/scummvm/commit/7a1ffe8c59964a502c0168264f9b2872afb94122
Author: Marcus Comstedt (marcus at mc.pp.se)
Date: 2013-08-18T06:21:18-07:00
Commit Message:
ANDROID: Add some margins when screen is a TV
Changed paths:
A dists/android/res/values-television/margins.xml
A dists/android/res/values/margins.xml
backends/platform/android/android.mk
dists/android/res/layout/main.xml
diff --git a/backends/platform/android/android.mk b/backends/platform/android/android.mk
index 34c3a99..b0df5e7 100644
--- a/backends/platform/android/android.mk
+++ b/backends/platform/android/android.mk
@@ -27,6 +27,8 @@ PORT_DISTFILES = $(PATH_DIST)/README.Android
RESOURCES = \
$(PATH_RESOURCES)/values/strings.xml \
+ $(PATH_RESOURCES)/values/margins.xml \
+ $(PATH_RESOURCES)/values-television/margins.xml \
$(PATH_RESOURCES)/layout/main.xml \
$(PATH_RESOURCES)/layout/splash.xml \
$(PATH_RESOURCES)/drawable/gradient.xml \
diff --git a/dists/android/res/layout/main.xml b/dists/android/res/layout/main.xml
index 8b0d515..31aa345 100644
--- a/dists/android/res/layout/main.xml
+++ b/dists/android/res/layout/main.xml
@@ -9,4 +9,8 @@
android:keepScreenOn="true"
android:focusable="true"
android:focusableInTouchMode="true"
+ android:layout_marginTop="@dimen/verticalMargin"
+ android:layout_marginLeft="@dimen/horizontalMargin"
+ android:layout_marginBottom="@dimen/verticalMargin"
+ android:layout_marginRight="@dimen/horizontalMargin"
/>
diff --git a/dists/android/res/values-television/margins.xml b/dists/android/res/values-television/margins.xml
new file mode 100644
index 0000000..df586ee
--- /dev/null
+++ b/dists/android/res/values-television/margins.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources>
+ <dimen name="verticalMargin">45px</dimen>
+ <dimen name="horizontalMargin">80px</dimen>
+</resources>
diff --git a/dists/android/res/values/margins.xml b/dists/android/res/values/margins.xml
new file mode 100644
index 0000000..a865687
--- /dev/null
+++ b/dists/android/res/values/margins.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources>
+ <dimen name="verticalMargin">0px</dimen>
+ <dimen name="horizontalMargin">0px</dimen>
+</resources>
Commit: d4d90b3f07bb379470a2090a8771e4c73be55ff8
https://github.com/scummvm/scummvm/commit/d4d90b3f07bb379470a2090a8771e4c73be55ff8
Author: David Turner (dgturner at iee.org)
Date: 2013-10-08T18:26:49-07:00
Commit Message:
Merge pull request #372 from zeldin/ouya
Basic OUYA support
Changed paths:
A dists/android/res/drawable-xhdpi/ouya_icon.png
A dists/android/res/values-television/margins.xml
A dists/android/res/values/margins.xml
backends/platform/android/android.cpp
backends/platform/android/android.h
backends/platform/android/android.mk
backends/platform/android/events.cpp
backends/platform/android/org/scummvm/scummvm/MouseHelper.java
backends/platform/android/org/scummvm/scummvm/ScummVMActivity.java
backends/platform/android/org/scummvm/scummvm/ScummVMEvents.java
configure
dists/android/AndroidManifest.xml
dists/android/AndroidManifest.xml.in
dists/android/res/layout/main.xml
More information about the Scummvm-git-logs
mailing list