New bitmap method SetRGBConversionFunction which can be used to
[tangerine.git] / rom / graphics / remvsprite.c
blobc04894c560608e90e9d6510584856b7ceee14646
1 /*
2 Copyright © 1995-2001, 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
53 AROS_LIBBASE_EXT_DECL(struct GfxBase *,GfxBase)
55 struct VSprite * Head;
56 struct VSprite * Current;
58 /* unlink this VSprite */
59 vs -> NextVSprite -> PrevVSprite = vs -> PrevVSprite;
60 vs -> PrevVSprite -> NextVSprite = vs -> NextVSprite;
62 /* look for the head of this list of gels */
63 Head = vs;
64 while (NULL != Head -> PrevVSprite )
65 Head = Head -> PrevVSprite;
67 /* take this VSprite out of the DrawPath and ClearPath */
68 Current = Head;
70 while (Current != NULL) {
71 if (Current -> IntVSprite -> DrawPath == vs) {
72 Current -> IntVSprite -> DrawPath = vs -> IntVSprite -> DrawPath;
73 break;
74 } else
75 Current = Current -> NextVSprite;
78 Current = Head;
79 while (Current != NULL) {
80 if (Current -> ClearPath == vs) {
81 Current -> ClearPath = vs -> ClearPath;
82 break;
83 } else
84 Current = Current -> NextVSprite;
88 * Are only the head and the tail VSprite left?
90 if (NULL == Head->NextVSprite->NextVSprite) {
91 _DeleteIntVSprite(Head,GfxBase);
92 _DeleteIntVSprite(Head->NextVSprite,GfxBase);
95 AROS_LIBFUNC_EXIT
97 } /* RemVSprite */