From a64e6fe1fc676771b589503916bde0f857401119 Mon Sep 17 00:00:00 2001 From: reinelt <> Date: Fri, 24 Mar 2000 11:36:56 +0000 Subject: [lcd4linux @ 2000-03-24 11:36:56 by reinelt] new syntax for raster configuration changed XRES and YRES to be configurable PPM driver works nice --- pixmap.c | 49 ++++++++++++++++++++++++++++++------------------- 1 file changed, 30 insertions(+), 19 deletions(-) (limited to 'pixmap.c') diff --git a/pixmap.c b/pixmap.c index 48343cb..24a65be 100644 --- a/pixmap.c +++ b/pixmap.c @@ -1,4 +1,4 @@ -/* $Id: pixmap.c,v 1.2 2000/03/23 07:24:48 reinelt Exp $ +/* $Id: pixmap.c,v 1.3 2000/03/24 11:36:56 reinelt Exp $ * * generic pixmap driver * @@ -20,6 +20,12 @@ * * * $Log: pixmap.c,v $ + * Revision 1.3 2000/03/24 11:36:56 reinelt + * + * new syntax for raster configuration + * changed XRES and YRES to be configurable + * PPM driver works nice + * * Revision 1.2 2000/03/23 07:24:48 reinelt * * PPM driver up and running (but slow!) @@ -38,8 +44,8 @@ * int pix_clear(void); * clears the pixmap * - * int pix_init (int r, int c); - * allocates & clear pixmap wit r rows and c columns + * int pix_init (int rows, int cols, int XRES, int YRES); + * allocates & clears pixmap * * int pix_put (int row, int col, char *text); * draws text into the pixmap @@ -56,33 +62,38 @@ #include "pixmap.h" #include "fontmap.h" -static int rows=0; -static int cols=0; +static int ROWS=0; +static int COLS=0; +static int XRES=0; +static int YRES=0; + unsigned char *Pixmap=NULL; int pix_clear(void) { int i; - for (i=0; i>=1; - Pixmap[(row+y)*cols+col+x]=Fontmap[c][y]&mask?1:0; + Pixmap[(row+y)*COLS+col+x]=Fontmap[c][y]&mask?1:0; } } col+=XRES; @@ -118,11 +129,11 @@ int pix_bar (int type, int row, int col, int max, int len1, int len2) col*=XRES; if (type & BAR_H) { - if (max>cols-col) - max=cols-col; + if (max>COLS-col) + max=COLS-col; } else { - if (max>rows-row) - max=rows-row; + if (max>ROWS-row) + max=ROWS-row; } if (len1<1) len1=1; @@ -143,7 +154,7 @@ int pix_bar (int type, int row, int col, int max, int len1, int len2) for (y=0; y