2 Copyright © 1995-2011, The AROS Development Team. All rights reserved.
5 Desc: Graphics function ScrollVPort()
9 #include <aros/debug.h>
10 #include <proto/oop.h>
12 #include "graphics_intern.h"
13 #include "gfxfuncsupport.h"
15 /*****************************************************************************
18 #include <proto/graphics.h>
20 AROS_LH1(void, ScrollVPort
,
23 AROS_LHA(struct ViewPort
*, vp
, A0
),
26 struct GfxBase
*, GfxBase
, 98, Graphics
)
35 AROS video drivers can perform a validation of offsets, and may refuse
36 to scroll the screen too far (if they somehow can't provide the requested
37 offset). In this case offset values in the ViewPort will be updated in
38 order to reflect the real result of the operation.
51 ******************************************************************************/
56 * Bitmap object pointer is contained in struct ViewPortData,
57 * connected to a ViewPortExtra.
58 * This is true even for planar Amiga bitmaps.
60 struct ViewPortExtra
*vpe
= (struct ViewPortExtra
*)GfxLookUp(vp
);
64 struct TagItem tags
[] =
66 { .ti_Tag
= aHidd_BitMap_LeftEdge
, .ti_Data
= vp
->DxOffset
, },
67 { .ti_Tag
= aHidd_BitMap_TopEdge
, .ti_Data
= vp
->DyOffset
, },
68 { .ti_Tag
= TAG_DONE
, }
72 /* Actually move the bitmap */
73 OOP_SetAttrs(VPE_DATA(vpe
)->Bitmap
, tags
);
75 /* The bitmap may fail to move. Fix up offsets now */
76 OOP_GetAttr(VPE_DATA(vpe
)->Bitmap
, aHidd_BitMap_LeftEdge
, &offset
);
77 vp
->DxOffset
= offset
;
78 OOP_GetAttr(VPE_DATA(vpe
)->Bitmap
, aHidd_BitMap_TopEdge
, &offset
);
79 vp
->DyOffset
= offset
;