2 Copyright © 1995-2010, The AROS Development Team. All rights reserved.
5 Desc: Graphics function ChangeExtSpriteA()
9 #include <aros/debug.h>
10 #include <graphics/gfxbase.h>
11 #include <graphics/clip.h>
12 #include <graphics/view.h>
13 #include <graphics/sprite.h>
14 #include <utility/tagitem.h>
15 #include <proto/utility.h>
17 #include "gfxfuncsupport.h"
18 #include "graphics_intern.h"
20 /*****************************************************************************
23 #include <proto/graphics.h>
25 AROS_LH4(LONG
, ChangeExtSpriteA
,
28 AROS_LHA(struct ViewPort
*, vp
, A0
),
29 AROS_LHA(struct ExtSprite
*, oldsprite
, A1
),
30 AROS_LHA(struct ExtSprite
*, newsprite
, A2
),
31 AROS_LHA(struct TagItem
*, tags
, A3
),
34 struct GfxBase
*, GfxBase
, 171, Graphics
)
39 vp - pointer to ViewPort structure that this sprite is
40 relative to, or NULL if relative only top of View
41 oldsprite - pointer to the old ExtSprite structure
42 newsprite - pointer to the new ExtSprite structure
43 tags - pointer to taglist
46 success - 0 if there was an error
57 This is a minimal implementation which supports only single sprite #0
60 With vp set to NULL the function always fails at the moment.
65 ******************************************************************************/
70 struct monitor_driverdata
*mdd
;
73 D(bug("ChangeExtSpriteA(0x%p, 0x%p, 0x%p)\n", vp
, oldsprite
, newsprite
));
75 /* We have only sprite #0 for the mouse pointer */
76 if (newsprite
->es_SimpleSprite
.num
)
79 /* Pick up position from old sprite */
80 newsprite
->es_SimpleSprite
.x
= oldsprite
->es_SimpleSprite
.x
;
81 newsprite
->es_SimpleSprite
.y
= oldsprite
->es_SimpleSprite
.y
;
82 D(bug("Sprite position: (%d, %d)\n", newsprite
->es_SimpleSprite
.x
, newsprite
->es_SimpleSprite
.y
));
84 bitmap
= OBTAIN_HIDD_BM(newsprite
->es_BitMap
);
85 D(bug("HIDD bitmap object: 0x%p\n", bitmap
));
88 /* Pick up display driver from ViewPort's bitmap */
89 mdd
= GET_BM_DRIVERDATA(vp
->RasInfo
->BitMap
);
90 res
= HIDD_Gfx_SetCursorShape(mdd
->gfxhidd
, bitmap
, 0, 0);
92 HIDD_Gfx_SetCursorVisible(mdd
->gfxhidd
, TRUE
);
94 /* TODO: NULL ViewPort means Amiga(tm) chipset display */
97 RELEASE_HIDD_BM(bitmap
, newsprite
->es_BitMap
);
101 } /* ChangeExtSpriteA */