typedef struct tile {
color_t color;
int number;
+ int x;
+ int y;
} tile_t;
#define DECK_MAX_TILES 104
{
tile->color = color;
tile->number = number;
+ tile->x = 0;
+ tile->y = 0;
}
static void tile_print(tile_t tile)
printf("%6s %2d\n", colors[tile.color], tile.number + 1);
}
-static void tile_draw(game_t *game, tile_t *tile, cairo_t *cr, int x, int y)
+static void tile_draw(game_t *game, tile_t *tile, cairo_t *cr)
{
char number_string[3];
int len;
FATAL_ERROR ("snprintf failed");
cairo_save(cr);
- cairo_translate(cr, x, y);
+ cairo_translate(cr, tile->x, tile->y);
rsvg_handle_render_cairo (game->blanktile, cr);
if (tile->color == BLACK)
{
for (j = 0; j < 13; ++j)
{
- tile_draw(game, &game->deck.tiles[j + (i * 13)],
- cr, 45 * j, 55 * i);
+ tile_draw(game, &game->deck.tiles[j + (i * 13)], cr);
}
}
}