Separate object layers, asign layers to proper slots

This commit is contained in:
2023-11-09 08:38:57 +01:00
parent 4458a26c4f
commit fa79af2a17
9 changed files with 226 additions and 72 deletions

View File

@@ -10,24 +10,26 @@ typedef struct BzTilesetDesc {
const char *texturePath;
} BzTilesetDesc;
typedef enum BzTileColliderType {
BZ_TILE_COLLIDER_NONE,
BZ_TILE_COLLIDER_RECT,
BZ_TILE_COLLIDER_ELLIPSE
} BzTileColliderType;
typedef enum BzTileShapeType {
BZ_TILE_SHAPE_NONE,
BZ_TILE_SHAPE_POINT,
BZ_TILE_SHAPE_RECT,
BZ_TILE_SHAPE_ELLIPSE,
//BZ_TILE_SHAPE_POLYGON
} BzTileShapeType;
typedef struct BzTileCollider {
BzTileColliderType type;
u8 x;
u8 y;
u8 sizeX;
u8 sizeY;
} BzTileCollider;
typedef struct BzTileShape {
BzTileShapeType type;
f32 x;
f32 y;
f32 sizeX;
f32 sizeY;
} BzTileShape;
typedef struct BzTileset {
Texture2D tiles;
i32 tileCount;
BzTileCollider *tileColliders;
BzTileShape *tileColliders;
i32 startID;
i32 tileWidth;
i32 tileHeight;
@@ -43,7 +45,7 @@ extern BzTileset BZ_TILESET_INVALID;
BzTileset bzTilesetCreate(const BzTilesetDesc *desc);
Rectangle bzTilesetGetTileRegion(BzTileset *tileset, int tileID);
BzTileCollider bzTilesetGetTileCollider(BzTileset *tileset, int tileID);
BzTileShape bzTilesetGetTileCollider(BzTileset *tileset, int tileID);
void bzTilesetDestroy(BzTileset *tileset);