2 Copyright © 1995-2001, The AROS Development Team. All rights reserved.
8 #include <aros/debug.h>
9 #include "graphics_intern.h"
10 #include "gfxfuncsupport.h"
12 struct rp8_render_data
16 HIDDT_PixelLUT
*pixlut
;
19 static ULONG
rp8_render(APTR rp8r_data
, LONG srcx
, LONG srcy
,
20 OOP_Object
*srcbm_obj
, OOP_Object
*gc
,
21 LONG x1
, LONG y1
, LONG x2
, LONG y2
,
22 struct GfxBase
*GfxBase
);
24 /*****************************************************************************
27 #include <clib/graphics_protos.h>
29 AROS_LH7(LONG
, ReadPixelArray8
,
32 AROS_LHA(struct RastPort
* , rp
, A0
),
33 AROS_LHA(LONG
, xstart
, D0
),
34 AROS_LHA(LONG
, ystart
, D1
),
35 AROS_LHA(LONG
, xstop
, D2
),
36 AROS_LHA(LONG
, ystop
, D3
),
37 AROS_LHA(UBYTE
* , array
, A2
),
38 AROS_LHA(struct RastPort
* , temprp
, A1
),
41 struct GfxBase
*, GfxBase
, 130, Graphics
)
60 27-11-96 digulla automatically created from
61 graphics_lib.fd and clib/graphics_protos.h
63 *****************************************************************************/
67 struct rp8_render_data rp8rd
;
69 HIDDT_PixelLUT pixlut
;
72 EnterFunc(bug("ReadPixelArray8(%p, %d, %d, %d, %d)\n",
73 rp
, xstart
, ystart
, xstop
, ystop
));
80 if ((xstart
> xstop
) || (ystart
> ystop
)) return 0;
82 if (!OBTAIN_DRIVERDATA(rp
, GfxBase
))
85 #warning "ReadPixelArray8 on hi/truecolor screens or a LUT for it does not really make sense"
87 pixlut
.entries
= AROS_PALETTE_SIZE
;
88 pixlut
.pixels
= IS_HIDD_BM(rp
->BitMap
) ? HIDD_BM_PIXTAB(rp
->BitMap
) : NULL
;
91 rp8rd
.modulo
= ((xstop
- xstart
+ 1) + 15) & ~15;
92 rp8rd
.pixlut
= &pixlut
;
99 pixread
= do_render_func(rp
, NULL
, &rr
, rp8_render
, &rp8rd
, FALSE
, GfxBase
);
101 RELEASE_DRIVERDATA(rp
, GfxBase
);
103 ReturnInt("ReadPixelArray8", LONG
, pixread
);
107 } /* ReadPixelArray8 */
109 /****************************************************************************************/
111 static ULONG
rp8_render(APTR rp8r_data
, LONG srcx
, LONG srcy
,
112 OOP_Object
*srcbm_obj
, OOP_Object
*gc
,
113 LONG x1
, LONG y1
, LONG x2
, LONG y2
,
114 struct GfxBase
*GfxBase
)
116 struct rp8_render_data
*rp8rd
;
119 rp8rd
= (struct rp8_render_data
*)rp8r_data
;
122 height
= y2
- y1
+ 1;
124 HIDD_BM_GetImageLUT(srcbm_obj
125 , rp8rd
->array
+ CHUNKY8_COORD_TO_BYTEIDX(srcx
, srcy
, rp8rd
->modulo
)
132 return width
* height
;
135 /****************************************************************************************/