convert line ends
[canaan.git] / prj / tech / libsrc / font / f16fl8t.c
blob970dd53a2ee2d5869a115c8233563fcea4f702ad
1 #include <dev2d.h>
3 static void il(uchar *dst, uchar *src, int n)
5 ushort *d16 = (ushort *)dst;
6 uint check = grd_light_table_size-1;
7 uint fclow = grd_gc.fcolor&0xff;
8 uint fchigh = 256 + ((grd_gc.fcolor>>8)&0xff);
9 int i;
11 for (i=0; i<n; i++) {
12 uint l = src[i];
13 ushort c16;
14 ushort *clut;
16 if (l-1>=check) // i.e., 0<l<grd_light_table_size
17 continue;
19 clut = (ushort *)(grd_light_table+(l<<10));
20 c16 = clut[fclow] + clut[fchigh];
21 clut = (ushort *)(grd_light_table+((check-l)<<10));
22 d16[i] = c16 + clut[dst[2*i]] + clut[256+dst[2*i+1]];
26 void flat16_flat8_tluc16_ubitmap(grs_bitmap *bm, int x, int y)
28 uchar *src, *dst;
29 int w = bm->w;
30 int h = bm->h;
32 src = bm->bits;
33 dst = grd_bm.bits + grd_bm.row*y + 2*x;
35 while (h--) {
36 il(dst, src, w);
37 src += bm->row;
38 dst += grd_bm.row;