From: Timothee 'TTimo' Besset Date: Sun, 6 May 2012 20:55:10 +0000 (-0500) Subject: dunno what happened there, someone brain farted hard X-Git-Tag: xonotic-v0.7.0~16^2^2~1 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=6476802ae87b1740b96a14514e265bc34a4314e1;p=xonotic%2Fnetradiant.git dunno what happened there, someone brain farted hard --- diff --git a/tools/quake3/q3map2/image.c b/tools/quake3/q3map2/image.c index d3b43633..2af46a6f 100644 --- a/tools/quake3/q3map2/image.c +++ b/tools/quake3/q3map2/image.c @@ -98,8 +98,7 @@ typedef struct pngBuffer_s { byte *buffer; int size, offset; -} -pngBuffer_t; +} pngBuffer_t; void PNGReadData( png_struct *png, png_byte *buffer, png_size_t size ){ pngBuffer_t *pb = (pngBuffer_t*) png_get_io_ptr( png ); @@ -123,7 +122,7 @@ void PNGReadData( png_struct *png, png_byte *buffer, png_size_t size ){ static void LoadPNGBuffer( byte *buffer, int size, byte **pixels, int *width, int *height ){ png_struct *png; png_info *info, *end; - pngBuffer_t *pb = (pngBuffer_t*) png_get_io_ptr( png ); + pngBuffer_t pb; int i, bitDepth, colorType, channels; png_uint_32 w, h; byte **rowPointers; @@ -166,11 +165,10 @@ static void LoadPNGBuffer( byte *buffer, int size, byte **pixels, int *width, in } /* set read callback */ - pb->buffer = buffer; - pb->size = size; - pb->offset = 0; - png_set_read_fn( png, &pb, PNGReadData ); - //png->io_ptr = &pb; /* hack! */ + pb.buffer = buffer; + pb.size = size; + pb.offset = 0; + png_set_read_fn( png, (void*)&pb, PNGReadData ); /* set error longjmp */ if ( setjmp( png_jmpbuf(png) ) ) {