From d9604e398bacb02e6000825243b875e5cfc007e4 Mon Sep 17 00:00:00 2001 From: kartofen Date: Wed, 10 Aug 2022 19:04:15 +0300 Subject: works with colors --- src/tiles.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/tiles.c') diff --git a/src/tiles.c b/src/tiles.c index 6b7a39b..d3fdc9d 100644 --- a/src/tiles.c +++ b/src/tiles.c @@ -39,16 +39,16 @@ void print_tiles() for(size_t y = 0; y < TILE_HEIGHT; y++) { for(size_t x = 0; x < TILE_WIDTH; x++) - putchar(tiles[i][y * TILE_WIDTH + x] + '0'); + putchar((tiles[i][(y * TILE_WIDTH + x)*3 + 0]) == 0 ? '#' : '.'); putchar('\n'); } putchar('\n'); } } -int get_tile_pixel(size_t t, size_t x, size_t y) +int get_tile_pixel(size_t t, size_t x, size_t y, int k) { - return tiles[t][y * TILE_WIDTH + x]; + return tiles[t][(y * TILE_WIDTH + x)*3 + k]; } small_t *load_tile_connections() -- cgit v1.2.3