ScummVM API documentation
animhierarchy.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 STARK_RESOURCES_ANIM_HIERARCHY_H
23 #define STARK_RESOURCES_ANIM_HIERARCHY_H
24 
25 #include "common/str.h"
26 
27 #include "engines/stark/resources/object.h"
28 #include "engines/stark/resourcereference.h"
29 
30 namespace Stark {
31 
32 class Visual;
33 
34 namespace Formats {
35 class XRCReadStream;
36 }
37 
38 namespace Resources {
39 
40 class Anim;
41 class BonesMesh;
42 class ItemVisual;
43 class TextureSet;
44 
51 class AnimHierarchy : public Object {
52 public:
53  static const Type::ResourceType TYPE = Type::kAnimHierarchy;
54 
55  AnimHierarchy(Object *parent, byte subType, uint16 index, const Common::String &name);
56  ~AnimHierarchy() override;
57 
58  // Resource API
59  void readData(Formats::XRCReadStream *stream) override;
60  void onAllLoaded() override;
61 
63  void setItemAnim(ItemVisual *item, int32 activity);
64 
66  void unselectItemAnim(ItemVisual *item);
67 
69  void selectItemAnim(ItemVisual *item);
70 
72  Anim *getCurrentAnim();
73 
75  BonesMesh *findBonesMesh();
76 
81  TextureSet *findTextureSet(uint32 textureType);
82 
83  Visual *getVisualForUsage(uint32 usage);
84 
86  Anim *getIdleActionAnim() const;
87 
88 protected:
89  void loadActivityAnimations();
90  void loadIdleAnimations();
91 
92  Anim *getAnimForActivity(uint32 activity);
93  void printData() override;
94 
95  Common::Array<ResourceReference> _animationReferences;
96  Common::Array<Anim *> _activityAnimations;
97  Common::Array<Anim *> _idleAnimations;
98 
99  ResourceReference _parentAnimHierarchyReference;
100 
101  float _field_5C;
102  uint32 _currentActivity;
103  Anim *_currentAnim;
104  uint32 _idleActionsFrequencySum;
105 };
106 
107 } // End of namespace Resources
108 } // End of namespace Stark
109 
110 #endif // STARK_RESOURCES_ANIM_HIERARCHY_H
Definition: str.h:59
Definition: visual.h:29
Definition: array.h:52
Definition: animhierarchy.h:51
Definition: anim.h:58
Definition: item.h:139
Definition: resourcereference.h:39
Definition: console.h:27
Definition: object.h:143
Definition: textureset.h:47
Definition: bonesmesh.h:43
Definition: xrc.h:45