summaryrefslogtreecommitdiffstats
path: root/src/core/loader
diff options
context:
space:
mode:
authorunknown <FreddyFunk@users.noreply.github.com>2019-02-07 19:40:39 +0100
committerunknown <FreddyFunk@users.noreply.github.com>2019-03-29 16:42:34 +0100
commit6a1a2d4aa54c314b372477bfaeb91e44cebe7df0 (patch)
tree143c14c57c33474294c6b90a8c74cbb016eebb63 /src/core/loader
parentgl_shader_disk_cache: Use better compression for transferable and precompiled shader disk chache files (diff)
downloadyuzu-6a1a2d4aa54c314b372477bfaeb91e44cebe7df0.tar
yuzu-6a1a2d4aa54c314b372477bfaeb91e44cebe7df0.tar.gz
yuzu-6a1a2d4aa54c314b372477bfaeb91e44cebe7df0.tar.bz2
yuzu-6a1a2d4aa54c314b372477bfaeb91e44cebe7df0.tar.lz
yuzu-6a1a2d4aa54c314b372477bfaeb91e44cebe7df0.tar.xz
yuzu-6a1a2d4aa54c314b372477bfaeb91e44cebe7df0.tar.zst
yuzu-6a1a2d4aa54c314b372477bfaeb91e44cebe7df0.zip
Diffstat (limited to 'src/core/loader')
-rw-r--r--src/core/loader/nso.cpp17
1 files changed, 7 insertions, 10 deletions
diff --git a/src/core/loader/nso.cpp b/src/core/loader/nso.cpp
index 714d85a59..8aeabe409 100644
--- a/src/core/loader/nso.cpp
+++ b/src/core/loader/nso.cpp
@@ -4,7 +4,8 @@
#include <cinttypes>
#include <vector>
-#include <lz4.h>
+
+#include "common/data_compression.h"
#include "common/common_funcs.h"
#include "common/file_util.h"
#include "common/hex_util.h"
@@ -35,15 +36,11 @@ static_assert(sizeof(MODHeader) == 0x1c, "MODHeader has incorrect size.");
std::vector<u8> DecompressSegment(const std::vector<u8>& compressed_data,
const NSOSegmentHeader& header) {
- std::vector<u8> uncompressed_data(header.size);
- const int bytes_uncompressed =
- LZ4_decompress_safe(reinterpret_cast<const char*>(compressed_data.data()),
- reinterpret_cast<char*>(uncompressed_data.data()),
- static_cast<int>(compressed_data.size()), header.size);
-
- ASSERT_MSG(bytes_uncompressed == static_cast<int>(header.size) &&
- bytes_uncompressed == static_cast<int>(uncompressed_data.size()),
- "{} != {} != {}", bytes_uncompressed, header.size, uncompressed_data.size());
+ const std::vector<u8> uncompressed_data =
+ Compression::DecompressDataLZ4(compressed_data, header.size);
+
+ ASSERT_MSG(uncompressed_data.size() == static_cast<int>(header.size),
+ "{} != {}", header.size, uncompressed_data.size());
return uncompressed_data;
}