summaryrefslogtreecommitdiffstats
path: root/minui
diff options
context:
space:
mode:
Diffstat (limited to 'minui')
-rw-r--r--minui/font_10x18.h2
-rw-r--r--minui/resources.c20
2 files changed, 11 insertions, 11 deletions
diff --git a/minui/font_10x18.h b/minui/font_10x18.h
index 7f96465cc..29d705344 100644
--- a/minui/font_10x18.h
+++ b/minui/font_10x18.h
@@ -3,7 +3,7 @@ struct {
unsigned height;
unsigned cwidth;
unsigned cheight;
- unsigned char rundata[];
+ unsigned char rundata[2973];
} font = {
.width = 960,
.height = 18,
diff --git a/minui/resources.c b/minui/resources.c
index a370b7108..c0a9ccacb 100644
--- a/minui/resources.c
+++ b/minui/resources.c
@@ -93,9 +93,13 @@ int res_create_surface(const char* name, gr_surface* pSurface) {
png_set_sig_bytes(png_ptr, sizeof(header));
png_read_info(png_ptr, info_ptr);
- int color_type = png_get_color_type(png_ptr, info_ptr);
- int bit_depth = png_get_bit_depth(png_ptr, info_ptr);
+ int color_type, bit_depth;
+ size_t width, height;
+ png_get_IHDR(png_ptr, info_ptr, &width, &height, &bit_depth,
+ &color_type, NULL, NULL, NULL);
+
int channels = png_get_channels(png_ptr, info_ptr);
+
if (!(bit_depth == 8 &&
((channels == 3 && color_type == PNG_COLOR_TYPE_RGB) ||
(channels == 4 && color_type == PNG_COLOR_TYPE_RGBA) ||
@@ -105,8 +109,6 @@ int res_create_surface(const char* name, gr_surface* pSurface) {
goto exit;
}
- size_t width = png_get_image_width(png_ptr, info_ptr);
- size_t height = png_get_image_height(png_ptr, info_ptr);
size_t stride = (color_type == PNG_COLOR_TYPE_GRAY ? 1 : 4) * width;
size_t pixelSize = stride * height;
@@ -246,12 +248,10 @@ int res_create_localized_surface(const char* name, gr_surface* pSurface) {
png_set_sig_bytes(png_ptr, sizeof(header));
png_read_info(png_ptr, info_ptr);
- size_t width = png_get_image_width(png_ptr, info_ptr);
- size_t height = png_get_image_height(png_ptr, info_ptr);
- size_t stride = 4 * width;
-
- int color_type = png_get_color_type(png_ptr, info_ptr);
- int bit_depth = png_get_bit_depth(png_ptr, info_ptr);
+ int color_type, bit_depth;
+ size_t width, height;
+ png_get_IHDR(png_ptr, info_ptr, &width, &height, &bit_depth,
+ &color_type, NULL, NULL, NULL);
int channels = png_get_channels(png_ptr, info_ptr);
if (!(bit_depth == 8 &&