mirror of
git://git.tartarus.org/simon/puzzles.git
synced 2025-04-21 16:05:44 -07:00
Undead was not ever actually draw_update()ing to the edges of its
rectangle, which showed up on the Javascript front end since the JS canvas doesn't start out defaulting to COL_BACKGROUND. Fixed it to draw_update to the edge of its area, and while I'm at it, narrowed the border (since this proves we didn't really need that much space anyway). [originally from svn r9795]
This commit is contained in:
14
undead.c
14
undead.c
@ -1644,7 +1644,7 @@ struct game_drawstate {
|
|||||||
};
|
};
|
||||||
|
|
||||||
#define TILESIZE (ds->tilesize)
|
#define TILESIZE (ds->tilesize)
|
||||||
#define BORDER (TILESIZE/2)
|
#define BORDER (TILESIZE/4)
|
||||||
|
|
||||||
static char *interpret_move(game_state *state, game_ui *ui,
|
static char *interpret_move(game_state *state, game_ui *ui,
|
||||||
const game_drawstate *ds, int x, int y, int button)
|
const game_drawstate *ds, int x, int y, int button)
|
||||||
@ -1974,8 +1974,12 @@ static game_state *execute_move(game_state *state, char *move) {
|
|||||||
|
|
||||||
static void game_compute_size(game_params *params, int tilesize,
|
static void game_compute_size(game_params *params, int tilesize,
|
||||||
int *x, int *y) {
|
int *x, int *y) {
|
||||||
*x = tilesize + (2 + params->w) * tilesize;
|
/* Ick: fake up `ds->tilesize' for macro expansion purposes */
|
||||||
*y = tilesize + (3 + params->h) * tilesize;
|
struct { int tilesize; } ads, *ds = &ads;
|
||||||
|
ads.tilesize = tilesize;
|
||||||
|
|
||||||
|
*x = 2*BORDER+(params->w+2)*TILESIZE;
|
||||||
|
*y = 2*BORDER+(params->h+3)*TILESIZE;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2410,8 +2414,8 @@ static void game_redraw(drawing *dr, game_drawstate *ds, game_state *oldstate,
|
|||||||
draw_rect(dr, BORDER+(ds->tilesize*(i+1))+1,
|
draw_rect(dr, BORDER+(ds->tilesize*(i+1))+1,
|
||||||
BORDER+(ds->tilesize*(j+2))+1, ds->tilesize-1,
|
BORDER+(ds->tilesize*(j+2))+1, ds->tilesize-1,
|
||||||
ds->tilesize-1, COL_BACKGROUND);
|
ds->tilesize-1, COL_BACKGROUND);
|
||||||
draw_update(dr,BORDER+TILESIZE-1,BORDER+2*TILESIZE-1,
|
draw_update(dr, 0, 0, 2*BORDER+(ds->w+2)*TILESIZE,
|
||||||
(ds->w)*TILESIZE+3, (ds->h)*TILESIZE+3);
|
2*BORDER+(ds->h+3)*TILESIZE);
|
||||||
}
|
}
|
||||||
|
|
||||||
hchanged = FALSE;
|
hchanged = FALSE;
|
||||||
|
Reference in New Issue
Block a user