[BACK]Return to patch-src_MakeData_cpp CVS log [TXT][DIR] Up to [local] / ports / games / motogt / patches

File: [local] / ports / games / motogt / patches / patch-src_MakeData_cpp (download)

Revision 1.1, Thu Oct 27 16:52:06 2011 UTC (12 years, 6 months ago) by yason
Branch point for: MAIN

Initial revision

$OpenBSD$
--- src/MakeData.cpp.orig	Thu Oct 27 20:05:40 2011
+++ src/MakeData.cpp	Thu Oct 27 20:09:28 2011
@@ -109,10 +109,10 @@ struct PngFile {
 		
 		png_read_info(png_ptr, info_ptr);
 		
-		width = info_ptr->width;
-		height = info_ptr->height;
-		color_type = info_ptr->color_type;
-		bit_depth = info_ptr->bit_depth;
+		int width = png_get_image_width(png_ptr, info_ptr);
+		height = png_get_image_height(png_ptr, info_ptr);
+		color_type = png_get_color_type(png_ptr, info_ptr);
+		bit_depth = png_get_bit_depth(png_ptr, info_ptr);
 		
 		number_of_passes = png_set_interlace_handling(png_ptr);
 		png_read_update_info(png_ptr, info_ptr);
@@ -125,7 +125,7 @@ struct PngFile {
 		
 		row_pointers = (png_bytep*) malloc(sizeof(png_bytep) * height);
 		for (int y=0; y<height; y++)
-			row_pointers[y] = (png_byte*) malloc(info_ptr->rowbytes);
+			row_pointers[y] = (png_byte*) malloc(png_get_rowbytes(png_ptr, info_ptr));
 		
 		png_read_image(png_ptr, row_pointers);