diff options
Diffstat (limited to 'src/tiledfile.c')
-rw-r--r-- | src/tiledfile.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/tiledfile.c b/src/tiledfile.c index d6d4b1b..bf0a828 100644 --- a/src/tiledfile.c +++ b/src/tiledfile.c @@ -30,6 +30,7 @@ void renderTilemapTexture(Texture2D *texOut, TiledMap tiledMap) { textureFromPixels(texOut, pixels, tiledMap.width, tiledMap.height); } + //! read rgba image from file void readrgba(Texture2D *loc, int width, int height, FILE *file) { Color *pixels = malloc(width*height*4); @@ -57,6 +58,14 @@ int readb(char * out, size_t noBytes, FILE * file) { return 0; } +char getTiledMapTile(TiledMap tiledMap, int pos[2]) { + return tiledMap.tilelayout[pos[1]*tiledMap.width + pos[0]]; +} + +void setTiledMapTile(TiledMap tiledMap, int pos[2], char tile) { + tiledMap.tilelayout[pos[1]*tiledMap.width + pos[0]] = tile; +} + //! load tilemap data from file TiledMap loadTiledMap(char * filename) { TiledMap tiledMap; |