Skip to content

Commit

Permalink
Fixed buttons on window element selection
Browse files Browse the repository at this point in the history
  • Loading branch information
theZiz committed Apr 27, 2017
1 parent 53adc88 commit 22cf77f
Showing 1 changed file with 25 additions and 28 deletions.
53 changes: 25 additions & 28 deletions window.c
Original file line number Diff line number Diff line change
Expand Up @@ -560,39 +560,36 @@ int window_calc(Uint32 steps)
nr++;
elem = elem->next;
}
if (elem == NULL)
int i = SP_MAPPING_MAX+4;
while (i --> 0 )
{
int i = SP_MAPPING_MAX+4;
while (i --> 0 )
if ( window->button[i].x + window->button[i].w >= mx &&
window->button[i].x <= mx &&
window->button[i].y + window->button[i].h >= my &&
window->button[i].y <= my )
{
if ( window->button[i].x + window->button[i].w >= mx &&
window->button[i].x <= mx &&
window->button[i].y + window->button[i].h >= my &&
window->button[i].y <= my )
if ( i < SP_MAPPING_MAX )
{
if ( i < SP_MAPPING_MAX )
spMapSetByID( i, 1 );
spGetInput()->touchscreen.pressed = 0;
}
else
switch ( i )
{
spMapSetByID( i, 1 );
spGetInput()->touchscreen.pressed = 0;
case SP_MAPPING_MAX + 0:
spGetInput()->axis[0] = -1;
break;
case SP_MAPPING_MAX + 1:
spGetInput()->axis[1] = -1;
break;
case SP_MAPPING_MAX + 2:
spGetInput()->axis[0] = 1;
break;
case SP_MAPPING_MAX + 3:
spGetInput()->axis[1] = 1;
break;
}
else
switch ( i )
{
case SP_MAPPING_MAX + 0:
spGetInput()->axis[0] = -1;
break;
case SP_MAPPING_MAX + 1:
spGetInput()->axis[1] = -1;
break;
case SP_MAPPING_MAX + 2:
spGetInput()->axis[0] = 1;
break;
case SP_MAPPING_MAX + 3:
spGetInput()->axis[1] = 1;
break;
}
break;
}
break;
}
}
}
Expand Down

0 comments on commit 22cf77f

Please sign in to comment.