ResidualVM logo ResidualVM website - Forums - Contact us BuildBot - Doxygen - Wiki curved edge

costume.h

Go to the documentation of this file.
00001 /* ResidualVM - A 3D game interpreter
00002  *
00003  * ResidualVM is the legal property of its developers, whose names
00004  * are too numerous to list here. Please refer to the COPYRIGHT
00005  * file distributed with this source distribution.
00006  *
00007  * This program is free software; you can redistribute it and/or
00008  * modify it under the terms of the GNU General Public License
00009  * as published by the Free Software Foundation; either version 2
00010  * of the License, or (at your option) any later version.
00011  *
00012  * This program is distributed in the hope that it will be useful,
00013  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00014  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00015  * GNU General Public License for more details.
00016  *
00017  * You should have received a copy of the GNU General Public License
00018  * along with this program; if not, write to the Free Software
00019  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
00020  *
00021  */
00022 
00023 #ifndef GRIM_COSTUME_H
00024 #define GRIM_COSTUME_H
00025 
00026 #include "common/str.h"
00027 
00028 #include "math/matrix4.h"
00029 
00030 #include "engines/grim/object.h"
00031 
00032 namespace Grim {
00033 
00034 typedef uint32 tag32;
00035 
00036 class CMap;
00037 class Model;
00038 class ModelNode;
00039 class TextSplitter;
00040 class ModelComponent;
00041 class Component;
00042 class Chore;
00043 class BaseHead;
00044 class Actor;
00045 
00046 class Costume : public Object {
00047 public:
00048     Costume(const Common::String &filename, Actor *owner, Costume *prevCost);
00049 
00050     virtual ~Costume();
00051     virtual void load(Common::SeekableReadStream *data);
00052 
00053     const Common::String &getFilename() const { return _fname; }
00054     void playChore(const char *name, uint msecs = 0);
00055     virtual void playChore(int num, uint msecs = 0);
00056     void playChoreLooping(const char *name, uint msecs = 0);
00057     virtual void playChoreLooping(int num, uint msecs = 0);
00058     void setChoreLastFrame(int num);
00059     void setChoreLooping(int num, bool val);
00060     void stopChore(int num, uint msecs = 0);
00061     void fadeChoreIn(int chore, uint msecs);
00062     void fadeChoreOut(int chore, uint msecs);
00063     ModelNode *getModelNodes();
00064     Model *getModel();
00065     void setColormap(const Common::String &map);
00066     void stopChores(bool ignoreLoopingChores = false, int msecs = 0);
00067     int isChoring(const char *name, bool excludeLooping);
00068     int isChoring(int num, bool excludeLooping);
00069     int isChoring(bool excludeLooping);
00070     int getNumChores() const { return _numChores; }
00071     Chore *getChore(const char *name);
00072     Chore *getChore(int i) { return _chores[i]; }
00073     int getChoreId(const char *name);
00074     const Common::List<Chore *> &getPlayingChores() const { return _playingChores; }
00075 
00076     void setHead(int joint1, int joint2, int joint3, float maxRoll, float maxPitch, float maxYaw);
00077     void setLookAtRate(float rate);
00078     float getLookAtRate() const;
00079     virtual void moveHead(bool entering, const Math::Vector3d &lookAt);
00080     int getHeadJoint() const;
00081 
00082     CMap *getCMap() { return _cmap; }
00083 
00084     virtual int update(uint frameTime);
00085     void animate();
00086     virtual void draw();
00087     void getBoundingBox(int *x1, int *y1, int *x2, int *y2);
00088     void setPosRotate(const Math::Vector3d &pos, const Math::Angle &pitch,
00089                       const Math::Angle &yaw, const Math::Angle &roll);
00090     Math::Matrix4 getMatrix() const;
00091     Actor *getOwner() const { return _owner; }
00092 
00093     Costume *getPreviousCostume() const;
00094 
00095     virtual void saveState(SaveGame *state) const;
00096     virtual bool restoreState(SaveGame *state);
00097 
00098     Component *getComponent(int num) { return _components[num]; }
00099 protected:
00100     virtual Component *loadComponent(tag32 tag, Component *parent, int parentID, const char *name, Component *prevComponent);
00101 
00102     void load(TextSplitter &ts, Costume *prevCost);
00103 
00104     ModelComponent *getMainModelComponent() const;
00105 
00106     Common::String _fname;
00107     Costume *_prevCostume;
00108 
00109     int _numComponents;
00110     Component **_components;
00111 
00112     BaseHead *_head;
00113 
00114     ObjectPtr<CMap> _cmap;
00115     int _numChores;
00116     Chore **_chores;
00117     Common::List<Chore*> _playingChores;
00118     Math::Matrix4 _matrix;
00119     Actor *_owner;
00120 
00121     float _lookAtRate;
00122 
00123     friend class Chore;
00124 };
00125 
00126 } // end of namespace Grim
00127 
00128 #endif


Generated on Sat Oct 12 2019 05:00:47 for ResidualVM by doxygen 1.7.1
curved edge   curved edge