ScummVM API documentation
anim.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  * Object animation definitions
21  */
22 
23 #ifndef TINSEL_ANIM_H // prevent multiple includes
24 #define TINSEL_ANIM_H
25 
26 #include "tinsel/dw.h" // for SCNHANDLE
27 
28 namespace Tinsel {
29 
30 struct OBJECT;
31 
33 struct ANIM {
34  int aniRate;
35  int aniDelta;
37  uint32 hScript;
39 };
40 
42 enum {
43  ANI_END = 0,
44  ANI_JUMP = 1,
45  ANI_HFLIP = 2,
46  ANI_VFLIP = 3,
47  ANI_HVFLIP = 4,
52  ANI_CALL = 9,
53  ANI_HIDE = 10,
54  ANI_STOP = 11
55 };
56 
58 union ANI_SCRIPT {
59  int32 op;
60  uint32 hFrame;
61 };
62 
63 
64 /*----------------------------------------------------------------------*\
65 |* Anim Function Prototypes *|
66 \*----------------------------------------------------------------------*/
67 
69 enum SCRIPTSTATE {ScriptFinished, ScriptNoSleep, ScriptSleep};
70 
71 SCRIPTSTATE DoNextFrame( // Execute the next animation frame of a animation script
72  ANIM *pAnim); // animation data structure
73 
74 void InitStepAnimScript( // Init a ANIM struct for single stepping through a animation script
75  ANIM *pAnim, // animation data structure
76  OBJECT *pAniObj, // object to animate
77  SCNHANDLE hNewScript, // handle to script of multipart frames
78  int aniSpeed); // sets speed of animation in frames
79 
80 SCRIPTSTATE StepAnimScript( // Execute the next command in a animation script
81  ANIM *pAnim); // animation data structure
82 
83 void SkipFrames( // Skip the specified number of frames
84  ANIM *pAnim, // animation data structure
85  int numFrames); // number of frames to skip
86 
87 bool AboutToJumpOrEnd(ANIM *pAnim);
88 
89 } // End of namespace Tinsel
90 
91 #endif // TINSEL_ANIM_H
adjust animated object y animation point
Definition: anim.h:49
flip animated object horizontally
Definition: anim.h:45
uint32 SCNHANDLE
Definition: dw.h:31
call routine
Definition: anim.h:52
Definition: anim.h:33
adjust animated object x animation point
Definition: anim.h:48
OBJECT * pObject
object to animate (assumed to be multi-part)
Definition: anim.h:36
uint32 hScript
animation script handle
Definition: anim.h:37
do not sleep for this frame
Definition: anim.h:51
Definition: object.h:73
adjust animated object x & y animation points
Definition: anim.h:50
int aniRate
animation speed
Definition: anim.h:34
uint32 hFrame
treat as a animation frame handle
Definition: anim.h:60
Definition: actors.h:36
flip animated object in both directions
Definition: anim.h:47
int scriptIndex
current position in animation script
Definition: anim.h:38
flip animated object vertically
Definition: anim.h:46
stop sound
Definition: anim.h:54
int aniDelta
animation speed delta counter
Definition: anim.h:35
end of animation script
Definition: anim.h:43
Definition: anim.h:58
int32 op
treat as an opcode or operand
Definition: anim.h:59
animation script jump
Definition: anim.h:44
hide animated object
Definition: anim.h:53
SCRIPTSTATE
Definition: anim.h:69