Arrange that random seeds are as harmonised as they can reasonably
[sgt/puzzles] / puzzles.h
index f3db36f..b8317ee 100644 (file)
--- a/puzzles.h
+++ b/puzzles.h
@@ -12,6 +12,8 @@
 #define FALSE 0
 #endif
 
+#define PI 3.141592653589793238462643383279502884197169399
+
 #define lenof(array) ( sizeof(array) / sizeof(*(array)) )
 
 #define STR_INT(x) #x
@@ -45,6 +47,9 @@ enum {
 #define IS_MOUSE_RELEASE(m) ( (unsigned)((m) - LEFT_RELEASE) <= \
                                (unsigned)(RIGHT_RELEASE - LEFT_RELEASE))
 
+/* Bit flags indicating mouse button priorities */
+#define BUTTON_BEATS(x,y) ( 1 << (((x)-LEFT_BUTTON)*3+(y)-LEFT_BUTTON) )
+
 #define IGNOREARG(x) ( (x) = (x) )
 
 typedef struct frontend frontend;
@@ -131,6 +136,7 @@ void midend_size(midend_data *me, int *x, int *y);
 void midend_new_game(midend_data *me);
 void midend_restart_game(midend_data *me);
 int midend_process_key(midend_data *me, int x, int y, int button);
+void midend_force_redraw(midend_data *me);
 void midend_redraw(midend_data *me);
 float *midend_colours(midend_data *me, int *ncolours);
 void midend_timer(midend_data *me, float tplus);
@@ -214,7 +220,7 @@ struct game {
     game_params *(*custom_params)(config_item *cfg);
     char *(*validate_params)(game_params *params);
     char *(*new_desc)(game_params *params, random_state *rs,
-                     game_aux_info **aux);
+                     game_aux_info **aux, int interactive);
     void (*free_aux_info)(game_aux_info *aux);
     char *(*validate_desc)(game_params *params, char *desc);
     game_state *(*new_game)(midend_data *me, game_params *params, char *desc);
@@ -226,8 +232,8 @@ struct game {
     char *(*text_format)(game_state *state);
     game_ui *(*new_ui)(game_state *state);
     void (*free_ui)(game_ui *ui);
-    game_state *(*make_move)(game_state *from, game_ui *ui, int x, int y,
-                            int button);
+    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);
     float *(*colours)(frontend *fe, game_state *state, int *ncolours);
     game_drawstate *(*new_drawstate)(game_state *state);
@@ -242,6 +248,7 @@ struct game {
     int (*wants_statusbar)(void);
     int is_timed;
     int (*timing_state)(game_state *state);
+    int mouse_priorities;
 };
 
 /*