Commit 1a9319e8 authored by wind2009's avatar wind2009

Merge branch 'master' of https://github.com/mercury233/irrlicht

parents 0e7ef4a0 b00b64f1
Pipeline #36419 passed with stages
in 4 minutes and 53 seconds
...@@ -4,3 +4,4 @@ ...@@ -4,3 +4,4 @@
/source/Irrlicht/MacOSX/MacOSX.xcodeproj/xcuserdata /source/Irrlicht/MacOSX/MacOSX.xcodeproj/xcuserdata
/bin/MacOSX /bin/MacOSX
/irrlicht.patch /irrlicht.patch
/premake*.lua
...@@ -89,7 +89,7 @@ namespace irr ...@@ -89,7 +89,7 @@ namespace irr
KEY_KEY_X = 0x58, // X key KEY_KEY_X = 0x58, // X key
KEY_KEY_Y = 0x59, // Y key KEY_KEY_Y = 0x59, // Y key
KEY_KEY_Z = 0x5A, // Z key KEY_KEY_Z = 0x5A, // Z key
KEY_LWIN = 0x5B, // Left Windows key (Microsoft Natural keyboard) KEY_LWIN = 0x5B, // Left Windows key (Microsoft® Natural® keyboard)
KEY_RWIN = 0x5C, // Right Windows key (Natural keyboard) KEY_RWIN = 0x5C, // Right Windows key (Natural keyboard)
KEY_APPS = 0x5D, // Applications key (Natural keyboard) KEY_APPS = 0x5D, // Applications key (Natural keyboard)
KEY_SLEEP = 0x5F, // Computer Sleep key KEY_SLEEP = 0x5F, // Computer Sleep key
......
...@@ -444,7 +444,7 @@ namespace video ...@@ -444,7 +444,7 @@ namespace video
} }
//! color in A8R8G8B8 Format //! color in A8R8G8B8 Format
u32 color; u32 color{};
}; };
......
...@@ -71,10 +71,13 @@ namespace video ...@@ -71,10 +71,13 @@ namespace video
//! Destructor //! Destructor
~SMaterialLayer() ~SMaterialLayer()
{
if(TextureMatrix)
{ {
MatrixAllocator.destruct(TextureMatrix); MatrixAllocator.destruct(TextureMatrix);
MatrixAllocator.deallocate(TextureMatrix); MatrixAllocator.deallocate(TextureMatrix);
} }
}
//! Assignment operator //! Assignment operator
/** \param other Material layer to copy from. /** \param other Material layer to copy from.
......
...@@ -165,7 +165,7 @@ void CColorConverter::convert8BitTo32Bit(const u8* in, u8* out, s32 width, s32 h ...@@ -165,7 +165,7 @@ void CColorConverter::convert8BitTo32Bit(const u8* in, u8* out, s32 width, s32 h
out += lineWidth * height; out += lineWidth * height;
u32 x; u32 x;
register u32 c; u32 c;
for (u32 y=0; y < (u32) height; ++y) for (u32 y=0; y < (u32) height; ++y)
{ {
if (flip) if (flip)
......
...@@ -24,9 +24,9 @@ namespace video ...@@ -24,9 +24,9 @@ namespace video
"; c0-3: Transposed world matrix \n"\ "; c0-3: Transposed world matrix \n"\
"; c8-11: Transposed worldViewProj matrix (Projection * View * World) \n"\ "; c8-11: Transposed worldViewProj matrix (Projection * View * World) \n"\
"; c12: Light01 position \n"\ "; c12: Light01 position \n"\
"; c13: x,y,z: Light01 color; .w: 1/LightRadius \n"\ "; c13: x,y,z: Light01 color; .w: 1/LightRadius² \n"\
"; c14: Light02 position \n"\ "; c14: Light02 position \n"\
"; c15: x,y,z: Light02 color; .w: 1/LightRadius \n"\ "; c15: x,y,z: Light02 color; .w: 1/LightRadius² \n"\
"\n"\ "\n"\
"; v0 - position \n"\ "; v0 - position \n"\
"; v1 - normal \n"\ "; v1 - normal \n"\
...@@ -65,13 +65,13 @@ namespace video ...@@ -65,13 +65,13 @@ namespace video
"mad oT3.xyz, r9.xyz, c95, c95 ; move light vector 2 from -1..1 into 0..1 \n"\ "mad oT3.xyz, r9.xyz, c95, c95 ; move light vector 2 from -1..1 into 0..1 \n"\
"\n"\ "\n"\
" ; calculate attenuation of light 1 \n"\ " ; calculate attenuation of light 1 \n"\
"dp3 r2.x, r2.xyz, r2.xyz ; r2.x = r2.x + r2.y + r2.z \n"\ "dp3 r2.x, r2.xyz, r2.xyz ; r2.x = r2.x² + r2.y² + r2.z² \n"\
"mul r2.x, r2.x, c13.w ; r2.x * attenutation \n"\ "mul r2.x, r2.x, c13.w ; r2.x * attenutation \n"\
"rsq r2, r2.x ; r2.xyzw = 1/sqrt(r2.x * attenutation)\n"\ "rsq r2, r2.x ; r2.xyzw = 1/sqrt(r2.x * attenutation)\n"\
"mul oD0, r2, c13 ; resulting light color = lightcolor * attenuation \n"\ "mul oD0, r2, c13 ; resulting light color = lightcolor * attenuation \n"\
"\n"\ "\n"\
" ; calculate attenuation of light 2 \n"\ " ; calculate attenuation of light 2 \n"\
"dp3 r3.x, r3.xyz, r3.xyz ; r3.x = r3.x + r3.y + r3.z \n"\ "dp3 r3.x, r3.xyz, r3.xyz ; r3.x = r3.x² + r3.y² + r3.z² \n"\
"mul r3.x, r3.x, c15.w ; r2.x * attenutation \n"\ "mul r3.x, r3.x, c15.w ; r2.x * attenutation \n"\
"rsq r3, r3.x ; r2.xyzw = 1/sqrt(r2.x * attenutation)\n"\ "rsq r3, r3.x ; r2.xyzw = 1/sqrt(r2.x * attenutation)\n"\
"mul oD1, r3, c15 ; resulting light color = lightcolor * attenuation \n"\ "mul oD1, r3, c15 ; resulting light color = lightcolor * attenuation \n"\
......
...@@ -24,9 +24,9 @@ namespace video ...@@ -24,9 +24,9 @@ namespace video
"; c4: Eye position \n"\ "; c4: Eye position \n"\
"; c8-11: Transposed worldViewProj matrix (Projection * View * World) \n"\ "; c8-11: Transposed worldViewProj matrix (Projection * View * World) \n"\
"; c12: Light01 position \n"\ "; c12: Light01 position \n"\
"; c13: x,y,z: Light01 color; .w: 1/LightRadius \n"\ "; c13: x,y,z: Light01 color; .w: 1/LightRadius² \n"\
"; c14: Light02 position \n"\ "; c14: Light02 position \n"\
"; c15: x,y,z: Light02 color; .w: 1/LightRadius \n"\ "; c15: x,y,z: Light02 color; .w: 1/LightRadius² \n"\
"vs.1.1\n"\ "vs.1.1\n"\
"; v0 ; position \n"\ "; v0 ; position \n"\
"; v1 ; normal \n"\ "; v1 ; normal \n"\
...@@ -78,13 +78,13 @@ namespace video ...@@ -78,13 +78,13 @@ namespace video
"mad oT4.xyz, r10.xyz, c95, c95 ; move eye vector from -1..1 into 0..1 \n"\ "mad oT4.xyz, r10.xyz, c95, c95 ; move eye vector from -1..1 into 0..1 \n"\
"\n"\ "\n"\
" ; calculate attenuation of light 1 \n"\ " ; calculate attenuation of light 1 \n"\
"dp3 r2.x, r2.xyz, r2.xyz ; r2.x = r2.x + r2.y + r2.z \n"\ "dp3 r2.x, r2.xyz, r2.xyz ; r2.x = r2.x² + r2.y² + r2.z² \n"\
"mul r2.x, r2.x, c13.w ; r2.x * attenutation \n"\ "mul r2.x, r2.x, c13.w ; r2.x * attenutation \n"\
"rsq r2, r2.x ; r2.xyzw = 1/sqrt(r2.x * attenutation)\n"\ "rsq r2, r2.x ; r2.xyzw = 1/sqrt(r2.x * attenutation)\n"\
"mul oD0, r2, c13 ; resulting light color = lightcolor * attenuation \n"\ "mul oD0, r2, c13 ; resulting light color = lightcolor * attenuation \n"\
"\n"\ "\n"\
" ; calculate attenuation of light 2 \n"\ " ; calculate attenuation of light 2 \n"\
"dp3 r3.x, r3.xyz, r3.xyz ; r3.x = r3.x + r3.y + r3.z \n"\ "dp3 r3.x, r3.xyz, r3.xyz ; r3.x = r3.x² + r3.y² + r3.z² \n"\
"mul r3.x, r3.x, c15.w ; r2.x * attenutation \n"\ "mul r3.x, r3.x, c15.w ; r2.x * attenutation \n"\
"rsq r3, r3.x ; r2.xyzw = 1/sqrt(r2.x * attenutation)\n"\ "rsq r3, r3.x ; r2.xyzw = 1/sqrt(r2.x * attenutation)\n"\
"mul oD1, r3, c15 ; resulting light color = lightcolor * attenuation \n"\ "mul oD1, r3, c15 ; resulting light color = lightcolor * attenuation \n"\
......
...@@ -24,9 +24,9 @@ namespace video ...@@ -24,9 +24,9 @@ namespace video
"; c0-3: Transposed world matrix \n"\ "; c0-3: Transposed world matrix \n"\
"; c8-11: Transposed worldViewProj matrix (Projection * View * World) \n"\ "; c8-11: Transposed worldViewProj matrix (Projection * View * World) \n"\
"; c12: Light01 position \n"\ "; c12: Light01 position \n"\
"; c13: x,y,z: Light01 color; .w: 1/LightRadius \n"\ "; c13: x,y,z: Light01 color; .w: 1/LightRadius² \n"\
"; c14: Light02 position \n"\ "; c14: Light02 position \n"\
"; c15: x,y,z: Light02 color; .w: 1/LightRadius \n"\ "; c15: x,y,z: Light02 color; .w: 1/LightRadius² \n"\
"vs.1.1\n"\ "vs.1.1\n"\
"dcl_position v0 ; position \n"\ "dcl_position v0 ; position \n"\
"dcl_normal v1 ; normal \n"\ "dcl_normal v1 ; normal \n"\
...@@ -65,13 +65,13 @@ namespace video ...@@ -65,13 +65,13 @@ namespace video
"mad oT3.xyz, r9.xyz, c95, c95 ; move light vector 2 from -1..1 into 0..1 \n"\ "mad oT3.xyz, r9.xyz, c95, c95 ; move light vector 2 from -1..1 into 0..1 \n"\
"\n"\ "\n"\
" ; calculate attenuation of light 1 \n"\ " ; calculate attenuation of light 1 \n"\
"dp3 r2.x, r2.xyz, r2.xyz ; r2.x = r2.x + r2.y + r2.z \n"\ "dp3 r2.x, r2.xyz, r2.xyz ; r2.x = r2.x² + r2.y² + r2.z² \n"\
"mul r2.x, r2.x, c13.w ; r2.x * attenutation \n"\ "mul r2.x, r2.x, c13.w ; r2.x * attenutation \n"\
"rsq r2, r2.x ; r2.xyzw = 1/sqrt(r2.x * attenutation)\n"\ "rsq r2, r2.x ; r2.xyzw = 1/sqrt(r2.x * attenutation)\n"\
"mul oD0, r2, c13 ; resulting light color = lightcolor * attenuation \n"\ "mul oD0, r2, c13 ; resulting light color = lightcolor * attenuation \n"\
"\n"\ "\n"\
" ; calculate attenuation of light 2 \n"\ " ; calculate attenuation of light 2 \n"\
"dp3 r3.x, r3.xyz, r3.xyz ; r3.x = r3.x + r3.y + r3.z \n"\ "dp3 r3.x, r3.xyz, r3.xyz ; r3.x = r3.x² + r3.y² + r3.z² \n"\
"mul r3.x, r3.x, c15.w ; r2.x * attenutation \n"\ "mul r3.x, r3.x, c15.w ; r2.x * attenutation \n"\
"rsq r3, r3.x ; r2.xyzw = 1/sqrt(r2.x * attenutation)\n"\ "rsq r3, r3.x ; r2.xyzw = 1/sqrt(r2.x * attenutation)\n"\
"mul oD1, r3, c15 ; resulting light color = lightcolor * attenuation \n"\ "mul oD1, r3, c15 ; resulting light color = lightcolor * attenuation \n"\
......
...@@ -30,9 +30,9 @@ namespace video ...@@ -30,9 +30,9 @@ namespace video
"; c4: Eye position \n"\ "; c4: Eye position \n"\
"; c8-11: Transposed worldViewProj matrix (Projection * View * World) \n"\ "; c8-11: Transposed worldViewProj matrix (Projection * View * World) \n"\
"; c12: Light01 position \n"\ "; c12: Light01 position \n"\
"; c13: x,y,z: Light01 color; .w: 1/LightRadius \n"\ "; c13: x,y,z: Light01 color; .w: 1/LightRadius² \n"\
"; c14: Light02 position \n"\ "; c14: Light02 position \n"\
"; c15: x,y,z: Light02 color; .w: 1/LightRadius \n"\ "; c15: x,y,z: Light02 color; .w: 1/LightRadius² \n"\
"vs.1.1\n"\ "vs.1.1\n"\
"dcl_position v0 ; position \n"\ "dcl_position v0 ; position \n"\
"dcl_normal v1 ; normal \n"\ "dcl_normal v1 ; normal \n"\
...@@ -84,13 +84,13 @@ namespace video ...@@ -84,13 +84,13 @@ namespace video
"mad oT4.xyz, r10.xyz, c95, c95 ; move eye vector from -1..1 into 0..1 \n"\ "mad oT4.xyz, r10.xyz, c95, c95 ; move eye vector from -1..1 into 0..1 \n"\
"\n"\ "\n"\
" ; calculate attenuation of light 1 \n"\ " ; calculate attenuation of light 1 \n"\
"dp3 r2.x, r2.xyz, r2.xyz ; r2.x = r2.x + r2.y + r2.z \n"\ "dp3 r2.x, r2.xyz, r2.xyz ; r2.x = r2.x² + r2.y² + r2.z² \n"\
"mul r2.x, r2.x, c13.w ; r2.x * attenutation \n"\ "mul r2.x, r2.x, c13.w ; r2.x * attenutation \n"\
"rsq r2, r2.x ; r2.xyzw = 1/sqrt(r2.x * attenutation)\n"\ "rsq r2, r2.x ; r2.xyzw = 1/sqrt(r2.x * attenutation)\n"\
"mul oD0, r2, c13 ; resulting light color = lightcolor * attenuation \n"\ "mul oD0, r2, c13 ; resulting light color = lightcolor * attenuation \n"\
"\n"\ "\n"\
" ; calculate attenuation of light 2 \n"\ " ; calculate attenuation of light 2 \n"\
"dp3 r3.x, r3.xyz, r3.xyz ; r3.x = r3.x + r3.y + r3.z \n"\ "dp3 r3.x, r3.xyz, r3.xyz ; r3.x = r3.x² + r3.y² + r3.z² \n"\
"mul r3.x, r3.x, c15.w ; r2.x * attenutation \n"\ "mul r3.x, r3.x, c15.w ; r2.x * attenutation \n"\
"rsq r3, r3.x ; r2.xyzw = 1/sqrt(r2.x * attenutation)\n"\ "rsq r3, r3.x ; r2.xyzw = 1/sqrt(r2.x * attenutation)\n"\
"mul oD1, r3, c15 ; resulting light color = lightcolor * attenuation \n"\ "mul oD1, r3, c15 ; resulting light color = lightcolor * attenuation \n"\
......
...@@ -143,10 +143,10 @@ bool COpenGLDriver::initDriver(CIrrDeviceWin32* device) ...@@ -143,10 +143,10 @@ bool COpenGLDriver::initDriver(CIrrDeviceWin32* device)
PIXELFORMATDESCRIPTOR pfd = { PIXELFORMATDESCRIPTOR pfd = {
sizeof(PIXELFORMATDESCRIPTOR), // Size Of This Pixel Format Descriptor sizeof(PIXELFORMATDESCRIPTOR), // Size Of This Pixel Format Descriptor
1, // Version Number 1, // Version Number
PFD_DRAW_TO_WINDOW | // Format Must Support Window static_cast<DWORD>(PFD_DRAW_TO_WINDOW | // Format Must Support Window
PFD_SUPPORT_OPENGL | // Format Must Support OpenGL PFD_SUPPORT_OPENGL | // Format Must Support OpenGL
(Params.Doublebuffer?PFD_DOUBLEBUFFER:0) | // Must Support Double Buffering (Params.Doublebuffer ? PFD_DOUBLEBUFFER : 0) | // Must Support Double Buffering
(Params.Stereobuffer?PFD_STEREO:0), // Must Support Stereo Buffer (Params.Stereobuffer ? PFD_STEREO : 0)), // Must Support Stereo Buffer
PFD_TYPE_RGBA, // Request An RGBA Format PFD_TYPE_RGBA, // Request An RGBA Format
Params.Bits, // Select Our Color Depth Params.Bits, // Select Our Color Depth
0, 0, 0, 0, 0, 0, // Color Bits Ignored 0, 0, 0, 0, 0, 0, // Color Bits Ignored
......
...@@ -667,7 +667,7 @@ bool CIrrDeviceMacOSX::createWindow() ...@@ -667,7 +667,7 @@ bool CIrrDeviceMacOSX::createWindow()
NSOpenGLPFASamples, (NSOpenGLPixelFormatAttribute)CreationParams.AntiAlias, NSOpenGLPFASamples, (NSOpenGLPixelFormatAttribute)CreationParams.AntiAlias,
NSOpenGLPFAStencilSize, (NSOpenGLPixelFormatAttribute)(CreationParams.Stencilbuffer?1:0), NSOpenGLPFAStencilSize, (NSOpenGLPixelFormatAttribute)(CreationParams.Stencilbuffer?1:0),
NSOpenGLPFADoubleBuffer, NSOpenGLPFADoubleBuffer,
(NSOpenGLPixelFormatAttribute)nil (NSOpenGLPixelFormatAttribute)0
}; };
if (CreationParams.AntiAlias<2) if (CreationParams.AntiAlias<2)
...@@ -693,7 +693,7 @@ bool CIrrDeviceMacOSX::createWindow() ...@@ -693,7 +693,7 @@ bool CIrrDeviceMacOSX::createWindow()
{ {
// Third try without Doublebuffer // Third try without Doublebuffer
os::Printer::log("No doublebuffering available.", ELL_WARNING); os::Printer::log("No doublebuffering available.", ELL_WARNING);
windowattribs[14]=(NSOpenGLPixelFormatAttribute)nil; windowattribs[14]=(NSOpenGLPixelFormatAttribute)0;
} }
format = [[NSOpenGLPixelFormat alloc] initWithAttributes:windowattribs]; format = [[NSOpenGLPixelFormat alloc] initWithAttributes:windowattribs];
...@@ -1024,13 +1024,13 @@ bool CIrrDeviceMacOSX::run() ...@@ -1024,13 +1024,13 @@ bool CIrrDeviceMacOSX::run()
auto frameHeight = [[textView superview] frame].size.height; auto frameHeight = [[textView superview] frame].size.height;
NSRect rect = { NSRect rect = {
(frameHeight - crect.LowerRightCorner.Y > crect.getHeight()) ? (frameHeight - crect.LowerRightCorner.Y > crect.getHeight()) ?
crect.UpperLeftCorner.X : (CGFloat)crect.UpperLeftCorner.X :
crect.UpperLeftCorner.X + crect.getWidth() / 2, (CGFloat)(crect.UpperLeftCorner.X + crect.getWidth() / 2),
(frameHeight - crect.LowerRightCorner.Y > crect.getHeight()) ? (frameHeight - crect.LowerRightCorner.Y > crect.getHeight()) ?
frameHeight - crect.LowerRightCorner.Y - crect.getHeight() - 1 : (CGFloat)(frameHeight - crect.LowerRightCorner.Y - crect.getHeight() - 1) :
frameHeight - crect.LowerRightCorner.Y, (CGFloat)(frameHeight - crect.LowerRightCorner.Y),
crect.getWidth() / 2, (CGFloat)(crect.getWidth() / 2),
crect.getHeight(), (CGFloat)crect.getHeight(),
}; };
[textView setFrame:rect]; [textView setFrame:rect];
[textView setHidden:NO]; [textView setHidden:NO];
......
...@@ -6088,12 +6088,13 @@ ...@@ -6088,12 +6088,13 @@
1DEB922308733DC00010E9CD /* Debug */ = { 1DEB922308733DC00010E9CD /* Debug */ = {
isa = XCBuildConfiguration; isa = XCBuildConfiguration;
buildSettings = { buildSettings = {
ARCHS = "x86_64 arm64"; ARCHS = "$(ARCHS_STANDARD)";
GCC_PREPROCESSOR_DEFINITIONS = GLES_SILENCE_DEPRECATION; CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
GCC_PREPROCESSOR_DEFINITIONS = "GLES_SILENCE_DEPRECATION PNG_ARM_NEON_OPT=0 PNG_ARM_NEON_IMPLEMENTATION=0";
GCC_WARN_ABOUT_RETURN_TYPE = YES; GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNUSED_VARIABLE = NO; GCC_WARN_UNUSED_VARIABLE = NO;
HEADER_SEARCH_PATHS = ../../../include; HEADER_SEARCH_PATHS = ../../../include;
MACOSX_DEPLOYMENT_TARGET = 10.10; MACOSX_DEPLOYMENT_TARGET = 10.13;
OTHER_CFLAGS = ( OTHER_CFLAGS = (
"-DMACOSX", "-DMACOSX",
"-D_DEBUG", "-D_DEBUG",
...@@ -6106,18 +6107,19 @@ ...@@ -6106,18 +6107,19 @@
1DEB922408733DC00010E9CD /* Release */ = { 1DEB922408733DC00010E9CD /* Release */ = {
isa = XCBuildConfiguration; isa = XCBuildConfiguration;
buildSettings = { buildSettings = {
ARCHS = "x86_64 arm64"; ARCHS = "$(ARCHS_STANDARD)";
CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
GCC_DYNAMIC_NO_PIC = YES; GCC_DYNAMIC_NO_PIC = YES;
GCC_GENERATE_DEBUGGING_SYMBOLS = NO; GCC_GENERATE_DEBUGGING_SYMBOLS = NO;
GCC_INLINES_ARE_PRIVATE_EXTERN = YES; GCC_INLINES_ARE_PRIVATE_EXTERN = YES;
GCC_OPTIMIZATION_LEVEL = 3; GCC_OPTIMIZATION_LEVEL = 3;
GCC_PREPROCESSOR_DEFINITIONS = GLES_SILENCE_DEPRECATION; GCC_PREPROCESSOR_DEFINITIONS = "GLES_SILENCE_DEPRECATION PNG_ARM_NEON_OPT=0 PNG_ARM_NEON_IMPLEMENTATION=0";
GCC_SYMBOLS_PRIVATE_EXTERN = YES; GCC_SYMBOLS_PRIVATE_EXTERN = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES; GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNUSED_VARIABLE = NO; GCC_WARN_UNUSED_VARIABLE = NO;
HEADER_SEARCH_PATHS = ../../../include; HEADER_SEARCH_PATHS = ../../../include;
INSTALL_MODE_FLAG = "a+rwx"; INSTALL_MODE_FLAG = "a+rwx";
MACOSX_DEPLOYMENT_TARGET = 10.10; MACOSX_DEPLOYMENT_TARGET = 10.13;
OTHER_CFLAGS = "-DMACOSX"; OTHER_CFLAGS = "-DMACOSX";
PREBINDING = NO; PREBINDING = NO;
SDKROOT = ""; SDKROOT = "";
......
libpng 1.6.37 - April 14, 2019 libpng 1.6.47 - February 18, 2025
============================== =================================
This is a public release of libpng, intended for use in production code. This is a public release of libpng, intended for use in production code.
...@@ -9,13 +9,13 @@ Files available for download ...@@ -9,13 +9,13 @@ Files available for download
Source files with LF line endings (for Unix/Linux): Source files with LF line endings (for Unix/Linux):
* libpng-1.6.37.tar.xz (LZMA-compressed, recommended) * libpng-1.6.47.tar.xz (LZMA-compressed, recommended)
* libpng-1.6.37.tar.gz * libpng-1.6.47.tar.gz (deflate-compressed)
Source files with CRLF line endings (for Windows): Source files with CRLF line endings (for Windows):
* lp1637.7z (LZMA-compressed, recommended) * lpng1647.7z (LZMA-compressed, recommended)
* lp1637.zip * lpng1647.zip (deflate-compressed)
Other information: Other information:
...@@ -25,20 +25,19 @@ Other information: ...@@ -25,20 +25,19 @@ Other information:
* TRADEMARK.md * TRADEMARK.md
Changes since the previous public release (version 1.6.36) Changes from version 1.6.46 to version 1.6.47
---------------------------------------------------------- ---------------------------------------------
* Fixed a use-after-free vulnerability (CVE-2019-7317) in png_image_free. * Modified the behaviour of colorspace chunks in order to adhere
* Fixed a memory leak in the ARM NEON implementation of png_do_expand_palette. to the new precedence rules formulated in the latest draft of
* Fixed a memory leak in pngtest.c. the PNG Specification.
* Fixed two vulnerabilities (CVE-2018-14048, CVE-2018-14550) in (Contributed by John Bowler)
contrib/pngminus; refactor. * Fixed a latent bug in `png_write_iCCP`.
* Changed the license of contrib/pngminus to MIT; refresh makefile and docs. This would have been a read-beyond-end-of-malloc vulnerability,
(Contributed by Willem van Schaik) introduced early in the libpng-1.6.0 development, yet (fortunately!)
* Fixed a typo in the libpng license v2. it was inaccessible before the above-mentioned modification of the
(Contributed by Miguel Ojeda) colorspace precedence rules, due to pre-existing colorspace checks.
* Added makefiles for AddressSanitizer-enabled builds. (Reported by Bob Friesenhahn; fixed by John Bowler)
* Cleaned up various makefiles.
Send comments/corrections/commendations to png-mng-implement at lists.sf.net. Send comments/corrections/commendations to png-mng-implement at lists.sf.net.
......
...@@ -4,7 +4,9 @@ PNG REFERENCE LIBRARY AUTHORS ...@@ -4,7 +4,9 @@ PNG REFERENCE LIBRARY AUTHORS
This is the list of PNG Reference Library ("libpng") Contributing This is the list of PNG Reference Library ("libpng") Contributing
Authors, for copyright and licensing purposes. Authors, for copyright and licensing purposes.
* Adam Richter
* Andreas Dilger * Andreas Dilger
* Chris Blume
* Cosmin Truta * Cosmin Truta
* Dave Martindale * Dave Martindale
* Eric S. Raymond * Eric S. Raymond
...@@ -15,12 +17,16 @@ Authors, for copyright and licensing purposes. ...@@ -15,12 +17,16 @@ Authors, for copyright and licensing purposes.
* James Yu * James Yu
* John Bowler * John Bowler
* Kevin Bracey * Kevin Bracey
* Lucas Chollet
* Magnus Holmgren * Magnus Holmgren
* Mandar Sahastrabuddhe * Mandar Sahastrabuddhe
* Mans Rullgard * Mans Rullgard
* Matt Sarett * Matt Sarett
* Mike Klein * Mike Klein
* Pascal Massimino
* Paul Schmidt * Paul Schmidt
* Philippe Antoine
* Qiang Zhou
* Sam Bushell * Sam Bushell
* Samuel Williams * Samuel Williams
* Simon-Pierre Cadieux * Simon-Pierre Cadieux
...@@ -30,16 +36,27 @@ Authors, for copyright and licensing purposes. ...@@ -30,16 +36,27 @@ Authors, for copyright and licensing purposes.
* Vadim Barkov * Vadim Barkov
* Willem van Schaik * Willem van Schaik
* Zhijie Liang * Zhijie Liang
* Apple Inc.
- Zixu Wang (王子旭)
* Arm Holdings * Arm Holdings
- Richard Townsend - Richard Townsend
* Google Inc. * Google Inc.
- Dan Field
- Leon Scroggins III
- Matt Sarett - Matt Sarett
- Mike Klein - Mike Klein
- Sami Boukortt
- Wan-Teh Chang
* Loongson Technology Corporation Ltd.
- GuXiWei (顾希伟)
- JinBo (金波)
- ZhangLixia (张利霞)
The build projects, the build scripts, the test scripts, and other The build projects, the build scripts, the test scripts, and other
files in the "projects", "scripts" and "tests" directories, have other files in the "projects", "scripts" and "tests" directories, have
copyright owners, but are released under the libpng license. other copyright owners, but are released under the libpng license.
Some files in the "contrib" directory, and some tools-generated files Some files in the "ci" and "contrib" directories, as well as some
that are distributed with libpng, have other copyright owners, and are of the tools-generated files that are distributed with libpng, have
released under other open source licenses. other copyright owners, and are released under other open source
licenses.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
...@@ -4,8 +4,8 @@ COPYRIGHT NOTICE, DISCLAIMER, and LICENSE ...@@ -4,8 +4,8 @@ COPYRIGHT NOTICE, DISCLAIMER, and LICENSE
PNG Reference Library License version 2 PNG Reference Library License version 2
--------------------------------------- ---------------------------------------
* Copyright (c) 1995-2019 The PNG Reference Library Authors. * Copyright (c) 1995-2025 The PNG Reference Library Authors.
* Copyright (c) 2018-2019 Cosmin Truta. * Copyright (c) 2018-2025 Cosmin Truta.
* Copyright (c) 2000-2002, 2004, 2006-2018 Glenn Randers-Pehrson. * Copyright (c) 2000-2002, 2004, 2006-2018 Glenn Randers-Pehrson.
* Copyright (c) 1996-1997 Andreas Dilger. * Copyright (c) 1996-1997 Andreas Dilger.
* Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc. * Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc.
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
TODO - list of things to do for libpng: TODO list for libpng
--------------------
* Fix all defects (duh!) * Fix all defects (duh!)
* Better C++ wrapper / full C++ implementation (?) * cHRM transformation.
* Fix the problems with C++ and 'extern "C"'. * Palette creation.
* cHRM transformation. * "grayscale->palette" transformation and "palette->grayscale" detection.
* Palette creation. * Improved dithering.
* "grayscale->palette" transformation and "palette->grayscale" detection. * Multi-lingual error and warning message support.
* Improved dithering. * Complete sRGB transformation. (Currently it simply uses gamma=0.45455.)
* Multi-lingual error and warning message support. * Man pages for function calls.
* Complete sRGB transformation. (Currently it simply uses gamma=0.45455.) * Better documentation.
* Man pages for function calls. * Better filter selection
* Better documentation.
* Better filter selection
(e.g., counting huffman bits/precompression; filter inertia; filter costs). (e.g., counting huffman bits/precompression; filter inertia; filter costs).
* Histogram creation. * Histogram creation.
* Text conversion between different code pages (e.g., Latin-1 -> Mac). * Text conversion between different code pages (e.g., Latin-1 to Mac).
* Avoid building gamma tables whenever possible. * Avoid building gamma tables whenever possible.
* Greater precision in changing to linear gamma for compositing against * Greater precision in changing to linear gamma for compositing against
background, and in doing rgb-to-gray transformations. background, and in doing rgb-to-gray transformations.
* Investigate pre-incremented loop counters and other loop constructions. * Investigate pre-incremented loop counters and other loop constructions.
* Interpolated method of handling interlacing. * Interpolated method of handling interlacing.
* More validations for libpng transformations. * More validations for libpng transformations.
This diff is collapsed.
#! /bin/sh
#
# Run 'autoreconf' to build 'configure', 'Makefile.in' and other configure
# control files.
#
# The first time this is run on a GIT checkout the only files that exist are
# configure.ac and Makefile.am; all of the autotools support scripts are
# missing. They are instantiated with autoreconf --force --install.
#
# For regular ("tarball") distributions all the files should exist. We do not
# want them to be updated *under any circumstances*. It should never be
# necessary to run autogen.sh because ./configure --enable-maintainer-mode says
# what to do if Makefile.am or configure.ac are changed.
#
# It is *probably* OK to update the files on a GIT checkout, because they have
# come from the local tools, but leave that to the user who is assumed to know
# whether it is ok or required.
#
# This script is intended to work without arguments, there are, however, hidden
# arguments (a) for use while testing the script and (b) to fix up systems that
# have been broken. If (b) is required the script prompts for the correct
# options. For this reason the options are *NOT* documented in the help; this
# is deliberate; UTSL.
#
clean=
maintainer=
while test $# -gt 0
do
case "$1" in
--maintainer)
maintainer=1;;
--clean)
clean=1;;
*)
exec >&2
echo "$0: usage: ./autogen.sh"
if test -d .git
then
echo " ./autogen.sh generates the configure script and"
echo " Makefile.in, or refreshes them after changes to Makefile.am"
echo " or configure.ac. You may prefer to just run autoreconf."
elif test -z "$maintainer"
then
echo " DO NOT RUN THIS SCRIPT."
echo " If you need to change Makefile.am or configure.ac then you"
echo " also need to run ./configure --enable-maintainer-mode and"
echo " use the appropriate autotools, *NOT* this script, to update"
echo " everything, please check the documentation of autoreconf."
echo " WARNING: libpng is intentionally generated with a known,"
echo " fixed, set of autotools. It is known *NOT* to work with"
echo " the collection of autotools distributed on highly reputable"
echo " operating systems."
echo " Remember: autotools is GNU software, you are expected to"
echo " pay for support."
else
echo " You have run autogen.sh with --maintainer enabled and you"
echo " are not using a GIT distribution, then you have given an"
echo " unrecognized argument. This is not good. --maintainer"
echo " switches off any assumptions that you might not know what"
echo " you are doing."
fi
exit 1;;
esac
shift
done
#
# First check for a set of the autotools files; if absent then this is assumed
# to be a GIT version and the local autotools must be used. If present this
# is a tarball distribution and the script should not be used. If partially
# present bad things are happening.
#
# The autotools generated files:
libpng_autotools_files="Makefile.in aclocal.m4 config.guess config.h.in
config.sub configure depcomp install-sh ltmain.sh missing\
test-driver"
#
# Files generated by versions of autoconf >2.68 or automake >1.13 (i.e. later
# versions than those required by configure.ac):
libpng_autotools_extra="compile config.h.in~"
#
# These are separate because 'maintainer-clean' does not remove them.
libpng_libtool_files="scripts/autoconf/libtool.m4 scripts/autoconf/ltoptions.m4\
scripts/autoconf/ltsugar.m4 scripts/autoconf/ltversion.m4\
scripts/autoconf/lt~obsolete.m4"
libpng_autotools_dirs="autom4te.cache" # not required
#
# The configure generated files:
libpng_configure_files="Makefile config.h config.log config.status\
libpng-config libpng.pc libtool stamp-h1"
libpng_configure_dirs=".deps"
#
# We must remove the configure generated files as well as the autotools
# generated files if autotools are regenerated because otherwise if configure
# has been run without "--enable-maintainer-mode" make can do a partial update
# of Makefile. These functions do the two bits of cleaning.
clean_autotools(){
rm -rf $libpng_autotools_files $libpng_libtool_files $libpng_autotools_dirs
rm -rf $libpng_autotools_extra
}
clean_configure(){
rm -rf $libpng_configure_files $libpng_configure_dirs
}
#
# Clean: remove everything (this is to help with testing)
if test -n "$clean"
then
clean_configure
if test -n "$maintainer"
then
clean_autotools
fi
exit 0
fi
#
# Validate the distribution.
libpng_autotools_file_found=
libpng_autotools_file_missing=
for file in $libpng_autotools_files
do
if test -f "$file"
then
libpng_autotools_file_found=1
else
libpng_autotools_file_missing=1
fi
done
#
# Presence of one of these does not *invalidate* missing, but absence
# invalidates found.
for file in $libpng_libtool_files
do
if test ! -f "$file"
then
libpng_autotools_file_missing=1
fi
done
#
# The cache directory doesn't matter - it will be regenerated and does not exist
# anyway in a tarball.
#
# Either everything is missing or everything is there, the --maintainer option
# just changes this so that the mode is set to generate all the files.
mode=
if test -z "$libpng_autotools_file_found" -o -n "$maintainer"
then
mode="autoreconf"
else
if test -n "$libpng_autotools_file_missing"
then
mode="broken"
else
mode="configure"
fi
fi
#
# So:
case "$mode" in
autoreconf)
# Clean in case configure files exist
clean_configure
clean_autotools
# Everything must be initialized, so use --force
if autoreconf --warnings=all --force --install
then
missing=
for file in $libpng_autotools_files
do
test -f "$file" || missing=1
done
# ignore the cache directory
test -z "$missing" || {
exec >&2
echo "autoreconf was run, but did not produce all the expected"
echo "files. It is likely that your autotools installation is"
echo "not compatible with that expected by libpng."
exit 1
}
else
exec >&2
echo "autoreconf failed: your version of autotools is incompatible"
echo "with this libpng version. Please use a distributed archive"
echo "(which includes the autotools generated files) and run configure"
echo "instead."
exit 1
fi;;
configure)
if test -d .git
then
exec >&2
echo "ERROR: running autoreconf on an initialized system"
echo " This is not necessary; it is only necessary to remake the"
echo " autotools generated files if Makefile.am or configure.ac"
echo " change and make does the right thing with:"
echo
echo " ./configure --enable-maintainer-mode."
echo
echo " You can run autoreconf yourself if you don't like maintainer"
echo " mode and you can also just run autoreconf -f -i to initialize"
echo " everything in the first place; this script is only for"
echo " compatibility with prior releases."
exit 1
else
exec >&2
echo "autogen.sh is intended only to generate 'configure' on systems"
echo "that do not have it. You have a complete 'configure', if you"
echo "need to change Makefile.am or configure.ac you also need to"
echo "run configure with the --enable-maintainer-mode option."
exit 1
fi;;
broken)
exec >&2
echo "Your system has a partial set of autotools generated files."
echo "autogen.sh is unable to proceed. The full set of files is"
echo "contained in the libpng 'tar' distribution archive and you do"
echo "not need to run autogen.sh if you use it."
exit 1;;
esac
This diff is collapsed.
This diff is collapsed.
/* config.h.in. Generated from configure.ac by autoheader. */
/* Define to 1 if you have the <dlfcn.h> header file. */
#undef HAVE_DLFCN_H
/* Define to 1 if you have the 'feenableexcept' function. */
#undef HAVE_FEENABLEEXCEPT
/* Define to 1 if you have the <inttypes.h> header file. */
#undef HAVE_INTTYPES_H
/* Define to 1 if you have the 'm' library (-lm). */
#undef HAVE_LIBM
/* Define to 1 if you have the 'z' library (-lz). */
#undef HAVE_LIBZ
/* Define to 1 if you have the 'pow' function. */
#undef HAVE_POW
/* Define to 1 if you have the <stdint.h> header file. */
#undef HAVE_STDINT_H
/* Define to 1 if you have the <stdio.h> header file. */
#undef HAVE_STDIO_H
/* Define to 1 if you have the <stdlib.h> header file. */
#undef HAVE_STDLIB_H
/* Define to 1 if you have the <strings.h> header file. */
#undef HAVE_STRINGS_H
/* Define to 1 if you have the <string.h> header file. */
#undef HAVE_STRING_H
/* Define to 1 if you have the <sys/stat.h> header file. */
#undef HAVE_SYS_STAT_H
/* Define to 1 if you have the <sys/types.h> header file. */
#undef HAVE_SYS_TYPES_H
/* Define to 1 if you have the <unistd.h> header file. */
#undef HAVE_UNISTD_H
/* Define to the sub-directory where libtool stores uninstalled libraries. */
#undef LT_OBJDIR
/* Name of package */
#undef PACKAGE
/* Define to the address where bug reports for this package should be sent. */
#undef PACKAGE_BUGREPORT
/* Define to the full name of this package. */
#undef PACKAGE_NAME
/* Define to the full name and version of this package. */
#undef PACKAGE_STRING
/* Define to the one symbol short name of this package. */
#undef PACKAGE_TARNAME
/* Define to the home page for this package. */
#undef PACKAGE_URL
/* Define to the version of this package. */
#undef PACKAGE_VERSION
/* Turn on ARM Neon optimizations at run-time */
#undef PNG_ARM_NEON_API_SUPPORTED
/* Check for ARM Neon support at run-time */
#undef PNG_ARM_NEON_CHECK_SUPPORTED
/* Enable ARM Neon optimizations */
#undef PNG_ARM_NEON_OPT
/* Enable Intel SSE optimizations */
#undef PNG_INTEL_SSE_OPT
/* Enable LOONGARCH LSX optimizations */
#undef PNG_LOONGARCH_LSX_OPT
/* Turn on MIPS MMI optimizations at run-time */
#undef PNG_MIPS_MMI_API_SUPPORTED
/* Check for MIPS MMI support at run-time */
#undef PNG_MIPS_MMI_CHECK_SUPPORTED
/* Enable MIPS MMI optimizations */
#undef PNG_MIPS_MMI_OPT
/* Turn on MIPS MSA optimizations at run-time */
#undef PNG_MIPS_MSA_API_SUPPORTED
/* Check for MIPS MSA support at run-time */
#undef PNG_MIPS_MSA_CHECK_SUPPORTED
/* Enable MIPS MSA optimizations */
#undef PNG_MIPS_MSA_OPT
/* Turn on POWERPC VSX optimizations at run-time */
#undef PNG_POWERPC_VSX_API_SUPPORTED
/* Check for POWERPC VSX support at run-time */
#undef PNG_POWERPC_VSX_CHECK_SUPPORTED
/* Enable POWERPC VSX optimizations */
#undef PNG_POWERPC_VSX_OPT
/* Define to 1 if all of the C89 standard headers exist (not just the ones
required in a freestanding environment). This macro is provided for
backward compatibility; new code need not use it. */
#undef STDC_HEADERS
/* Define to 1 if your <sys/time.h> declares 'struct tm'. */
#undef TM_IN_SYS_TIME
/* Version number of package */
#undef VERSION
/* Define to the equivalent of the C99 'restrict' keyword, or to
nothing if this is not supported. Do not define if restrict is
supported only directly. */
#undef restrict
/* Work around a bug in older versions of Sun C++, which did not
#define __restrict__ or support _Restrict or __restrict__
even though the corresponding Sun C compiler ended up with
"#define restrict _Restrict" or "#define restrict __restrict__"
in the previous line. This workaround can be removed once
we assume Oracle Developer Studio 12.5 (2016) or later. */
#if defined __SUNPRO_CC && !defined __RESTRICT && !defined __restrict__
# define _Restrict
# define __restrict__
#endif
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
#if 0 /* in case someone actually tries to compile this */ #if 0 /* in case someone actually tries to compile this */
/* example.c - an example of using libpng /* example.c - an example of using libpng
* *
* Maintained 2018 Cosmin Truta * Maintained 2018-2024 Cosmin Truta
* Maintained 1998-2016 Glenn Randers-Pehrson * Maintained 1998-2016 Glenn Randers-Pehrson
* Maintained 1996-1997 Andreas Dilger * Maintained 1996-1997 Andreas Dilger
* Written 1995-1996 Guy Eric Schalnat, Group 42, Inc. * Written 1995-1996 Guy Eric Schalnat, Group 42, Inc.
...@@ -126,6 +125,7 @@ int main(int argc, const char **argv) ...@@ -126,6 +125,7 @@ int main(int argc, const char **argv)
else else
free(buffer); free(buffer);
} }
}
/* Something went wrong reading or writing the image. libpng stores a /* Something went wrong reading or writing the image. libpng stores a
* textual message in the 'png_image' structure: * textual message in the 'png_image' structure:
...@@ -258,9 +258,9 @@ int check_if_png(char *file_name, FILE **fp) ...@@ -258,9 +258,9 @@ int check_if_png(char *file_name, FILE **fp)
return 0; return 0;
/* Compare the first PNG_BYTES_TO_CHECK bytes of the signature. /* Compare the first PNG_BYTES_TO_CHECK bytes of the signature.
* Return nonzero (true) if they match. * Return true if they match.
*/ */
return(!png_sig_cmp(buf, 0, PNG_BYTES_TO_CHECK)); return png_sig_cmp(buf, 0, PNG_BYTES_TO_CHECK) == 0;
} }
/* Read a PNG file. You may want to return an error code if the read /* Read a PNG file. You may want to return an error code if the read
...@@ -280,7 +280,7 @@ void read_png(char *file_name) /* We need to open the file */ ...@@ -280,7 +280,7 @@ void read_png(char *file_name) /* We need to open the file */
FILE *fp; FILE *fp;
if ((fp = fopen(file_name, "rb")) == NULL) if ((fp = fopen(file_name, "rb")) == NULL)
return (ERROR); return ERROR;
#else no_open_file /* prototype 2 */ #else no_open_file /* prototype 2 */
void read_png(FILE *fp, int sig_read) /* File is already open */ void read_png(FILE *fp, int sig_read) /* File is already open */
...@@ -303,7 +303,7 @@ void read_png(FILE *fp, int sig_read) /* File is already open */ ...@@ -303,7 +303,7 @@ void read_png(FILE *fp, int sig_read) /* File is already open */
if (png_ptr == NULL) if (png_ptr == NULL)
{ {
fclose(fp); fclose(fp);
return (ERROR); return ERROR;
} }
/* Allocate/initialize the memory for image information. REQUIRED. */ /* Allocate/initialize the memory for image information. REQUIRED. */
...@@ -312,7 +312,7 @@ void read_png(FILE *fp, int sig_read) /* File is already open */ ...@@ -312,7 +312,7 @@ void read_png(FILE *fp, int sig_read) /* File is already open */
{ {
fclose(fp); fclose(fp);
png_destroy_read_struct(&png_ptr, NULL, NULL); png_destroy_read_struct(&png_ptr, NULL, NULL);
return (ERROR); return ERROR;
} }
/* Set error handling if you are using the setjmp/longjmp method (this is /* Set error handling if you are using the setjmp/longjmp method (this is
...@@ -325,7 +325,7 @@ void read_png(FILE *fp, int sig_read) /* File is already open */ ...@@ -325,7 +325,7 @@ void read_png(FILE *fp, int sig_read) /* File is already open */
png_destroy_read_struct(&png_ptr, &info_ptr, NULL); png_destroy_read_struct(&png_ptr, &info_ptr, NULL);
fclose(fp); fclose(fp);
/* If we get here, we had a problem reading the file. */ /* If we get here, we had a problem reading the file. */
return (ERROR); return ERROR;
} }
/* One of the following I/O initialization methods is REQUIRED. */ /* One of the following I/O initialization methods is REQUIRED. */
...@@ -584,7 +584,7 @@ void read_png(FILE *fp, int sig_read) /* File is already open */ ...@@ -584,7 +584,7 @@ void read_png(FILE *fp, int sig_read) /* File is already open */
fclose(fp); fclose(fp);
/* That's it! */ /* That's it! */
return (OK); return OK;
} }
/* Progressively read a file */ /* Progressively read a file */
...@@ -603,18 +603,18 @@ initialize_png_reader(png_structp *png_ptr, png_infop *info_ptr) ...@@ -603,18 +603,18 @@ initialize_png_reader(png_structp *png_ptr, png_infop *info_ptr)
if (*png_ptr == NULL) if (*png_ptr == NULL)
{ {
*info_ptr = NULL; *info_ptr = NULL;
return (ERROR); return ERROR;
} }
*info_ptr = png_create_info_struct(png_ptr); *info_ptr = png_create_info_struct(png_ptr);
if (*info_ptr == NULL) if (*info_ptr == NULL)
{ {
png_destroy_read_struct(png_ptr, info_ptr, NULL); png_destroy_read_struct(png_ptr, info_ptr, NULL);
return (ERROR); return ERROR;
} }
if (setjmp(png_jmpbuf((*png_ptr)))) if (setjmp(png_jmpbuf((*png_ptr))))
{ {
png_destroy_read_struct(png_ptr, info_ptr, NULL); png_destroy_read_struct(png_ptr, info_ptr, NULL);
return (ERROR); return ERROR;
} }
/* You will need to provide all three function callbacks, /* You will need to provide all three function callbacks,
...@@ -631,7 +631,7 @@ initialize_png_reader(png_structp *png_ptr, png_infop *info_ptr) ...@@ -631,7 +631,7 @@ initialize_png_reader(png_structp *png_ptr, png_infop *info_ptr)
*/ */
png_set_progressive_read_fn(*png_ptr, (void *)stream_data, png_set_progressive_read_fn(*png_ptr, (void *)stream_data,
info_callback, row_callback, end_callback); info_callback, row_callback, end_callback);
return (OK); return OK;
} }
int int
...@@ -642,7 +642,7 @@ process_data(png_structp *png_ptr, png_infop *info_ptr, ...@@ -642,7 +642,7 @@ process_data(png_structp *png_ptr, png_infop *info_ptr,
{ {
/* Free the png_ptr and info_ptr memory on error. */ /* Free the png_ptr and info_ptr memory on error. */
png_destroy_read_struct(png_ptr, info_ptr, NULL); png_destroy_read_struct(png_ptr, info_ptr, NULL);
return (ERROR); return ERROR;
} }
/* Give chunks of data as they arrive from the data stream /* Give chunks of data as they arrive from the data stream
...@@ -656,7 +656,7 @@ process_data(png_structp *png_ptr, png_infop *info_ptr, ...@@ -656,7 +656,7 @@ process_data(png_structp *png_ptr, png_infop *info_ptr,
* callback, if you aren't already displaying them there. * callback, if you aren't already displaying them there.
*/ */
png_process_data(*png_ptr, *info_ptr, buffer, length); png_process_data(*png_ptr, *info_ptr, buffer, length);
return (OK); return OK;
} }
info_callback(png_structp png_ptr, png_infop info) info_callback(png_structp png_ptr, png_infop info)
...@@ -746,7 +746,7 @@ void write_png(char *file_name /* , ... other image information ... */) ...@@ -746,7 +746,7 @@ void write_png(char *file_name /* , ... other image information ... */)
/* Open the file */ /* Open the file */
fp = fopen(file_name, "wb"); fp = fopen(file_name, "wb");
if (fp == NULL) if (fp == NULL)
return (ERROR); return ERROR;
/* Create and initialize the png_struct with the desired error handler /* Create and initialize the png_struct with the desired error handler
* functions. If you want to use the default stderr and longjump method, * functions. If you want to use the default stderr and longjump method,
...@@ -759,7 +759,7 @@ void write_png(char *file_name /* , ... other image information ... */) ...@@ -759,7 +759,7 @@ void write_png(char *file_name /* , ... other image information ... */)
if (png_ptr == NULL) if (png_ptr == NULL)
{ {
fclose(fp); fclose(fp);
return (ERROR); return ERROR;
} }
/* Allocate/initialize the image information data. REQUIRED. */ /* Allocate/initialize the image information data. REQUIRED. */
...@@ -768,7 +768,7 @@ void write_png(char *file_name /* , ... other image information ... */) ...@@ -768,7 +768,7 @@ void write_png(char *file_name /* , ... other image information ... */)
{ {
fclose(fp); fclose(fp);
png_destroy_write_struct(&png_ptr, NULL); png_destroy_write_struct(&png_ptr, NULL);
return (ERROR); return ERROR;
} }
/* Set up error handling. REQUIRED if you aren't supplying your own /* Set up error handling. REQUIRED if you aren't supplying your own
...@@ -779,7 +779,7 @@ void write_png(char *file_name /* , ... other image information ... */) ...@@ -779,7 +779,7 @@ void write_png(char *file_name /* , ... other image information ... */)
/* If we get here, we had a problem writing the file. */ /* If we get here, we had a problem writing the file. */
fclose(fp); fclose(fp);
png_destroy_write_struct(&png_ptr, &info_ptr); png_destroy_write_struct(&png_ptr, &info_ptr);
return (ERROR); return ERROR;
} }
/* One of the following I/O initialization functions is REQUIRED. */ /* One of the following I/O initialization functions is REQUIRED. */
...@@ -1034,7 +1034,7 @@ void write_png(char *file_name /* , ... other image information ... */) ...@@ -1034,7 +1034,7 @@ void write_png(char *file_name /* , ... other image information ... */)
fclose(fp); fclose(fp);
/* That's it! */ /* That's it! */
return (OK); return OK;
} }
#endif /* if 0 */ #endif /* if 0 */
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
/* pngdebug.h - Debugging macros for libpng, also used in pngtest.c /* pngdebug.h - Debugging macros for libpng, also used in pngtest.c
* *
* Copyright (c) 2018 Cosmin Truta * Copyright (c) 2018 Cosmin Truta
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
source/Irrlicht/libpng/pngtest.png

8.55 KB | W: | H:

source/Irrlicht/libpng/pngtest.png

8.62 KB | W: | H:

source/Irrlicht/libpng/pngtest.png
source/Irrlicht/libpng/pngtest.png
source/Irrlicht/libpng/pngtest.png
source/Irrlicht/libpng/pngtest.png
  • 2-up
  • Swipe
  • Onion skin
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment