Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 #ifndef GRIM_COSTUMEEMI_H
00024 #define GRIM_COSTUMEEMI_H
00025
00026 #include "common/stream.h"
00027
00028 #include "engines/grim/object.h"
00029 #include "engines/grim/costume.h"
00030 #include "engines/grim/emi/costume/emichore.h"
00031
00032 namespace Grim {
00033
00034 typedef uint32 tag32;
00035
00036 class EMISkelComponent;
00037 class EMIMeshComponent;
00038 class Material;
00039 class EMIModel;
00040
00041 class EMICostume : public Costume {
00042 public:
00043 EMICostume(const Common::String &filename, Actor *owner, Costume *prevCost);
00044
00045 void load(Common::SeekableReadStream *data) override;
00046
00047 void draw() override;
00048 int update(uint time) override;
00049
00050 void playChore(int num, uint msecs = 0) override;
00051 void playChoreLooping(int num, uint msecs = 0) override;
00052
00053 void saveState(SaveGame *state) const override;
00054 bool restoreState(SaveGame *state) override;
00055
00056 Material *loadMaterial(const Common::String &name, bool clamp);
00057 Material *findMaterial(const Common::String &name);
00058
00059 void setHead(const char *joint, const Math::Vector3d &offset);
00060 void setHeadLimits(float yawRange, float maxPitch, float minPitch);
00061
00062 EMIModel *getEMIModel() const;
00063 EMIModel *getEMIModel(int num) const;
00064 public:
00065 EMIChore *_wearChore;
00066 EMISkelComponent *_emiSkel;
00067 private:
00068 Common::List<ObjectPtr<Material> > _materials;
00069 static bool compareChores(const Chore *c1, const Chore *c2);
00070 Component *loadEMIComponent(Component *parent, int parentID, const char *name, Component *prevComponent);
00071 void setWearChore(EMIChore *chore);
00072
00073 friend class Chore;
00074 };
00075
00076 }
00077
00078 #endif