aboutsummaryrefslogtreecommitdiffstats
path: root/pixmap.c
diff options
context:
space:
mode:
authorreinelt <>2003-09-10 14:01:53 +0000
committerreinelt <>2003-09-10 14:01:53 +0000
commit5146eb2377a9001f52d3d84a5f0bbf3bb1f48f61 (patch)
treeec9c18875187b83f745ddd264b4f1ca66848a5c1 /pixmap.c
parent8f51f05f631c06c4f8f7c87ac0047827210f44ad (diff)
downloadlcd4linux-5146eb2377a9001f52d3d84a5f0bbf3bb1f48f61.tar.gz
[lcd4linux @ 2003-09-10 14:01:52 by reinelt]
icons nearly finished\!
Diffstat (limited to 'pixmap.c')
-rw-r--r--pixmap.c39
1 files changed, 38 insertions, 1 deletions
diff --git a/pixmap.c b/pixmap.c
index 26f3b2f..8cd086e 100644
--- a/pixmap.c
+++ b/pixmap.c
@@ -1,4 +1,4 @@
-/* $Id: pixmap.c,v 1.10 2002/08/19 04:41:20 reinelt Exp $
+/* $Id: pixmap.c,v 1.11 2003/09/10 14:01:53 reinelt Exp $
*
* generic pixmap driver
*
@@ -20,6 +20,9 @@
*
*
* $Log: pixmap.c,v $
+ * Revision 1.11 2003/09/10 14:01:53 reinelt
+ * icons nearly finished\!
+ *
* Revision 1.10 2002/08/19 04:41:20 reinelt
* introduced bar.c, moved bar stuff from display.h to bar.h
*
@@ -84,14 +87,19 @@
* int pix_bar (int type, int row, int col, int max, int len1, int len2);
* draws a bar into the pixmap
*
+ * void pix_icon (int ascii, char *buffer)
+ * used as the "define char" function for icons
+ *
*/
+
#include <stdlib.h>
#include <stdio.h>
#include <time.h>
#include "display.h"
#include "bar.h"
+#include "icon.h"
#include "pixmap.h"
#include "fontmap.h"
#include "debug.h"
@@ -103,6 +111,7 @@ static int YRES=0;
unsigned char *LCDpixmap=NULL;
+
int pix_clear(void)
{
int i;
@@ -114,6 +123,7 @@ int pix_clear(void)
return 0;
}
+
int pix_init (int rows, int cols, int xres, int yres)
{
if (rows<1 || cols<1 || xres<1 || yres<1)
@@ -133,6 +143,7 @@ int pix_init (int rows, int cols, int xres, int yres)
return pix_clear();
}
+
int pix_put (int row, int col, char *text)
{
int c, x, y, mask;
@@ -157,6 +168,7 @@ int pix_put (int row, int col, char *text)
return 0;
}
+
#define N_BAR_T 10
int pix_bar (int type, int row, int col, int max, int len1, int len2)
@@ -273,3 +285,28 @@ int pix_bar (int type, int row, int col, int max, int len1, int len2)
return 0;
}
+
+void pix_icon (int ascii, char *buffer)
+{
+ // we have to peek the whole screen for this particular icon,
+ // and render it again
+
+ int row, col;
+ int x, y, mask;
+ int c;
+
+ for (row=0; row<ROWS/YRES; row++) {
+ for (col=0; col<COLS/XRES; col++) {
+ c=icon_peek(row, col);
+ if (c!=ascii) continue;
+ for (y=0; y<YRES; y++) {
+ mask=1<<XRES;
+ for (x=0; x<XRES; x++) {
+ mask>>=1;
+ LCDpixmap[(row*YRES+y)*COLS+col*XRES+x]=buffer[y]&mask?1:0;
+ }
+ }
+ }
+ }
+
+}