Indentation fix, cleanup.
[AROS.git] / rom / graphics / movesprite.c
blob765a1a66faf3e9bae78e1ef0bb4a254fbec2549e
1 /*
2 Copyright © 1995-2010, The AROS Development Team. All rights reserved.
3 $Id$
5 Desc: Graphics function MoveSprite()
6 Lang: english
7 */
8 #include <aros/debug.h>
9 #include <graphics/view.h>
10 #include <graphics/sprite.h>
11 #include <oop/oop.h>
13 #include "graphics_intern.h"
14 #include "gfxfuncsupport.h"
16 /*****************************************************************************
18 NAME */
19 #include <proto/graphics.h>
21 AROS_LH4(void, MoveSprite,
23 /* SYNOPSIS */
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),
29 /* LOCATION */
30 struct GfxBase *, GfxBase, 71, Graphics)
32 /* FUNCTION
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.
40 INPUTS
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
46 RESULT
47 None.
49 NOTES
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.
57 EXAMPLE
59 BUGS
61 SEE ALSO
63 INTERNALS
65 HISTORY
68 ******************************************************************************/
70 AROS_LIBFUNC_INIT
72 struct monitor_driverdata *mdd;
74 if (vp) {
75 sprite->x = x + vp->DxOffset;
76 sprite->y = y + vp->DyOffset;
77 mdd = GET_BM_DRIVERDATA(vp->RasInfo->BitMap);
78 } else {
79 sprite->x = x;
80 sprite->y = y;
81 /* TODO: obviously this should use a chipset driver. Currently we have no one. */
82 return;
85 if (sprite->num) /* We have only sprite #0 for the mouse cursor */
86 return;
88 HIDD_Gfx_SetCursorPos(mdd->gfxhidd, sprite->x, sprite->y);
90 AROS_LIBFUNC_EXIT
91 } /* MoveSprite */