compiler: Support autoopening of libraries in AROS_SHxx() style programs
[AROS.git] / rom / graphics / remvsprite.c
blob263a64e4ef1981da07ccab5b4d59d4d8e1981990
1 /*
2 Copyright © 1995-2007, The AROS Development Team. All rights reserved.
3 $Id$
5 Desc: Graphics function AddVSprite()
6 Lang: english
7 */
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 /*****************************************************************************
17 NAME */
19 AROS_LH1(void, RemVSprite,
21 /* SYNOPSIS */
22 AROS_LHA(struct VSprite *, vs, A0),
24 /* LOCATION */
25 struct GfxBase *, GfxBase, 23, Graphics)
27 /* FUNCTION
28 The VSprite is unlinked from the gel list.
30 INPUTS
31 vs = pointer to VSprite to be removed from the gel list
33 RESULT
35 NOTES
37 EXAMPLE
39 BUGS
41 SEE ALSO
42 InitGels(), RemIBob(), graphics/gels.h
44 INTERNALS
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.
48 HISTORY
50 *****************************************************************************/
52 AROS_LIBFUNC_INIT
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 */
62 Head = vs;
63 while (NULL != Head -> PrevVSprite )
64 Head = Head -> PrevVSprite;
66 /* take this VSprite out of the DrawPath and ClearPath */
67 Current = Head;
69 while (Current != NULL) {
70 if (Current -> IntVSprite -> DrawPath == vs) {
71 Current -> IntVSprite -> DrawPath = vs -> IntVSprite -> DrawPath;
72 break;
73 } else
74 Current = Current -> NextVSprite;
77 Current = Head;
78 while (Current != NULL) {
79 if (Current -> ClearPath == vs) {
80 Current -> ClearPath = vs -> ClearPath;
81 break;
82 } else
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);
94 AROS_LIBFUNC_EXIT
96 } /* RemVSprite */