Go to the documentation of this file.
29 int num_frames = 0, i;
37 anim->num_animations = 0;
45 if (!strncmp(
buf,
"mina", 4)) {
46 anim->faces =
static_cast<const Face **
>(malloc(
sizeof(
Face*)*num_frames));
47 for (i = 0; i < num_frames; i++)
49 anim->num_animations = num_frames;
50 if (num_frames <= 1) {
51 LOG(
llevDebug,
"anim: %s has less then two faces in %s\n",
52 anim->name, full_path.c_str());
54 if (num_frames %
anim->facings) {
55 LOG(
llevDebug,
"anim: %s has %d frames: not a multiple of facings (%d) in %s\n",
56 anim->name, num_frames,
57 anim->facings, full_path.c_str());
64 }
else if (!strncmp(
buf,
"facings", 7)) {
65 if (!(
anim->facings = atoi(
buf+7))) {
66 LOG(
llevDebug,
"anim: %s has 0 facings in %s (line %s)\n",
67 anim->name, full_path.c_str(),
buf);
72 faces[num_frames++] = face;
82 if (*
buf ==
'#' || *
buf ==
'\0')
84 if (!strncmp(
buf,
"end", 3)) {
95 if (!strncmp(
buf,
"smoothface ", 11)) {
99 char *space = strchr(
buf + 11,
' ');
113 if (!strncmp(
buf,
"face ", 5)) {
123 on_face =
static_cast<Face *
>(calloc(1,
sizeof(
Face)));
130 if (!strncmp(
buf,
"animation ", 10)) {
135 if (on_face == NULL) {
137 }
else if (!strncmp(
buf,
"visibility", 10)) {
139 }
else if (!strncmp(
buf,
"magicmap", 8)) {
142 }
else if (!strncmp(
buf,
"is_floor", 8)) {
FaceLoader(Faces *faces, AllAnimations *animations, AssetsTracker *tracker)
void LOG(LogLevel logLevel, const char *format,...)
void loadAnimationBlock(BufferReader *reader, const std::string &full_path, const char *animation_name)
virtual void load(BufferReader *reader, const std::string &filename) override
const Face * find_face(const char *name)
T * define(const Key &name, T *asset)
sstring add_string(const char *str)
virtual void assetDefined(const archetype *asset, const std::string &filename)
void free_string(sstring str)
AssetsTracker * m_tracker
uint8_t find_color(const char *name)
AllAnimations * m_animations
char * bufferreader_next_line(BufferReader *br)