Go to the documentation of this file.
30 int num_frames = 0, i;
38 anim->num_animations = 0;
46 if (!strncmp(
buf,
"mina", 4)) {
47 anim->faces =
static_cast<const Face **
>(malloc(
sizeof(
Face*)*num_frames));
48 for (i = 0; i < num_frames; i++)
50 anim->num_animations = num_frames;
51 if (num_frames <= 1) {
52 LOG(
llevDebug,
"anim: %s has less then two faces in %s\n",
53 anim->name, full_path.c_str());
55 if (num_frames %
anim->facings) {
56 LOG(
llevDebug,
"anim: %s has %d frames: not a multiple of facings (%d) in %s\n",
57 anim->name, num_frames,
58 anim->facings, full_path.c_str());
62 }
else if (!strncmp(
buf,
"facings", 7)) {
63 if (!(
anim->facings = atoi(
buf+7))) {
64 LOG(
llevDebug,
"anim: %s has 0 facings in %s (line %s)\n",
65 anim->name, full_path.c_str(),
buf);
70 faces[num_frames++] = face;
80 if (*
buf ==
'#' || *
buf ==
'\0')
82 if (!strncmp(
buf,
"end", 3)) {
90 if (!strncmp(
buf,
"smoothface ", 11)) {
94 char *space = strchr(
buf + 11,
' ');
108 if (!strncmp(
buf,
"face ", 5)) {
118 on_face =
static_cast<Face *
>(calloc(1,
sizeof(
Face)));
125 if (!strncmp(
buf,
"animation ", 10)) {
130 if (on_face == NULL) {
132 }
else if (!strncmp(
buf,
"visibility", 10)) {
134 }
else if (!strncmp(
buf,
"magicmap", 8)) {
137 }
else if (!strncmp(
buf,
"is_floor", 8)) {
FaceLoader(Faces *faces, AllAnimations *animations)
sstring add_string(const char *str)
void loadAnimationBlock(BufferReader *reader, const std::string &full_path, const char *animation_name)
virtual void load(BufferReader *reader, const std::string &filename) override
char * bufferreader_next_line(BufferReader *br)
const Face * find_face(const char *name)
void free_string(sstring str)
T * define(const Key &name, T *asset)
uint8_t find_color(const char *name)
void LOG(LogLevel logLevel, const char *format,...)
AllAnimations * m_animations