From 44a3981fbf6d917ba7d38c80679f75e40a88adb4 Mon Sep 17 00:00:00 2001 From: Daniel Richard G Date: Mon, 16 Sep 2013 15:57:32 -0400 Subject: [PATCH] Use png_get_image_{width,height}() instead of info_ptr->{width,height} Later versions of libpng (1.5.x) have made the png_info structure opaque, breaking direct access to its fields. Fortunately, the library also provides getter routines, and these are available in the more-widely- deployed 1.2.x series. --- style.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/style.cpp b/style.cpp index a3754be6..c1908fa2 100644 --- a/style.cpp +++ b/style.cpp @@ -400,8 +400,8 @@ void TextWindow::ScreenBackgroundImage(int link, DWORD v) { png_read_png(png_ptr, info_ptr, PNG_TRANSFORM_EXPAND | PNG_TRANSFORM_STRIP_ALPHA, NULL); - int w; w = (int)info_ptr->width; - int h; h = (int)info_ptr->height; + int w; w = (int)png_get_image_width(png_ptr, info_ptr); + int h; h = (int)png_get_image_height(png_ptr, info_ptr); BYTE **rows; rows = png_get_rows(png_ptr, info_ptr); // Round to next-highest powers of two, since the textures require