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
)
64 27-11-96 digulla automatically created from
65 graphics_lib.fd and clib/graphics_protos.h
67 *****************************************************************************/
71 struct bitmap_render_data brd
;
73 HIDDT_DrawMode old_drmd
;
77 struct TagItem gc_tags
[] =
79 { aHidd_GC_DrawMode
, 0UL },
83 EnterFunc(bug("BltBitMapRastPort(%d %d %d, %d, %d, %d)\n"
84 , xSrc
, ySrc
, xDest
, yDest
, xSize
, ySize
));
86 if (!OBTAIN_DRIVERDATA(destRP
, GfxBase
))
94 brd
.minterm
= minterm
;
95 brd
.srcbm_obj
= OBTAIN_HIDD_BM(srcBitMap
);
96 if (NULL
== brd
.srcbm_obj
)
98 RELEASE_DRIVERDATA(destRP
, GfxBase
);
102 brd
.srcbm
= srcBitMap
;
104 gc
= GetDriverData(destRP
)->dd_GC
;
105 OOP_GetAttr(gc
, aHidd_GC_DrawMode
, &old_drmd
);
107 gc_tags
[0].ti_Data
= MINTERM_TO_GCDRMD(minterm
);
108 OOP_SetAttrs(gc
, gc_tags
);
112 rr
.MaxX
= xDest
+ xSize
- 1;
113 rr
.MaxY
= yDest
+ ySize
- 1;
118 do_render_func(destRP
, &src
, &rr
, bitmap_render
, &brd
, TRUE
, GfxBase
);
120 RELEASE_HIDD_BM(brd
.srcbm_obj
, srcBitMap
);
122 gc_tags
[0].ti_Data
= old_drmd
;
123 OOP_SetAttrs(gc
, gc_tags
);
125 RELEASE_DRIVERDATA(destRP
, GfxBase
);
127 ReturnVoid("BltBitMapRastPort");
131 } /* BltBitMapRastPort */
133 /****************************************************************************************/
135 static ULONG
bitmap_render(APTR bitmap_rd
, LONG srcx
, LONG srcy
,
136 OOP_Object
*dstbm_obj
, OOP_Object
*dst_gc
,
137 LONG x1
, LONG y1
, LONG x2
, LONG y2
, struct GfxBase
*GfxBase
)
139 struct bitmap_render_data
*brd
;
143 height
= y2
- y1
+ 1;
145 brd
= (struct bitmap_render_data
*)bitmap_rd
;
147 // D(bug("bitmap_render(%p, %d, %d, %p, %p, %d, %d, %d, %d, %p)\n"
148 // , bitmap_rd, srcx, srcy, dstbm_obj, dst_gc, x1, y1, x2, y2, GfxBase));
151 /* Get some info on the colormaps. We have to make sure
152 that we have the apropriate mapping tables set.
155 if (!int_bltbitmap(brd
->srcbm
161 , x2
- x1
+ 1, y2
- y1
+ 1
168 return width
* height
;
171 /****************************************************************************************/