X-Git-Url: https://git.distorted.org.uk/~mdw/sgt/puzzles/blobdiff_plain/ab53eb64790d5bee44525c3a50a420a6816e2495..154bf9b1ed5f05b68c9f7c4d2e3d42e181170f53:/puzzles.h diff --git a/puzzles.h b/puzzles.h index 8be9009..f3aee1a 100644 --- a/puzzles.h +++ b/puzzles.h @@ -22,8 +22,12 @@ #define STR(x) STR_INT(x) /* NB not perfect because they evaluate arguments multiple times. */ +#ifndef max #define max(x,y) ( (x)>(y) ? (x) : (y) ) +#endif /* max */ +#ifndef min #define min(x,y) ( (x)<(y) ? (x) : (y) ) +#endif /* min */ enum { LEFT_BUTTON = 0x0200, @@ -39,6 +43,7 @@ enum { CURSOR_DOWN, CURSOR_LEFT, CURSOR_RIGHT, + CURSOR_SELECT, /* made smaller because of 'limited range of datatype' errors. */ MOD_CTRL = 0x1000, @@ -147,7 +152,7 @@ void get_random_seed(void **randseed, int *randseedsize); midend_data *midend_new(frontend *fe, const game *ourgame); void midend_free(midend_data *me); void midend_set_params(midend_data *me, game_params *params); -void midend_size(midend_data *me, int *x, int *y); +void midend_size(midend_data *me, int *x, int *y, int expand); void midend_new_game(midend_data *me); void midend_restart_game(midend_data *me); void midend_stop_anim(midend_data *me); @@ -248,9 +253,12 @@ struct game { char *(*text_format)(game_state *state); game_ui *(*new_ui)(game_state *state); void (*free_ui)(game_ui *ui); + void (*changed_state)(game_ui *ui, game_state *oldstate, + game_state *newstate); game_state *(*make_move)(game_state *from, game_ui *ui, game_drawstate *ds, int x, int y, int button); - void (*size)(game_params *params, int *x, int *y); + void (*size)(game_params *params, game_drawstate *ds, int *x, int *y, + int expand); float *(*colours)(frontend *fe, game_state *state, int *ncolours); game_drawstate *(*new_drawstate)(game_state *state); void (*free_drawstate)(game_drawstate *ds);