Skip to content

Commit 2ffe9fe

Browse files
authored
Overlay lightgun fixes (#17340)
- Fix the "Allow Off-Screen" setting not working since #17308 - Prevent offscreen shot from disabling the lightgun with some cores - Fullscreen pointer coordinates no longer needed
1 parent 54c37cf commit 2ffe9fe

1 file changed

Lines changed: 7 additions & 9 deletions

File tree

input/input_driver.c

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1221,7 +1221,9 @@ static int16_t input_overlay_lightgun_state(settings_t *settings,
12211221
else
12221222
return -0x8000;
12231223
case RETRO_DEVICE_ID_LIGHTGUN_IS_OFFSCREEN:
1224-
return input_driver_pointer_is_offscreen(ptr_st->ptr[0].x, ptr_st->ptr[0].y);
1224+
ptr_st->device_mask |= (1 << RETRO_DEVICE_LIGHTGUN);
1225+
return ( settings->bools.input_overlay_lightgun_allow_offscreen
1226+
&& input_driver_pointer_is_offscreen(ptr_st->ptr[0].x, ptr_st->ptr[0].y));
12251227
case RETRO_DEVICE_ID_LIGHTGUN_AUX_A:
12261228
case RETRO_DEVICE_ID_LIGHTGUN_AUX_B:
12271229
case RETRO_DEVICE_ID_LIGHTGUN_AUX_C:
@@ -3307,10 +3309,9 @@ static void input_overlay_update_pointer_coords(
33073309
RETRO_DEVICE_ID_POINTER_Y);
33083310
}
33093311

3310-
/* Need fullscreen pointer for mouse and lightgun */
3312+
/* Need fullscreen pointer for mouse only */
33113313
if ( !ptr_st->count
3312-
&& (ptr_st->device_mask &
3313-
((1 << RETRO_DEVICE_MOUSE) | (1 << RETRO_DEVICE_LIGHTGUN))))
3314+
&& (ptr_st->device_mask & (1 << RETRO_DEVICE_MOUSE)))
33143315
{
33153316
ptr_st->screen_x = current_input->input_state(
33163317
input_data, NULL, NULL, NULL, NULL, true, 0,
@@ -3477,14 +3478,11 @@ static void input_poll_overlay(
34773478

34783479
if (ol_ptr_enable)
34793480
{
3480-
input_overlay_pointer_state_t *ptr_st = &ol->pointer_state;
3481-
struct input_overlay_mouse_state *mouse_st = (struct input_overlay_mouse_state*)&ptr_st->mouse;
3482-
34833481
if (ptr_state->device_mask & (1 << RETRO_DEVICE_LIGHTGUN))
34843482
input_overlay_poll_lightgun(settings, ol, old_ptr_count);
34853483
if (ptr_state->device_mask & (1 << RETRO_DEVICE_MOUSE))
3486-
input_overlay_poll_mouse(settings, mouse_st, ol,
3487-
ptr_st->count, old_ptr_count);
3484+
input_overlay_poll_mouse(settings, &ptr_state->mouse, ol,
3485+
ptr_state->count, old_ptr_count);
34883486

34893487
ptr_state->device_mask = 0;
34903488
}

0 commit comments

Comments
 (0)