ScummVM API documentation
model_component.h
1 /* ScummVM - Graphic Adventure Engine
2  *
3  * ScummVM is the legal property of its developers, whose names
4  * are too numerous to list here. Please refer to the COPYRIGHT
5  * file distributed with this source distribution.
6  *
7  * This program is free software: you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation, either version 3 of the License, or
10  * (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program. If not, see <http://www.gnu.org/licenses/>.
19  *
20  */
21 
22 #ifndef GRIM_MODEL_COMPONENT_H
23 #define GRIM_MODEL_COMPONENT_H
24 
25 #include "engines/grim/costume/component.h"
26 
27 namespace Grim {
28 
29 class Model;
30 class AnimManager;
31 
32 class ModelComponent : public Component {
33 public:
34  ModelComponent(Component *parent, int parentID, const char *filename, Component *prevComponent, tag32 tag);
35  ~ModelComponent();
36 
37  void init();
38  void setKey(int val);
39  int update(uint time);
40  void animate();
41  void reset();
42  void resetColormap();
43  void restoreState(SaveGame *state);
44  void translateObject(bool reset);
45  static void translateObject(ModelNode *node, bool reset);
46  AnimManager *getAnimManager() const;
47 
48  ModelNode *getHierarchy() { return _hier; }
49  int getNumNodes();
50  Model *getModel() { return _obj; }
51  void draw();
52  void getBoundingBox(int *x1, int *y1, int *x2, int *y2);
53 
54 protected:
55  Model *_obj;
56  ModelNode *_hier;
57  AnimManager *_animation;
58  Component *_prevComp;
59  bool _animated;
60 };
61 
62 } // end of namespace Grim
63 
64 #endif
Definition: animation.h:78
Definition: savegame.h:33
Definition: actor.h:33
Definition: component.h:38
Definition: model.h:43
Definition: model_component.h:32
Definition: model.h:158