Documented GVF_SAVE_VAR alongside other flags, and removed a query/doubt
[AROS.git] / rom / hyperlayers / swapbitsrastportcliprect.c
bloba336a16e754186e4559e848e7ee9c3a76a31fee0
1 /*
2 Copyright © 1995-2007, The AROS Development Team. All rights reserved.
3 $Id$
5 Desc:
6 Lang: english
7 */
8 #include <aros/libcall.h>
9 #include <proto/layers.h>
10 #include <proto/graphics.h>
11 #include "layers_intern.h"
13 /*****************************************************************************
15 NAME */
17 AROS_LH2(void, SwapBitsRastPortClipRect,
19 /* SYNOPSIS */
20 AROS_LHA(struct RastPort *, rp, A0),
21 AROS_LHA(struct ClipRect *, cr, A1),
23 /* LOCATION */
24 struct LayersBase *, LayersBase, 21, Layers)
26 /* FUNCTION
28 INPUTS
30 RESULT
32 NOTES
34 EXAMPLE
36 BUGS
38 SEE ALSO
40 INTERNALS
42 HISTORY
44 *****************************************************************************/
46 AROS_LIBFUNC_INIT
48 /*
49 First allocate a BitMap where the BitMap Data of the RastPort's
50 bitmap will go into.
52 struct BitMap * NewBM;
54 NewBM = AllocBitMap(GetBitMapAttr(cr->BitMap, BMA_WIDTH) + 16,
55 GetBitMapAttr(cr->BitMap, BMA_HEIGHT),
56 GetBitMapAttr(cr->BitMap, BMA_DEPTH),
58 rp->BitMap);
60 Save the displayed bitmap area to the new BitMap
63 BltBitMap(rp->BitMap,
64 cr->bounds.MinX,
65 cr->bounds.MinY,
66 NewBM,
67 ALIGN_OFFSET(cr->bounds.MinX),
69 cr->bounds.MaxX - cr->bounds.MinX + 1,
70 cr->bounds.MaxY - cr->bounds.MinY + 1,
71 0x0c0,
72 0xff,
73 NULL
77 Display the contents of the ClipRect's BitMap.
78 */
80 BltBitMap(cr->BitMap,
81 ALIGN_OFFSET(cr->bounds.MinX),
83 rp->BitMap,
84 cr->bounds.MinX,
85 cr->bounds.MinY,
86 cr->bounds.MaxX - cr->bounds.MinX + 1,
87 cr->bounds.MaxY - cr->bounds.MinY + 1,
88 0x0c0,
89 0xff,
90 NULL
94 Free the 'old' BitMap of the ClipRect and hang the new BitMap into
95 the ClipRect structure.
97 FreeBitMap(cr->BitMap);
98 cr->BitMap = NewBM;
100 AROS_LIBFUNC_EXIT
101 } /* SwapBitsRastPortClipRect */