Skip to content

Commit 35bc000

Browse files
dudantaslibergod
authored andcommitted
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 4475b6c commit 35bc000

File tree

4 files changed

+470
-1039
lines changed

4 files changed

+470
-1039
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)
@@ -509,6 +510,7 @@ if(MSVC)
509510
${CMAKE_THREAD_LIBS_INIT}
510511
${PHYSFS_LIBRARY}
511512
${ZLIB_LIBRARY}
513+
PNG::PNG
512514
${NLOHMANN_JSON_LIBRARY}
513515
${OPENGL_LIBRARIES}
514516
${DirectX_LIBRARY}
@@ -555,6 +557,7 @@ elseif(ANDROID)
555557
${LUAJIT_LIBRARY}
556558
${PHYSFS_LIBRARY}
557559
${ZLIB_LIBRARY}
560+
PNG::PNG
558561
${NLOHMANN_JSON_LIBRARY}
559562
${EGL_LIBRARY}
560563
${OGG_LIBRARY}
@@ -602,6 +605,7 @@ elseif(WASM)
602605
${LUA_LIBRARY}
603606
${PHYSFS_LIBRARY}
604607
${ZLIB_LIBRARY}
608+
PNG::PNG
605609
${PROTOBUF_LIBRARY}
606610
${NLOHMANN_JSON_LIBRARY}
607611
${GLEW_LIBRARY}

0 commit comments

Comments
 (0)