Compare commits

...

3 Commits

Author SHA1 Message Date
njohnson
c3d75e4a97 Merge branch 'alpha'
Some checks failed
CI Build / build-macos (push) Failing after 27s
CI Build / build-windows (push) Failing after 7m50s
2026-01-13 14:29:48 -05:00
njohnson
51d632dd90 Fix macOS build: wrap Xbox SDK code with Q_OS_WIN guards
The xcompress.h header and XMem compression functions require Windows.h
and the Xbox SDK, which are not available on macOS. Wrap all XMem
functions with #ifdef Q_OS_WIN and provide stub implementations that
return empty data on non-Windows platforms.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-13 14:27:34 -05:00
njohnson
41cb33b5b5 Adding test file to trigger pipeline. 2026-01-13 14:26:26 -05:00
2 changed files with 38 additions and 0 deletions

View File

@ -1,6 +1,9 @@
#include "compression.h"
#include "minilzo.h"
#ifdef Q_OS_WIN
#include "xcompress.h"
#endif
// libmspack for LZX decompression
extern "C" {
@ -229,6 +232,7 @@ QString Compression::quickBmsPath()
return s_quickBmsPath;
}
#ifdef Q_OS_WIN
QByteArray Compression::CompressXMem(const QByteArray &data)
{
XMEMCODEC_PARAMETERS_LZX lzxParams = {};
@ -253,7 +257,15 @@ QByteArray Compression::CompressXMem(const QByteArray &data)
output.resize(static_cast<int>(actualSize));
return output;
}
#else
QByteArray Compression::CompressXMem(const QByteArray &)
{
qWarning() << "XMem compression not available on this platform";
return {};
}
#endif
#ifdef Q_OS_WIN
QByteArray Compression::DecompressXMem(const QByteArray &data,
int flags, int windowSize, int partSize)
{
@ -479,6 +491,32 @@ QByteArray Compression::DecompressXMemRaw(const QByteArray &data, int flags, int
XMemDestroyDecompressionContext(ctx);
return output;
}
#else
// Non-Windows stub implementations
QByteArray Compression::DecompressXMem(const QByteArray &, int, int, int)
{
qWarning() << "XMem decompression not available on this platform";
return {};
}
QByteArray Compression::DecompressXMemNative(const QByteArray &)
{
qWarning() << "XMem native decompression not available on this platform";
return {};
}
QByteArray Compression::DecompressXMemTDecode(const QByteArray &, int, int, int)
{
qWarning() << "XMem TDecode decompression not available on this platform";
return {};
}
QByteArray Compression::DecompressXMemRaw(const QByteArray &, int, int, int)
{
qWarning() << "XMem raw decompression not available on this platform";
return {};
}
#endif
// ============================================================================
// lzxdhelper-style LZX decompression (UE Viewer/Gildor approach)

0
test_1 Normal file
View File