diff --git a/app/app.pro b/app/app.pro index 1cbef80..d4823c0 100644 --- a/app/app.pro +++ b/app/app.pro @@ -13,9 +13,9 @@ FORMS += $$files($$PWD/*.ui) RESOURCES += ../data/data.qrc LIBS += \ - -L$$PWD/../third_party/devil_sdk/lib/ -lDevIL -lILU -lILUT \ - -L$$PWD/../third_party/zlib/lib/ -lzlib \ - -L$$PWD/../third_party/xbox_sdk/lib -lxcompress64 \ + #-L$$PWD/../third_party/devil_sdk/lib/ -lDevIL -lILU -lILUT \ + #-L$$PWD/../third_party/zlib/lib/ -lzlib \ + #-L$$PWD/../third_party/xbox_sdk/lib -lxcompress64 \ -L$$OUT_PWD/../libs/ -lcore \ -L$$OUT_PWD/../libs/ -lxassets\ -L$$OUT_PWD/../libs/ -lcompression \ @@ -27,9 +27,9 @@ LIBS += \ -L$$OUT_PWD/../libs/ -lzonefile INCLUDEPATH += \ - $$PWD/../third_party/devil_sdk/include/ \ - $$PWD/../third_party/zlib/include \ - $$PWD/../third_party/xbox_sdk/include \ + #$$PWD/../third_party/devil_sdk/include/ \ + #$$PWD/../third_party/zlib/include \ + #$$PWD/../third_party/xbox_sdk/include \ $$PWD/../libs/core \ $$PWD/../libs/compression \ $$PWD/../libs/encryption \ @@ -41,9 +41,9 @@ INCLUDEPATH += \ $$PWD/../libs/zonefile DEPENDPATH += \ - $$PWD/../third_party/devil_sdk/include/ \ - $$PWD/../third_party/zlib/include \ - $$PWD/../third_party/xbox_sdk/include \ + #$$PWD/../third_party/devil_sdk/include/ \ + #$$PWD/../third_party/zlib/include \ + #$$PWD/../third_party/xbox_sdk/include \ $$PWD/../libs/core \ $$PWD/../libs/compression \ $$PWD/../libs/encryption \ diff --git a/app/mainwindow.cpp b/app/mainwindow.cpp index a79a918..448a203 100644 --- a/app/mainwindow.cpp +++ b/app/mainwindow.cpp @@ -1,4 +1,5 @@ #include "mainwindow.h" +#include "qtimer.h" #include "ui_mainwindow.h" #include "aboutdialog.h" @@ -10,9 +11,7 @@ #include "materialviewer.h" #include "preferenceeditor.h" #include "reportissuedialog.h" -#include "rumblefileviewer.h" #include "rumblegraphviewer.h" -#include "soundviewer.h" #include "stringtableviewer.h" #include "techsetviewer.h" #include "fastfile_factory.h" @@ -24,12 +23,11 @@ #include "ipak_structs.h" #include "iwiviewer.h" #include "localstringviewer.h" -#include "imagewidget.h" #include "zonefileviewer.h" #include "techsetviewer.h" #include "logmanager.h" -#include +#include MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), ui(new Ui::MainWindow) { @@ -37,6 +35,8 @@ MainWindow::MainWindow(QWidget *parent) setAcceptDrops(true); + XAsset::SetDebug(true); + mTypeMap = QMap(); mTypeOrder = QStringList(); mRawFileMap = QMap(); @@ -541,6 +541,21 @@ bool MainWindow::OpenFastFile(const QString aFastFilePath) { return true; } +bool MainWindow::OpenFastFile(const QByteArray& aFastFileData, const QString aFastFilePath) { + const QString fastFileStem = aFastFilePath.section("/", -1, -1); + if (mTreeWidget->HasFastFile(fastFileStem)) { + LogManager::instance().addError("Can't add duplicate file!"); + return false; + } + + FastFile* fastFile = FastFileFactory::Create(aFastFileData); + fastFile->SetStem(fastFileStem); + mTreeWidget->AddFastFile(fastFile); + + // Open zone file after decompressing ff and writing + return true; +} + /* OpenFastFile() @@ -550,18 +565,11 @@ bool MainWindow::OpenFastFile(const QString aFastFilePath) { bool MainWindow::OpenFastFile() { // Open file dialog to steam apps const QString steamPath = "C:/Program Files (x86)/Steam/steamapps/common/Call of Duty World at War/zone/english/"; - const QString fastFilePath = QFileDialog::getOpenFileName(this, "Open Fast File", steamPath, "Fast File (*.ff);;All Files (*.*)"); - if (fastFilePath.isNull()) { - // User pressed cancel - return false; - } else if (!QFile::exists(fastFilePath)) { - QMessageBox::warning(this, "Warning!", QString("%1 does not exist!.").arg(fastFilePath)); - return false; - } - if (!OpenFastFile(fastFilePath)) { - qDebug() << "Failed to open Fast file!"; - return false; - } + + QFileDialog::getOpenFileContent(tr("Fast File (*.ff);;All Files (*.*)"), [this](const QString &fileName, const QByteArray &data){ + OpenFastFile(data, fileName); + }); + return true; } diff --git a/app/mainwindow.h b/app/mainwindow.h index 8266e2b..7b2c3c8 100644 --- a/app/mainwindow.h +++ b/app/mainwindow.h @@ -15,7 +15,6 @@ #include #include #include -#include QT_BEGIN_NAMESPACE namespace Ui { @@ -34,6 +33,7 @@ public: private slots: bool OpenFastFile(const QString aFastFilePath); + bool OpenFastFile(const QByteArray& aFastFileData, const QString aFastFilePath); bool OpenFastFile(); bool OpenZoneFile(const QString aZoneFilePath, bool fromFF = false); diff --git a/data/Data.qrc b/data/Data.qrc index e967e7b..1de200b 100644 --- a/data/Data.qrc +++ b/data/Data.qrc @@ -20,7 +20,6 @@ icons/Icon_Editor.png icons/Icon_Views.png icons/Icon_Tree.png - icons/Icon_Copy.png icons/Icon_Cut.png icons/Icon_Find.png icons/Icon_NewFile.png diff --git a/libs/compression/compression.cpp b/libs/compression/compression.cpp index 5029276..0570cb1 100644 --- a/libs/compression/compression.cpp +++ b/libs/compression/compression.cpp @@ -1,8 +1,8 @@ #include "compression.h" //#include "minilzo.h" -#define XBOXAPI __declspec(dllimport) -#include "xcompress.h" +//#define XBOXAPI __declspec(dllimport) +//#include "xcompress.h" #include #include @@ -11,61 +11,63 @@ QByteArray Compression::CompressXMem(const QByteArray &data) { - XMEMCODEC_PARAMETERS_LZX lzxParams = {}; - lzxParams.Flags = 0; - lzxParams.WindowSize = 0x20000; - lzxParams.CompressionPartitionSize = 0x80000; + // XMEMCODEC_PARAMETERS_LZX lzxParams = {}; + // lzxParams.Flags = 0; + // lzxParams.WindowSize = 0x20000; + // lzxParams.CompressionPartitionSize = 0x80000; - XMEMCOMPRESSION_CONTEXT ctx = nullptr; - if (FAILED(XMemCreateCompressionContext(XMEMCODEC_LZX, &lzxParams, 0, &ctx)) || !ctx) - return QByteArray(); + // XMEMCOMPRESSION_CONTEXT ctx = nullptr; + // if (FAILED(XMemCreateCompressionContext(XMEMCODEC_LZX, &lzxParams, 0, &ctx)) || !ctx) + // return QByteArray(); - SIZE_T estimatedSize = data.size() + XCOMPRESS_LZX_BLOCK_GROWTH_SIZE_MAX; - QByteArray output(static_cast(estimatedSize), 0); - SIZE_T actualSize = estimatedSize; + // SIZE_T estimatedSize = data.size() + XCOMPRESS_LZX_BLOCK_GROWTH_SIZE_MAX; + // QByteArray output(static_cast(estimatedSize), 0); + // SIZE_T actualSize = estimatedSize; - HRESULT hr = XMemCompress(ctx, output.data(), &actualSize, data.constData(), data.size()); - XMemDestroyCompressionContext(ctx); + // HRESULT hr = XMemCompress(ctx, output.data(), &actualSize, data.constData(), data.size()); + // XMemDestroyCompressionContext(ctx); - if (FAILED(hr)) - return QByteArray(); + // if (FAILED(hr)) + // return QByteArray(); - output.resize(static_cast(actualSize)); - return output; + // output.resize(static_cast(actualSize)); + // return output; + return QByteArray(); } QByteArray Compression::DecompressXMem(const QByteArray &data, int flags, int windowSize, int partSize) { - if (data.isEmpty()) - return {}; + // if (data.isEmpty()) + // return {}; - XMEMCODEC_PARAMETERS_LZX lzxParams = {}; - lzxParams.Flags = flags; - lzxParams.WindowSize = windowSize; - lzxParams.CompressionPartitionSize = partSize; + // XMEMCODEC_PARAMETERS_LZX lzxParams = {}; + // lzxParams.Flags = flags; + // lzxParams.WindowSize = windowSize; + // lzxParams.CompressionPartitionSize = partSize; - XMEMDECOMPRESSION_CONTEXT ctx = nullptr; - if (FAILED(XMemCreateDecompressionContext(XMEMCODEC_LZX, &lzxParams, 0, &ctx)) || !ctx) - return {}; + // XMEMDECOMPRESSION_CONTEXT ctx = nullptr; + // if (FAILED(XMemCreateDecompressionContext(XMEMCODEC_LZX, &lzxParams, 0, &ctx)) || !ctx) + // return {}; - // Allocate large enough buffer for decompression (16 MB is a safe upper bound) - const SIZE_T kMaxOutSize = 16 * 1024 * 1024; - QByteArray output(static_cast(kMaxOutSize), Qt::Uninitialized); - SIZE_T actualSize = kMaxOutSize; + // // Allocate large enough buffer for decompression (16 MB is a safe upper bound) + // const SIZE_T kMaxOutSize = 16 * 1024 * 1024; + // QByteArray output(static_cast(kMaxOutSize), Qt::Uninitialized); + // SIZE_T actualSize = kMaxOutSize; - HRESULT hr = XMemDecompress(ctx, - output.data(), &actualSize, - data.constData(), data.size() + 16); + // HRESULT hr = XMemDecompress(ctx, + // output.data(), &actualSize, + // data.constData(), data.size() + 16); - XMemDestroyDecompressionContext(ctx); + // XMemDestroyDecompressionContext(ctx); - if (FAILED(hr)) { - qWarning() << "XMemDecompress failed with HRESULT:" << hr; - return {}; - } + // if (FAILED(hr)) { + // qWarning() << "XMemDecompress failed with HRESULT:" << hr; + // return {}; + // } - output.resize(static_cast(actualSize)); - return output; + // output.resize(static_cast(actualSize)); + // return output; + return QByteArray(); } quint32 Compression::CalculateAdler32Checksum(const QByteArray &data) { diff --git a/libs/compression/compression.h b/libs/compression/compression.h index c57bc57..8026ece 100644 --- a/libs/compression/compression.h +++ b/libs/compression/compression.h @@ -3,7 +3,7 @@ #include "QtZlib/zlib.h" -#include +//#include #include #include #include diff --git a/libs/compression/lzoconf.h b/libs/compression/lzoconf.h index f9a8bdb..d4c7743 100644 --- a/libs/compression/lzoconf.h +++ b/libs/compression/lzoconf.h @@ -105,7 +105,7 @@ extern "C" { # define LZO_INT_MAX 9223372036854775807LL # define LZO_INT_MIN (-1LL - LZO_INT_MAX) # elif (LZO_ABI_IP32L64) /* MIPS R5900 */ - typedef unsigned int lzo_uint; + typedef quint32 lzo_uint; typedef int lzo_int; # define LZO_SIZEOF_LZO_INT LZO_SIZEOF_INT # define LZO_TYPEOF_LZO_INT LZO_TYPEOF_INT diff --git a/libs/compression/lzodefs.h b/libs/compression/lzodefs.h index c3e2bcf..1e347e0 100644 --- a/libs/compression/lzodefs.h +++ b/libs/compression/lzodefs.h @@ -2847,7 +2847,7 @@ LZO_COMPILE_TIME_ASSERT_HEADER(LZO_SIZEOF_PTRDIFF_T == sizeof(ptrdiff_t)) # define LZO_TYPEOF_LZO_INT16E_T LZO_TYPEOF_LONG #elif (LZO_SIZEOF_INT == 2) && !(LZO_CFG_PREFER_TYPEOF_ACC_INT16E_T == LZO_TYPEOF_SHORT) # define lzo_int16e_t int -# define lzo_uint16e_t unsigned int +# define lzo_uint16e_t quint32 # define LZO_TYPEOF_LZO_INT16E_T LZO_TYPEOF_INT #elif (LZO_SIZEOF_SHORT == 2) # define lzo_int16e_t short int @@ -2856,14 +2856,14 @@ LZO_COMPILE_TIME_ASSERT_HEADER(LZO_SIZEOF_PTRDIFF_T == sizeof(ptrdiff_t)) #elif 1 && !(LZO_CFG_TYPE_NO_MODE_HI) && (LZO_CC_CLANG || (LZO_CC_GNUC >= 0x025f00ul) || LZO_CC_LLVM) # if !(LZO_LANG_ASSEMBLER) typedef int lzo_int16e_hi_t__ __attribute__((__mode__(__HI__))); - typedef unsigned int lzo_uint16e_hi_t__ __attribute__((__mode__(__HI__))); + typedef quint32 lzo_uint16e_hi_t__ __attribute__((__mode__(__HI__))); # endif # define lzo_int16e_t lzo_int16e_hi_t__ # define lzo_uint16e_t lzo_uint16e_hi_t__ # define LZO_TYPEOF_LZO_INT16E_T LZO_TYPEOF___MODE_HI #elif (LZO_SIZEOF___INT16 == 2) # define lzo_int16e_t __int16 -# define lzo_uint16e_t unsigned __int16 +# define lzo_uint16e_t quint32 # define LZO_TYPEOF_LZO_INT16E_T LZO_TYPEOF___INT16 #else #endif @@ -2883,7 +2883,7 @@ LZO_COMPILE_TIME_ASSERT_HEADER(LZO_SIZEOF_PTRDIFF_T == sizeof(ptrdiff_t)) # define LZO_TYPEOF_LZO_INT32E_T LZO_TYPEOF_LONG #elif (LZO_SIZEOF_INT == 4) # define lzo_int32e_t int -# define lzo_uint32e_t unsigned int +# define lzo_uint32e_t quint32 # define LZO_TYPEOF_LZO_INT32E_T LZO_TYPEOF_INT #elif (LZO_SIZEOF_SHORT == 4) # define lzo_int32e_t short int @@ -2896,7 +2896,7 @@ LZO_COMPILE_TIME_ASSERT_HEADER(LZO_SIZEOF_PTRDIFF_T == sizeof(ptrdiff_t)) #elif 1 && !(LZO_CFG_TYPE_NO_MODE_SI) && (LZO_CC_CLANG || (LZO_CC_GNUC >= 0x025f00ul) || LZO_CC_LLVM) && (__INT_MAX__+0 > 2147483647L) # if !(LZO_LANG_ASSEMBLER) typedef int lzo_int32e_si_t__ __attribute__((__mode__(__SI__))); - typedef unsigned int lzo_uint32e_si_t__ __attribute__((__mode__(__SI__))); + typedef quint32 lzo_uint32e_si_t__ __attribute__((__mode__(__SI__))); # endif # define lzo_int32e_t lzo_int32e_si_t__ # define lzo_uint32e_t lzo_uint32e_si_t__ @@ -2904,7 +2904,7 @@ LZO_COMPILE_TIME_ASSERT_HEADER(LZO_SIZEOF_PTRDIFF_T == sizeof(ptrdiff_t)) #elif 1 && !(LZO_CFG_TYPE_NO_MODE_SI) && (LZO_CC_GNUC >= 0x025f00ul) && defined(__AVR__) && (__LONG_MAX__+0 == 32767L) # if !(LZO_LANG_ASSEMBLER) typedef int lzo_int32e_si_t__ __attribute__((__mode__(__SI__))); - typedef unsigned int lzo_uint32e_si_t__ __attribute__((__mode__(__SI__))); + typedef quint32 lzo_uint32e_si_t__ __attribute__((__mode__(__SI__))); # endif # define lzo_int32e_t lzo_int32e_si_t__ # define lzo_uint32e_t lzo_uint32e_si_t__ @@ -2913,7 +2913,7 @@ LZO_COMPILE_TIME_ASSERT_HEADER(LZO_SIZEOF_PTRDIFF_T == sizeof(ptrdiff_t)) # define LZO_TYPEOF_LZO_INT32E_T LZO_TYPEOF___MODE_SI #elif (LZO_SIZEOF___INT32 == 4) # define lzo_int32e_t __int32 -# define lzo_uint32e_t unsigned __int32 +# define lzo_uint32e_t quint32 # define LZO_TYPEOF_LZO_INT32E_T LZO_TYPEOF___INT32 #else #endif @@ -2937,7 +2937,7 @@ LZO_COMPILE_TIME_ASSERT_HEADER(LZO_SIZEOF_PTRDIFF_T == sizeof(ptrdiff_t)) #endif #if (LZO_SIZEOF_INT == 8) && (LZO_SIZEOF_INT < LZO_SIZEOF_LONG) # define lzo_int64e_t int -# define lzo_uint64e_t unsigned int +# define lzo_uint64e_t quint32 # define LZO_TYPEOF_LZO_INT64E_T LZO_TYPEOF_INT #elif (LZO_SIZEOF_LONG == 8) && !(LZO_CFG_PREFER_TYPEOF_ACC_INT64E_T == LZO_TYPEOF_LONG_LONG) && !(LZO_CFG_PREFER_TYPEOF_ACC_INT64E_T == LZO_TYPEOF___INT64) # define lzo_int64e_t long int @@ -2984,7 +2984,7 @@ LZO_COMPILE_TIME_ASSERT_HEADER(LZO_SIZEOF_PTRDIFF_T == sizeof(ptrdiff_t)) # define LZO_TYPEOF_LZO_INT32L_T LZO_TYPEOF_LZO_INT32E_T #elif (LZO_SIZEOF_INT >= 4) && (LZO_SIZEOF_INT < LZO_SIZEOF_LONG) # define lzo_int32l_t int -# define lzo_uint32l_t unsigned int +# define lzo_uint32l_t quint32 # define LZO_SIZEOF_LZO_INT32L_T LZO_SIZEOF_INT # define LZO_TYPEOF_LZO_INT32L_T LZO_SIZEOF_INT #elif (LZO_SIZEOF_LONG >= 4) @@ -3057,7 +3057,7 @@ LZO_COMPILE_TIME_ASSERT_HEADER(LZO_SIZEOF_PTRDIFF_T == sizeof(ptrdiff_t)) #elif (LZO_CC_MSC && (_MSC_VER >= 1300) && (LZO_SIZEOF_VOID_P == 4) && (LZO_SIZEOF_INT == 4)) # if !(LZO_LANG_ASSEMBLER) typedef __w64 int lzo_intptr_t; - typedef __w64 unsigned int lzo_uintptr_t; + typedef __w64 quint32 lzo_uintptr_t; # endif # define lzo_intptr_t lzo_intptr_t # define lzo_uintptr_t lzo_uintptr_t @@ -3070,7 +3070,7 @@ LZO_COMPILE_TIME_ASSERT_HEADER(LZO_SIZEOF_PTRDIFF_T == sizeof(ptrdiff_t)) # define LZO_TYPEOF_LZO_INTPTR_T LZO_TYPEOF_SHORT #elif (LZO_SIZEOF_INT >= LZO_SIZEOF_VOID_P) && (LZO_SIZEOF_INT < LZO_SIZEOF_LONG) # define lzo_intptr_t int -# define lzo_uintptr_t unsigned int +# define lzo_uintptr_t quint32 # define LZO_SIZEOF_LZO_INTPTR_T LZO_SIZEOF_INT # define LZO_TYPEOF_LZO_INTPTR_T LZO_TYPEOF_INT #elif (LZO_SIZEOF_LONG >= LZO_SIZEOF_VOID_P) @@ -3104,7 +3104,7 @@ LZO_COMPILE_TIME_ASSERT_HEADER(LZO_SIZEOF_PTRDIFF_T == sizeof(ptrdiff_t)) # define LZO_SIZEOF_LZO_WORD_T LZO_SIZEOF_LONG # define LZO_TYPEOF_LZO_WORD_T LZO_TYPEOF_LONG #elif (LZO_WORDSIZE == LZO_SIZEOF_INT) -# define lzo_word_t unsigned int +# define lzo_word_t quint32 # define lzo_sword_t int # define LZO_SIZEOF_LZO_WORD_T LZO_SIZEOF_INT # define LZO_TYPEOF_LZO_WORD_T LZO_TYPEOF_INT diff --git a/libs/ddsfile/ddsfile.cpp b/libs/ddsfile/ddsfile.cpp index 7e7baf1..52c1c26 100644 --- a/libs/ddsfile/ddsfile.cpp +++ b/libs/ddsfile/ddsfile.cpp @@ -89,92 +89,92 @@ DDSFile::DDSFile(const QString &aFilePath) } DDSFile::DDSFile(const QByteArray aDDSData, const QString aFileStem) { - QDataStream ddsIn(aDDSData); - ddsIn.setByteOrder(QDataStream::LittleEndian); + // QDataStream ddsIn(aDDSData); + // ddsIn.setByteOrder(QDataStream::LittleEndian); - DDSHeader ddsHeader; - if (ddsIn.readRawData(reinterpret_cast(&ddsHeader), sizeof(DDSHeader)) != sizeof(DDSHeader)) { - qDebug() << "Error: Failed to read DDSHeader from QByteArray!"; - return; - } + // DDSHeader ddsHeader; + // if (ddsIn.readRawData(reinterpret_cast(&ddsHeader), sizeof(DDSHeader)) != sizeof(DDSHeader)) { + // qDebug() << "Error: Failed to read DDSHeader from QByteArray!"; + // return; + // } - fileStem = aFileStem; - header = ddsHeader; + // fileStem = aFileStem; + // header = ddsHeader; - // Ensure DevIL is initialized once globally - static bool devilInitialized = false; - if (!devilInitialized) { - ilInit(); - devilInitialized = true; - } + // // Ensure DevIL is initialized once globally + // static bool devilInitialized = false; + // if (!devilInitialized) { + // ilInit(); + // devilInitialized = true; + // } - // Generate and bind an image - ILuint imageID; - ilGenImages(1, &imageID); - ilBindImage(imageID); + // // Generate and bind an image + // ILuint imageID; + // ilGenImages(1, &imageID); + // ilBindImage(imageID); - ilEnable(IL_ORIGIN_SET); - ilOriginFunc(IL_ORIGIN_UPPER_LEFT); + // ilEnable(IL_ORIGIN_SET); + // ilOriginFunc(IL_ORIGIN_UPPER_LEFT); - // Load DDS file - if (!ilLoadL(IL_DDS, aDDSData.constData(), aDDSData.size())) { - ILuint devilError = ilGetError(); - qDebug() << "DevIL Error while loading DDS: " << devilError; - ilDeleteImages(1, &imageID); - return; - } + // // Load DDS file + // if (!ilLoadL(IL_DDS, aDDSData.constData(), aDDSData.size())) { + // ILuint devilError = ilGetError(); + // qDebug() << "DevIL Error while loading DDS: " << devilError; + // ilDeleteImages(1, &imageID); + // return; + // } - // Get mipmap count - ILint numMipmaps = ilGetInteger(IL_NUM_MIPMAPS); - qDebug() << "Number of mipmaps: " << numMipmaps; + // // Get mipmap count + // ILint numMipmaps = ilGetInteger(IL_NUM_MIPMAPS); + // qDebug() << "Number of mipmaps: " << numMipmaps; - // Loop over all mipmap levels (0 is the base image) - for (ILint level = 0; level <= numMipmaps; ++level) { - ilBindImage(imageID); - if (!ilActiveMipmap(level)) { - qDebug() << "DevIL failed to activate mipmap level" << level; - continue; - } + // // Loop over all mipmap levels (0 is the base image) + // for (ILint level = 0; level <= numMipmaps; ++level) { + // ilBindImage(imageID); + // if (!ilActiveMipmap(level)) { + // qDebug() << "DevIL failed to activate mipmap level" << level; + // continue; + // } - // Get mipmap properties - int width = ilGetInteger(IL_IMAGE_WIDTH); - int height = ilGetInteger(IL_IMAGE_HEIGHT); - int depth = ilGetInteger(IL_IMAGE_DEPTH); - int format = ilGetInteger(IL_IMAGE_FORMAT); - int bpp = 0; + // // Get mipmap properties + // int width = ilGetInteger(IL_IMAGE_WIDTH); + // int height = ilGetInteger(IL_IMAGE_HEIGHT); + // int depth = ilGetInteger(IL_IMAGE_DEPTH); + // int format = ilGetInteger(IL_IMAGE_FORMAT); + // int bpp = 0; - switch (format) { - case IL_RGB: - bpp = 3; - break; - case IL_RGBA: - bpp = 4; - break; - default: - qDebug() << "Unsupported image format."; - continue; - } + // switch (format) { + // case IL_RGB: + // bpp = 3; + // break; + // case IL_RGBA: + // bpp = 4; + // break; + // default: + // qDebug() << "Unsupported image format."; + // continue; + // } - int dataSize = width * height * depth * bpp; + // int dataSize = width * height * depth * bpp; - ILubyte *data = ilGetData(); - if (!data) { - qDebug() << "Error: DevIL returned null data for mipmap level" << level; - continue; - } + // ILubyte *data = ilGetData(); + // if (!data) { + // qDebug() << "Error: DevIL returned null data for mipmap level" << level; + // continue; + // } - // Create a mipmap structure - DDSMipmap mipmap; - mipmap.width = width; - mipmap.height = height; - mipmap.data = QByteArray(reinterpret_cast(data), dataSize); - mipmap.size = dataSize; + // // Create a mipmap structure + // DDSMipmap mipmap; + // mipmap.width = width; + // mipmap.height = height; + // mipmap.data = QByteArray(reinterpret_cast(data), dataSize); + // mipmap.size = dataSize; - // Store in DDS file - mipmaps.append(mipmap); - } + // // Store in DDS file + // mipmaps.append(mipmap); + // } - ilDeleteImages(1, &imageID); + // ilDeleteImages(1, &imageID); } DDSFile::DDSFile(const DDSFile &ddsFile) : diff --git a/libs/ddsfile/ddsfile.h b/libs/ddsfile/ddsfile.h index bf43bbf..86cdb32 100644 --- a/libs/ddsfile/ddsfile.h +++ b/libs/ddsfile/ddsfile.h @@ -9,7 +9,7 @@ #include #include #include -#include +//#include struct DDSPixelFormat { quint32 size; diff --git a/libs/ddsfile/ddsfile.pro b/libs/ddsfile/ddsfile.pro index 98a74fc..2660832 100644 --- a/libs/ddsfile/ddsfile.pro +++ b/libs/ddsfile/ddsfile.pro @@ -6,17 +6,17 @@ SOURCES += $$files($$PWD/*.cpp, true) HEADERS += $$files($$PWD/*.h, true) LIBS += \ - -L$$PWD/../../third_party/devil_sdk/lib/ -lDevIL \ - -L$$PWD/../../third_party/devil_sdk/lib/ -lILU \ - -L$$PWD/../../third_party/devil_sdk/lib/ -lILUT \ + #-L$$PWD/../../third_party/devil_sdk/lib/ -lDevIL \ + #-L$$PWD/../../third_party/devil_sdk/lib/ -lILU \ + #-L$$PWD/../../third_party/devil_sdk/lib/ -lILUT \ -L$$OUT_PWD/../libs/iwifile -liwifile INCLUDEPATH += \ $$PWD/../iwifile/ \ - $$PWD/../../third_party/devil_sdk/include/ + #$$PWD/../../third_party/devil_sdk/include/ DEPENDPATH += \ $$PWD/../iwifile/ \ - $$PWD/../../third_party/devil_sdk/include/ + #$$PWD/../../third_party/devil_sdk/include/ DESTDIR = $$OUT_PWD/../ diff --git a/libs/encryption/ecrypt-portable.h b/libs/encryption/ecrypt-portable.h index 972e7e9..8cae0e4 100644 --- a/libs/encryption/ecrypt-portable.h +++ b/libs/encryption/ecrypt-portable.h @@ -27,10 +27,10 @@ /* * The following types are defined (if available): * - * u8: unsigned integer type, at least 8 bits - * u16: unsigned integer type, at least 16 bits - * u32: unsigned integer type, at least 32 bits - * u64: unsigned integer type, at least 64 bits + * u8: quint32eger type, at least 8 bits + * u16: quint32eger type, at least 16 bits + * u32: quint32eger type, at least 32 bits + * u64: quint32eger type, at least 64 bits * * s8, s16, s32, s64 -> signed counterparts of u8, u16, u32, u64 * diff --git a/libs/encryption/encryption.cpp b/libs/encryption/encryption.cpp index 81e2abe..9bbdc10 100644 --- a/libs/encryption/encryption.cpp +++ b/libs/encryption/encryption.cpp @@ -87,7 +87,7 @@ void Encryption::UpdateIVTable(QByteArray &table, int index, const QByteArray &s } quint32 Encryption::ToUInt32(const QByteArray &data, int offset) { - // Converts 4 bytes (starting at offset) from data into a 32-bit unsigned integer (little-endian) + // Converts 4 bytes (starting at offset) from data into a 32-bit quint32eger (little-endian) return ((static_cast(static_cast(data[offset])) ) | (static_cast(static_cast(data[offset+1])) << 8 ) | (static_cast(static_cast(data[offset+2])) << 16) | diff --git a/libs/encryption/salsa20.cpp b/libs/encryption/salsa20.cpp index 272199f..e7254d6 100644 --- a/libs/encryption/salsa20.cpp +++ b/libs/encryption/salsa20.cpp @@ -59,7 +59,7 @@ void ECRYPT_encrypt_bytes(ECRYPT_ctx *x,const u8 *m,u8 *c,u32 bytes) u32 j0, j1, j2, j3, j4, j5, j6, j7, j8, j9, j10, j11, j12, j13, j14, j15; u8 *ctarget; u8 tmp[64]; - unsigned int i; + int i; if (!bytes) return; diff --git a/libs/encryption/sha1.cpp b/libs/encryption/sha1.cpp index 608a3ae..69e1d98 100644 --- a/libs/encryption/sha1.cpp +++ b/libs/encryption/sha1.cpp @@ -10,7 +10,7 @@ Still 100% Public Domain Corrected a problem which generated improper hash values on 16 bit machines Routine SHA1Update changed from - void SHA1Update(SHA1_CTX* context, unsigned char* data, unsigned int + void SHA1Update(SHA1_CTX* context, unsigned char* data, quint32 len) to void SHA1Update(SHA1_CTX* context, unsigned char* data, unsigned @@ -27,7 +27,7 @@ be guaranteed to generate the wrong hash (e.g. Test Vector #3, a million "a"s). I also changed the declaration of variables i & j in SHA1Update to -unsigned long from unsigned int for the same reason. +unsigned long from quint32 for the same reason. These changes should make no difference to any 32 bit implementations since an diff --git a/libs/fastfile/PS3/fastfile_cod4_ps3.cpp b/libs/fastfile/PS3/fastfile_cod4_ps3.cpp index d10bd12..16d59c2 100644 --- a/libs/fastfile/PS3/fastfile_cod4_ps3.cpp +++ b/libs/fastfile/PS3/fastfile_cod4_ps3.cpp @@ -90,7 +90,7 @@ bool FastFile_COD4_PS3::Load(const QByteArray aData) { // Loop until EOF or invalid chunk while (pos <= aData.size()) { // Read 2-byte BIG-ENDIAN chunk size - quint16 chunkSize; + quint32 chunkSize; QDataStream chunkStream(aData.mid(pos, 2)); chunkStream.setByteOrder(QDataStream::BigEndian); chunkStream >> chunkSize; diff --git a/libs/fastfile/PS3/fastfile_cod5_ps3.cpp b/libs/fastfile/PS3/fastfile_cod5_ps3.cpp index fbd6643..0772a20 100644 --- a/libs/fastfile/PS3/fastfile_cod5_ps3.cpp +++ b/libs/fastfile/PS3/fastfile_cod5_ps3.cpp @@ -90,7 +90,7 @@ bool FastFile_COD5_PS3::Load(const QByteArray aData) { // Loop until EOF or invalid chunk while (pos <= aData.size()) { // Read 2-byte BIG-ENDIAN chunk size - quint16 chunkSize; + quint32 chunkSize; QDataStream chunkStream(aData.mid(pos, 2)); chunkStream.setByteOrder(QDataStream::BigEndian); chunkStream >> chunkSize; diff --git a/libs/iwifile/iwifile.h b/libs/iwifile/iwifile.h index 2daf1e8..47bf577 100644 --- a/libs/iwifile/iwifile.h +++ b/libs/iwifile/iwifile.h @@ -30,9 +30,9 @@ struct IWIHeader { struct IWIInfo { quint8 Format; quint8 Usage; - quint16 Width; - quint16 Height; - quint16 Depth; + quint32 Width; + quint32 Height; + quint32 Depth; }; struct IWIMipmap { diff --git a/libs/xassets/xanimdeltapartquat.cpp b/libs/xassets/xanimdeltapartquat.cpp index d99dbef..abd2a32 100644 --- a/libs/xassets/xanimdeltapartquat.cpp +++ b/libs/xassets/xanimdeltapartquat.cpp @@ -13,11 +13,11 @@ void XAnimDeltaPartQuat::ParseData(QDataStream *aStream) { } } -quint16 XAnimDeltaPartQuat::GetSize() const { +quint32 XAnimDeltaPartQuat::GetSize() const { return mSize; } -void XAnimDeltaPartQuat::SetSize(quint16 size) { +void XAnimDeltaPartQuat::SetSize(quint32 size) { mSize = size; } diff --git a/libs/xassets/xanimdeltapartquat.h b/libs/xassets/xanimdeltapartquat.h index 7d981a5..1c2731e 100644 --- a/libs/xassets/xanimdeltapartquat.h +++ b/libs/xassets/xanimdeltapartquat.h @@ -17,14 +17,14 @@ public: void ParseData(QDataStream *aStream) override; - quint16 GetSize() const; - void SetSize(quint16 size); + quint32 GetSize() const; + void SetSize(quint32 size); const XAnimDeltaPartQuatData& GetData() const; void SetData(const XAnimDeltaPartQuatData& data); private: - quint16 mSize = 0; + quint32 mSize = 0; XAnimDeltaPartQuatData mData; }; diff --git a/libs/xassets/xanimindices.cpp b/libs/xassets/xanimindices.cpp index f13e9f9..5a003fc 100644 --- a/libs/xassets/xanimindices.cpp +++ b/libs/xassets/xanimindices.cpp @@ -28,10 +28,10 @@ void XAnimIndices::Clear() mIndex = 0; } -quint16 XAnimIndices::GetIndex() const { +quint32 XAnimIndices::GetIndex() const { return mIndex; } -void XAnimIndices::SetIndex(quint16 index) { +void XAnimIndices::SetIndex(quint32 index) { mIndex = index; } diff --git a/libs/xassets/xanimindices.h b/libs/xassets/xanimindices.h index 66dd25c..1d4f00e 100644 --- a/libs/xassets/xanimindices.h +++ b/libs/xassets/xanimindices.h @@ -12,11 +12,11 @@ public: void ParseData(QDataStream *aStream) override; void Clear() override; - quint16 GetIndex() const; - void SetIndex(quint16 index); + quint32 GetIndex() const; + void SetIndex(quint32 index); private: - quint16 mIndex = 0; + quint32 mIndex = 0; }; #endif // XANIMINDICES_H diff --git a/libs/xassets/xanimnotifyinfo.cpp b/libs/xassets/xanimnotifyinfo.cpp index 3e0241f..8b0bf0e 100644 --- a/libs/xassets/xanimnotifyinfo.cpp +++ b/libs/xassets/xanimnotifyinfo.cpp @@ -27,11 +27,11 @@ void XAnimNotifyInfo::Clear() mTime = 0.0f; } -quint16 XAnimNotifyInfo::GetName() const { +quint32 XAnimNotifyInfo::GetName() const { return mName; } -void XAnimNotifyInfo::SetName(quint16 name) { +void XAnimNotifyInfo::SetName(quint32 name) { mName = name; } diff --git a/libs/xassets/xanimnotifyinfo.h b/libs/xassets/xanimnotifyinfo.h index 115dbe0..c24b19f 100644 --- a/libs/xassets/xanimnotifyinfo.h +++ b/libs/xassets/xanimnotifyinfo.h @@ -12,14 +12,14 @@ public: void ParseData(QDataStream *aStream) override; void Clear() override; - quint16 GetName() const; - void SetName(quint16 name); + quint32 GetName() const; + void SetName(quint32 name); float GetTime() const; void SetTime(float time); private: - quint16 mName; + quint32 mName; float mTime; }; diff --git a/libs/xassets/xanimparts.cpp b/libs/xassets/xanimparts.cpp index 3daeb69..ab26f3f 100644 --- a/libs/xassets/xanimparts.cpp +++ b/libs/xassets/xanimparts.cpp @@ -67,7 +67,7 @@ void XAnimParts::ParseData(QDataStream *aStream) { >> mNotifyCount >> mAssetType; - quint16 pad; + quint32 pad; *aStream >> pad; mPad = (pad != 0); diff --git a/libs/xassets/xanimparts.h b/libs/xassets/xanimparts.h index 7b36901..950c6bd 100644 --- a/libs/xassets/xanimparts.h +++ b/libs/xassets/xanimparts.h @@ -21,12 +21,12 @@ public: private: XString mName; - quint16 mDataByteCount = 0; - quint16 mDataShortCount = 0; - quint16 mDataIntCount = 0; - quint16 mRandomDataByteCount = 0; - quint16 mRandomDataIntCount = 0; - quint16 mNumFrames = 0; + quint32 mDataByteCount = 0; + quint32 mDataShortCount = 0; + quint32 mDataIntCount = 0; + quint32 mRandomDataByteCount = 0; + quint32 mRandomDataIntCount = 0; + quint32 mNumFrames = 0; bool mIsLoop = false; bool mIsDelta = false; @@ -37,13 +37,13 @@ private: bool mPad = false; - quint16 mRandomDataShortCount = 0; - quint16 mIndexCount = 0; + quint32 mRandomDataShortCount = 0; + quint32 mIndexCount = 0; float mFramerate = 0.0f; float mFrequency = 0.0f; - quint16 mNames = 0; + quint32 mNames = 0; quint8 mDataByte = 0; qint16 mDataShort = 0; int mDataInt = 0; diff --git a/libs/xassets/xanimparttrans.h b/libs/xassets/xanimparttrans.h index 3c9a2c2..d5addab 100644 --- a/libs/xassets/xanimparttrans.h +++ b/libs/xassets/xanimparttrans.h @@ -15,7 +15,7 @@ public: void Clear() override; private: - quint16 mSize; + quint32 mSize; bool mIsSmallTrans; XAnimPartTransData mData; }; diff --git a/libs/xassets/xasset.cpp b/libs/xassets/xasset.cpp index ea494d0..3d38c4c 100644 --- a/libs/xassets/xasset.cpp +++ b/libs/xassets/xasset.cpp @@ -19,6 +19,8 @@ #include "xstringtable.h" #include "xweapondef.h" +XAsset:: + XAsset::XAsset() : mPtr(0) , mType(ASSET_TYPE_NONE) @@ -61,14 +63,39 @@ QString XAsset::GetName() const return mName; } +void XAsset::SetDebug(bool aDebug) +{ + XAsset::mDebug = aDebug; +} + +bool XAsset::IsDebug() const +{ + return mDebug; +} + void XAsset::Clear() { + if (mDebug) + { + qDebug() << QString("Clearing XAsset of type %1").arg(GetName()); + } mPtr = 0; mType = ASSET_TYPE_NONE; } void XAsset::ParsePtr(QDataStream *aStream, bool aDataFlag) { *aStream >> mPtr; + if (mDebug) + { + // Always treat as unsigned when displaying in hex + quint64 raw = static_cast(static_cast(mPtr)); + + QString hexPtr = QString("0x%1") + .arg(raw, 8, 16, QLatin1Char('0')) + .toUpper(); + + qDebug() << QString("[%1] Parsed %2 ptr %3 (%4)").arg(aStream->device()->pos(), 10, 10, QChar('0')).arg(GetName()).arg(mPtr).arg(hexPtr); + } if (aDataFlag && mPtr == -1) { @@ -78,6 +105,10 @@ void XAsset::ParsePtr(QDataStream *aStream, bool aDataFlag) { XAsset* XAsset::Create(XAssetType aAssetType) { + if (mDebug) + { + qDebug() << QString("Creating XAsset with type %1").arg(XAssetTypeToString(aAssetType)); + } switch (aAssetType) { case ASSET_TYPE_XANIMPARTS: @@ -417,6 +448,8 @@ QString XAsset::XAssetTypeToString(XAssetType type) { case ASSET_TYPE_CG_MEDIA_TABLE: return "CgMediaTable"; default: - return ""; + return "UnknownAsset"; } } + +bool XAsset::mDebug = true; diff --git a/libs/xassets/xasset.h b/libs/xassets/xasset.h index b4e0602..50d1dbe 100644 --- a/libs/xassets/xasset.h +++ b/libs/xassets/xasset.h @@ -5,6 +5,8 @@ #include #include +#include +#include class XAsset { @@ -21,6 +23,9 @@ public: void SetName(QString aName); QString GetName() const; + static void SetDebug(bool aDebug); + bool IsDebug() const; + virtual void Clear(); virtual void ParsePtr(QDataStream *aStream, bool aDataFlag = true); virtual void ParseData(QDataStream *aStream) = 0; @@ -28,6 +33,8 @@ public: static XAsset* Create(XAssetType aAssetType); static QString XAssetTypeToString(XAssetType type); + static bool mDebug; + private: qint32 mPtr; XAssetType mType; diff --git a/libs/xassets/xassetlist.cpp b/libs/xassets/xassetlist.cpp index d95d6a9..012f57d 100644 --- a/libs/xassets/xassetlist.cpp +++ b/libs/xassets/xassetlist.cpp @@ -20,6 +20,8 @@ XAssetList::XAssetList(ZoneFile* aZoneFile) , mAssetHeaders() , mZoneFile(aZoneFile) { + SetType(ASSET_TYPE_ASSETLIST); + SetName("Asset List"); } XAssetList::~XAssetList() @@ -29,7 +31,10 @@ XAssetList::~XAssetList() void XAssetList::ParseData(QDataStream *aStream) { // Parse string list - qDebug() << aStream->device()->pos(); + if (IsDebug()) + { + qDebug() << QString("[%1] Parsing data for %2").arg(aStream->device()->pos(), 10, 10, QChar('0')).arg(GetName()); + } mStringList.ParsePtr(aStream); // Parse asset count and assets @@ -37,6 +42,11 @@ void XAssetList::ParseData(QDataStream *aStream) { *aStream >> mAssetCount >> assetsPtr; + if (IsDebug()) + { + qDebug() << QString("[%1] mAssetCount = %2").arg(aStream->device()->pos(), 10, 10, QChar('0')).arg(mAssetCount); + qDebug() << QString("[%1] assetsPtr = %2").arg(aStream->device()->pos(), 10, 10, QChar('0')).arg(assetsPtr); + } mStringList.ParseData(aStream); diff --git a/libs/xassets/xaudiopacketaligned.cpp b/libs/xassets/xaudiopacketaligned.cpp index a8426d1..24e823a 100644 --- a/libs/xassets/xaudiopacketaligned.cpp +++ b/libs/xassets/xaudiopacketaligned.cpp @@ -1,21 +1,53 @@ -#include "xsoundfile.h" +#include "xaudiopacketaligned.h" -XSoundFile::XSoundFile() +XAudioPacketAligned::XAudioPacketAligned() + : XAsset() + , mBuffer() + , mBufferSize(0) + , mLoopCount(0) + , aXmaLoop() + , mContext() { - + } -XSoundFile::~XSoundFile() +XAudioPacketAligned::~XAudioPacketAligned() { - + } -void XSoundFile::ParseData(QDataStream *aStream) +void XAudioPacketAligned::ParseData(QDataStream *aStream) { + qint32 bufferPtr, contextPtr; + *aStream + >> bufferPtr + >> mBufferSize + >> mLoopCount; + + for (int i = 0; i < 6; i++) + { + XAudioXmaLoopRegion loop; + loop.ParseData(aStream); + } + + *aStream >> contextPtr; + + if (bufferPtr) + { + aStream->readRawData(mBuffer.data(), mBufferSize); + } + if (contextPtr) + { + *aStream >> mContext; + } } -void XSoundFile::Clear() +void XAudioPacketAligned::Clear() { - + mBuffer.clear(); + mBufferSize = 0; + mLoopCount = 0; + aXmaLoop.clear(); + mContext = '\0'; } diff --git a/libs/xassets/xaudiopacketaligned.h b/libs/xassets/xaudiopacketaligned.h index fe0ce47..5e56fd0 100644 --- a/libs/xassets/xaudiopacketaligned.h +++ b/libs/xassets/xaudiopacketaligned.h @@ -20,7 +20,7 @@ private: quint32 mBufferSize; quint32 mLoopCount; QVector aXmaLoop; - char* mContext; + char mContext; }; #endif // XAUDIOPACKETALIGNED_H diff --git a/libs/xassets/xaudioseektable.cpp b/libs/xassets/xaudioseektable.cpp index 13c82e2..1aaa9c4 100644 --- a/libs/xassets/xaudioseektable.cpp +++ b/libs/xassets/xaudioseektable.cpp @@ -1,6 +1,9 @@ #include "xaudioseektable.h" XAudioSeekTable::XAudioSeekTable() + : XAsset() + , mSize(0) + , mData() { } @@ -12,10 +15,19 @@ XAudioSeekTable::~XAudioSeekTable() void XAudioSeekTable::ParseData(QDataStream *aStream) { + qint32 dataPtr; + *aStream + >> mSize + >> dataPtr; + if (dataPtr) + { + aStream->readRawData(mData.data(), 4 * mSize); + } } void XAudioSeekTable::Clear() { - + mSize = 0; + mData.clear(); } diff --git a/libs/xassets/xaudioseektable.h b/libs/xassets/xaudioseektable.h index fc349fd..4a909db 100644 --- a/libs/xassets/xaudioseektable.h +++ b/libs/xassets/xaudioseektable.h @@ -15,7 +15,7 @@ public: virtual void Clear() override; private: - int mSize; + quint32 mSize; QByteArray mData; }; diff --git a/libs/xassets/xaudiosound.cpp b/libs/xassets/xaudiosound.cpp index 3a0da6c..03bbc34 100644 --- a/libs/xassets/xaudiosound.cpp +++ b/libs/xassets/xaudiosound.cpp @@ -1,6 +1,11 @@ #include "xaudiosound.h" XAudioSound::XAudioSound() + : XAsset() + , mPacket() + , mFormat() + , mXmaDataInfo() + , mSeekTable() { } @@ -12,10 +17,16 @@ XAudioSound::~XAudioSound() void XAudioSound::ParseData(QDataStream *aStream) { - + mPacket.ParseData(aStream); + mFormat.ParseData(aStream); + mXmaDataInfo.ParseData(aStream); + mSeekTable.ParseData(aStream); } void XAudioSound::Clear() { - + mPacket.Clear(); + mFormat.Clear(); + mXmaDataInfo.Clear(); + mSeekTable.Clear(); } diff --git a/libs/xassets/xaudiosound.h b/libs/xassets/xaudiosound.h index 94c799d..00df51d 100644 --- a/libs/xassets/xaudiosound.h +++ b/libs/xassets/xaudiosound.h @@ -17,10 +17,10 @@ public: virtual void Clear() override; private: - XAudioPacketAligned* mPacket; - XAudioSourceFormat* mFormat; - XAudioXmaDataInfo* mXmaDataInfo; - XAudioSeekTable *mSeekTable; + XAudioPacketAligned mPacket; + XAudioSourceFormat mFormat; + XAudioXmaDataInfo mXmaDataInfo; + XAudioSeekTable mSeekTable; }; #endif // XAUDIOSOUND_H diff --git a/libs/xassets/xaudioxmaformat.h b/libs/xassets/xaudioxmaformat.h index ec6b145..ae7e5fc 100644 --- a/libs/xassets/xaudioxmaformat.h +++ b/libs/xassets/xaudioxmaformat.h @@ -13,7 +13,7 @@ public: virtual void Clear() override; private: - unsigned int mSampleRate; + quint32 mSampleRate; quint8 mChannelCount; quint8 mDecodeBufferSize; }; diff --git a/libs/xassets/xaudioxmaloopregion.h b/libs/xassets/xaudioxmaloopregion.h index 370e2fb..858194c 100644 --- a/libs/xassets/xaudioxmaloopregion.h +++ b/libs/xassets/xaudioxmaloopregion.h @@ -13,8 +13,8 @@ public: virtual void Clear() override; private: - unsigned int mLoopStart; - unsigned int mLoopEnd; + quint32 mLoopStart; + quint32 mLoopEnd; quint8 mLoopSubframeEnd; quint8 mLoopSubframeSkip; }; diff --git a/libs/xassets/xbmodeldrawinfo.h b/libs/xassets/xbmodeldrawinfo.h index c1de91c..641d2db 100644 --- a/libs/xassets/xbmodeldrawinfo.h +++ b/libs/xassets/xbmodeldrawinfo.h @@ -15,7 +15,7 @@ public: virtual void Clear() override; private: - quint16 mSurfId; + quint32 mSurfId; }; #endif // XBMODELDRAWINFO_H diff --git a/libs/xassets/xbrushwrapper.h b/libs/xassets/xbrushwrapper.h index b040d4a..05019d0 100644 --- a/libs/xassets/xbrushwrapper.h +++ b/libs/xassets/xbrushwrapper.h @@ -19,7 +19,7 @@ private: QVector3D mMins; int mContents; QVector3D mMaxs; - unsigned int mNumSides; + quint32 mNumSides; QVector mSides; QVector mAxialMaterialNum; quint8 *mBaseAdjacentSide; diff --git a/libs/xassets/xcardmemory.cpp b/libs/xassets/xcardmemory.cpp index ef1333f..51d2264 100644 --- a/libs/xassets/xcardmemory.cpp +++ b/libs/xassets/xcardmemory.cpp @@ -12,6 +12,11 @@ XCardMemory::~XCardMemory() } +quint32 XCardMemory::GetPlatform() const +{ + return mPlatform; +} + void XCardMemory::ParseData(QDataStream *aStream) { *aStream >> mPlatform; diff --git a/libs/xassets/xcardmemory.h b/libs/xassets/xcardmemory.h index d8ed56d..e6dbb52 100644 --- a/libs/xassets/xcardmemory.h +++ b/libs/xassets/xcardmemory.h @@ -9,11 +9,13 @@ public: XCardMemory(); ~XCardMemory(); + quint32 GetPlatform() const; + virtual void ParseData(QDataStream* aStream) override; virtual void Clear() override; private: - int mPlatform; + quint32 mPlatform; }; #endif // XCARDMEMORY_H diff --git a/libs/xassets/xcbrushside.cpp b/libs/xassets/xcbrushside.cpp index 0bbbc88..f7c7df5 100644 --- a/libs/xassets/xcbrushside.cpp +++ b/libs/xassets/xcbrushside.cpp @@ -2,7 +2,6 @@ XCBrushSide::XCBrushSide() : XAsset() - , mPlanePtr(0) , mPlane() , mMaterialNum(0) , mFirstAdjacentSideOffset(0) @@ -18,13 +17,24 @@ XCBrushSide::~XCBrushSide() void XCBrushSide::ParseData(QDataStream *aStream) { - + mPlane.ParsePtr(aStream, false); + + *aStream + >> mMaterialNum + >> mFirstAdjacentSideOffset + >> mEdgeCount; + + aStream->skipRawData(1); + + if (mPlane.GetPtr() == -1) + { + mPlane.ParseData(aStream); + } } void XCBrushSide::Clear() { - mPlanePtr = 0; - mPlane = XCPlane(); + mPlane.Clear(); mMaterialNum = 0; mFirstAdjacentSideOffset = 0; mEdgeCount = 0; diff --git a/libs/xassets/xcbrushside.h b/libs/xassets/xcbrushside.h index e38a125..93b600f 100644 --- a/libs/xassets/xcbrushside.h +++ b/libs/xassets/xcbrushside.h @@ -14,7 +14,6 @@ public: virtual void Clear() override; private: - qint32 mPlanePtr; XCPlane mPlane; uint mMaterialNum; qint16 mFirstAdjacentSideOffset; diff --git a/libs/xassets/xcleaf.cpp b/libs/xassets/xcleaf.cpp index 51e81ad..6aeab84 100644 --- a/libs/xassets/xcleaf.cpp +++ b/libs/xassets/xcleaf.cpp @@ -28,22 +28,24 @@ void XCLeaf::ParseData(QDataStream *aStream) { >> mMaxs[2] >> mLeafBrushNode >> mCluster; + + aStream->skipRawData(2); } } -quint16 XCLeaf::GetFirstCollAabbIndex() const { +quint32 XCLeaf::GetFirstCollAabbIndex() const { return mFirstCollAabbIndex; } -void XCLeaf::SetFirstCollAabbIndex(quint16 index) { +void XCLeaf::SetFirstCollAabbIndex(quint32 index) { mFirstCollAabbIndex = index; } -quint16 XCLeaf::GetCollAabbCount() const { +quint32 XCLeaf::GetCollAabbCount() const { return mCollAabbCount; } -void XCLeaf::SetCollAabbCount(quint16 count) { +void XCLeaf::SetCollAabbCount(quint32 count) { mCollAabbCount = count; } diff --git a/libs/xassets/xcleaf.h b/libs/xassets/xcleaf.h index 7f111ff..bb8564e 100644 --- a/libs/xassets/xcleaf.h +++ b/libs/xassets/xcleaf.h @@ -12,11 +12,11 @@ public: void ParseData(QDataStream *aStream) override; - quint16 GetFirstCollAabbIndex() const; - void SetFirstCollAabbIndex(quint16 index); + quint32 GetFirstCollAabbIndex() const; + void SetFirstCollAabbIndex(quint32 index); - quint16 GetCollAabbCount() const; - void SetCollAabbCount(quint16 count); + quint32 GetCollAabbCount() const; + void SetCollAabbCount(quint32 count); int GetBrushContents() const; void SetBrushContents(int contents); @@ -37,8 +37,8 @@ public: void SetCluster(qint16 cluster); private: - quint16 mFirstCollAabbIndex; - quint16 mCollAabbCount; + quint32 mFirstCollAabbIndex; + quint32 mCollAabbCount; int mBrushContents; int mTerrainContents; QVector mMins; diff --git a/libs/xassets/xcleafbrushnodechildren.cpp b/libs/xassets/xcleafbrushnodechildren.cpp index 57c0311..a13efd3 100644 --- a/libs/xassets/xcleafbrushnodechildren.cpp +++ b/libs/xassets/xcleafbrushnodechildren.cpp @@ -27,5 +27,5 @@ void XCLeafBrushNodeChildren::Clear() { mDist = 0.0f; mRange = 0.0f; - mChildOffset = QVector(); + mChildOffset = QVector(); } diff --git a/libs/xassets/xcleafbrushnodechildren.h b/libs/xassets/xcleafbrushnodechildren.h index 75e9623..3ad4d8e 100644 --- a/libs/xassets/xcleafbrushnodechildren.h +++ b/libs/xassets/xcleafbrushnodechildren.h @@ -17,7 +17,7 @@ public: private: float mDist; float mRange; - QVector mChildOffset; + QVector mChildOffset; }; #endif // XCLEAFBRUSHNODECHILDREN_H diff --git a/libs/xassets/xcleafbrushnodeleaf.h b/libs/xassets/xcleafbrushnodeleaf.h index cca5b4b..f46d8b8 100644 --- a/libs/xassets/xcleafbrushnodeleaf.h +++ b/libs/xassets/xcleafbrushnodeleaf.h @@ -13,7 +13,7 @@ public: void Clear() override; private: - QVector mBrushes; + QVector mBrushes; }; #endif // XCLEAFBRUSHNODELEAF_H diff --git a/libs/xassets/xclipmap.cpp b/libs/xassets/xclipmap.cpp index 464e1f4..fdd0951 100644 --- a/libs/xassets/xclipmap.cpp +++ b/libs/xassets/xclipmap.cpp @@ -1,7 +1,58 @@ #include "xclipmap.h" XClipMap::XClipMap() - : XAsset() { + : XAsset() + , mName() + , mIsInUse(false) + , mPlaneCount(0) + , mPlanes() + , mNumStaticModels(0) + , mStaticModelList() + , mNumMaterials(0) + , mMaterials() + , mNumBrushSides(0) + , mBrushsides() + , mNumBrushEdges(0) + , mBrushEdges() + , mNumNodes(0) + , mNodes() + , mNumLeafs(0) + , mLeafs() + , mLeafBrushNodesCount(0) + , mLeafBrushNodes() + , mNumLeafBrushes(0) + , mLeafBrushes() + , mNumLeafSurfaces(0) + , mLeafSurfaces() + , mVertCount(0) + , mVerts() + , mTriCount(0) + , mTriIndices() + , mTriEdgeIsWalkable() + , mBorderCount(0) + , mBorders() + , mPartitionCount(0) + , mPartitions() + , mAabbTreeCount(0) + , mAabbTrees() + , mNumSubModels(0) + , mCModels() + , mNumBrushes(0) + , mBrushes() + , mNumClusters(0) + , mClusterBytes(0) + , mVisibility() + , mVised(0) + , mMapEnts() + , mBoxBrush() + , mBoxModel() + , mDynEntCounts(0) + , mDynEntDefList(2) + , mDynEntPoseList(2) + , mDynEntClientList(2) + , mDynEntCollList(2) + , mChecksum(0) +{ SetType(ASSET_TYPE_CLIPMAP); SetName("ClipMap"); } @@ -11,12 +62,201 @@ XClipMap::~XClipMap() } -void XClipMap::ParseData(QDataStream *aStream) { - mName = XString::ParseCustom(aStream); +void XClipMap::ParseData(QDataStream *aStream) +{ + if (GetPtr() == -1) + { + mName.ParsePtr(aStream, false); - *aStream >> mChecksum; + qint32 planePtr, staticModelPtr, materialsPtr, brushSidesPtr, + brushEdgesPtr, nodesPtr, leafsPtr, leafsBrushNodesPtr, + leafBrushesPtr, leafSurfacesPtr, vertPtr1, vertPtr2, vertPtr3, + triIndicesPtr, triEdgeWalkablePtr, bordersPtr, partitionsPtr, aabbTreesPtr, + cModelsPtr; + *aStream + >> mIsInUse + >> mPlaneCount + >> planePtr + >> mNumStaticModels + >> staticModelPtr + >> mNumMaterials + >> materialsPtr + >> mNumBrushSides + >> brushSidesPtr + >> mNumBrushEdges + >> brushEdgesPtr + >> mNumNodes + >> nodesPtr + >> mNumLeafs + >> leafsPtr + >> mLeafBrushNodesCount + >> leafsBrushNodesPtr + >> mNumLeafBrushes + >> leafBrushesPtr + >> mNumLeafSurfaces + >> leafSurfacesPtr + >> mVertCount + >> vertPtr1 + >> vertPtr2 + >> vertPtr3 + >> mTriCount + >> triIndicesPtr + >> triEdgeWalkablePtr + >> mBorderCount + >> bordersPtr + >> mPartitionCount + >> partitionsPtr + >> mAabbTreeCount + >> aabbTreesPtr + >> mNumSubModels + >> cModelsPtr + >> mNumBrushes; - // We would parse arrays here, but we're using placeholders + aStream->skipRawData(2); + + qint32 brushesPtr, visibilityPtr, mapEntsPtr, boxBrushPtr; + *aStream + >> brushesPtr + >> mNumClusters + >> mClusterBytes + >> visibilityPtr + >> mVised + >> mapEntsPtr + >> boxBrushPtr; + + mBoxModel.ParseData(aStream); + + quint16 dynEntCount; + *aStream >> dynEntCount; + mDynEntCounts.append(dynEntCount); + *aStream >> dynEntCount; + mDynEntCounts.append(dynEntCount); + + mDynEntDefList[0].ParsePtr(aStream, false); + mDynEntDefList[0].ParsePtr(aStream, false); + + mDynEntPoseList[0].ParsePtr(aStream, false); + mDynEntPoseList[0].ParsePtr(aStream, false); + + mDynEntClientList[0].ParsePtr(aStream, false); + mDynEntClientList[0].ParsePtr(aStream, false); + + mDynEntCollList[0].ParsePtr(aStream, false); + mDynEntCollList[0].ParsePtr(aStream, false); + + *aStream >> mChecksum; + + if (planePtr) + { + for (int i = 0; i < mPlaneCount; i++) + { + XCPlane newCPlane; + newCPlane.ParseData(aStream); + mPlanes.append(newCPlane); + } + } + + if (staticModelPtr) + { + for (int i = 0; i < mNumStaticModels; i++) + { + XCStaticModel newModel; + newModel.ParseData(aStream); + mStaticModelList.append(newModel); + } + } + + if (materialsPtr) + { + for (int i = 0; i < mNumMaterials; i++) + { + XDMaterial newDMaterial; + newDMaterial.ParseData(aStream); + mMaterials.append(newDMaterial); + } + } + + if (brushSidesPtr) + { + for (int i = 0; i < mNumBrushSides; i++) + { + XCBrushSide newBrushSide; + newBrushSide.ParseData(aStream); + mBrushsides.append(newBrushSide); + } + } + + if (brushEdgesPtr) + { + for (int i = 0; i < mNumBrushEdges; i++) + { + quint8 newBrushEdge; + *aStream >> newBrushEdge; + mBrushEdges.append(newBrushEdge); + } + } + + if (nodesPtr) + { + for (int i = 0; i < mNumNodes; i++) + { + XCNode newNode; + newNode.ParseData(aStream); + mNodes.append(newNode); + } + } + + if (leafsPtr) + { + for (int i = 0; i < mNumLeafs; i++) + { + XCLeaf newLeaf; + newLeaf.ParseData(aStream); + mLeafs.append(newLeaf); + } + } + + if (leafBrushesPtr) + { + for (int i = 0; i < mNumLeafBrushes; i++) + { + quint32 newBrush; + *aStream >> newBrush; + mLeafBrushes.append(newBrush); + } + } + + if (leafsBrushNodesPtr) + { + for (int i = 0; i < mNumLeafBrushes; i++) + { + XCLeafBrushNode newBrushNode; + newBrushNode.ParseData(aStream); + mLeafBrushNodes.append(newBrushNode); + } + } + + mLeafbrushNodes() + mLeafsurfaces() + mVerts() + mTriIndices() + mTriEdgeIsWalkable() + mBorders() + mPartitions() + mAabbTrees() + mCodels() + mBrushes() + mVisibility() + mMapEnts() + mBoxBrush() + mBoxModel() + mDynEntCount(0) + mDynEntDefList() + mDynEntPoseList() + mDynEntClientList() + mDynEntCollList() + (0) + } } void XClipMap::Clear() diff --git a/libs/xassets/xclipmap.h b/libs/xassets/xclipmap.h index 33dac01..caaac85 100644 --- a/libs/xassets/xclipmap.h +++ b/libs/xassets/xclipmap.h @@ -29,45 +29,45 @@ public: void Clear() override; private: - QString mName; + XString mName; - bool mIsInUse; + quint32 mIsInUse; int mPlaneCount; QVector mPlanes; - uint mNumStaticModels; + quint32 mNumStaticModels; QVector mStaticModelList; - uint mNumMaterials; + quint32 mNumMaterials; QVector mMaterials; - uint mNumBrushSides; + quint32 mNumBrushSides; QVector mBrushsides; - uint mNumBrushEdges; + quint32 mNumBrushEdges; QVector mBrushEdges; - uint mNumNodes; + quint32 mNumNodes; QVector mNodes; - uint mNumLeafs; + quint32 mNumLeafs; QVector mLeafs; - uint mLeafbrushNodesCount; - QVector mLeafbrushNodes; + quint32 mLeafBrushNodesCount; + QVector mLeafBrushNodes; - uint mNumLeafBrushes; - QVector mLeafbrushes; + quint32 mNumLeafBrushes; + QVector mLeafBrushes; - uint mNumLeafSurfaces; - QVector mLeafsurfaces; + quint32 mNumLeafSurfaces; + QVector mLeafSurfaces; - uint mVertCount; + quint32 mVertCount; QVector mVerts; int mTriCount; - QVector mTriIndices; + QVector mTriIndices; QVector mTriEdgeIsWalkable; int mBorderCount; @@ -80,9 +80,9 @@ private: QVector mAabbTrees; uint mNumSubModels; - QVector mCodels; + QVector mCModels; - quint16 mNumBrushes; + quint32 mNumBrushes; QVector mBrushes; int mNumClusters; @@ -92,14 +92,14 @@ private: QVector mVisibility; int mVised; QVector mMapEnts; - XCBrush *mBoxBrush; + XCBrush mBoxBrush; XCModel mBoxModel; - quint16 mDynEntCount[2]; - XDynEntityDef *mDynEntDefList[2]; - XDynEntityPose *mDynEntPoseList[2]; - XDynEntityClient *mDynEntClientList[2]; - XDynEntityColl *mDynEntCollList[2]; - uint mChecksum; + QVector mDynEntCounts; + QVector mDynEntDefList; + QVector mDynEntPoseList; + QVector mDynEntClientList; + QVector mDynEntCollList; + quint32 mChecksum; }; #endif // XCLIPMAP_H diff --git a/libs/xassets/xcnode.cpp b/libs/xassets/xcnode.cpp index b65ccf3..ade0e27 100644 --- a/libs/xassets/xcnode.cpp +++ b/libs/xassets/xcnode.cpp @@ -2,31 +2,32 @@ XCNode::XCNode() : XAsset() - , mPlane(new XCPlane()) + , mPlane() , mChildren() { } XCNode::~XCNode() { - delete mPlane; + } void XCNode::ParseData(QDataStream *aStream) { if (GetPtr() == -1) { - // We would parse plane here, but we're using a placeholder - mPlane->ParseData(aStream); + mPlane.ParsePtr(aStream); // Parse children *aStream >> mChildren[0] >> mChildren[1]; + + mPlane.ParseData(aStream); } } void XCNode::Clear() { - mPlane->Clear(); + mPlane.Clear(); mChildren.clear(); } diff --git a/libs/xassets/xcnode.h b/libs/xassets/xcnode.h index 481eb17..828a978 100644 --- a/libs/xassets/xcnode.h +++ b/libs/xassets/xcnode.h @@ -14,7 +14,7 @@ public: void Clear() override; private: - XCPlane* mPlane; + XCPlane mPlane; QVector mChildren; }; diff --git a/libs/xassets/xcollisionaabbtree.cpp b/libs/xassets/xcollisionaabbtree.cpp index 3e42d7d..8fee2b6 100644 --- a/libs/xassets/xcollisionaabbtree.cpp +++ b/libs/xassets/xcollisionaabbtree.cpp @@ -48,19 +48,19 @@ void XCollisionAabbTree::SetHalfSize(QVector3D aHalfSize) { mHalfSize = aHalfSize; } -quint16 XCollisionAabbTree::GetMaterialIndex() const { +quint32 XCollisionAabbTree::GetMaterialIndex() const { return mMaterialIndex; } -void XCollisionAabbTree::SetMaterialIndex(quint16 aIndex) { +void XCollisionAabbTree::SetMaterialIndex(quint32 aIndex) { mMaterialIndex = aIndex; } -quint16 XCollisionAabbTree::GetChildCount() const { +quint32 XCollisionAabbTree::GetChildCount() const { return mChildCount; } -void XCollisionAabbTree::SetChildCount(quint16 count) { +void XCollisionAabbTree::SetChildCount(quint32 count) { mChildCount = count; } diff --git a/libs/xassets/xcollisionaabbtree.h b/libs/xassets/xcollisionaabbtree.h index a6c5b58..15f583c 100644 --- a/libs/xassets/xcollisionaabbtree.h +++ b/libs/xassets/xcollisionaabbtree.h @@ -20,11 +20,11 @@ public: QVector3D GetHalfSize() const; void SetHalfSize(QVector3D aHalfSize); - quint16 GetMaterialIndex() const; - void SetMaterialIndex(quint16 aIndex); + quint32 GetMaterialIndex() const; + void SetMaterialIndex(quint32 aIndex); - quint16 GetChildCount() const; - void SetChildCount(quint16 aCount); + quint32 GetChildCount() const; + void SetChildCount(quint32 aCount); XCollisionAabbTreeIndex& GetTreeIndex(); void SetTreeIndex(const XCollisionAabbTreeIndex& aTreeIndex); @@ -32,8 +32,8 @@ public: private: QVector3D mOrigin; QVector3D mHalfSize; - quint16 mMaterialIndex = 0; - quint16 mChildCount = 0; + quint32 mMaterialIndex = 0; + quint32 mChildCount = 0; XCollisionAabbTreeIndex mTreeIndex; }; diff --git a/libs/xassets/xcplane.cpp b/libs/xassets/xcplane.cpp index 41204a5..12b6cf5 100644 --- a/libs/xassets/xcplane.cpp +++ b/libs/xassets/xcplane.cpp @@ -18,7 +18,18 @@ XCPlane::~XCPlane() void XCPlane::ParseData(QDataStream *aStream) { - + if (GetPtr() == -1) + { + *aStream + >> mNormal[0] + >> mNormal[1] + >> mNormal[2] + >> mDist + >> mType + >> mSignbits + >> mPad[0] + >> mPad[1]; + } } void XCPlane::Clear() diff --git a/libs/xassets/xcstaticmodel.cpp b/libs/xassets/xcstaticmodel.cpp index 9a76aa3..c4fb1b6 100644 --- a/libs/xassets/xcstaticmodel.cpp +++ b/libs/xassets/xcstaticmodel.cpp @@ -16,9 +16,11 @@ void XCStaticModel::ParseData(QDataStream *aStream) { // Parse writable mWritable.ParseData(aStream); - // We would parse xmodel here, but we're using a placeholder + aStream->skipRawData(2); + qint32 xModelPtr; *aStream + >> xModelPtr >> mOrigin[0] >> mOrigin[1] >> mOrigin[2]; diff --git a/libs/xassets/xcstaticmodel.h b/libs/xassets/xcstaticmodel.h index 4bdf10a..63e2cc7 100644 --- a/libs/xassets/xcstaticmodel.h +++ b/libs/xassets/xcstaticmodel.h @@ -16,7 +16,7 @@ public: private: XCStaticModelWritable mWritable; - const XModel* mModel; + XModel mModel; QVector3D mOrigin; QVector mInvScaledAxis; QVector3D mAbsmin; diff --git a/libs/xassets/xcstaticmodelwritable.cpp b/libs/xassets/xcstaticmodelwritable.cpp index 3348cc9..91944d6 100644 --- a/libs/xassets/xcstaticmodelwritable.cpp +++ b/libs/xassets/xcstaticmodelwritable.cpp @@ -17,11 +17,11 @@ void XCStaticModelWritable::ParseData(QDataStream *aStream) { } } -quint16 XCStaticModelWritable::GetNextModelInWorldSector() const { +quint32 XCStaticModelWritable::GetNextModelInWorldSector() const { return mNextModelInWorldSector; } -void XCStaticModelWritable::SetNextModelInWorldSector(quint16 nextModel) { +void XCStaticModelWritable::SetNextModelInWorldSector(quint32 nextModel) { mNextModelInWorldSector = nextModel; } diff --git a/libs/xassets/xcstaticmodelwritable.h b/libs/xassets/xcstaticmodelwritable.h index e6c0ca8..90edbf5 100644 --- a/libs/xassets/xcstaticmodelwritable.h +++ b/libs/xassets/xcstaticmodelwritable.h @@ -11,11 +11,11 @@ public: void ParseData(QDataStream *aStream) override; - quint16 GetNextModelInWorldSector() const; - void SetNextModelInWorldSector(quint16 nextModel); + quint32 GetNextModelInWorldSector() const; + void SetNextModelInWorldSector(quint32 nextModel); private: - quint16 mNextModelInWorldSector; + quint32 mNextModelInWorldSector; }; #endif // XCSTATICMODELWRITABLE_H diff --git a/libs/xassets/xd3dbasetexture.h b/libs/xassets/xd3dbasetexture.h index cfced0a..8670b1f 100644 --- a/libs/xassets/xd3dbasetexture.h +++ b/libs/xassets/xd3dbasetexture.h @@ -15,7 +15,7 @@ public: virtual void Clear() override; private: - unsigned int mMipFlush; + quint32 mMipFlush; XGpuTextureFetchConstant mFormat; XD3DResource mResource; }; diff --git a/libs/xassets/xd3dresource.h b/libs/xassets/xd3dresource.h index 925ee67..30cc5db 100644 --- a/libs/xassets/xd3dresource.h +++ b/libs/xassets/xd3dresource.h @@ -13,12 +13,12 @@ public: virtual void Clear() override; private: - unsigned int mCommon; - unsigned int mReferenceCount; - unsigned int mFence; - unsigned int mReadFence; - unsigned int mIdentifier; - unsigned int mBaseFlush; + quint32 mCommon; + quint32 mReferenceCount; + quint32 mFence; + quint32 mReadFence; + quint32 mIdentifier; + quint32 mBaseFlush; }; diff --git a/libs/xassets/xdynentityclient.h b/libs/xassets/xdynentityclient.h index 0a80c90..b8124ef 100644 --- a/libs/xassets/xdynentityclient.h +++ b/libs/xassets/xdynentityclient.h @@ -14,8 +14,8 @@ public: private: int mPhysObjId; - quint16 mFlags; - quint16 mLightingHandle; + quint32 mFlags; + quint32 mLightingHandle; int mHealth; }; diff --git a/libs/xassets/xdynentitycoll.h b/libs/xassets/xdynentitycoll.h index d6b3c88..c80f2ae 100644 --- a/libs/xassets/xdynentitycoll.h +++ b/libs/xassets/xdynentitycoll.h @@ -15,8 +15,8 @@ public: void Clear() override; private: - quint16 mSector; - quint16 mNextEntInSector; + quint32 mSector; + quint32 mNextEntInSector; QVector mLinkMins; QVector mLinkMaxs; }; diff --git a/libs/xassets/xdynentitydef.h b/libs/xassets/xdynentitydef.h index 3fc57dc..9d89b5e 100644 --- a/libs/xassets/xdynentitydef.h +++ b/libs/xassets/xdynentitydef.h @@ -29,8 +29,8 @@ private: XGfxPlacement mPose; qint32 mModelPtr; XModel mModel; - quint16 mBrushModel; - quint16 mPhysicsBrushModel; + quint32 mBrushModel; + quint32 mPhysicsBrushModel; qint32 mBestroyFxPtr; XFxEffectDef mDestroyFx; qint32 mDestroyPiecesPtr; diff --git a/libs/xassets/xfxtraildef.cpp b/libs/xassets/xfxtraildef.cpp index 0df3646..ba6fd44 100644 --- a/libs/xassets/xfxtraildef.cpp +++ b/libs/xassets/xfxtraildef.cpp @@ -26,7 +26,7 @@ void XFxTrailDef::Clear() mVertCount = 0; mVerts = QVector(); mIndCount = 0; - mIndices = QVector(); + mIndices = QVector(); } void XFxTrailDef::ParseData(QDataStream *aStream) diff --git a/libs/xassets/xfxtraildef.h b/libs/xassets/xfxtraildef.h index 51f543d..fd9f43c 100644 --- a/libs/xassets/xfxtraildef.h +++ b/libs/xassets/xfxtraildef.h @@ -22,7 +22,7 @@ private: int mVertCount; QVector mVerts; int mIndCount; - QVector mIndices; + QVector mIndices; }; #endif // XFXTRAILDEF_H diff --git a/libs/xassets/xgfxaabbtree.h b/libs/xassets/xgfxaabbtree.h index c4f99d1..e949a16 100644 --- a/libs/xassets/xgfxaabbtree.h +++ b/libs/xassets/xgfxaabbtree.h @@ -18,13 +18,13 @@ public: private: QVector3D mMins; QVector3D mMaxs; - quint16 mChildCount; - quint16 mSurfaceCount; - quint16 mStartSurfIndex; + quint32 mChildCount; + quint32 mSurfaceCount; + quint32 mStartSurfIndex; - quint16 mModelIndexCount; + quint32 mModelIndexCount; qint32 mModelIndexesPtr; - QVector mModelIndexes; + QVector mModelIndexes; int mChildrenOffset; }; diff --git a/libs/xassets/xgfxcolor.h b/libs/xassets/xgfxcolor.h index e4ca60f..310c482 100644 --- a/libs/xassets/xgfxcolor.h +++ b/libs/xassets/xgfxcolor.h @@ -14,7 +14,7 @@ public: void SetColor(quint8 r, quint8 g, quint8 b, quint8 a); private: - unsigned int mPacked; + quint32 mPacked; quint8 mArray[4]; }; diff --git a/libs/xassets/xgfximage.cpp b/libs/xassets/xgfximage.cpp index f893073..a3d6ed1 100644 --- a/libs/xassets/xgfximage.cpp +++ b/libs/xassets/xgfximage.cpp @@ -28,7 +28,44 @@ XGfxImage::~XGfxImage() void XGfxImage::ParseData(QDataStream *aStream) { + *aStream >> mMapType; + mTexture.ParseData(aStream); + + *aStream >> mSemantic; + + aStream->skipRawData(3); + + mCardMemory.ParseData(aStream); + + qint32 pixelsPtr; + *aStream + >> mWidth + >> mHeight + >> mDepth + >> mCategory + >> mDelayLoadPixels + >> pixelsPtr + >> mBaseSize + >> mStreamSlot + >> mStreaming; + + aStream->skipRawData(1); + + mName.ParsePtr(aStream); + + int variableSkip = 5; + if (mDelayLoadPixels) + { + variableSkip = 2; + } + aStream->skipRawData(variableSkip); + if (pixelsPtr) + { + aStream->readRawData(mPixels.data(), mCardMemory.GetPlatform()); + } + // TODO: This is wrong + mTexture.ParseData(aStream); } void XGfxImage::Clear() diff --git a/libs/xassets/xgfximage.h b/libs/xassets/xgfximage.h index 002ca78..be8811d 100644 --- a/libs/xassets/xgfximage.h +++ b/libs/xassets/xgfximage.h @@ -5,6 +5,7 @@ #include "xcardmemory.h" #include "xgfxtexture.h" #include "xmaptype.h" +#include "xstring.h" #include #include @@ -28,11 +29,11 @@ private: quint16 mDepth; quint8 mCategory; bool mDelayLoadPixels; - QVector mPixels; - unsigned int mBaseSize; + QByteArray mPixels; + quint32 mBaseSize; quint16 mStreamSlot; bool mStreaming; - QString mName; + XString mName; }; #endif // XGFXIMAGE_H diff --git a/libs/xassets/xgfxlightgrid.h b/libs/xassets/xgfxlightgrid.h index 585387a..d0040eb 100644 --- a/libs/xassets/xgfxlightgrid.h +++ b/libs/xassets/xgfxlightgrid.h @@ -20,17 +20,17 @@ public: private: bool mHasLightRegions; - unsigned int mSunPrimaryLightIndex; + quint32 mSunPrimaryLightIndex; QVector3D mMins; QVector3D mMaxs; - unsigned int mRowAxis; - unsigned int mColAxis; - unsigned __int16 *mRowDataStart; - unsigned int mRawRowDataSize; - unsigned __int8 *mRawRowData; - unsigned int mEntryCount; + quint32 mRowAxis; + quint32 mColAxis; + quint16 *mRowDataStart; + quint32 mRawRowDataSize; + quint8 *mRawRowData; + quint32 mEntryCount; QVector mEntries; - unsigned int mColorCount; + quint32 mColorCount; QVector mColors; }; diff --git a/libs/xassets/xgfxlightgridentry.h b/libs/xassets/xgfxlightgridentry.h index 6cbae71..c833d2c 100644 --- a/libs/xassets/xgfxlightgridentry.h +++ b/libs/xassets/xgfxlightgridentry.h @@ -15,7 +15,7 @@ public: virtual void Clear() override; virtual void ParseData(QDataStream *aStream) override; - quint16 colorsIndex; + quint32 colorsIndex; quint8 primaryLightIndex; quint8 needsTrace; }; diff --git a/libs/xassets/xgfxpixelshaderloaddef.cpp b/libs/xassets/xgfxpixelshaderloaddef.cpp index 84b1676..988f3da 100644 --- a/libs/xassets/xgfxpixelshaderloaddef.cpp +++ b/libs/xassets/xgfxpixelshaderloaddef.cpp @@ -2,9 +2,7 @@ XGfxPixelShaderLoadDef::XGfxPixelShaderLoadDef() : XAsset() - , mCachedPartPtr(0) , mCachedPart() - , mPhysicalPartPtr(0) , mPhysicalPart() , mCachedPartSize(0) , mPhysicalPartSize(0) @@ -17,17 +15,39 @@ XGfxPixelShaderLoadDef::~XGfxPixelShaderLoadDef() } -void XGfxPixelShaderLoadDef::ParseData(QDataStream *aStream) +quint16 XGfxPixelShaderLoadDef::GetPhysicalPartSize() const { - + return mPhysicalPartSize; +} + +quint16 XGfxPixelShaderLoadDef::GetCachedPartSize() const +{ + return mCachedPartSize; } void XGfxPixelShaderLoadDef::Clear() { - mCachedPartPtr = 0; mCachedPart.clear(); - mPhysicalPartPtr = 0; mPhysicalPart.clear(); mCachedPartSize = 0; mPhysicalPartSize = 0; } + +void XGfxPixelShaderLoadDef::ParseData(QDataStream *aStream) +{ + qint32 cachedPartPtr, physicalPartPtr; + *aStream + >> cachedPartPtr + >> physicalPartPtr + >> mCachedPartSize + >> mPhysicalPartSize; + + if (physicalPartPtr) + { + aStream->readRawData(mPhysicalPart.data(), mPhysicalPartSize); + } + if (cachedPartPtr) + { + aStream->readRawData(mCachedPart.data(), mCachedPartSize); + } +} diff --git a/libs/xassets/xgfxpixelshaderloaddef.h b/libs/xassets/xgfxpixelshaderloaddef.h index 85547b1..3de8a9a 100644 --- a/libs/xassets/xgfxpixelshaderloaddef.h +++ b/libs/xassets/xgfxpixelshaderloaddef.h @@ -11,14 +11,15 @@ public: explicit XGfxPixelShaderLoadDef(); ~XGfxPixelShaderLoadDef(); + quint16 GetPhysicalPartSize() const; + quint16 GetCachedPartSize() const; + void ParseData(QDataStream *aStream) override; void Clear() override; private: - quint16 mCachedPartPtr; - QVector mCachedPart; - quint16 mPhysicalPartPtr; - QVector mPhysicalPart; + QByteArray mCachedPart; + QByteArray mPhysicalPart; quint16 mCachedPartSize; quint16 mPhysicalPartSize; }; diff --git a/libs/xassets/xgfxscenedynbrush.h b/libs/xassets/xgfxscenedynbrush.h index 3f27108..d488285 100644 --- a/libs/xassets/xgfxscenedynbrush.h +++ b/libs/xassets/xgfxscenedynbrush.h @@ -17,7 +17,7 @@ public: private: XBModelDrawInfo mInfo; - quint16 mDynEntId; + quint32 mDynEntId; }; #endif // XGFXSCENEDYNBRUSH_H diff --git a/libs/xassets/xgfxscenedynmodel.h b/libs/xassets/xgfxscenedynmodel.h index 6bf997e..0c6c646 100644 --- a/libs/xassets/xgfxscenedynmodel.h +++ b/libs/xassets/xgfxscenedynmodel.h @@ -17,7 +17,7 @@ public: private: XModelDrawInfo mInfo; - quint16 mDynEntId; + quint32 mDynEntId; }; #endif // XGFXSCENEDYNMODEL_H diff --git a/libs/xassets/xgfxshadowgeometry.h b/libs/xassets/xgfxshadowgeometry.h index bd0ccda..20df2f4 100644 --- a/libs/xassets/xgfxshadowgeometry.h +++ b/libs/xassets/xgfxshadowgeometry.h @@ -15,12 +15,12 @@ public: virtual void Clear() override; private: - quint16 mSurfaceCount; - quint16 mModelCount; + quint32 mSurfaceCount; + quint32 mModelCount; qint32 mSortedSurfIndexPtr; - QVector mSortedSurfIndex; + QVector mSortedSurfIndex; qint32 mModelIndexPtr; - QVector mModelIndex; + QVector mModelIndex; }; #endif // XGFXSHADOWGEOMETRY_H diff --git a/libs/xassets/xgfxstaticmodeldrawinst.h b/libs/xassets/xgfxstaticmodeldrawinst.h index f4992c9..3e08aa4 100644 --- a/libs/xassets/xgfxstaticmodeldrawinst.h +++ b/libs/xassets/xgfxstaticmodeldrawinst.h @@ -22,7 +22,7 @@ private: XModel *mModel; quint8 mReflectionProbeIndex; quint8 mPrimaryLightIndex; - quint16 mLightingHandle; + quint32 mLightingHandle; quint8 mFlags; }; diff --git a/libs/xassets/xgfxvertexshaderloaddef.cpp b/libs/xassets/xgfxvertexshaderloaddef.cpp index c09efae..203dbda 100644 --- a/libs/xassets/xgfxvertexshaderloaddef.cpp +++ b/libs/xassets/xgfxvertexshaderloaddef.cpp @@ -7,7 +7,7 @@ XGfxVertexShaderLoadDef::XGfxVertexShaderLoadDef() , mCachedPartSize(0) , mPhysicalPartSize(0) { - + SetName("Vertex Shader Definition"); } XGfxVertexShaderLoadDef::~XGfxVertexShaderLoadDef() @@ -25,6 +25,10 @@ void XGfxVertexShaderLoadDef::Clear() void XGfxVertexShaderLoadDef::ParseData(QDataStream *aStream) { + if (IsDebug()) + { + qDebug() << QString("[%1] Parsing data for %2").arg(aStream->device()->pos(), 10, 10, QChar('0')).arg(GetName()); + } qint32 cachedPartPtr, physicalPartPtr; *aStream >> cachedPartPtr @@ -32,12 +36,28 @@ void XGfxVertexShaderLoadDef::ParseData(QDataStream *aStream) >> mCachedPartSize >> mPhysicalPartSize; + if (IsDebug()) + { + qDebug() << QString("[%1] cachedPartPtr = %2").arg(aStream->device()->pos(), 10, 10, QChar('0')).arg(cachedPartPtr); + qDebug() << QString("[%1] physicalPartPtr = %2").arg(aStream->device()->pos(), 10, 10, QChar('0')).arg(physicalPartPtr); + qDebug() << QString("[%1] mCachedPartSize = %2").arg(aStream->device()->pos(), 10, 10, QChar('0')).arg(mCachedPartSize); + qDebug() << QString("[%1] mPerPrimArgCount %2").arg(aStream->device()->pos(), 10, 10, QChar('0')).arg(mPhysicalPartSize); + } + if (physicalPartPtr) { aStream->readRawData(mPhysicalPart.data(), mPhysicalPartSize); + if (IsDebug()) + { + qDebug() << QString("[%1] mPhysicalPart = %2").arg(aStream->device()->pos(), 10, 10, QChar('0')).arg(mPhysicalPart); + } } if (cachedPartPtr) { aStream->readRawData(mCachedPart.data(), mCachedPartSize); + if (IsDebug()) + { + qDebug() << QString("[%1] mCachedPart = %2").arg(aStream->device()->pos(), 10, 10, QChar('0')).arg(mCachedPart); + } } } diff --git a/libs/xassets/xgfxworlddpvsplanes.h b/libs/xassets/xgfxworlddpvsplanes.h index 1d411ff..c1b201e 100644 --- a/libs/xassets/xgfxworlddpvsplanes.h +++ b/libs/xassets/xgfxworlddpvsplanes.h @@ -20,7 +20,7 @@ private: qint32 aPlanesPtr; QVector aPlanes; qint32 aNodesPtr; - QVector aNodes; + QVector aNodes; qint32 aSceneEntCellBitsPtr; QVector aSceneEntCellBits; }; diff --git a/libs/xassets/xgfxworlddpvsstatic.h b/libs/xassets/xgfxworlddpvsstatic.h index 9730b6d..6d783e3 100644 --- a/libs/xassets/xgfxworlddpvsstatic.h +++ b/libs/xassets/xgfxworlddpvsstatic.h @@ -32,7 +32,7 @@ private: QVector mSmodelVisData; QVector mSurfaceVisData; uint *mLodData; - quint16 *mSortedSurfIndex; + quint32 *mSortedSurfIndex; QVector *mModelInsts; QVector *mSurfaces; QVector *mCullGroups; diff --git a/libs/xassets/xglyph.h b/libs/xassets/xglyph.h index 2d837e7..aaadfa4 100644 --- a/libs/xassets/xglyph.h +++ b/libs/xassets/xglyph.h @@ -13,7 +13,7 @@ public: void ParseData(QDataStream *aStream) override; private: - quint16 mLetter; + quint32 mLetter; char mX0; char mY0; quint8 mDx; diff --git a/libs/xassets/xgpuvertexfetchconstant.h b/libs/xassets/xgpuvertexfetchconstant.h index b6685c1..4811467 100644 --- a/libs/xassets/xgpuvertexfetchconstant.h +++ b/libs/xassets/xgpuvertexfetchconstant.h @@ -14,7 +14,7 @@ public: private: XGpuVertexRawRequest mRequest; - unsigned int mDword[2]; + quint32 mDword[2]; }; #endif // XGPUVERTEXFETCHCONSTANT_H diff --git a/libs/xassets/xloadedsound.cpp b/libs/xassets/xloadedsound.cpp index ab72ae7..1b9747a 100644 --- a/libs/xassets/xloadedsound.cpp +++ b/libs/xassets/xloadedsound.cpp @@ -15,10 +15,15 @@ XLoadedSound::~XLoadedSound() void XLoadedSound::ParseData(QDataStream *aStream) { - + if (GetPtr() == -1) + { + mName.ParsePtr(aStream, false); + mSound.ParseData(aStream); + } } void XLoadedSound::Clear() { - + mName.Clear(); + mSound.Clear(); } diff --git a/libs/xassets/xloadedsound.h b/libs/xassets/xloadedsound.h index 500cc2d..9003b1d 100644 --- a/libs/xassets/xloadedsound.h +++ b/libs/xassets/xloadedsound.h @@ -15,8 +15,8 @@ public: virtual void Clear() override; private: - XString* mName; - XAudioSound* mSound; + XString mName; + XAudioSound mSound; }; #endif // XLOADEDSOUND_H diff --git a/libs/xassets/xmaterialargumentdef.cpp b/libs/xassets/xmaterialargumentdef.cpp index d2c2d25..48d03e0 100644 --- a/libs/xassets/xmaterialargumentdef.cpp +++ b/libs/xassets/xmaterialargumentdef.cpp @@ -1,15 +1,27 @@ #include "xmaterialargumentdef.h" +#include "xmaterialshaderargument.h" XMaterialArgumentDef::XMaterialArgumentDef() : XAsset() - , mLiteralConst(nullptr) - , mCodeConst() , mCodeSampler(0) - , mNameHash(0) + , mParent(nullptr) { } +XMaterialArgumentDef::XMaterialArgumentDef(XMaterialShaderArgument &aParent) + : XAsset() + , mCodeSampler(0) + , mParent(&aParent) +{ + +} + +XMaterialArgumentDef::~XMaterialArgumentDef() +{ + +} + void XMaterialArgumentDef::Clear() { @@ -17,5 +29,19 @@ void XMaterialArgumentDef::Clear() void XMaterialArgumentDef::ParseData(QDataStream *aStream) { - + if (!mParent) + { + return; + } + + *aStream >> mCodeSampler; + + if (mParent->GetType() == 1 || mParent->GetType() == 7) + { + if (mCodeSampler == -1) + { + // TODO: Figure out wtf this parses... + aStream->skipRawData(16); + } + } } diff --git a/libs/xassets/xmaterialargumentdef.h b/libs/xassets/xmaterialargumentdef.h index 5faafb1..4dcdaa3 100644 --- a/libs/xassets/xmaterialargumentdef.h +++ b/libs/xassets/xmaterialargumentdef.h @@ -2,21 +2,22 @@ #define XMATERIALARGUMENTDEF_H #include "xasset.h" -#include "xmaterialargumentcodeconst.h" + +class XMaterialShaderArgument; class XMaterialArgumentDef : public XAsset { public: - XMaterialArgumentDef(); + explicit XMaterialArgumentDef(); + XMaterialArgumentDef(XMaterialShaderArgument &aParent); + ~XMaterialArgumentDef(); virtual void Clear() override; virtual void ParseData(QDataStream *aStream) override; private: - const float *mLiteralConst; - XMaterialArgumentCodeConst mCodeConst; - unsigned int mCodeSampler; - unsigned int mNameHash; + qint32 mCodeSampler; + XMaterialShaderArgument* mParent; }; #endif // XMATERIALARGUMENTDEF_H diff --git a/libs/xassets/xmaterialconstantdef.h b/libs/xassets/xmaterialconstantdef.h index bcebf3f..91ad8fa 100644 --- a/libs/xassets/xmaterialconstantdef.h +++ b/libs/xassets/xmaterialconstantdef.h @@ -15,7 +15,7 @@ public: virtual void Clear() override; private: - unsigned int mNameHash; + quint32 mNameHash; QString mName; QVector mLiteral; }; diff --git a/libs/xassets/xmaterialinfo.h b/libs/xassets/xmaterialinfo.h index 5c3c526..654cfb3 100644 --- a/libs/xassets/xmaterialinfo.h +++ b/libs/xassets/xmaterialinfo.h @@ -22,7 +22,7 @@ private: quint8 mTextureAtlasRowCount; quint8 mTextureAtlasColumnCount; XGfxDrawSurf mDrawSurf; - unsigned int mSurfaceTypeBits; + quint32 mSurfaceTypeBits; }; #endif // XMATERIALINFO_H diff --git a/libs/xassets/xmaterialpass.cpp b/libs/xassets/xmaterialpass.cpp index d2baddd..3fd12e0 100644 --- a/libs/xassets/xmaterialpass.cpp +++ b/libs/xassets/xmaterialpass.cpp @@ -3,10 +3,13 @@ #include "xmaterialvertexshader.h" #include "xmaterialpixelshader.h" +#include +#include + XMaterialPass::XMaterialPass() : XAsset() , mVertexDecl() - , mVertexShaderArray() + , mVertexShaderArray(15) , mVertexShader() , mPixelShader() , mPerPrimArgCount(0) @@ -16,7 +19,7 @@ XMaterialPass::XMaterialPass() , mPrecompiledIndex(0) , mArgs() { - + SetName("Material Pass"); } void XMaterialPass::Clear() @@ -26,6 +29,11 @@ void XMaterialPass::Clear() void XMaterialPass::ParseData(QDataStream *aStream) { + if (IsDebug()) + { + qDebug() << QString("[%1] Parsing data for %2").arg(aStream->device()->pos(), 10, 10, QChar('0')).arg(GetName()); + } + mVertexDecl.ParsePtr(aStream, false); for (int i = 0; i < 15; i++) { @@ -34,20 +42,45 @@ void XMaterialPass::ParseData(QDataStream *aStream) mVertexShader.ParsePtr(aStream, false); mPixelShader.ParsePtr(aStream, false); - qint32 argPtr; + qint32 argsPtr; *aStream >> mPerPrimArgCount >> mPerObjArgCount >> mStableArgCount >> mCustomSamplerFlags - >> mPrecompiledIndex - >> argPtr; + >> mPrecompiledIndex; + + aStream->skipRawData(3); + + *aStream >> argsPtr; + + if (IsDebug()) + { + qDebug() << QString("[%1] mPerPrimArgCount = %2").arg(aStream->device()->pos(), 10, 10, QChar('0')).arg(mPerPrimArgCount); + qDebug() << QString("[%1] mPerObjArgCount = %2").arg(aStream->device()->pos(), 10, 10, QChar('0')).arg(mPerObjArgCount); + qDebug() << QString("[%1] mStableArgCount = %2").arg(aStream->device()->pos(), 10, 10, QChar('0')).arg(mStableArgCount); + qDebug() << QString("[%1] mCustomSamplerFlags = %2").arg(aStream->device()->pos(), 10, 10, QChar('0')).arg(mCustomSamplerFlags); + qDebug() << QString("[%1] mPrecompiledIndex = %2").arg(aStream->device()->pos(), 10, 10, QChar('0')).arg(mPrecompiledIndex); + qDebug() << QString("[%1] argsPtr = %2").arg(aStream->device()->pos(), 10, 10, QChar('0')).arg(argsPtr); + } mVertexDecl.ParseData(aStream); + for (int i = 0; i < 15; i++) { mVertexShaderArray[i].ParseData(aStream); } mVertexShader.ParseData(aStream); mPixelShader.ParseData(aStream); + + if (argsPtr) + { + int argCount = mStableArgCount + mPerObjArgCount + mPerPrimArgCount; + for (int i = 0; i < argCount; i++) + { + XMaterialShaderArgument arg; + arg.ParseData(aStream); + mArgs.append(arg); + } + } } diff --git a/libs/xassets/xmaterialpass.h b/libs/xassets/xmaterialpass.h index c60cebe..8a391c9 100644 --- a/libs/xassets/xmaterialpass.h +++ b/libs/xassets/xmaterialpass.h @@ -27,7 +27,7 @@ private: int mStableArgCount; int mCustomSamplerFlags; int mPrecompiledIndex; - XMaterialShaderArgument mArgs; + QVector mArgs; }; #endif // XMATERIALPASS_H diff --git a/libs/xassets/xmaterialpixelshader.cpp b/libs/xassets/xmaterialpixelshader.cpp index f2ebdc2..9eb3694 100644 --- a/libs/xassets/xmaterialpixelshader.cpp +++ b/libs/xassets/xmaterialpixelshader.cpp @@ -2,7 +2,7 @@ XMaterialPixelShader::XMaterialPixelShader() : XAsset() - , mName("") + , mName() , mShaderProgram() { SetType(ASSET_TYPE_PIXELSHADER); @@ -16,11 +16,15 @@ XMaterialPixelShader::~XMaterialPixelShader() void XMaterialPixelShader::Clear() { - mName.clear(); + mName.Clear(); mShaderProgram.Clear(); } void XMaterialPixelShader::ParseData(QDataStream *aStream) { - + if (GetPtr() == -1) + { + mName.ParsePtr(aStream); + mShaderProgram.ParseData(aStream); + } } diff --git a/libs/xassets/xmaterialpixelshader.h b/libs/xassets/xmaterialpixelshader.h index cdf5f7c..972d0d0 100644 --- a/libs/xassets/xmaterialpixelshader.h +++ b/libs/xassets/xmaterialpixelshader.h @@ -2,6 +2,7 @@ #define XMATERIALPIXERHSHADER_H #include "xasset.h" +#include "xstring.h" #include "xmaterialpixelshaderprogram.h" class XMaterialPixelShader : public XAsset @@ -14,7 +15,7 @@ public: void ParseData(QDataStream *aStream) override; private: - QString mName; + XString mName; XMaterialPixelShaderProgram mShaderProgram; }; diff --git a/libs/xassets/xmaterialpixelshaderprogram.cpp b/libs/xassets/xmaterialpixelshaderprogram.cpp index 55361ee..2b12312 100644 --- a/libs/xassets/xmaterialpixelshaderprogram.cpp +++ b/libs/xassets/xmaterialpixelshaderprogram.cpp @@ -2,7 +2,7 @@ XMaterialPixelShaderProgram::XMaterialPixelShaderProgram() : XAsset() - , mPixelShader(nullptr) + , mPixelShader() , mLoadDef() { @@ -10,16 +10,26 @@ XMaterialPixelShaderProgram::XMaterialPixelShaderProgram() XMaterialPixelShaderProgram::~XMaterialPixelShaderProgram() { - delete mPixelShader; + } void XMaterialPixelShaderProgram::Clear() { - mPixelShader->Clear(); + mPixelShader.Clear(); mLoadDef.Clear(); } void XMaterialPixelShaderProgram::ParseData(QDataStream *aStream) { + mLoadDef.ParseData(aStream); + mPixelShader.ParseData(aStream); + if (mLoadDef.GetPhysicalPartSize()) + { + //mPixelShader. + } + else + { + //mLoadDef + } } diff --git a/libs/xassets/xmaterialpixelshaderprogram.h b/libs/xassets/xmaterialpixelshaderprogram.h index df177ee..cc5ee47 100644 --- a/libs/xassets/xmaterialpixelshaderprogram.h +++ b/libs/xassets/xmaterialpixelshaderprogram.h @@ -18,7 +18,7 @@ public: void ParseData(QDataStream *aStream) override; private: - XD3DPixelShader *mPixelShader; + XD3DPixelShader mPixelShader; XGfxPixelShaderLoadDef mLoadDef; }; diff --git a/libs/xassets/xmaterialshaderargument.cpp b/libs/xassets/xmaterialshaderargument.cpp index 7c14ce7..b77351f 100644 --- a/libs/xassets/xmaterialshaderargument.cpp +++ b/libs/xassets/xmaterialshaderargument.cpp @@ -6,15 +6,31 @@ XMaterialShaderArgument::XMaterialShaderArgument() , mDest(0) , mDef() { - + SetName("Material Shader Argument"); } void XMaterialShaderArgument::Clear() { - + mType = 0; + mDest = 0; + mDef.Clear(); } void XMaterialShaderArgument::ParseData(QDataStream *aStream) { - + *aStream + >> mType + >> mDest; + + mDef.ParseData(aStream, mType); +} + +quint16 XMaterialShaderArgument::GetType() const +{ + return mType; +} + +quint16 XMaterialShaderArgument::GetDest() const +{ + return mDest; } diff --git a/libs/xassets/xmaterialshaderargument.h b/libs/xassets/xmaterialshaderargument.h index 917bc56..d79b1e3 100644 --- a/libs/xassets/xmaterialshaderargument.h +++ b/libs/xassets/xmaterialshaderargument.h @@ -12,9 +12,12 @@ public: virtual void Clear() override; virtual void ParseData(QDataStream *aStream) override; + quint16 GetType() const; + quint16 GetDest() const; + private: - int mType; - int mDest; + quint16 mType; + quint16 mDest; XMaterialArgumentDef mDef; }; diff --git a/libs/xassets/xmaterialtechnique.cpp b/libs/xassets/xmaterialtechnique.cpp index f9db48b..f258597 100644 --- a/libs/xassets/xmaterialtechnique.cpp +++ b/libs/xassets/xmaterialtechnique.cpp @@ -1,6 +1,4 @@ #include "xmaterialtechnique.h" -#include "qdebug.h" -#include "qfiledevice.h" XMaterialTechnique::XMaterialTechnique() : XAsset() @@ -9,7 +7,7 @@ XMaterialTechnique::XMaterialTechnique() , mPassCount(0) , mPassArray() { - + SetName("Material Technique"); } XMaterialTechnique::~XMaterialTechnique() @@ -19,15 +17,23 @@ XMaterialTechnique::~XMaterialTechnique() void XMaterialTechnique::ParseData(QDataStream *aStream) { - mName.ParsePtr(aStream); - - qDebug() << aStream->device()->pos(); + if (IsDebug()) + { + qDebug() << QString("[%1] Parsing data for %2").arg(aStream->device()->pos(), 10, 10, QChar('0')).arg(GetName()); + } + mName.ParsePtr(aStream, false); *aStream >> mFlags >> mPassCount; - mPassArray = QVector(mPassArray); + if (IsDebug()) + { + qDebug() << QString("[%1] mFlags = %2").arg(aStream->device()->pos(), 10, 10, QChar('0')).arg(mFlags); + qDebug() << QString("[%1] mPassCount = %2").arg(aStream->device()->pos(), 10, 10, QChar('0')).arg(mPassCount); + } + + mPassArray = QVector(mPassCount); for (int i = 0; i < mPassCount; i++) { diff --git a/libs/xassets/xmaterialtechnique.h b/libs/xassets/xmaterialtechnique.h index 1266811..bf89bd0 100644 --- a/libs/xassets/xmaterialtechnique.h +++ b/libs/xassets/xmaterialtechnique.h @@ -18,8 +18,8 @@ public: private: XString mName; - int mFlags; - int mPassCount; + quint16 mFlags; + quint16 mPassCount; QVector mPassArray; }; diff --git a/libs/xassets/xmaterialtechniqueset.cpp b/libs/xassets/xmaterialtechniqueset.cpp index 2e0d437..82eaf9e 100644 --- a/libs/xassets/xmaterialtechniqueset.cpp +++ b/libs/xassets/xmaterialtechniqueset.cpp @@ -1,6 +1,4 @@ #include "xmaterialtechniqueset.h" -#include "qdebug.h" -#include "qfiledevice.h" XMaterialTechniqueSet::XMaterialTechniqueSet() : XAsset() @@ -20,33 +18,40 @@ XMaterialTechniqueSet::~XMaterialTechniqueSet() void XMaterialTechniqueSet::ParseData(QDataStream *aStream) { - qDebug() << aStream->device()->pos(); - mName.ParsePtr(aStream); + if (IsDebug()) + { + qDebug() << QString("[%1] Parsing data for %2").arg(aStream->device()->pos(), 10, 10, QChar('0')).arg(GetName()); + } + mName.ParsePtr(aStream, false); - *aStream - >> mWorldVertFormat; + *aStream >> mWorldVertFormat; + if (IsDebug()) + { + qDebug() << QString("[%1] mWorldVertFormat = %2").arg(aStream->device()->pos(), 10, 10, QChar('0')).arg(mWorldVertFormat); + } - aStream->skipRawData(2); + aStream->skipRawData(3); qint32 remappedPtr; - *aStream - >> remappedPtr; + *aStream >> remappedPtr; + if (IsDebug()) + { + qDebug() << QString("[%1] remappedPtr = %2").arg(aStream->device()->pos(), 10, 10, QChar('0')).arg(remappedPtr); + qDebug() << QString("Parsing techniques."); + } for (int i = 0; i < 26; i++) { - qDebug() << aStream->device()->pos(); XMaterialTechnique newTechnique; - newTechnique.ParsePtr(aStream); + newTechnique.ParsePtr(aStream, false); mTechniques.append(newTechnique); } - qDebug() << aStream->device()->pos(); - mName.ParseData(aStream); + mName.ParseData(aStream, ","); for (int i = 0; i < 26; i++) { - XMaterialTechnique newTechnique = mTechniques[i]; - newTechnique.ParseData(aStream); + mTechniques[i].ParseData(aStream); } } diff --git a/libs/xassets/xmaterialtexturedef.h b/libs/xassets/xmaterialtexturedef.h index 75cca5a..7e33d00 100644 --- a/libs/xassets/xmaterialtexturedef.h +++ b/libs/xassets/xmaterialtexturedef.h @@ -14,7 +14,7 @@ public: virtual void Clear() override; private: - unsigned int mNameHash; + quint32 mNameHash; char mNameStart; char mNameEnd; quint8 mSamplerState; diff --git a/libs/xassets/xmaterialvertexdeclaration.cpp b/libs/xassets/xmaterialvertexdeclaration.cpp index 0402d50..1f45ab7 100644 --- a/libs/xassets/xmaterialvertexdeclaration.cpp +++ b/libs/xassets/xmaterialvertexdeclaration.cpp @@ -6,7 +6,7 @@ XMaterialVertexDeclaration::XMaterialVertexDeclaration() , mHasOptionalSource(false) , mRouting() { - + SetName("Material Vertex Declaration"); } void XMaterialVertexDeclaration::Clear() @@ -16,11 +16,20 @@ void XMaterialVertexDeclaration::Clear() void XMaterialVertexDeclaration::ParseData(QDataStream *aStream) { + if (IsDebug()) + { + qDebug() << QString("[%1]").arg(aStream->device()->pos(), 10, 10, QChar('0')) << "Parsing data for " << XAssetTypeToString(GetType()); + } if (GetPtr() == -1) { *aStream >> mStreamCount >> mHasOptionalSource; + if (IsDebug()) + { + qDebug() << QString("[%1]").arg(aStream->device()->pos(), 10, 10, QChar('0')) << " mStreamCount = " << mStreamCount; + qDebug() << QString("[%1]").arg(aStream->device()->pos(), 10, 10, QChar('0')) << " mHasOptionalSource = " << mHasOptionalSource; + } mRouting.ParseData(aStream); } diff --git a/libs/xassets/xmaterialvertexshader.cpp b/libs/xassets/xmaterialvertexshader.cpp index 83668dc..35a4117 100644 --- a/libs/xassets/xmaterialvertexshader.cpp +++ b/libs/xassets/xmaterialvertexshader.cpp @@ -6,7 +6,7 @@ XMaterialVertexShader::XMaterialVertexShader() , mName() , mProgram() { - + SetName("Material Vertex Shader"); } void XMaterialVertexShader::Clear() @@ -18,6 +18,10 @@ void XMaterialVertexShader::ParseData(QDataStream *aStream) { if (GetPtr() == -1) { + if (IsDebug()) + { + qDebug() << QString("[%1] Parsing data for %2").arg(aStream->device()->pos(), 10, 10, QChar('0')).arg(GetName()); + } mName.ParsePtr(aStream, false); mProgram.ParseData(aStream); diff --git a/libs/xassets/xmaterialvertexshaderprogram.cpp b/libs/xassets/xmaterialvertexshaderprogram.cpp index fa80781..7db234c 100644 --- a/libs/xassets/xmaterialvertexshaderprogram.cpp +++ b/libs/xassets/xmaterialvertexshaderprogram.cpp @@ -5,7 +5,7 @@ XMaterialVertexShaderProgram::XMaterialVertexShaderProgram() //, mVertexShader() , mLoadDef() { - + SetName("Material Vertex Shader Program"); } XMaterialVertexShaderProgram::~XMaterialVertexShaderProgram() @@ -21,5 +21,9 @@ void XMaterialVertexShaderProgram::Clear() void XMaterialVertexShaderProgram::ParseData(QDataStream *aStream) { + if (IsDebug()) + { + qDebug() << QString("[%1] Parsing data for %2").arg(aStream->device()->pos(), 10, 10, QChar('0')).arg(GetName()); + } mLoadDef.ParseData(aStream); } diff --git a/libs/xassets/xmaterialvertexstreamrouting.cpp b/libs/xassets/xmaterialvertexstreamrouting.cpp index c2dd8c0..d923711 100644 --- a/libs/xassets/xmaterialvertexstreamrouting.cpp +++ b/libs/xassets/xmaterialvertexstreamrouting.cpp @@ -2,8 +2,10 @@ XMaterialVertexStreamRouting::XMaterialVertexStreamRouting() : XAsset() + , mData(16) + , mDecl(15) { - + SetName("Material Vertex Stream Routing"); } void XMaterialVertexStreamRouting::Clear() @@ -13,5 +15,12 @@ void XMaterialVertexStreamRouting::Clear() void XMaterialVertexStreamRouting::ParseData(QDataStream *aStream) { - + if (IsDebug()) + { + qDebug() << QString("[%1] Parsing data for %2").arg(aStream->device()->pos(), 10, 10, QChar('0')).arg(GetName()); + } + for (int i = 0; i < 15; i++) + { + mDecl[i].ParsePtr(aStream, false); + } } diff --git a/libs/xassets/xmaterialvertexstreamrouting.h b/libs/xassets/xmaterialvertexstreamrouting.h index 0e880f4..ca17fee 100644 --- a/libs/xassets/xmaterialvertexstreamrouting.h +++ b/libs/xassets/xmaterialvertexstreamrouting.h @@ -14,8 +14,8 @@ public: virtual void ParseData(QDataStream *aStream) override; private: - XMaterialStreamRouting mData[16]; - XD3DVertexDeclaration mDecl[15]; + QVector mData; + QVector mDecl; }; #endif // XMATERIALVERTEXSTREAMROUTING_H diff --git a/libs/xassets/xmodeldrawinfo.h b/libs/xassets/xmodeldrawinfo.h index 725496a..e569bb8 100644 --- a/libs/xassets/xmodeldrawinfo.h +++ b/libs/xassets/xmodeldrawinfo.h @@ -13,8 +13,8 @@ public: virtual void Clear() override; private: - quint16 aLod; - quint16 aSurfId; + quint32 aLod; + quint32 aSurfId; }; #endif // XMODELDRAWINFO_H diff --git a/libs/xassets/xmodellodinfo.h b/libs/xassets/xmodellodinfo.h index bfa9287..4113055 100644 --- a/libs/xassets/xmodellodinfo.h +++ b/libs/xassets/xmodellodinfo.h @@ -16,8 +16,8 @@ public: private: float mDist; - quint16 mNumsurfs; - quint16 mSurfIndex; + quint32 mNumsurfs; + quint32 mSurfIndex; QVector mPartBits; }; diff --git a/libs/xassets/xpathbasenode.h b/libs/xassets/xpathbasenode.h index bd32559..5c27c88 100644 --- a/libs/xassets/xpathbasenode.h +++ b/libs/xassets/xpathbasenode.h @@ -16,7 +16,7 @@ public: private: QVector3D mOrigin; - unsigned int mType; + quint32 mType; }; #endif // XPATHBASENODE_H diff --git a/libs/xassets/xpathdata.cpp b/libs/xassets/xpathdata.cpp index 834887e..0ffe207 100644 --- a/libs/xassets/xpathdata.cpp +++ b/libs/xassets/xpathdata.cpp @@ -24,16 +24,16 @@ void XPathData::ParseData(QDataStream *aStream) { mNodeTrees.clear(); // Parse nodes - for (unsigned int i = 0; i < mNodeCount; ++i) { + for (quint32 i = 0; i < mNodeCount; ++i) { XPathNode node; node.ParseData(aStream); mNodes.append(node); } // Parse base nodes count and array - unsigned int baseNodeCount; + quint32 baseNodeCount; *aStream >> baseNodeCount; - for (unsigned int i = 0; i < baseNodeCount; ++i) { + for (quint32 i = 0; i < baseNodeCount; ++i) { XPathBaseNode baseNode; baseNode.ParseData(aStream); mBaseNodes.append(baseNode); @@ -69,11 +69,11 @@ void XPathData::ParseData(QDataStream *aStream) { } } -unsigned int XPathData::GetNodeCount() const { +quint32 XPathData::GetNodeCount() const { return mNodeCount; } -void XPathData::SetNodeCount(unsigned int count) { +void XPathData::SetNodeCount(quint32 count) { mNodeCount = count; } diff --git a/libs/xassets/xpathdata.h b/libs/xassets/xpathdata.h index 10831aa..310dc19 100644 --- a/libs/xassets/xpathdata.h +++ b/libs/xassets/xpathdata.h @@ -13,15 +13,15 @@ public: void ParseData(QDataStream *aStream) override; - unsigned int GetNodeCount() const; - void SetNodeCount(unsigned int count); + quint32 GetNodeCount() const; + void SetNodeCount(quint32 count); private: - unsigned int mNodeCount = 0; + quint32 mNodeCount = 0; // Using our new classes instead of raw pointers to structures QVector mNodes; // Vector for automatic memory management QVector mBaseNodes; - unsigned int mChainNodeCount = 0; + quint32 mChainNodeCount = 0; QVector mChainNodeForNode; QVector mNodeForChainNode; int mVisBytes = 0; diff --git a/libs/xassets/xphysgeomlist.h b/libs/xassets/xphysgeomlist.h index 7f857e5..ffbb3bc 100644 --- a/libs/xassets/xphysgeomlist.h +++ b/libs/xassets/xphysgeomlist.h @@ -15,7 +15,7 @@ public: virtual void Clear() override; private: - unsigned int mCount; + quint32 mCount; QVector mGeoms; XPhysMass mMass; }; diff --git a/libs/xassets/xrigidvertlist.h b/libs/xassets/xrigidvertlist.h index 38344be..b7639fb 100644 --- a/libs/xassets/xrigidvertlist.h +++ b/libs/xassets/xrigidvertlist.h @@ -13,10 +13,10 @@ public: void Clear() override; private: - quint16 mBoneOffset; - quint16 mVertCount; - quint16 mTriOffset; - quint16 mTriCount; + quint32 mBoneOffset; + quint32 mVertCount; + quint32 mTriOffset; + quint32 mTriCount; XSurfaceCollisionTree *mCollisionTree; }; diff --git a/libs/xassets/xscriptstringlist.cpp b/libs/xassets/xscriptstringlist.cpp index 77be195..4db9386 100644 --- a/libs/xassets/xscriptstringlist.cpp +++ b/libs/xassets/xscriptstringlist.cpp @@ -7,7 +7,7 @@ XScriptStringList::XScriptStringList() , mStringPtrs() , mScriptStrings() { - + SetName("Script String List"); } int XScriptStringList::Size() @@ -26,6 +26,10 @@ void XScriptStringList::ParseData(QDataStream *aStream) { if (GetPtr() == -1) { + if (IsDebug()) + { + qDebug() << QString("[%1] Parsing data for %2").arg(aStream->device()->pos(), 10, 10, QChar('0')).arg(GetName()); + } for (int i = 0; i < mCount; i++) { qint32 tempStringPtr; @@ -33,7 +37,12 @@ void XScriptStringList::ParseData(QDataStream *aStream) if (tempStringPtr == -1) { - mScriptStrings << XString::ParseCustom(aStream); + const QString newScriptString = XString::ParseCustom(aStream); + mScriptStrings << newScriptString; + if (IsDebug()) + { + qDebug() << QString("[%1] newScriptString = %2").arg(aStream->device()->pos(), 10, 10, QChar('0')).arg(newScriptString); + } } } } @@ -46,6 +55,18 @@ void XScriptStringList::ParsePtr(QDataStream *aStream, bool aDataFlag) *aStream >> mCount >> stringsPtr; + if (mDebug) + { + // Always treat as unsigned when displaying in hex + quint64 raw = static_cast(static_cast(GetPtr())); + + QString hexPtr = QString("0x%1") + .arg(raw, 8, 16, QLatin1Char('0')) + .toUpper(); + + qDebug() << QString("[%1] Parsed %2 ptr %3 (%4)").arg(aStream->device()->pos(), 10, 10, QChar('0')).arg(GetName()).arg(stringsPtr).arg(hexPtr); + qDebug() << QString("[%1] mCount = %2").arg(aStream->device()->pos(), 10, 10, QChar('0')).arg(mCount); + } SetPtr(stringsPtr); diff --git a/libs/xassets/xsentienthandle.h b/libs/xassets/xsentienthandle.h index 1426d91..6ec7e50 100644 --- a/libs/xassets/xsentienthandle.h +++ b/libs/xassets/xsentienthandle.h @@ -13,8 +13,8 @@ public: void Clear() override; private: - quint16 mNumber; - quint16 mInfoIndex; + quint32 mNumber; + quint32 mInfoIndex; }; #endif // XSENTIENTHANDLE_H diff --git a/libs/xassets/xsoundalias.cpp b/libs/xassets/xsoundalias.cpp index 40152ca..cdce085 100644 --- a/libs/xassets/xsoundalias.cpp +++ b/libs/xassets/xsoundalias.cpp @@ -1,6 +1,30 @@ #include "xsoundalias.h" XSoundAlias::XSoundAlias() + : XAsset() + , mAliasName() + , mSubtitle() + , mSecondaryAliasName() + , mChainAliasName() + , mSoundFile() + , mSequence(0) + , mVolMin(0.0f) + , mVolMax(0.0f) + , mPitchMin(0.0f) + , mPitchMax(0.0f) + , mDistMin(0.0f) + , mDistMax(0.0f) + , mFlags(0) + , mSlavePercentage(0.0f) + , mProbability(0.0f) + , mLfePercentage(0.0f) + , mCenterPercentage(0.0f) + , mStartDelay(0) + , mVolumeFalloffCurve() + , mEnvelopMin(0.0f) + , mEnvelopMax(0.0f) + , mEnvelopPercentage(0.0f) + , mSpeakerMap() { } @@ -17,5 +41,42 @@ void XSoundAlias::Clear() void XSoundAlias::ParseData(QDataStream *aStream) { + mAliasName.ParsePtr(aStream, false); + mSubtitle.ParsePtr(aStream, false); + mSecondaryAliasName.ParsePtr(aStream, false); + mChainAliasName.ParsePtr(aStream, false); + qint32 soundFilePtr; + *aStream + >> soundFilePtr + >> mSequence + >> mVolMin + >> mVolMax + >> mPitchMin + >> mPitchMax + >> mDistMin + >> mDistMax + >> mFlags + >> mSlavePercentage + >> mProbability + >> mLfePercentage + >> mCenterPercentage + >> mStartDelay; + + mVolumeFalloffCurve.ParsePtr(aStream, false); + + *aStream + >> mEnvelopMin + >> mEnvelopMax + >> mEnvelopPercentage; + + mSpeakerMap.ParsePtr(aStream, false); + + mAliasName.ParseData(aStream); + mSubtitle.ParseData(aStream); + mSecondaryAliasName.ParseData(aStream); + mChainAliasName.ParseData(aStream); + mSoundFile.ParseData(aStream); + mVolumeFalloffCurve.ParseData(aStream); + mSpeakerMap.ParseData(aStream); } diff --git a/libs/xassets/xsoundalias.h b/libs/xassets/xsoundalias.h index 98e3b55..15cef22 100644 --- a/libs/xassets/xsoundalias.h +++ b/libs/xassets/xsoundalias.h @@ -17,11 +17,11 @@ public: virtual void ParseData(QDataStream* aStream) override; private: - XString* mAliasName; - XString* mSubtitle; - XString* mSecondaryAliasName; - XString* mChainAliasName; - XSoundFile* mSoundFile; + XString mAliasName; + XString mSubtitle; + XString mSecondaryAliasName; + XString mChainAliasName; + XSoundFile mSoundFile; int mSequence; float mVolMin; float mVolMax; @@ -35,11 +35,11 @@ private: float mLfePercentage; float mCenterPercentage; int mStartDelay; - XSoundCurve* mVolumeFalloffCurve; + XSoundCurve mVolumeFalloffCurve; float mEnvelopMin; float mEnvelopMax; float mEnvelopPercentage; - XSpeakerMap* mSpeakerMap; + XSpeakerMap mSpeakerMap; }; diff --git a/libs/xassets/xsoundaliaslist.cpp b/libs/xassets/xsoundaliaslist.cpp index d925db9..79a9097 100644 --- a/libs/xassets/xsoundaliaslist.cpp +++ b/libs/xassets/xsoundaliaslist.cpp @@ -2,8 +2,8 @@ XSoundAliasList::XSoundAliasList() : XAsset() - , mAliasName("") - , mHead(new XSoundAlias()) + , mAliasName() + , mAliases() , mCount(0) { SetType(ASSET_TYPE_SOUND); @@ -17,10 +17,32 @@ XSoundAliasList::~XSoundAliasList() void XSoundAliasList::Clear() { - + mAliasName.Clear(); + mAliases.clear(); + mCount = 0; } void XSoundAliasList::ParseData(QDataStream *aStream) { + if (GetPtr() == -1) + { + mAliasName.ParsePtr(aStream, false); + qint32 headPtr; + *aStream + >> headPtr + >> mCount; + + mAliasName.ParseData(aStream); + + if (headPtr == -1) + { + for (int i = 0; i < mCount; i++) + { + XSoundAlias newAlias; + newAlias.ParseData(aStream); + mAliases.append(newAlias); + } + } + } } diff --git a/libs/xassets/xsoundaliaslist.h b/libs/xassets/xsoundaliaslist.h index 4058580..00fa159 100644 --- a/libs/xassets/xsoundaliaslist.h +++ b/libs/xassets/xsoundaliaslist.h @@ -14,8 +14,8 @@ public: virtual void ParseData(QDataStream* aStream) override; private: - QString mAliasName; - XSoundAlias *mHead; + XString mAliasName; + QVector mAliases; int mCount; }; diff --git a/libs/xassets/xsoundfile.cpp b/libs/xassets/xsoundfile.cpp index a8426d1..c606aff 100644 --- a/libs/xassets/xsoundfile.cpp +++ b/libs/xassets/xsoundfile.cpp @@ -1,6 +1,10 @@ #include "xsoundfile.h" XSoundFile::XSoundFile() + : XAsset() + , mType(0) + , mExists(0) + , mRef() { } @@ -10,12 +14,28 @@ XSoundFile::~XSoundFile() } +quint8 XSoundFile::GetSoundType() const +{ + return mType; +} + void XSoundFile::ParseData(QDataStream *aStream) { + if (GetPtr() == -1) + { + *aStream + >> mType + >> mExists; + aStream->skipRawData(2); + + mRef.ParseData(aStream); + } } void XSoundFile::Clear() { - + mType = 0; + mExists = 0; + mRef.Clear(); } diff --git a/libs/xassets/xsoundfile.h b/libs/xassets/xsoundfile.h index 5616abd..440e65d 100644 --- a/libs/xassets/xsoundfile.h +++ b/libs/xassets/xsoundfile.h @@ -2,8 +2,7 @@ #define XSOUNDFILE_H #include "xasset.h" - -class XSoundFileRef; +#include "xsoundfileref.h" class XSoundFile : public XAsset { @@ -11,13 +10,15 @@ public: XSoundFile(); ~XSoundFile(); + quint8 GetSoundType() const; + virtual void ParseData(QDataStream* aStream) override; virtual void Clear() override; private: quint8 mType; quint8 mExists; - XSoundFileRef* mRef; + XSoundFileRef mRef; }; #endif // XSOUNDFILE_H diff --git a/libs/xassets/xsoundfileref.cpp b/libs/xassets/xsoundfileref.cpp index 325be58..0649c64 100644 --- a/libs/xassets/xsoundfileref.cpp +++ b/libs/xassets/xsoundfileref.cpp @@ -1,8 +1,19 @@ #include "xsoundfileref.h" +#include "xsoundfile.h" XSoundFileRef::XSoundFileRef() : XAsset() - , mLoadSnd(new XLoadedSound()) + , mParent() + , mLoadedSnd() + , mStreamSnd() +{ + +} + +XSoundFileRef::XSoundFileRef(XSoundFile &aParent) + : XAsset() + , mParent(&aParent) + , mLoadedSnd() , mStreamSnd() { @@ -10,16 +21,22 @@ XSoundFileRef::XSoundFileRef() XSoundFileRef::~XSoundFileRef() { - delete mLoadSnd; + } void XSoundFileRef::ParseData(QDataStream *aStream) { - + if (mParent->GetSoundType() == 1) + { + mLoadedSnd.ParsePtr(aStream); + } + else + { + mStreamSnd.ParseData(aStream); + } } void XSoundFileRef::Clear() { - mLoadSnd->Clear(); mStreamSnd.Clear(); } diff --git a/libs/xassets/xsoundfileref.h b/libs/xassets/xsoundfileref.h index 2d42b32..2e023f7 100644 --- a/libs/xassets/xsoundfileref.h +++ b/libs/xassets/xsoundfileref.h @@ -5,17 +5,21 @@ #include "xloadedsound.h" #include "xstreamedsound.h" +class XSoundFile; + class XSoundFileRef : public XAsset { public: explicit XSoundFileRef(); + XSoundFileRef(XSoundFile& aParent); ~XSoundFileRef(); virtual void ParseData(QDataStream* aStream) override; virtual void Clear() override; private: - XLoadedSound *mLoadSnd; + XSoundFile* mParent; + XLoadedSound mLoadedSnd; XStreamedSound mStreamSnd; }; diff --git a/libs/xassets/xspeakermap.cpp b/libs/xassets/xspeakermap.cpp index f969e2b..35b91c0 100644 --- a/libs/xassets/xspeakermap.cpp +++ b/libs/xassets/xspeakermap.cpp @@ -82,28 +82,31 @@ QVector XSpeakerMap::ParseChannelArray(QDataStream *aStream, void XSpeakerMap::ParseData(QDataStream *aStream) { - *aStream >> mIsDefault; - - // Skip padding bytes in struct - aStream->skipRawData(3); - - mName->ParsePtr(aStream, false); - - auto channelArray = ParseChannelArray(aStream, MAP_DIM); - - - - for (int i = 0; i < 2; i++) + if (GetPtr() == -1) { - for (int j = 0; j < 2; j++) + *aStream >> mIsDefault; + + // Skip padding bytes in struct + aStream->skipRawData(3); + + mName->ParsePtr(aStream, false); + + auto channelArray = ParseChannelArray(aStream, MAP_DIM); + + + + for (int i = 0; i < 2; i++) { - XAudioChannelMap* newChannelMap = new XAudioChannelMap(); + for (int j = 0; j < 2; j++) + { + XAudioChannelMap* newChannelMap = new XAudioChannelMap(); - mChannelMaps[i][j] = newChannelMap; + mChannelMaps[i][j] = newChannelMap; + } } - } - mName->ParseData(aStream); + mName->ParseData(aStream); + } } void XSpeakerMap::Clear() diff --git a/libs/xassets/xsrftriangles.h b/libs/xassets/xsrftriangles.h index 39be526..28f82aa 100644 --- a/libs/xassets/xsrftriangles.h +++ b/libs/xassets/xsrftriangles.h @@ -17,8 +17,8 @@ public: private: int mVertexLayerData; int mFirstVertex; - quint16 mVertexCount; - quint16 mTriCount; + quint32 mVertexCount; + quint32 mTriCount; int mBaseIndex; QVector3D mTopMipMins; QVector3D mTopMipMaxs; diff --git a/libs/xassets/xstreamfilenamepacked.h b/libs/xassets/xstreamfilenamepacked.h index 1a3d4f4..b5b5600 100644 --- a/libs/xassets/xstreamfilenamepacked.h +++ b/libs/xassets/xstreamfilenamepacked.h @@ -15,8 +15,8 @@ public: virtual void Clear() override; private: - unsigned int mOffset; - unsigned int mLength; + quint32 mOffset; + quint32 mLength; }; #endif // XSTREAMFILENAMEPACKED_H diff --git a/libs/xassets/xstreamsourceinfo.h b/libs/xassets/xstreamsourceinfo.h index 0a4a23b..3eeb0f4 100644 --- a/libs/xassets/xstreamsourceinfo.h +++ b/libs/xassets/xstreamsourceinfo.h @@ -13,8 +13,8 @@ public: virtual void ParseData(QDataStream* aStream) override; private: - quint16 mStream; - quint16 mOffset; + quint32 mStream; + quint32 mOffset; uint mType; }; diff --git a/libs/xassets/xstring.cpp b/libs/xassets/xstring.cpp index 395a645..bdfd304 100644 --- a/libs/xassets/xstring.cpp +++ b/libs/xassets/xstring.cpp @@ -1,10 +1,13 @@ #include "xstring.h" +#include +#include + XString::XString() : XAsset() , mString("") { - + SetName("String"); } XString::XString(const QString aString) @@ -65,10 +68,23 @@ void XString::Clear() } void XString::ParseData(QDataStream *aStream) +{ + ParseData(aStream, ""); +} + +void XString::ParseData(QDataStream *aStream, QString aRemoveStr) { if (GetPtr() == -1) { mString = ParseCustom(aStream); + if (!aRemoveStr.isEmpty()) + { + mString = mString.replace(aRemoveStr, ""); + } + if (IsDebug()) + { + qDebug() << QString("[%1] mString = %2").arg(aStream->device()->pos(), 10, 10, QChar('0')).arg(mString); + } } } diff --git a/libs/xassets/xstring.h b/libs/xassets/xstring.h index e18d3f6..7bce201 100644 --- a/libs/xassets/xstring.h +++ b/libs/xassets/xstring.h @@ -22,6 +22,7 @@ public: virtual void Clear() override; virtual void ParseData(QDataStream* aStream) override; + virtual void ParseData(QDataStream* aStream, QString aRemoveStr); private: QString mString; diff --git a/libs/xassets/xsurface.h b/libs/xassets/xsurface.h index e1f48ac..8a82583 100644 --- a/libs/xassets/xsurface.h +++ b/libs/xassets/xsurface.h @@ -19,13 +19,13 @@ public: private: quint8 mTileMode; bool mDeformed; - quint16 mVertCount; - quint16 mTriCount; - quint16 *mTriIndices; + quint32 mVertCount; + quint32 mTriCount; + quint32 *mTriIndices; XSurfaceVertexInfo mVertInfo; XGfxPackedVertex *mVerts0; XD3DVertexBuffer mVb0; - unsigned int mVertListCount; + quint32 mVertListCount; QVector mVertList; XD3DIndexBuffer mIndexBuffer; int mPartBits[4]; diff --git a/libs/xassets/xsurfacecollisionaabb.h b/libs/xassets/xsurfacecollisionaabb.h index d283232..cc46e18 100644 --- a/libs/xassets/xsurfacecollisionaabb.h +++ b/libs/xassets/xsurfacecollisionaabb.h @@ -12,8 +12,8 @@ public: void Clear() override; private: - quint16 mMins[3]; - quint16 mMaxs[3]; + quint32 mMins[3]; + quint32 mMaxs[3]; }; #endif // XSURFACECOLLISIONAAB_H diff --git a/libs/xassets/xsurfacecollisionleaf.h b/libs/xassets/xsurfacecollisionleaf.h index baf7f31..9e38b0b 100644 --- a/libs/xassets/xsurfacecollisionleaf.h +++ b/libs/xassets/xsurfacecollisionleaf.h @@ -12,7 +12,7 @@ public: void Clear() override; private: - quint16 mTriangleBeginIndex; + quint32 mTriangleBeginIndex; }; #endif // XSURFACECOLLISIONLEAF_H diff --git a/libs/xassets/xsurfacecollisionnode.h b/libs/xassets/xsurfacecollisionnode.h index 439cc97..c8465bd 100644 --- a/libs/xassets/xsurfacecollisionnode.h +++ b/libs/xassets/xsurfacecollisionnode.h @@ -14,8 +14,8 @@ public: private: XSurfaceCollisionAabb mAABB; - quint16 mChildBeginIndex; - quint16 mChildCount; + quint32 mChildBeginIndex; + quint32 mChildCount; }; #endif // XSURFACECOLLISIONNODE_H diff --git a/libs/xassets/xsurfacecollisiontree.h b/libs/xassets/xsurfacecollisiontree.h index 139a707..8f81b87 100644 --- a/libs/xassets/xsurfacecollisiontree.h +++ b/libs/xassets/xsurfacecollisiontree.h @@ -18,9 +18,9 @@ public: private: float mTrans[3]; float mScale[3]; - unsigned int mNodeCount; + quint32 mNodeCount; QVector mNodes; - unsigned int mLeafCount; + quint32 mLeafCount; QVector mLeafs; }; diff --git a/libs/xassets/xsurfacevertexinfo.h b/libs/xassets/xsurfacevertexinfo.h index f4dff40..005e649 100644 --- a/libs/xassets/xsurfacevertexinfo.h +++ b/libs/xassets/xsurfacevertexinfo.h @@ -14,7 +14,7 @@ public: private: qint16 mVertCount[4]; qint32 mVertsBlendPtr; - quint16 mVertsBlend; + quint32 mVertsBlend; }; #endif // XSURFACEVERTEXINFO_H diff --git a/libs/xassets/xweapondef.h b/libs/xassets/xweapondef.h index 792ea45..d0febfa 100644 --- a/libs/xassets/xweapondef.h +++ b/libs/xassets/xweapondef.h @@ -28,9 +28,9 @@ private: QStringList mXAnims; QString mModeName; - quint16 mHideTags[8]; - quint16 mNotetrackSoundMapKeys[16]; - quint16 mNotetrackSoundMapValues[16]; + quint32 mHideTags[8]; + quint32 mNotetrackSoundMapKeys[16]; + quint32 mNotetrackSoundMapValues[16]; int mPlayerAnimType; XWeaponType mWeapType; XWeaponClass mWeapClass; diff --git a/libs/zonefile/360/zonefile_cod6_360.cpp b/libs/zonefile/360/zonefile_cod6_360.cpp index a91ffc8..2c88e9c 100644 --- a/libs/zonefile/360/zonefile_cod6_360.cpp +++ b/libs/zonefile/360/zonefile_cod6_360.cpp @@ -531,7 +531,7 @@ bool ZoneFile_COD6_360::Load(const QByteArray aFileData) { // if (magic != 65534 && magic != 65535) { return result; } // SHADER_TYPE type = SHADER_NONE; -// quint16 rawShaderType; +// quint32 rawShaderType; // *aZoneFileStream >> rawShaderType; // if (rawShaderType == 65535) { // Pixel shader // type = SHADER_PIXEL; diff --git a/tests/360/autotest_cod4_360.cpp b/tests/360/autotest_cod4_360.cpp index 837839d..d848802 100644 --- a/tests/360/autotest_cod4_360.cpp +++ b/tests/360/autotest_cod4_360.cpp @@ -4,6 +4,7 @@ #include "autotest_cod.h" #include "compression.h" +#include "fastfile.h" class AutoTest_COD4_360 : public AutoTest_COD { Q_OBJECT @@ -59,11 +60,11 @@ void AutoTest_COD4_360::testDecompression() { zoneStream.setByteOrder(QDataStream::BigEndian); quint32 zoneSize; zoneStream >> zoneSize; - if (abs(zoneSize - testZoneData.size()) != 36) { + if (fabs(zoneSize - testZoneData.size()) != 36) { qDebug() << "Zone Size: " << zoneSize; qDebug() << "Test zone Size: " << testZoneData.size(); } - QVERIFY2(abs(zoneSize - testZoneData.size()) == 36, + QVERIFY2(fabs(zoneSize - testZoneData.size()) == 36, qPrintable("Decompression validation failed for: " + fastFilePath)); // Write the decompressed zone data to the exports folder with a .zone extension. @@ -122,7 +123,7 @@ void AutoTest_COD4_360::testFactory() { const QString testName = "Factory ingest: " + fastFilePath; - FastFile* fastFile = FastFileFactory::Create(fastFilePath); + FastFile* fastFile = FastFile::Open(fastFilePath); const QString game = fastFile->GetGame(); bool correctGame = game == "COD4"; diff --git a/tests/360/autotest_cod5_360.cpp b/tests/360/autotest_cod5_360.cpp index aa21cae..7ae62fc 100644 --- a/tests/360/autotest_cod5_360.cpp +++ b/tests/360/autotest_cod5_360.cpp @@ -56,10 +56,10 @@ void AutoTest_COD5_360::testDecompression() { zoneStream.setByteOrder(QDataStream::BigEndian); quint32 zoneSize; zoneStream >> zoneSize; - if (abs(zoneSize - testZoneData.size()) != 36) { + if (fabs(zoneSize - testZoneData.size()) != 36) { qDebug() << "Zone Size: " << zoneSize; qDebug() << "Test zone Size: " << testZoneData.size(); - qDebug() << "Difference: " << abs(zoneSize - testZoneData.size()); + qDebug() << "Difference: " << fabs(zoneSize - testZoneData.size()); } QVERIFY2(zoneSize + 36 == testZoneData.size(), qPrintable("Decompression validation failed for: " + fastFilePath)); diff --git a/tests/360/autotest_cod6_360.cpp b/tests/360/autotest_cod6_360.cpp index 24ebd11..2aaa7cf 100644 --- a/tests/360/autotest_cod6_360.cpp +++ b/tests/360/autotest_cod6_360.cpp @@ -75,10 +75,10 @@ void AutoTest_COD6_360::testDecompression() { zoneStream.setByteOrder(QDataStream::BigEndian); quint32 zoneSize; zoneStream >> zoneSize; - if (abs(zoneSize - testZoneData.size()) != 32) { + if (fabs(zoneSize - testZoneData.size()) != 32) { qDebug() << "Zone Size: " << zoneSize; qDebug() << "Test zone Size: " << testZoneData.size(); - qDebug() << "Difference: " << abs(zoneSize - testZoneData.size()); + qDebug() << "Difference: " << fabs(zoneSize - testZoneData.size()); } QVERIFY2(zoneSize + 32 == testZoneData.size(), qPrintable("Decompression validation failed for: " + fastFilePath)); diff --git a/tests/360/autotest_cod7_360.cpp b/tests/360/autotest_cod7_360.cpp index 0c2d70d..9ae7a11 100644 --- a/tests/360/autotest_cod7_360.cpp +++ b/tests/360/autotest_cod7_360.cpp @@ -112,10 +112,10 @@ void AutoTest_COD7_360::testDecompression() { zoneStream.setByteOrder(QDataStream::BigEndian); quint32 zoneSize; zoneStream >> zoneSize; - if (abs(zoneSize - testZoneData.size()) != 36) { + if (fabs(zoneSize - testZoneData.size()) != 36) { qDebug() << "Zone Size: " << zoneSize; qDebug() << "Test zone Size: " << testZoneData.size(); - qDebug() << "Difference: " << abs(zoneSize - testZoneData.size()); + qDebug() << "Difference: " << fabs(zoneSize - testZoneData.size()); } QVERIFY2(zoneSize + 36 == testZoneData.size(), qPrintable("Decompression validation failed for: " + fastFilePath)); diff --git a/tests/360/autotest_cod8_360.cpp b/tests/360/autotest_cod8_360.cpp index a5d56ce..3bbd9c1 100644 --- a/tests/360/autotest_cod8_360.cpp +++ b/tests/360/autotest_cod8_360.cpp @@ -69,10 +69,10 @@ void AutoTest_COD8_360::testDecompression() { zoneStream.setByteOrder(QDataStream::LittleEndian); quint32 zoneSize; zoneStream >> zoneSize; - if (abs(zoneSize - testZoneData.size()) != 44) { + if (fabs(zoneSize - testZoneData.size()) != 44) { qDebug() << "Zone Size: " << zoneSize; qDebug() << "Test zone Size: " << testZoneData.size(); - qDebug() << "Difference: " << abs(zoneSize - testZoneData.size()); + qDebug() << "Difference: " << fabs(zoneSize - testZoneData.size()); } //QVERIFY2(zoneSize + 44 == testZoneData.size(), // qPrintable("Decompression validation failed for: " + fastFilePath)); diff --git a/tests/PS3/autotest_cod4_ps3.cpp b/tests/PS3/autotest_cod4_ps3.cpp index 2402d2d..75c315f 100644 --- a/tests/PS3/autotest_cod4_ps3.cpp +++ b/tests/PS3/autotest_cod4_ps3.cpp @@ -61,7 +61,7 @@ void AutoTest_COD4_PS3::testDecompression() { // Loop until EOF or invalid chunk while (pos <= testFFData.size()) { // Read 2-byte BIG-ENDIAN chunk size - quint16 chunkSize; + quint32 chunkSize; QDataStream chunkStream(testFFData.mid(pos, 2)); chunkStream.setByteOrder(QDataStream::BigEndian); chunkStream >> chunkSize; @@ -124,7 +124,7 @@ void AutoTest_COD4_PS3::testCompression() { offset += chunk.size(); QByteArray compressedChunk = Compression::CompressDeflate(chunk); - quint16 length = static_cast(compressedChunk.size()); + quint32 length = static_cast(compressedChunk.size()); // Write 2-byte big-endian chunk size recompressedData.append(static_cast((length >> 8) & 0xFF)); diff --git a/tests/PS3/autotest_cod5_ps3.cpp b/tests/PS3/autotest_cod5_ps3.cpp index be875aa..81e5d39 100644 --- a/tests/PS3/autotest_cod5_ps3.cpp +++ b/tests/PS3/autotest_cod5_ps3.cpp @@ -61,7 +61,7 @@ void AutoTest_COD5_PS3::testDecompression() { // Loop until EOF or invalid chunk while (pos <= testFFData.size()) { // Read 2-byte BIG-ENDIAN chunk size - quint16 chunkSize; + quint32 chunkSize; QDataStream chunkStream(testFFData.mid(pos, 2)); chunkStream.setByteOrder(QDataStream::BigEndian); chunkStream >> chunkSize; @@ -123,7 +123,7 @@ void AutoTest_COD5_PS3::testCompression() { offset += chunk.size(); QByteArray compressedChunk = Compression::CompressDeflate(chunk); - quint16 length = static_cast(compressedChunk.size()); + quint32 length = static_cast(compressedChunk.size()); // Write 2-byte big-endian chunk size recompressedData.append(static_cast((length >> 8) & 0xFF)); diff --git a/tests/PS3/autotest_cod7_ps3.cpp b/tests/PS3/autotest_cod7_ps3.cpp index 95c368c..bd36285 100644 --- a/tests/PS3/autotest_cod7_ps3.cpp +++ b/tests/PS3/autotest_cod7_ps3.cpp @@ -111,10 +111,10 @@ void AutoTest_COD7_PS3::testDecompression() { zoneStream.setByteOrder(QDataStream::BigEndian); quint32 zoneSize; zoneStream >> zoneSize; - if (abs(zoneSize - testZoneData.size()) != 36) { + if (fabs(zoneSize - testZoneData.size()) != 36) { qDebug() << "Zone Size: " << zoneSize; qDebug() << "Test zone Size: " << testZoneData.size(); - qDebug() << "Difference: " << abs(zoneSize - testZoneData.size()); + qDebug() << "Difference: " << fabs(zoneSize - testZoneData.size()); } QVERIFY2(zoneSize + 36 == testZoneData.size(), qPrintable("Decompression validation failed for: " + fastFilePath)); diff --git a/tests/tests.pro b/tests/tests.pro index c1da1a0..c2c3e47 100644 --- a/tests/tests.pro +++ b/tests/tests.pro @@ -2,7 +2,7 @@ TEMPLATE = app CONFIG += no_main # Enable the testlib module -QT += testlib core-private +QT += testlib #core-private # Define a test-specific flag DEFINES += QT_TESTS @@ -20,9 +20,9 @@ HEADERS += $$files($$PWD/*.h, true) # } LIBS += \ - -L$$PWD/../third_party/devil_sdk/lib/ -lDevIL -lILU -lILUT \ - -L$$PWD/../third_party/zlib/lib/ -lzlib \ - -L$$PWD/../third_party/xbox_sdk/lib -lxcompress64 \ + #-L$$PWD/../third_party/devil_sdk/lib/ -lDevIL -lILU -lILUT \ + #-L$$PWD/../third_party/zlib/lib/ -lzlib \ + #-L$$PWD/../third_party/xbox_sdk/lib -lxcompress64 \ -L$$OUT_PWD/../libs/ -lcore \ -L$$OUT_PWD/../libs/ -lxassets\ -L$$OUT_PWD/../libs/ -lcompression \ @@ -34,9 +34,9 @@ LIBS += \ -L$$OUT_PWD/../libs/ -lzonefile INCLUDEPATH += \ - $$PWD/../third_party/devil_sdk/include/ \ - $$PWD/../third_party/zlib/include \ - $$PWD/../third_party/xbox_sdk/include \ + #$$PWD/../third_party/devil_sdk/include/ \ + #$$PWD/../third_party/zlib/include \ + #$$PWD/../third_party/xbox_sdk/include \ $$PWD/../libs/core \ $$PWD/../libs/compression \ $$PWD/../libs/encryption \ @@ -48,9 +48,9 @@ INCLUDEPATH += \ $$PWD/../libs/zonefile DEPENDPATH += \ - $$PWD/../third_party/devil_sdk/include/ \ - $$PWD/../third_party/zlib/include \ - $$PWD/../third_party/xbox_sdk/include \ + #$$PWD/../third_party/devil_sdk/include/ \ + #$$PWD/../third_party/zlib/include \ + #$$PWD/../third_party/xbox_sdk/include \ $$PWD/../libs/core \ $$PWD/../libs/compression \ $$PWD/../libs/encryption \ diff --git a/tools/asset_assess/asset_assess.pro b/tools/asset_assess/asset_assess.pro index c63325e..d964653 100644 --- a/tools/asset_assess/asset_assess.pro +++ b/tools/asset_assess/asset_assess.pro @@ -8,9 +8,9 @@ SOURCES += $$files($$PWD/*.cpp, true) HEADERS += $$files($$PWD/*.h, true) LIBS += \ - -L$$PWD/../../third_party/devil_sdk/lib/ -lDevIL -lILU -lILUT \ - -L$$PWD/../../third_party/zlib/lib/ -lzlib \ - -L$$PWD/../../third_party/xbox_sdk/lib -lxcompress64 \ + #-L$$PWD/../../third_party/devil_sdk/lib/ -lDevIL -lILU -lILUT \ + #-L$$PWD/../../third_party/zlib/lib/ -lzlib \ + #-L$$PWD/../../third_party/xbox_sdk/lib -lxcompress64 \ -L$$OUT_PWD/../../libs/ -lcore \ -L$$OUT_PWD/../../libs/ -lxassets\ -L$$OUT_PWD/../../libs/ -lcompression \ @@ -22,9 +22,9 @@ LIBS += \ -L$$OUT_PWD/../../libs/ -lzonefile INCLUDEPATH += \ - $$PWD/../../third_party/devil_sdk/include/ \ - $$PWD/../../third_party/zlib/include \ - $$PWD/../../third_party/xbox_sdk/include \ + #$$PWD/../../third_party/devil_sdk/include/ \ + #$$PWD/../../third_party/zlib/include \ + #$$PWD/../../third_party/xbox_sdk/include \ $$PWD/../../libs/core \ $$PWD/../../libs/compression \ $$PWD/../../libs/encryption \ @@ -36,9 +36,9 @@ INCLUDEPATH += \ $$PWD/../../libs/zonefile DEPENDPATH += \ - $$PWD/../../third_party/devil_sdk/include/ \ - $$PWD/../../third_party/zlib/include \ - $$PWD/../../third_party/xbox_sdk/include \ + #$$PWD/../../third_party/devil_sdk/include/ \ + #$$PWD/../../third_party/zlib/include \ + #$$PWD/../../third_party/xbox_sdk/include \ $$PWD/../../libs/core \ $$PWD/../../libs/compression \ $$PWD/../../libs/encryption \ diff --git a/tools/compro/compro.pro b/tools/compro/compro.pro index 4c35d77..7b8472a 100644 --- a/tools/compro/compro.pro +++ b/tools/compro/compro.pro @@ -7,9 +7,9 @@ HEADERS += $$files($$PWD/*.h, true) FORMS += $$files($$PWD/*.ui, true) LIBS += \ - -L$$PWD/../../third_party/devil_sdk/lib/ -lDevIL -lILU -lILUT \ - -L$$PWD/../../third_party/zlib/lib/ -lzlib \ - -L$$PWD/../../third_party/xbox_sdk/lib -lxcompress64 \ + #-L$$PWD/../../third_party/devil_sdk/lib/ -lDevIL -lILU -lILUT \ + #-L$$PWD/../../third_party/zlib/lib/ -lzlib \ + #-L$$PWD/../../third_party/xbox_sdk/lib -lxcompress64 \ -L$$OUT_PWD/../../libs/ -lcore \ -L$$OUT_PWD/../../libs/ -lxassets\ -L$$OUT_PWD/../../libs/ -lcompression \ @@ -21,9 +21,9 @@ LIBS += \ -L$$OUT_PWD/../../libs/ -lzonefile INCLUDEPATH += \ - $$PWD/../../third_party/devil_sdk/include/ \ - $$PWD/../../third_party/zlib/include \ - $$PWD/../../third_party/xbox_sdk/include \ + #$$PWD/../../third_party/devil_sdk/include/ \ + #$$PWD/../../third_party/zlib/include \ + #$$PWD/../../third_party/xbox_sdk/include \ $$PWD/../../libs/core \ $$PWD/../../libs/compression \ $$PWD/../../libs/encryption \ @@ -35,9 +35,9 @@ INCLUDEPATH += \ $$PWD/../../libs/zonefile DEPENDPATH += \ - $$PWD/../../third_party/devil_sdk/include/ \ - $$PWD/../../third_party/zlib/include \ - $$PWD/../../third_party/xbox_sdk/include \ + #$$PWD/../../third_party/devil_sdk/include/ \ + #$$PWD/../../third_party/zlib/include \ + #$$PWD/../../third_party/xbox_sdk/include \ $$PWD/../../libs/core \ $$PWD/../../libs/compression \ $$PWD/../../libs/encryption \ diff --git a/tools/zentry/zentry.pro b/tools/zentry/zentry.pro index 46d982e..636fa59 100644 --- a/tools/zentry/zentry.pro +++ b/tools/zentry/zentry.pro @@ -9,9 +9,9 @@ HEADERS += $$files($$PWD/*.h, true) FORMS += $$files($$PWD/*.ui, true) LIBS += \ - -L$$PWD/../../third_party/devil_sdk/lib/ -lDevIL -lILU -lILUT \ - -L$$PWD/../../third_party/zlib/lib/ -lzlib \ - -L$$PWD/../../third_party/xbox_sdk/lib -lxcompress64 \ + #-L$$PWD/../../third_party/devil_sdk/lib/ -lDevIL -lILU -lILUT \ + #-L$$PWD/../../third_party/zlib/lib/ -lzlib \ + #-L$$PWD/../../third_party/xbox_sdk/lib -lxcompress64 \ -L$$OUT_PWD/../../libs/ -lcore \ -L$$OUT_PWD/../../libs/ -lxassets\ -L$$OUT_PWD/../../libs/ -lcompression \ @@ -23,9 +23,9 @@ LIBS += \ -L$$OUT_PWD/../../libs/ -lzonefile INCLUDEPATH += \ - $$PWD/../../third_party/devil_sdk/include/ \ - $$PWD/../../third_party/zlib/include \ - $$PWD/../../third_party/xbox_sdk/include \ + #$$PWD/../../third_party/devil_sdk/include/ \ + #$$PWD/../../third_party/zlib/include \ + #$$PWD/../../third_party/xbox_sdk/include \ $$PWD/../../libs/core \ $$PWD/../../libs/compression \ $$PWD/../../libs/encryption \ @@ -37,9 +37,9 @@ INCLUDEPATH += \ $$PWD/../../libs/zonefile DEPENDPATH += \ - $$PWD/../../third_party/devil_sdk/include/ \ - $$PWD/../../third_party/zlib/include \ - $$PWD/../../third_party/xbox_sdk/include \ + #$$PWD/../../third_party/devil_sdk/include/ \ + #$$PWD/../../third_party/zlib/include \ + #$$PWD/../../third_party/xbox_sdk/include \ $$PWD/../../libs/core \ $$PWD/../../libs/compression \ $$PWD/../../libs/encryption \