Switch to lzokay library

This commit is contained in:
Jack Andersen 2018-12-19 17:45:48 -10:00
parent b7f35e0528
commit e716d05cec
11 changed files with 16 additions and 15 deletions

View File

@ -11,6 +11,7 @@
<mapping directory="$PROJECT_DIR$/hecl" vcs="Git" /> <mapping directory="$PROJECT_DIR$/hecl" vcs="Git" />
<mapping directory="$PROJECT_DIR$/hecl-gui" vcs="Git" /> <mapping directory="$PROJECT_DIR$/hecl-gui" vcs="Git" />
<mapping directory="$PROJECT_DIR$/hecl/extern/athena" vcs="Git" /> <mapping directory="$PROJECT_DIR$/hecl/extern/athena" vcs="Git" />
<mapping directory="$PROJECT_DIR$/hecl/extern/athena/extern/lzokay" vcs="Git" />
<mapping directory="$PROJECT_DIR$/hecl/extern/boo" vcs="Git" /> <mapping directory="$PROJECT_DIR$/hecl/extern/boo" vcs="Git" />
<mapping directory="$PROJECT_DIR$/hecl/extern/boo/glslang" vcs="Git" /> <mapping directory="$PROJECT_DIR$/hecl/extern/boo/glslang" vcs="Git" />
<mapping directory="$PROJECT_DIR$/hecl/extern/boo/lib/graphicsdev/nx/libdrm_nouveau" vcs="Git" /> <mapping directory="$PROJECT_DIR$/hecl/extern/boo/lib/graphicsdev/nx/libdrm_nouveau" vcs="Git" />

View File

@ -30,7 +30,7 @@ macro(dataspec_add_list rel_path a_list)
set(${a_list} "${tmp_list}") set(${a_list} "${tmp_list}")
endmacro(dataspec_add_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 # Each game's DNA library
include(DNACommon/CMakeLists.txt) include(DNACommon/CMakeLists.txt)

View File

@ -1,5 +1,5 @@
#include <zlib.h> #include <zlib.h>
#include <lzo/lzo1x.h> #include <lzokay.hpp>
#include "DNAMP1.hpp" #include "DNAMP1.hpp"
#include "PAK.hpp" #include "PAK.hpp"
#include "AGSC.hpp" #include "AGSC.hpp"
@ -122,8 +122,8 @@ std::unique_ptr<atUint8[]> PAK::Entry::getBuffer(const nod::Node& pak, atUint64&
strm->read(&chunkSz, 2); strm->read(&chunkSz, 2);
chunkSz = hecl::SBig(chunkSz); chunkSz = hecl::SBig(chunkSz);
strm->read(compBuf, chunkSz); strm->read(compBuf, chunkSz);
lzo_uint dsz = rem; size_t dsz = rem;
lzo1x_decompress(compBuf, chunkSz, bufCur, &dsz, nullptr); lzokay::decompress(compBuf, chunkSz, bufCur, dsz);
bufCur += dsz; bufCur += dsz;
rem -= dsz; rem -= dsz;
} }

View File

@ -1,5 +1,5 @@
#include <athena/FileWriter.hpp> #include <athena/FileWriter.hpp>
#include <lzo/lzo1x.h> #include <lzokay.hpp>
#include "MREA.hpp" #include "MREA.hpp"
#include "../DNAMP1/MREA.hpp" #include "../DNAMP1/MREA.hpp"
#include "DataSpec/DNACommon/EGMC.hpp" #include "DataSpec/DNACommon/EGMC.hpp"
@ -47,8 +47,8 @@ void MREA::StreamReader::nextBlock() {
rem -= chunkSz; rem -= chunkSz;
} else { } else {
m_source.readUBytesToBuf(m_compBuf.get(), chunkSz); m_source.readUBytesToBuf(m_compBuf.get(), chunkSz);
lzo_uint dsz = rem; size_t dsz = rem;
lzo1x_decompress(m_compBuf.get(), chunkSz, bufCur, &dsz, nullptr); lzokay::decompress(m_compBuf.get(), chunkSz, bufCur, dsz);
bufCur += dsz; bufCur += dsz;
rem -= dsz; rem -= dsz;
} }

View File

@ -179,8 +179,8 @@ std::unique_ptr<atUint8[]> PAK::Entry::getBuffer(const nod::Node& pak, atUint64&
while (rem) { while (rem) {
atUint16 chunkSz = hecl::SBig(*(atUint16*)compBufCur); atUint16 chunkSz = hecl::SBig(*(atUint16*)compBufCur);
compBufCur += 2; compBufCur += 2;
lzo_uint dsz = rem; size_t dsz = rem;
lzo1x_decompress(compBufCur, chunkSz, bufCur, &dsz, nullptr); lzokay::decompress(compBufCur, chunkSz, bufCur, dsz);
compBufCur += chunkSz; compBufCur += chunkSz;
bufCur += dsz; bufCur += dsz;
rem -= dsz; rem -= dsz;

View File

@ -2,7 +2,7 @@
#include <unordered_map> #include <unordered_map>
#include <lzo/lzo1x.h> #include <lzokay.hpp>
#include <nod/DiscBase.hpp> #include <nod/DiscBase.hpp>
#include "DataSpec/DNACommon/PAK.hpp" #include "DataSpec/DNACommon/PAK.hpp"

View File

@ -107,7 +107,7 @@ target_link_libraries(urde
hecl-full hecl-blender-addon hecl-full hecl-blender-addon
athena-core nod logvisor athena-libyaml amuse boo athena-core nod logvisor athena-libyaml amuse boo
${PNG_LIB} libjpeg-turbo squish xxhash zeus ${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}) ${BOO_SYS_LIBS} ${URDE_PLAT_LIBS})
if(COMMAND add_sanitizers) if(COMMAND add_sanitizers)
add_sanitizers(urde) add_sanitizers(urde)

2
amuse

@ -1 +1 @@
Subproject commit c1c47c51eb3c8ec4378520bfe872407e50c2038b Subproject commit 7719459ac700a88e67192379770cf38a2d84e7c0

2
hecl

@ -1 +1 @@
Subproject commit ef8806b1d3789f992beb86c29679ffe36a9a25d6 Subproject commit 9cccdec68251f4ae70810131160d05f823dd3595

View File

@ -3,4 +3,4 @@ include_directories(${CMAKE_CURRENT_SOURCE_DIR} ./../Runtime)
add_executable(mpcksum main.cpp) add_executable(mpcksum main.cpp)
target_link_libraries(mpcksum target_link_libraries(mpcksum
athena-core athena-libyaml z lzo2) athena-core athena-libyaml z lzokay)

View File

@ -33,5 +33,5 @@ if(APPLE)
endif() endif()
target_link_libraries(visigen logvisor athena-core athena-libyaml zeus glew 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() endif()