mirror of
https://github.com/libretro/RetroArch
synced 2025-04-09 21:45:45 +00:00
Move set_rumble function to input/input_driver.c
This commit is contained in:
parent
d40f7467eb
commit
3ec9005c5c
18
driver.c
18
driver.c
@ -261,24 +261,6 @@ void driver_set_nonblock_state(bool enable)
|
|||||||
g_extern.audio_data.block_chunk_size;
|
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:
|
* driver_get_current_framebuffer:
|
||||||
*
|
*
|
||||||
|
12
driver.h
12
driver.h
@ -380,18 +380,6 @@ uintptr_t driver_get_current_framebuffer(void);
|
|||||||
|
|
||||||
retro_proc_address_t driver_get_proc_address(const char *sym);
|
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:
|
* driver_update_system_av_info:
|
||||||
* @info : pointer to new A/V info
|
* @info : pointer to new A/V info
|
||||||
|
@ -1010,7 +1010,7 @@ bool rarch_environment_cb(unsigned cmd, void *data)
|
|||||||
(struct retro_rumble_interface*)data;
|
(struct retro_rumble_interface*)data;
|
||||||
|
|
||||||
RARCH_LOG("Environ GET_RUMBLE_INTERFACE.\n");
|
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;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -19,6 +19,7 @@
|
|||||||
#include "input_driver.h"
|
#include "input_driver.h"
|
||||||
#include "../driver.h"
|
#include "../driver.h"
|
||||||
#include "../general.h"
|
#include "../general.h"
|
||||||
|
#include "../libretro.h"
|
||||||
|
|
||||||
static const input_driver_t *input_drivers[] = {
|
static const input_driver_t *input_drivers[] = {
|
||||||
#ifdef __CELLOS_LV2__
|
#ifdef __CELLOS_LV2__
|
||||||
@ -153,3 +154,21 @@ void find_input_driver(void)
|
|||||||
rarch_fail(1, "find_input_driver()");
|
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;
|
||||||
|
}
|
||||||
|
@ -121,6 +121,18 @@ const char* config_get_input_driver_options(void);
|
|||||||
|
|
||||||
void find_input_driver(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
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
@ -3050,8 +3050,8 @@ bool rarch_main_command(unsigned cmd)
|
|||||||
case RARCH_CMD_RUMBLE_STOP:
|
case RARCH_CMD_RUMBLE_STOP:
|
||||||
for (i = 0; i < MAX_USERS; i++)
|
for (i = 0; i < MAX_USERS; i++)
|
||||||
{
|
{
|
||||||
driver_set_rumble_state(i, RETRO_RUMBLE_STRONG, 0);
|
input_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_WEAK, 0);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case RARCH_CMD_GRAB_MOUSE_TOGGLE:
|
case RARCH_CMD_GRAB_MOUSE_TOGGLE:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user