#define COORD(x) ( (x) * TILE_SIZE + BORDER )
#define FROMCOORD(x) ( ((x) - BORDER + TILE_SIZE) / TILE_SIZE - 1 )
-#define PI 3.141592653589793238462643383279502884197169399
-
#define ANIM_PER_RADIUS_UNIT 0.13F
#define FLASH_FRAME 0.13F
for (j = 0; j < n/2; j++) {
int k;
int g[4];
- int p[4] = {
- j*w+i,
- i*w+(n-j-1),
- (n-j-1)*w+(n-i-1),
- (n-i-1)*w+j
- };
+ int p[4];
+
+ p[0] = j*w+i;
+ p[1] = i*w+(n-j-1);
+ p[2] = (n-j-1)*w+(n-i-1);
+ p[3] = (n-i-1)*w+j;
for (k = 0; k < 4; k++)
g[k] = grid[p[k]];
int k;
k = sprintf(buf, "%d%c", grid[i] / 4,
- params->orientable ? "uldr"[grid[i] & 3] : ',');
+ (char)(params->orientable ? "uldr"[grid[i] & 3] : ','));
ret = sresize(ret, retlen + k + 1, char);
strcpy(ret + retlen, buf);
static void game_free_drawstate(game_drawstate *ds)
{
+ sfree(ds->grid);
sfree(ds);
}
bgcolour = COL_BACKGROUND;
if (!ds->started) {
- int coords[6];
+ int coords[10];
draw_rect(fe, 0, 0,
TILE_SIZE * state->w + 2 * BORDER,
coords[1] = COORD(state->h) + HIGHLIGHT_WIDTH - 1;
coords[2] = COORD(state->w) + HIGHLIGHT_WIDTH - 1;
coords[3] = COORD(0) - HIGHLIGHT_WIDTH;
- coords[4] = COORD(0) - HIGHLIGHT_WIDTH;
- coords[5] = COORD(state->h) + HIGHLIGHT_WIDTH - 1;
- draw_polygon(fe, coords, 3, TRUE, COL_HIGHLIGHT);
- draw_polygon(fe, coords, 3, FALSE, COL_HIGHLIGHT);
+ coords[4] = coords[2] - TILE_SIZE;
+ coords[5] = coords[3] + TILE_SIZE;
+ coords[8] = COORD(0) - HIGHLIGHT_WIDTH;
+ coords[9] = COORD(state->h) + HIGHLIGHT_WIDTH - 1;
+ coords[6] = coords[8] + TILE_SIZE;
+ coords[7] = coords[9] - TILE_SIZE;
+ draw_polygon(fe, coords, 5, TRUE, COL_HIGHLIGHT);
+ draw_polygon(fe, coords, 5, FALSE, COL_HIGHLIGHT);
coords[1] = COORD(0) - HIGHLIGHT_WIDTH;
coords[0] = COORD(0) - HIGHLIGHT_WIDTH;
- draw_polygon(fe, coords, 3, TRUE, COL_LOWLIGHT);
- draw_polygon(fe, coords, 3, FALSE, COL_LOWLIGHT);
+ draw_polygon(fe, coords, 5, TRUE, COL_LOWLIGHT);
+ draw_polygon(fe, coords, 5, FALSE, COL_LOWLIGHT);
ds->started = TRUE;
}
game_flash_length,
game_wants_statusbar,
FALSE, game_timing_state,
+ 0, /* mouse_priorities */
};