From 8a27da4c34c2a233a5f793893ed778e395a5220d Mon Sep 17 00:00:00 2001 From: ilotterytea Date: Sat, 25 Jan 2025 16:26:26 +0500 Subject: feat: tile data and image description in XdTexture --- src/xd.h | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/xd.h b/src/xd.h index 690fe76..163c680 100644 --- a/src/xd.h +++ b/src/xd.h @@ -6,13 +6,25 @@ #define XD_MAX_TEXTURES 256 typedef enum { PLAYER_START = 0, NEXT_FLOOR, PREVIOUS_FLOOR } XdEntityType; +typedef enum { TILE_FLOOR = 0, TILE_WALL, TILE_CORNER } XdTileType; typedef struct { - int id; char *type; unsigned char *data; + int width, height, dataSize; } XdTexture; +typedef struct { + XdTexture *texture; + int id; + XdTileType type; +} XdTile; + +typedef struct { + int id; + XdTileType type; +} XdTileData; + typedef struct { int x, y; XdTexture *texture; @@ -48,7 +60,8 @@ typedef struct { typedef struct { char *name; int version; - XdTexture textures[XD_MAX_TEXTURES]; + XdTexture *textures[XD_MAX_TEXTURES]; + XdTile *tiles[XD_MAX_TEXTURES]; XdEntity *entities[XD_MAX_ENTITIES]; XdLevel *levels[]; } XdData; -- cgit v1.2.3