Another animation (circle). Comments welcome :)

This commit is contained in:
bsongis
2011-11-26 16:02:46 +00:00
parent 2ec3769bb5
commit e0cdbb8294
3 changed files with 19 additions and 5 deletions
+5 -2
View File
@@ -292,9 +292,10 @@ void lcd_plot(uint8_t x,uint8_t y, uint8_t att)
lcd_mask(p, BITMASK(y%8), att);
}
void lcd_hlineStip(int8_t x, uint8_t y, uint8_t w, uint8_t pat, uint8_t att)
void lcd_hlineStip(int8_t x, uint8_t y, int8_t w, uint8_t pat, uint8_t att)
{
if (y >= DISPLAY_H) return;
if (w<0) { x+=w; w=-w; }
if (x<0) { w+=x; x=0; }
if (x+w > DISPLAY_W) { w = DISPLAY_W - x; }
@@ -313,13 +314,15 @@ void lcd_hlineStip(int8_t x, uint8_t y, uint8_t w, uint8_t pat, uint8_t att)
}
}
void lcd_hline(uint8_t x,uint8_t y, uint8_t w, uint8_t att)
void lcd_hline(uint8_t x,uint8_t y, int8_t w, uint8_t att)
{
lcd_hlineStip(x, y, w, 0xff, att);
}
void lcd_vlineStip(uint8_t x, int8_t y, int8_t h, uint8_t pat)
{
if (x >= DISPLAY_W) return;
if (h<0) { y+=h; h=-h; }
if (y<0) { h+=y; y=0; }
if (y+h > DISPLAY_H) { h = DISPLAY_H - y; }