Skip to content

Commit

Permalink
Update main.c
Browse files Browse the repository at this point in the history
  • Loading branch information
mrbid authored Jan 13, 2024
1 parent 527be3c commit 0c8bad2
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions main.c
Original file line number Diff line number Diff line change
Expand Up @@ -1313,20 +1313,20 @@ void main_loop()
// cursor icon switching based on the mouse position.
// have a cross while over the playing field.
#ifndef BUILD_GLFW
// cursor
switch (cursor_state)
if(cursor_state == 0 && mx < touch_margin-1.f)
{
case 0:
if (mx <= ww-touch_margin+1.f && mx >= touch_margin-1.f)
break;
SDL_SetCursor(beam_cursor);
cursor_state = 1;
break;
case 1:
if (mx > touch_margin && mx < ww-touch_margin)
SDL_SetCursor(cross_cursor);
cursor_state = 0;
break;
SDL_SetCursor(beam_cursor);
cursor_state = 1;
}
else if(cursor_state == 0 && mx > ww-touch_margin+1.f)
{
SDL_SetCursor(beam_cursor);
cursor_state = 1;
}
else if(cursor_state == 1 && mx > touch_margin && mx < ww-touch_margin)
{
SDL_SetCursor(cross_cursor);
cursor_state = 0;
}
#endif

Expand Down

0 comments on commit 0c8bad2

Please sign in to comment.