[gnome-games] gamepad: Drop usage of StandardGamepadAxis in Vala
- From: Adrien Plazas <aplazas src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-games] gamepad: Drop usage of StandardGamepadAxis in Vala
- Date: Sun, 14 May 2017 17:06:34 +0000 (UTC)
commit 30104a2f9d0d8600bf3b61cf307bc71e92cdcaf9
Author: Adrien Plazas <kekun plazas laposte net>
Date: Sat May 13 12:05:56 2017 +0200
gamepad: Drop usage of StandardGamepadAxis in Vala
https://bugzilla.gnome.org/show_bug.cgi?id=782611
src/Makefile.am | 2 --
src/gamepad/gamepad.c | 4 ++--
src/gamepad/gamepad.vapi | 4 ++--
src/gamepad/standard-gamepad-axis.vapi | 10 ----------
src/retro/retro-gamepad.vala | 8 ++++----
5 files changed, 8 insertions(+), 20 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.c b/src/gamepad/gamepad.c
index ad180d5..c8ce869 100644
--- a/src/gamepad/gamepad.c
+++ b/src/gamepad/gamepad.c
@@ -295,7 +295,7 @@ static void games_gamepad_class_init (GamesGamepadClass *klass) {
0, NULL, NULL,
NULL,
G_TYPE_NONE, 2,
- GAMES_TYPE_STANDARD_GAMEPAD_BUTTON,
+ G_TYPE_UINT,
G_TYPE_BOOLEAN);
/**
@@ -312,7 +312,7 @@ static void games_gamepad_class_init (GamesGamepadClass *klass) {
0, NULL, NULL,
NULL,
G_TYPE_NONE, 2,
- GAMES_TYPE_STANDARD_GAMEPAD_AXIS,
+ G_TYPE_UINT,
G_TYPE_DOUBLE);
/**
diff --git a/src/gamepad/gamepad.vapi b/src/gamepad/gamepad.vapi
index d2f6ff8..1e2fd2a 100644
--- a/src/gamepad/gamepad.vapi
+++ b/src/gamepad/gamepad.vapi
@@ -3,8 +3,8 @@
[CCode (cheader_filename = "gamepad.h")]
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 button_event (uint button, bool value);
+ public signal void axis_event (uint 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]