From 865a7f3b947c32ceefc63dc3d4112b51d7e9991c Mon Sep 17 00:00:00 2001
From: reinelt <reinelt@3ae390bd-cb1e-0410-b409-cd5a39f66f1f>
Date: Wed, 22 Oct 2003 04:32:25 +0000
Subject: [lcd4linux @ 2003-10-22 04:32:25 by reinelt] fixed icon bug found by
 Rob van Nieuwkerk

git-svn-id: https://ssl.bulix.org/svn/lcd4linux/trunk@268 3ae390bd-cb1e-0410-b409-cd5a39f66f1f
---
 XWindow.c |  9 +++++++--
 icon.c    | 13 +++++++++++--
 2 files changed, 18 insertions(+), 4 deletions(-)

diff --git a/XWindow.c b/XWindow.c
index c8e9caf..d186964 100644
--- a/XWindow.c
+++ b/XWindow.c
@@ -1,4 +1,4 @@
-/* $Id: XWindow.c,v 1.35 2003/10/05 17:58:50 reinelt Exp $
+/* $Id: XWindow.c,v 1.36 2003/10/22 04:32:25 reinelt Exp $
  *
  * X11 Driver for LCD4Linux 
  *
@@ -22,6 +22,9 @@
  *
  *
  * $Log: XWindow.c,v $
+ * Revision 1.36  2003/10/22 04:32:25  reinelt
+ * fixed icon bug found by Rob van Nieuwkerk
+ *
  * Revision 1.35  2003/10/05 17:58:50  reinelt
  * libtool junk; copyright messages cleaned up
  *
@@ -464,7 +467,9 @@ int xlcdinit(LCD *Self)
 
 int xlcdclear(int full) 
 {
-  return pix_clear();
+  icon_clear();
+  pix_clear();
+  return 0;
 }
 
 
diff --git a/icon.c b/icon.c
index 1fc5d78..cce5ab0 100644
--- a/icon.c
+++ b/icon.c
@@ -1,4 +1,4 @@
-/* $Id: icon.c,v 1.10 2003/10/22 04:19:16 reinelt Exp $
+/* $Id: icon.c,v 1.11 2003/10/22 04:32:25 reinelt Exp $
  *
  * generic icon and heartbeat handling
  *
@@ -22,6 +22,9 @@
  *
  *
  * $Log: icon.c,v $
+ * Revision 1.11  2003/10/22 04:32:25  reinelt
+ * fixed icon bug found by Rob van Nieuwkerk
+ *
  * Revision 1.10  2003/10/22 04:19:16  reinelt
  * Makefile.in for imon.c/.h, some MatrixOrbital clients
  *
@@ -170,7 +173,7 @@ int icon_init (int rows, int cols, int xres, int yres, int chars, int icons,
 
   for (n=0; n<icons; n++) {
     Bitmap[n].nData=1;
-    Bitmap[n].lData=0;
+    Bitmap[n].lData=-1;
     Bitmap[n].Data=malloc(YRES*sizeof(char));
     memset (Bitmap[n].Data, 0, YRES*sizeof(char));
     icon_read_bitmap(n);
@@ -186,10 +189,16 @@ void icon_clear(void)
 {
   int n;
 
+  // reset screen buffer
   for (n=0; n<ROWS*COLS; n++) {
     Screen[n]=-1;
   }
 
+  // reset last bitmap pointer
+  for (n=0; n<ICONS; n++) {
+    Bitmap[n].lData=-1;
+  }
+
 }
 
 
-- 
cgit v1.2.3