~mdw
/
sgt
/
puzzles
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Lee Dowling points out that duplicating the entire grid data
[sgt/puzzles]
/
bridges.c
diff --git
a/bridges.c
b/bridges.c
index
be173ff
..
1829681
100644
(file)
--- a/
bridges.c
+++ b/
bridges.c
@@
-147,6
+147,11
@@
static void fixup_islands_for_realloc(game_state *state)
}
}
}
}
+static int game_can_format_as_text_now(game_params *params)
+{
+ return TRUE;
+}
+
static char *game_text_format(game_state *state)
{
int x, y, len, nl;
static char *game_text_format(game_state *state)
{
int x, y, len, nl;
@@
-1064,8
+1069,7
@@
static void map_group(game_state *state)
struct island *is, *is_join;
/* Initialise dsf. */
struct island *is, *is_join;
/* Initialise dsf. */
- for (i = 0; i < wh; i++)
- dsf[i] = i;
+ dsf_init(dsf, wh);
/* For each island, find connected islands right or down
* and merge the dsf for the island squares as well as the
/* For each island, find connected islands right or down
* and merge the dsf for the island squares as well as the
@@
-1602,9
+1606,8
@@
static game_state *new_state(game_params *params)
ret->solved = ret->completed = 0;
ret->solver = snew(struct solver_state);
ret->solved = ret->completed = 0;
ret->solver = snew(struct solver_state);
- ret->solver->dsf = snew
n(wh, int
);
+ ret->solver->dsf = snew
_dsf(wh
);
ret->solver->tmpdsf = snewn(wh, int);
ret->solver->tmpdsf = snewn(wh, int);
- for (i = 0; i < wh; i++) ret->solver->dsf[i] = i;
ret->solver->refcount = 1;
ret->solver->refcount = 1;
@@
-2631,7
+2634,7
@@
static void game_print(drawing *dr, game_state *state, int ts)
#endif
const struct game thegame = {
#endif
const struct game thegame = {
- "Bridges", "games.bridges",
+ "Bridges", "games.bridges",
"bridges",
default_params,
game_fetch_preset,
decode_params,
default_params,
game_fetch_preset,
decode_params,
@@
-2646,7
+2649,7
@@
const struct game thegame = {
dup_game,
free_game,
TRUE, solve_game,
dup_game,
free_game,
TRUE, solve_game,
- TRUE, game_text_format,
+ TRUE, game_
can_format_as_text_now, game_
text_format,
new_ui,
free_ui,
encode_ui,
new_ui,
free_ui,
encode_ui,
@@
-2664,7
+2667,7
@@
const struct game thegame = {
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,
-
0,
/* flags */
+
REQUIRE_RBUTTON,
/* flags */
};
/* vim: set shiftwidth=4 tabstop=8: */
};
/* vim: set shiftwidth=4 tabstop=8: */