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

component.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_COMPONENT_H
00024 #define GRIM_COMPONENT_H
00025 
00026 #include "math/matrix4.h"
00027 #include "engines/grim/object.h"
00028 #include "engines/grim/animation.h"
00029 
00030 namespace Grim {
00031 
00032 typedef uint32 tag32;
00033 
00034 class Costume;
00035 class CMap;
00036 class SaveGame;
00037 
00038 class Component {
00039 public:
00040     Component(Component *parent, int parentID, const char *name, tag32 tag);
00041 
00042     CMap *getCMap();
00043     virtual void setColormap(CMap *c);
00044     bool isVisible();
00045     Component *getParent() { return _parent; }
00046     virtual void setMatrix(const Math::Matrix4 &) { };
00047     virtual void init() { }
00048     virtual void setKey(int) { }
00049     virtual void setMapName(char *) { }
00050     virtual int update(uint time) { return 0; }
00051     virtual void animate() { }
00052     virtual void draw() { }
00053     virtual void reset() { }
00054     virtual void fade(Animation::FadeMode, int) { }
00055     virtual void advance(uint msecs) { }
00056     virtual void setPaused(bool paused) { }
00057     virtual void resetColormap() { }
00058     virtual void saveState(SaveGame *) { }
00059     virtual void restoreState(SaveGame *) { }
00060     virtual ~Component();
00061 
00062     bool isComponentType(char a0, char a1, char a2, char a3) { return _tag == MKTAG(a0, a1, a2, a3); }
00063 
00064 protected:
00065     ObjectPtr<CMap> _cmap, _previousCmap;
00066     tag32 _tag;
00067     int _parentID;
00068     bool _visible;
00069     Component *_parent, *_child, *_sibling;
00070     Costume *_cost;
00071     Common::String _name;
00072 
00073     void setCostume(Costume *cost) { _cost = cost; }
00074     void setParent(Component *newParent);
00075     void removeChild(Component *child);
00076     void resetHierCMap();
00077 
00078     friend class Costume;
00079     friend class EMICostume;
00080 };
00081 
00082 } // end of namespace Grim
00083 
00084 #endif


Generated on Sat May 25 2019 05:00:41 for ResidualVM by doxygen 1.7.1
curved edge   curved edge