10 static uchar bm_bits
[32*32*2];
11 static grs_bitmap bm
={
12 bm_bits
, BMT_FLAT8
, 0, 0, 32, 32, 32, 5, 5
15 static uchar clut
[256];
16 static uchar pal
[768];
24 int get_input(void (*cb
)())
30 case '2': size
.y
++; break;
31 case '8': size
.y
--; break;
32 case '4': size
.x
--; break;
33 case '6': size
.x
++; break;
34 case 'w': pos
.y
-=5; break;
35 case 'x': pos
.y
+=5; break;
36 case 'a': pos
.x
-=5; break;
37 case 'd': pos
.x
+=5; break;
38 case 'b': do_box
^=1; break;
39 case 'm': do_bm
^=1; break;
40 case 'f': fill_type
++;
41 if (fill_type
==FILL_TYPES
) fill_type
=0;
43 case 't': bm
.flags
^=BMF_TRANS
; break;
51 int fc_save
=grd_gc
.fcolor
;
53 gr_rect(0, 0, grd_bm
.w
, grd_bm
.h
);
54 grd_gc
.fcolor
= fc_save
;
59 grd_gc
.fill_type
=fill_type
;
60 if (fill_type
==FILL_CLUT
)
61 grd_gc
.fill_parm
= (ulong
)clut
;
62 if (fill_type
==FILL_SOLID
)
63 grd_gc
.fill_parm
= grd_gc
.fcolor
;
65 gr_bitmap(&bm
, pos
.x
, pos
.y
);
67 gr_box(pos
.x
, pos
.y
, pos
.x
+size
.x
, pos
.y
+size
.y
);
68 grd_gc
.fill_type
=FILL_NORM
;
74 for (i
=0; i
<bm
.row
*bm
.h
; i
++)
76 for (i
=0; i
<256; i
++) {
82 gr_set_default_pal(pal
);
91 gr_set_mode(GRM_320x400x8
, TRUE
);
92 s
= gr_alloc_screen(grd_cap
->w
, grd_cap
->h
);
98 } while (get_input(clear
));
99 mprintf("hi there.\n");