2 Copyright © 1995-2007, The AROS Development Team. All rights reserved.
5 Desc: Graphics function AddAnimOb()
8 #include <graphics/gels.h>
9 #include <graphics/rastport.h>
10 #include "graphics_intern.h"
12 /*****************************************************************************
15 #include <proto/graphics.h>
17 AROS_LH3(void, AddAnimOb
,
20 AROS_LHA(struct AnimOb
*, anOb
, A0
),
21 AROS_LHA(struct AnimOb
** , anKey
, A1
),
22 AROS_LHA(struct RastPort
*, rp
, A2
),
25 struct GfxBase
*, GfxBase
, 26, Graphics
)
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())
35 anOb = pointer to AnimOb structure to be added to list of
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
52 InitGels(), Animate(), graphics/rastport.h, graphics/gels.h
58 *****************************************************************************/
62 struct AnimComp
* CurAnimComp
;
64 /* this AnimOb becomes the first on in the list*/
67 anOb
-> NextOb
= (*anKey
);
68 anOb
-> PrevOb
= NULL
;
69 (*anKey
) -> PrevOb
= anOb
;
73 CurAnimComp
= anOb
-> HeadComp
;
75 while (NULL
!= CurAnimComp
)
77 /* initialize the timer of each component's first sequence */
78 CurAnimComp
-> Timer
= CurAnimComp
-> TimeSet
;
79 AddBob(CurAnimComp
-> AnimBob
, rp
);
80 /* visit the next component */
81 CurAnimComp
= CurAnimComp
-> NextComp
;