Search
lxdream.org :: lxdream :: r320:660b15095115
lxdream 0.9.1
released Jun 29
Download Now
changeset320:660b15095115
parent319:5392aed6a982
child321:7036e3692165
authornkeynes
dateWed Jan 24 08:13:18 2007 +0000 (12 years ago)
Add draw_grid_24 method
test/pvr.c
1.1 --- a/test/pvr.c Wed Jan 24 08:11:14 2007 +0000
1.2 +++ b/test/pvr.c Wed Jan 24 08:13:18 2007 +0000
1.3 @@ -1,5 +1,5 @@
1.4 /**
1.5 - * $Id: pvr.c,v 1.4 2007-01-21 05:23:53 nkeynes Exp $
1.6 + * $Id: pvr.c,v 1.5 2007-01-24 08:13:18 nkeynes Exp $
1.7 *
1.8 * PVR support code
1.9 *
1.10 @@ -489,5 +489,29 @@
1.11 addr[(linesize*y) + x] = colour;
1.12 }
1.13 }
1.14 +}
1.15
1.16 +void draw_grid_24( unsigned char *addr, unsigned int colour )
1.17 +{
1.18 + int x,y;
1.19 + char r = (colour >> 16) & 0xFF;
1.20 + char g = (colour >> 8) & 0xFF;
1.21 + char b = (colour & 0xFF);
1.22 + unsigned int linesize = 640*3;
1.23 + for( x=0; x<640; x+=32 ) {
1.24 + for( y=0; y<480; y++ ) {
1.25 + int a = (linesize*y)+x * 3;
1.26 + addr[a++] = r;
1.27 + addr[a++] = g;
1.28 + addr[a++] = b;
1.29 + }
1.30 + }
1.31 + for( y=0; y<480; y+=32 ) {
1.32 + for( x=0; x<640; x++ ) {
1.33 + int a = (linesize*y)+x * 3;
1.34 + addr[a++] = r;
1.35 + addr[a++] = g;
1.36 + addr[a++] = b;
1.37 + }
1.38 + }
1.39 }
.