X-Git-Url: https://de.git.xonotic.org/?p=xonotic%2Fnetradiant.git;a=blobdiff_plain;f=tools%2Fquake3%2Fq3map2%2Fimage.c;h=5ab1d48b1c1a4799b295564851401d751a93a6e0;hp=bb6a52563206a2e65bc92ae1551e05611e8d25c3;hb=7fc621fc78d0e040dc2c12f38dc53dd9048215dc;hpb=e4287c28bb2dafedc81c66e63951d947cfbeb225 diff --git a/tools/quake3/q3map2/image.c b/tools/quake3/q3map2/image.c index bb6a5256..5ab1d48b 100644 --- a/tools/quake3/q3map2/image.c +++ b/tools/quake3/q3map2/image.c @@ -98,8 +98,7 @@ typedef struct pngBuffer_s { byte *buffer; png_size_t 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 ); @@ -124,11 +123,11 @@ static void LoadPNGBuffer( byte *buffer, int size, byte **pixels, int *width, in png_struct *png; png_info *info, *end; pngBuffer_t pb; + //pngBuffer_t *pb = (pngBuffer_t*) png_get_io_ptr( png ); int bitDepth, colorType; png_uint_32 w, h, i; byte **rowPointers; - /* dummy check */ if ( buffer == NULL || size <= 0 || pixels == NULL || width == NULL || height == NULL ) { return; @@ -171,9 +170,10 @@ static void LoadPNGBuffer( byte *buffer, int size, byte **pixels, int *width, in pb.size = size; pb.offset = 0; png_set_read_fn( png, &pb, PNGReadData ); + //png->io_ptr = &pb; /* hack! */ /* set error longjmp */ - if ( setjmp( png_jmpbuf( png ) ) ) { + if ( setjmp( png_jmpbuf(png) ) ) { Sys_Printf( "WARNING: An error occurred reading PNG image\n" ); png_destroy_read_struct( &png, &info, &end ); return;