New bitmap method SetRGBConversionFunction which can be used to
[tangerine.git] / rom / hyperlayers / scrolllayer.c
blobb27d8ccb3fbc9ce9afc863c8d2fb0a7298e18dae
1 /*
2 Copyright © 1995-2001, The AROS Development Team. All rights reserved.
3 $Id$
5 Desc:
6 Lang: english
7 */
8 #include <aros/libcall.h>
9 #include <graphics/clip.h>
10 #include <exec/types.h>
11 #include <proto/exec.h>
12 #include <graphics/layers.h>
13 #include <proto/layers.h>
14 #include <proto/graphics.h>
15 #include "layers_intern.h"
17 /*****************************************************************************
19 NAME */
21 AROS_LH4(void, ScrollLayer,
23 /* SYNOPSIS */
24 AROS_LHA(LONG , dummy, A0),
25 AROS_LHA(struct Layer *, l , A1),
26 AROS_LHA(LONG , dx , D0),
27 AROS_LHA(LONG , dy , D1),
29 /* LOCATION */
30 struct LayersBase *, LayersBase, 12, Layers)
32 /* FUNCTION
33 For superbitmapped layers this function work like this:.
34 It updates the contents of the superbitmap with what is
35 visible on the display, repositions the superbitmap
36 and redraws the display.
37 For non-superbitmapped layers, all subsequent (x,y) pairs
38 are adjusted by the scroll(x,y) value in the layer. If
39 ScrollLayer(-10,-3) was called and (0,0) is drawn it will
40 finally end up at coordinates (10, 3) in the superbitmap.
42 INPUTS
43 l - pointer to layer
44 dx - delta x to add to current x scroll value
45 dy - delta y to add to current y scroll value
47 RESULT
50 NOTES
52 EXAMPLE
54 BUGS
55 not tested
57 SEE ALSO
59 INTERNALS
61 HISTORY
62 27-11-96 digulla automatically created from
63 layers_lib.fd and clib/layers_protos.h
65 *****************************************************************************/
67 AROS_LIBFUNC_INIT
68 AROS_LIBBASE_EXT_DECL(struct LayersBase *,LayersBase)
70 if (0 == dx && 0 == dy)
71 return;
73 LockLayer(0, l);
75 /* if it's a superbitmapped layer */
76 if ((l->Flags & LAYERSUPER) != 0)
78 /* store the visible "stuff" to the superbitmap */
79 SyncSBitMap(l);
81 l->Scroll_X -= dx;
82 l->Scroll_Y -= dy;
84 /* show what's in the superbitmap */
85 CopySBitMap(l);
87 else
89 l->Scroll_X -= dx;
90 l->Scroll_Y -= dy;
93 UnlockLayer(l);
95 return;
97 AROS_LIBFUNC_EXIT
98 } /* ScrollLayer */