mirror of
https://github.com/libretro/RetroArch.git
synced 2024-11-24 00:20:01 +00:00
Style nits
This commit is contained in:
parent
ebcf42ceb7
commit
0354ced675
@ -923,9 +923,11 @@ static void sunxi_set_texture_frame(void *data, const void *frame, bool rgb32,
|
||||
static void sunxi_set_aspect_ratio (void *data, unsigned aspect_ratio_idx)
|
||||
{
|
||||
struct sunxi_video *_dispvars = (struct sunxi_video*)data;
|
||||
/* Here we obtain the new aspect ratio. */
|
||||
float new_aspect = aspectratio_lut[aspect_ratio_idx].value;
|
||||
if (new_aspect != _dispvars->aspect_ratio) {
|
||||
float new_aspect = aspectratio_lut[aspect_ratio_idx].value;
|
||||
|
||||
if (new_aspect != _dispvars->aspect_ratio)
|
||||
{
|
||||
/* Here we set the new aspect ratio. */
|
||||
_dispvars->aspect_ratio = new_aspect;
|
||||
sunxi_setup_scale(_dispvars, _dispvars->src_width, _dispvars->src_height, _dispvars->src_pitch);
|
||||
}
|
||||
|
@ -1367,12 +1367,16 @@ static bool gl_glsl_set_mvp(void *data, void *shader_data, const math_matrix_4x4
|
||||
goto fallback;
|
||||
|
||||
loc = glsl->uniforms[glsl->active_idx].mvp;
|
||||
if (loc >= 0) {
|
||||
if (current_idx != glsl->active_idx || mat->data != current_mat_data_pointer[glsl->active_idx] || *mat->data != current_mat_data[glsl->active_idx]) {
|
||||
if (loc >= 0)
|
||||
{
|
||||
if ( (current_idx != glsl->active_idx) ||
|
||||
(mat->data != current_mat_data_pointer[glsl->active_idx]) ||
|
||||
(*mat->data != current_mat_data[glsl->active_idx]))
|
||||
{
|
||||
glUniformMatrix4fv(loc, 1, GL_FALSE, mat->data);
|
||||
current_idx = glsl->active_idx;
|
||||
current_idx = glsl->active_idx;
|
||||
current_mat_data_pointer[glsl->active_idx] = (float*)mat->data;
|
||||
current_mat_data[glsl->active_idx] = *mat->data;
|
||||
current_mat_data[glsl->active_idx] = *mat->data;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
|
@ -2902,7 +2902,8 @@ vulkan_filter_chain_t *vulkan_filter_chain_create_from_preset(
|
||||
}
|
||||
|
||||
auto itr = find_if(shader->parameters, shader->parameters + shader->num_parameters,
|
||||
[&](const video_shader_parameter ¶m) {
|
||||
[&](const video_shader_parameter ¶m)
|
||||
{
|
||||
return meta_param.id == param.id;
|
||||
});
|
||||
|
||||
|
@ -590,16 +590,17 @@ static void qnx_handle_navigator_event(
|
||||
switch (bps_event_get_code(event))
|
||||
{
|
||||
case NAVIGATOR_SYSKEY_PRESS:
|
||||
switch(navigator_event_get_syskey_key(event)) {
|
||||
case NAVIGATOR_SYSKEY_BACK:
|
||||
input_keyboard_event(true, RETROK_BACKSPACE, 0, 0, RETRO_DEVICE_KEYBOARD);
|
||||
input_keyboard_event(false, RETROK_BACKSPACE, 0, 0, RETRO_DEVICE_KEYBOARD);
|
||||
break;
|
||||
case NAVIGATOR_SYSKEY_SEND:
|
||||
case NAVIGATOR_SYSKEY_END:
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
switch(navigator_event_get_syskey_key(event))
|
||||
{
|
||||
case NAVIGATOR_SYSKEY_BACK:
|
||||
input_keyboard_event(true, RETROK_BACKSPACE, 0, 0, RETRO_DEVICE_KEYBOARD);
|
||||
input_keyboard_event(false, RETROK_BACKSPACE, 0, 0, RETRO_DEVICE_KEYBOARD);
|
||||
break;
|
||||
case NAVIGATOR_SYSKEY_SEND:
|
||||
case NAVIGATOR_SYSKEY_END:
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case NAVIGATOR_SWIPE_DOWN:
|
||||
@ -612,21 +613,19 @@ static void qnx_handle_navigator_event(
|
||||
case NAVIGATOR_WINDOW_INVISIBLE:
|
||||
while(true)
|
||||
{
|
||||
unsigned event_code;
|
||||
|
||||
/* Block until we get a resume or exit event. */
|
||||
bps_get_event(&event_pause, -1);
|
||||
unsigned event_code = bps_event_get_code(event_pause);
|
||||
event_code = bps_event_get_code(event_pause);
|
||||
|
||||
if(event_code == NAVIGATOR_WINDOW_STATE)
|
||||
{
|
||||
if(navigator_event_get_window_state(event_pause) == NAVIGATOR_WINDOW_FULLSCREEN)
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
else if(event_code == NAVIGATOR_EXIT)
|
||||
{
|
||||
goto shutdown;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case NAVIGATOR_WINDOW_FULLSCREEN:
|
||||
|
@ -82,9 +82,11 @@ CFComparisonResult iohidmanager_sort_elements(const void *val1, const void *val2
|
||||
|
||||
static bool iohidmanager_check_for_id(apple_input_rec_t *rec, uint32_t id)
|
||||
{
|
||||
while(rec) {
|
||||
if(rec->id == id) return true;
|
||||
rec = rec->next;
|
||||
while(rec)
|
||||
{
|
||||
if(rec->id == id)
|
||||
return true;
|
||||
rec = rec->next;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
@ -133,20 +135,21 @@ static bool iohidmanager_hid_joypad_button(void *data,
|
||||
/* Check hat. */
|
||||
if (hat_dir)
|
||||
{
|
||||
if(h >= 1) {
|
||||
if(h >= 1)
|
||||
return false;
|
||||
}
|
||||
|
||||
switch(hat_dir)
|
||||
{
|
||||
case HAT_LEFT_MASK:
|
||||
case HAT_LEFT_MASK:
|
||||
return hid->hats[port][0] < 0;
|
||||
case HAT_RIGHT_MASK:
|
||||
case HAT_RIGHT_MASK:
|
||||
return hid->hats[port][0] > 0;
|
||||
case HAT_UP_MASK:
|
||||
case HAT_UP_MASK:
|
||||
return hid->hats[port][1] < 0;
|
||||
case HAT_DOWN_MASK:
|
||||
case HAT_DOWN_MASK:
|
||||
return hid->hats[port][1] > 0;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -114,12 +114,13 @@ static void apple_gamecontroller_joypad_poll(void)
|
||||
|
||||
static void apple_gamecontroller_joypad_register(GCGamepad *gamepad)
|
||||
{
|
||||
gamepad.valueChangedHandler = ^(GCGamepad *updateGamepad, GCControllerElement *element) {
|
||||
gamepad.valueChangedHandler = ^(GCGamepad *updateGamepad, GCControllerElement *element)
|
||||
{
|
||||
apple_gamecontroller_joypad_poll_internal(updateGamepad.controller);
|
||||
};
|
||||
|
||||
gamepad.controller.controllerPausedHandler = ^(GCController *controller) {
|
||||
|
||||
gamepad.controller.controllerPausedHandler = ^(GCController *controller)
|
||||
{
|
||||
uint32_t slot = (uint32_t)controller.playerIndex;
|
||||
mfi_buttons[slot] |= (1 << RETRO_DEVICE_ID_JOYPAD_START);
|
||||
|
||||
@ -187,13 +188,15 @@ bool apple_gamecontroller_joypad_init(void *data)
|
||||
[[NSNotificationCenter defaultCenter] addObserverForName:GCControllerDidConnectNotification
|
||||
object:nil
|
||||
queue:[NSOperationQueue mainQueue]
|
||||
usingBlock:^(NSNotification *note) {
|
||||
usingBlock:^(NSNotification *note)
|
||||
{
|
||||
apple_gamecontroller_joypad_connect([note object]);
|
||||
}];
|
||||
[[NSNotificationCenter defaultCenter] addObserverForName:GCControllerDidDisconnectNotification
|
||||
object:nil
|
||||
queue:[NSOperationQueue mainQueue]
|
||||
usingBlock:^(NSNotification *note) {
|
||||
usingBlock:^(NSNotification *note)
|
||||
{
|
||||
apple_gamecontroller_joypad_disconnect([note object]);
|
||||
} ];
|
||||
#endif
|
||||
|
@ -67,7 +67,8 @@ static const char *psp_joypad_name(unsigned pad)
|
||||
if (psp2_model != SCE_KERNEL_MODEL_VITATV)
|
||||
return "Vita Controller";
|
||||
|
||||
switch (curr_ctrl_info.port[pad + 1]) {
|
||||
switch (curr_ctrl_info.port[pad + 1])
|
||||
{
|
||||
case SCE_CTRL_TYPE_DS3:
|
||||
return "DS3 Controller";
|
||||
case SCE_CTRL_TYPE_DS4:
|
||||
@ -102,7 +103,8 @@ static bool psp_joypad_init(void *data)
|
||||
|
||||
#if defined(VITA)
|
||||
psp2_model = sceKernelGetModelForCDialog();
|
||||
if (psp2_model != SCE_KERNEL_MODEL_VITATV) {
|
||||
if (psp2_model != SCE_KERNEL_MODEL_VITATV)
|
||||
{
|
||||
sceTouchSetSamplingState(SCE_TOUCH_PORT_BACK, SCE_TOUCH_SAMPLING_STATE_START);
|
||||
sceTouchSetSamplingState(SCE_TOUCH_PORT_FRONT, SCE_TOUCH_SAMPLING_STATE_START);
|
||||
players_count = 1;
|
||||
@ -188,16 +190,19 @@ static void psp_joypad_poll(void)
|
||||
#endif
|
||||
|
||||
#ifdef VITA
|
||||
if (psp2_model != SCE_KERNEL_MODEL_VITATV) {
|
||||
if (psp2_model != SCE_KERNEL_MODEL_VITATV)
|
||||
players_count = 1;
|
||||
} else {
|
||||
else
|
||||
{
|
||||
sceCtrlGetControllerPortInfo(&curr_ctrl_info);
|
||||
for (player = 0; player < players_count; player++) {
|
||||
for (player = 0; player < players_count; player++)
|
||||
{
|
||||
if (old_ctrl_info.port[player + 1] == curr_ctrl_info.port[player + 1])
|
||||
continue;
|
||||
|
||||
if (old_ctrl_info.port[player + 1] != SCE_CTRL_TYPE_UNPAIRED &&
|
||||
curr_ctrl_info.port[player + 1] == SCE_CTRL_TYPE_UNPAIRED) {
|
||||
curr_ctrl_info.port[player + 1] == SCE_CTRL_TYPE_UNPAIRED)
|
||||
{
|
||||
memset(&actuators[player], 0, sizeof(SceCtrlActuator));
|
||||
input_autoconfigure_disconnect(player, psp_joypad.ident);
|
||||
}
|
||||
@ -321,7 +326,8 @@ static bool psp_joypad_rumble(unsigned pad,
|
||||
switch (effect)
|
||||
{
|
||||
case RETRO_RUMBLE_WEAK:
|
||||
switch (curr_ctrl_info.port[pad + 1]) {
|
||||
switch (curr_ctrl_info.port[pad + 1])
|
||||
{
|
||||
case SCE_CTRL_TYPE_DS3:
|
||||
actuators[pad].small = strength > 1 ? 1 : 0;
|
||||
break;
|
||||
@ -333,7 +339,8 @@ static bool psp_joypad_rumble(unsigned pad,
|
||||
}
|
||||
break;
|
||||
case RETRO_RUMBLE_STRONG:
|
||||
switch (curr_ctrl_info.port[pad + 1]) {
|
||||
switch (curr_ctrl_info.port[pad + 1])
|
||||
{
|
||||
case SCE_CTRL_TYPE_DS3:
|
||||
actuators[pad].large = strength > 1 ? LERP(strength, 0xffff, 0xbf) + 0x40 : 0;
|
||||
break;
|
||||
|
Loading…
Reference in New Issue
Block a user