aboutsummaryrefslogtreecommitdiff
path: root/palisade.c
diff options
context:
space:
mode:
authorSimon Tatham <anakin@pobox.com>2023-04-20 17:27:21 +0100
committerSimon Tatham <anakin@pobox.com>2023-04-20 18:39:41 +0100
commitc5e253a9f9d3d651227ccad56e2c7526ee1f3eba (patch)
treed5054843aa49a7ae0d793b6d26f162aead5bbdfd /palisade.c
parent14e1e05510ac02a5502823bafe46d98c6fab3e5c (diff)
downloadpuzzles-c5e253a9f9d3d651227ccad56e2c7526ee1f3eba.zip
puzzles-c5e253a9f9d3d651227ccad56e2c7526ee1f3eba.tar.gz
puzzles-c5e253a9f9d3d651227ccad56e2c7526ee1f3eba.tar.bz2
puzzles-c5e253a9f9d3d651227ccad56e2c7526ee1f3eba.tar.xz
Reorganise the dsf API into three kinds of dsf.
This is preparing to separate out the auxiliary functionality, and perhaps leave space for making more of it in future. The previous name 'edsf' was too vague: the 'e' stood for 'extended', and didn't say anything about _how_ it was extended. It's now called a 'flip dsf', since it tracks whether elements in the same class are flipped relative to each other. More importantly, clients that are going to use the flip tracking must say so when they allocate the dsf. And Keen's need to track the minimal element of an equivalence class is going to become a non-default feature, so there needs to be a new kind of dsf that specially tracks those, and Keen will have to call it. While I'm here, I've renamed the three dsf creation functions so that they start with 'dsf_' like all the rest of the dsf API.
Diffstat (limited to 'palisade.c')
-rw-r--r--palisade.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/palisade.c b/palisade.c
index c07d887..09ef3af 100644
--- a/palisade.c
+++ b/palisade.c
@@ -527,7 +527,7 @@ static bool is_solved(const game_params *params, clue *clues,
{
int w = params->w, h = params->h, wh = w*h, k = params->k;
int i, x, y;
- DSF *dsf = snew_dsf(wh);
+ DSF *dsf = dsf_new(wh);
build_dsf(w, h, border, dsf, true);
@@ -582,7 +582,7 @@ static bool solver(const game_params *params, clue *clues, borderflag *borders)
ctx.params = params;
ctx.clues = clues;
ctx.borders = borders;
- ctx.dsf = snew_dsf(wh);
+ ctx.dsf = dsf_new(wh);
solver_connected_clues_versus_region_size(&ctx); /* idempotent */
do {
@@ -1172,7 +1172,7 @@ static void game_redraw(drawing *dr, game_drawstate *ds,
{
int w = state->shared->params.w, h = state->shared->params.h, wh = w*h;
int r, c, flash = ((int) (flashtime * 5 / FLASH_TIME)) % 2;
- DSF *black_border_dsf = snew_dsf(wh), *yellow_border_dsf = snew_dsf(wh);
+ DSF *black_border_dsf = dsf_new(wh), *yellow_border_dsf = dsf_new(wh);
int k = state->shared->params.k;
if (!ds->grid) {