which didn't actually need it. It was originally introduced in
Fifteen to suppress animation on Solve moves, but midend.c now does
that centrally unless the game specifically instructs it otherwise.
Therefore, just_used_solve is obsolete in all games which previously
used it. (Mines was even worse: it scrupulously maintained the
correctness of the field but never used it!)
Untangle is exempt from this cleanup: its `just_solved' field is
used to change the _length_ of the animation on Solve moves, not to
suppress it entirely, and so it has to stay.
[originally from svn r6419]
int *tiles;
int gap_pos;
int completed;
int *tiles;
int gap_pos;
int completed;
- int just_used_solve; /* used to suppress undo animation */
int used_solve; /* used to suppress completion flash */
int movecount;
};
int used_solve; /* used to suppress completion flash */
int movecount;
};
assert(state->tiles[state->gap_pos] == 0);
state->completed = state->movecount = 0;
assert(state->tiles[state->gap_pos] == 0);
state->completed = state->movecount = 0;
- state->used_solve = state->just_used_solve = FALSE;
+ state->used_solve = FALSE;
ret->completed = state->completed;
ret->movecount = state->movecount;
ret->used_solve = state->used_solve;
ret->completed = state->completed;
ret->movecount = state->movecount;
ret->used_solve = state->used_solve;
- ret->just_used_solve = state->just_used_solve;
for (i = 0; i < ret->n; i++)
ret->tiles[i] = (i+1) % ret->n;
ret->gap_pos = ret->n-1;
for (i = 0; i < ret->n; i++)
ret->tiles[i] = (i+1) % ret->n;
ret->gap_pos = ret->n-1;
- ret->used_solve = ret->just_used_solve = TRUE;
+ ret->used_solve = TRUE;
ret->completed = ret->movecount = 1;
return ret;
ret->completed = ret->movecount = 1;
return ret;
up = C(from, ux, uy);
ret = dup_game(from);
up = C(from, ux, uy);
ret = dup_game(from);
- ret->just_used_solve = FALSE; /* zero this in a hurry */
ret->gap_pos = C(from, dx, dy);
assert(ret->gap_pos >= 0 && ret->gap_pos < ret->n);
ret->gap_pos = C(from, dx, dy);
assert(ret->gap_pos >= 0 && ret->gap_pos < ret->n);
static float game_anim_length(game_state *oldstate,
game_state *newstate, int dir, game_ui *ui)
{
static float game_anim_length(game_state *oldstate,
game_state *newstate, int dir, game_ui *ui)
{
- if ((dir > 0 && newstate->just_used_solve) ||
- (dir < 0 && oldstate->just_used_solve))
- return 0.0F;
- else
- return ANIM_TIME;
}
static float game_flash_length(game_state *oldstate,
}
static float game_flash_length(game_state *oldstate,
struct game_state {
int w, h, n, dead, won;
struct game_state {
int w, h, n, dead, won;
- int used_solve, just_used_solve;
struct mine_layout *layout; /* real mine positions */
signed char *grid; /* player knowledge */
/*
struct mine_layout *layout; /* real mine positions */
signed char *grid; /* player knowledge */
/*
state->h = params->h;
state->n = params->n;
state->dead = state->won = FALSE;
state->h = params->h;
state->n = params->n;
state->dead = state->won = FALSE;
- state->used_solve = state->just_used_solve = FALSE;
+ state->used_solve = FALSE;
wh = state->w * state->h;
wh = state->w * state->h;
ret->dead = state->dead;
ret->won = state->won;
ret->used_solve = state->used_solve;
ret->dead = state->dead;
ret->won = state->won;
ret->used_solve = state->used_solve;
- ret->just_used_solve = state->just_used_solve;
ret->layout = state->layout;
ret->layout->refcount++;
ret->grid = snewn(ret->w * ret->h, signed char);
ret->layout = state->layout;
ret->layout->refcount++;
ret->grid = snewn(ret->w * ret->h, signed char);
ret->grid[yy*ret->w+xx] = v;
}
}
ret->grid[yy*ret->w+xx] = v;
}
}
- ret->used_solve = ret->just_used_solve = TRUE;
+ ret->used_solve = TRUE;
ret->won = TRUE;
return ret;
} else {
ret = dup_game(from);
ret->won = TRUE;
return ret;
} else {
ret = dup_game(from);
- ret->just_used_solve = FALSE;
while (*move) {
if (move[0] == 'F' &&
while (*move) {
if (move[0] == 'F' &&
struct game_state {
int width, height, wrapping, completed;
int last_rotate_x, last_rotate_y, last_rotate_dir;
struct game_state {
int width, height, wrapping, completed;
int last_rotate_x, last_rotate_y, last_rotate_dir;
- int used_solve, just_used_solve;
unsigned char *tiles;
unsigned char *barriers;
};
unsigned char *tiles;
unsigned char *barriers;
};
h = state->height = params->height;
state->wrapping = params->wrapping;
state->last_rotate_dir = state->last_rotate_x = state->last_rotate_y = 0;
h = state->height = params->height;
state->wrapping = params->wrapping;
state->last_rotate_dir = state->last_rotate_x = state->last_rotate_y = 0;
- state->completed = state->used_solve = state->just_used_solve = FALSE;
+ state->completed = state->used_solve = FALSE;
state->tiles = snewn(state->width * state->height, unsigned char);
memset(state->tiles, 0, state->width * state->height);
state->barriers = snewn(state->width * state->height, unsigned char);
state->tiles = snewn(state->width * state->height, unsigned char);
memset(state->tiles, 0, state->width * state->height);
state->barriers = snewn(state->width * state->height, unsigned char);
ret->wrapping = state->wrapping;
ret->completed = state->completed;
ret->used_solve = state->used_solve;
ret->wrapping = state->wrapping;
ret->completed = state->completed;
ret->used_solve = state->used_solve;
- ret->just_used_solve = state->just_used_solve;
ret->last_rotate_dir = state->last_rotate_dir;
ret->last_rotate_x = state->last_rotate_x;
ret->last_rotate_y = state->last_rotate_y;
ret->last_rotate_dir = state->last_rotate_dir;
ret->last_rotate_x = state->last_rotate_x;
ret->last_rotate_y = state->last_rotate_y;
int tx, ty, n, noanim, orig;
ret = dup_game(from);
int tx, ty, n, noanim, orig;
ret = dup_game(from);
- ret->just_used_solve = FALSE;
if (move[0] == 'J' || move[0] == 'S') {
if (move[0] == 'S')
if (move[0] == 'J' || move[0] == 'S') {
if (move[0] == 'S')
- ret->just_used_solve = ret->used_solve = TRUE;
+ ret->used_solve = TRUE;
move++;
if (*move == ';')
move++;
if (*move == ';')
- /*
- * Don't animate an auto-solve move.
- */
- if ((dir > 0 && newstate->just_used_solve) ||
- (dir < 0 && oldstate->just_used_solve))
- return 0.0F;
-
/*
* Don't animate if last_rotate_dir is zero.
*/
/*
* Don't animate if last_rotate_dir is zero.
*/
struct game_state {
int width, height, cx, cy, wrapping, completed;
struct game_state {
int width, height, cx, cy, wrapping, completed;
- int used_solve, just_used_solve;
int move_count, movetarget;
/* position (row or col number, starting at 0) of last move. */
int move_count, movetarget;
/* position (row or col number, starting at 0) of last move. */
state->wrapping = params->wrapping;
state->movetarget = params->movetarget;
state->completed = 0;
state->wrapping = params->wrapping;
state->movetarget = params->movetarget;
state->completed = 0;
- state->used_solve = state->just_used_solve = FALSE;
+ state->used_solve = FALSE;
state->move_count = 0;
state->last_move_row = -1;
state->last_move_col = -1;
state->move_count = 0;
state->last_move_row = -1;
state->last_move_col = -1;
ret->movetarget = state->movetarget;
ret->completed = state->completed;
ret->used_solve = state->used_solve;
ret->movetarget = state->movetarget;
ret->completed = state->completed;
ret->used_solve = state->used_solve;
- ret->just_used_solve = state->just_used_solve;
ret->move_count = state->move_count;
ret->last_move_row = state->last_move_row;
ret->last_move_col = state->last_move_col;
ret->move_count = state->move_count;
ret->last_move_row = state->last_move_row;
ret->last_move_col = state->last_move_col;
strlen(move) == from->width * from->height + 1) {
int i;
ret = dup_game(from);
strlen(move) == from->width * from->height + 1) {
int i;
ret = dup_game(from);
- ret->used_solve = ret->just_used_solve = TRUE;
+ ret->used_solve = TRUE;
ret->completed = ret->move_count = 1;
for (i = 0; i < from->width * from->height; i++) {
ret->completed = ret->move_count = 1;
for (i = 0; i < from->width * from->height; i++) {
return NULL; /* can't parse move string */
ret = dup_game(from);
return NULL; /* can't parse move string */
ret = dup_game(from);
- ret->just_used_solve = FALSE;
if (col)
slide_col(ret, d, c);
if (col)
slide_col(ret, d, c);
static float game_anim_length(game_state *oldstate,
game_state *newstate, int dir, game_ui *ui)
{
static float game_anim_length(game_state *oldstate,
game_state *newstate, int dir, game_ui *ui)
{
- /*
- * Don't animate an auto-solve move.
- */
- if ((dir > 0 && newstate->just_used_solve) ||
- (dir < 0 && oldstate->just_used_solve))
- return 0.0F;
-
int w, h, n;
int *tiles;
int completed;
int w, h, n;
int *tiles;
int completed;
- int just_used_solve; /* used to suppress undo animation */
int used_solve; /* used to suppress completion flash */
int movecount, movetarget;
int last_movement_sense;
int used_solve; /* used to suppress completion flash */
int movecount, movetarget;
int last_movement_sense;
state->completed = state->movecount = 0;
state->movetarget = params->movetarget;
state->completed = state->movecount = 0;
state->movetarget = params->movetarget;
- state->used_solve = state->just_used_solve = FALSE;
+ state->used_solve = FALSE;
state->last_movement_sense = 0;
return state;
state->last_movement_sense = 0;
return state;
ret->movecount = state->movecount;
ret->movetarget = state->movetarget;
ret->used_solve = state->used_solve;
ret->movecount = state->movecount;
ret->movetarget = state->movetarget;
ret->used_solve = state->used_solve;
- ret->just_used_solve = state->just_used_solve;
ret->last_movement_sense = state->last_movement_sense;
return ret;
ret->last_movement_sense = state->last_movement_sense;
return ret;
*/
for (i = 0; i < ret->n; i++)
ret->tiles[i] = i+1;
*/
for (i = 0; i < ret->n; i++)
ret->tiles[i] = i+1;
- ret->used_solve = ret->just_used_solve = TRUE;
+ ret->used_solve = TRUE;
ret->completed = ret->movecount = 1;
return ret;
ret->completed = ret->movecount = 1;
return ret;
return NULL;
ret = dup_game(from);
return NULL;
ret = dup_game(from);
- ret->just_used_solve = FALSE; /* zero this in a hurry */
do {
tx = (cx - dx + from->w) % from->w;
do {
tx = (cx - dx + from->w) % from->w;
static float game_anim_length(game_state *oldstate,
game_state *newstate, int dir, game_ui *ui)
{
static float game_anim_length(game_state *oldstate,
game_state *newstate, int dir, game_ui *ui)
{
- if ((dir > 0 && newstate->just_used_solve) ||
- (dir < 0 && oldstate->just_used_solve))
- return 0.0F;
- else
- return ANIM_TIME;
}
static float game_flash_length(game_state *oldstate,
}
static float game_flash_length(game_state *oldstate,
int orientable;
int *grid;
int completed;
int orientable;
int *grid;
int completed;
- int just_used_solve; /* used to suppress undo animation */
int used_solve; /* used to suppress completion flash */
int movecount, movetarget;
int lastx, lasty, lastr; /* coordinates of last rotation */
int used_solve; /* used to suppress completion flash */
int movecount, movetarget;
int lastx, lasty, lastr; /* coordinates of last rotation */
state->n = n;
state->orientable = params->orientable;
state->completed = 0;
state->n = n;
state->orientable = params->orientable;
state->completed = 0;
- state->used_solve = state->just_used_solve = FALSE;
+ state->used_solve = FALSE;
state->movecount = 0;
state->movetarget = params->movetarget;
state->lastx = state->lasty = state->lastr = -1;
state->movecount = 0;
state->movetarget = params->movetarget;
state->lastx = state->lasty = state->lastr = -1;
ret->lasty = state->lasty;
ret->lastr = state->lastr;
ret->used_solve = state->used_solve;
ret->lasty = state->lasty;
ret->lastr = state->lastr;
ret->used_solve = state->used_solve;
- ret->just_used_solve = state->just_used_solve;
ret->grid = snewn(ret->w * ret->h, int);
memcpy(ret->grid, state->grid, ret->w * ret->h * sizeof(int));
ret->grid = snewn(ret->w * ret->h, int);
memcpy(ret->grid, state->grid, ret->w * ret->h * sizeof(int));
qsort(ret->grid, ret->w*ret->h, sizeof(int), compare_int);
for (i = 0; i < ret->w*ret->h; i++)
ret->grid[i] &= ~3;
qsort(ret->grid, ret->w*ret->h, sizeof(int), compare_int);
for (i = 0; i < ret->w*ret->h; i++)
ret->grid[i] &= ~3;
- ret->used_solve = ret->just_used_solve = TRUE;
+ ret->used_solve = TRUE;
ret->completed = ret->movecount = 1;
return ret;
ret->completed = ret->movecount = 1;
return ret;
return NULL; /* can't parse this move string */
ret = dup_game(from);
return NULL; /* can't parse this move string */
ret = dup_game(from);
- ret->just_used_solve = FALSE; /* zero this in a hurry */
ret->movecount++;
do_rotate(ret->grid, w, h, n, ret->orientable, x, y, dir);
ret->lastx = x;
ret->movecount++;
do_rotate(ret->grid, w, h, n, ret->orientable, x, y, dir);
ret->lastx = x;
static float game_anim_length(game_state *oldstate, game_state *newstate,
int dir, game_ui *ui)
{
static float game_anim_length(game_state *oldstate, game_state *newstate,
int dir, game_ui *ui)
{
- if ((dir > 0 && newstate->just_used_solve) ||
- (dir < 0 && oldstate->just_used_solve))
- return 0.0F;
- else
- return ANIM_PER_RADIUS_UNIT * sqrt(newstate->n-1);
+ return ANIM_PER_RADIUS_UNIT * sqrt(newstate->n-1);
}
static float game_flash_length(game_state *oldstate, game_state *newstate,
}
static float game_flash_length(game_state *oldstate, game_state *newstate,