2 Copyright © 1995-2001, The AROS Development Team. All rights reserved.
8 #include <aros/debug.h>
9 #include <proto/graphics.h>
10 #include <proto/oop.h>
11 #include "graphics_intern.h"
12 #include "gfxfuncsupport.h"
14 static ULONG
blttemplate_render(APTR btr_data
, LONG srcx
, LONG srcy
,
15 OOP_Object
*dstbm_obj
, OOP_Object
*dst_gc
,
16 LONG x1
, LONG y1
, LONG x2
, LONG y2
,
17 struct GfxBase
*GfxBase
);
27 /*****************************************************************************
30 #include <clib/graphics_protos.h>
32 AROS_LH8(void, BltTemplate
,
36 AROS_LHA(PLANEPTR
, source
, A0
),
37 AROS_LHA(LONG
, xSrc
, D0
),
38 AROS_LHA(LONG
, srcMod
, D1
),
39 AROS_LHA(struct RastPort
* , destRP
, A1
),
40 AROS_LHA(LONG
, xDest
, D2
),
41 AROS_LHA(LONG
, yDest
, D3
),
42 AROS_LHA(LONG
, xSize
, D4
),
43 AROS_LHA(LONG
, ySize
, D5
),
46 struct GfxBase
*, GfxBase
, 6, Graphics
)
49 Draws the image in the template into the
50 RastPort in the current color and drawing mode.
53 source - template bitplane. Should be Word aligned.
54 xSrc - x offset in source plane (0...15).
55 srcMod - BytesPerRow in template mask.
56 destRP - destination RastPort.
57 xDest,yDest - upper left corner of destination.
58 xSize,ySize - size of destination.
73 27-11-96 digulla automatically created from
74 graphics_lib.fd and clib/graphics_protos.h
76 *****************************************************************************/
80 struct bt_render_data btrd
;
83 EnterFunc(bug("driver_BltTemplate(%d, %d, %d, %d, %d, %d)\n"
84 , xSrc
, srcMod
, xDest
, yDest
, xSize
, ySize
));
89 if (!OBTAIN_DRIVERDATA(destRP
, GfxBase
))
90 ReturnVoid("driver_BltTemplate");
92 btrd
.template = (UBYTE
*)source
;
95 btrd
.inverttemplate
= (destRP
->DrawMode
& INVERSVID
) ? TRUE
: FALSE
;
99 rr
.MaxX
= xDest
+ xSize
- 1;
100 rr
.MaxY
= yDest
+ ySize
- 1;
102 do_render_func(destRP
, NULL
, &rr
, blttemplate_render
, &btrd
, FALSE
, GfxBase
);
104 RELEASE_DRIVERDATA(destRP
, GfxBase
);
106 ReturnVoid("driver_BltTemplate");
112 /****************************************************************************************/
114 static ULONG
blttemplate_render(APTR btr_data
, LONG srcx
, LONG srcy
,
115 OOP_Object
*dstbm_obj
, OOP_Object
*dst_gc
,
116 LONG x1
, LONG y1
, LONG x2
, LONG y2
,
117 struct GfxBase
*GfxBase
)
119 struct bt_render_data
*btrd
;
125 height
= y2
- y1
+ 1;
127 btrd
= (struct bt_render_data
*)btr_data
;
128 x
= srcx
+ btrd
->srcx
;
130 template = btrd
->template + btrd
->modulo
* srcy
;
132 HIDD_BM_PutTemplate(dstbm_obj
, dst_gc
, template, btrd
->modulo
,
133 x
, x1
, y1
, width
, height
, btrd
->inverttemplate
);
135 return width
* height
;