]> git.karo-electronics.de Git - oswald.git/blobdiff - ui/oswald_graphics.c
Bluetooth handling, screen reworks for icons
[oswald.git] / ui / oswald_graphics.c
index a6eb14f9dfd50191705b71c4c4d0e3198f4a8e55..304aa7af6154c31939ac6c1322781a7815c2b93e 100644 (file)
@@ -5,21 +5,26 @@
 #include "oswald_graphics.h"
 
 
 #include "oswald_graphics.h"
 
 
+#if 0
 void oswald_draw_bitmap(const uint8_t xstart, const uint8_t ystart, const uint8_t width, const uint8_t height, const void *bmp)
 {
        uint8_t x, y;
 void oswald_draw_bitmap(const uint8_t xstart, const uint8_t ystart, const uint8_t width, const uint8_t height, const void *bmp)
 {
        uint8_t x, y;
+       uint8_t *cb;
 
        // we only draw set pixel, unset pixel remain as they are
        for (y=0; y<height; y++) {
                for (x=0; x<width; x++) {
 
        // we only draw set pixel, unset pixel remain as they are
        for (y=0; y<height; y++) {
                for (x=0; x<width; x++) {
-                       hal_lcd_set_pixel(x, y, TRUE);
+                       cb = (uint8_t *)(bmp + (y * ((width / 8)+((width % 8) ? 1:0))) + (x / 8));
+                       if (*cb & (1 << (x % 8)))
+                               hal_lcd_set_pixel(xstart + x, ystart + y, TRUE);
                }
        }
 }
                }
        }
 }
+#endif
 
 void oswald_draw_Line(uint8_t xstart, uint8_t ystart, uint8_t xend, uint8_t yend)
 {
 
 void oswald_draw_Line(uint8_t xstart, uint8_t ystart, uint8_t xend, uint8_t yend)
 {
-       int x, y, t, dx, dy, incx, incy, pdx, pdy, ddx, ddy, es, el, err;
+       uint8_t x, y, t, dx, dy, incx, incy, pdx, pdy, ddx, ddy, es, el, err;
  
        dx = xend - xstart;
        dy = yend - ystart;
  
        dx = xend - xstart;
        dy = yend - ystart;