2 Copyright © 1995-2007, The AROS Development Team. All rights reserved.
5 Desc: Graphics function AddVSprite()
8 #include <graphics/gels.h>
9 #include <graphics/rastport.h>
10 #include "graphics_intern.h"
11 #include "gels_internal.h"
12 #include <proto/exec.h>
14 /*****************************************************************************
17 #include <proto/graphics.h>
19 AROS_LH2(void, AddVSprite
,
22 AROS_LHA(struct VSprite
*, vs
, A0
),
23 AROS_LHA(struct RastPort
*, rp
, A1
),
26 struct GfxBase
*, GfxBase
, 17, Graphics
)
29 The VSprite is linked into the current gel list using it's
30 y and x coordinates. The VSprite's flags are set up.
33 vs = pointer to VSprite to be linked into gel list
34 rp = pointer to RastPort that has an initialized GelsInfo linked
35 to it (see InitGels()).
46 InitGels() graphics/gels.h graphics/rastport.h
52 *****************************************************************************/
56 struct VSprite
* CurVSprite
;
57 /* the Y-coordinate is most significant! */
58 LONG Koord
= JOIN_XY_COORDS(vs
->X
, vs
->Y
);
60 /* Reset the Flags for this VSprite and set OldX/Y */
65 CurVSprite
= rp
->GelsInfo
->gelHead
;
67 /* look for the appropriate place to insert the VSprite into the
68 list of VSprites which is connected to the GelsInfo which was
69 previously found in the rastport */
71 while (JOIN_XY_COORDS(CurVSprite
->NextVSprite
->X
, CurVSprite
->NextVSprite
->Y
) < Koord
)
72 CurVSprite
= CurVSprite
->NextVSprite
;
74 /* insert the new VSprite *after* CurVSprite */
76 CurVSprite
-> NextVSprite
-> PrevVSprite
= vs
;
77 vs
-> NextVSprite
= CurVSprite
-> NextVSprite
;
78 vs
-> PrevVSprite
= CurVSprite
;
79 CurVSprite
-> NextVSprite
= vs
;
82 * Create he IntVSprite structure for improved handling of
83 * the VSprite ImageData.
85 vs
-> IntVSprite
= _CreateIntVSprite(vs
, rp
, GfxBase
);