2 Copyright © 1995-2001, The AROS Development Team. All rights reserved.
8 #include <aros/debug.h>
10 #include "graphics_intern.h"
11 #include "gfxfuncsupport.h"
13 struct bitmap_render_data
15 struct render_special_info rsi
;
18 OOP_Object
*srcbm_obj
;
22 static ULONG
bitmap_render(APTR bitmap_rd
, LONG srcx
, LONG srcy
,
23 OOP_Object
*dstbm_obj
, OOP_Object
*dst_gc
,
24 LONG x1
, LONG y1
, LONG x2
, LONG y2
, struct GfxBase
*GfxBase
);
26 /*****************************************************************************
29 #include <proto/graphics.h>
31 AROS_LH9 (void, BltBitMapRastPort
,
34 AROS_LHA(struct BitMap
*, srcBitMap
, A0
),
35 AROS_LHA(LONG
, xSrc
, D0
),
36 AROS_LHA(LONG
, ySrc
, D1
),
37 AROS_LHA(struct RastPort
*, destRP
, A1
),
38 AROS_LHA(LONG
, xDest
, D2
),
39 AROS_LHA(LONG
, yDest
, D3
),
40 AROS_LHA(LONG
, xSize
, D4
),
41 AROS_LHA(LONG
, ySize
, D5
),
42 AROS_LHA(ULONG
, minterm
, D6
),
45 struct GfxBase
*, GfxBase
, 101, Graphics
)
48 Moves a part of a bitmap around or into another bitmaps.
51 srcBitMap - Copy from this bitmap.
52 xSrc, ySrc - This is the upper left corner of the area to copy.
53 destRP - Destination RastPort.
54 xDest, yDest - Upper left corner where to place the copy
55 xSize, ySize - The size of the area to copy
56 minterm - How to copy. See BltBitMap() for an explanation.
62 If a special hardware is available, this function will use it.
80 27-11-96 digulla automatically created from
81 graphics_lib.fd and clib/graphics_protos.h
83 *****************************************************************************/
87 struct bitmap_render_data brd
;
89 HIDDT_DrawMode old_drmd
;
93 struct TagItem gc_tags
[] =
95 { aHidd_GC_DrawMode
, 0UL },
99 EnterFunc(bug("BltBitMapRastPort(%d %d %d, %d, %d, %d)\n"
100 , xSrc
, ySrc
, xDest
, yDest
, xSize
, ySize
));
102 if (!OBTAIN_DRIVERDATA(destRP
, GfxBase
))
110 brd
.minterm
= minterm
;
111 brd
.srcbm_obj
= OBTAIN_HIDD_BM(srcBitMap
);
112 if (NULL
== brd
.srcbm_obj
)
114 RELEASE_DRIVERDATA(destRP
, GfxBase
);
118 brd
.srcbm
= srcBitMap
;
120 gc
= GetDriverData(destRP
)->dd_GC
;
121 OOP_GetAttr(gc
, aHidd_GC_DrawMode
, &old_drmd
);
123 gc_tags
[0].ti_Data
= MINTERM_TO_GCDRMD(minterm
);
124 OOP_SetAttrs(gc
, gc_tags
);
128 rr
.MaxX
= xDest
+ xSize
- 1;
129 rr
.MaxY
= yDest
+ ySize
- 1;
134 do_render_func(destRP
, &src
, &rr
, bitmap_render
, &brd
, TRUE
, TRUE
, GfxBase
);
136 RELEASE_HIDD_BM(brd
.srcbm_obj
, srcBitMap
);
138 gc_tags
[0].ti_Data
= old_drmd
;
139 OOP_SetAttrs(gc
, gc_tags
);
141 RELEASE_DRIVERDATA(destRP
, GfxBase
);
143 ReturnVoid("BltBitMapRastPort");
147 } /* BltBitMapRastPort */
149 /****************************************************************************************/
151 static ULONG
bitmap_render(APTR bitmap_rd
, LONG srcx
, LONG srcy
,
152 OOP_Object
*dstbm_obj
, OOP_Object
*dst_gc
,
153 LONG x1
, LONG y1
, LONG x2
, LONG y2
, struct GfxBase
*GfxBase
)
155 struct bitmap_render_data
*brd
;
159 height
= y2
- y1
+ 1;
161 brd
= (struct bitmap_render_data
*)bitmap_rd
;
163 // D(bug("bitmap_render(%p, %d, %d, %p, %p, %d, %d, %d, %d, %p)\n"
164 // , bitmap_rd, srcx, srcy, dstbm_obj, dst_gc, x1, y1, x2, y2, GfxBase));
167 /* Get some info on the colormaps. We have to make sure
168 that we have the apropriate mapping tables set.
171 if (!int_bltbitmap(brd
->srcbm
177 , x2
- x1
+ 1, y2
- y1
+ 1
184 return width
* height
;
187 /****************************************************************************************/