88,13 → 88,13 |
/* open file and test for it being a png */ |
FILE *fp = fopen(file_name, "rb"); |
if (!fp) { |
cprintf("[read_png_file] File %s could not be opened for reading", file_name); |
cprintf("[read_png_file] File %s could not be opened for reading\n", file_name); |
sys_end(); |
} |
fread(header, 1, 8, fp); |
|
if (png_sig_cmp(header, 0, 8)) |
cprintf("[read_png_file] File %s is not recognized as a PNG file", file_name); |
cprintf("[read_png_file] File %s is not recognized as a PNG file\n", file_name); |
|
/* initialize stuff */ |
|
101,11 → 101,11 |
png_ptr = png_create_read_struct(PNG_LIBPNG_VER_STRING, NULL, NULL, NULL); |
|
if (!png_ptr) |
cprintf("[read_png_file] png_create_read_struct failed"); |
cprintf("[read_png_file] png_create_read_struct failed\n"); |
|
info_ptr = png_create_info_struct(png_ptr); |
if (!info_ptr) |
cprintf("[read_png_file] png_create_info_struct failed"); |
cprintf("[read_png_file] png_create_info_struct failed\n"); |
|
png_init_io(png_ptr, fp); |
png_set_sig_bytes(png_ptr, 8); |
393,8 → 393,7 |
} |
|
video_buf = vga_getgraphmem(); |
rgb_565_buf = malloc(RGB565MEM); |
|
|
grx_setbuffer(rgb_565_buf, WIDTH, HEIGHT); //Init of RGB16 version of grx functions |
//created to work with Mesa buffer |
return 0; |
508,16 → 507,16 |
k.ascii = 'c'; |
keyb_hook(k,program_key_end); |
} |
|
|
rgb_565_buf = malloc(RGB565MEM); |
|
gl_init(); |
|
if (screen(INITSTR)) { |
printk(KERN_INFO "Graphical initialization failed !!\n"); |
sys_end(); |
} |
|
memset(rgb_565_buf, 0, RGB565MEM); |
|
gl_init(); |
|
group_activate(1); |
|
return 0; |