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.
pull/3/head
Daniel Richard G 2013-09-16 15:57:32 -04:00
parent 66315d5eea
commit 44a3981fbf
1 changed files with 2 additions and 2 deletions

View File

@ -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