refactor some things...
This commit is contained in:
parent
3550fad638
commit
1744e689b5
25 changed files with 2396 additions and 1307 deletions
|
|
@ -6,31 +6,15 @@
|
|||
typedef struct pxl8_tile_animation pxl8_tile_animation;
|
||||
typedef struct pxl8_tile_properties pxl8_tile_properties;
|
||||
typedef struct pxl8_autotile_rule pxl8_autotile_rule;
|
||||
|
||||
typedef struct pxl8_tilesheet {
|
||||
u8* data;
|
||||
bool* tile_valid;
|
||||
u32 width;
|
||||
u32 height;
|
||||
u32 tile_size;
|
||||
u32 tiles_per_row;
|
||||
u32 total_tiles;
|
||||
pxl8_color_mode color_mode;
|
||||
u32 ref_count;
|
||||
|
||||
pxl8_tile_animation* animations;
|
||||
u32 animation_count;
|
||||
|
||||
pxl8_tile_properties* properties;
|
||||
|
||||
pxl8_autotile_rule** autotile_rules;
|
||||
u32* autotile_rule_counts;
|
||||
} pxl8_tilesheet;
|
||||
typedef struct pxl8_tilesheet pxl8_tilesheet;
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
pxl8_tilesheet* pxl8_tilesheet_create(u32 tile_size);
|
||||
void pxl8_tilesheet_destroy(pxl8_tilesheet* tilesheet);
|
||||
|
||||
pxl8_result pxl8_tilesheet_add_animation(
|
||||
pxl8_tilesheet* tilesheet,
|
||||
u16 base_tile_id,
|
||||
|
|
@ -45,18 +29,18 @@ pxl8_result pxl8_tilesheet_add_autotile_rule(
|
|||
u16 result_tile_id
|
||||
);
|
||||
u16 pxl8_tilesheet_apply_autotile(const pxl8_tilesheet* tilesheet, u16 base_tile_id, u8 neighbors);
|
||||
void pxl8_tilesheet_free(pxl8_tilesheet* tilesheet);
|
||||
u16 pxl8_tilesheet_get_animated_frame(const pxl8_tilesheet* tilesheet, u16 tile_id);
|
||||
const pxl8_tile_properties* pxl8_tilesheet_get_tile_property(
|
||||
const pxl8_tilesheet* tilesheet,
|
||||
u16 tile_id
|
||||
);
|
||||
u32 pxl8_tilesheet_get_tile_size(const pxl8_tilesheet* tilesheet);
|
||||
bool pxl8_tilesheet_is_tile_valid(const pxl8_tilesheet* tilesheet, u16 tile_id);
|
||||
pxl8_result pxl8_tilesheet_load(pxl8_tilesheet* tilesheet, const char* filepath, pxl8_gfx_ctx* gfx);
|
||||
pxl8_result pxl8_tilesheet_load(pxl8_tilesheet* tilesheet, const char* filepath, pxl8_gfx* gfx);
|
||||
void pxl8_tilesheet_ref(pxl8_tilesheet* tilesheet);
|
||||
void pxl8_tilesheet_render_tile(
|
||||
const pxl8_tilesheet* tilesheet,
|
||||
pxl8_gfx_ctx* gfx,
|
||||
pxl8_gfx* gfx,
|
||||
u16 tile_id,
|
||||
i32 x,
|
||||
i32 y,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue