aboutsummaryrefslogtreecommitdiff
path: root/undead.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 /undead.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 'undead.c')
-rw-r--r--undead.c32
1 files changed, 16 insertions, 16 deletions
diff --git a/undead.c b/undead.c
index 4784754..d2a07a3 100644
--- a/undead.c
+++ b/undead.c
@@ -1774,7 +1774,7 @@ static char *interpret_move(const game_state *state, game_ui *ui,
if (button == 'a' || button == 'A') {
ui->ascii = !ui->ascii;
- return UI_UPDATE;
+ return MOVE_UI_UPDATE;
}
if (button == 'm' || button == 'M') {
@@ -1787,21 +1787,21 @@ static char *interpret_move(const game_state *state, game_ui *ui,
if (button == 'g' || button == 'G' || button == '1') {
if (!ui->hcursor) ui->hshow = false;
if (state->guess[xi] == 1)
- return ui->hcursor ? NULL : UI_UPDATE;
+ return ui->hcursor ? NULL : MOVE_UI_UPDATE;
sprintf(buf,"G%d",xi);
return dupstr(buf);
}
if (button == 'v' || button == 'V' || button == '2') {
if (!ui->hcursor) ui->hshow = false;
if (state->guess[xi] == 2)
- return ui->hcursor ? NULL : UI_UPDATE;
+ return ui->hcursor ? NULL : MOVE_UI_UPDATE;
sprintf(buf,"V%d",xi);
return dupstr(buf);
}
if (button == 'z' || button == 'Z' || button == '3') {
if (!ui->hcursor) ui->hshow = false;
if (state->guess[xi] == 4)
- return ui->hcursor ? NULL : UI_UPDATE;
+ return ui->hcursor ? NULL : MOVE_UI_UPDATE;
sprintf(buf,"Z%d",xi);
return dupstr(buf);
}
@@ -1809,7 +1809,7 @@ static char *interpret_move(const game_state *state, game_ui *ui,
button == '0' || button == '\b' ) {
if (!ui->hcursor) ui->hshow = false;
if (state->guess[xi] == 7 && state->pencils[xi] == 0)
- return ui->hcursor ? NULL : UI_UPDATE;
+ return ui->hcursor ? NULL : MOVE_UI_UPDATE;
sprintf(buf,"E%d",xi);
return dupstr(buf);
}
@@ -1829,12 +1829,12 @@ static char *interpret_move(const game_state *state, game_ui *ui,
}
ui->hshow = true;
ui->hcursor = true;
- return UI_UPDATE;
+ return MOVE_UI_UPDATE;
}
if (ui->hshow && button == CURSOR_SELECT) {
ui->hpencil = !ui->hpencil;
ui->hcursor = true;
- return UI_UPDATE;
+ return MOVE_UI_UPDATE;
}
if (ui->hshow && ui->hpencil) {
@@ -1871,7 +1871,7 @@ static char *interpret_move(const game_state *state, game_ui *ui,
ui->hshow = false;
}
if (state->pencils[xi] == 0)
- return ui->hcursor ? NULL : UI_UPDATE;
+ return ui->hcursor ? NULL : MOVE_UI_UPDATE;
sprintf(buf,"E%d",xi);
return dupstr(buf);
}
@@ -1888,14 +1888,14 @@ static char *interpret_move(const game_state *state, game_ui *ui,
ui->hpencil = false;
ui->hcursor = false;
ui->hx = gx; ui->hy = gy;
- return UI_UPDATE;
+ return MOVE_UI_UPDATE;
}
else if (button == RIGHT_BUTTON && g == 7) {
ui->hshow = true;
ui->hpencil = true;
ui->hcursor = false;
ui->hx = gx; ui->hy = gy;
- return UI_UPDATE;
+ return MOVE_UI_UPDATE;
}
}
else if (ui->hshow) {
@@ -1906,14 +1906,14 @@ static char *interpret_move(const game_state *state, game_ui *ui,
ui->hpencil = false;
ui->hcursor = false;
ui->hx = 0; ui->hy = 0;
- return UI_UPDATE;
+ return MOVE_UI_UPDATE;
}
else {
ui->hshow = true;
ui->hpencil = false;
ui->hcursor = false;
ui->hx = gx; ui->hy = gy;
- return UI_UPDATE;
+ return MOVE_UI_UPDATE;
}
}
else {
@@ -1921,7 +1921,7 @@ static char *interpret_move(const game_state *state, game_ui *ui,
ui->hpencil = false;
ui->hcursor = false;
ui->hx = gx; ui->hy = gy;
- return UI_UPDATE;
+ return MOVE_UI_UPDATE;
}
}
else if (button == RIGHT_BUTTON) {
@@ -1930,7 +1930,7 @@ static char *interpret_move(const game_state *state, game_ui *ui,
ui->hpencil = true;
ui->hcursor = false;
ui->hx = gx; ui->hy = gy;
- return UI_UPDATE;
+ return MOVE_UI_UPDATE;
}
else {
if (gx == ui->hx && gy == ui->hy) {
@@ -1938,14 +1938,14 @@ static char *interpret_move(const game_state *state, game_ui *ui,
ui->hpencil = false;
ui->hcursor = false;
ui->hx = 0; ui->hy = 0;
- return UI_UPDATE;
+ return MOVE_UI_UPDATE;
}
else if (g == 7) {
ui->hshow = true;
ui->hpencil = true;
ui->hcursor = false;
ui->hx = gx; ui->hy = gy;
- return UI_UPDATE;
+ return MOVE_UI_UPDATE;
}
}
}