Don't try to put pixel off-screen
This commit is contained in:
parent
fadccef0df
commit
086eba4ea4
1 changed files with 1 additions and 0 deletions
|
@ -19,5 +19,6 @@ void initfb(unsigned long addr, unsigned short w, unsigned short h, unsigned cha
|
||||||
}
|
}
|
||||||
|
|
||||||
void putpixel(unsigned short x, unsigned short y, unsigned char r, unsigned char g, unsigned char b, unsigned char a) {
|
void putpixel(unsigned short x, unsigned short y, unsigned char r, unsigned char g, unsigned char b, unsigned char a) {
|
||||||
|
if (x>fb_width || y> fb_height) return;
|
||||||
*((unsigned long *)(fb_address + y*fb_pitch + x*fb_bytespp)) = r<<fb_rpos | g<<fb_gpos | b<<fb_bpos;
|
*((unsigned long *)(fb_address + y*fb_pitch + x*fb_bytespp)) = r<<fb_rpos | g<<fb_gpos | b<<fb_bpos;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue