[gnome-games/wip/aplazas/gamepad-event: 11/11] gamepad: Drop usage of StandardGamepadAxis in Vala
- From: Adrien Plazas <aplazas src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-games/wip/aplazas/gamepad-event: 11/11] gamepad: Drop usage of StandardGamepadAxis in Vala
- Date: Sat, 13 May 2017 10:21:03 +0000 (UTC)
commit d3cba251d9e85fb5b98fc6556958f20e35d29b61
Author: Adrien Plazas <kekun plazas laposte net>
Date: Sat May 13 12:05:56 2017 +0200
gamepad: Drop usage of StandardGamepadAxis in Vala
src/Makefile.am | 2 --
src/gamepad/gamepad.vapi | 2 +-
src/gamepad/standard-gamepad-axis.vapi | 10 ----------
src/retro/retro-gamepad.vala | 8 ++++----
4 files changed, 5 insertions(+), 17 deletions(-)
---
diff --git a/src/Makefile.am b/src/Makefile.am
index e7d53d2..64ad992 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -28,7 +28,6 @@ EXTRA_DIST = \
gamepad/gamepad.vapi \
gamepad/gamepad-monitor.vapi \
gamepad/raw-gamepad.vapi \
- gamepad/standard-gamepad-axis.vapi \
$(NULL)
header_file = libgnome-games.h
@@ -196,7 +195,6 @@ gnome_games_VALAFLAGS = \
--pkg gamepad \
--pkg gamepad-monitor \
--pkg raw-gamepad \
- --pkg standard-gamepad-axis \
--gresources $(gresource_file) \
--vapi $(vapi_file) \
--vapidir=event/ \
diff --git a/src/gamepad/gamepad.vapi b/src/gamepad/gamepad.vapi
index d2f6ff8..fd0e581 100644
--- a/src/gamepad/gamepad.vapi
+++ b/src/gamepad/gamepad.vapi
@@ -4,7 +4,7 @@
private class Games.Gamepad : GLib.Object {
public signal void event (Event event);
public signal void button_event (uint16 button, bool value);
- public signal void axis_event (StandardGamepadAxis axis, double value);
+ public signal void axis_event (uint16 axis, double value);
public signal void unplugged ();
public Gamepad (RawGamepad raw_gamepad) throws GLib.Error;
}
diff --git a/src/retro/retro-gamepad.vala b/src/retro/retro-gamepad.vala
index 647cca9..abb9f15 100644
--- a/src/retro/retro-gamepad.vala
+++ b/src/retro/retro-gamepad.vala
@@ -87,18 +87,18 @@ private class Games.RetroGamepad: Object, Retro.InputDevice {
case Retro.AnalogIndex.LEFT:
switch (id) {
case Retro.AnalogId.X:
- return axes[StandardGamepadAxis.LEFT_X];
+ return axes[EventCode.ABS_X];
case Retro.AnalogId.Y:
- return axes[StandardGamepadAxis.LEFT_Y];
+ return axes[EventCode.ABS_Y];
default:
return 0;
}
case Retro.AnalogIndex.RIGHT:
switch (id) {
case Retro.AnalogId.X:
- return axes[StandardGamepadAxis.RIGHT_X];
+ return axes[EventCode.ABS_RX];
case Retro.AnalogId.Y:
- return axes[StandardGamepadAxis.RIGHT_Y];
+ return axes[EventCode.ABS_RY];
default:
return 0;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]