ScummVM API documentation
animations.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_SCENE_ANIMATIONS_H
23 #define TWINE_SCENE_ANIMATIONS_H
24 
25 #include "common/scummsys.h"
26 #include "twine/parser/anim.h"
27 
28 namespace TwinE {
29 
30 struct AnimTimerDataStruct;
31 class BodyData;
32 class TwinEEngine;
33 
34 class Animations {
35 private:
36  TwinEEngine *_engine;
37  int16 patchInterAngle(int32 deltaTime, int32 keyFrameLength, int16 newAngle1, int16 lastAngle1) const;
38  int16 patchInterStep(int32 deltaTime, int32 keyFrameLength, int16 newPos, int16 lastPos) const;
39 
46  bool setInterDepObjet(int32 keyframeIdx, const AnimData &animData, AnimTimerDataStruct *animTimerDataPtr);
47 
48  void copyKeyFrameToState(const KeyFrame *keyframe, BodyData &bodyData, int32 numBones) const;
49  void copyStateToKeyFrame(KeyFrame *keyframe, const BodyData &bodyData) const;
50 
51  int _animKeyframeBufIdx = 0;
52  KeyFrame _animKeyframeBuf[32];
53 
55  int16 _animMasterRot = 0; // AnimMasterRot
57  int16 _animStepBeta = 0; // AnimStepBeta
58 
60  IVec3 _currentStep;
61 
62 public:
63  Animations(TwinEEngine *engine);
64 
66  AnimationTypes _currentActorAnimExtraPtr = AnimationTypes::kAnimNone;
67 
75  void setAnimObjet(int32 keyframeIdx, const AnimData &animData, BodyData &bodyData, AnimTimerDataStruct *animTimerDataPtr);
76 
84  bool doSetInterAnimObjet(int32 keyframeIdx, const AnimData &animData, BodyData &bodyData, AnimTimerDataStruct *animTimerDataPtr);
85 
91  int32 searchAnim(AnimationTypes animIdx, int32 actorIdx = OWN_ACTOR_SCENE_INDEX);
92 
98  void stockInterAnim(const BodyData &bodyData, AnimTimerDataStruct *animTimerDataPtr);
99 
107  bool initAnim(AnimationTypes newAnim, AnimType animType, AnimationTypes animExtra, int32 actorIdx);
108 
113  void processAnimActions(int32 actorIdx);
114 
119  void doAnim(int32 actorIdx);
120 };
121 
122 } // namespace TwinE
123 #endif
void stockInterAnim(const BodyData &bodyData, AnimTimerDataStruct *animTimerDataPtr)
void processAnimActions(int32 actorIdx)
bool initAnim(AnimationTypes newAnim, AnimType animType, AnimationTypes animExtra, int32 actorIdx)
Definition: shared.h:113
Definition: actor.h:55
void setAnimObjet(int32 keyframeIdx, const AnimData &animData, BodyData &bodyData, AnimTimerDataStruct *animTimerDataPtr)
Definition: animations.h:34
AnimationTypes _currentActorAnimExtraPtr
Definition: animations.h:66
Definition: anim.h:57
Definition: twine.h:200
Definition: achievements_tables.h:27
void doAnim(int32 actorIdx)
Definition: anim.h:45
int32 searchAnim(AnimationTypes animIdx, int32 actorIdx=OWN_ACTOR_SCENE_INDEX)
bool doSetInterAnimObjet(int32 keyframeIdx, const AnimData &animData, BodyData &bodyData, AnimTimerDataStruct *animTimerDataPtr)
Definition: body.h:35