45 auto face = std::find_if(
m_assets.begin(),
m_assets.end(), [&id] (
auto& face) {
46 return face.second->number == id;
48 return face ==
m_assets.end() ? NULL : face->second;
61 for (
size_t l = 0; l < strlen(face->
name); l++) {
virtual void added(Face *face) override
An asset was either referenced (but undefined) or defined.
Face * smoothface
Smoothed face for this, NULL for none.
New face structure - this enforces the notion that data is face by face only - you can not change the...
sstring add_string(const char *str)
Share a string.
const Face * findById(uint16_t id)
std::unordered_map< std::string, Face *> 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.
virtual void replace(Face *existing, Face *update) override
Replace an asset by an updated version.
void asset_destroy(Face *item)
Face * asset_create(const std::string &name)
uint16_t number
This is the image unique identifier.
uint8_t visibility
How visible is the face compared to other faces, highest wins.
uint8_t magicmap
Color to show this in magic map.
sstring name
Face name, as used by archetypes and such.