aboutsummaryrefslogtreecommitdiff
path: root/map.c
diff options
context:
space:
mode:
authorBen Harris <bjh21@bjh21.me.uk>2023-06-04 18:42:58 +0100
committerBen Harris <bjh21@bjh21.me.uk>2023-06-11 00:33:27 +0100
commita9af3fda1d784c42d486a019a0a4e947f762af70 (patch)
tree8cb5d37274541dae804cd11d944feb41ffa1d40b /map.c
parentb08c13f5f47a8541961fc150142523b061d3d9c6 (diff)
downloadpuzzles-a9af3fda1d784c42d486a019a0a4e947f762af70.zip
puzzles-a9af3fda1d784c42d486a019a0a4e947f762af70.tar.gz
puzzles-a9af3fda1d784c42d486a019a0a4e947f762af70.tar.bz2
puzzles-a9af3fda1d784c42d486a019a0a4e947f762af70.tar.xz
Rename UI_UPDATE as MOVE_UI_UPDATE
All the other constants named UI_* are special key names that can be passed to midend_process_key(), but UI_UPDATE is a special return value from the back-end interpret_move() function instead. This renaming makes the distinction clear and provides a naming convention for future special return values from interpret_move().
Diffstat (limited to '')
-rw-r--r--map.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/map.c b/map.c
index 127db04..e7681a0 100644
--- a/map.c
+++ b/map.c
@@ -2481,7 +2481,7 @@ static char *interpret_move(const game_state *state, game_ui *ui,
*/
if (button == 'l' || button == 'L') {
ui->show_numbers = !ui->show_numbers;
- return UI_UPDATE;
+ return MOVE_UI_UPDATE;
}
if (IS_CURSOR_MOVE(button)) {
@@ -2490,12 +2490,12 @@ static char *interpret_move(const game_state *state, game_ui *ui,
ui->cur_visible = true;
ui->cur_moved = true;
ui->cur_lastmove = button;
- return UI_UPDATE;
+ return MOVE_UI_UPDATE;
}
if (IS_CURSOR_SELECT(button)) {
if (!ui->cur_visible) {
ui->cur_visible = true;
- return UI_UPDATE;
+ return MOVE_UI_UPDATE;
}
if (ui->drag_colour == -2) { /* not currently cursor-dragging, start. */
int r = region_from_ui_cursor(state, ui);
@@ -2507,7 +2507,7 @@ static char *interpret_move(const game_state *state, game_ui *ui,
ui->drag_pencil = 0;
}
ui->cur_moved = false;
- return UI_UPDATE;
+ return MOVE_UI_UPDATE;
} else { /* currently cursor-dragging; drop the colour in the new region. */
alt_button = (button == CURSOR_SELECT2);
/* Double-select removes current colour. */
@@ -2532,14 +2532,14 @@ static char *interpret_move(const game_state *state, game_ui *ui,
ui->dragx = x;
ui->dragy = y;
ui->cur_visible = false;
- return UI_UPDATE;
+ return MOVE_UI_UPDATE;
}
if ((button == LEFT_DRAG || button == RIGHT_DRAG) &&
ui->drag_colour > -2) {
ui->dragx = x;
ui->dragy = y;
- return UI_UPDATE;
+ return MOVE_UI_UPDATE;
}
if ((button == LEFT_RELEASE || button == RIGHT_RELEASE) &&
@@ -2564,18 +2564,18 @@ drag_dropped:
ui->drag_colour = -2;
if (r < 0)
- return UI_UPDATE; /* drag into border; do nothing else */
+ return MOVE_UI_UPDATE; /* drag into border; do nothing else */
if (state->map->immutable[r])
- return UI_UPDATE; /* can't change this region */
+ return MOVE_UI_UPDATE; /* can't change this region */
if (state->colouring[r] == c && state->pencil[r] == p)
- return UI_UPDATE; /* don't _need_ to change this region */
+ return MOVE_UI_UPDATE; /* don't _need_ to change this region */
if (alt_button) {
if (state->colouring[r] >= 0) {
/* Can't pencil on a coloured region */
- return UI_UPDATE;
+ return MOVE_UI_UPDATE;
} else if (c >= 0) {
/* Right-dragging from colour to blank toggles one pencil */
p = state->pencil[r] ^ (1 << c);