~mdw
/
sgt
/
puzzles
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Cleanup patch from James H: disable the `s' key, which was only in
[sgt/puzzles]
/
galaxies.c
diff --git
a/galaxies.c
b/galaxies.c
index
d59509e
..
e1bc5b5
100644
(file)
--- a/
galaxies.c
+++ b/
galaxies.c
@@
-298,8
+298,8
@@
static void add_assoc(game_state *state, space *tile, space *dot) {
tile->dotx = dot->x;
tile->doty = dot->y;
dot->nassoc++;
tile->dotx = dot->x;
tile->doty = dot->y;
dot->nassoc++;
- debug(("add_assoc sp %d %d --> dot %d,%d, new nassoc %d.\n",
- tile->x, tile->y, dot->x, dot->y, dot->nassoc));
+
/*
debug(("add_assoc sp %d %d --> dot %d,%d, new nassoc %d.\n",
+ tile->x, tile->y, dot->x, dot->y, dot->nassoc));
*/
}
static struct space *sp2dot(game_state *state, int x, int y)
}
static struct space *sp2dot(game_state *state, int x, int y)
@@
-1216,8
+1216,8
@@
generate:
clear_game(state, 1);
ntries++;
clear_game(state, 1);
ntries++;
- /
/generate_pass(state, rs, scratch, 10, GP_DOTS);
- /
/generate_pass(state, rs, scratch, 100, 0);
+ /
* generate_pass(state, rs, scratch, 10, GP_DOTS); */
+ /
* generate_pass(state, rs, scratch, 100, 0); */
generate_pass(state, rs, scratch, 100, GP_DOTS);
game_update_dots(state);
generate_pass(state, rs, scratch, 100, GP_DOTS);
game_update_dots(state);
@@
-2075,7
+2075,7
@@
static void game_changed_state(game_ui *ui, game_state *oldstate,
#define PREFERRED_TILE_SIZE 32
#define TILE_SIZE (ds->tilesize)
#define DOT_SIZE (TILE_SIZE / 4)
#define PREFERRED_TILE_SIZE 32
#define TILE_SIZE (ds->tilesize)
#define DOT_SIZE (TILE_SIZE / 4)
-#define EDGE_THICKNESS (
TILE_SIZE / 16
)
+#define EDGE_THICKNESS (
max(TILE_SIZE / 16, 2)
)
#define BORDER TILE_SIZE
#define COORD(x) ( (x) * TILE_SIZE + BORDER )
#define BORDER TILE_SIZE
#define COORD(x) ( (x) * TILE_SIZE + BORDER )
@@
-2197,14
+2197,10
@@
static char *interpret_move(game_state *state, game_ui *ui, game_drawstate *ds,
int px, py;
struct space *sp, *dot;
int px, py;
struct space *sp, *dot;
- if (button == 'H' || button == 'h' ||
- button == 'S' || button == 's') {
+ if (button == 'H' || button == 'h') {
char *ret;
game_state *tmp = dup_game(state);
char *ret;
game_state *tmp = dup_game(state);
- if (button == 'H' || button == 'h')
- solver_obvious(tmp);
- else
- solver_state(tmp, DIFF_UNREASONABLE-1);
+ solver_obvious(tmp);
ret = diff_game(state, tmp, 0);
free_game(tmp);
return ret;
ret = diff_game(state, tmp, 0);
free_game(tmp);
return ret;
@@
-2225,8
+2221,8
@@
static char *interpret_move(game_state *state, game_ui *ui, game_drawstate *ds,
} else if (button == RIGHT_BUTTON) {
int px1, py1;
} else if (button == RIGHT_BUTTON) {
int px1, py1;
- px =
2*(FROMCOORD( (int)((float)x + 0.5) )
);
- py =
2*(FROMCOORD( (int)((float)y + 0.5) )
);
+ px =
(int)(2*FROMCOORD((float)x) + 0.5
);
+ py =
(int)(2*FROMCOORD((float)y) + 0.5
);
dot = NULL;
dot = NULL;
@@
-2245,8
+2241,8
@@
static char *interpret_move(game_state *state, game_ui *ui, game_drawstate *ds,
* Found a dot. Begin a drag from it.
*/
dot = &SPACE(state, px1, py1);
* Found a dot. Begin a drag from it.
*/
dot = &SPACE(state, px1, py1);
- ui->srcx = px;
- ui->srcy = py;
+ ui->srcx = px
1
;
+ ui->srcy = py
1
;
goto done; /* multi-level break */
}
}
goto done; /* multi-level break */
}
}
@@
-2594,6
+2590,7
@@
static game_state *execute_move(game_state *state, char *move)
#endif
} else if (c == 'S') {
move++;
#endif
} else if (c == 'S') {
move++;
+ ret->used_solve = 1;
} else
goto badmove;
} else
goto badmove;
@@
-3230,11
+3227,11
@@
const struct game thegame = {
FALSE, FALSE, NULL, NULL,
TRUE, /* wants_statusbar */
#else
FALSE, FALSE, NULL, NULL,
TRUE, /* wants_statusbar */
#else
- TRUE,
TRU
E, game_print_size, game_print,
+ TRUE,
FALS
E, game_print_size, game_print,
FALSE, /* wants_statusbar */
#endif
FALSE, game_timing_state,
FALSE, /* wants_statusbar */
#endif
FALSE, game_timing_state,
-
0,
/* flags */
+
REQUIRE_RBUTTON,
/* flags */
};
#ifdef STANDALONE_SOLVER
};
#ifdef STANDALONE_SOLVER