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 vs
-> NextVSprite
-> PrevVSprite
= vs
-> PrevVSprite
;
59 vs
-> PrevVSprite
-> NextVSprite
= vs
-> NextVSprite
;
61 /* look for the head of this list of gels */
63 while (NULL
!= Head
-> PrevVSprite
)
64 Head
= Head
-> PrevVSprite
;
66 /* take this VSprite out of the DrawPath and ClearPath */
69 while (Current
!= NULL
) {
70 if (Current
-> IntVSprite
-> DrawPath
== vs
) {
71 Current
-> IntVSprite
-> DrawPath
= vs
-> IntVSprite
-> DrawPath
;
74 Current
= Current
-> NextVSprite
;
78 while (Current
!= NULL
) {
79 if (Current
-> ClearPath
== vs
) {
80 Current
-> ClearPath
= vs
-> ClearPath
;
83 Current
= Current
-> NextVSprite
;
87 * Are only the head and the tail VSprite left?
89 if (NULL
== Head
->NextVSprite
->NextVSprite
) {
90 _DeleteIntVSprite(Head
,GfxBase
);
91 _DeleteIntVSprite(Head
->NextVSprite
,GfxBase
);