2 Copyright © 1995-2011, The AROS Development Team. All rights reserved.
8 #include <aros/debug.h>
11 #include "graphics_intern.h"
12 #include "gfxfuncsupport.h"
13 #include "graphics_driver.h"
15 /****************************************************************************************/
17 struct bitmap_render_data
19 struct render_special_info rsi
;
22 OOP_Object
*srcbm_obj
;
25 static ULONG
bitmap_render(APTR bitmap_rd
, WORD srcx
, WORD srcy
,
26 OOP_Object
*dstbm_obj
, OOP_Object
*dst_gc
,
27 struct Rectangle
*rect
, struct GfxBase
*GfxBase
)
29 struct bitmap_render_data
*brd
= bitmap_rd
;
30 OOP_Object
*gfxhidd
= SelectDriverObject(brd
->srcbm
, dstbm_obj
, GfxBase
);
31 WORD width
= rect
->MaxX
- rect
->MinX
+ 1;
32 WORD height
= rect
->MaxY
- rect
->MinY
+ 1;
35 // D(bug("bitmap_render(%p, %d, %d, %p, %p, %d, %d, %d, %d, %p)\n"
36 // , bitmap_rd, srcx, srcy, dstbm_obj, dst_gc, rect->MinX, rect->MinY, rect->MaxX, rect->MaxY, GfxBase));
39 * Get some info on the colormaps. We have to make sure
40 * that we have the appropriate mapping tables set.
42 res
= int_bltbitmap(brd
->srcbm
, brd
->srcbm_obj
, srcx
, srcy
,
43 brd
->rsi
.curbm
, dstbm_obj
, rect
->MinX
, rect
->MinY
,
44 width
, height
, brd
->minterm
, gfxhidd
, dst_gc
, GfxBase
);
46 return res
? width
* height
: 0;
49 /*****************************************************************************
52 #include <proto/graphics.h>
54 AROS_LH9 (void, BltBitMapRastPort
,
57 AROS_LHA(struct BitMap
*, srcBitMap
, A0
),
58 AROS_LHA(WORD
, xSrc
, D0
),
59 AROS_LHA(WORD
, ySrc
, D1
),
60 AROS_LHA(struct RastPort
*, destRP
, A1
),
61 AROS_LHA(WORD
, xDest
, D2
),
62 AROS_LHA(WORD
, yDest
, D3
),
63 AROS_LHA(WORD
, xSize
, D4
),
64 AROS_LHA(WORD
, ySize
, D5
),
65 AROS_LHA(ULONG
, minterm
, D6
),
68 struct GfxBase
*, GfxBase
, 101, Graphics
)
71 Moves part of a bitmap around or into another bitmap.
74 srcBitMap - Copy from this bitmap.
75 xSrc, ySrc - This is the upper left corner of the area to copy.
76 destRP - Destination RastPort.
77 xDest, yDest - Upper left corner where to place the copy
78 xSize, ySize - The size of the area to copy
79 minterm - How to copy. See BltBitMap() for an explanation.
85 If special hardware is available, this function will use it.
102 *****************************************************************************/
106 struct bitmap_render_data brd
;
111 EnterFunc(bug("BltBitMapRastPort(%d %d %d, %d, %d, %d, %x, %p, %p)\n"
112 , xSrc
, ySrc
, xDest
, yDest
, xSize
, ySize
, minterm
, srcBitMap
, destRP
));
119 brd
.srcbm_obj
= OBTAIN_HIDD_BM(srcBitMap
);
120 if (NULL
== brd
.srcbm_obj
)
125 brd
.minterm
= minterm
;
126 brd
.srcbm
= srcBitMap
;
128 /* Get RastPort's GC and set the correct ROP */
129 gc
= GetDriverData(destRP
, GfxBase
);
130 GC_DRMD(gc
) = MINTERM_TO_GCDRMD(minterm
);
134 rr
.MaxX
= xDest
+ xSize
- 1;
135 rr
.MaxY
= yDest
+ ySize
- 1;
140 do_render_with_gc(destRP
, &src
, &rr
, bitmap_render
, &brd
, gc
, TRUE
, TRUE
, GfxBase
);
142 RELEASE_HIDD_BM(brd
.srcbm_obj
, srcBitMap
);
143 ReturnVoid("BltBitMapRastPort");
147 } /* BltBitMapRastPort */