mirror of
https://github.com/libretro/RetroArch
synced 2025-03-22 07:21:15 +00:00
(joypad_connection.c ) change 'used' to 'connected'
This commit is contained in:
parent
738d70d2f8
commit
65f6d2253d
@ -23,7 +23,7 @@ static int find_vacant_pad(joypad_connection_t *joyconn)
|
|||||||
for (i = 0; i < MAX_USERS; i++)
|
for (i = 0; i < MAX_USERS; i++)
|
||||||
{
|
{
|
||||||
joypad_connection_t *conn = (joypad_connection_t*)&joyconn[i];
|
joypad_connection_t *conn = (joypad_connection_t*)&joyconn[i];
|
||||||
if (conn && !conn->used)
|
if (conn && !conn->connected)
|
||||||
return i;
|
return i;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -43,10 +43,10 @@ void *pad_connection_init(unsigned pads)
|
|||||||
{
|
{
|
||||||
joypad_connection_t *conn = (joypad_connection_t*)&joyconn[i];
|
joypad_connection_t *conn = (joypad_connection_t*)&joyconn[i];
|
||||||
|
|
||||||
conn->used = false;
|
conn->connected = false;
|
||||||
conn->iface = NULL;
|
conn->iface = NULL;
|
||||||
conn->is_gcapi = false;
|
conn->is_gcapi = false;
|
||||||
conn->data = NULL;
|
conn->data = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
return joyconn;
|
return joyconn;
|
||||||
@ -62,7 +62,7 @@ int32_t pad_connection_pad_init(joypad_connection_t *joyconn,
|
|||||||
unsigned i;
|
unsigned i;
|
||||||
joypad_connection_t* s = (joypad_connection_t*)&joyconn[pad];
|
joypad_connection_t* s = (joypad_connection_t*)&joyconn[pad];
|
||||||
|
|
||||||
s->used = true;
|
s->connected = true;
|
||||||
|
|
||||||
static const struct
|
static const struct
|
||||||
{
|
{
|
||||||
@ -100,8 +100,8 @@ int32_t apple_joypad_connect_gcapi(joypad_connection_t *joyconn)
|
|||||||
|
|
||||||
if (s)
|
if (s)
|
||||||
{
|
{
|
||||||
s->used = true;
|
s->connected = true;
|
||||||
s->is_gcapi = true;
|
s->is_gcapi = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -110,7 +110,7 @@ int32_t apple_joypad_connect_gcapi(joypad_connection_t *joyconn)
|
|||||||
|
|
||||||
void pad_connection_pad_deinit(joypad_connection_t *s, uint32_t pad)
|
void pad_connection_pad_deinit(joypad_connection_t *s, uint32_t pad)
|
||||||
{
|
{
|
||||||
if (!s || !s->used)
|
if (!s || !s->connected)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (s->iface)
|
if (s->iface)
|
||||||
@ -121,15 +121,15 @@ void pad_connection_pad_deinit(joypad_connection_t *s, uint32_t pad)
|
|||||||
s->iface->deinit(s->data);
|
s->iface->deinit(s->data);
|
||||||
}
|
}
|
||||||
|
|
||||||
s->iface = NULL;
|
s->iface = NULL;
|
||||||
s->used = false;
|
s->connected = false;
|
||||||
s->is_gcapi = false;
|
s->is_gcapi = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
void pad_connection_packet(joypad_connection_t *s, uint32_t pad,
|
void pad_connection_packet(joypad_connection_t *s, uint32_t pad,
|
||||||
uint8_t* data, uint32_t length)
|
uint8_t* data, uint32_t length)
|
||||||
{
|
{
|
||||||
if (!s->used)
|
if (!s->connected)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (s->iface && s->data && s->iface->packet_handler)
|
if (s->iface && s->data && s->iface->packet_handler)
|
||||||
@ -153,7 +153,7 @@ int16_t pad_connection_get_axis(joypad_connection_t *s,
|
|||||||
|
|
||||||
bool pad_connection_has_interface(joypad_connection_t *s, unsigned pad)
|
bool pad_connection_has_interface(joypad_connection_t *s, unsigned pad)
|
||||||
{
|
{
|
||||||
if (s->used && s->iface)
|
if (s->connected && s->iface)
|
||||||
return true;
|
return true;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@ -172,7 +172,7 @@ void pad_connection_destroy(joypad_connection_t *joyconn)
|
|||||||
bool pad_connection_rumble(joypad_connection_t *s,
|
bool pad_connection_rumble(joypad_connection_t *s,
|
||||||
unsigned pad, enum retro_rumble_effect effect, uint16_t strength)
|
unsigned pad, enum retro_rumble_effect effect, uint16_t strength)
|
||||||
{
|
{
|
||||||
if (!s->used)
|
if (!s->connected)
|
||||||
return false;
|
return false;
|
||||||
if (!s->iface)
|
if (!s->iface)
|
||||||
return false;
|
return false;
|
||||||
|
@ -39,7 +39,7 @@ extern pad_connection_interface_t pad_connection_ps3;
|
|||||||
|
|
||||||
typedef struct
|
typedef struct
|
||||||
{
|
{
|
||||||
bool used;
|
bool connected;
|
||||||
struct pad_connection_interface *iface;
|
struct pad_connection_interface *iface;
|
||||||
void* data;
|
void* data;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user