38 free(existing->
faces);
40 update->
faces =
nullptr;
This represents one animation.
sstring add_string(const char *str)
Share a string.
Global type definitions and header inclusions.
std::unordered_map< std::string, Animations *> m_assets
Known assets.
const Face * blank_face
Following can just as easily be pointers, but it is easier to keep them like this.
void free_string(sstring str)
This will reduce the refcount, and if it has reached 0, str will be freed.
uint8_t num_animations
How many different faces to animate, size of the faces array.
void asset_destroy(Animations *item)
Animations * asset_create(const std::string &name)
uint8_t facings
How many facings (1,2,4,8).
bool has_blank
If this animation contains a blank face or not, used for invisibility.
uint16_t num
Where we are in the array.
virtual void added(Animations *anim) override
An asset was either referenced (but undefined) or defined.
const Face ** faces
The actual faces for the animation.
sstring name
Name of the animation sequence.
C function wrappers to interact with assets.
virtual void replace(Animations *existing, Animations *update) override
Replace an asset by an updated version.
std::set< std::string > m_undefined
List of undefined assets.