Crossfire Server, Trunk
FaceLoader.h
Go to the documentation of this file.
1 /*
2  * Crossfire -- cooperative multi-player graphical RPG and adventure game
3  *
4  * Copyright (c) 2020-2021 the Crossfire Development Team
5  *
6  * Crossfire is free software and comes with ABSOLUTELY NO WARRANTY. You are
7  * welcome to redistribute it under certain conditions. For details, please
8  * see COPYING and LICENSE.
9  *
10  * The authors can be reached via e-mail at <crossfire@metalforge.org>.
11  */
12 
13 #ifndef FACELOADER_H
14 #define FACELOADER_H
15 
16 #include "AssetLoader.h"
17 #include "Utils.h"
18 
19 class Faces;
20 class AllAnimations;
21 class AssetsTracker;
22 
23 class FaceLoader : public AssetLoader {
24 public:
26 
27  virtual bool willLoad(const std::string &filename) override {
28  return Utils::endsWith(filename.c_str(), ".face");
29  }
30 
31  virtual void load(BufferReader *reader, const std::string &filename) override;
32 
33 private:
37 
38  void loadAnimationBlock(BufferReader *reader, const std::string &full_path, const char *animation_name);
39 };
40 
41 #endif /* FACELOADER_H */
42 
FaceLoader::FaceLoader
FaceLoader(Faces *faces, AllAnimations *animations, AssetsTracker *tracker)
Definition: FaceLoader.cpp:22
FaceLoader::loadAnimationBlock
void loadAnimationBlock(BufferReader *reader, const std::string &full_path, const char *animation_name)
Definition: FaceLoader.cpp:27
FaceLoader::load
virtual void load(BufferReader *reader, const std::string &filename) override
Definition: FaceLoader.cpp:77
AssetLoader
Definition: AssetLoader.h:24
npc_dialog.filename
filename
Definition: npc_dialog.py:99
AssetsTracker
Definition: AssetsTracker.h:26
Utils.h
FaceLoader::willLoad
virtual bool willLoad(const std::string &filename) override
Definition: FaceLoader.h:27
dragon_attune.animations
dictionary animations
Definition: dragon_attune.py:25
Faces
Definition: Faces.h:19
FaceLoader::m_tracker
AssetsTracker * m_tracker
Definition: FaceLoader.h:36
AllAnimations
Definition: Animations.h:19
dragon_attune.faces
dictionary faces
Definition: dragon_attune.py:31
FaceLoader
Definition: FaceLoader.h:23
FaceLoader::m_animations
AllAnimations * m_animations
Definition: FaceLoader.h:35
FaceLoader::m_faces
Faces * m_faces
Definition: FaceLoader.h:34
BufferReader
Definition: bufferreader.cpp:21
Utils::endsWith
static bool endsWith(const char *const str, const char *const with)
Definition: Utils.cpp:16
AssetLoader.h