ScummVM API documentation
entity.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 TWINE_PARSER_ENTITY_H
23 #define TWINE_PARSER_ENTITY_H
24 
25 #include "common/array.h"
26 #include "common/memstream.h"
27 #include "common/stream.h"
28 #include "twine/parser/parser.h"
29 #include "twine/shared.h"
30 
31 namespace TwinE {
32 
33 struct EntityBody {
34  int index;
35  ActorBoundingBox actorBoundingBox;
37 };
38 
39 struct EntityAnim {
40  AnimationTypes animation;
41  int animIndex;
42 
43  struct Action {
44  ActionType type = ActionType::ACTION_NOP;
45  uint8 animFrame = 0;
46  int16 sampleIndex = 0;
47  int16 frequency = 0;
48  int16 xAngle = 0;
49  int16 yAngle = 0;
50  int16 xRotPoint = 0;
51  int16 extraAngle = 0;
52  int16 finalAngle = 0;
53  int16 strength = 0;
54  int16 distanceX = 0;
55  int16 distanceY = 0;
56  int16 distanceZ = 0;
57  int16 yHeight = 0;
58  uint8 spriteIndex = 0;
59  uint8 targetActor = 0;
60  int16 repeat = 0;
61  };
62 
63  Common::Array<Action> _actions;
64 };
65 
69 class EntityData : public Parser {
70 private:
72  Common::Array<EntityAnim> _animations;
73 
74  bool loadBody(Common::SeekableReadStream &stream);
75  bool loadAnim(Common::SeekableReadStream &stream);
76 
77 protected:
78  void reset() override;
79 
80 public:
81  bool loadFromStream(Common::SeekableReadStream &stream, bool lba1) override;
82 
83  const Common::Array<EntityAnim::Action> *getActions(AnimationTypes animation) const;
84  const EntityBody *getBody(const int index) const;
85  int32 getAnimIndex(AnimationTypes animation) const;
86 };
87 
88 } // End of namespace TwinE
89 
90 #endif
Definition: array.h:52
Definition: entity.h:33
Definition: stream.h:745
int index
Definition: entity.h:34
Associate 3d models from body hqr with animations from anim.hqr for the game characters.
Definition: entity.h:69
Definition: achievements_tables.h:27
int hqrBodyIndex
Definition: entity.h:36
Definition: parser.h:32
Definition: entity.h:39
Definition: shared.h:191
Definition: entity.h:43