diff options
Diffstat (limited to 'src/gen_tiles.c')
-rw-r--r-- | src/gen_tiles.c | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/src/gen_tiles.c b/src/gen_tiles.c index f7e030e..e4e2159 100644 --- a/src/gen_tiles.c +++ b/src/gen_tiles.c @@ -59,6 +59,8 @@ FILE *fp; void save(small_t *t, small_t *c, int n, int i) { #ifdef GENERATE_PPM_TILES + (void)i; + char file_name[64] = {0}; sprintf(file_name, "files/tiles/tile_%d.ppm", n); @@ -66,9 +68,15 @@ void save(small_t *t, small_t *c, int n, int i) small_t *pixels = malloc(TILE_WIDTH * TILE_HEIGHT *3); for(int y = 0; y < TILE_HEIGHT; y++) for(int x = 0; x < TILE_WIDTH; x++) { - set_color(pixels, t, x, y, 0, 255, 0); - set_color(pixels, t, x, y, 1, 255, 0); - set_color(pixels, t, x, y, 2, 255, 0); + set_color(pixels, t, x, y, 0, + generated_tile_colors[0][0], + generated_tile_colors[1][0]); + set_color(pixels, t, x, y, 1, + generated_tile_colors[0][1], + generated_tile_colors[1][1]); + set_color(pixels, t, x, y, 2, + generated_tile_colors[0][2], + generated_tile_colors[1][2]); } save_as_ppm(file_name, pixels, TILE_WIDTH, TILE_HEIGHT, 1); @@ -76,6 +84,8 @@ void save(small_t *t, small_t *c, int n, int i) printf("Saved file: %s\n", file_name); #endif #ifdef TILESET_NAME + (void)t; (void)c; + char command[128]; sprintf(command, "cp files/tilesets/%s/%s.ppm files/tiles/tile_%d.ppm", TILESET_NAME, tile_names[i], n); system(command); |