mirror of
https://github.com/libretro/RetroArch
synced 2025-03-29 22:20:21 +00:00
Move dinput_joypad_get_vidpid_from_xinput_index to
xinput_hybrid_joypad.c
This commit is contained in:
parent
212fc885ed
commit
65af2828da
@ -50,32 +50,6 @@ extern int g_xinput_pad_indexes[MAX_USERS];
|
||||
|
||||
#include "dinput_joypad_inl.h"
|
||||
|
||||
bool dinput_joypad_get_vidpid_from_xinput_index(
|
||||
int32_t index, int32_t *vid,
|
||||
int32_t *pid, int32_t *dinput_index)
|
||||
{
|
||||
int i;
|
||||
|
||||
for (i = 0; i < ARRAY_SIZE(g_xinput_pad_indexes); i++)
|
||||
{
|
||||
/* Found XInput pad? */
|
||||
if (index == g_xinput_pad_indexes[i])
|
||||
{
|
||||
if (vid)
|
||||
*vid = g_pads[i].vid;
|
||||
|
||||
if (pid)
|
||||
*pid = g_pads[i].pid;
|
||||
|
||||
if (dinput_index)
|
||||
*dinput_index = i;
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/* Based on SDL2's implementation. */
|
||||
bool guid_is_xinput_device(const GUID* product_guid)
|
||||
|
@ -41,10 +41,6 @@ struct dinput_joypad_data
|
||||
DIEFFECT rumble_props;
|
||||
};
|
||||
|
||||
bool dinput_joypad_get_vidpid_from_xinput_index(
|
||||
int32_t index, int32_t *vid,
|
||||
int32_t *pid, int32_t *dinput_index);
|
||||
|
||||
RETRO_END_DECLS
|
||||
|
||||
#endif
|
||||
|
@ -117,6 +117,33 @@ static const uint16_t button_index_to_bitmap_code[] = {
|
||||
/* Forward declaration */
|
||||
bool guid_is_xinput_device(const GUID* product_guid);
|
||||
|
||||
static bool dinput_joypad_get_vidpid_from_xinput_index(
|
||||
int32_t index, int32_t *vid,
|
||||
int32_t *pid, int32_t *dinput_index)
|
||||
{
|
||||
int i;
|
||||
|
||||
for (i = 0; i < ARRAY_SIZE(g_xinput_pad_indexes); i++)
|
||||
{
|
||||
/* Found XInput pad? */
|
||||
if (index == g_xinput_pad_indexes[i])
|
||||
{
|
||||
if (vid)
|
||||
*vid = g_pads[i].vid;
|
||||
|
||||
if (pid)
|
||||
*pid = g_pads[i].pid;
|
||||
|
||||
if (dinput_index)
|
||||
*dinput_index = i;
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
static BOOL CALLBACK enum_joypad_cb_hybrid(
|
||||
const DIDEVICEINSTANCE *inst, void *p)
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user