Go to the documentation of this file.
28 int num_frames = 0, i;
36 anim->num_animations = 0;
44 if (!strncmp(
buf,
"mina", 4)) {
45 anim->faces =
static_cast<const Face **
>(malloc(
sizeof(
Face*)*num_frames));
46 for (i = 0; i < num_frames; i++)
48 anim->num_animations = num_frames;
49 if (num_frames <= 1) {
50 LOG(
llevDebug,
"anim: %s has less then two faces in %s\n",
51 anim->name, full_path.c_str());
53 if (num_frames %
anim->facings) {
54 LOG(
llevDebug,
"anim: %s has %d frames: not a multiple of facings (%d) in %s\n",
55 anim->name, num_frames,
56 anim->facings, full_path.c_str());
60 }
else if (!strncmp(
buf,
"facings", 7)) {
61 if (!(
anim->facings = atoi(
buf+7))) {
62 LOG(
llevDebug,
"anim: %s has 0 facings in %s (line %s)\n",
63 anim->name, full_path.c_str(),
buf);
68 faces[num_frames++] = face;
78 if (*
buf ==
'#' || *
buf ==
'\0')
80 if (!strncmp(
buf,
"end", 3)) {
88 if (!strncmp(
buf,
"smoothface ", 11)) {
92 char *space = strchr(
buf + 11,
' ');
106 if (!strncmp(
buf,
"face ", 5)) {
116 on_face =
static_cast<Face *
>(calloc(1,
sizeof(
Face)));
123 if (!strncmp(
buf,
"animation ", 10)) {
128 if (on_face == NULL) {
130 }
else if (!strncmp(
buf,
"visibility", 10)) {
132 }
else if (!strncmp(
buf,
"magicmap", 8)) {
135 }
else if (!strncmp(
buf,
"is_floor", 8)) {
FaceLoader(Faces *faces, AllAnimations *animations)
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)
void free_string(sstring str)
uint8_t find_color(const char *name)
AllAnimations * m_animations
char * bufferreader_next_line(BufferReader *br)