Skip to content

Commit 358e66f

Browse files
committed
Refactor APNG loader to use libpng-based implementation
Replaces the custom APNG loading and saving logic in apngloader.cpp with a new implementation based on libpng, moved to apng_png.hpp. Updates CMakeLists.txt to require PNG, and ensures libpng is built with APNG support. This change modernizes and simplifies APNG handling, improving maintainability and leveraging standard library support.
1 parent d8d9e72 commit 358e66f

File tree

4 files changed

+470
-1041
lines changed

4 files changed

+470
-1041
lines changed

src/CMakeLists.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,7 @@ add_definitions(-D"BUILD_REVISION=\\\"${BUILD_REVISION}\\\"")
180180
find_package(OpenSSL QUIET)
181181
find_package(PhysFS REQUIRED)
182182
find_package(ZLIB REQUIRED)
183+
find_package(PNG REQUIRED)
183184
find_package(phmap REQUIRED)
184185
find_package(absl CONFIG REQUIRED)
185186
find_package(Protobuf REQUIRED)
@@ -500,6 +501,7 @@ if(MSVC)
500501
${CMAKE_THREAD_LIBS_INIT}
501502
${PHYSFS_LIBRARY}
502503
${ZLIB_LIBRARY}
504+
PNG::PNG
503505
${NLOHMANN_JSON_LIBRARY}
504506
${OPENGL_LIBRARIES}
505507
${DirectX_LIBRARY}
@@ -545,6 +547,7 @@ elseif(ANDROID)
545547
${LUAJIT_LIBRARY}
546548
${PHYSFS_LIBRARY}
547549
${ZLIB_LIBRARY}
550+
PNG::PNG
548551
${NLOHMANN_JSON_LIBRARY}
549552
${EGL_LIBRARY}
550553
${OGG_LIBRARY}
@@ -591,6 +594,7 @@ elseif(WASM)
591594
${LUA_LIBRARY}
592595
${PHYSFS_LIBRARY}
593596
${ZLIB_LIBRARY}
597+
PNG::PNG
594598
${PROTOBUF_LIBRARY}
595599
${NLOHMANN_JSON_LIBRARY}
596600
${GLEW_LIBRARY}

0 commit comments

Comments
 (0)