X-Git-Url: https://git.distorted.org.uk/~mdw/sgt/puzzles/blobdiff_plain/79cb09e95eb4303318afb13c55759e48bfd5c016..81ff8295651d75cdd07ff6fbb5a52d8aebe84136:/flip.c diff --git a/flip.c b/flip.c index 0cd5348..e6c4077 100644 --- a/flip.c +++ b/flip.c @@ -590,6 +590,8 @@ static char *new_game_desc(game_params *params, random_state *rs, sprintf(ret, "%s,%s", mbmp, gbmp); sfree(mbmp); sfree(gbmp); + sfree(matrix); + sfree(grid); return ret; } @@ -731,6 +733,7 @@ static game_state *solve_game(game_state *state, game_state *currstate, if (equations[j * (wh+1) + wh]) { *error = "No solution exists for this position"; sfree(equations); + sfree(und); return NULL; } break; @@ -852,6 +855,7 @@ static game_state *solve_game(game_state *state, game_state *currstate, sfree(shortest); sfree(solution); sfree(equations); + sfree(und); return ret; } @@ -1053,11 +1057,19 @@ static void draw_tile(frontend *fe, game_drawstate *ds, } /* - * Draw a hint blob if required. + * Draw a hint rectangle if required. */ if (tile & 2) { - draw_rect(fe, bx + TILE_SIZE/20, by + TILE_SIZE / 20, - TILE_SIZE / 6, TILE_SIZE / 6, COL_HINT); + int x1 = bx + TILE_SIZE / 20, x2 = bx + TILE_SIZE - TILE_SIZE / 20; + int y1 = by + TILE_SIZE / 20, y2 = by + TILE_SIZE - TILE_SIZE / 20; + int i = 3; + while (i--) { + draw_line(fe, x1, y1, x2, y1, COL_HINT); + draw_line(fe, x1, y2, x2, y2, COL_HINT); + draw_line(fe, x1, y1, x1, y2, COL_HINT); + draw_line(fe, x2, y1, x2, y2, COL_HINT); + x1++, y1++, x2--, y2--; + } } unclip(fe); @@ -1174,7 +1186,7 @@ static int game_timing_state(game_state *state) #endif const struct game thegame = { - "Flip", NULL, + "Flip", "games.flip", default_params, game_fetch_preset, decode_params,