Doc fixes.
[bertos.git] / drv / lcd_gfx_test.c
old mode 100755 (executable)
new mode 100644 (file)
index d86c393..121555f
@@ -1,8 +1,33 @@
 /**
  * \file
  * <!--
+ * This file is part of BeRTOS.
+ *
+ * Bertos is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ *
+ * As a special exception, you may use this file as part of a free software
+ * library without restriction.  Specifically, if other files instantiate
+ * templates or use macros or inline functions from this file, or you compile
+ * this file and link it with other files to produce an executable, this
+ * file does not by itself cause the resulting executable to be covered by
+ * the GNU General Public License.  This exception does not however
+ * invalidate any other reasons why the executable file might be covered by
+ * the GNU General Public License.
+ *
  * Copyright 2006 Develer S.r.l. (http://www.develer.com/)
- * This file is part of DevLib - See README.devlib for information.
+ *
  * -->
  *
  * \version $Id$
@@ -14,6 +39,9 @@
 
 /*#*
  *#* $Log$
+ *#* Revision 1.3  2006/01/17 23:00:26  bernie
+ *#* Don't use hardcoded coordinates.
+ *#*
  *#* Revision 1.2  2006/01/17 02:31:57  bernie
  *#* Test gfx with the usual pentagons.
  *#*
@@ -43,24 +71,26 @@ int main(int argc, char *argv[])
 
        coord_t x = 0, y = LCD_WIDTH / 2;
        coord_t xdir = +1, ydir = -1;
+       Bitmap *bm = &lcd_bitmap;
 
        for(;;)
        {
-               gfx_bitmapClear(&lcd_bitmap);
-               gfx_rectDraw(&lcd_bitmap, 10, 10, LCD_WIDTH-10, LCD_HEIGHT-10);
-               gfx_setClipRect(&lcd_bitmap, 10, 10, LCD_WIDTH-10, LCD_HEIGHT-10);
-               magic(&lcd_bitmap, x, y);
+               gfx_bitmapClear(bm);
+               gfx_setClipRect(bm, 0, 0, bm->width, bm->height);
+               gfx_rectDraw(bm, 10, 10, bm->width-10, bm->height-10);
+               gfx_setClipRect(bm, 11, 11, bm->width-11, bm->height-11);
+               magic(bm, x, y);
 
                x += xdir;
                y += ydir;
-               if (x >= LCD_WIDTH)  xdir = -1;
+               if (x >= bm->width)  xdir = -1;
                if (x <= -50)        xdir = +1;
-               if (y >= LCD_HEIGHT) ydir = -1;
+               if (y >= bm->height) ydir = -1;
                if (y <= -50)        ydir = +1;
 
-               lcd_blit_bitmap(&lcd_bitmap);
+               lcd_blit_bitmap(bm);
                emul_idle();
-               usleep(100);
+               usleep(10000);
        }
 
        emul_cleanup();