diff options
| author | Ben Harris <bjh21@bjh21.me.uk> | 2023-06-04 18:42:58 +0100 |
|---|---|---|
| committer | Ben Harris <bjh21@bjh21.me.uk> | 2023-06-11 00:33:27 +0100 |
| commit | a9af3fda1d784c42d486a019a0a4e947f762af70 (patch) | |
| tree | 8cb5d37274541dae804cd11d944feb41ffa1d40b /tracks.c | |
| parent | b08c13f5f47a8541961fc150142523b061d3d9c6 (diff) | |
| download | puzzles-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 'tracks.c')
| -rw-r--r-- | tracks.c | 20 |
1 files changed, 10 insertions, 10 deletions
@@ -2279,13 +2279,13 @@ static char *interpret_move(const game_state *state, game_ui *ui, ui->drag_sx = ui->drag_ex = gx; ui->drag_sy = ui->drag_ey = gy; - return UI_UPDATE; + return MOVE_UI_UPDATE; } if (IS_MOUSE_DRAG(button)) { ui->cursor_active = false; update_ui_drag(state, ui, gx, gy); - return UI_UPDATE; + return MOVE_UI_UPDATE; } if (IS_MOUSE_RELEASE(button)) { @@ -2322,12 +2322,12 @@ static char *interpret_move(const game_state *state, game_ui *ui, cy = CENTERED_COORD(gy); if (!INGRID(state, gx, gy) || FROMCOORD(x) != gx || FROMCOORD(y) != gy) - return UI_UPDATE; + return MOVE_UI_UPDATE; if (max(abs(x-cx),abs(y-cy)) < TILE_SIZE/4) { if (ui_can_flip_square(state, gx, gy, button == RIGHT_RELEASE)) return square_flip_str(state, gx, gy, button == RIGHT_RELEASE, tmpbuf); - return UI_UPDATE; + return MOVE_UI_UPDATE; } else { if (abs(x-cx) < abs(y-cy)) { /* Closest to top/bottom edge. */ @@ -2341,7 +2341,7 @@ static char *interpret_move(const game_state *state, game_ui *ui, return edge_flip_str(state, gx, gy, direction, button == RIGHT_RELEASE, tmpbuf); else - return UI_UPDATE; + return MOVE_UI_UPDATE; } } } @@ -2354,7 +2354,7 @@ static char *interpret_move(const game_state *state, game_ui *ui, if (!ui->cursor_active) { ui->cursor_active = true; - return UI_UPDATE; + return MOVE_UI_UPDATE; } ui->curx = ui->curx + dx; @@ -2365,17 +2365,17 @@ static char *interpret_move(const game_state *state, game_ui *ui, } ui->curx = min(max(ui->curx, 1), 2*w-1); ui->cury = min(max(ui->cury, 1), 2*h-1); - return UI_UPDATE; + return MOVE_UI_UPDATE; } if (IS_CURSOR_SELECT(button)) { if (!ui->cursor_active) { ui->cursor_active = true; - return UI_UPDATE; + return MOVE_UI_UPDATE; } /* click on square corner does nothing (shouldn't get here) */ if ((ui->curx % 2) == 0 && (ui->cury % 2 == 0)) - return UI_UPDATE; + return MOVE_UI_UPDATE; gx = ui->curx / 2; gy = ui->cury / 2; @@ -2387,7 +2387,7 @@ static char *interpret_move(const game_state *state, game_ui *ui, else if (!direction && ui_can_flip_square(state, gx, gy, button == CURSOR_SELECT2)) return square_flip_str(state, gx, gy, button == CURSOR_SELECT2, tmpbuf); - return UI_UPDATE; + return MOVE_UI_UPDATE; } #if 0 |