From 4c9fafc4c126af2466dc6c56b9c952f901a1c726 Mon Sep 17 00:00:00 2001 From: kartofen Date: Thu, 22 Dec 2022 14:53:44 +0200 Subject: better tileset configuration --- src/config.h | 44 ++------------------------------------------ src/gen_tiles.c | 9 +++++++-- 2 files changed, 9 insertions(+), 44 deletions(-) (limited to 'src') diff --git a/src/config.h b/src/config.h index bd6fc31..f1fa501 100644 --- a/src/config.h +++ b/src/config.h @@ -1,52 +1,12 @@ // name of the tileset, localated in files/tilesets directory -#define TILESET_NAME "black-white" - -#define DIMENTIONS 2 -#define TILE_TYPES 5 - -tile tiles[TILE_TYPES] = { - { "empty" , 'X', { 0, 0, 0, 0 } }, - { "t" , 'T', { 0, 1, 1, 1 } }, - { "cross" , 'X', { 1, 1, 1, 1 } }, - { "line" , 'I', { 0, 1, 1, 0 } }, - { "corner" , 'T', { 1, 1, 0, 0 } } -}; +#define TILESET knots // Array for which tiles to include the tiles.dat int tiles_to_load[] = { 3, 4 }; -// // name of the tileset, localated in files/tilesets directory -// #define TILESET_NAME "circuit" - -// #define DIMENTIONS 2 -// #define TILE_TYPES 14 - -// // pcb green - 0 -// // green - 1, -// // grey - 2, -// // black - 3, -// // other - 4, 5 -// tile tiles[TILE_TYPES] = { -// { "bridge" , 'I', { 1, 2, 2, 1 } }, -// { "component" , 'X', { 3, 3, 3, 3 } }, -// { "connection" , 'T', { 1, 4, 5, 3 } }, -// { "corner" , 'T', { 0, 0, 4, 5 } }, -// { "dskew" , 'I', { 1, 1, 1, 1 } }, -// { "skew" , 'T', { 1, 1, 0, 0 } }, -// { "substrate" , 'X', { 0, 0, 0, 0 } }, -// { "t" , 'T', { 0, 1, 1, 1 } }, -// { "track" , 'I', { 1, 0, 0, 1 } }, -// { "transition" , 'T', { 2, 0, 0, 1 } }, -// { "turn" , 'T', { 1, 1, 0, 0 } }, -// { "viad" , 'I', { 0, 1, 1, 0 } }, -// { "vias" , 'T', { 1, 0, 0, 0 } }, -// { "wire" , 'I', { 0, 2, 2, 0 } }, -// }; - - -// // Array for which tiles to include the tiles.dat +// #define TILESET circuit // int tiles_to_load[] = { // 0, 1, 2, 3, 4, 5, 6, // 7, 8, 9, 10, 11, 12, 13, diff --git a/src/gen_tiles.c b/src/gen_tiles.c index c29bc29..5d6cba3 100644 --- a/src/gen_tiles.c +++ b/src/gen_tiles.c @@ -8,11 +8,16 @@ typedef struct tile { char name[64]; char symetry; small_t connections[SIDES_MAX]; - // small_t neighbours[TILES_CAP]; -// size_t neigbours_sz; } tile; #include "config.h" +#define STR_AUX(a) #a +#define STR(a) STR_AUX(a) +#define TILESET_PATH(name) STR(../PATH/name/tileset.h) +// include the tileset header configuration +#include TILESET_PATH(TILESET) + +#define TILESET_NAME STR(TILESET) void copy(char *tile_set, char *name, int n) { -- cgit v1.2.3