From 3b250baa02a7332510685948bf17576c397b8ceb Mon Sep 17 00:00:00 2001 From: Simon Tatham Date: Sun, 9 Sep 2012 18:40:12 +0000 Subject: New rule: interpret_move() is passed a pointer to the game_drawstate basically just so that it can divide mouse coordinates by the tile size, but is definitely not expected to _write_ to it, and it hadn't previously occurred to me that anyone might try. Therefore, interpret_move() now gets a pointer to a _const_ game_drawstate instead of a writable one. All existing puzzles cope fine with this API change (as long as the new const qualifier is also added to a couple of subfunctions to which interpret_move delegates work), except for the just-committed Undead, which somehow had ds->ascii and ui->ascii the wrong way round but is otherwise unproblematic. [originally from svn r9657] --- range.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'range.c') diff --git a/range.c b/range.c index 425259f..43231d9 100644 --- a/range.c +++ b/range.c @@ -1248,7 +1248,7 @@ struct game_drawstate { #define COORD(x) ((x) * TILESIZE + BORDER) #define FROMCOORD(x) (((x) - BORDER) / TILESIZE) -static char *interpret_move(game_state *state, game_ui *ui, game_drawstate *ds, +static char *interpret_move(game_state *state, game_ui *ui, const game_drawstate *ds, int x, int y, int button) { enum {none, forwards, backwards, hint}; -- cgit v1.1