Lotta asset-based changes.
This commit is contained in:
parent
d129c7ba62
commit
abd1a6a051
18
app/app.pro
18
app/app.pro
@ -13,9 +13,9 @@ FORMS += $$files($$PWD/*.ui)
|
|||||||
RESOURCES += ../data/data.qrc
|
RESOURCES += ../data/data.qrc
|
||||||
|
|
||||||
LIBS += \
|
LIBS += \
|
||||||
-L$$PWD/../third_party/devil_sdk/lib/ -lDevIL -lILU -lILUT \
|
#-L$$PWD/../third_party/devil_sdk/lib/ -lDevIL -lILU -lILUT \
|
||||||
-L$$PWD/../third_party/zlib/lib/ -lzlib \
|
#-L$$PWD/../third_party/zlib/lib/ -lzlib \
|
||||||
-L$$PWD/../third_party/xbox_sdk/lib -lxcompress64 \
|
#-L$$PWD/../third_party/xbox_sdk/lib -lxcompress64 \
|
||||||
-L$$OUT_PWD/../libs/ -lcore \
|
-L$$OUT_PWD/../libs/ -lcore \
|
||||||
-L$$OUT_PWD/../libs/ -lxassets\
|
-L$$OUT_PWD/../libs/ -lxassets\
|
||||||
-L$$OUT_PWD/../libs/ -lcompression \
|
-L$$OUT_PWD/../libs/ -lcompression \
|
||||||
@ -27,9 +27,9 @@ LIBS += \
|
|||||||
-L$$OUT_PWD/../libs/ -lzonefile
|
-L$$OUT_PWD/../libs/ -lzonefile
|
||||||
|
|
||||||
INCLUDEPATH += \
|
INCLUDEPATH += \
|
||||||
$$PWD/../third_party/devil_sdk/include/ \
|
#$$PWD/../third_party/devil_sdk/include/ \
|
||||||
$$PWD/../third_party/zlib/include \
|
#$$PWD/../third_party/zlib/include \
|
||||||
$$PWD/../third_party/xbox_sdk/include \
|
#$$PWD/../third_party/xbox_sdk/include \
|
||||||
$$PWD/../libs/core \
|
$$PWD/../libs/core \
|
||||||
$$PWD/../libs/compression \
|
$$PWD/../libs/compression \
|
||||||
$$PWD/../libs/encryption \
|
$$PWD/../libs/encryption \
|
||||||
@ -41,9 +41,9 @@ INCLUDEPATH += \
|
|||||||
$$PWD/../libs/zonefile
|
$$PWD/../libs/zonefile
|
||||||
|
|
||||||
DEPENDPATH += \
|
DEPENDPATH += \
|
||||||
$$PWD/../third_party/devil_sdk/include/ \
|
#$$PWD/../third_party/devil_sdk/include/ \
|
||||||
$$PWD/../third_party/zlib/include \
|
#$$PWD/../third_party/zlib/include \
|
||||||
$$PWD/../third_party/xbox_sdk/include \
|
#$$PWD/../third_party/xbox_sdk/include \
|
||||||
$$PWD/../libs/core \
|
$$PWD/../libs/core \
|
||||||
$$PWD/../libs/compression \
|
$$PWD/../libs/compression \
|
||||||
$$PWD/../libs/encryption \
|
$$PWD/../libs/encryption \
|
||||||
|
|||||||
@ -1,4 +1,5 @@
|
|||||||
#include "mainwindow.h"
|
#include "mainwindow.h"
|
||||||
|
#include "qtimer.h"
|
||||||
#include "ui_mainwindow.h"
|
#include "ui_mainwindow.h"
|
||||||
|
|
||||||
#include "aboutdialog.h"
|
#include "aboutdialog.h"
|
||||||
@ -10,9 +11,7 @@
|
|||||||
#include "materialviewer.h"
|
#include "materialviewer.h"
|
||||||
#include "preferenceeditor.h"
|
#include "preferenceeditor.h"
|
||||||
#include "reportissuedialog.h"
|
#include "reportissuedialog.h"
|
||||||
#include "rumblefileviewer.h"
|
|
||||||
#include "rumblegraphviewer.h"
|
#include "rumblegraphviewer.h"
|
||||||
#include "soundviewer.h"
|
|
||||||
#include "stringtableviewer.h"
|
#include "stringtableviewer.h"
|
||||||
#include "techsetviewer.h"
|
#include "techsetviewer.h"
|
||||||
#include "fastfile_factory.h"
|
#include "fastfile_factory.h"
|
||||||
@ -24,12 +23,11 @@
|
|||||||
#include "ipak_structs.h"
|
#include "ipak_structs.h"
|
||||||
#include "iwiviewer.h"
|
#include "iwiviewer.h"
|
||||||
#include "localstringviewer.h"
|
#include "localstringviewer.h"
|
||||||
#include "imagewidget.h"
|
|
||||||
#include "zonefileviewer.h"
|
#include "zonefileviewer.h"
|
||||||
#include "techsetviewer.h"
|
#include "techsetviewer.h"
|
||||||
#include "logmanager.h"
|
#include "logmanager.h"
|
||||||
|
|
||||||
#include <qmath.h>
|
#include <QtMath>
|
||||||
|
|
||||||
MainWindow::MainWindow(QWidget *parent)
|
MainWindow::MainWindow(QWidget *parent)
|
||||||
: QMainWindow(parent), ui(new Ui::MainWindow) {
|
: QMainWindow(parent), ui(new Ui::MainWindow) {
|
||||||
@ -37,6 +35,8 @@ MainWindow::MainWindow(QWidget *parent)
|
|||||||
|
|
||||||
setAcceptDrops(true);
|
setAcceptDrops(true);
|
||||||
|
|
||||||
|
XAsset::SetDebug(true);
|
||||||
|
|
||||||
mTypeMap = QMap<QString, int>();
|
mTypeMap = QMap<QString, int>();
|
||||||
mTypeOrder = QStringList();
|
mTypeOrder = QStringList();
|
||||||
mRawFileMap = QMap<QString, QString>();
|
mRawFileMap = QMap<QString, QString>();
|
||||||
@ -541,6 +541,21 @@ bool MainWindow::OpenFastFile(const QString aFastFilePath) {
|
|||||||
return true;
|
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()
|
OpenFastFile()
|
||||||
|
|
||||||
@ -550,18 +565,11 @@ bool MainWindow::OpenFastFile(const QString aFastFilePath) {
|
|||||||
bool MainWindow::OpenFastFile() {
|
bool MainWindow::OpenFastFile() {
|
||||||
// Open file dialog to steam apps
|
// 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 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()) {
|
QFileDialog::getOpenFileContent(tr("Fast File (*.ff);;All Files (*.*)"), [this](const QString &fileName, const QByteArray &data){
|
||||||
// User pressed cancel
|
OpenFastFile(data, fileName);
|
||||||
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;
|
|
||||||
}
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -15,7 +15,6 @@
|
|||||||
#include <QPlainTextEdit>
|
#include <QPlainTextEdit>
|
||||||
#include <QMimeData>
|
#include <QMimeData>
|
||||||
#include <QProgressBar>
|
#include <QProgressBar>
|
||||||
#include <windows.h>
|
|
||||||
|
|
||||||
QT_BEGIN_NAMESPACE
|
QT_BEGIN_NAMESPACE
|
||||||
namespace Ui {
|
namespace Ui {
|
||||||
@ -34,6 +33,7 @@ public:
|
|||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
bool OpenFastFile(const QString aFastFilePath);
|
bool OpenFastFile(const QString aFastFilePath);
|
||||||
|
bool OpenFastFile(const QByteArray& aFastFileData, const QString aFastFilePath);
|
||||||
bool OpenFastFile();
|
bool OpenFastFile();
|
||||||
|
|
||||||
bool OpenZoneFile(const QString aZoneFilePath, bool fromFF = false);
|
bool OpenZoneFile(const QString aZoneFilePath, bool fromFF = false);
|
||||||
|
|||||||
@ -20,7 +20,6 @@
|
|||||||
<file>icons/Icon_Editor.png</file>
|
<file>icons/Icon_Editor.png</file>
|
||||||
<file>icons/Icon_Views.png</file>
|
<file>icons/Icon_Views.png</file>
|
||||||
<file>icons/Icon_Tree.png</file>
|
<file>icons/Icon_Tree.png</file>
|
||||||
<file>icons/Icon_Copy.png</file>
|
|
||||||
<file>icons/Icon_Cut.png</file>
|
<file>icons/Icon_Cut.png</file>
|
||||||
<file>icons/Icon_Find.png</file>
|
<file>icons/Icon_Find.png</file>
|
||||||
<file>icons/Icon_NewFile.png</file>
|
<file>icons/Icon_NewFile.png</file>
|
||||||
|
|||||||
@ -1,8 +1,8 @@
|
|||||||
#include "compression.h"
|
#include "compression.h"
|
||||||
//#include "minilzo.h"
|
//#include "minilzo.h"
|
||||||
|
|
||||||
#define XBOXAPI __declspec(dllimport)
|
//#define XBOXAPI __declspec(dllimport)
|
||||||
#include "xcompress.h"
|
//#include "xcompress.h"
|
||||||
|
|
||||||
#include <QLibrary>
|
#include <QLibrary>
|
||||||
#include <QDebug>
|
#include <QDebug>
|
||||||
@ -11,61 +11,63 @@
|
|||||||
|
|
||||||
QByteArray Compression::CompressXMem(const QByteArray &data)
|
QByteArray Compression::CompressXMem(const QByteArray &data)
|
||||||
{
|
{
|
||||||
XMEMCODEC_PARAMETERS_LZX lzxParams = {};
|
// XMEMCODEC_PARAMETERS_LZX lzxParams = {};
|
||||||
lzxParams.Flags = 0;
|
// lzxParams.Flags = 0;
|
||||||
lzxParams.WindowSize = 0x20000;
|
// lzxParams.WindowSize = 0x20000;
|
||||||
lzxParams.CompressionPartitionSize = 0x80000;
|
// lzxParams.CompressionPartitionSize = 0x80000;
|
||||||
|
|
||||||
XMEMCOMPRESSION_CONTEXT ctx = nullptr;
|
// XMEMCOMPRESSION_CONTEXT ctx = nullptr;
|
||||||
if (FAILED(XMemCreateCompressionContext(XMEMCODEC_LZX, &lzxParams, 0, &ctx)) || !ctx)
|
// if (FAILED(XMemCreateCompressionContext(XMEMCODEC_LZX, &lzxParams, 0, &ctx)) || !ctx)
|
||||||
return QByteArray();
|
// return QByteArray();
|
||||||
|
|
||||||
SIZE_T estimatedSize = data.size() + XCOMPRESS_LZX_BLOCK_GROWTH_SIZE_MAX;
|
// SIZE_T estimatedSize = data.size() + XCOMPRESS_LZX_BLOCK_GROWTH_SIZE_MAX;
|
||||||
QByteArray output(static_cast<int>(estimatedSize), 0);
|
// QByteArray output(static_cast<int>(estimatedSize), 0);
|
||||||
SIZE_T actualSize = estimatedSize;
|
// SIZE_T actualSize = estimatedSize;
|
||||||
|
|
||||||
HRESULT hr = XMemCompress(ctx, output.data(), &actualSize, data.constData(), data.size());
|
// HRESULT hr = XMemCompress(ctx, output.data(), &actualSize, data.constData(), data.size());
|
||||||
XMemDestroyCompressionContext(ctx);
|
// XMemDestroyCompressionContext(ctx);
|
||||||
|
|
||||||
if (FAILED(hr))
|
// if (FAILED(hr))
|
||||||
return QByteArray();
|
// return QByteArray();
|
||||||
|
|
||||||
output.resize(static_cast<int>(actualSize));
|
// output.resize(static_cast<int>(actualSize));
|
||||||
return output;
|
// return output;
|
||||||
|
return QByteArray();
|
||||||
}
|
}
|
||||||
|
|
||||||
QByteArray Compression::DecompressXMem(const QByteArray &data, int flags, int windowSize, int partSize)
|
QByteArray Compression::DecompressXMem(const QByteArray &data, int flags, int windowSize, int partSize)
|
||||||
{
|
{
|
||||||
if (data.isEmpty())
|
// if (data.isEmpty())
|
||||||
return {};
|
// return {};
|
||||||
|
|
||||||
XMEMCODEC_PARAMETERS_LZX lzxParams = {};
|
// XMEMCODEC_PARAMETERS_LZX lzxParams = {};
|
||||||
lzxParams.Flags = flags;
|
// lzxParams.Flags = flags;
|
||||||
lzxParams.WindowSize = windowSize;
|
// lzxParams.WindowSize = windowSize;
|
||||||
lzxParams.CompressionPartitionSize = partSize;
|
// lzxParams.CompressionPartitionSize = partSize;
|
||||||
|
|
||||||
XMEMDECOMPRESSION_CONTEXT ctx = nullptr;
|
// XMEMDECOMPRESSION_CONTEXT ctx = nullptr;
|
||||||
if (FAILED(XMemCreateDecompressionContext(XMEMCODEC_LZX, &lzxParams, 0, &ctx)) || !ctx)
|
// if (FAILED(XMemCreateDecompressionContext(XMEMCODEC_LZX, &lzxParams, 0, &ctx)) || !ctx)
|
||||||
return {};
|
// return {};
|
||||||
|
|
||||||
// Allocate large enough buffer for decompression (16 MB is a safe upper bound)
|
// // Allocate large enough buffer for decompression (16 MB is a safe upper bound)
|
||||||
const SIZE_T kMaxOutSize = 16 * 1024 * 1024;
|
// const SIZE_T kMaxOutSize = 16 * 1024 * 1024;
|
||||||
QByteArray output(static_cast<int>(kMaxOutSize), Qt::Uninitialized);
|
// QByteArray output(static_cast<int>(kMaxOutSize), Qt::Uninitialized);
|
||||||
SIZE_T actualSize = kMaxOutSize;
|
// SIZE_T actualSize = kMaxOutSize;
|
||||||
|
|
||||||
HRESULT hr = XMemDecompress(ctx,
|
// HRESULT hr = XMemDecompress(ctx,
|
||||||
output.data(), &actualSize,
|
// output.data(), &actualSize,
|
||||||
data.constData(), data.size() + 16);
|
// data.constData(), data.size() + 16);
|
||||||
|
|
||||||
XMemDestroyDecompressionContext(ctx);
|
// XMemDestroyDecompressionContext(ctx);
|
||||||
|
|
||||||
if (FAILED(hr)) {
|
// if (FAILED(hr)) {
|
||||||
qWarning() << "XMemDecompress failed with HRESULT:" << hr;
|
// qWarning() << "XMemDecompress failed with HRESULT:" << hr;
|
||||||
return {};
|
// return {};
|
||||||
}
|
// }
|
||||||
|
|
||||||
output.resize(static_cast<int>(actualSize));
|
// output.resize(static_cast<int>(actualSize));
|
||||||
return output;
|
// return output;
|
||||||
|
return QByteArray();
|
||||||
}
|
}
|
||||||
|
|
||||||
quint32 Compression::CalculateAdler32Checksum(const QByteArray &data) {
|
quint32 Compression::CalculateAdler32Checksum(const QByteArray &data) {
|
||||||
|
|||||||
@ -3,7 +3,7 @@
|
|||||||
|
|
||||||
#include "QtZlib/zlib.h"
|
#include "QtZlib/zlib.h"
|
||||||
|
|
||||||
#include <windows.h>
|
//#include <windows.h>
|
||||||
#include <QtGlobal>
|
#include <QtGlobal>
|
||||||
#include <stddef.h>
|
#include <stddef.h>
|
||||||
#include <QByteArray>
|
#include <QByteArray>
|
||||||
|
|||||||
@ -105,7 +105,7 @@ extern "C" {
|
|||||||
# define LZO_INT_MAX 9223372036854775807LL
|
# define LZO_INT_MAX 9223372036854775807LL
|
||||||
# define LZO_INT_MIN (-1LL - LZO_INT_MAX)
|
# define LZO_INT_MIN (-1LL - LZO_INT_MAX)
|
||||||
# elif (LZO_ABI_IP32L64) /* MIPS R5900 */
|
# elif (LZO_ABI_IP32L64) /* MIPS R5900 */
|
||||||
typedef unsigned int lzo_uint;
|
typedef quint32 lzo_uint;
|
||||||
typedef int lzo_int;
|
typedef int lzo_int;
|
||||||
# define LZO_SIZEOF_LZO_INT LZO_SIZEOF_INT
|
# define LZO_SIZEOF_LZO_INT LZO_SIZEOF_INT
|
||||||
# define LZO_TYPEOF_LZO_INT LZO_TYPEOF_INT
|
# define LZO_TYPEOF_LZO_INT LZO_TYPEOF_INT
|
||||||
|
|||||||
@ -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
|
# define LZO_TYPEOF_LZO_INT16E_T LZO_TYPEOF_LONG
|
||||||
#elif (LZO_SIZEOF_INT == 2) && !(LZO_CFG_PREFER_TYPEOF_ACC_INT16E_T == LZO_TYPEOF_SHORT)
|
#elif (LZO_SIZEOF_INT == 2) && !(LZO_CFG_PREFER_TYPEOF_ACC_INT16E_T == LZO_TYPEOF_SHORT)
|
||||||
# define lzo_int16e_t int
|
# 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
|
# define LZO_TYPEOF_LZO_INT16E_T LZO_TYPEOF_INT
|
||||||
#elif (LZO_SIZEOF_SHORT == 2)
|
#elif (LZO_SIZEOF_SHORT == 2)
|
||||||
# define lzo_int16e_t short int
|
# 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)
|
#elif 1 && !(LZO_CFG_TYPE_NO_MODE_HI) && (LZO_CC_CLANG || (LZO_CC_GNUC >= 0x025f00ul) || LZO_CC_LLVM)
|
||||||
# if !(LZO_LANG_ASSEMBLER)
|
# if !(LZO_LANG_ASSEMBLER)
|
||||||
typedef int lzo_int16e_hi_t__ __attribute__((__mode__(__HI__)));
|
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
|
# endif
|
||||||
# define lzo_int16e_t lzo_int16e_hi_t__
|
# define lzo_int16e_t lzo_int16e_hi_t__
|
||||||
# define lzo_uint16e_t lzo_uint16e_hi_t__
|
# define lzo_uint16e_t lzo_uint16e_hi_t__
|
||||||
# define LZO_TYPEOF_LZO_INT16E_T LZO_TYPEOF___MODE_HI
|
# define LZO_TYPEOF_LZO_INT16E_T LZO_TYPEOF___MODE_HI
|
||||||
#elif (LZO_SIZEOF___INT16 == 2)
|
#elif (LZO_SIZEOF___INT16 == 2)
|
||||||
# define lzo_int16e_t __int16
|
# 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
|
# define LZO_TYPEOF_LZO_INT16E_T LZO_TYPEOF___INT16
|
||||||
#else
|
#else
|
||||||
#endif
|
#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
|
# define LZO_TYPEOF_LZO_INT32E_T LZO_TYPEOF_LONG
|
||||||
#elif (LZO_SIZEOF_INT == 4)
|
#elif (LZO_SIZEOF_INT == 4)
|
||||||
# define lzo_int32e_t int
|
# 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
|
# define LZO_TYPEOF_LZO_INT32E_T LZO_TYPEOF_INT
|
||||||
#elif (LZO_SIZEOF_SHORT == 4)
|
#elif (LZO_SIZEOF_SHORT == 4)
|
||||||
# define lzo_int32e_t short int
|
# 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)
|
#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)
|
# if !(LZO_LANG_ASSEMBLER)
|
||||||
typedef int lzo_int32e_si_t__ __attribute__((__mode__(__SI__)));
|
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
|
# endif
|
||||||
# define lzo_int32e_t lzo_int32e_si_t__
|
# define lzo_int32e_t lzo_int32e_si_t__
|
||||||
# define lzo_uint32e_t lzo_uint32e_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)
|
#elif 1 && !(LZO_CFG_TYPE_NO_MODE_SI) && (LZO_CC_GNUC >= 0x025f00ul) && defined(__AVR__) && (__LONG_MAX__+0 == 32767L)
|
||||||
# if !(LZO_LANG_ASSEMBLER)
|
# if !(LZO_LANG_ASSEMBLER)
|
||||||
typedef int lzo_int32e_si_t__ __attribute__((__mode__(__SI__)));
|
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
|
# endif
|
||||||
# define lzo_int32e_t lzo_int32e_si_t__
|
# define lzo_int32e_t lzo_int32e_si_t__
|
||||||
# define lzo_uint32e_t lzo_uint32e_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
|
# define LZO_TYPEOF_LZO_INT32E_T LZO_TYPEOF___MODE_SI
|
||||||
#elif (LZO_SIZEOF___INT32 == 4)
|
#elif (LZO_SIZEOF___INT32 == 4)
|
||||||
# define lzo_int32e_t __int32
|
# 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
|
# define LZO_TYPEOF_LZO_INT32E_T LZO_TYPEOF___INT32
|
||||||
#else
|
#else
|
||||||
#endif
|
#endif
|
||||||
@ -2937,7 +2937,7 @@ LZO_COMPILE_TIME_ASSERT_HEADER(LZO_SIZEOF_PTRDIFF_T == sizeof(ptrdiff_t))
|
|||||||
#endif
|
#endif
|
||||||
#if (LZO_SIZEOF_INT == 8) && (LZO_SIZEOF_INT < LZO_SIZEOF_LONG)
|
#if (LZO_SIZEOF_INT == 8) && (LZO_SIZEOF_INT < LZO_SIZEOF_LONG)
|
||||||
# define lzo_int64e_t int
|
# 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
|
# 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)
|
#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
|
# 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
|
# define LZO_TYPEOF_LZO_INT32L_T LZO_TYPEOF_LZO_INT32E_T
|
||||||
#elif (LZO_SIZEOF_INT >= 4) && (LZO_SIZEOF_INT < LZO_SIZEOF_LONG)
|
#elif (LZO_SIZEOF_INT >= 4) && (LZO_SIZEOF_INT < LZO_SIZEOF_LONG)
|
||||||
# define lzo_int32l_t int
|
# 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_SIZEOF_LZO_INT32L_T LZO_SIZEOF_INT
|
||||||
# define LZO_TYPEOF_LZO_INT32L_T LZO_SIZEOF_INT
|
# define LZO_TYPEOF_LZO_INT32L_T LZO_SIZEOF_INT
|
||||||
#elif (LZO_SIZEOF_LONG >= 4)
|
#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))
|
#elif (LZO_CC_MSC && (_MSC_VER >= 1300) && (LZO_SIZEOF_VOID_P == 4) && (LZO_SIZEOF_INT == 4))
|
||||||
# if !(LZO_LANG_ASSEMBLER)
|
# if !(LZO_LANG_ASSEMBLER)
|
||||||
typedef __w64 int lzo_intptr_t;
|
typedef __w64 int lzo_intptr_t;
|
||||||
typedef __w64 unsigned int lzo_uintptr_t;
|
typedef __w64 quint32 lzo_uintptr_t;
|
||||||
# endif
|
# endif
|
||||||
# define lzo_intptr_t lzo_intptr_t
|
# define lzo_intptr_t lzo_intptr_t
|
||||||
# define lzo_uintptr_t lzo_uintptr_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
|
# define LZO_TYPEOF_LZO_INTPTR_T LZO_TYPEOF_SHORT
|
||||||
#elif (LZO_SIZEOF_INT >= LZO_SIZEOF_VOID_P) && (LZO_SIZEOF_INT < LZO_SIZEOF_LONG)
|
#elif (LZO_SIZEOF_INT >= LZO_SIZEOF_VOID_P) && (LZO_SIZEOF_INT < LZO_SIZEOF_LONG)
|
||||||
# define lzo_intptr_t int
|
# 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_SIZEOF_LZO_INTPTR_T LZO_SIZEOF_INT
|
||||||
# define LZO_TYPEOF_LZO_INTPTR_T LZO_TYPEOF_INT
|
# define LZO_TYPEOF_LZO_INTPTR_T LZO_TYPEOF_INT
|
||||||
#elif (LZO_SIZEOF_LONG >= LZO_SIZEOF_VOID_P)
|
#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_SIZEOF_LZO_WORD_T LZO_SIZEOF_LONG
|
||||||
# define LZO_TYPEOF_LZO_WORD_T LZO_TYPEOF_LONG
|
# define LZO_TYPEOF_LZO_WORD_T LZO_TYPEOF_LONG
|
||||||
#elif (LZO_WORDSIZE == LZO_SIZEOF_INT)
|
#elif (LZO_WORDSIZE == LZO_SIZEOF_INT)
|
||||||
# define lzo_word_t unsigned int
|
# define lzo_word_t quint32
|
||||||
# define lzo_sword_t int
|
# define lzo_sword_t int
|
||||||
# define LZO_SIZEOF_LZO_WORD_T LZO_SIZEOF_INT
|
# define LZO_SIZEOF_LZO_WORD_T LZO_SIZEOF_INT
|
||||||
# define LZO_TYPEOF_LZO_WORD_T LZO_TYPEOF_INT
|
# define LZO_TYPEOF_LZO_WORD_T LZO_TYPEOF_INT
|
||||||
|
|||||||
@ -89,92 +89,92 @@ DDSFile::DDSFile(const QString &aFilePath)
|
|||||||
}
|
}
|
||||||
|
|
||||||
DDSFile::DDSFile(const QByteArray aDDSData, const QString aFileStem) {
|
DDSFile::DDSFile(const QByteArray aDDSData, const QString aFileStem) {
|
||||||
QDataStream ddsIn(aDDSData);
|
// QDataStream ddsIn(aDDSData);
|
||||||
ddsIn.setByteOrder(QDataStream::LittleEndian);
|
// ddsIn.setByteOrder(QDataStream::LittleEndian);
|
||||||
|
|
||||||
DDSHeader ddsHeader;
|
// DDSHeader ddsHeader;
|
||||||
if (ddsIn.readRawData(reinterpret_cast<char*>(&ddsHeader), sizeof(DDSHeader)) != sizeof(DDSHeader)) {
|
// if (ddsIn.readRawData(reinterpret_cast<char*>(&ddsHeader), sizeof(DDSHeader)) != sizeof(DDSHeader)) {
|
||||||
qDebug() << "Error: Failed to read DDSHeader from QByteArray!";
|
// qDebug() << "Error: Failed to read DDSHeader from QByteArray!";
|
||||||
return;
|
// return;
|
||||||
}
|
// }
|
||||||
|
|
||||||
fileStem = aFileStem;
|
// fileStem = aFileStem;
|
||||||
header = ddsHeader;
|
// header = ddsHeader;
|
||||||
|
|
||||||
// Ensure DevIL is initialized once globally
|
// // Ensure DevIL is initialized once globally
|
||||||
static bool devilInitialized = false;
|
// static bool devilInitialized = false;
|
||||||
if (!devilInitialized) {
|
// if (!devilInitialized) {
|
||||||
ilInit();
|
// ilInit();
|
||||||
devilInitialized = true;
|
// devilInitialized = true;
|
||||||
}
|
// }
|
||||||
|
|
||||||
// Generate and bind an image
|
// // Generate and bind an image
|
||||||
ILuint imageID;
|
// ILuint imageID;
|
||||||
ilGenImages(1, &imageID);
|
// ilGenImages(1, &imageID);
|
||||||
ilBindImage(imageID);
|
// ilBindImage(imageID);
|
||||||
|
|
||||||
ilEnable(IL_ORIGIN_SET);
|
// ilEnable(IL_ORIGIN_SET);
|
||||||
ilOriginFunc(IL_ORIGIN_UPPER_LEFT);
|
// ilOriginFunc(IL_ORIGIN_UPPER_LEFT);
|
||||||
|
|
||||||
// Load DDS file
|
// // Load DDS file
|
||||||
if (!ilLoadL(IL_DDS, aDDSData.constData(), aDDSData.size())) {
|
// if (!ilLoadL(IL_DDS, aDDSData.constData(), aDDSData.size())) {
|
||||||
ILuint devilError = ilGetError();
|
// ILuint devilError = ilGetError();
|
||||||
qDebug() << "DevIL Error while loading DDS: " << devilError;
|
// qDebug() << "DevIL Error while loading DDS: " << devilError;
|
||||||
ilDeleteImages(1, &imageID);
|
// ilDeleteImages(1, &imageID);
|
||||||
return;
|
// return;
|
||||||
}
|
// }
|
||||||
|
|
||||||
// Get mipmap count
|
// // Get mipmap count
|
||||||
ILint numMipmaps = ilGetInteger(IL_NUM_MIPMAPS);
|
// ILint numMipmaps = ilGetInteger(IL_NUM_MIPMAPS);
|
||||||
qDebug() << "Number of mipmaps: " << numMipmaps;
|
// qDebug() << "Number of mipmaps: " << numMipmaps;
|
||||||
|
|
||||||
// Loop over all mipmap levels (0 is the base image)
|
// // Loop over all mipmap levels (0 is the base image)
|
||||||
for (ILint level = 0; level <= numMipmaps; ++level) {
|
// for (ILint level = 0; level <= numMipmaps; ++level) {
|
||||||
ilBindImage(imageID);
|
// ilBindImage(imageID);
|
||||||
if (!ilActiveMipmap(level)) {
|
// if (!ilActiveMipmap(level)) {
|
||||||
qDebug() << "DevIL failed to activate mipmap level" << level;
|
// qDebug() << "DevIL failed to activate mipmap level" << level;
|
||||||
continue;
|
// continue;
|
||||||
}
|
// }
|
||||||
|
|
||||||
// Get mipmap properties
|
// // Get mipmap properties
|
||||||
int width = ilGetInteger(IL_IMAGE_WIDTH);
|
// int width = ilGetInteger(IL_IMAGE_WIDTH);
|
||||||
int height = ilGetInteger(IL_IMAGE_HEIGHT);
|
// int height = ilGetInteger(IL_IMAGE_HEIGHT);
|
||||||
int depth = ilGetInteger(IL_IMAGE_DEPTH);
|
// int depth = ilGetInteger(IL_IMAGE_DEPTH);
|
||||||
int format = ilGetInteger(IL_IMAGE_FORMAT);
|
// int format = ilGetInteger(IL_IMAGE_FORMAT);
|
||||||
int bpp = 0;
|
// int bpp = 0;
|
||||||
|
|
||||||
switch (format) {
|
// switch (format) {
|
||||||
case IL_RGB:
|
// case IL_RGB:
|
||||||
bpp = 3;
|
// bpp = 3;
|
||||||
break;
|
// break;
|
||||||
case IL_RGBA:
|
// case IL_RGBA:
|
||||||
bpp = 4;
|
// bpp = 4;
|
||||||
break;
|
// break;
|
||||||
default:
|
// default:
|
||||||
qDebug() << "Unsupported image format.";
|
// qDebug() << "Unsupported image format.";
|
||||||
continue;
|
// continue;
|
||||||
}
|
// }
|
||||||
|
|
||||||
int dataSize = width * height * depth * bpp;
|
// int dataSize = width * height * depth * bpp;
|
||||||
|
|
||||||
ILubyte *data = ilGetData();
|
// ILubyte *data = ilGetData();
|
||||||
if (!data) {
|
// if (!data) {
|
||||||
qDebug() << "Error: DevIL returned null data for mipmap level" << level;
|
// qDebug() << "Error: DevIL returned null data for mipmap level" << level;
|
||||||
continue;
|
// continue;
|
||||||
}
|
// }
|
||||||
|
|
||||||
// Create a mipmap structure
|
// // Create a mipmap structure
|
||||||
DDSMipmap mipmap;
|
// DDSMipmap mipmap;
|
||||||
mipmap.width = width;
|
// mipmap.width = width;
|
||||||
mipmap.height = height;
|
// mipmap.height = height;
|
||||||
mipmap.data = QByteArray(reinterpret_cast<const char*>(data), dataSize);
|
// mipmap.data = QByteArray(reinterpret_cast<const char*>(data), dataSize);
|
||||||
mipmap.size = dataSize;
|
// mipmap.size = dataSize;
|
||||||
|
|
||||||
// Store in DDS file
|
// // Store in DDS file
|
||||||
mipmaps.append(mipmap);
|
// mipmaps.append(mipmap);
|
||||||
}
|
// }
|
||||||
|
|
||||||
ilDeleteImages(1, &imageID);
|
// ilDeleteImages(1, &imageID);
|
||||||
}
|
}
|
||||||
|
|
||||||
DDSFile::DDSFile(const DDSFile &ddsFile) :
|
DDSFile::DDSFile(const DDSFile &ddsFile) :
|
||||||
|
|||||||
@ -9,7 +9,7 @@
|
|||||||
#include <QVector>
|
#include <QVector>
|
||||||
#include <QDebug>
|
#include <QDebug>
|
||||||
#include <QImage>
|
#include <QImage>
|
||||||
#include <IL/il.h>
|
//#include <IL/il.h>
|
||||||
|
|
||||||
struct DDSPixelFormat {
|
struct DDSPixelFormat {
|
||||||
quint32 size;
|
quint32 size;
|
||||||
|
|||||||
@ -6,17 +6,17 @@ SOURCES += $$files($$PWD/*.cpp, true)
|
|||||||
HEADERS += $$files($$PWD/*.h, true)
|
HEADERS += $$files($$PWD/*.h, true)
|
||||||
|
|
||||||
LIBS += \
|
LIBS += \
|
||||||
-L$$PWD/../../third_party/devil_sdk/lib/ -lDevIL \
|
#-L$$PWD/../../third_party/devil_sdk/lib/ -lDevIL \
|
||||||
-L$$PWD/../../third_party/devil_sdk/lib/ -lILU \
|
#-L$$PWD/../../third_party/devil_sdk/lib/ -lILU \
|
||||||
-L$$PWD/../../third_party/devil_sdk/lib/ -lILUT \
|
#-L$$PWD/../../third_party/devil_sdk/lib/ -lILUT \
|
||||||
-L$$OUT_PWD/../libs/iwifile -liwifile
|
-L$$OUT_PWD/../libs/iwifile -liwifile
|
||||||
|
|
||||||
INCLUDEPATH += \
|
INCLUDEPATH += \
|
||||||
$$PWD/../iwifile/ \
|
$$PWD/../iwifile/ \
|
||||||
$$PWD/../../third_party/devil_sdk/include/
|
#$$PWD/../../third_party/devil_sdk/include/
|
||||||
|
|
||||||
DEPENDPATH += \
|
DEPENDPATH += \
|
||||||
$$PWD/../iwifile/ \
|
$$PWD/../iwifile/ \
|
||||||
$$PWD/../../third_party/devil_sdk/include/
|
#$$PWD/../../third_party/devil_sdk/include/
|
||||||
|
|
||||||
DESTDIR = $$OUT_PWD/../
|
DESTDIR = $$OUT_PWD/../
|
||||||
|
|||||||
@ -27,10 +27,10 @@
|
|||||||
/*
|
/*
|
||||||
* The following types are defined (if available):
|
* The following types are defined (if available):
|
||||||
*
|
*
|
||||||
* u8: unsigned integer type, at least 8 bits
|
* u8: quint32eger type, at least 8 bits
|
||||||
* u16: unsigned integer type, at least 16 bits
|
* u16: quint32eger type, at least 16 bits
|
||||||
* u32: unsigned integer type, at least 32 bits
|
* u32: quint32eger type, at least 32 bits
|
||||||
* u64: unsigned integer type, at least 64 bits
|
* u64: quint32eger type, at least 64 bits
|
||||||
*
|
*
|
||||||
* s8, s16, s32, s64 -> signed counterparts of u8, u16, u32, u64
|
* s8, s16, s32, s64 -> signed counterparts of u8, u16, u32, u64
|
||||||
*
|
*
|
||||||
|
|||||||
@ -87,7 +87,7 @@ void Encryption::UpdateIVTable(QByteArray &table, int index, const QByteArray &s
|
|||||||
}
|
}
|
||||||
|
|
||||||
quint32 Encryption::ToUInt32(const QByteArray &data, int offset) {
|
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<quint32>(static_cast<uchar>(data[offset])) ) |
|
return ((static_cast<quint32>(static_cast<uchar>(data[offset])) ) |
|
||||||
(static_cast<quint32>(static_cast<uchar>(data[offset+1])) << 8 ) |
|
(static_cast<quint32>(static_cast<uchar>(data[offset+1])) << 8 ) |
|
||||||
(static_cast<quint32>(static_cast<uchar>(data[offset+2])) << 16) |
|
(static_cast<quint32>(static_cast<uchar>(data[offset+2])) << 16) |
|
||||||
|
|||||||
@ -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;
|
u32 j0, j1, j2, j3, j4, j5, j6, j7, j8, j9, j10, j11, j12, j13, j14, j15;
|
||||||
u8 *ctarget;
|
u8 *ctarget;
|
||||||
u8 tmp[64];
|
u8 tmp[64];
|
||||||
unsigned int i;
|
int i;
|
||||||
|
|
||||||
if (!bytes) return;
|
if (!bytes) return;
|
||||||
|
|
||||||
|
|||||||
@ -10,7 +10,7 @@ Still 100% Public Domain
|
|||||||
|
|
||||||
Corrected a problem which generated improper hash values on 16 bit machines
|
Corrected a problem which generated improper hash values on 16 bit machines
|
||||||
Routine SHA1Update changed from
|
Routine SHA1Update changed from
|
||||||
void SHA1Update(SHA1_CTX* context, unsigned char* data, unsigned int
|
void SHA1Update(SHA1_CTX* context, unsigned char* data, quint32
|
||||||
len)
|
len)
|
||||||
to
|
to
|
||||||
void SHA1Update(SHA1_CTX* context, unsigned char* data, unsigned
|
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).
|
"a"s).
|
||||||
|
|
||||||
I also changed the declaration of variables i & j in SHA1Update to
|
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
|
These changes should make no difference to any 32 bit implementations since
|
||||||
an
|
an
|
||||||
|
|||||||
@ -90,7 +90,7 @@ bool FastFile_COD4_PS3::Load(const QByteArray aData) {
|
|||||||
// Loop until EOF or invalid chunk
|
// Loop until EOF or invalid chunk
|
||||||
while (pos <= aData.size()) {
|
while (pos <= aData.size()) {
|
||||||
// Read 2-byte BIG-ENDIAN chunk size
|
// Read 2-byte BIG-ENDIAN chunk size
|
||||||
quint16 chunkSize;
|
quint32 chunkSize;
|
||||||
QDataStream chunkStream(aData.mid(pos, 2));
|
QDataStream chunkStream(aData.mid(pos, 2));
|
||||||
chunkStream.setByteOrder(QDataStream::BigEndian);
|
chunkStream.setByteOrder(QDataStream::BigEndian);
|
||||||
chunkStream >> chunkSize;
|
chunkStream >> chunkSize;
|
||||||
|
|||||||
@ -90,7 +90,7 @@ bool FastFile_COD5_PS3::Load(const QByteArray aData) {
|
|||||||
// Loop until EOF or invalid chunk
|
// Loop until EOF or invalid chunk
|
||||||
while (pos <= aData.size()) {
|
while (pos <= aData.size()) {
|
||||||
// Read 2-byte BIG-ENDIAN chunk size
|
// Read 2-byte BIG-ENDIAN chunk size
|
||||||
quint16 chunkSize;
|
quint32 chunkSize;
|
||||||
QDataStream chunkStream(aData.mid(pos, 2));
|
QDataStream chunkStream(aData.mid(pos, 2));
|
||||||
chunkStream.setByteOrder(QDataStream::BigEndian);
|
chunkStream.setByteOrder(QDataStream::BigEndian);
|
||||||
chunkStream >> chunkSize;
|
chunkStream >> chunkSize;
|
||||||
|
|||||||
@ -30,9 +30,9 @@ struct IWIHeader {
|
|||||||
struct IWIInfo {
|
struct IWIInfo {
|
||||||
quint8 Format;
|
quint8 Format;
|
||||||
quint8 Usage;
|
quint8 Usage;
|
||||||
quint16 Width;
|
quint32 Width;
|
||||||
quint16 Height;
|
quint32 Height;
|
||||||
quint16 Depth;
|
quint32 Depth;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct IWIMipmap {
|
struct IWIMipmap {
|
||||||
|
|||||||
@ -13,11 +13,11 @@ void XAnimDeltaPartQuat::ParseData(QDataStream *aStream) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
quint16 XAnimDeltaPartQuat::GetSize() const {
|
quint32 XAnimDeltaPartQuat::GetSize() const {
|
||||||
return mSize;
|
return mSize;
|
||||||
}
|
}
|
||||||
|
|
||||||
void XAnimDeltaPartQuat::SetSize(quint16 size) {
|
void XAnimDeltaPartQuat::SetSize(quint32 size) {
|
||||||
mSize = size;
|
mSize = size;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -17,14 +17,14 @@ public:
|
|||||||
|
|
||||||
void ParseData(QDataStream *aStream) override;
|
void ParseData(QDataStream *aStream) override;
|
||||||
|
|
||||||
quint16 GetSize() const;
|
quint32 GetSize() const;
|
||||||
void SetSize(quint16 size);
|
void SetSize(quint32 size);
|
||||||
|
|
||||||
const XAnimDeltaPartQuatData& GetData() const;
|
const XAnimDeltaPartQuatData& GetData() const;
|
||||||
void SetData(const XAnimDeltaPartQuatData& data);
|
void SetData(const XAnimDeltaPartQuatData& data);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
quint16 mSize = 0;
|
quint32 mSize = 0;
|
||||||
XAnimDeltaPartQuatData mData;
|
XAnimDeltaPartQuatData mData;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@ -28,10 +28,10 @@ void XAnimIndices::Clear()
|
|||||||
mIndex = 0;
|
mIndex = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
quint16 XAnimIndices::GetIndex() const {
|
quint32 XAnimIndices::GetIndex() const {
|
||||||
return mIndex;
|
return mIndex;
|
||||||
}
|
}
|
||||||
|
|
||||||
void XAnimIndices::SetIndex(quint16 index) {
|
void XAnimIndices::SetIndex(quint32 index) {
|
||||||
mIndex = index;
|
mIndex = index;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -12,11 +12,11 @@ public:
|
|||||||
void ParseData(QDataStream *aStream) override;
|
void ParseData(QDataStream *aStream) override;
|
||||||
void Clear() override;
|
void Clear() override;
|
||||||
|
|
||||||
quint16 GetIndex() const;
|
quint32 GetIndex() const;
|
||||||
void SetIndex(quint16 index);
|
void SetIndex(quint32 index);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
quint16 mIndex = 0;
|
quint32 mIndex = 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // XANIMINDICES_H
|
#endif // XANIMINDICES_H
|
||||||
|
|||||||
@ -27,11 +27,11 @@ void XAnimNotifyInfo::Clear()
|
|||||||
mTime = 0.0f;
|
mTime = 0.0f;
|
||||||
}
|
}
|
||||||
|
|
||||||
quint16 XAnimNotifyInfo::GetName() const {
|
quint32 XAnimNotifyInfo::GetName() const {
|
||||||
return mName;
|
return mName;
|
||||||
}
|
}
|
||||||
|
|
||||||
void XAnimNotifyInfo::SetName(quint16 name) {
|
void XAnimNotifyInfo::SetName(quint32 name) {
|
||||||
mName = name;
|
mName = name;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -12,14 +12,14 @@ public:
|
|||||||
void ParseData(QDataStream *aStream) override;
|
void ParseData(QDataStream *aStream) override;
|
||||||
void Clear() override;
|
void Clear() override;
|
||||||
|
|
||||||
quint16 GetName() const;
|
quint32 GetName() const;
|
||||||
void SetName(quint16 name);
|
void SetName(quint32 name);
|
||||||
|
|
||||||
float GetTime() const;
|
float GetTime() const;
|
||||||
void SetTime(float time);
|
void SetTime(float time);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
quint16 mName;
|
quint32 mName;
|
||||||
float mTime;
|
float mTime;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@ -67,7 +67,7 @@ void XAnimParts::ParseData(QDataStream *aStream) {
|
|||||||
>> mNotifyCount
|
>> mNotifyCount
|
||||||
>> mAssetType;
|
>> mAssetType;
|
||||||
|
|
||||||
quint16 pad;
|
quint32 pad;
|
||||||
*aStream >> pad;
|
*aStream >> pad;
|
||||||
mPad = (pad != 0);
|
mPad = (pad != 0);
|
||||||
|
|
||||||
|
|||||||
@ -21,12 +21,12 @@ public:
|
|||||||
private:
|
private:
|
||||||
XString mName;
|
XString mName;
|
||||||
|
|
||||||
quint16 mDataByteCount = 0;
|
quint32 mDataByteCount = 0;
|
||||||
quint16 mDataShortCount = 0;
|
quint32 mDataShortCount = 0;
|
||||||
quint16 mDataIntCount = 0;
|
quint32 mDataIntCount = 0;
|
||||||
quint16 mRandomDataByteCount = 0;
|
quint32 mRandomDataByteCount = 0;
|
||||||
quint16 mRandomDataIntCount = 0;
|
quint32 mRandomDataIntCount = 0;
|
||||||
quint16 mNumFrames = 0;
|
quint32 mNumFrames = 0;
|
||||||
|
|
||||||
bool mIsLoop = false;
|
bool mIsLoop = false;
|
||||||
bool mIsDelta = false;
|
bool mIsDelta = false;
|
||||||
@ -37,13 +37,13 @@ private:
|
|||||||
|
|
||||||
bool mPad = false;
|
bool mPad = false;
|
||||||
|
|
||||||
quint16 mRandomDataShortCount = 0;
|
quint32 mRandomDataShortCount = 0;
|
||||||
quint16 mIndexCount = 0;
|
quint32 mIndexCount = 0;
|
||||||
|
|
||||||
float mFramerate = 0.0f;
|
float mFramerate = 0.0f;
|
||||||
float mFrequency = 0.0f;
|
float mFrequency = 0.0f;
|
||||||
|
|
||||||
quint16 mNames = 0;
|
quint32 mNames = 0;
|
||||||
quint8 mDataByte = 0;
|
quint8 mDataByte = 0;
|
||||||
qint16 mDataShort = 0;
|
qint16 mDataShort = 0;
|
||||||
int mDataInt = 0;
|
int mDataInt = 0;
|
||||||
|
|||||||
@ -15,7 +15,7 @@ public:
|
|||||||
void Clear() override;
|
void Clear() override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
quint16 mSize;
|
quint32 mSize;
|
||||||
bool mIsSmallTrans;
|
bool mIsSmallTrans;
|
||||||
XAnimPartTransData mData;
|
XAnimPartTransData mData;
|
||||||
};
|
};
|
||||||
|
|||||||
@ -19,6 +19,8 @@
|
|||||||
#include "xstringtable.h"
|
#include "xstringtable.h"
|
||||||
#include "xweapondef.h"
|
#include "xweapondef.h"
|
||||||
|
|
||||||
|
XAsset::
|
||||||
|
|
||||||
XAsset::XAsset()
|
XAsset::XAsset()
|
||||||
: mPtr(0)
|
: mPtr(0)
|
||||||
, mType(ASSET_TYPE_NONE)
|
, mType(ASSET_TYPE_NONE)
|
||||||
@ -61,14 +63,39 @@ QString XAsset::GetName() const
|
|||||||
return mName;
|
return mName;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void XAsset::SetDebug(bool aDebug)
|
||||||
|
{
|
||||||
|
XAsset::mDebug = aDebug;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool XAsset::IsDebug() const
|
||||||
|
{
|
||||||
|
return mDebug;
|
||||||
|
}
|
||||||
|
|
||||||
void XAsset::Clear()
|
void XAsset::Clear()
|
||||||
{
|
{
|
||||||
|
if (mDebug)
|
||||||
|
{
|
||||||
|
qDebug() << QString("Clearing XAsset of type %1").arg(GetName());
|
||||||
|
}
|
||||||
mPtr = 0;
|
mPtr = 0;
|
||||||
mType = ASSET_TYPE_NONE;
|
mType = ASSET_TYPE_NONE;
|
||||||
}
|
}
|
||||||
|
|
||||||
void XAsset::ParsePtr(QDataStream *aStream, bool aDataFlag) {
|
void XAsset::ParsePtr(QDataStream *aStream, bool aDataFlag) {
|
||||||
*aStream >> mPtr;
|
*aStream >> mPtr;
|
||||||
|
if (mDebug)
|
||||||
|
{
|
||||||
|
// Always treat as unsigned when displaying in hex
|
||||||
|
quint64 raw = static_cast<quint64>(static_cast<quint32>(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)
|
if (aDataFlag && mPtr == -1)
|
||||||
{
|
{
|
||||||
@ -78,6 +105,10 @@ void XAsset::ParsePtr(QDataStream *aStream, bool aDataFlag) {
|
|||||||
|
|
||||||
XAsset* XAsset::Create(XAssetType aAssetType)
|
XAsset* XAsset::Create(XAssetType aAssetType)
|
||||||
{
|
{
|
||||||
|
if (mDebug)
|
||||||
|
{
|
||||||
|
qDebug() << QString("Creating XAsset with type %1").arg(XAssetTypeToString(aAssetType));
|
||||||
|
}
|
||||||
switch (aAssetType)
|
switch (aAssetType)
|
||||||
{
|
{
|
||||||
case ASSET_TYPE_XANIMPARTS:
|
case ASSET_TYPE_XANIMPARTS:
|
||||||
@ -417,6 +448,8 @@ QString XAsset::XAssetTypeToString(XAssetType type) {
|
|||||||
case ASSET_TYPE_CG_MEDIA_TABLE:
|
case ASSET_TYPE_CG_MEDIA_TABLE:
|
||||||
return "CgMediaTable";
|
return "CgMediaTable";
|
||||||
default:
|
default:
|
||||||
return "";
|
return "UnknownAsset";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool XAsset::mDebug = true;
|
||||||
|
|||||||
@ -5,6 +5,8 @@
|
|||||||
|
|
||||||
#include <QDataStream>
|
#include <QDataStream>
|
||||||
#include <QString>
|
#include <QString>
|
||||||
|
#include <QDebug>
|
||||||
|
#include <QIODevice>
|
||||||
|
|
||||||
class XAsset
|
class XAsset
|
||||||
{
|
{
|
||||||
@ -21,6 +23,9 @@ public:
|
|||||||
void SetName(QString aName);
|
void SetName(QString aName);
|
||||||
QString GetName() const;
|
QString GetName() const;
|
||||||
|
|
||||||
|
static void SetDebug(bool aDebug);
|
||||||
|
bool IsDebug() const;
|
||||||
|
|
||||||
virtual void Clear();
|
virtual void Clear();
|
||||||
virtual void ParsePtr(QDataStream *aStream, bool aDataFlag = true);
|
virtual void ParsePtr(QDataStream *aStream, bool aDataFlag = true);
|
||||||
virtual void ParseData(QDataStream *aStream) = 0;
|
virtual void ParseData(QDataStream *aStream) = 0;
|
||||||
@ -28,6 +33,8 @@ public:
|
|||||||
static XAsset* Create(XAssetType aAssetType);
|
static XAsset* Create(XAssetType aAssetType);
|
||||||
static QString XAssetTypeToString(XAssetType type);
|
static QString XAssetTypeToString(XAssetType type);
|
||||||
|
|
||||||
|
static bool mDebug;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
qint32 mPtr;
|
qint32 mPtr;
|
||||||
XAssetType mType;
|
XAssetType mType;
|
||||||
|
|||||||
@ -20,6 +20,8 @@ XAssetList::XAssetList(ZoneFile* aZoneFile)
|
|||||||
, mAssetHeaders()
|
, mAssetHeaders()
|
||||||
, mZoneFile(aZoneFile)
|
, mZoneFile(aZoneFile)
|
||||||
{
|
{
|
||||||
|
SetType(ASSET_TYPE_ASSETLIST);
|
||||||
|
SetName("Asset List");
|
||||||
}
|
}
|
||||||
|
|
||||||
XAssetList::~XAssetList()
|
XAssetList::~XAssetList()
|
||||||
@ -29,7 +31,10 @@ XAssetList::~XAssetList()
|
|||||||
|
|
||||||
void XAssetList::ParseData(QDataStream *aStream) {
|
void XAssetList::ParseData(QDataStream *aStream) {
|
||||||
// Parse string list
|
// 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);
|
mStringList.ParsePtr(aStream);
|
||||||
|
|
||||||
// Parse asset count and assets
|
// Parse asset count and assets
|
||||||
@ -37,6 +42,11 @@ void XAssetList::ParseData(QDataStream *aStream) {
|
|||||||
*aStream
|
*aStream
|
||||||
>> mAssetCount
|
>> mAssetCount
|
||||||
>> assetsPtr;
|
>> 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);
|
mStringList.ParseData(aStream);
|
||||||
|
|
||||||
|
|||||||
@ -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';
|
||||||
}
|
}
|
||||||
|
|||||||
@ -20,7 +20,7 @@ private:
|
|||||||
quint32 mBufferSize;
|
quint32 mBufferSize;
|
||||||
quint32 mLoopCount;
|
quint32 mLoopCount;
|
||||||
QVector<XAudioXmaLoopRegion> aXmaLoop;
|
QVector<XAudioXmaLoopRegion> aXmaLoop;
|
||||||
char* mContext;
|
char mContext;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // XAUDIOPACKETALIGNED_H
|
#endif // XAUDIOPACKETALIGNED_H
|
||||||
|
|||||||
@ -1,6 +1,9 @@
|
|||||||
#include "xaudioseektable.h"
|
#include "xaudioseektable.h"
|
||||||
|
|
||||||
XAudioSeekTable::XAudioSeekTable()
|
XAudioSeekTable::XAudioSeekTable()
|
||||||
|
: XAsset()
|
||||||
|
, mSize(0)
|
||||||
|
, mData()
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -12,10 +15,19 @@ XAudioSeekTable::~XAudioSeekTable()
|
|||||||
|
|
||||||
void XAudioSeekTable::ParseData(QDataStream *aStream)
|
void XAudioSeekTable::ParseData(QDataStream *aStream)
|
||||||
{
|
{
|
||||||
|
qint32 dataPtr;
|
||||||
|
*aStream
|
||||||
|
>> mSize
|
||||||
|
>> dataPtr;
|
||||||
|
|
||||||
|
if (dataPtr)
|
||||||
|
{
|
||||||
|
aStream->readRawData(mData.data(), 4 * mSize);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void XAudioSeekTable::Clear()
|
void XAudioSeekTable::Clear()
|
||||||
{
|
{
|
||||||
|
mSize = 0;
|
||||||
|
mData.clear();
|
||||||
}
|
}
|
||||||
|
|||||||
@ -15,7 +15,7 @@ public:
|
|||||||
virtual void Clear() override;
|
virtual void Clear() override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
int mSize;
|
quint32 mSize;
|
||||||
QByteArray mData;
|
QByteArray mData;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@ -1,6 +1,11 @@
|
|||||||
#include "xaudiosound.h"
|
#include "xaudiosound.h"
|
||||||
|
|
||||||
XAudioSound::XAudioSound()
|
XAudioSound::XAudioSound()
|
||||||
|
: XAsset()
|
||||||
|
, mPacket()
|
||||||
|
, mFormat()
|
||||||
|
, mXmaDataInfo()
|
||||||
|
, mSeekTable()
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -12,10 +17,16 @@ XAudioSound::~XAudioSound()
|
|||||||
|
|
||||||
void XAudioSound::ParseData(QDataStream *aStream)
|
void XAudioSound::ParseData(QDataStream *aStream)
|
||||||
{
|
{
|
||||||
|
mPacket.ParseData(aStream);
|
||||||
|
mFormat.ParseData(aStream);
|
||||||
|
mXmaDataInfo.ParseData(aStream);
|
||||||
|
mSeekTable.ParseData(aStream);
|
||||||
}
|
}
|
||||||
|
|
||||||
void XAudioSound::Clear()
|
void XAudioSound::Clear()
|
||||||
{
|
{
|
||||||
|
mPacket.Clear();
|
||||||
|
mFormat.Clear();
|
||||||
|
mXmaDataInfo.Clear();
|
||||||
|
mSeekTable.Clear();
|
||||||
}
|
}
|
||||||
|
|||||||
@ -17,10 +17,10 @@ public:
|
|||||||
virtual void Clear() override;
|
virtual void Clear() override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
XAudioPacketAligned* mPacket;
|
XAudioPacketAligned mPacket;
|
||||||
XAudioSourceFormat* mFormat;
|
XAudioSourceFormat mFormat;
|
||||||
XAudioXmaDataInfo* mXmaDataInfo;
|
XAudioXmaDataInfo mXmaDataInfo;
|
||||||
XAudioSeekTable *mSeekTable;
|
XAudioSeekTable mSeekTable;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // XAUDIOSOUND_H
|
#endif // XAUDIOSOUND_H
|
||||||
|
|||||||
@ -13,7 +13,7 @@ public:
|
|||||||
virtual void Clear() override;
|
virtual void Clear() override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
unsigned int mSampleRate;
|
quint32 mSampleRate;
|
||||||
quint8 mChannelCount;
|
quint8 mChannelCount;
|
||||||
quint8 mDecodeBufferSize;
|
quint8 mDecodeBufferSize;
|
||||||
};
|
};
|
||||||
|
|||||||
@ -13,8 +13,8 @@ public:
|
|||||||
virtual void Clear() override;
|
virtual void Clear() override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
unsigned int mLoopStart;
|
quint32 mLoopStart;
|
||||||
unsigned int mLoopEnd;
|
quint32 mLoopEnd;
|
||||||
quint8 mLoopSubframeEnd;
|
quint8 mLoopSubframeEnd;
|
||||||
quint8 mLoopSubframeSkip;
|
quint8 mLoopSubframeSkip;
|
||||||
};
|
};
|
||||||
|
|||||||
@ -15,7 +15,7 @@ public:
|
|||||||
virtual void Clear() override;
|
virtual void Clear() override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
quint16 mSurfId;
|
quint32 mSurfId;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // XBMODELDRAWINFO_H
|
#endif // XBMODELDRAWINFO_H
|
||||||
|
|||||||
@ -19,7 +19,7 @@ private:
|
|||||||
QVector3D mMins;
|
QVector3D mMins;
|
||||||
int mContents;
|
int mContents;
|
||||||
QVector3D mMaxs;
|
QVector3D mMaxs;
|
||||||
unsigned int mNumSides;
|
quint32 mNumSides;
|
||||||
QVector<XCBrushSide> mSides;
|
QVector<XCBrushSide> mSides;
|
||||||
QVector<QVector3D> mAxialMaterialNum;
|
QVector<QVector3D> mAxialMaterialNum;
|
||||||
quint8 *mBaseAdjacentSide;
|
quint8 *mBaseAdjacentSide;
|
||||||
|
|||||||
@ -12,6 +12,11 @@ XCardMemory::~XCardMemory()
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
quint32 XCardMemory::GetPlatform() const
|
||||||
|
{
|
||||||
|
return mPlatform;
|
||||||
|
}
|
||||||
|
|
||||||
void XCardMemory::ParseData(QDataStream *aStream)
|
void XCardMemory::ParseData(QDataStream *aStream)
|
||||||
{
|
{
|
||||||
*aStream >> mPlatform;
|
*aStream >> mPlatform;
|
||||||
|
|||||||
@ -9,11 +9,13 @@ public:
|
|||||||
XCardMemory();
|
XCardMemory();
|
||||||
~XCardMemory();
|
~XCardMemory();
|
||||||
|
|
||||||
|
quint32 GetPlatform() const;
|
||||||
|
|
||||||
virtual void ParseData(QDataStream* aStream) override;
|
virtual void ParseData(QDataStream* aStream) override;
|
||||||
virtual void Clear() override;
|
virtual void Clear() override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
int mPlatform;
|
quint32 mPlatform;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // XCARDMEMORY_H
|
#endif // XCARDMEMORY_H
|
||||||
|
|||||||
@ -2,7 +2,6 @@
|
|||||||
|
|
||||||
XCBrushSide::XCBrushSide()
|
XCBrushSide::XCBrushSide()
|
||||||
: XAsset()
|
: XAsset()
|
||||||
, mPlanePtr(0)
|
|
||||||
, mPlane()
|
, mPlane()
|
||||||
, mMaterialNum(0)
|
, mMaterialNum(0)
|
||||||
, mFirstAdjacentSideOffset(0)
|
, mFirstAdjacentSideOffset(0)
|
||||||
@ -18,13 +17,24 @@ XCBrushSide::~XCBrushSide()
|
|||||||
|
|
||||||
void XCBrushSide::ParseData(QDataStream *aStream)
|
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()
|
void XCBrushSide::Clear()
|
||||||
{
|
{
|
||||||
mPlanePtr = 0;
|
mPlane.Clear();
|
||||||
mPlane = XCPlane();
|
|
||||||
mMaterialNum = 0;
|
mMaterialNum = 0;
|
||||||
mFirstAdjacentSideOffset = 0;
|
mFirstAdjacentSideOffset = 0;
|
||||||
mEdgeCount = 0;
|
mEdgeCount = 0;
|
||||||
|
|||||||
@ -14,7 +14,6 @@ public:
|
|||||||
virtual void Clear() override;
|
virtual void Clear() override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
qint32 mPlanePtr;
|
|
||||||
XCPlane mPlane;
|
XCPlane mPlane;
|
||||||
uint mMaterialNum;
|
uint mMaterialNum;
|
||||||
qint16 mFirstAdjacentSideOffset;
|
qint16 mFirstAdjacentSideOffset;
|
||||||
|
|||||||
@ -28,22 +28,24 @@ void XCLeaf::ParseData(QDataStream *aStream) {
|
|||||||
>> mMaxs[2]
|
>> mMaxs[2]
|
||||||
>> mLeafBrushNode
|
>> mLeafBrushNode
|
||||||
>> mCluster;
|
>> mCluster;
|
||||||
|
|
||||||
|
aStream->skipRawData(2);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
quint16 XCLeaf::GetFirstCollAabbIndex() const {
|
quint32 XCLeaf::GetFirstCollAabbIndex() const {
|
||||||
return mFirstCollAabbIndex;
|
return mFirstCollAabbIndex;
|
||||||
}
|
}
|
||||||
|
|
||||||
void XCLeaf::SetFirstCollAabbIndex(quint16 index) {
|
void XCLeaf::SetFirstCollAabbIndex(quint32 index) {
|
||||||
mFirstCollAabbIndex = index;
|
mFirstCollAabbIndex = index;
|
||||||
}
|
}
|
||||||
|
|
||||||
quint16 XCLeaf::GetCollAabbCount() const {
|
quint32 XCLeaf::GetCollAabbCount() const {
|
||||||
return mCollAabbCount;
|
return mCollAabbCount;
|
||||||
}
|
}
|
||||||
|
|
||||||
void XCLeaf::SetCollAabbCount(quint16 count) {
|
void XCLeaf::SetCollAabbCount(quint32 count) {
|
||||||
mCollAabbCount = count;
|
mCollAabbCount = count;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -12,11 +12,11 @@ public:
|
|||||||
|
|
||||||
void ParseData(QDataStream *aStream) override;
|
void ParseData(QDataStream *aStream) override;
|
||||||
|
|
||||||
quint16 GetFirstCollAabbIndex() const;
|
quint32 GetFirstCollAabbIndex() const;
|
||||||
void SetFirstCollAabbIndex(quint16 index);
|
void SetFirstCollAabbIndex(quint32 index);
|
||||||
|
|
||||||
quint16 GetCollAabbCount() const;
|
quint32 GetCollAabbCount() const;
|
||||||
void SetCollAabbCount(quint16 count);
|
void SetCollAabbCount(quint32 count);
|
||||||
|
|
||||||
int GetBrushContents() const;
|
int GetBrushContents() const;
|
||||||
void SetBrushContents(int contents);
|
void SetBrushContents(int contents);
|
||||||
@ -37,8 +37,8 @@ public:
|
|||||||
void SetCluster(qint16 cluster);
|
void SetCluster(qint16 cluster);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
quint16 mFirstCollAabbIndex;
|
quint32 mFirstCollAabbIndex;
|
||||||
quint16 mCollAabbCount;
|
quint32 mCollAabbCount;
|
||||||
int mBrushContents;
|
int mBrushContents;
|
||||||
int mTerrainContents;
|
int mTerrainContents;
|
||||||
QVector<float> mMins;
|
QVector<float> mMins;
|
||||||
|
|||||||
@ -27,5 +27,5 @@ void XCLeafBrushNodeChildren::Clear()
|
|||||||
{
|
{
|
||||||
mDist = 0.0f;
|
mDist = 0.0f;
|
||||||
mRange = 0.0f;
|
mRange = 0.0f;
|
||||||
mChildOffset = QVector<quint16>();
|
mChildOffset = QVector<quint32>();
|
||||||
}
|
}
|
||||||
|
|||||||
@ -17,7 +17,7 @@ public:
|
|||||||
private:
|
private:
|
||||||
float mDist;
|
float mDist;
|
||||||
float mRange;
|
float mRange;
|
||||||
QVector<quint16> mChildOffset;
|
QVector<quint32> mChildOffset;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // XCLEAFBRUSHNODECHILDREN_H
|
#endif // XCLEAFBRUSHNODECHILDREN_H
|
||||||
|
|||||||
@ -13,7 +13,7 @@ public:
|
|||||||
void Clear() override;
|
void Clear() override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QVector<quint16> mBrushes;
|
QVector<quint32> mBrushes;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // XCLEAFBRUSHNODELEAF_H
|
#endif // XCLEAFBRUSHNODELEAF_H
|
||||||
|
|||||||
@ -1,7 +1,58 @@
|
|||||||
#include "xclipmap.h"
|
#include "xclipmap.h"
|
||||||
|
|
||||||
XClipMap::XClipMap()
|
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);
|
SetType(ASSET_TYPE_CLIPMAP);
|
||||||
SetName("ClipMap");
|
SetName("ClipMap");
|
||||||
}
|
}
|
||||||
@ -11,12 +62,201 @@ XClipMap::~XClipMap()
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void XClipMap::ParseData(QDataStream *aStream) {
|
void XClipMap::ParseData(QDataStream *aStream)
|
||||||
mName = XString::ParseCustom(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()
|
void XClipMap::Clear()
|
||||||
|
|||||||
@ -29,45 +29,45 @@ public:
|
|||||||
void Clear() override;
|
void Clear() override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QString mName;
|
XString mName;
|
||||||
|
|
||||||
bool mIsInUse;
|
quint32 mIsInUse;
|
||||||
|
|
||||||
int mPlaneCount;
|
int mPlaneCount;
|
||||||
QVector<XCPlane> mPlanes;
|
QVector<XCPlane> mPlanes;
|
||||||
|
|
||||||
uint mNumStaticModels;
|
quint32 mNumStaticModels;
|
||||||
QVector<XCStaticModel> mStaticModelList;
|
QVector<XCStaticModel> mStaticModelList;
|
||||||
|
|
||||||
uint mNumMaterials;
|
quint32 mNumMaterials;
|
||||||
QVector<XDMaterial> mMaterials;
|
QVector<XDMaterial> mMaterials;
|
||||||
|
|
||||||
uint mNumBrushSides;
|
quint32 mNumBrushSides;
|
||||||
QVector<XCBrushSide> mBrushsides;
|
QVector<XCBrushSide> mBrushsides;
|
||||||
|
|
||||||
uint mNumBrushEdges;
|
quint32 mNumBrushEdges;
|
||||||
QVector<quint8> mBrushEdges;
|
QVector<quint8> mBrushEdges;
|
||||||
|
|
||||||
uint mNumNodes;
|
quint32 mNumNodes;
|
||||||
QVector<XCNode> mNodes;
|
QVector<XCNode> mNodes;
|
||||||
|
|
||||||
uint mNumLeafs;
|
quint32 mNumLeafs;
|
||||||
QVector<XCLeaf> mLeafs;
|
QVector<XCLeaf> mLeafs;
|
||||||
|
|
||||||
uint mLeafbrushNodesCount;
|
quint32 mLeafBrushNodesCount;
|
||||||
QVector<XCLeafBrushNode> mLeafbrushNodes;
|
QVector<XCLeafBrushNode> mLeafBrushNodes;
|
||||||
|
|
||||||
uint mNumLeafBrushes;
|
quint32 mNumLeafBrushes;
|
||||||
QVector<quint16> mLeafbrushes;
|
QVector<quint32> mLeafBrushes;
|
||||||
|
|
||||||
uint mNumLeafSurfaces;
|
quint32 mNumLeafSurfaces;
|
||||||
QVector<uint> mLeafsurfaces;
|
QVector<uint> mLeafSurfaces;
|
||||||
|
|
||||||
uint mVertCount;
|
quint32 mVertCount;
|
||||||
QVector<float> mVerts;
|
QVector<float> mVerts;
|
||||||
|
|
||||||
int mTriCount;
|
int mTriCount;
|
||||||
QVector<quint16> mTriIndices;
|
QVector<quint32> mTriIndices;
|
||||||
QVector<quint8> mTriEdgeIsWalkable;
|
QVector<quint8> mTriEdgeIsWalkable;
|
||||||
|
|
||||||
int mBorderCount;
|
int mBorderCount;
|
||||||
@ -80,9 +80,9 @@ private:
|
|||||||
QVector<XCollisionAabbTree> mAabbTrees;
|
QVector<XCollisionAabbTree> mAabbTrees;
|
||||||
|
|
||||||
uint mNumSubModels;
|
uint mNumSubModels;
|
||||||
QVector<XCModel> mCodels;
|
QVector<XCModel> mCModels;
|
||||||
|
|
||||||
quint16 mNumBrushes;
|
quint32 mNumBrushes;
|
||||||
QVector<XCBrush> mBrushes;
|
QVector<XCBrush> mBrushes;
|
||||||
|
|
||||||
int mNumClusters;
|
int mNumClusters;
|
||||||
@ -92,14 +92,14 @@ private:
|
|||||||
QVector<quint8> mVisibility;
|
QVector<quint8> mVisibility;
|
||||||
int mVised;
|
int mVised;
|
||||||
QVector<XMapEnts> mMapEnts;
|
QVector<XMapEnts> mMapEnts;
|
||||||
XCBrush *mBoxBrush;
|
XCBrush mBoxBrush;
|
||||||
XCModel mBoxModel;
|
XCModel mBoxModel;
|
||||||
quint16 mDynEntCount[2];
|
QVector<quint32> mDynEntCounts;
|
||||||
XDynEntityDef *mDynEntDefList[2];
|
QVector<XDynEntityDef> mDynEntDefList;
|
||||||
XDynEntityPose *mDynEntPoseList[2];
|
QVector<XDynEntityPose> mDynEntPoseList;
|
||||||
XDynEntityClient *mDynEntClientList[2];
|
QVector<XDynEntityClient> mDynEntClientList;
|
||||||
XDynEntityColl *mDynEntCollList[2];
|
QVector<XDynEntityColl> mDynEntCollList;
|
||||||
uint mChecksum;
|
quint32 mChecksum;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // XCLIPMAP_H
|
#endif // XCLIPMAP_H
|
||||||
|
|||||||
@ -2,31 +2,32 @@
|
|||||||
|
|
||||||
XCNode::XCNode()
|
XCNode::XCNode()
|
||||||
: XAsset()
|
: XAsset()
|
||||||
, mPlane(new XCPlane())
|
, mPlane()
|
||||||
, mChildren()
|
, mChildren()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
XCNode::~XCNode()
|
XCNode::~XCNode()
|
||||||
{
|
{
|
||||||
delete mPlane;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void XCNode::ParseData(QDataStream *aStream) {
|
void XCNode::ParseData(QDataStream *aStream) {
|
||||||
if (GetPtr() == -1) {
|
if (GetPtr() == -1) {
|
||||||
// We would parse plane here, but we're using a placeholder
|
mPlane.ParsePtr(aStream);
|
||||||
mPlane->ParseData(aStream);
|
|
||||||
|
|
||||||
// Parse children
|
// Parse children
|
||||||
*aStream
|
*aStream
|
||||||
>> mChildren[0]
|
>> mChildren[0]
|
||||||
>> mChildren[1];
|
>> mChildren[1];
|
||||||
|
|
||||||
|
mPlane.ParseData(aStream);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void XCNode::Clear()
|
void XCNode::Clear()
|
||||||
{
|
{
|
||||||
mPlane->Clear();
|
mPlane.Clear();
|
||||||
mChildren.clear();
|
mChildren.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -14,7 +14,7 @@ public:
|
|||||||
void Clear() override;
|
void Clear() override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
XCPlane* mPlane;
|
XCPlane mPlane;
|
||||||
QVector<qint16> mChildren;
|
QVector<qint16> mChildren;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@ -48,19 +48,19 @@ void XCollisionAabbTree::SetHalfSize(QVector3D aHalfSize) {
|
|||||||
mHalfSize = aHalfSize;
|
mHalfSize = aHalfSize;
|
||||||
}
|
}
|
||||||
|
|
||||||
quint16 XCollisionAabbTree::GetMaterialIndex() const {
|
quint32 XCollisionAabbTree::GetMaterialIndex() const {
|
||||||
return mMaterialIndex;
|
return mMaterialIndex;
|
||||||
}
|
}
|
||||||
|
|
||||||
void XCollisionAabbTree::SetMaterialIndex(quint16 aIndex) {
|
void XCollisionAabbTree::SetMaterialIndex(quint32 aIndex) {
|
||||||
mMaterialIndex = aIndex;
|
mMaterialIndex = aIndex;
|
||||||
}
|
}
|
||||||
|
|
||||||
quint16 XCollisionAabbTree::GetChildCount() const {
|
quint32 XCollisionAabbTree::GetChildCount() const {
|
||||||
return mChildCount;
|
return mChildCount;
|
||||||
}
|
}
|
||||||
|
|
||||||
void XCollisionAabbTree::SetChildCount(quint16 count) {
|
void XCollisionAabbTree::SetChildCount(quint32 count) {
|
||||||
mChildCount = count;
|
mChildCount = count;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -20,11 +20,11 @@ public:
|
|||||||
QVector3D GetHalfSize() const;
|
QVector3D GetHalfSize() const;
|
||||||
void SetHalfSize(QVector3D aHalfSize);
|
void SetHalfSize(QVector3D aHalfSize);
|
||||||
|
|
||||||
quint16 GetMaterialIndex() const;
|
quint32 GetMaterialIndex() const;
|
||||||
void SetMaterialIndex(quint16 aIndex);
|
void SetMaterialIndex(quint32 aIndex);
|
||||||
|
|
||||||
quint16 GetChildCount() const;
|
quint32 GetChildCount() const;
|
||||||
void SetChildCount(quint16 aCount);
|
void SetChildCount(quint32 aCount);
|
||||||
|
|
||||||
XCollisionAabbTreeIndex& GetTreeIndex();
|
XCollisionAabbTreeIndex& GetTreeIndex();
|
||||||
void SetTreeIndex(const XCollisionAabbTreeIndex& aTreeIndex);
|
void SetTreeIndex(const XCollisionAabbTreeIndex& aTreeIndex);
|
||||||
@ -32,8 +32,8 @@ public:
|
|||||||
private:
|
private:
|
||||||
QVector3D mOrigin;
|
QVector3D mOrigin;
|
||||||
QVector3D mHalfSize;
|
QVector3D mHalfSize;
|
||||||
quint16 mMaterialIndex = 0;
|
quint32 mMaterialIndex = 0;
|
||||||
quint16 mChildCount = 0;
|
quint32 mChildCount = 0;
|
||||||
XCollisionAabbTreeIndex mTreeIndex;
|
XCollisionAabbTreeIndex mTreeIndex;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@ -18,7 +18,18 @@ XCPlane::~XCPlane()
|
|||||||
|
|
||||||
void XCPlane::ParseData(QDataStream *aStream)
|
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()
|
void XCPlane::Clear()
|
||||||
|
|||||||
@ -16,9 +16,11 @@ void XCStaticModel::ParseData(QDataStream *aStream) {
|
|||||||
// Parse writable
|
// Parse writable
|
||||||
mWritable.ParseData(aStream);
|
mWritable.ParseData(aStream);
|
||||||
|
|
||||||
// We would parse xmodel here, but we're using a placeholder
|
aStream->skipRawData(2);
|
||||||
|
|
||||||
|
qint32 xModelPtr;
|
||||||
*aStream
|
*aStream
|
||||||
|
>> xModelPtr
|
||||||
>> mOrigin[0]
|
>> mOrigin[0]
|
||||||
>> mOrigin[1]
|
>> mOrigin[1]
|
||||||
>> mOrigin[2];
|
>> mOrigin[2];
|
||||||
|
|||||||
@ -16,7 +16,7 @@ public:
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
XCStaticModelWritable mWritable;
|
XCStaticModelWritable mWritable;
|
||||||
const XModel* mModel;
|
XModel mModel;
|
||||||
QVector3D mOrigin;
|
QVector3D mOrigin;
|
||||||
QVector<QVector3D> mInvScaledAxis;
|
QVector<QVector3D> mInvScaledAxis;
|
||||||
QVector3D mAbsmin;
|
QVector3D mAbsmin;
|
||||||
|
|||||||
@ -17,11 +17,11 @@ void XCStaticModelWritable::ParseData(QDataStream *aStream) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
quint16 XCStaticModelWritable::GetNextModelInWorldSector() const {
|
quint32 XCStaticModelWritable::GetNextModelInWorldSector() const {
|
||||||
return mNextModelInWorldSector;
|
return mNextModelInWorldSector;
|
||||||
}
|
}
|
||||||
|
|
||||||
void XCStaticModelWritable::SetNextModelInWorldSector(quint16 nextModel) {
|
void XCStaticModelWritable::SetNextModelInWorldSector(quint32 nextModel) {
|
||||||
mNextModelInWorldSector = nextModel;
|
mNextModelInWorldSector = nextModel;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -11,11 +11,11 @@ public:
|
|||||||
|
|
||||||
void ParseData(QDataStream *aStream) override;
|
void ParseData(QDataStream *aStream) override;
|
||||||
|
|
||||||
quint16 GetNextModelInWorldSector() const;
|
quint32 GetNextModelInWorldSector() const;
|
||||||
void SetNextModelInWorldSector(quint16 nextModel);
|
void SetNextModelInWorldSector(quint32 nextModel);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
quint16 mNextModelInWorldSector;
|
quint32 mNextModelInWorldSector;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // XCSTATICMODELWRITABLE_H
|
#endif // XCSTATICMODELWRITABLE_H
|
||||||
|
|||||||
@ -15,7 +15,7 @@ public:
|
|||||||
virtual void Clear() override;
|
virtual void Clear() override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
unsigned int mMipFlush;
|
quint32 mMipFlush;
|
||||||
XGpuTextureFetchConstant mFormat;
|
XGpuTextureFetchConstant mFormat;
|
||||||
XD3DResource mResource;
|
XD3DResource mResource;
|
||||||
};
|
};
|
||||||
|
|||||||
@ -13,12 +13,12 @@ public:
|
|||||||
virtual void Clear() override;
|
virtual void Clear() override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
unsigned int mCommon;
|
quint32 mCommon;
|
||||||
unsigned int mReferenceCount;
|
quint32 mReferenceCount;
|
||||||
unsigned int mFence;
|
quint32 mFence;
|
||||||
unsigned int mReadFence;
|
quint32 mReadFence;
|
||||||
unsigned int mIdentifier;
|
quint32 mIdentifier;
|
||||||
unsigned int mBaseFlush;
|
quint32 mBaseFlush;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -14,8 +14,8 @@ public:
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
int mPhysObjId;
|
int mPhysObjId;
|
||||||
quint16 mFlags;
|
quint32 mFlags;
|
||||||
quint16 mLightingHandle;
|
quint32 mLightingHandle;
|
||||||
int mHealth;
|
int mHealth;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@ -15,8 +15,8 @@ public:
|
|||||||
void Clear() override;
|
void Clear() override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
quint16 mSector;
|
quint32 mSector;
|
||||||
quint16 mNextEntInSector;
|
quint32 mNextEntInSector;
|
||||||
QVector<float> mLinkMins;
|
QVector<float> mLinkMins;
|
||||||
QVector<float> mLinkMaxs;
|
QVector<float> mLinkMaxs;
|
||||||
};
|
};
|
||||||
|
|||||||
@ -29,8 +29,8 @@ private:
|
|||||||
XGfxPlacement mPose;
|
XGfxPlacement mPose;
|
||||||
qint32 mModelPtr;
|
qint32 mModelPtr;
|
||||||
XModel mModel;
|
XModel mModel;
|
||||||
quint16 mBrushModel;
|
quint32 mBrushModel;
|
||||||
quint16 mPhysicsBrushModel;
|
quint32 mPhysicsBrushModel;
|
||||||
qint32 mBestroyFxPtr;
|
qint32 mBestroyFxPtr;
|
||||||
XFxEffectDef mDestroyFx;
|
XFxEffectDef mDestroyFx;
|
||||||
qint32 mDestroyPiecesPtr;
|
qint32 mDestroyPiecesPtr;
|
||||||
|
|||||||
@ -26,7 +26,7 @@ void XFxTrailDef::Clear()
|
|||||||
mVertCount = 0;
|
mVertCount = 0;
|
||||||
mVerts = QVector<XFxTrailVertex>();
|
mVerts = QVector<XFxTrailVertex>();
|
||||||
mIndCount = 0;
|
mIndCount = 0;
|
||||||
mIndices = QVector<quint16>();
|
mIndices = QVector<quint32>();
|
||||||
}
|
}
|
||||||
|
|
||||||
void XFxTrailDef::ParseData(QDataStream *aStream)
|
void XFxTrailDef::ParseData(QDataStream *aStream)
|
||||||
|
|||||||
@ -22,7 +22,7 @@ private:
|
|||||||
int mVertCount;
|
int mVertCount;
|
||||||
QVector<XFxTrailVertex> mVerts;
|
QVector<XFxTrailVertex> mVerts;
|
||||||
int mIndCount;
|
int mIndCount;
|
||||||
QVector<quint16> mIndices;
|
QVector<quint32> mIndices;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // XFXTRAILDEF_H
|
#endif // XFXTRAILDEF_H
|
||||||
|
|||||||
@ -18,13 +18,13 @@ public:
|
|||||||
private:
|
private:
|
||||||
QVector3D mMins;
|
QVector3D mMins;
|
||||||
QVector3D mMaxs;
|
QVector3D mMaxs;
|
||||||
quint16 mChildCount;
|
quint32 mChildCount;
|
||||||
quint16 mSurfaceCount;
|
quint32 mSurfaceCount;
|
||||||
quint16 mStartSurfIndex;
|
quint32 mStartSurfIndex;
|
||||||
|
|
||||||
quint16 mModelIndexCount;
|
quint32 mModelIndexCount;
|
||||||
qint32 mModelIndexesPtr;
|
qint32 mModelIndexesPtr;
|
||||||
QVector<quint16> mModelIndexes;
|
QVector<quint32> mModelIndexes;
|
||||||
|
|
||||||
int mChildrenOffset;
|
int mChildrenOffset;
|
||||||
};
|
};
|
||||||
|
|||||||
@ -14,7 +14,7 @@ public:
|
|||||||
void SetColor(quint8 r, quint8 g, quint8 b, quint8 a);
|
void SetColor(quint8 r, quint8 g, quint8 b, quint8 a);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
unsigned int mPacked;
|
quint32 mPacked;
|
||||||
quint8 mArray[4];
|
quint8 mArray[4];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@ -28,7 +28,44 @@ XGfxImage::~XGfxImage()
|
|||||||
|
|
||||||
void XGfxImage::ParseData(QDataStream *aStream)
|
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()
|
void XGfxImage::Clear()
|
||||||
|
|||||||
@ -5,6 +5,7 @@
|
|||||||
#include "xcardmemory.h"
|
#include "xcardmemory.h"
|
||||||
#include "xgfxtexture.h"
|
#include "xgfxtexture.h"
|
||||||
#include "xmaptype.h"
|
#include "xmaptype.h"
|
||||||
|
#include "xstring.h"
|
||||||
|
|
||||||
#include <QString>
|
#include <QString>
|
||||||
#include <QVector>
|
#include <QVector>
|
||||||
@ -28,11 +29,11 @@ private:
|
|||||||
quint16 mDepth;
|
quint16 mDepth;
|
||||||
quint8 mCategory;
|
quint8 mCategory;
|
||||||
bool mDelayLoadPixels;
|
bool mDelayLoadPixels;
|
||||||
QVector<quint8> mPixels;
|
QByteArray mPixels;
|
||||||
unsigned int mBaseSize;
|
quint32 mBaseSize;
|
||||||
quint16 mStreamSlot;
|
quint16 mStreamSlot;
|
||||||
bool mStreaming;
|
bool mStreaming;
|
||||||
QString mName;
|
XString mName;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // XGFXIMAGE_H
|
#endif // XGFXIMAGE_H
|
||||||
|
|||||||
@ -20,17 +20,17 @@ public:
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
bool mHasLightRegions;
|
bool mHasLightRegions;
|
||||||
unsigned int mSunPrimaryLightIndex;
|
quint32 mSunPrimaryLightIndex;
|
||||||
QVector3D mMins;
|
QVector3D mMins;
|
||||||
QVector3D mMaxs;
|
QVector3D mMaxs;
|
||||||
unsigned int mRowAxis;
|
quint32 mRowAxis;
|
||||||
unsigned int mColAxis;
|
quint32 mColAxis;
|
||||||
unsigned __int16 *mRowDataStart;
|
quint16 *mRowDataStart;
|
||||||
unsigned int mRawRowDataSize;
|
quint32 mRawRowDataSize;
|
||||||
unsigned __int8 *mRawRowData;
|
quint8 *mRawRowData;
|
||||||
unsigned int mEntryCount;
|
quint32 mEntryCount;
|
||||||
QVector<XGfxLightGridEntry> mEntries;
|
QVector<XGfxLightGridEntry> mEntries;
|
||||||
unsigned int mColorCount;
|
quint32 mColorCount;
|
||||||
QVector<XGfxLightGridColors> mColors;
|
QVector<XGfxLightGridColors> mColors;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@ -15,7 +15,7 @@ public:
|
|||||||
virtual void Clear() override;
|
virtual void Clear() override;
|
||||||
virtual void ParseData(QDataStream *aStream) override;
|
virtual void ParseData(QDataStream *aStream) override;
|
||||||
|
|
||||||
quint16 colorsIndex;
|
quint32 colorsIndex;
|
||||||
quint8 primaryLightIndex;
|
quint8 primaryLightIndex;
|
||||||
quint8 needsTrace;
|
quint8 needsTrace;
|
||||||
};
|
};
|
||||||
|
|||||||
@ -2,9 +2,7 @@
|
|||||||
|
|
||||||
XGfxPixelShaderLoadDef::XGfxPixelShaderLoadDef()
|
XGfxPixelShaderLoadDef::XGfxPixelShaderLoadDef()
|
||||||
: XAsset()
|
: XAsset()
|
||||||
, mCachedPartPtr(0)
|
|
||||||
, mCachedPart()
|
, mCachedPart()
|
||||||
, mPhysicalPartPtr(0)
|
|
||||||
, mPhysicalPart()
|
, mPhysicalPart()
|
||||||
, mCachedPartSize(0)
|
, mCachedPartSize(0)
|
||||||
, mPhysicalPartSize(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()
|
void XGfxPixelShaderLoadDef::Clear()
|
||||||
{
|
{
|
||||||
mCachedPartPtr = 0;
|
|
||||||
mCachedPart.clear();
|
mCachedPart.clear();
|
||||||
mPhysicalPartPtr = 0;
|
|
||||||
mPhysicalPart.clear();
|
mPhysicalPart.clear();
|
||||||
mCachedPartSize = 0;
|
mCachedPartSize = 0;
|
||||||
mPhysicalPartSize = 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);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
@ -11,14 +11,15 @@ public:
|
|||||||
explicit XGfxPixelShaderLoadDef();
|
explicit XGfxPixelShaderLoadDef();
|
||||||
~XGfxPixelShaderLoadDef();
|
~XGfxPixelShaderLoadDef();
|
||||||
|
|
||||||
|
quint16 GetPhysicalPartSize() const;
|
||||||
|
quint16 GetCachedPartSize() const;
|
||||||
|
|
||||||
void ParseData(QDataStream *aStream) override;
|
void ParseData(QDataStream *aStream) override;
|
||||||
void Clear() override;
|
void Clear() override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
quint16 mCachedPartPtr;
|
QByteArray mCachedPart;
|
||||||
QVector<quint8> mCachedPart;
|
QByteArray mPhysicalPart;
|
||||||
quint16 mPhysicalPartPtr;
|
|
||||||
QVector<quint8> mPhysicalPart;
|
|
||||||
quint16 mCachedPartSize;
|
quint16 mCachedPartSize;
|
||||||
quint16 mPhysicalPartSize;
|
quint16 mPhysicalPartSize;
|
||||||
};
|
};
|
||||||
|
|||||||
@ -17,7 +17,7 @@ public:
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
XBModelDrawInfo mInfo;
|
XBModelDrawInfo mInfo;
|
||||||
quint16 mDynEntId;
|
quint32 mDynEntId;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // XGFXSCENEDYNBRUSH_H
|
#endif // XGFXSCENEDYNBRUSH_H
|
||||||
|
|||||||
@ -17,7 +17,7 @@ public:
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
XModelDrawInfo mInfo;
|
XModelDrawInfo mInfo;
|
||||||
quint16 mDynEntId;
|
quint32 mDynEntId;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // XGFXSCENEDYNMODEL_H
|
#endif // XGFXSCENEDYNMODEL_H
|
||||||
|
|||||||
@ -15,12 +15,12 @@ public:
|
|||||||
virtual void Clear() override;
|
virtual void Clear() override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
quint16 mSurfaceCount;
|
quint32 mSurfaceCount;
|
||||||
quint16 mModelCount;
|
quint32 mModelCount;
|
||||||
qint32 mSortedSurfIndexPtr;
|
qint32 mSortedSurfIndexPtr;
|
||||||
QVector<quint16> mSortedSurfIndex;
|
QVector<quint32> mSortedSurfIndex;
|
||||||
qint32 mModelIndexPtr;
|
qint32 mModelIndexPtr;
|
||||||
QVector<quint16> mModelIndex;
|
QVector<quint32> mModelIndex;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // XGFXSHADOWGEOMETRY_H
|
#endif // XGFXSHADOWGEOMETRY_H
|
||||||
|
|||||||
@ -22,7 +22,7 @@ private:
|
|||||||
XModel *mModel;
|
XModel *mModel;
|
||||||
quint8 mReflectionProbeIndex;
|
quint8 mReflectionProbeIndex;
|
||||||
quint8 mPrimaryLightIndex;
|
quint8 mPrimaryLightIndex;
|
||||||
quint16 mLightingHandle;
|
quint32 mLightingHandle;
|
||||||
quint8 mFlags;
|
quint8 mFlags;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@ -7,7 +7,7 @@ XGfxVertexShaderLoadDef::XGfxVertexShaderLoadDef()
|
|||||||
, mCachedPartSize(0)
|
, mCachedPartSize(0)
|
||||||
, mPhysicalPartSize(0)
|
, mPhysicalPartSize(0)
|
||||||
{
|
{
|
||||||
|
SetName("Vertex Shader Definition");
|
||||||
}
|
}
|
||||||
|
|
||||||
XGfxVertexShaderLoadDef::~XGfxVertexShaderLoadDef()
|
XGfxVertexShaderLoadDef::~XGfxVertexShaderLoadDef()
|
||||||
@ -25,6 +25,10 @@ void XGfxVertexShaderLoadDef::Clear()
|
|||||||
|
|
||||||
void XGfxVertexShaderLoadDef::ParseData(QDataStream *aStream)
|
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;
|
qint32 cachedPartPtr, physicalPartPtr;
|
||||||
*aStream
|
*aStream
|
||||||
>> cachedPartPtr
|
>> cachedPartPtr
|
||||||
@ -32,12 +36,28 @@ void XGfxVertexShaderLoadDef::ParseData(QDataStream *aStream)
|
|||||||
>> mCachedPartSize
|
>> mCachedPartSize
|
||||||
>> mPhysicalPartSize;
|
>> 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)
|
if (physicalPartPtr)
|
||||||
{
|
{
|
||||||
aStream->readRawData(mPhysicalPart.data(), mPhysicalPartSize);
|
aStream->readRawData(mPhysicalPart.data(), mPhysicalPartSize);
|
||||||
|
if (IsDebug())
|
||||||
|
{
|
||||||
|
qDebug() << QString("[%1] mPhysicalPart = %2").arg(aStream->device()->pos(), 10, 10, QChar('0')).arg(mPhysicalPart);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (cachedPartPtr)
|
if (cachedPartPtr)
|
||||||
{
|
{
|
||||||
aStream->readRawData(mCachedPart.data(), mCachedPartSize);
|
aStream->readRawData(mCachedPart.data(), mCachedPartSize);
|
||||||
|
if (IsDebug())
|
||||||
|
{
|
||||||
|
qDebug() << QString("[%1] mCachedPart = %2").arg(aStream->device()->pos(), 10, 10, QChar('0')).arg(mCachedPart);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -20,7 +20,7 @@ private:
|
|||||||
qint32 aPlanesPtr;
|
qint32 aPlanesPtr;
|
||||||
QVector<XCPlane> aPlanes;
|
QVector<XCPlane> aPlanes;
|
||||||
qint32 aNodesPtr;
|
qint32 aNodesPtr;
|
||||||
QVector<quint16> aNodes;
|
QVector<quint32> aNodes;
|
||||||
qint32 aSceneEntCellBitsPtr;
|
qint32 aSceneEntCellBitsPtr;
|
||||||
QVector<uint> aSceneEntCellBits;
|
QVector<uint> aSceneEntCellBits;
|
||||||
};
|
};
|
||||||
|
|||||||
@ -32,7 +32,7 @@ private:
|
|||||||
QVector<quint8*> mSmodelVisData;
|
QVector<quint8*> mSmodelVisData;
|
||||||
QVector<quint8*> mSurfaceVisData;
|
QVector<quint8*> mSurfaceVisData;
|
||||||
uint *mLodData;
|
uint *mLodData;
|
||||||
quint16 *mSortedSurfIndex;
|
quint32 *mSortedSurfIndex;
|
||||||
QVector<XGfxStaticModelInst> *mModelInsts;
|
QVector<XGfxStaticModelInst> *mModelInsts;
|
||||||
QVector<XGfxSurface> *mSurfaces;
|
QVector<XGfxSurface> *mSurfaces;
|
||||||
QVector<XGfxCullGroup> *mCullGroups;
|
QVector<XGfxCullGroup> *mCullGroups;
|
||||||
|
|||||||
@ -13,7 +13,7 @@ public:
|
|||||||
void ParseData(QDataStream *aStream) override;
|
void ParseData(QDataStream *aStream) override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
quint16 mLetter;
|
quint32 mLetter;
|
||||||
char mX0;
|
char mX0;
|
||||||
char mY0;
|
char mY0;
|
||||||
quint8 mDx;
|
quint8 mDx;
|
||||||
|
|||||||
@ -14,7 +14,7 @@ public:
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
XGpuVertexRawRequest mRequest;
|
XGpuVertexRawRequest mRequest;
|
||||||
unsigned int mDword[2];
|
quint32 mDword[2];
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // XGPUVERTEXFETCHCONSTANT_H
|
#endif // XGPUVERTEXFETCHCONSTANT_H
|
||||||
|
|||||||
@ -15,10 +15,15 @@ XLoadedSound::~XLoadedSound()
|
|||||||
|
|
||||||
void XLoadedSound::ParseData(QDataStream *aStream)
|
void XLoadedSound::ParseData(QDataStream *aStream)
|
||||||
{
|
{
|
||||||
|
if (GetPtr() == -1)
|
||||||
|
{
|
||||||
|
mName.ParsePtr(aStream, false);
|
||||||
|
mSound.ParseData(aStream);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void XLoadedSound::Clear()
|
void XLoadedSound::Clear()
|
||||||
{
|
{
|
||||||
|
mName.Clear();
|
||||||
|
mSound.Clear();
|
||||||
}
|
}
|
||||||
|
|||||||
@ -15,8 +15,8 @@ public:
|
|||||||
virtual void Clear() override;
|
virtual void Clear() override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
XString* mName;
|
XString mName;
|
||||||
XAudioSound* mSound;
|
XAudioSound mSound;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // XLOADEDSOUND_H
|
#endif // XLOADEDSOUND_H
|
||||||
|
|||||||
@ -1,15 +1,27 @@
|
|||||||
#include "xmaterialargumentdef.h"
|
#include "xmaterialargumentdef.h"
|
||||||
|
#include "xmaterialshaderargument.h"
|
||||||
|
|
||||||
XMaterialArgumentDef::XMaterialArgumentDef()
|
XMaterialArgumentDef::XMaterialArgumentDef()
|
||||||
: XAsset()
|
: XAsset()
|
||||||
, mLiteralConst(nullptr)
|
|
||||||
, mCodeConst()
|
|
||||||
, mCodeSampler(0)
|
, mCodeSampler(0)
|
||||||
, mNameHash(0)
|
, mParent(nullptr)
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
XMaterialArgumentDef::XMaterialArgumentDef(XMaterialShaderArgument &aParent)
|
||||||
|
: XAsset()
|
||||||
|
, mCodeSampler(0)
|
||||||
|
, mParent(&aParent)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
XMaterialArgumentDef::~XMaterialArgumentDef()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
void XMaterialArgumentDef::Clear()
|
void XMaterialArgumentDef::Clear()
|
||||||
{
|
{
|
||||||
|
|
||||||
@ -17,5 +29,19 @@ void XMaterialArgumentDef::Clear()
|
|||||||
|
|
||||||
void XMaterialArgumentDef::ParseData(QDataStream *aStream)
|
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);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -2,21 +2,22 @@
|
|||||||
#define XMATERIALARGUMENTDEF_H
|
#define XMATERIALARGUMENTDEF_H
|
||||||
|
|
||||||
#include "xasset.h"
|
#include "xasset.h"
|
||||||
#include "xmaterialargumentcodeconst.h"
|
|
||||||
|
class XMaterialShaderArgument;
|
||||||
|
|
||||||
class XMaterialArgumentDef : public XAsset
|
class XMaterialArgumentDef : public XAsset
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
XMaterialArgumentDef();
|
explicit XMaterialArgumentDef();
|
||||||
|
XMaterialArgumentDef(XMaterialShaderArgument &aParent);
|
||||||
|
~XMaterialArgumentDef();
|
||||||
|
|
||||||
virtual void Clear() override;
|
virtual void Clear() override;
|
||||||
virtual void ParseData(QDataStream *aStream) override;
|
virtual void ParseData(QDataStream *aStream) override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
const float *mLiteralConst;
|
qint32 mCodeSampler;
|
||||||
XMaterialArgumentCodeConst mCodeConst;
|
XMaterialShaderArgument* mParent;
|
||||||
unsigned int mCodeSampler;
|
|
||||||
unsigned int mNameHash;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // XMATERIALARGUMENTDEF_H
|
#endif // XMATERIALARGUMENTDEF_H
|
||||||
|
|||||||
@ -15,7 +15,7 @@ public:
|
|||||||
virtual void Clear() override;
|
virtual void Clear() override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
unsigned int mNameHash;
|
quint32 mNameHash;
|
||||||
QString mName;
|
QString mName;
|
||||||
QVector<float> mLiteral;
|
QVector<float> mLiteral;
|
||||||
};
|
};
|
||||||
|
|||||||
@ -22,7 +22,7 @@ private:
|
|||||||
quint8 mTextureAtlasRowCount;
|
quint8 mTextureAtlasRowCount;
|
||||||
quint8 mTextureAtlasColumnCount;
|
quint8 mTextureAtlasColumnCount;
|
||||||
XGfxDrawSurf mDrawSurf;
|
XGfxDrawSurf mDrawSurf;
|
||||||
unsigned int mSurfaceTypeBits;
|
quint32 mSurfaceTypeBits;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // XMATERIALINFO_H
|
#endif // XMATERIALINFO_H
|
||||||
|
|||||||
@ -3,10 +3,13 @@
|
|||||||
#include "xmaterialvertexshader.h"
|
#include "xmaterialvertexshader.h"
|
||||||
#include "xmaterialpixelshader.h"
|
#include "xmaterialpixelshader.h"
|
||||||
|
|
||||||
|
#include <QDebug>
|
||||||
|
#include <QIODevice>
|
||||||
|
|
||||||
XMaterialPass::XMaterialPass()
|
XMaterialPass::XMaterialPass()
|
||||||
: XAsset()
|
: XAsset()
|
||||||
, mVertexDecl()
|
, mVertexDecl()
|
||||||
, mVertexShaderArray()
|
, mVertexShaderArray(15)
|
||||||
, mVertexShader()
|
, mVertexShader()
|
||||||
, mPixelShader()
|
, mPixelShader()
|
||||||
, mPerPrimArgCount(0)
|
, mPerPrimArgCount(0)
|
||||||
@ -16,7 +19,7 @@ XMaterialPass::XMaterialPass()
|
|||||||
, mPrecompiledIndex(0)
|
, mPrecompiledIndex(0)
|
||||||
, mArgs()
|
, mArgs()
|
||||||
{
|
{
|
||||||
|
SetName("Material Pass");
|
||||||
}
|
}
|
||||||
|
|
||||||
void XMaterialPass::Clear()
|
void XMaterialPass::Clear()
|
||||||
@ -26,6 +29,11 @@ void XMaterialPass::Clear()
|
|||||||
|
|
||||||
void XMaterialPass::ParseData(QDataStream *aStream)
|
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);
|
mVertexDecl.ParsePtr(aStream, false);
|
||||||
for (int i = 0; i < 15; i++)
|
for (int i = 0; i < 15; i++)
|
||||||
{
|
{
|
||||||
@ -34,20 +42,45 @@ void XMaterialPass::ParseData(QDataStream *aStream)
|
|||||||
mVertexShader.ParsePtr(aStream, false);
|
mVertexShader.ParsePtr(aStream, false);
|
||||||
mPixelShader.ParsePtr(aStream, false);
|
mPixelShader.ParsePtr(aStream, false);
|
||||||
|
|
||||||
qint32 argPtr;
|
qint32 argsPtr;
|
||||||
*aStream
|
*aStream
|
||||||
>> mPerPrimArgCount
|
>> mPerPrimArgCount
|
||||||
>> mPerObjArgCount
|
>> mPerObjArgCount
|
||||||
>> mStableArgCount
|
>> mStableArgCount
|
||||||
>> mCustomSamplerFlags
|
>> mCustomSamplerFlags
|
||||||
>> mPrecompiledIndex
|
>> mPrecompiledIndex;
|
||||||
>> argPtr;
|
|
||||||
|
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);
|
mVertexDecl.ParseData(aStream);
|
||||||
|
|
||||||
for (int i = 0; i < 15; i++)
|
for (int i = 0; i < 15; i++)
|
||||||
{
|
{
|
||||||
mVertexShaderArray[i].ParseData(aStream);
|
mVertexShaderArray[i].ParseData(aStream);
|
||||||
}
|
}
|
||||||
mVertexShader.ParseData(aStream);
|
mVertexShader.ParseData(aStream);
|
||||||
mPixelShader.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);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -27,7 +27,7 @@ private:
|
|||||||
int mStableArgCount;
|
int mStableArgCount;
|
||||||
int mCustomSamplerFlags;
|
int mCustomSamplerFlags;
|
||||||
int mPrecompiledIndex;
|
int mPrecompiledIndex;
|
||||||
XMaterialShaderArgument mArgs;
|
QVector<XMaterialShaderArgument> mArgs;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // XMATERIALPASS_H
|
#endif // XMATERIALPASS_H
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
XMaterialPixelShader::XMaterialPixelShader()
|
XMaterialPixelShader::XMaterialPixelShader()
|
||||||
: XAsset()
|
: XAsset()
|
||||||
, mName("")
|
, mName()
|
||||||
, mShaderProgram()
|
, mShaderProgram()
|
||||||
{
|
{
|
||||||
SetType(ASSET_TYPE_PIXELSHADER);
|
SetType(ASSET_TYPE_PIXELSHADER);
|
||||||
@ -16,11 +16,15 @@ XMaterialPixelShader::~XMaterialPixelShader()
|
|||||||
|
|
||||||
void XMaterialPixelShader::Clear()
|
void XMaterialPixelShader::Clear()
|
||||||
{
|
{
|
||||||
mName.clear();
|
mName.Clear();
|
||||||
mShaderProgram.Clear();
|
mShaderProgram.Clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
void XMaterialPixelShader::ParseData(QDataStream *aStream)
|
void XMaterialPixelShader::ParseData(QDataStream *aStream)
|
||||||
{
|
{
|
||||||
|
if (GetPtr() == -1)
|
||||||
|
{
|
||||||
|
mName.ParsePtr(aStream);
|
||||||
|
mShaderProgram.ParseData(aStream);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -2,6 +2,7 @@
|
|||||||
#define XMATERIALPIXERHSHADER_H
|
#define XMATERIALPIXERHSHADER_H
|
||||||
|
|
||||||
#include "xasset.h"
|
#include "xasset.h"
|
||||||
|
#include "xstring.h"
|
||||||
#include "xmaterialpixelshaderprogram.h"
|
#include "xmaterialpixelshaderprogram.h"
|
||||||
|
|
||||||
class XMaterialPixelShader : public XAsset
|
class XMaterialPixelShader : public XAsset
|
||||||
@ -14,7 +15,7 @@ public:
|
|||||||
void ParseData(QDataStream *aStream) override;
|
void ParseData(QDataStream *aStream) override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QString mName;
|
XString mName;
|
||||||
XMaterialPixelShaderProgram mShaderProgram;
|
XMaterialPixelShaderProgram mShaderProgram;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
XMaterialPixelShaderProgram::XMaterialPixelShaderProgram()
|
XMaterialPixelShaderProgram::XMaterialPixelShaderProgram()
|
||||||
: XAsset()
|
: XAsset()
|
||||||
, mPixelShader(nullptr)
|
, mPixelShader()
|
||||||
, mLoadDef()
|
, mLoadDef()
|
||||||
{
|
{
|
||||||
|
|
||||||
@ -10,16 +10,26 @@ XMaterialPixelShaderProgram::XMaterialPixelShaderProgram()
|
|||||||
|
|
||||||
XMaterialPixelShaderProgram::~XMaterialPixelShaderProgram()
|
XMaterialPixelShaderProgram::~XMaterialPixelShaderProgram()
|
||||||
{
|
{
|
||||||
delete mPixelShader;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void XMaterialPixelShaderProgram::Clear()
|
void XMaterialPixelShaderProgram::Clear()
|
||||||
{
|
{
|
||||||
mPixelShader->Clear();
|
mPixelShader.Clear();
|
||||||
mLoadDef.Clear();
|
mLoadDef.Clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
void XMaterialPixelShaderProgram::ParseData(QDataStream *aStream)
|
void XMaterialPixelShaderProgram::ParseData(QDataStream *aStream)
|
||||||
{
|
{
|
||||||
|
mLoadDef.ParseData(aStream);
|
||||||
|
mPixelShader.ParseData(aStream);
|
||||||
|
|
||||||
|
if (mLoadDef.GetPhysicalPartSize())
|
||||||
|
{
|
||||||
|
//mPixelShader.
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
//mLoadDef
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -18,7 +18,7 @@ public:
|
|||||||
void ParseData(QDataStream *aStream) override;
|
void ParseData(QDataStream *aStream) override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
XD3DPixelShader *mPixelShader;
|
XD3DPixelShader mPixelShader;
|
||||||
XGfxPixelShaderLoadDef mLoadDef;
|
XGfxPixelShaderLoadDef mLoadDef;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@ -6,15 +6,31 @@ XMaterialShaderArgument::XMaterialShaderArgument()
|
|||||||
, mDest(0)
|
, mDest(0)
|
||||||
, mDef()
|
, mDef()
|
||||||
{
|
{
|
||||||
|
SetName("Material Shader Argument");
|
||||||
}
|
}
|
||||||
|
|
||||||
void XMaterialShaderArgument::Clear()
|
void XMaterialShaderArgument::Clear()
|
||||||
{
|
{
|
||||||
|
mType = 0;
|
||||||
|
mDest = 0;
|
||||||
|
mDef.Clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
void XMaterialShaderArgument::ParseData(QDataStream *aStream)
|
void XMaterialShaderArgument::ParseData(QDataStream *aStream)
|
||||||
{
|
{
|
||||||
|
*aStream
|
||||||
|
>> mType
|
||||||
|
>> mDest;
|
||||||
|
|
||||||
|
mDef.ParseData(aStream, mType);
|
||||||
|
}
|
||||||
|
|
||||||
|
quint16 XMaterialShaderArgument::GetType() const
|
||||||
|
{
|
||||||
|
return mType;
|
||||||
|
}
|
||||||
|
|
||||||
|
quint16 XMaterialShaderArgument::GetDest() const
|
||||||
|
{
|
||||||
|
return mDest;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -12,9 +12,12 @@ public:
|
|||||||
virtual void Clear() override;
|
virtual void Clear() override;
|
||||||
virtual void ParseData(QDataStream *aStream) override;
|
virtual void ParseData(QDataStream *aStream) override;
|
||||||
|
|
||||||
|
quint16 GetType() const;
|
||||||
|
quint16 GetDest() const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
int mType;
|
quint16 mType;
|
||||||
int mDest;
|
quint16 mDest;
|
||||||
XMaterialArgumentDef mDef;
|
XMaterialArgumentDef mDef;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@ -1,6 +1,4 @@
|
|||||||
#include "xmaterialtechnique.h"
|
#include "xmaterialtechnique.h"
|
||||||
#include "qdebug.h"
|
|
||||||
#include "qfiledevice.h"
|
|
||||||
|
|
||||||
XMaterialTechnique::XMaterialTechnique()
|
XMaterialTechnique::XMaterialTechnique()
|
||||||
: XAsset()
|
: XAsset()
|
||||||
@ -9,7 +7,7 @@ XMaterialTechnique::XMaterialTechnique()
|
|||||||
, mPassCount(0)
|
, mPassCount(0)
|
||||||
, mPassArray()
|
, mPassArray()
|
||||||
{
|
{
|
||||||
|
SetName("Material Technique");
|
||||||
}
|
}
|
||||||
|
|
||||||
XMaterialTechnique::~XMaterialTechnique()
|
XMaterialTechnique::~XMaterialTechnique()
|
||||||
@ -19,15 +17,23 @@ XMaterialTechnique::~XMaterialTechnique()
|
|||||||
|
|
||||||
void XMaterialTechnique::ParseData(QDataStream *aStream)
|
void XMaterialTechnique::ParseData(QDataStream *aStream)
|
||||||
{
|
{
|
||||||
mName.ParsePtr(aStream);
|
if (IsDebug())
|
||||||
|
{
|
||||||
qDebug() << aStream->device()->pos();
|
qDebug() << QString("[%1] Parsing data for %2").arg(aStream->device()->pos(), 10, 10, QChar('0')).arg(GetName());
|
||||||
|
}
|
||||||
|
mName.ParsePtr(aStream, false);
|
||||||
|
|
||||||
*aStream
|
*aStream
|
||||||
>> mFlags
|
>> mFlags
|
||||||
>> mPassCount;
|
>> mPassCount;
|
||||||
|
|
||||||
mPassArray = QVector<XMaterialPass>(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<XMaterialPass>(mPassCount);
|
||||||
|
|
||||||
for (int i = 0; i < mPassCount; i++)
|
for (int i = 0; i < mPassCount; i++)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -18,8 +18,8 @@ public:
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
XString mName;
|
XString mName;
|
||||||
int mFlags;
|
quint16 mFlags;
|
||||||
int mPassCount;
|
quint16 mPassCount;
|
||||||
QVector<XMaterialPass> mPassArray;
|
QVector<XMaterialPass> mPassArray;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user