2 Copyright © 1995-2010, 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 ******************************************************************************/
55 /* We use obtain/release pair because this makes ScrollVPort()
56 operating also on planar bitmaps, which can aid in porting AROS
58 OOP_Object
*bitmap
= OBTAIN_HIDD_BM(vp
->RasInfo
->BitMap
);
60 aHidd_BitMap_LeftEdge
, vp
->DxOffset
,
61 aHidd_BitMap_TopEdge
, vp
->DyOffset
,
66 /* Actually move the bitmap */
67 OOP_SetAttrs(bitmap
, tags
);
69 /* The bitmap may fail to move. Fix up offsets now */
70 OOP_GetAttr(bitmap
, aHidd_BitMap_LeftEdge
, &offset
);
71 vp
->DxOffset
= offset
;
72 OOP_GetAttr(bitmap
, aHidd_BitMap_TopEdge
, &offset
);
73 vp
->DyOffset
= offset
;
75 RELEASE_HIDD_BM(bitmap
, vp
->RasInfo
->BitMap
);