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
28namespace Tinsel {
29
30struct OBJECT;
31
33struct ANIM {
34 int aniRate;
37 uint32 hScript;
39};
40
42enum {
43 ANI_END = 0,
53 ANI_HIDE = 10,
54 ANI_STOP = 11
55};
56
59 int32 op;
60 uint32 hFrame;
61};
62
63
64/*----------------------------------------------------------------------*\
65|* Anim Function Prototypes *|
66\*----------------------------------------------------------------------*/
67
69enum SCRIPTSTATE {ScriptFinished, ScriptNoSleep, ScriptSleep};
70
71SCRIPTSTATE DoNextFrame( // Execute the next animation frame of a animation script
72 ANIM *pAnim); // animation data structure
73
74void 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
80SCRIPTSTATE StepAnimScript( // Execute the next command in a animation script
81 ANIM *pAnim); // animation data structure
82
83void SkipFrames( // Skip the specified number of frames
84 ANIM *pAnim, // animation data structure
85 int numFrames); // number of frames to skip
86
87bool AboutToJumpOrEnd(ANIM *pAnim);
88
89} // End of namespace Tinsel
90
91#endif // TINSEL_ANIM_H
Definition: actors.h:36
@ ANI_HIDE
hide animated object
Definition: anim.h:53
@ ANI_ADJUSTXY
adjust animated object x & y animation points
Definition: anim.h:50
@ ANI_STOP
stop sound
Definition: anim.h:54
@ ANI_JUMP
animation script jump
Definition: anim.h:44
@ ANI_END
end of animation script
Definition: anim.h:43
@ ANI_HFLIP
flip animated object horizontally
Definition: anim.h:45
@ ANI_HVFLIP
flip animated object in both directions
Definition: anim.h:47
@ ANI_CALL
call routine
Definition: anim.h:52
@ ANI_ADJUSTX
adjust animated object x animation point
Definition: anim.h:48
@ ANI_VFLIP
flip animated object vertically
Definition: anim.h:46
@ ANI_NOSLEEP
do not sleep for this frame
Definition: anim.h:51
@ ANI_ADJUSTY
adjust animated object y animation point
Definition: anim.h:49
uint32 SCNHANDLE
Definition: dw.h:31
SCRIPTSTATE
Definition: anim.h:69
Definition: anim.h:33
int aniRate
animation speed
Definition: anim.h:34
OBJECT * pObject
object to animate (assumed to be multi-part)
Definition: anim.h:36
int scriptIndex
current position in animation script
Definition: anim.h:38
int aniDelta
animation speed delta counter
Definition: anim.h:35
uint32 hScript
animation script handle
Definition: anim.h:37
Definition: object.h:74
Definition: anim.h:58
int32 op
treat as an opcode or operand
Definition: anim.h:59
uint32 hFrame
treat as a animation frame handle
Definition: anim.h:60