Now we have the `dir' parameter, we should use it where it makes

sense to do so.

[originally from svn r4477]
This commit is contained in:
Simon Tatham
2004-08-17 19:59:14 +00:00
parent ae63b8010b
commit a7b1697b1c
2 changed files with 7 additions and 3 deletions

4
cube.c
View File

@ -1366,13 +1366,15 @@ void game_redraw(frontend *fe, game_drawstate *ds, game_state *oldstate,
draw_rect(fe, 0, 0, (int)((bb.r-bb.l+2.0F) * GRID_SCALE), draw_rect(fe, 0, 0, (int)((bb.r-bb.l+2.0F) * GRID_SCALE),
(int)((bb.d-bb.u+2.0F) * GRID_SCALE), COL_BACKGROUND); (int)((bb.d-bb.u+2.0F) * GRID_SCALE), COL_BACKGROUND);
if (oldstate && oldstate->movecount > state->movecount) { if (dir < 0) {
game_state *t; game_state *t;
/* /*
* This is an Undo. So reverse the order of the states, and * This is an Undo. So reverse the order of the states, and
* run the roll timer backwards. * run the roll timer backwards.
*/ */
assert(oldstate);
t = oldstate; t = oldstate;
oldstate = state; oldstate = state;
state = t; state = t;

View File

@ -664,10 +664,12 @@ void game_redraw(frontend *fe, game_drawstate *ds, game_state *oldstate,
float c; float c;
int sense; int sense;
if (oldstate && state->movecount < oldstate->movecount) if (dir < 0) {
assert(oldstate);
sense = -oldstate->last_movement_sense; sense = -oldstate->last_movement_sense;
else } else {
sense = state->last_movement_sense; sense = state->last_movement_sense;
}
t = state->tiles[i]; t = state->tiles[i];