Build contrib binary archive again because it isn't included in FreeBSD
[AROS.git] / rom / hyperlayers / swapbitsrastportcliprect.c
blobb71d04c27b92faea722c5fbc7aa0c4c2dbfe0ece
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 <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
47 AROS_LIBBASE_EXT_DECL(struct LayersBase *,LayersBase)
49 /*
50 First allocate a BitMap where the BitMap Data of the RastPort's
51 bitmap will go into.
53 struct BitMap * NewBM;
55 NewBM = AllocBitMap(GetBitMapAttr(cr->BitMap, BMA_WIDTH) + 16,
56 GetBitMapAttr(cr->BitMap, BMA_HEIGHT),
57 GetBitMapAttr(cr->BitMap, BMA_DEPTH),
59 rp->BitMap);
61 Save the displayed bitmap area to the new BitMap
64 BltBitMap(rp->BitMap,
65 cr->bounds.MinX,
66 cr->bounds.MinY,
67 NewBM,
68 ALIGN_OFFSET(cr->bounds.MinX),
70 cr->bounds.MaxX - cr->bounds.MinX + 1,
71 cr->bounds.MaxY - cr->bounds.MinY + 1,
72 0x0c0,
73 0xff,
74 NULL
78 Display the contents of the ClipRect's BitMap.
79 */
81 BltBitMap(cr->BitMap,
82 ALIGN_OFFSET(cr->bounds.MinX),
84 rp->BitMap,
85 cr->bounds.MinX,
86 cr->bounds.MinY,
87 cr->bounds.MaxX - cr->bounds.MinX + 1,
88 cr->bounds.MaxY - cr->bounds.MinY + 1,
89 0x0c0,
90 0xff,
91 NULL
95 Free the 'old' BitMap of the ClipRect and hang the new BitMap into
96 the ClipRect structure.
98 FreeBitMap(cr->BitMap);
99 cr->BitMap = NewBM;
101 AROS_LIBFUNC_EXIT
102 } /* SwapBitsRastPortClipRect */