notaz.gp2x.de
/
libpicofe.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
giz menu works
[libpicofe.git]
/
common
/
readpng.c
diff --git
a/gp2x/readpng.c
b/common/readpng.c
similarity index 76%
rename from
gp2x/readpng.c
rename to
common/readpng.c
index
a890e4e
..
2a74668
100644
(file)
--- a/
gp2x/readpng.c
+++ b/
common/readpng.c
@@
-2,6
+2,7
@@
#include <string.h>
#include <png.h>
#include "readpng.h"
#include <string.h>
#include <png.h>
#include "readpng.h"
+#include "lprintf.h"
void readpng(void *dest, const char *fname, readpng_what what)
{
void readpng(void *dest, const char *fname, readpng_what what)
{
@@
-18,14
+19,14
@@
void readpng(void *dest, const char *fname, readpng_what what)
fp = fopen(fname, "rb");
if (fp == NULL)
{
fp = fopen(fname, "rb");
if (fp == NULL)
{
- printf(__FILE__ ": failed to open: %s\n", fname);
+
l
printf(__FILE__ ": failed to open: %s\n", fname);
return;
}
png_ptr = png_create_read_struct(PNG_LIBPNG_VER_STRING, NULL, NULL, NULL);
if (!png_ptr)
{
return;
}
png_ptr = png_create_read_struct(PNG_LIBPNG_VER_STRING, NULL, NULL, NULL);
if (!png_ptr)
{
- printf(__FILE__ ": png_create_read_struct() failed\n");
+
l
printf(__FILE__ ": png_create_read_struct() failed\n");
fclose(fp);
return;
}
fclose(fp);
return;
}
@@
-33,7
+34,7
@@
void readpng(void *dest, const char *fname, readpng_what what)
info_ptr = png_create_info_struct(png_ptr);
if (!info_ptr)
{
info_ptr = png_create_info_struct(png_ptr);
if (!info_ptr)
{
- printf(__FILE__ ": png_create_info_struct() failed\n");
+
l
printf(__FILE__ ": png_create_info_struct() failed\n");
goto done;
}
goto done;
}
@@
-43,11
+44,11
@@
void readpng(void *dest, const char *fname, readpng_what what)
row_ptr = png_get_rows(png_ptr, info_ptr);
if (row_ptr == NULL)
{
row_ptr = png_get_rows(png_ptr, info_ptr);
if (row_ptr == NULL)
{
- printf(__FILE__ ": png_get_rows() failed\n");
+
l
printf(__FILE__ ": png_get_rows() failed\n");
goto done;
}
goto done;
}
- // printf("%s: %ix%i @ %ibpp\n", fname, (int)info_ptr->width, (int)info_ptr->height, info_ptr->pixel_depth);
+ //
l
printf("%s: %ix%i @ %ibpp\n", fname, (int)info_ptr->width, (int)info_ptr->height, info_ptr->pixel_depth);
switch (what)
{
switch (what)
{
@@
-57,7
+58,7
@@
void readpng(void *dest, const char *fname, readpng_what what)
unsigned short *dst = dest;
if (info_ptr->pixel_depth != 24)
{
unsigned short *dst = dest;
if (info_ptr->pixel_depth != 24)
{
- printf(__FILE__ ": bg image uses %ibpp, needed 24bpp\n", info_ptr->pixel_depth);
+
l
printf(__FILE__ ": bg image uses %ibpp, needed 24bpp\n", info_ptr->pixel_depth);
break;
}
height = info_ptr->height;
break;
}
height = info_ptr->height;
@@
-85,13
+86,13
@@
void readpng(void *dest, const char *fname, readpng_what what)
unsigned char *dst = dest;
if (info_ptr->width != 128 || info_ptr->height != 160)
{
unsigned char *dst = dest;
if (info_ptr->width != 128 || info_ptr->height != 160)
{
- printf(__FILE__ ": unexpected font image size %ix%i, needed 128x160\n",
+
l
printf(__FILE__ ": unexpected font image size %ix%i, needed 128x160\n",
(int)info_ptr->width, (int)info_ptr->height);
break;
}
if (info_ptr->pixel_depth != 8)
{
(int)info_ptr->width, (int)info_ptr->height);
break;
}
if (info_ptr->pixel_depth != 8)
{
- printf(__FILE__ ": font image uses %ibpp, needed 8bpp\n", info_ptr->pixel_depth);
+
l
printf(__FILE__ ": font image uses %ibpp, needed 8bpp\n", info_ptr->pixel_depth);
break;
}
for (y = 0; y < 16; y++)
break;
}
for (y = 0; y < 16; y++)
@@
-115,13
+116,13
@@
void readpng(void *dest, const char *fname, readpng_what what)
unsigned char *dst = dest;
if (info_ptr->width != 8 || info_ptr->height != 10)
{
unsigned char *dst = dest;
if (info_ptr->width != 8 || info_ptr->height != 10)
{
- printf(__FILE__ ": unexpected selector image size %ix%i, needed 8x10\n",
+
l
printf(__FILE__ ": unexpected selector image size %ix%i, needed 8x10\n",
(int)info_ptr->width, (int)info_ptr->height);
break;
}
if (info_ptr->pixel_depth != 8)
{
(int)info_ptr->width, (int)info_ptr->height);
break;
}
if (info_ptr->pixel_depth != 8)
{
- printf(__FILE__ ": selector image uses %ibpp, needed 8bpp\n", info_ptr->pixel_depth);
+
l
printf(__FILE__ ": selector image uses %ibpp, needed 8bpp\n", info_ptr->pixel_depth);
break;
}
for (y1 = 0; y1 < 10; y1++)
break;
}
for (y1 = 0; y1 < 10; y1++)