~mdw
/
sgt
/
puzzles
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Remove the 'cheated' flag in Range's game_ui, which was stickily
[sgt/puzzles]
/
signpost.c
diff --git
a/signpost.c
b/signpost.c
index
fdeadba
..
19649b2
100644
(file)
--- a/
signpost.c
+++ b/
signpost.c
@@
-1812,8
+1812,8
@@
static int num2col(game_drawstate *ds, int num)
{
int set = num / (ds->n+1);
{
int set = num / (ds->n+1);
- if (num <= 0) return COL_B0;
- return COL_B0 +
(set % 16
);
+ if (num <= 0
|| set == 0
) return COL_B0;
+ return COL_B0 +
1 + ((set-1) % 15
);
}
#define ARROW_HALFSZ (7 * TILE_SIZE / 32)
}
#define ARROW_HALFSZ (7 * TILE_SIZE / 32)
@@
-1930,19
+1930,30
@@
static void tile_redraw(drawing *dr, game_drawstate *ds, int tx, int ty,
if (!empty) {
int set = (num <= 0) ? 0 : num / (ds->n+1);
if (!empty) {
int set = (num <= 0) ? 0 : num / (ds->n+1);
+ char *p = buf;
if (set == 0 || num <= 0) {
sprintf(buf, "%d", num);
} else {
int n = num % (ds->n+1);
if (set == 0 || num <= 0) {
sprintf(buf, "%d", num);
} else {
int n = num % (ds->n+1);
+ p += sizeof(buf) - 1;
- if (n == 0)
- sprintf(buf, "%c", (int)(set+'a'-1));
- else
- sprintf(buf, "%c+%d", (int)(set+'a'-1), n);
+ if (n != 0) {
+ sprintf(buf, "+%d", n); /* Just to get the length... */
+ p -= strlen(buf);
+ sprintf(p, "+%d", n);
+ } else {
+ *p = '\0';
+ }
+ do {
+ set--;
+ p--;
+ *p = (char)((set % 26)+'a');
+ set /= 26;
+ } while (set);
}
}
- textsz = min(2*asz, (TILE_SIZE - 2 * cb) / (int)strlen(
buf
));
+ textsz = min(2*asz, (TILE_SIZE - 2 * cb) / (int)strlen(
p
));
draw_text(dr, tx + cb, ty + TILE_SIZE/4, FONT_VARIABLE, textsz,
draw_text(dr, tx + cb, ty + TILE_SIZE/4, FONT_VARIABLE, textsz,
- ALIGN_VCENTRE | ALIGN_HLEFT, textcol,
buf
);
+ ALIGN_VCENTRE | ALIGN_HLEFT, textcol,
p
);
}
if (print_ink < 0) {
}
if (print_ink < 0) {
@@
-2122,9
+2133,9
@@
static float game_flash_length(game_state *oldstate, game_state *newstate,
return 0.0F;
}
return 0.0F;
}
-static int game_
is_solved
(game_state *state)
+static int game_
status
(game_state *state)
{
{
- return state->completed;
+ return state->completed
? +1 : 0
;
}
static int game_timing_state(game_state *state, game_ui *ui)
}
static int game_timing_state(game_state *state, game_ui *ui)
@@
-2208,7
+2219,7
@@
const struct game thegame = {
game_redraw,
game_anim_length,
game_flash_length,
game_redraw,
game_anim_length,
game_flash_length,
- game_
is_solved
,
+ game_
status
,
TRUE, FALSE, game_print_size, game_print,
FALSE, /* wants_statusbar */
FALSE, game_timing_state,
TRUE, FALSE, game_print_size, game_print,
FALSE, /* wants_statusbar */
FALSE, game_timing_state,