From: Rudolf Polzer Date: Thu, 12 Apr 2012 13:32:57 +0000 (+0200) Subject: Merge remote-tracking branch 'ttimo/master' X-Git-Tag: xonotic-v0.7.0~16^2~3 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=62d99f889c0e98be65f779d3983109c84ce58cec;p=xonotic%2Fnetradiant.git Merge remote-tracking branch 'ttimo/master' Conflicts: plugins/imagepng/plugin.cpp radiant/gtkdlgs.cpp radiant/radiant.ico tools/quake3/q3map2/image.c --- 62d99f889c0e98be65f779d3983109c84ce58cec diff --cc plugins/imagepng/plugin.cpp index e46b7065,784500f8..bf087416 --- a/plugins/imagepng/plugin.cpp +++ b/plugins/imagepng/plugin.cpp @@@ -38,8 -103,8 +38,8 @@@ void user_warning_fn( png_structp png_p } void user_error_fn( png_structp png_ptr, png_const_charp error_msg ){ - g_FuncTable.m_pfnSysPrintf( "libpng error: %s\n", error_msg ); + globalErrorStream() << "libpng error: " << error_msg << "\n"; - longjmp( png_jmpbuf( png_ptr ), 0 ); + longjmp( png_jmpbuf(png_ptr), 0 ); } void user_read_data( png_structp png_ptr, png_bytep data, png_uint_32 length ){ @@@ -82,12 -153,16 +82,12 @@@ Image* LoadPNGBuff( unsigned char* fbuf } // configure the read function - png_set_read_fn( png_ptr, ( void * ) & p_fbuffer, ( png_rw_ptr ) & user_read_data ); + png_set_read_fn( png_ptr, ( png_voidp ) & p_fbuffer, ( png_rw_ptr ) & user_read_data ); - if ( setjmp( png_jmpbuf( png_ptr ) ) ) { + if ( setjmp( png_jmpbuf(png_ptr) ) ) { png_destroy_read_struct( &png_ptr, &info_ptr, &end_info ); - if ( *pic ) { - g_free( *pic ); - free( row_pointers ); - } - return; + return 0; } png_read_info( png_ptr, info_ptr ); diff --cc tools/quake3/q3map2/image.c index bb6a5256,d3b43633..ad782124 --- a/tools/quake3/q3map2/image.c +++ b/tools/quake3/q3map2/image.c @@@ -123,12 -123,11 +123,12 @@@ void PNGReadData( png_struct *png, png_ 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 ); - int i, bitDepth, colorType, channels; - png_uint_32 w, h; + 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;