X-Git-Url: http://git.mutantstargoat.com?a=blobdiff_plain;f=src%2Fgfx.cc;h=87b5939e7cde8ba15a14b926935b063eb6e65a6d;hb=ffd2c0a0f8b898cb4199a0c63aff255a85cc0f11;hp=54ed7f96a757d847ba852e93871e4dd02563b851;hpb=0860ce537422597075fbc63ddcc9a73303362a93;p=winnie diff --git a/src/gfx.cc b/src/gfx.cc index 54ed7f9..87b5939 100644 --- a/src/gfx.cc +++ b/src/gfx.cc @@ -14,7 +14,7 @@ #define FRAMEBUFFER_SIZE(xsz, ysz, bpp) ((xsz) * (ysz) * (bpp) / CHAR_BIT) -static unsigned char* framebuffer; +static unsigned char *framebuffer; static int dev_fd = -1; static Rect screen_rect; @@ -58,6 +58,7 @@ bool init_gfx() void destroy_gfx() { + clear_screen(0, 0, 0); close(dev_fd); dev_fd = -1; @@ -65,7 +66,7 @@ void destroy_gfx() framebuffer = 0; } -unsigned char* get_framebuffer() +unsigned char *get_framebuffer() { return framebuffer; } @@ -82,12 +83,19 @@ int get_color_depth() void clear_screen(int r, int g, int b) { - unsigned char* fb = framebuffer; - for(int i=0; i