2 Copyright © 1995-2013, The AROS Development Team. All rights reserved.
9 #include <aros/debug.h>
10 #include <proto/graphics.h>
11 #include <proto/oop.h>
13 #include "graphics_intern.h"
14 #include "gfxfuncsupport.h"
16 /****************************************************************************************/
26 static ULONG
blttemplate_render(APTR btr_data
, WORD srcx
, WORD srcy
,
27 OOP_Object
*dstbm_obj
, OOP_Object
*dst_gc
,
28 struct Rectangle
*rect
, struct GfxBase
*GfxBase
)
30 struct bt_render_data
*btrd
= btr_data
;
31 WORD width
= rect
->MaxX
- rect
->MinX
+ 1;
32 WORD height
= rect
->MaxY
- rect
->MinY
+ 1;
33 WORD x
= srcx
+ btrd
->srcx
;
34 UBYTE
*template = btrd
->template + btrd
->modulo
* srcy
;
36 HIDD_BM_PutTemplate(dstbm_obj
, dst_gc
, template, btrd
->modulo
,
37 x
, rect
->MinX
, rect
->MinY
, width
, height
, btrd
->inverttemplate
);
39 return width
* height
;
42 /*****************************************************************************
45 #include <clib/graphics_protos.h>
47 AROS_LH8(void, BltTemplate
,
51 AROS_LHA(PLANEPTR
, source
, A0
),
52 AROS_LHA(WORD
, xSrc
, D0
),
53 AROS_LHA(WORD
, srcMod
, D1
),
54 AROS_LHA(struct RastPort
* , destRP
, A1
),
55 AROS_LHA(WORD
, xDest
, D2
),
56 AROS_LHA(WORD
, yDest
, D3
),
57 AROS_LHA(WORD
, xSize
, D4
),
58 AROS_LHA(WORD
, ySize
, D5
),
61 struct GfxBase
*, GfxBase
, 6, Graphics
)
64 Draws part of a single-bitplane image into the RastPort in the current
65 colors (foreground and background) and drawing mode.
68 source - pointer to the aligned UWORD in which the top-lefthand corner
69 of the template is located.
70 xSrc - bit offset of top-lefthand corner of template from start of
71 UWORD pointed to by 'source' input (0 to 15).
72 srcMod - number of bytes per row in template's bitplane.
73 destRP - destination RastPort.
74 xDest,yDest - upper left corner of destination.
75 xSize,ySize - size of destination.
81 The size and destination coordinates may be outside the RastPort
82 boundaries, in which case the affected area is safely truncated.
92 *****************************************************************************/
96 struct bt_render_data btrd
;
99 EnterFunc(bug("driver_BltTemplate(%d, %d, %d, %d, %d, %d)\n"
100 , xSrc
, srcMod
, xDest
, yDest
, xSize
, ySize
));
105 btrd
.template = (UBYTE
*)source
;
107 btrd
.modulo
= srcMod
;
108 btrd
.inverttemplate
= (destRP
->DrawMode
& INVERSVID
) ? TRUE
: FALSE
;
112 rr
.MaxX
= xDest
+ xSize
- 1;
113 rr
.MaxY
= yDest
+ ySize
- 1;
115 do_render_func(destRP
, NULL
, &rr
, blttemplate_render
, &btrd
, TRUE
, FALSE
, GfxBase
);
116 ReturnVoid("driver_BltTemplate");