diff options
author | davidovski <david@davidovski.xyz> | 2023-07-23 16:46:05 +0200 |
---|---|---|
committer | davidovski <david@davidovski.xyz> | 2023-07-23 16:46:05 +0200 |
commit | c726acd0467906afee74afb7051bb2e705e26565 (patch) | |
tree | e8b9422ba926f09b85c229d51d5a99a077ea69e8 /src/tiledmap.h | |
parent | 0d78ec0e53d9824a029840e74bf0721ed2187e6a (diff) |
add chunk offset to rendering
Diffstat (limited to 'src/tiledmap.h')
-rw-r--r-- | src/tiledmap.h | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/tiledmap.h b/src/tiledmap.h index 2c4cf94..972a74d 100644 --- a/src/tiledmap.h +++ b/src/tiledmap.h @@ -3,7 +3,8 @@ #define CHUNK_CACHE_SIZE 32 -typedef char * Chunk; +typedef unsigned char Tile; +typedef Tile * Chunk; typedef struct CachedChunk { long filePos; @@ -24,8 +25,8 @@ typedef struct ChunkedTiledMap { void textureFromPixels(Texture2D *texOut, Color *pixels, int width, int height); TiledMap openTiledMap(char * filename); CachedChunk * loadChunk(TiledMap *tiledMap, int x, int y); -char getChunkedTile(TiledMap *tiledMap, int x, int y); -char setChunkedTile(TiledMap * tiledMap, int x, int y, char value); +Tile getChunkedTile(TiledMap *tiledMap, int x, int y); +Tile setChunkedTile(TiledMap * tiledMap, int x, int y, Tile value); CachedChunk * createChunk(TiledMap * tiledMap, int x, int y, Chunk chunk); void writeTiledMapHeader(TiledMap tiledMap); TiledMap openNewTiledMap(char * filename, Image atlas, int tileSize, int chunkWidth, int chunkHeight, int width, int height); |