2 Copyright © 1995-2007, The AROS Development Team. All rights reserved.
5 Desc: Graphics function AddVSprite()
8 #include <proto/graphics.h>
9 #include <graphics/gels.h>
10 #include "gels_internal.h"
11 #include <graphics/rastport.h>
12 #include "graphics_intern.h"
13 #include <proto/exec.h>
15 /*****************************************************************************
19 AROS_LH1(void, RemVSprite
,
22 AROS_LHA(struct VSprite
*, vs
, A0
),
25 struct GfxBase
*, GfxBase
, 23, Graphics
)
28 The VSprite is unlinked from the gel list.
31 vs = pointer to VSprite to be removed from the gel list
42 InitGels(), RemIBob(), graphics/gels.h
45 I don't know whether it is correct to take the VSprite out of the
46 ClearPath and DrawPath, but it is implemented that way.
50 *****************************************************************************/
54 struct VSprite
* Head
;
55 struct VSprite
* Current
;
57 /* unlink this VSprite */
58 if (vs
-> NextVSprite
)
59 vs
-> NextVSprite
-> PrevVSprite
= vs
-> PrevVSprite
;
60 vs
-> PrevVSprite
-> NextVSprite
= vs
-> NextVSprite
;
62 /* look for the head of this list of gels */
64 while (NULL
!= Head
-> PrevVSprite
)
65 Head
= Head
-> PrevVSprite
;
67 /* take this VSprite out of the DrawPath and ClearPath */
70 while (Current
!= NULL
) {
71 if ((Current
-> IntVSprite
) && (Current
-> IntVSprite
-> DrawPath
== vs
)) {
72 Current
-> IntVSprite
-> DrawPath
= vs
-> IntVSprite
-> DrawPath
;
75 Current
= Current
-> NextVSprite
;
79 while (Current
!= NULL
) {
80 if (Current
-> ClearPath
== vs
) {
81 Current
-> ClearPath
= vs
-> ClearPath
;
84 Current
= Current
-> NextVSprite
;
88 * Are only the head and the tail VSprite left?
90 if ((Head
) && ((!Head
->NextVSprite
) || (NULL
== Head
->NextVSprite
->NextVSprite
))) {
91 _DeleteIntVSprite(Head
,GfxBase
);
92 if (Head
->NextVSprite
)
93 _DeleteIntVSprite(Head
->NextVSprite
,GfxBase
);