Move set_rumble function to input/input_driver.c

This commit is contained in:
twinaphex 2015-01-19 04:16:43 +01:00
parent d40f7467eb
commit 3ec9005c5c
6 changed files with 34 additions and 33 deletions

View File

@ -261,24 +261,6 @@ void driver_set_nonblock_state(bool enable)
g_extern.audio_data.block_chunk_size;
}
/**
* driver_set_rumble_state:
* @port : User number.
* @effect : Rumble effect.
* @strength : Strength of rumble effect.
*
* Sets the rumble state.
* Used by RETRO_ENVIRONMENT_GET_RUMBLE_INTERFACE.
**/
bool driver_set_rumble_state(unsigned port,
enum retro_rumble_effect effect, uint16_t strength)
{
if (driver.input && driver.input_data && driver.input->set_rumble)
return driver.input->set_rumble(driver.input_data,
port, effect, strength);
return false;
}
/**
* driver_get_current_framebuffer:
*

View File

@ -380,18 +380,6 @@ uintptr_t driver_get_current_framebuffer(void);
retro_proc_address_t driver_get_proc_address(const char *sym);
/**
* driver_set_rumble_state:
* @port : User number.
* @effect : Rumble effect.
* @strength : Strength of rumble effect.
*
* Sets the rumble state.
* Used by RETRO_ENVIRONMENT_GET_RUMBLE_INTERFACE.
**/
bool driver_set_rumble_state(unsigned port,
enum retro_rumble_effect effect, uint16_t strength);
/**
* driver_update_system_av_info:
* @info : pointer to new A/V info

View File

@ -1010,7 +1010,7 @@ bool rarch_environment_cb(unsigned cmd, void *data)
(struct retro_rumble_interface*)data;
RARCH_LOG("Environ GET_RUMBLE_INTERFACE.\n");
iface->set_rumble_state = driver_set_rumble_state;
iface->set_rumble_state = input_driver_set_rumble_state;
break;
}

View File

@ -19,6 +19,7 @@
#include "input_driver.h"
#include "../driver.h"
#include "../general.h"
#include "../libretro.h"
static const input_driver_t *input_drivers[] = {
#ifdef __CELLOS_LV2__
@ -153,3 +154,21 @@ void find_input_driver(void)
rarch_fail(1, "find_input_driver()");
}
}
/**
* input_driver_set_rumble_state:
* @port : User number.
* @effect : Rumble effect.
* @strength : Strength of rumble effect.
*
* Sets the rumble state.
* Used by RETRO_ENVIRONMENT_GET_RUMBLE_INTERFACE.
**/
bool input_driver_set_rumble_state(unsigned port,
enum retro_rumble_effect effect, uint16_t strength)
{
if (driver.input && driver.input_data && driver.input->set_rumble)
return driver.input->set_rumble(driver.input_data,
port, effect, strength);
return false;
}

View File

@ -121,6 +121,18 @@ const char* config_get_input_driver_options(void);
void find_input_driver(void);
/**
* input_driver_set_rumble_state:
* @port : User number.
* @effect : Rumble effect.
* @strength : Strength of rumble effect.
*
* Sets the rumble state.
* Used by RETRO_ENVIRONMENT_GET_RUMBLE_INTERFACE.
**/
bool input_driver_set_rumble_state(unsigned port,
enum retro_rumble_effect effect, uint16_t strength);
#ifdef __cplusplus
}
#endif

View File

@ -3050,8 +3050,8 @@ bool rarch_main_command(unsigned cmd)
case RARCH_CMD_RUMBLE_STOP:
for (i = 0; i < MAX_USERS; i++)
{
driver_set_rumble_state(i, RETRO_RUMBLE_STRONG, 0);
driver_set_rumble_state(i, RETRO_RUMBLE_WEAK, 0);
input_driver_set_rumble_state(i, RETRO_RUMBLE_STRONG, 0);
input_driver_set_rumble_state(i, RETRO_RUMBLE_WEAK, 0);
}
break;
case RARCH_CMD_GRAB_MOUSE_TOGGLE: