add cartridge system
This commit is contained in:
parent
ff698730f1
commit
98ca54e920
25 changed files with 968 additions and 315 deletions
|
|
@ -3,6 +3,10 @@
|
|||
#include "pxl8_types.h"
|
||||
#include "pxl8_gfx.h"
|
||||
|
||||
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;
|
||||
|
|
@ -12,6 +16,15 @@ typedef struct pxl8_tilesheet {
|
|||
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;
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
|
@ -30,6 +43,22 @@ bool pxl8_tilesheet_is_tile_valid(const pxl8_tilesheet* tilesheet, u16 tile_id);
|
|||
pxl8_tilesheet* pxl8_tilesheet_new(u32 tile_size);
|
||||
void pxl8_tilesheet_destroy(pxl8_tilesheet* tilesheet);
|
||||
|
||||
void pxl8_tilesheet_ref(pxl8_tilesheet* tilesheet);
|
||||
void pxl8_tilesheet_unref(pxl8_tilesheet* tilesheet);
|
||||
|
||||
pxl8_result pxl8_tilesheet_add_animation(pxl8_tilesheet* tilesheet, u16 base_tile_id,
|
||||
const u16* frames, u16 frame_count, f32 frame_duration);
|
||||
void pxl8_tilesheet_update_animations(pxl8_tilesheet* tilesheet, f32 delta_time);
|
||||
u16 pxl8_tilesheet_get_animated_frame(const pxl8_tilesheet* tilesheet, u16 tile_id);
|
||||
|
||||
void pxl8_tilesheet_set_tile_property(pxl8_tilesheet* tilesheet, u16 tile_id,
|
||||
const pxl8_tile_properties* props);
|
||||
const pxl8_tile_properties* pxl8_tilesheet_get_tile_property(const pxl8_tilesheet* tilesheet, u16 tile_id);
|
||||
|
||||
pxl8_result pxl8_tilesheet_add_autotile_rule(pxl8_tilesheet* tilesheet, u16 base_tile_id,
|
||||
u8 neighbor_mask, u16 result_tile_id);
|
||||
u16 pxl8_tilesheet_apply_autotile(const pxl8_tilesheet* tilesheet, u16 base_tile_id, u8 neighbors);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue