diff --git a/Makefile.common b/Makefile.common index 1ad62389f3..c152dd310a 100644 --- a/Makefile.common +++ b/Makefile.common @@ -165,7 +165,6 @@ OBJ += frontend/frontend.o \ input/input_common.o \ input/input_keymaps.o \ input/input_remapping.o \ - input/input_sensor.o \ tasks/task_overlay.o \ input/input_overlay.o \ patch.o \ diff --git a/dynamic.c b/dynamic.c index df3d84181b..debd866974 100644 --- a/dynamic.c +++ b/dynamic.c @@ -30,6 +30,8 @@ #include "performance.h" #include "audio/audio_driver.h" +#include "input/input_driver.h" + #include "libretro_private.h" #include "cores/internal_cores.h" #include "retroarch.h" @@ -38,7 +40,6 @@ #include "msg_hash.h" #include "verbosity.h" -#include "input/input_sensor.h" #ifdef HAVE_DYNAMIC #define SYMBOL(x) do { \ diff --git a/griffin/griffin.c b/griffin/griffin.c index 8a95d84d4f..b0b71ef93f 100644 --- a/griffin/griffin.c +++ b/griffin/griffin.c @@ -311,7 +311,6 @@ INPUT #include "../input/input_common.c" #include "../input/input_keymaps.c" #include "../input/input_remapping.c" -#include "../input/input_sensor.c" #include "../input/keyboard_line.c" #ifdef HAVE_OVERLAY diff --git a/input/input_driver.c b/input/input_driver.c index 4bebd4dba1..e48ed88ad2 100644 --- a/input/input_driver.c +++ b/input/input_driver.c @@ -289,3 +289,35 @@ void input_driver_keyboard_mapping_set_block(bool value) if (input->keyboard_mapping_set_block) driver->input->keyboard_mapping_set_block(driver->input_data, value); } + +/** + * input_sensor_set_state: + * @port : User number. + * @effect : Sensor action. + * @rate : Sensor rate update. + * + * Sets the sensor state. + * Used by RETRO_ENVIRONMENT_GET_SENSOR_INTERFACE. + **/ +bool input_sensor_set_state(unsigned port, + enum retro_sensor_action action, unsigned rate) +{ + driver_t *driver = driver_get_ptr(); + + if (driver->input && driver->input_data && + driver->input->set_sensor_state) + return driver->input->set_sensor_state(driver->input_data, + port, action, rate); + return false; +} + +float input_sensor_get_input(unsigned port, unsigned id) +{ + driver_t *driver = driver_get_ptr(); + + if (driver->input && driver->input_data && + driver->input->get_sensor_input) + return driver->input->get_sensor_input(driver->input_data, + port, id); + return 0.0f; +} diff --git a/input/input_driver.h b/input/input_driver.h index f8d699eb27..0942110a5c 100644 --- a/input/input_driver.h +++ b/input/input_driver.h @@ -179,6 +179,20 @@ const input_driver_t *input_get_ptr(void *data); void input_driver_set(const input_driver_t **input, void **input_data); +/** + * input_sensor_set_state: + * @port : User number. + * @effect : Sensor action. + * @rate : Sensor rate update. + * + * Sets the sensor state. + * Used by RETRO_ENVIRONMENT_GET_SENSOR_INTERFACE. + **/ +bool input_sensor_set_state(unsigned port, + enum retro_sensor_action action, unsigned rate); + +float input_sensor_get_input(unsigned port, unsigned id); + #ifdef __cplusplus } #endif diff --git a/input/input_sensor.c b/input/input_sensor.c deleted file mode 100644 index 1cae2b1e0f..0000000000 --- a/input/input_sensor.c +++ /dev/null @@ -1,51 +0,0 @@ -/* RetroArch - A frontend for libretro. - * Copyright (C) 2010-2014 - Hans-Kristian Arntzen - * Copyright (C) 2011-2015 - Daniel De Matteis - * - * RetroArch is free software: you can redistribute it and/or modify it under the terms - * of the GNU General Public License as published by the Free Software Found- - * ation, either version 3 of the License, or (at your option) any later version. - * - * RetroArch is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; - * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - * PURPOSE. See the GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along with RetroArch. - * If not, see . - */ - -#include "input_sensor.h" - -#include "../driver.h" - -/** - * input_sensor_set_state: - * @port : User number. - * @effect : Sensor action. - * @rate : Sensor rate update. - * - * Sets the sensor state. - * Used by RETRO_ENVIRONMENT_GET_SENSOR_INTERFACE. - **/ -bool input_sensor_set_state(unsigned port, - enum retro_sensor_action action, unsigned rate) -{ - driver_t *driver = driver_get_ptr(); - - if (driver->input && driver->input_data && - driver->input->set_sensor_state) - return driver->input->set_sensor_state(driver->input_data, - port, action, rate); - return false; -} - -float input_sensor_get_input(unsigned port, unsigned id) -{ - driver_t *driver = driver_get_ptr(); - - if (driver->input && driver->input_data && - driver->input->get_sensor_input) - return driver->input->get_sensor_input(driver->input_data, - port, id); - return 0.0f; -} diff --git a/input/input_sensor.h b/input/input_sensor.h deleted file mode 100644 index 344538ab32..0000000000 --- a/input/input_sensor.h +++ /dev/null @@ -1,36 +0,0 @@ -/* RetroArch - A frontend for libretro. - * Copyright (C) 2010-2014 - Hans-Kristian Arntzen - * Copyright (C) 2011-2015 - Daniel De Matteis - * - * RetroArch is free software: you can redistribute it and/or modify it under the terms - * of the GNU General Public License as published by the Free Software Found- - * ation, either version 3 of the License, or (at your option) any later version. - * - * RetroArch is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; - * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - * PURPOSE. See the GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along with RetroArch. - * If not, see . - */ - -#ifndef __INPUT_SENSOR_H -#define __INPUT_SENSOR_H - -#include "../libretro.h" - -/** - * input_sensor_set_state: - * @port : User number. - * @effect : Sensor action. - * @rate : Sensor rate update. - * - * Sets the sensor state. - * Used by RETRO_ENVIRONMENT_GET_SENSOR_INTERFACE. - **/ -bool input_sensor_set_state(unsigned port, - enum retro_sensor_action action, unsigned rate); - -float input_sensor_get_input(unsigned port, unsigned id); - -#endif diff --git a/tasks/task_overlay.c b/tasks/task_overlay.c index f07be6f52c..d775352050 100644 --- a/tasks/task_overlay.c +++ b/tasks/task_overlay.c @@ -638,7 +638,6 @@ task_finished: if (task->cancelled) { - struct overlay *o; unsigned i; if (task->error)