diff options
author | davidovski <david@davidovski.xyz> | 2023-07-22 00:50:32 +0200 |
---|---|---|
committer | davidovski <david@davidovski.xyz> | 2023-07-22 00:50:32 +0200 |
commit | 5ec62c0a2a0357a79f92b8bb37f67272e7f910ff (patch) | |
tree | 26e45f549e27999f9bc2d6f5d62461894223230d /src/chunkedtiledmap.h | |
parent | 2dcefdb4565f96b808ed01ce1d96a802b8f73931 (diff) |
loading map data from chunks rather than tilelayout
Diffstat (limited to 'src/chunkedtiledmap.h')
-rw-r--r-- | src/chunkedtiledmap.h | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/src/chunkedtiledmap.h b/src/chunkedtiledmap.h index 0d5c5d0..8bc2aaa 100644 --- a/src/chunkedtiledmap.h +++ b/src/chunkedtiledmap.h @@ -1,9 +1,6 @@ #include <raylib.h> #include "kdtree.h" -const int i = 1; -#define is_bigendian() ( (*(char*)&i) == 0 ) - typedef struct ChunkedTiledMap { FILE * file; int chunkWidth; @@ -14,3 +11,14 @@ typedef struct ChunkedTiledMap { Color * atlasData; kdtree_t * chunkTree; } ChunkedTiledMap; + +void textureFromPixels(Texture2D *texOut, Color *pixels, int width, int height); +ChunkedTiledMap openTiledMap(char * filename); +char * loadChunk(ChunkedTiledMap tiledMap, int x, int y); +char getChunkedTile(ChunkedTiledMap tiledMap, int x, int y); +char setChunkedTile(ChunkedTiledMap * tiledMap, int x, int y, char value); +char * appendChunk(ChunkedTiledMap * tiledMap, int x, int y, char * chunk); +void writeTiledMapHeader(ChunkedTiledMap tiledMap); +ChunkedTiledMap openNewTiledMap(char * filename, Image atlas, int tileSize, int chunkWidth, int chunkHeight, int width, int height); +void closeTiledMap(ChunkedTiledMap tiledMap); + |