mirror of
git://git.tartarus.org/simon/puzzles.git
synced 2025-04-22 16:32:13 -07:00
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]
This commit is contained in:
@ -2369,7 +2369,7 @@ static void coord_round_to_edge(float x, float y, int *xr, int *yr)
|
||||
#endif
|
||||
|
||||
#ifdef EDITOR
|
||||
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)
|
||||
{
|
||||
char buf[80];
|
||||
@ -2404,7 +2404,7 @@ static char *interpret_move(game_state *state, game_ui *ui, game_drawstate *ds,
|
||||
return NULL;
|
||||
}
|
||||
#else
|
||||
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)
|
||||
{
|
||||
/* UI operations (play mode):
|
||||
|
Reference in New Issue
Block a user