2 Copyright © 1995-2011, 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 UBYTE 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 the image in the template into the
65 RastPort in the current color and drawing mode.
68 source - template bitplane. Should be Word aligned.
69 xSrc - x offset in source plane (0...15).
70 srcMod - BytesPerRow in template mask.
71 destRP - destination RastPort.
72 xDest,yDest - upper left corner of destination.
73 xSize,ySize - size of destination.
88 27-11-96 digulla automatically created from
89 graphics_lib.fd and clib/graphics_protos.h
91 *****************************************************************************/
95 struct bt_render_data btrd
;
98 EnterFunc(bug("driver_BltTemplate(%d, %d, %d, %d, %d, %d)\n"
99 , xSrc
, srcMod
, xDest
, yDest
, xSize
, ySize
));
104 btrd
.template = (UBYTE
*)source
;
106 btrd
.modulo
= srcMod
;
107 btrd
.inverttemplate
= (destRP
->DrawMode
& INVERSVID
) ? TRUE
: FALSE
;
111 rr
.MaxX
= xDest
+ xSize
- 1;
112 rr
.MaxY
= yDest
+ ySize
- 1;
114 do_render_func(destRP
, NULL
, &rr
, blttemplate_render
, &btrd
, TRUE
, FALSE
, GfxBase
);
115 ReturnVoid("driver_BltTemplate");