aboutsummaryrefslogtreecommitdiff
path: root/src/tiles.c
diff options
context:
space:
mode:
authorkartofen <mladenovnasko0@gmail.com>2022-08-10 19:04:15 +0300
committerkartofen <mladenovnasko0@gmail.com>2022-08-10 19:04:15 +0300
commitd9604e398bacb02e6000825243b875e5cfc007e4 (patch)
tree4afba74929bc410fd245b09e1af1a68cf49981fd /src/tiles.c
parent5625d69c29e03816822b68e994a248c59fd0831e (diff)
works with colors
Diffstat (limited to 'src/tiles.c')
-rw-r--r--src/tiles.c6
1 files changed, 3 insertions, 3 deletions
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()