57 lines
1.1 KiB
C
57 lines
1.1 KiB
C
#ifndef BREEZE_TILESET_H
|
|
#define BREEZE_TILESET_H
|
|
|
|
#include "../defines.h"
|
|
|
|
#include <raylib.h>
|
|
|
|
typedef i16 BzTile;
|
|
|
|
typedef struct BzTilesetDesc {
|
|
const char *path;
|
|
const char *texturePath;
|
|
} BzTilesetDesc;
|
|
|
|
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 BzTileShape {
|
|
BzTileShapeType type;
|
|
f32 x;
|
|
f32 y;
|
|
f32 sizeX;
|
|
f32 sizeY;
|
|
} BzTileShape;
|
|
|
|
typedef struct BzTileset {
|
|
Texture2D tiles;
|
|
i32 tileCount;
|
|
BzTileShape *tileColliders;
|
|
i32 startID;
|
|
i32 tileWidth;
|
|
i32 tileHeight;
|
|
i32 width;
|
|
i32 height;
|
|
i32 offsetX;
|
|
i32 offsetY;
|
|
bool isValid;
|
|
} BzTileset;
|
|
|
|
extern BzTileset BZ_TILESET_INVALID;
|
|
|
|
BzTileset bzTilesetCreate(const BzTilesetDesc *desc);
|
|
|
|
Rectangle bzTilesetGetTileRegion(BzTileset *tileset, BzTile tileID);
|
|
BzTileShape bzTilesetGetTileCollider(BzTileset *tileset, BzTile tileID);
|
|
|
|
void bzTilesetDestroy(BzTileset *tileset);
|
|
|
|
|
|
|
|
#endif //BREEZE_TILESET_H
|