[retro-gtk] retro-gobject: Remove unused sensor interface



commit 552cab0a2de3cffbaba8f2ea09c5a23909c41763
Author: Adrien Plazas <kekun plazas laposte net>
Date:   Thu Jan 19 10:19:32 2017 +0100

    retro-gobject: Remove unused sensor interface
    
    https://bugzilla.gnome.org/show_bug.cgi?id=777482

 retro-gobject/Makefile.am         |    1 -
 retro-gobject/core.vala           |   10 --------
 retro-gobject/retro-environment.c |   42 -------------------------------------
 retro-gobject/sensor.vala         |   31 ---------------------------
 4 files changed, 0 insertions(+), 84 deletions(-)
---
diff --git a/retro-gobject/Makefile.am b/retro-gobject/Makefile.am
index d80e7c0..8a3d65a 100644
--- a/retro-gobject/Makefile.am
+++ b/retro-gobject/Makefile.am
@@ -56,7 +56,6 @@ libretro_gobject_la_SOURCES = \
        retro.vala \
        retro-module-query.vala \
        rumble.vala \
-       sensor.vala \
        subsystem.vala \
        system-info.vala \
        video.vala \
diff --git a/retro-gobject/core.vala b/retro-gobject/core.vala
index d25a4b7..8455e9d 100644
--- a/retro-gobject/core.vala
+++ b/retro-gobject/core.vala
@@ -276,16 +276,6 @@ public class Core : Object {
        public Rumble rumble_interface { set; get; }
 
        /**
-        * The sensor interface.
-        *
-        * Optional.
-        * If set, it must be set before {@link init} is called.
-        *
-        * TODO Change visibility once the interface have been tested.
-        */
-       internal Sensor sensor_interface { set; get; }
-
-       /**
         * The camera interface.
         *
         * Optional.
diff --git a/retro-gobject/retro-environment.c b/retro-gobject/retro-environment.c
index fa8054b..50e24f4 100644
--- a/retro-gobject/retro-environment.c
+++ b/retro-gobject/retro-environment.c
@@ -47,11 +47,6 @@ typedef struct {
        gpointer set_rumble_state;
 } RetroRumbleCallback;
 
-typedef struct {
-       gpointer set_sensor_state;
-       gpointer get_sensor_input;
-} RetroSensorCallback;
-
 static gboolean rumble_callback_set_rumble_state (guint port, RetroRumbleEffect effect, guint16 strength) {
        RetroCore *cb_data = retro_core_get_cb_data ();
        if (!cb_data)
@@ -64,30 +59,6 @@ static gboolean rumble_callback_set_rumble_state (guint port, RetroRumbleEffect
        return RETRO_RUMBLE_GET_INTERFACE (interface)->set_rumble_state (interface, port, effect, strength);
 }
 
-static gboolean sensor_callback_set_sensor_state (guint port, RetroSensorAction action, guint rate) {
-       RetroCore *cb_data = retro_core_get_cb_data ();
-       if (!cb_data)
-               g_return_val_if_reached (FALSE);
-
-       RetroSensor *interface = retro_core_get_sensor_interface (cb_data);
-       if (!interface)
-               g_return_val_if_reached (FALSE);
-
-       return RETRO_SENSOR_GET_INTERFACE (interface)->set_sensor_state (interface, port, action, rate);
-}
-
-static gfloat sensor_callback_get_sensor_input (guint port, guint id) {
-       RetroCore *cb_data = retro_core_get_cb_data ();
-       if (!cb_data)
-               g_return_val_if_reached (0.0);
-
-       RetroSensor *interface = retro_core_get_sensor_interface (cb_data);
-       if (!interface)
-               g_return_val_if_reached (0.0);
-
-       return RETRO_SENSOR_GET_INTERFACE (interface)->get_sensor_input (interface, port, id);
-}
-
 static gboolean camera_callback_start () {
        RetroCore *cb_data = retro_core_get_cb_data ();
        if (!cb_data)
@@ -441,17 +412,6 @@ static gboolean get_save_directory (RetroCore *self, const gchar* *save_director
        return TRUE;
 }
 
-static gboolean get_sensor_callback (RetroCore *self, RetroSensorCallback *cb) {
-       void *interface_exists = retro_core_get_sensor_interface (self);
-       if (!interface_exists)
-               return FALSE;
-
-       cb->set_sensor_state = sensor_callback_set_sensor_state;
-       cb->get_sensor_input = sensor_callback_get_sensor_input;
-
-       return TRUE;
-}
-
 static gboolean get_system_directory (RetroCore *self, const gchar* *system_directory) {
        *(system_directory) = retro_core_get_system_directory (self);
 
@@ -665,8 +625,6 @@ static gboolean environment_interfaces_command (RetroCore *self, unsigned cmd, g
                return get_rumble_callback (self, (RetroRumbleCallback *) data);
 
        case RETRO_ENVIRONMENT_GET_SENSOR_INTERFACE:
-               return get_sensor_callback (self, (RetroSensorCallback *) data);
-
        default:
                return FALSE;
        }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]