aboutsummaryrefslogtreecommitdiff
path: root/bridges.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 /bridges.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 'bridges.c')
-rw-r--r--bridges.c24
1 files changed, 12 insertions, 12 deletions
diff --git a/bridges.c b/bridges.c
index acb64dc..7997c69 100644
--- a/bridges.c
+++ b/bridges.c
@@ -2126,7 +2126,7 @@ static char *ui_cancel_drag(game_ui *ui)
ui->dragx_src = ui->dragy_src = -1;
ui->dragx_dst = ui->dragy_dst = -1;
ui->dragging = false;
- return UI_UPDATE;
+ return MOVE_UI_UPDATE;
}
static game_ui *new_ui(const game_state *state)
@@ -2333,7 +2333,7 @@ static char *update_drag_dst(const game_state *state, game_ui *ui,
/*debug(("update_drag src (%d,%d) d(%d,%d) dst (%d,%d)\n",
ui->dragx_src, ui->dragy_src, dx, dy,
ui->dragx_dst, ui->dragy_dst));*/
- return UI_UPDATE;
+ return MOVE_UI_UPDATE;
}
static char *finish_drag(const game_state *state, game_ui *ui)
@@ -2376,7 +2376,7 @@ static char *interpret_move(const game_state *state, game_ui *ui,
if (ggrid & G_ISLAND) {
ui->dragx_src = gx;
ui->dragy_src = gy;
- return UI_UPDATE;
+ return MOVE_UI_UPDATE;
} else
return ui_cancel_drag(ui);
} else if (button == LEFT_DRAG || button == RIGHT_DRAG) {
@@ -2390,7 +2390,7 @@ static char *interpret_move(const game_state *state, game_ui *ui,
/* cancel a drag when we go back to the starting point */
ui->dragx_dst = -1;
ui->dragy_dst = -1;
- return UI_UPDATE;
+ return MOVE_UI_UPDATE;
}
} else if (button == LEFT_RELEASE || button == RIGHT_RELEASE) {
if (ui->dragging) {
@@ -2477,19 +2477,19 @@ static char *interpret_move(const game_state *state, game_ui *ui,
if (!dingrid) break;
}
- if (!oingrid) return UI_UPDATE;
+ if (!oingrid) return MOVE_UI_UPDATE;
}
/* not reached */
found:
ui->cur_x = nx;
ui->cur_y = ny;
- return UI_UPDATE;
+ return MOVE_UI_UPDATE;
}
} else if (IS_CURSOR_SELECT(button)) {
if (!ui->cur_visible) {
ui->cur_visible = true;
- return UI_UPDATE;
+ return MOVE_UI_UPDATE;
}
if (ui->dragging || button == CURSOR_SELECT2) {
ui_cancel_drag(ui);
@@ -2497,7 +2497,7 @@ found:
sprintf(buf, "M%d,%d", ui->cur_x, ui->cur_y);
return dupstr(buf);
} else
- return UI_UPDATE;
+ return MOVE_UI_UPDATE;
} else {
grid_type v = GRID(state, ui->cur_x, ui->cur_y);
if (v & G_ISLAND) {
@@ -2506,7 +2506,7 @@ found:
ui->dragy_src = ui->cur_y;
ui->dragx_dst = ui->dragy_dst = -1;
ui->drag_is_noline = (button == CURSOR_SELECT2);
- return UI_UPDATE;
+ return MOVE_UI_UPDATE;
}
}
} else if ((button >= '0' && button <= '9') ||
@@ -2524,7 +2524,7 @@ found:
if (!ui->cur_visible) {
ui->cur_visible = true;
- return UI_UPDATE;
+ return MOVE_UI_UPDATE;
}
for (i = 0; i < state->n_islands; ++i) {
@@ -2551,12 +2551,12 @@ found:
if (best_x != -1 && best_y != -1) {
ui->cur_x = best_x;
ui->cur_y = best_y;
- return UI_UPDATE;
+ return MOVE_UI_UPDATE;
} else
return NULL;
} else if (button == 'g' || button == 'G') {
ui->show_hints = !ui->show_hints;
- return UI_UPDATE;
+ return MOVE_UI_UPDATE;
}
return NULL;