--- src/RageSurface_Load_PNG.cpp.old	2005-10-01 05:32:44.000000000 +0200
+++ src/RageSurface_Load_PNG.cpp	2011-06-28 12:37:27.542730428 +0200
@@ -40,7 +40,7 @@
 void RageFile_png_read( png_struct *png, png_byte *p, png_size_t size )
 {
 	CHECKPOINT;
-	RageFile *f = (RageFile *) png->io_ptr;
+	RageFile *f = (RageFile *) png_get_io_ptr(png);
 
 	int got = f->Read( p, size );
 	if( got == -1 )
@@ -66,7 +66,7 @@
 void PNG_Error( png_struct *png, const char *error )
 {
 	CHECKPOINT;
-	error_info *info = (error_info *) png->error_ptr;
+	error_info *info = (error_info *) png_get_error_ptr(png);
 	strncpy( info->err, error, 1024 );
 	info->err[1023] = 0;
 	LOG->Trace( "loading \"%s\": err: %s", info->fn, info->err );
@@ -76,7 +76,7 @@
 void PNG_Warning( png_struct *png, const char *warning )
 {
 	CHECKPOINT;
-	error_info *info = (error_info *) png->error_ptr;
+	error_info *info = (error_info *) png_get_error_ptr(png);
 	LOG->Trace( "loading \"%s\": warning: %s", info->fn, warning );
 }
 
@@ -139,7 +139,7 @@
 
 	/* Expand grayscale images to the full 8 bits from 1, 2, or 4 bits/pixel */
 	if( color_type == PNG_COLOR_TYPE_GRAY && bit_depth < 8 )
-		png_set_gray_1_2_4_to_8( png );
+		png_set_expand_gray_1_2_4_to_8( png );
 
 	/* These are set for type == PALETTE. */
 	RageSurfaceColor colors[256];