diff options
| author | Simon Tatham <anakin@pobox.com> | 2023-06-18 09:18:58 +0100 |
|---|---|---|
| committer | Simon Tatham <anakin@pobox.com> | 2023-06-18 09:18:58 +0100 |
| commit | 68a1e8413c500f62f81c5a283de47bf404346edc (patch) | |
| tree | 0399e471e4218d643d38aa503f9e04e3cb243e3f /spectre.c | |
| parent | 86466959e8dc127513c1dc5c702492c8107c4b20 (diff) | |
| download | puzzles-68a1e8413c500f62f81c5a283de47bf404346edc.zip puzzles-68a1e8413c500f62f81c5a283de47bf404346edc.tar.gz puzzles-68a1e8413c500f62f81c5a283de47bf404346edc.tar.bz2 puzzles-68a1e8413c500f62f81c5a283de47bf404346edc.tar.xz | |
spectre.c: expose a couple more internal functions.
spectre-test will want to use these for an additional generation mode.
Diffstat (limited to 'spectre.c')
| -rw-r--r-- | spectre.c | 18 |
1 files changed, 7 insertions, 11 deletions
@@ -145,17 +145,16 @@ void spectre_place(Spectre *spec, Point u, Point v, int index_of_u) } } -static Spectre *spectre_initial(Point u, Point v, int index_of_u, - SpectreCoords *sc) +Spectre *spectre_initial(SpectreContext *ctx) { Spectre *spec = snew(Spectre); - spectre_place(spec, u, v, index_of_u); - spec->sc = spectre_coords_copy(sc); + spectre_place(spec, ctx->start_vertices[0], ctx->start_vertices[1], 0); + spec->sc = spectre_coords_copy(ctx->prototype); return spec; } -static Spectre *spectre_adjacent( - SpectreContext *ctx, const Spectre *src_spec, unsigned src_edge) +Spectre *spectre_adjacent(SpectreContext *ctx, const Spectre *src_spec, + unsigned src_edge) { unsigned dst_edge; Spectre *dst_spec = snew(Spectre); @@ -186,7 +185,7 @@ static int spectre_cmp(void *av, void *bv) return 0; } -static void spectre_free(Spectre *spec) +void spectre_free(Spectre *spec) { spectre_coords_free(spec->sc); sfree(spec); @@ -438,10 +437,7 @@ void spectrectx_generate(SpectreContext *ctx, Spectre *qhead = NULL, *qtail = NULL; { - SpectreCoords *sc = spectrectx_initial_coords(ctx); - Spectre *spec = spectre_initial(ctx->start_vertices[0], - ctx->start_vertices[1], 0, sc); - spectre_coords_free(sc); + Spectre *spec = spectre_initial(ctx); add234(placed, spec); |