[gnome-games: 14/20] gamepad: Make GamepadDPad class a struct
- From: Adrien Plazas <aplazas src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-games: 14/20] gamepad: Make GamepadDPad class a struct
- Date: Wed, 3 May 2017 08:21:58 +0000 (UTC)
commit b8f3cc6cd4c25f2fd209e526db99d34f5ed9e119
Author: Adrien Plazas <kekun plazas laposte net>
Date: Fri Apr 28 14:10:48 2017 +0200
gamepad: Make GamepadDPad class a struct
This better reflects the usage of this type.
https://bugzilla.gnome.org/show_bug.cgi?id=781572
src/gamepad/gamepad-dpad.vala | 13 ++++---------
src/gamepad/gamepad-mapping.vala | 2 +-
2 files changed, 5 insertions(+), 10 deletions(-)
---
diff --git a/src/gamepad/gamepad-dpad.vala b/src/gamepad/gamepad-dpad.vala
index 87e7443..ae2355e 100644
--- a/src/gamepad/gamepad-dpad.vala
+++ b/src/gamepad/gamepad-dpad.vala
@@ -1,12 +1,7 @@
// This file is part of GNOME Games. License: GPL-3.0+.
-private class Games.GamepadDPad : Object {
- public GamepadInputType types[4];
- public int values[4];
- public int axis_values[2];
-
- public GamepadDPad () {
- axis_values[0] = axis_values[1] = 0;
- types[0] = types[1] = types[2] = types[3] = GamepadInputType.INVALID;
- }
+private struct Games.GamepadDPad {
+ GamepadInputType types[4];
+ int values[4];
+ int axis_values[2];
}
diff --git a/src/gamepad/gamepad-mapping.vala b/src/gamepad/gamepad-mapping.vala
index 4526e1d..cba06fb 100644
--- a/src/gamepad/gamepad-mapping.vala
+++ b/src/gamepad/gamepad-mapping.vala
@@ -128,7 +128,7 @@ private class Games.GamepadMapping : Object {
dpad_position++;
}
while (dpads.length <= dpad_index)
- dpads += new GamepadDPad ();
+ dpads += GamepadDPad ();
dpads[dpad_index].types[dpad_position] = type;
dpads[dpad_index].values[dpad_position] = parsed_key;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]