* outlines by the judicious use of diagonally divided squares.
*/
{
- random_state *rs = random_init(desc, strlen(desc));
+ random_state *rs = random_new(desc, strlen(desc));
int *squares = snewn(wh, int);
int done_something;
sfree(state->map->regiony);
sfree(state->map);
}
+ sfree(state->pencil);
sfree(state->colouring);
sfree(state);
}
}
struct game_ui {
- int drag_colour; /* -1 means no drag active */
+ /*
+ * drag_colour:
+ *
+ * - -2 means no drag currently active.
+ * - >=0 means we're dragging a solid colour.
+ * - -1 means we're dragging a blank space, and drag_pencil
+ * might or might not add some pencil-mark stipples to that.
+ */
+ int drag_colour;
int drag_pencil;
int dragx, dragy;
int show_numbers;
{
ds->tilesize = tilesize;
- if (ds->bl)
- blitter_free(dr, ds->bl);
+ assert(!ds->bl); /* set_size is never called twice */
ds->bl = blitter_new(dr, TILESIZE+3, TILESIZE+3);
}
static void draw_square(drawing *dr, game_drawstate *ds,
game_params *params, struct map *map,
- int x, int y, int v)
+ int x, int y, unsigned long v)
{
int w = params->w, h = params->h, wh = w*h;
- int tv, bv, xo, yo, errs, pencil, i, j, oldj;
- int show_numbers;
+ int tv, bv, xo, yo, i, j, oldj;
+ unsigned long errs, pencil, show_numbers;
errs = v & ERR_MASK;
v &= ~ERR_MASK;
draw_circle(dr, COORD(x) + (xo+1)*TILESIZE/5,
COORD(y) + (yo+1)*TILESIZE/5,
- TILESIZE/8, COL_0 + c, COL_0 + c);
+ TILESIZE/7, COL_0 + c, COL_0 + c);
}
/*
for (x = 0; x < w; x++) {
int tv = state->colouring[state->map->map[TE * wh + y*w+x]];
int bv = state->colouring[state->map->map[BE * wh + y*w+x]];
- int v;
+ unsigned long v;
if (tv < 0)
tv = FOUR;
*/
for (y = 0; y < h; y++)
for (x = 0; x < w; x++) {
- int v = ds->todraw[y*w+x];
+ unsigned long v = ds->todraw[y*w+x];
if (ds->drawn[y*w+x] != v) {
draw_square(dr, ds, &state->p, state->map, x, y, v);
ds->drawn[y*w+x] = v;
/* Ick: fake up `ds->tilesize' for macro expansion purposes */
struct { int tilesize; } ads, *ds = &ads;
+ /* We can't call game_set_size() here because we don't want a blitter */
ads.tilesize = tilesize;
ink = print_mono_colour(dr, 0);