Support for colliders
This commit is contained in:
@@ -10,8 +10,24 @@ typedef struct BzTilesetDesc {
|
||||
const char *texturePath;
|
||||
} BzTilesetDesc;
|
||||
|
||||
typedef enum BzTileColliderType {
|
||||
BZ_TILE_COLLIDER_NONE,
|
||||
BZ_TILE_COLLIDER_RECT,
|
||||
BZ_TILE_COLLIDER_ELLIPSE
|
||||
} BzTileColliderType;
|
||||
|
||||
typedef struct BzTileCollider {
|
||||
BzTileColliderType type;
|
||||
u8 x;
|
||||
u8 y;
|
||||
u8 sizeX;
|
||||
u8 sizeY;
|
||||
} BzTileCollider;
|
||||
|
||||
typedef struct BzTileset {
|
||||
Texture2D tiles;
|
||||
i32 tileCount;
|
||||
BzTileCollider *tileColliders;
|
||||
i32 startID;
|
||||
i32 tileWidth;
|
||||
i32 tileHeight;
|
||||
@@ -27,6 +43,7 @@ extern BzTileset BZ_TILESET_INVALID;
|
||||
BzTileset bzTilesetCreate(const BzTilesetDesc *desc);
|
||||
|
||||
Rectangle bzTilesetGetTileRegion(BzTileset *tileset, int tileID);
|
||||
BzTileCollider bzTilesetGetTileCollider(BzTileset *tileset, int tileID);
|
||||
|
||||
void bzTilesetDestroy(BzTileset *tileset);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user