~mdw
/
sgt
/
puzzles
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Gareth points out that the recess highlights around the outside of
[sgt/puzzles]
/
pattern.c
diff --git
a/pattern.c
b/pattern.c
index
438243d
..
26201e8
100644
(file)
--- a/
pattern.c
+++ b/
pattern.c
@@
-475,7
+475,7
@@
struct game_aux_info {
};
static char *new_game_desc(game_params *params, random_state *rs,
};
static char *new_game_desc(game_params *params, random_state *rs,
- game_aux_info **aux)
+ game_aux_info **aux
, int interactive
)
{
unsigned char *grid;
int i, j, max, rowlen, *rowdata;
{
unsigned char *grid;
int i, j, max, rowlen, *rowdata;
@@
-601,7
+601,7
@@
static char *validate_desc(game_params *params, char *desc)
return NULL;
}
return NULL;
}
-static game_state *new_game(game_params *params, char *desc)
+static game_state *new_game(
midend_data *me,
game_params *params, char *desc)
{
int i;
char *p;
{
int i;
char *p;
@@
-764,11
+764,12
@@
static void free_ui(game_ui *ui)
sfree(ui);
}
sfree(ui);
}
-static game_state *make_move(game_state *from, game_ui *ui,
- int x, int y, int button)
-{
+static game_state *make_move(game_state *from, game_ui *ui, game_drawstate *ds,
+ int x, int y, int button) {
game_state *ret;
game_state *ret;
+ button &= ~MOD_MASK;
+
x = FROMCOORD(from->w, x);
y = FROMCOORD(from->h, y);
x = FROMCOORD(from->w, x);
y = FROMCOORD(from->h, y);
@@
-1084,13
+1085,13
@@
static void game_redraw(frontend *fe, game_drawstate *ds, game_state *oldstate,
}
static float game_anim_length(game_state *oldstate,
}
static float game_anim_length(game_state *oldstate,
- game_state *newstate, int dir)
+ game_state *newstate, int dir
, game_ui *ui
)
{
return 0.0F;
}
static float game_flash_length(game_state *oldstate,
{
return 0.0F;
}
static float game_flash_length(game_state *oldstate,
- game_state *newstate, int dir)
+ game_state *newstate, int dir
, game_ui *ui
)
{
if (!oldstate->completed && newstate->completed &&
!oldstate->cheated && !newstate->cheated)
{
if (!oldstate->completed && newstate->completed &&
!oldstate->cheated && !newstate->cheated)
@@
-1103,6
+1104,11
@@
static int game_wants_statusbar(void)
return FALSE;
}
return FALSE;
}
+static int game_timing_state(game_state *state)
+{
+ return TRUE;
+}
+
#ifdef COMBINED
#define thegame pattern
#endif
#ifdef COMBINED
#define thegame pattern
#endif
@@
-1136,6
+1142,8
@@
const struct game thegame = {
game_anim_length,
game_flash_length,
game_wants_statusbar,
game_anim_length,
game_flash_length,
game_wants_statusbar,
+ FALSE, game_timing_state,
+ 0, /* mouse_priorities */
};
#ifdef STANDALONE_SOLVER
};
#ifdef STANDALONE_SOLVER
@@
-1206,13
+1214,14
@@
int main(int argc, char **argv)
}
*desc++ = '\0';
}
*desc++ = '\0';
- p = decode_params(id);
+ p = default_params();
+ decode_params(p, id);
err = validate_desc(p, desc);
if (err) {
fprintf(stderr, "%s: %s\n", argv[0], err);
return 1;
}
err = validate_desc(p, desc);
if (err) {
fprintf(stderr, "%s: %s\n", argv[0], err);
return 1;
}
- s = new_game(p, desc);
+ s = new_game(
NULL,
p, desc);
{
int w = p->w, h = p->h, i, j, done_any, max;
{
int w = p->w, h = p->h, i, j, done_any, max;