From 1e72c8221210bbc24fd34d5cab75818193f2d962 Mon Sep 17 00:00:00 2001 From: jaseg Date: Fri, 10 Jan 2014 12:34:25 +0100 Subject: Working on gif handling. Not working yet. libgif does not yet read all parts of the file --- host/main.c | 69 +++++++++++++++++++++++++++++++++++++++++++++++-------------- 1 file changed, 54 insertions(+), 15 deletions(-) (limited to 'host/main.c') diff --git a/host/main.c b/host/main.c index 29e56f9..07a99dd 100644 --- a/host/main.c +++ b/host/main.c @@ -1,7 +1,8 @@ #include "main.h" -#include "font.h" #include "color.h" +#include "font.h" +#include "gif.h" #include #include #include @@ -345,34 +346,72 @@ void console_render_buffer(framebuffer_t *fb){ } int main(int argc, char **argv){ - if(argc < 2){ - fprintf(stderr, "No input text given\n"); + if(argc != 2){ + fprintf(stderr, "No or too much input text given\n"); return 1; } - FILE *f = fopen("unifont.bdf", "r"); - if(!f){ + FILE *fontfile = fopen("unifont.bdf", "r"); + if(!fontfile){ fprintf(stderr, "Error opening font file: %s\n", strerror(errno)); return 1; } glyph_t* glyph_table[BLP_SIZE]; - if(read_bdf(f, glyph_table, BLP_SIZE)){ + if(read_bdf(fontfile, glyph_table, BLP_SIZE)){ fprintf(stderr, "Error reading font file.\n"); return 1; } + fclose(fontfile); - for(;;){ - printf("\033[2J"); - for(unsigned int i=1; i