both get passed a pointer to the game_ui. This means that if they
need to note down information for the redraw function about what
_type_ of flash or animation is required, they now have somewhere to
do so.
git-svn-id: svn://svn.tartarus.org/sgt/puzzles@5858
cda61777-01e9-0310-a592-
d414129be87e
12 files changed:
}
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 ROLLTIME;
}
static float game_flash_length(game_state *oldstate,
{
return ROLLTIME;
}
static float game_flash_length(game_state *oldstate,
- game_state *newstate, int dir)
+ game_state *newstate, int dir, game_ui *ui)
}
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)
{
if ((dir > 0 && newstate->just_used_solve) ||
(dir < 0 && oldstate->just_used_solve))
{
if ((dir > 0 && newstate->just_used_solve) ||
(dir < 0 && oldstate->just_used_solve))
}
static float game_flash_length(game_state *oldstate,
}
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->used_solve && !newstate->used_solve)
{
if (!oldstate->completed && newstate->completed &&
!oldstate->used_solve && !newstate->used_solve)
flashtime = me->ourgame->flash_length(me->oldstate ? me->oldstate :
me->states[me->statepos-2].state,
me->states[me->statepos-1].state,
flashtime = me->ourgame->flash_length(me->oldstate ? me->oldstate :
me->states[me->statepos-2].state,
me->states[me->statepos-1].state,
- me->oldstate ? me->dir : +1);
+ me->oldstate ? me->dir : +1,
+ me->ui);
if (flashtime > 0) {
me->flash_pos = 0.0F;
me->flash_time = flashtime;
if (flashtime > 0) {
me->flash_pos = 0.0F;
me->flash_time = flashtime;
} else {
anim_time = me->ourgame->anim_length(oldstate,
me->states[me->statepos-1].state,
} else {
anim_time = me->ourgame->anim_length(oldstate,
me->states[me->statepos-1].state,
}
me->oldstate = oldstate;
}
me->oldstate = 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)
}
static float game_flash_length(game_state *oldstate,
}
static float game_flash_length(game_state *oldstate,
- game_state *newstate, int dir)
+ game_state *newstate, int dir, game_ui *ui)
{
/*
* If the game has just been completed, we display a completion
{
/*
* If the game has just been completed, we display a completion
}
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)
{
/*
* Don't animate an auto-solve move.
{
/*
* Don't animate an auto-solve move.
}
static float game_flash_length(game_state *oldstate,
}
static float game_flash_length(game_state *oldstate,
- game_state *newstate, int dir)
+ game_state *newstate, int dir, game_ui *ui)
{
/*
* If the game has just been completed, we display a completion
{
/*
* If the game has just been completed, we display a completion
}
static float game_anim_length(game_state *oldstate, game_state *newstate,
}
static float game_anim_length(game_state *oldstate, game_state *newstate,
{
return 0.0F;
}
static float game_flash_length(game_state *oldstate, game_state *newstate,
{
return 0.0F;
}
static float game_flash_length(game_state *oldstate, game_state *newstate,
}
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)
void (*redraw)(frontend *fe, game_drawstate *ds, game_state *oldstate,
game_state *newstate, int dir, game_ui *ui, float anim_time,
float flash_time);
void (*redraw)(frontend *fe, game_drawstate *ds, game_state *oldstate,
game_state *newstate, int dir, game_ui *ui, float anim_time,
float flash_time);
- float (*anim_length)(game_state *oldstate, game_state *newstate, int dir);
- float (*flash_length)(game_state *oldstate, game_state *newstate, int dir);
+ float (*anim_length)(game_state *oldstate, game_state *newstate, int dir,
+ game_ui *ui);
+ float (*flash_length)(game_state *oldstate, game_state *newstate, int dir,
+ game_ui *ui);
int (*wants_statusbar)(void);
};
int (*wants_statusbar)(void);
};
}
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)
}
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)
{
if ((dir > 0 && newstate->just_used_solve) ||
(dir < 0 && oldstate->just_used_solve))
{
if ((dir > 0 && newstate->just_used_solve) ||
(dir < 0 && oldstate->just_used_solve))
}
static float game_flash_length(game_state *oldstate,
}
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->used_solve && !newstate->used_solve)
{
if (!oldstate->completed && newstate->completed &&
!oldstate->used_solve && !newstate->used_solve)
}
static float game_anim_length(game_state *oldstate, game_state *newstate,
}
static float game_anim_length(game_state *oldstate, game_state *newstate,
{
return 0.0F;
}
static float game_flash_length(game_state *oldstate, game_state *newstate,
{
return 0.0F;
}
static float game_flash_length(game_state *oldstate, game_state *newstate,
{
if (!oldstate->completed && newstate->completed &&
!oldstate->cheated && !newstate->cheated)
{
if (!oldstate->completed && newstate->completed &&
!oldstate->cheated && !newstate->cheated)
}
static float game_anim_length(game_state *oldstate, game_state *newstate,
}
static float game_anim_length(game_state *oldstate, game_state *newstate,
{
if ((dir > 0 && newstate->just_used_solve) ||
(dir < 0 && oldstate->just_used_solve))
{
if ((dir > 0 && newstate->just_used_solve) ||
(dir < 0 && oldstate->just_used_solve))
}
static float game_flash_length(game_state *oldstate, game_state *newstate,
}
static float game_flash_length(game_state *oldstate, game_state *newstate,
{
if (!oldstate->completed && newstate->completed &&
!oldstate->used_solve && !newstate->used_solve)
{
if (!oldstate->completed && newstate->completed &&
!oldstate->used_solve && !newstate->used_solve)
*/
if (oldstate) {
float angle;
*/
if (oldstate) {
float angle;
- float anim_max = game_anim_length(oldstate, state, dir);
+ float anim_max = game_anim_length(oldstate, state, dir, ui);
if (dir > 0) {
lastx = state->lastx;
if (dir > 0) {
lastx = state->lastx;