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;
};
assert(state->tiles[state->gap_pos] == 0);
state->completed = state->movecount = 0;
- state->used_solve = state->just_used_solve = FALSE;
+ state->used_solve = FALSE;
return state;
}
ret->completed = state->completed;
ret->movecount = state->movecount;
ret->used_solve = state->used_solve;
- ret->just_used_solve = state->just_used_solve;
return ret;
}
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;
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);
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;
+ return ANIM_TIME;
}
static float game_flash_length(game_state *oldstate,
struct game_state {
int w, h, n, dead, won;
- int used_solve, just_used_solve;
+ int used_solve;
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->used_solve = state->just_used_solve = FALSE;
+ state->used_solve = FALSE;
wh = state->w * state->h;
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->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->just_used_solve = FALSE;
while (*move) {
if (move[0] == 'F' &&
struct game_state {
int width, height, wrapping, completed;
int last_rotate_x, last_rotate_y, last_rotate_dir;
- int used_solve, just_used_solve;
+ int used_solve;
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;
- 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);
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;
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')
- ret->just_used_solve = ret->used_solve = TRUE;
+ ret->used_solve = TRUE;
move++;
if (*move == ';')
{
int last_rotate_dir;
- /*
- * 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.
*/
struct game_state {
int width, height, cx, cy, wrapping, completed;
- int used_solve, just_used_solve;
+ int used_solve;
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->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;
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;
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++) {
return NULL; /* can't parse move string */
ret = dup_game(from);
- ret->just_used_solve = FALSE;
if (col)
slide_col(ret, d, c);
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;
-
return ANIM_TIME;
}
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;
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;
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;
*/
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;
return NULL;
ret = dup_game(from);
- ret->just_used_solve = FALSE; /* zero this in a hurry */
do {
tx = (cx - dx + from->w) % from->w;
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;
+ return ANIM_TIME;
}
static float game_flash_length(game_state *oldstate,
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 */
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;
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));
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;
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;
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,