forked from len0rd/rockbox
made lcd_invertrect() working
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@1644 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
6985f34beb
commit
e67db77d6a
2 changed files with 11 additions and 2 deletions
|
|
@ -910,9 +910,17 @@ void lcd_fillrect (int x, int y, int nx, int ny)
|
||||||
/* Invert a rectangular area at (x, y), size (nx, ny) */
|
/* Invert a rectangular area at (x, y), size (nx, ny) */
|
||||||
void lcd_invertrect (int x, int y, int nx, int ny)
|
void lcd_invertrect (int x, int y, int nx, int ny)
|
||||||
{
|
{
|
||||||
int i;
|
int i,j;
|
||||||
|
|
||||||
|
if (x>LCD_WIDTH) return;
|
||||||
|
if (y>LCD_HEIGHT) return;
|
||||||
|
|
||||||
|
if (x+nx>LCD_WIDTH) nx=LCD_WIDTH-x;
|
||||||
|
if (y+ny>LCD_HEIGHT) ny=LCD_HEIGHT-y;
|
||||||
|
|
||||||
for (i = 0; i < nx; i++)
|
for (i = 0; i < nx; i++)
|
||||||
lcd_bitmap (ones, x+i, y, 1, ny, false);
|
for (j = 0; j < ny; j++)
|
||||||
|
INVERT_PIXEL((x+i),(y+j));
|
||||||
}
|
}
|
||||||
|
|
||||||
void lcd_drawline( int x1, int y1, int x2, int y2 )
|
void lcd_drawline( int x1, int y1, int x2, int y2 )
|
||||||
|
|
|
||||||
|
|
@ -79,6 +79,7 @@ extern void lcd_double_height (bool on);
|
||||||
|
|
||||||
#define DRAW_PIXEL(x,y) lcd_framebuffer[x][y/8] |= (1<<(y&7))
|
#define DRAW_PIXEL(x,y) lcd_framebuffer[x][y/8] |= (1<<(y&7))
|
||||||
#define CLEAR_PIXEL(x,y) lcd_framebuffer[x][y/8] &= ~(1<<(y&7))
|
#define CLEAR_PIXEL(x,y) lcd_framebuffer[x][y/8] &= ~(1<<(y&7))
|
||||||
|
#define INVERT_PIXEL(x,y) lcd_framebuffer[x][y/8] ^= (1<<(y&7))
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Memory copy of display bitmap
|
* Memory copy of display bitmap
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue