mirror of
git://git.tartarus.org/simon/puzzles.git
synced 2025-04-21 08:01:30 -07:00
Pattern: use new move_cursor() features
This commit is contained in:
12
pattern.c
12
pattern.c
@ -1394,16 +1394,16 @@ static char *interpret_move(const game_state *state, game_ui *ui,
|
|||||||
|
|
||||||
if (IS_CURSOR_MOVE(button)) {
|
if (IS_CURSOR_MOVE(button)) {
|
||||||
int x = ui->cur_x, y = ui->cur_y, newstate;
|
int x = ui->cur_x, y = ui->cur_y, newstate;
|
||||||
char buf[80];
|
char buf[80], *ret;
|
||||||
move_cursor(button, &ui->cur_x, &ui->cur_y,
|
ret = move_cursor(button, &ui->cur_x, &ui->cur_y,
|
||||||
state->common->w, state->common->h, false, NULL);
|
state->common->w, state->common->h, false,
|
||||||
ui->cur_visible = true;
|
&ui->cur_visible);
|
||||||
if (!control && !shift) return MOVE_UI_UPDATE;
|
if (!control && !shift) return ret;
|
||||||
|
|
||||||
newstate = control ? shift ? GRID_UNKNOWN : GRID_FULL : GRID_EMPTY;
|
newstate = control ? shift ? GRID_UNKNOWN : GRID_FULL : GRID_EMPTY;
|
||||||
if (state->grid[y * state->common->w + x] == newstate &&
|
if (state->grid[y * state->common->w + x] == newstate &&
|
||||||
state->grid[ui->cur_y * state->common->w + ui->cur_x] == newstate)
|
state->grid[ui->cur_y * state->common->w + ui->cur_x] == newstate)
|
||||||
return MOVE_UI_UPDATE;
|
return ret;
|
||||||
|
|
||||||
sprintf(buf, "%c%d,%d,%d,%d", control ? shift ? 'U' : 'F' : 'E',
|
sprintf(buf, "%c%d,%d,%d,%d", control ? shift ? 'U' : 'F' : 'E',
|
||||||
min(x, ui->cur_x), min(y, ui->cur_y),
|
min(x, ui->cur_x), min(y, ui->cur_y),
|
||||||
|
Reference in New Issue
Block a user