Fixed a warning (missing type cast)
[tangerine.git] / rom / graphics / addanimob.c
blob0eaed28a7ad183cda6ee83987c7780d29fffb7d5
1 /*
2 Copyright © 1995-2001, The AROS Development Team. All rights reserved.
3 $Id$
5 Desc: Graphics function AddAnimOb()
6 Lang: english
7 */
8 #include <graphics/gels.h>
9 #include <graphics/rastport.h>
10 #include "graphics_intern.h"
12 /*****************************************************************************
14 NAME */
15 #include <proto/graphics.h>
17 AROS_LH3(void, AddAnimOb,
19 /* SYNOPSIS */
20 AROS_LHA(struct AnimOb *, anOb, A0),
21 AROS_LHA(struct AnimOb ** , anKey, A1),
22 AROS_LHA(struct RastPort *, rp, A2),
24 /* LOCATION */
25 struct GfxBase *, GfxBase, 26, Graphics)
27 /* FUNCTION
28 Link the AnimOb into the list pointed to by AnimKey.
29 Calls AddBob with all components of a Bob and initializes
30 all the timers of the components of this AnimOb.
31 You have to provide a valid GelsInfo structure that is linked
32 to the RastPort (InitGels())
34 INPUTS
35 anOb = pointer to AnimOb structure to be added to list of
36 AnimObs
37 anKey = address of a pointer to the first AnimOb in the list
38 (when first calling this function the content of
39 this address has to be NULL!)
40 rp = pointer to a valid RastPort with initialized GelsInfo
41 structure
43 RESULT
45 NOTES
47 EXAMPLE
49 BUGS
51 SEE ALSO
52 InitGels() Animate() graphics/rastport.h graphics/gels.h
54 INTERNALS
56 HISTORY
58 *****************************************************************************/
60 AROS_LIBFUNC_INIT
61 AROS_LIBBASE_EXT_DECL(struct GfxBase *,GfxBase)
63 struct AnimComp * CurAnimComp;
65 /* this AnimOb becomes the first on in the list*/
66 if (NULL != *anKey)
68 anOb -> NextOb = (*anKey);
69 anOb -> PrevOb = NULL;
70 (*anKey) -> PrevOb = anOb;
72 *anKey = anOb;
74 CurAnimComp = anOb -> HeadComp;
76 while (NULL != CurAnimComp)
78 /* initialize the timer of each component's first sequence */
79 CurAnimComp -> Timer = CurAnimComp -> TimeSet;
80 AddBob(CurAnimComp -> AnimBob, rp);
81 /* visit the next component */
82 CurAnimComp = CurAnimComp -> NextComp;
85 AROS_LIBFUNC_EXIT
86 } /* AddAnimOb */