2 Copyright © 1995-2010, The AROS Development Team. All rights reserved.
5 Desc: Graphics function MoveSprite()
8 #include <aros/debug.h>
9 #include <graphics/view.h>
10 #include <graphics/sprite.h>
13 #include "graphics_intern.h"
14 #include "gfxfuncsupport.h"
16 /*****************************************************************************
19 #include <proto/graphics.h>
21 AROS_LH4(void, MoveSprite
,
24 AROS_LHA(struct ViewPort
*, vp
, A0
),
25 AROS_LHA(struct SimpleSprite
*, sprite
, A1
),
26 AROS_LHA(WORD
, x
, D0
),
27 AROS_LHA(WORD
, y
, D1
),
30 struct GfxBase
*, GfxBase
, 71, Graphics
)
33 Move sprite to a new position on the screen. Coordinates
34 are specified relatively to given ViewPort, or relatively
35 to the entire View (physical display) if the ViewPort is NULL.
37 This function works also with extended sprites, since
38 struct SimpleSprite is a part of struct ExtSprite.
41 vp - a ViewPort for relative sprite positioning or NULL
42 sprite - a pointer to a sprite descriptor structure
43 x - a new X coordinate
44 y - a new Y coordinate
50 AROS currently supports only one sprite #0 for mouse pointer.
51 Other sprite numbers are ignored by this function.
53 ViewPort is also used in order to specify the physical display.
54 If it's not specified, Amiga(tm) chipset display is assumed.
55 This is available only on Amiga(tm) architecture.
68 ******************************************************************************/
72 struct monitor_driverdata
*mdd
;
75 sprite
->x
= x
+ vp
->DxOffset
;
76 sprite
->y
= y
+ vp
->DyOffset
;
77 mdd
= GET_BM_DRIVERDATA(vp
->RasInfo
->BitMap
);
81 /* TODO: obviously this should use a chipset driver. Currently we have no one. */
85 if (sprite
->num
) /* We have only sprite #0 for the mouse cursor */
88 HIDD_Gfx_SetCursorPos(mdd
->gfxhidd
, sprite
->x
, sprite
->y
);