From e716d05cec1cfaaa5646bf2328e52c010fa52343 Mon Sep 17 00:00:00 2001 From: Jack Andersen Date: Wed, 19 Dec 2018 17:45:48 -1000 Subject: [PATCH] Switch to lzokay library --- .idea/vcs.xml | 1 + DataSpec/CMakeLists.txt | 2 +- DataSpec/DNAMP1/PAK.cpp | 6 +++--- DataSpec/DNAMP2/MREA.cpp | 6 +++--- DataSpec/DNAMP3/PAK.cpp | 4 ++-- DataSpec/DNAMP3/PAK.hpp | 2 +- Editor/CMakeLists.txt | 2 +- amuse | 2 +- hecl | 2 +- mpcksum/CMakeLists.txt | 2 +- visigen/CMakeLists.txt | 2 +- 11 files changed, 16 insertions(+), 15 deletions(-) diff --git a/.idea/vcs.xml b/.idea/vcs.xml index e288eb80f..fc6740e26 100644 --- a/.idea/vcs.xml +++ b/.idea/vcs.xml @@ -11,6 +11,7 @@ + diff --git a/DataSpec/CMakeLists.txt b/DataSpec/CMakeLists.txt index 0e69fa653..57ab64582 100644 --- a/DataSpec/CMakeLists.txt +++ b/DataSpec/CMakeLists.txt @@ -30,7 +30,7 @@ macro(dataspec_add_list rel_path a_list) set(${a_list} "${tmp_list}") endmacro(dataspec_add_list) -include_directories(${ZLIB_INCLUDE_DIR} ${LZO_INCLUDE_DIR}) +include_directories(${ZLIB_INCLUDE_DIR} ${LZOKAY_INCLUDE_DIR}) # Each game's DNA library include(DNACommon/CMakeLists.txt) diff --git a/DataSpec/DNAMP1/PAK.cpp b/DataSpec/DNAMP1/PAK.cpp index 266e15060..75a2e7c4d 100644 --- a/DataSpec/DNAMP1/PAK.cpp +++ b/DataSpec/DNAMP1/PAK.cpp @@ -1,5 +1,5 @@ #include -#include +#include #include "DNAMP1.hpp" #include "PAK.hpp" #include "AGSC.hpp" @@ -122,8 +122,8 @@ std::unique_ptr PAK::Entry::getBuffer(const nod::Node& pak, atUint64& strm->read(&chunkSz, 2); chunkSz = hecl::SBig(chunkSz); strm->read(compBuf, chunkSz); - lzo_uint dsz = rem; - lzo1x_decompress(compBuf, chunkSz, bufCur, &dsz, nullptr); + size_t dsz = rem; + lzokay::decompress(compBuf, chunkSz, bufCur, dsz); bufCur += dsz; rem -= dsz; } diff --git a/DataSpec/DNAMP2/MREA.cpp b/DataSpec/DNAMP2/MREA.cpp index 2b4ed4a49..ec36bd9e5 100644 --- a/DataSpec/DNAMP2/MREA.cpp +++ b/DataSpec/DNAMP2/MREA.cpp @@ -1,5 +1,5 @@ #include -#include +#include #include "MREA.hpp" #include "../DNAMP1/MREA.hpp" #include "DataSpec/DNACommon/EGMC.hpp" @@ -47,8 +47,8 @@ void MREA::StreamReader::nextBlock() { rem -= chunkSz; } else { m_source.readUBytesToBuf(m_compBuf.get(), chunkSz); - lzo_uint dsz = rem; - lzo1x_decompress(m_compBuf.get(), chunkSz, bufCur, &dsz, nullptr); + size_t dsz = rem; + lzokay::decompress(m_compBuf.get(), chunkSz, bufCur, dsz); bufCur += dsz; rem -= dsz; } diff --git a/DataSpec/DNAMP3/PAK.cpp b/DataSpec/DNAMP3/PAK.cpp index 69163f549..fd55153e7 100644 --- a/DataSpec/DNAMP3/PAK.cpp +++ b/DataSpec/DNAMP3/PAK.cpp @@ -179,8 +179,8 @@ std::unique_ptr PAK::Entry::getBuffer(const nod::Node& pak, atUint64& while (rem) { atUint16 chunkSz = hecl::SBig(*(atUint16*)compBufCur); compBufCur += 2; - lzo_uint dsz = rem; - lzo1x_decompress(compBufCur, chunkSz, bufCur, &dsz, nullptr); + size_t dsz = rem; + lzokay::decompress(compBufCur, chunkSz, bufCur, dsz); compBufCur += chunkSz; bufCur += dsz; rem -= dsz; diff --git a/DataSpec/DNAMP3/PAK.hpp b/DataSpec/DNAMP3/PAK.hpp index b1283a563..898b7031a 100644 --- a/DataSpec/DNAMP3/PAK.hpp +++ b/DataSpec/DNAMP3/PAK.hpp @@ -2,7 +2,7 @@ #include -#include +#include #include #include "DataSpec/DNACommon/PAK.hpp" diff --git a/Editor/CMakeLists.txt b/Editor/CMakeLists.txt index 1249ff332..c6a86b9ea 100644 --- a/Editor/CMakeLists.txt +++ b/Editor/CMakeLists.txt @@ -107,7 +107,7 @@ target_link_libraries(urde hecl-full hecl-blender-addon athena-core nod logvisor athena-libyaml amuse boo ${PNG_LIB} libjpeg-turbo squish xxhash zeus - kabufuda jbus discord-rpc ${ZLIB_LIBRARIES} ${LZO_LIB} + kabufuda jbus discord-rpc ${ZLIB_LIBRARIES} lzokay ${BOO_SYS_LIBS} ${URDE_PLAT_LIBS}) if(COMMAND add_sanitizers) add_sanitizers(urde) diff --git a/amuse b/amuse index c1c47c51e..7719459ac 160000 --- a/amuse +++ b/amuse @@ -1 +1 @@ -Subproject commit c1c47c51eb3c8ec4378520bfe872407e50c2038b +Subproject commit 7719459ac700a88e67192379770cf38a2d84e7c0 diff --git a/hecl b/hecl index ef8806b1d..9cccdec68 160000 --- a/hecl +++ b/hecl @@ -1 +1 @@ -Subproject commit ef8806b1d3789f992beb86c29679ffe36a9a25d6 +Subproject commit 9cccdec68251f4ae70810131160d05f823dd3595 diff --git a/mpcksum/CMakeLists.txt b/mpcksum/CMakeLists.txt index 3b58d8c5f..426f90f71 100644 --- a/mpcksum/CMakeLists.txt +++ b/mpcksum/CMakeLists.txt @@ -3,4 +3,4 @@ include_directories(${CMAKE_CURRENT_SOURCE_DIR} ./../Runtime) add_executable(mpcksum main.cpp) target_link_libraries(mpcksum - athena-core athena-libyaml z lzo2) + athena-core athena-libyaml z lzokay) diff --git a/visigen/CMakeLists.txt b/visigen/CMakeLists.txt index 1bacf8d19..3c6917cb1 100644 --- a/visigen/CMakeLists.txt +++ b/visigen/CMakeLists.txt @@ -33,5 +33,5 @@ if(APPLE) endif() target_link_libraries(visigen logvisor athena-core athena-libyaml zeus glew - xxhash ${ZLIB_LIBRARIES} ${LZO_LIB} ${BOO_SYS_LIBS} ${PLAT_LIBS}) + xxhash ${ZLIB_LIBRARIES} lzokay ${BOO_SYS_LIBS} ${PLAT_LIBS}) endif()