Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Overlay lightgun fixes #17340

Merged
merged 1 commit into from
Jan 4, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 7 additions & 9 deletions input/input_driver.c
Original file line number Diff line number Diff line change
Expand Up @@ -1221,7 +1221,9 @@ static int16_t input_overlay_lightgun_state(settings_t *settings,
else
return -0x8000;
case RETRO_DEVICE_ID_LIGHTGUN_IS_OFFSCREEN:
return input_driver_pointer_is_offscreen(ptr_st->ptr[0].x, ptr_st->ptr[0].y);
ptr_st->device_mask |= (1 << RETRO_DEVICE_LIGHTGUN);
return ( settings->bools.input_overlay_lightgun_allow_offscreen
&& input_driver_pointer_is_offscreen(ptr_st->ptr[0].x, ptr_st->ptr[0].y));
case RETRO_DEVICE_ID_LIGHTGUN_AUX_A:
case RETRO_DEVICE_ID_LIGHTGUN_AUX_B:
case RETRO_DEVICE_ID_LIGHTGUN_AUX_C:
Expand Down Expand Up @@ -3307,10 +3309,9 @@ static void input_overlay_update_pointer_coords(
RETRO_DEVICE_ID_POINTER_Y);
}

/* Need fullscreen pointer for mouse and lightgun */
/* Need fullscreen pointer for mouse only */
if ( !ptr_st->count
&& (ptr_st->device_mask &
((1 << RETRO_DEVICE_MOUSE) | (1 << RETRO_DEVICE_LIGHTGUN))))
&& (ptr_st->device_mask & (1 << RETRO_DEVICE_MOUSE)))
{
ptr_st->screen_x = current_input->input_state(
input_data, NULL, NULL, NULL, NULL, true, 0,
Expand Down Expand Up @@ -3477,14 +3478,11 @@ static void input_poll_overlay(

if (ol_ptr_enable)
{
input_overlay_pointer_state_t *ptr_st = &ol->pointer_state;
struct input_overlay_mouse_state *mouse_st = (struct input_overlay_mouse_state*)&ptr_st->mouse;

if (ptr_state->device_mask & (1 << RETRO_DEVICE_LIGHTGUN))
input_overlay_poll_lightgun(settings, ol, old_ptr_count);
if (ptr_state->device_mask & (1 << RETRO_DEVICE_MOUSE))
input_overlay_poll_mouse(settings, mouse_st, ol,
ptr_st->count, old_ptr_count);
input_overlay_poll_mouse(settings, &ptr_state->mouse, ol,
ptr_state->count, old_ptr_count);

ptr_state->device_mask = 0;
}
Expand Down
Loading