(Blackberry) Minor style nit

This commit is contained in:
twinaphex 2013-04-09 02:33:50 +02:00
parent 5232bc2683
commit e26359a564

View File

@ -106,14 +106,10 @@ static void process_gamepad_event(screen_event_t screen_event, int type)
screen_get_event_property_iv(screen_event, SCREEN_PROPERTY_BUTTONS, &controller->buttons); screen_get_event_property_iv(screen_event, SCREEN_PROPERTY_BUTTONS, &controller->buttons);
if (controller->analogCount > 0) if (controller->analogCount > 0)
{
screen_get_event_property_iv(screen_event, SCREEN_PROPERTY_ANALOG0, controller->analog0); screen_get_event_property_iv(screen_event, SCREEN_PROPERTY_ANALOG0, controller->analog0);
}
if (controller->analogCount == 2) if (controller->analogCount == 2)
{
screen_get_event_property_iv(screen_event, SCREEN_PROPERTY_ANALOG1, controller->analog1); screen_get_event_property_iv(screen_event, SCREEN_PROPERTY_ANALOG1, controller->analog1);
}
} }
static void loadController(input_device_t* controller) static void loadController(input_device_t* controller)
@ -132,31 +128,21 @@ static void loadController(input_device_t* controller)
// Check for the existence of analog sticks. // Check for the existence of analog sticks.
if (!screen_get_device_property_iv(controller->handle, SCREEN_PROPERTY_ANALOG0, controller->analog0)) if (!screen_get_device_property_iv(controller->handle, SCREEN_PROPERTY_ANALOG0, controller->analog0))
{
++controller->analogCount; ++controller->analogCount;
}
if (!screen_get_device_property_iv(controller->handle, SCREEN_PROPERTY_ANALOG1, controller->analog1)) if (!screen_get_device_property_iv(controller->handle, SCREEN_PROPERTY_ANALOG1, controller->analog1))
{
++controller->analogCount; ++controller->analogCount;
} }
}
//Screen service will map supported controllers, we still might need to adjust. //Screen service will map supported controllers, we still might need to adjust.
qnx_input_autodetect_gamepad(controller); qnx_input_autodetect_gamepad(controller);
if (controller->type == SCREEN_EVENT_GAMEPAD) if (controller->type == SCREEN_EVENT_GAMEPAD)
{
RARCH_LOG("Gamepad Device Connected:\n"); RARCH_LOG("Gamepad Device Connected:\n");
}
else if (controller->type == SCREEN_EVENT_JOYSTICK) else if (controller->type == SCREEN_EVENT_JOYSTICK)
{
RARCH_LOG("Joystick Device Connected:\n"); RARCH_LOG("Joystick Device Connected:\n");
}
else if (controller->type == SCREEN_EVENT_KEYBOARD) else if (controller->type == SCREEN_EVENT_KEYBOARD)
{
RARCH_LOG("Keyboard Device Connected:\n"); RARCH_LOG("Keyboard Device Connected:\n");
}
RARCH_LOG("\tID: %s\n", controller->id); RARCH_LOG("\tID: %s\n", controller->id);
RARCH_LOG("\tVendor: %s\n", controller->vendor); RARCH_LOG("\tVendor: %s\n", controller->vendor);
@ -176,6 +162,7 @@ static void discoverControllers()
// Scan the list for gamepad and joystick devices. // Scan the list for gamepad and joystick devices.
int i; int i;
for (i = 0; i < deviceCount; i++) for (i = 0; i < deviceCount; i++)
{ {
int type; int type;
@ -188,11 +175,9 @@ static void discoverControllers()
pads_connected++; pads_connected++;
if (pads_connected == MAX_PADS) if (pads_connected == MAX_PADS)
{
break; break;
} }
} }
}
free(devices_found); free(devices_found);
} }
@ -230,21 +215,13 @@ static void qnx_input_autodetect_gamepad(input_device_t* controller)
//CCCC is the device's Product ID (also in hexadecimal) //CCCC is the device's Product ID (also in hexadecimal)
//D.D is the device's version number //D.D is the device's version number
if (strstr(controller->id, "057E-0306")) if (strstr(controller->id, "057E-0306"))
{
device = DEVICE_WIIMOTE; device = DEVICE_WIIMOTE;
}
else if (strstr(controller->id, "0A5C-8502")) else if (strstr(controller->id, "0A5C-8502"))
{
device = DEVICE_KEYBOARD; device = DEVICE_KEYBOARD;
}
else if (controller->id) else if (controller->id)
{
device = DEVICE_UNKNOWN; device = DEVICE_UNKNOWN;
}
else else
{
device = DEVICE_NONE; device = DEVICE_NONE;
}
if (driver.input->set_keybinds) if (driver.input->set_keybinds)
driver.input->set_keybinds((void*)controller, device, pads_connected, 0, driver.input->set_keybinds((void*)controller, device, pads_connected, 0,
@ -294,14 +271,10 @@ static void process_keyboard_event(screen_event_t event, int type)
if ((unsigned int)g_settings.input.binds[i][b].joykey == (unsigned int)(sym&0xFF)) if ((unsigned int)g_settings.input.binds[i][b].joykey == (unsigned int)(sym&0xFF))
{ {
if (flags & KEY_DOWN) if (flags & KEY_DOWN)
{
controller->buttons |= 1 << b; controller->buttons |= 1 << b;
}
else else
{
controller->buttons &= ~(1<<b); controller->buttons &= ~(1<<b);
} }
}
} }
} }
@ -479,7 +452,6 @@ static void *qnx_input_init(void)
for (i = 0; i < MAX_TOUCH; ++i) for (i = 0; i < MAX_TOUCH; ++i)
touch[i].contact_id = -1; touch[i].contact_id = -1;
for (i = 0; i < MAX_PADS; ++i) for (i = 0; i < MAX_PADS; ++i)
initController(&devices[i]); initController(&devices[i]);
#ifdef HAVE_BB10 #ifdef HAVE_BB10
@ -531,9 +503,7 @@ static int16_t qnx_input_state(void *data, const struct retro_keybind **retro_ke
{ {
case RETRO_DEVICE_JOYPAD: case RETRO_DEVICE_JOYPAD:
if (g_settings.input.device[port] == DEVICE_KEYBOARD) if (g_settings.input.device[port] == DEVICE_KEYBOARD)
{
return ((devices[port].buttons & (1 << id)) && (port < pads_connected)); return ((devices[port].buttons & (1 << id)) && (port < pads_connected));
}
else else
return ((devices[port].buttons & retro_keybinds[port][id].joykey) && (port < pads_connected)); return ((devices[port].buttons & retro_keybinds[port][id].joykey) && (port < pads_connected));
#ifdef HAVE_BB10 #ifdef HAVE_BB10