Skip to content

Commit

Permalink
Overlays: Don't trigger meta keys with sliding input
Browse files Browse the repository at this point in the history
  • Loading branch information
neil4 committed Sep 7, 2024
1 parent 5a183f9 commit 2e0ad86
Showing 1 changed file with 14 additions and 9 deletions.
23 changes: 14 additions & 9 deletions input/input_overlay.c
Original file line number Diff line number Diff line change
Expand Up @@ -1401,7 +1401,7 @@ void input_overlay_update_mouse_scale(void)
}
}

void input_overlay_set_eightway_anchors(input_overlay_t *ol)
static void input_overlay_set_eightway_anchors(input_overlay_t *ol)
{
int i, j, k;
for (i = 0; i < ol->size; i++)
Expand All @@ -1411,14 +1411,13 @@ void input_overlay_set_eightway_anchors(input_overlay_t *ol)
for (j = 0; j < overlay->size; j++)
{
struct overlay_desc *desc = overlay->descs + j;
uint64_t mask = desc->key_mask;
if (desc->hitbox != OVERLAY_HITBOX_NONE)
continue;

for (k = 0; k < overlay->size; k++)
{
struct overlay_desc *desc2 = overlay->descs + k;
uint64_t mask = desc->key_mask;

if (!desc2->eightway_vals)
continue;

Expand Down Expand Up @@ -1967,16 +1966,19 @@ static INLINE bool input_overlay_poll_descs(
BIT16_CLEAR(descs[j].touch_mask, touch_idx);
}

any_desc_hit = true;
BIT16_SET(desc->touch_mask, touch_idx);

switch(desc->type)
{
case OVERLAY_TYPE_BUTTONS:
out->buttons |= desc->key_mask;
if (desc->key_mask & META_KEY_MASK)
{
/* Don't trigger meta keys with sliding input */
if (old_touch_idx != -1 && !use_range_mod)
continue;
if (BIT64_GET(desc->key_mask, RARCH_OVERLAY_NEXT))
ol->next_index = desc->next_index;
}

if (BIT64_GET(desc->key_mask, RARCH_OVERLAY_NEXT))
ol->next_index = desc->next_index;
out->buttons |= desc->key_mask;
break;
case OVERLAY_TYPE_DPAD_AREA:
case OVERLAY_TYPE_ABXY_AREA:
Expand All @@ -1994,6 +1996,9 @@ static INLINE bool input_overlay_poll_descs(
ol->active->scale_w, ol->active->scale_h);
break;
}

any_desc_hit = true;
BIT16_SET(desc->touch_mask, touch_idx);
}

return any_desc_hit;
Expand Down

3 comments on commit 2e0ad86

@purrpgoddpeebles
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you please add retroachievements support and the arcade.cfg amd rgpad stovk overlays so we have something else besides flat plzz mayne

@neil4
Copy link
Owner Author

@neil4 neil4 commented on 2e0ad86 Sep 8, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can add overlays manually with "Install Assets". Just put them in an 'overlays' folder, zip it, and browse for the zipfile. I might add an option to download stock overlays.

I don't know the first thing about retro achievements TBH, but I might look into it sometime

@LibretroAdmin
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @neil4 , apologies for letting this PR languish for so long.

I promise that if you can resolve the merge conflict I'll merge this immediately.

libretro#14896

My bad.

Please sign in to comment.