mirror of
git://git.tartarus.org/simon/puzzles.git
synced 2025-04-20 15:41:30 -07:00
Use move_cursor() for cursor movement in Same Game
No significant behavioural change.
This commit is contained in:
10
samegame.c
10
samegame.c
@ -1285,13 +1285,9 @@ static char *interpret_move(const game_state *state, game_ui *ui,
|
|||||||
ui->displaysel = false;
|
ui->displaysel = false;
|
||||||
tx = FROMCOORD(x); ty= FROMCOORD(y);
|
tx = FROMCOORD(x); ty= FROMCOORD(y);
|
||||||
} else if (IS_CURSOR_MOVE(button)) {
|
} else if (IS_CURSOR_MOVE(button)) {
|
||||||
int dx = 0, dy = 0;
|
return move_cursor(button, &ui->xsel, &ui->ysel,
|
||||||
ui->displaysel = true;
|
state->params.w, state->params.h,
|
||||||
dx = (button == CURSOR_LEFT) ? -1 : ((button == CURSOR_RIGHT) ? +1 : 0);
|
true, &ui->displaysel);
|
||||||
dy = (button == CURSOR_DOWN) ? +1 : ((button == CURSOR_UP) ? -1 : 0);
|
|
||||||
ui->xsel = (ui->xsel + state->params.w + dx) % state->params.w;
|
|
||||||
ui->ysel = (ui->ysel + state->params.h + dy) % state->params.h;
|
|
||||||
return ret;
|
|
||||||
} else if (IS_CURSOR_SELECT(button)) {
|
} else if (IS_CURSOR_SELECT(button)) {
|
||||||
ui->displaysel = true;
|
ui->displaysel = true;
|
||||||
tx = ui->xsel;
|
tx = ui->xsel;
|
||||||
|
Reference in New Issue
Block a user