You've already forked UnrealEngineUWP
mirror of
https://github.com/izzy2lost/UnrealEngineUWP.git
synced 2026-03-26 18:15:20 -07:00
#rb none #rnx #preflight 61680e471ae4f30001ad7f0b [CL 17814766 by Martin Ridgers in ue5-main branch]
56 lines
1.3 KiB
C++
56 lines
1.3 KiB
C++
// Copyright Epic Games, Inc. All Rights Reserved.
|
|
|
|
#include "CoreTypes.h"
|
|
|
|
THIRD_PARTY_INCLUDES_START
|
|
#if defined(_MSC_VER)
|
|
# pragma warning(push)
|
|
# pragma warning(disable : 6239)
|
|
#endif
|
|
|
|
#if !defined(TRACE_PRIVATE_EXTERNAL_LZ4)
|
|
# define LZ4_NAMESPACE Trace
|
|
# include "LZ4/lz4.c.inl"
|
|
# undef LZ4_NAMESPACE
|
|
# define TRACE_PRIVATE_LZ4_NAMESPACE ::Trace::
|
|
#else
|
|
# define TRACE_PRIVATE_LZ4_NAMESPACE
|
|
#endif
|
|
|
|
#if defined(_MSC_VER)
|
|
# pragma warning(pop)
|
|
#endif
|
|
THIRD_PARTY_INCLUDES_END
|
|
|
|
namespace UE {
|
|
namespace Trace {
|
|
namespace Private {
|
|
|
|
////////////////////////////////////////////////////////////////////////////////
|
|
int32 Encode(const void* Src, int32 SrcSize, void* Dest, int32 DestSize)
|
|
{
|
|
return TRACE_PRIVATE_LZ4_NAMESPACE LZ4_compress_fast(
|
|
(const char*)Src,
|
|
(char*)Dest,
|
|
SrcSize,
|
|
DestSize,
|
|
1 // increase by 1 for small speed increase
|
|
);
|
|
}
|
|
|
|
////////////////////////////////////////////////////////////////////////////////
|
|
uint32 GetEncodeMaxSize(uint32 InputSize)
|
|
{
|
|
return LZ4_COMPRESSBOUND(InputSize);
|
|
}
|
|
|
|
////////////////////////////////////////////////////////////////////////////////
|
|
TRACELOG_API int32 Decode(const void* Src, int32 SrcSize, void* Dest, int32 DestSize)
|
|
{
|
|
return TRACE_PRIVATE_LZ4_NAMESPACE LZ4_decompress_safe((const char*)Src, (char*)Dest, SrcSize, DestSize);
|
|
}
|
|
|
|
} // namespace Private
|
|
} // namespace Trace
|
|
} // namespace UE
|