Compare commits
131 Commits
2f044a8d94
...
ba83aa5247
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ba83aa5247 | ||
|
|
324e84eafc | ||
|
|
e290f2aca9 | ||
|
|
b13001ac90 | ||
|
|
1e24a2cc81 | ||
|
|
631dbdfa53 | ||
|
|
fbf295f2a8 | ||
|
|
00c84fd622 | ||
|
|
a8cee21ae8 | ||
|
|
48d7c3e692 | ||
|
|
c7291b567f | ||
|
|
ecb0e528c2 | ||
|
|
2de65b22ec | ||
|
|
a01d07ce41 | ||
|
|
348bf2a299 | ||
|
|
37c81d78ce | ||
|
|
33052d2e11 | ||
|
|
4603ebd7cf | ||
|
|
00f0a8a828 | ||
|
|
367e4e012e | ||
|
|
3bf4e8b0e5 | ||
|
|
39a5a75333 | ||
|
|
20f4dcd798 | ||
|
|
8398156122 | ||
|
|
8136ba1d34 | ||
|
|
2c18b939e7 | ||
|
|
01d2b95417 | ||
|
|
8cfb82e03d | ||
|
|
2d8d34bab8 | ||
|
|
6e772cb6b7 | ||
|
|
32ce8e350f | ||
|
|
73ab1a368a | ||
|
|
d9aa25c4af | ||
|
|
d18cfb6968 | ||
|
|
924e448270 | ||
|
|
4dc402fd16 | ||
|
|
8b802028e9 | ||
|
|
f6a20c873a | ||
|
|
4e4422466c | ||
|
|
3bf032d2e0 | ||
|
|
3d378b28c9 | ||
|
|
1f7ca563bf | ||
|
|
f6a0ff580c | ||
|
|
b9e858a6d5 | ||
|
|
f88eeec7ee | ||
|
|
9c6c55fe75 | ||
|
|
e6f2932ef1 | ||
|
|
8c1f9539c7 | ||
|
|
21379d133d | ||
|
|
6e58c8fc2f | ||
|
|
10db1eec7d | ||
|
|
d267ad19f5 | ||
|
|
99d2885f9c | ||
|
|
0545bfe642 | ||
|
|
7e408d2c2e | ||
|
|
512b9bae61 | ||
|
|
0f10bf9375 | ||
|
|
63468fa91e | ||
|
|
d9f6e13bdf | ||
|
|
e512636ad6 | ||
|
|
f2769e689f | ||
|
|
9898a03417 | ||
|
|
7174f1fe22 | ||
|
|
4480eb83d7 | ||
|
|
5ee673175c | ||
|
|
86885f999c | ||
|
|
2e4e0a6b99 | ||
|
|
338b50c694 | ||
|
|
20b57db193 | ||
|
|
7b61cff46d | ||
|
|
25728f9486 | ||
|
|
8e215f13af | ||
|
|
a71607aae3 | ||
|
|
2ae9bf95a4 | ||
|
|
08cf71cb02 | ||
|
|
8f3fa82f64 | ||
|
|
e40bee38af | ||
|
|
2799108c7d | ||
|
|
e1be487b6b | ||
|
|
383d6e2439 | ||
|
|
3452b73eb0 | ||
|
|
9dc45d3024 | ||
|
|
dc0a8a1e3d | ||
|
|
cf2102e182 | ||
|
|
6db6760a0a | ||
|
|
cdd0142759 | ||
|
|
4fbf77e661 | ||
|
|
8d31623138 | ||
|
|
acd14a2179 | ||
|
|
f09124f611 | ||
|
|
ead2e4eaf7 | ||
|
|
63ccc50de3 | ||
|
|
a753c24d9d | ||
|
|
d4bf2e0796 | ||
|
|
2472cd5d1b | ||
|
|
7bfe92eb9c | ||
|
|
990d413673 | ||
|
|
b4f677f81b | ||
|
|
59dfc3f05e | ||
|
|
3d409fc1d4 | ||
|
|
ab437b460f | ||
|
|
ff46687106 | ||
|
|
d7f099dc05 | ||
|
|
415156256a | ||
|
|
c799f53687 | ||
|
|
15ff5e65b1 | ||
|
|
a3769f0bad | ||
|
|
8a668620de | ||
|
|
935634c9e2 | ||
|
|
d13e227eb9 | ||
|
|
b977dbd183 | ||
|
|
15399a2969 | ||
|
|
bc3cc77a0a | ||
|
|
dcd6d9bf7b | ||
|
|
ddcb00676a | ||
|
|
73f9207839 | ||
|
|
bccbca87fa | ||
|
|
a24fec5558 | ||
|
|
c26ba7dcab | ||
|
|
cadcd2d53c | ||
|
|
7eca939c06 | ||
|
|
975567cdd4 | ||
|
|
2df2d491ae | ||
|
|
9b4852f393 | ||
|
|
f3d0abb65e | ||
|
|
9a5ae3bf51 | ||
|
|
d11783ebfc | ||
|
|
f5eebe6743 | ||
|
|
b8c7bdb1ba | ||
|
|
87bbe47e7e | ||
|
|
1ff6475fdb |
36
ai-commit.sh
Normal file
36
ai-commit.sh
Normal file
@ -0,0 +1,36 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
set -e
|
||||||
|
|
||||||
|
# 1. Stage everything
|
||||||
|
git add -A
|
||||||
|
|
||||||
|
# 2. Get list of staged files
|
||||||
|
FILES=$(git diff --cached --name-only)
|
||||||
|
|
||||||
|
if [ -z "$FILES" ]; then
|
||||||
|
echo "No changes to commit."
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
# 3. Loop file by file
|
||||||
|
for FILE in $FILES; do
|
||||||
|
# Get diff for this file
|
||||||
|
DIFF=$(git diff --cached -- "$FILE")
|
||||||
|
|
||||||
|
if [ -z "$DIFF" ]; then
|
||||||
|
continue
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Ask Ollama for a commit message describing this file change
|
||||||
|
MSG=$(echo "$DIFF" | ollama run gemma3 \
|
||||||
|
"You are a commit bot. Write a SHORT, clear, concise Git commit message for changes in file: $FILE.
|
||||||
|
Only output the commit message, nothing else.
|
||||||
|
Diff:
|
||||||
|
$DIFF")
|
||||||
|
|
||||||
|
# Commit just this file with its message
|
||||||
|
git commit -m "$MSG" -- "$FILE"
|
||||||
|
|
||||||
|
echo "✅ Committed $FILE with message:"
|
||||||
|
echo "$MSG"
|
||||||
|
done
|
||||||
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 \
|
||||||
|
|||||||
@ -789,7 +789,7 @@ int MainWindow::LoadFile_IPAK(const QString aFilePath) {
|
|||||||
|
|
||||||
QVector<IPAKIndexEntry> entries = QVector<IPAKIndexEntry>();
|
QVector<IPAKIndexEntry> entries = QVector<IPAKIndexEntry>();
|
||||||
QVector<IPAKSection> sections = QVector<IPAKSection>(header.sectionCount);
|
QVector<IPAKSection> sections = QVector<IPAKSection>(header.sectionCount);
|
||||||
for (uint i = 0; i < header.sectionCount; i++) {
|
for (quint32 i = 0; i < header.sectionCount; i++) {
|
||||||
IPAKSection currentSection;
|
IPAKSection currentSection;
|
||||||
stream >> currentSection;
|
stream >> currentSection;
|
||||||
sections << currentSection;
|
sections << currentSection;
|
||||||
@ -811,7 +811,7 @@ int MainWindow::LoadFile_IPAK(const QString aFilePath) {
|
|||||||
<< " - Count: " << chunkHeader.count << "\n"
|
<< " - Count: " << chunkHeader.count << "\n"
|
||||||
<< " - Offset: " << chunkHeader.offset;
|
<< " - Offset: " << chunkHeader.offset;
|
||||||
|
|
||||||
for (uint j = 0; j < 31; j++) {
|
for (quint32 j = 0; j < 31; j++) {
|
||||||
IPAKDataChunkCommand command;
|
IPAKDataChunkCommand command;
|
||||||
stream >> command;
|
stream >> command;
|
||||||
if (!command.size) { continue; }
|
if (!command.size) { continue; }
|
||||||
@ -821,7 +821,7 @@ int MainWindow::LoadFile_IPAK(const QString aFilePath) {
|
|||||||
<< " - Compressed: " << command.compressed;
|
<< " - Compressed: " << command.compressed;
|
||||||
|
|
||||||
}
|
}
|
||||||
for (uint j = 0; j < chunkHeader.count; j++) {
|
for (quint32 j = 0; j < chunkHeader.count; j++) {
|
||||||
auto command = chunkHeader.commands[j];
|
auto command = chunkHeader.commands[j];
|
||||||
|
|
||||||
qDebug() << "Reading from " << stream.device()->pos();
|
qDebug() << "Reading from " << stream.device()->pos();
|
||||||
@ -846,7 +846,7 @@ int MainWindow::LoadFile_IPAK(const QString aFilePath) {
|
|||||||
stream.skipRawData(sizeof(quint32) * (31 - chunkHeader.count));
|
stream.skipRawData(sizeof(quint32) * (31 - chunkHeader.count));
|
||||||
qDebug() << stream.device()->pos();
|
qDebug() << stream.device()->pos();
|
||||||
} else if (sectionType == "Index") {
|
} else if (sectionType == "Index") {
|
||||||
for (uint j = 0; j < currentSection.itemCount; j++) {
|
for (quint32 j = 0; j < currentSection.itemCount; j++) {
|
||||||
IPAKIndexEntry entry;
|
IPAKIndexEntry entry;
|
||||||
stream >> entry;
|
stream >> entry;
|
||||||
|
|
||||||
|
|||||||
@ -3,19 +3,27 @@
|
|||||||
|
|
||||||
MaterialViewer::MaterialViewer(QWidget *parent)
|
MaterialViewer::MaterialViewer(QWidget *parent)
|
||||||
: QWidget(parent)
|
: QWidget(parent)
|
||||||
, ui(new Ui::MaterialViewer) {
|
, ui(new Ui::MaterialViewer)
|
||||||
|
{
|
||||||
ui->setupUi(this);
|
ui->setupUi(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
MaterialViewer::~MaterialViewer() {
|
MaterialViewer::~MaterialViewer()
|
||||||
|
{
|
||||||
delete ui;
|
delete ui;
|
||||||
}
|
}
|
||||||
|
|
||||||
QString ToHexStr(quint32 in) {
|
QString ToHexStr(quint32 in)
|
||||||
|
{
|
||||||
return QString("%1").arg(in, 8, 16, QChar('0')).toUpper();
|
return QString("%1").arg(in, 8, 16, QChar('0')).toUpper();
|
||||||
}
|
}
|
||||||
|
|
||||||
void MaterialViewer::SetMaterial(const XMaterial* aMaterial) {
|
void MaterialViewer::SetMaterial(const XMaterial* aMaterial)
|
||||||
|
{
|
||||||
|
Q_UNUSED(aMaterial);
|
||||||
|
|
||||||
|
// TODO: Fill in MaterialViewer::SetMaterial
|
||||||
|
|
||||||
// ui->lineEdit_NamePtr->setText(ToHexStr(aMaterial->namePtr));
|
// ui->lineEdit_NamePtr->setText(ToHexStr(aMaterial->namePtr));
|
||||||
// ui->lineEdit_Name->setText(aMaterial->name);
|
// ui->lineEdit_Name->setText(aMaterial->name);
|
||||||
// ui->lineEdit_RefPtr->setText(ToHexStr(aMaterial->refNamePtr));
|
// ui->lineEdit_RefPtr->setText(ToHexStr(aMaterial->refNamePtr));
|
||||||
|
|||||||
@ -22,7 +22,7 @@ RumbleGraphViewer::~RumbleGraphViewer() {
|
|||||||
void RumbleGraphViewer::SetRumbleGraphFile(const XRawFile* aRawFile) {
|
void RumbleGraphViewer::SetRumbleGraphFile(const XRawFile* aRawFile) {
|
||||||
mRumbleGraphFile = aRawFile;
|
mRumbleGraphFile = aRawFile;
|
||||||
|
|
||||||
QDataStream rawFileStream;//(mRumbleGraphFile->contents.toLatin1());
|
XDataStream rawFileStream;//(mRumbleGraphFile->contents.toLatin1());
|
||||||
|
|
||||||
QByteArray magic(15, Qt::Uninitialized);
|
QByteArray magic(15, Qt::Uninitialized);
|
||||||
rawFileStream.readRawData(magic.data(), 15);
|
rawFileStream.readRawData(magic.data(), 15);
|
||||||
|
|||||||
@ -490,12 +490,12 @@ void XTreeWidget::PrepareContextMenu(const QPoint &pos) {
|
|||||||
});
|
});
|
||||||
QAction *exportZoneFileAction = new QAction("Export Zone File");
|
QAction *exportZoneFileAction = new QAction("Export Zone File");
|
||||||
exportSubmenu->addAction(exportZoneFileAction);
|
exportSubmenu->addAction(exportZoneFileAction);
|
||||||
connect(exportZoneFileAction, &QAction::triggered, this, [fastFile](bool checked) {
|
connect(exportZoneFileAction, &QAction::triggered, this, [](bool checked) {
|
||||||
Q_UNUSED(checked);
|
Q_UNUSED(checked);
|
||||||
|
|
||||||
const QString zoneFilePath = QFileDialog::getSaveFileName(
|
// const QString zoneFilePath = QFileDialog::getSaveFileName(
|
||||||
nullptr, "Export Zone File...", QDir::currentPath(),
|
// nullptr, "Export Zone File...", QDir::currentPath(),
|
||||||
"Zone File (*.zone);;All Files(*.*)");
|
// "Zone File (*.zone);;All Files(*.*)");
|
||||||
//fastFile->GetZoneFile()->SaveZoneFile(zoneFilePath);
|
//fastFile->GetZoneFile()->SaveZoneFile(zoneFilePath);
|
||||||
});
|
});
|
||||||
} else if (activeText.contains(".zone")) {
|
} else if (activeText.contains(".zone")) {
|
||||||
@ -508,7 +508,7 @@ void XTreeWidget::PrepareContextMenu(const QPoint &pos) {
|
|||||||
QMenu *exportSubmenu = new QMenu("Export...", this);
|
QMenu *exportSubmenu = new QMenu("Export...", this);
|
||||||
contextMenu->addMenu(exportSubmenu);
|
contextMenu->addMenu(exportSubmenu);
|
||||||
|
|
||||||
const ZoneFile* zoneFile = mZoneFiles[fileStem];
|
//const ZoneFile* zoneFile = mZoneFiles[fileStem];
|
||||||
|
|
||||||
QAction *exportZoneFileAction = new QAction("Export Zone File");
|
QAction *exportZoneFileAction = new QAction("Export Zone File");
|
||||||
exportSubmenu->addAction(exportZoneFileAction);
|
exportSubmenu->addAction(exportZoneFileAction);
|
||||||
@ -530,7 +530,7 @@ void XTreeWidget::PrepareContextMenu(const QPoint &pos) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (parentItem && parentItem != invisibleRootItem() && parentItem->text(0).contains(".zone")) {
|
if (parentItem && parentItem != invisibleRootItem() && parentItem->text(0).contains(".zone")) {
|
||||||
const QString fileStem = parentItem->text(0).section('.', 0, 0);
|
//const QString fileStem = parentItem->text(0).section('.', 0, 0);
|
||||||
// QVector<LoadedSound> LoadedSounds = mZoneFiles[fileStem]->GetAssetMap().sounds;
|
// QVector<LoadedSound> LoadedSounds = mZoneFiles[fileStem]->GetAssetMap().sounds;
|
||||||
// for (LoadedSound LoadedSound : LoadedSounds) {
|
// for (LoadedSound LoadedSound : LoadedSounds) {
|
||||||
// for (Sound sound : LoadedSound.sounds) {
|
// for (Sound sound : LoadedSound.sounds) {
|
||||||
@ -577,14 +577,14 @@ void XTreeWidget::PrepareContextMenu(const QPoint &pos) {
|
|||||||
}
|
}
|
||||||
if (parentItem && parentItem != invisibleRootItem() && parentItem->text(0).contains(".zone")) {
|
if (parentItem && parentItem != invisibleRootItem() && parentItem->text(0).contains(".zone")) {
|
||||||
const QString fileStem = parentItem->text(0).section('.', 0, 0);
|
const QString fileStem = parentItem->text(0).section('.', 0, 0);
|
||||||
auto zoneFile = mZoneFiles[fileStem];
|
//auto zoneFile = mZoneFiles[fileStem];
|
||||||
|
|
||||||
QMenu *exportSubmenu = new QMenu("Export...", this);
|
QMenu *exportSubmenu = new QMenu("Export...", this);
|
||||||
contextMenu->addMenu(exportSubmenu);
|
contextMenu->addMenu(exportSubmenu);
|
||||||
|
|
||||||
QAction *exportAllWAVAction = new QAction("Export ALL as WAV Files");
|
QAction *exportAllWAVAction = new QAction("Export ALL as WAV Files");
|
||||||
exportSubmenu->addAction(exportAllWAVAction);
|
exportSubmenu->addAction(exportAllWAVAction);
|
||||||
connect(exportAllWAVAction, &QAction::triggered, this, [zoneFile](bool checked) {
|
connect(exportAllWAVAction, &QAction::triggered, this, [](bool checked) {
|
||||||
Q_UNUSED(checked);
|
Q_UNUSED(checked);
|
||||||
|
|
||||||
// for (LoadedSound LoadedSound : zoneFile->GetAssetMap().sounds) {
|
// for (LoadedSound LoadedSound : zoneFile->GetAssetMap().sounds) {
|
||||||
|
|||||||
@ -1,73 +1,68 @@
|
|||||||
#include "compression.h"
|
#include "compression.h"
|
||||||
//#include "minilzo.h"
|
#include "minilzo.h"
|
||||||
|
#include "xcompress.h"
|
||||||
//#define XBOXAPI __declspec(dllimport)
|
|
||||||
//#include "xcompress.h"
|
|
||||||
|
|
||||||
#include <QLibrary>
|
#include <QLibrary>
|
||||||
#include <QDebug>
|
#include <QDebug>
|
||||||
#include <QFile>
|
#include <QFile>
|
||||||
#include <QDataStream>
|
|
||||||
|
|
||||||
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) {
|
||||||
@ -298,22 +293,22 @@ QByteArray Compression::CompressDeflateWithSettings(const QByteArray &aData, int
|
|||||||
|
|
||||||
QByteArray Compression::DecompressLZO(const QByteArray &aCompressedData, quint32 aDestSize) {
|
QByteArray Compression::DecompressLZO(const QByteArray &aCompressedData, quint32 aDestSize) {
|
||||||
QByteArray dst;
|
QByteArray dst;
|
||||||
// static bool ok = (lzo_init() == LZO_E_OK);
|
static bool ok = (lzo_init() == LZO_E_OK);
|
||||||
// if (!ok)
|
if (!ok)
|
||||||
// throw std::runtime_error("lzo_init failed");
|
throw std::runtime_error("lzo_init failed");
|
||||||
|
|
||||||
// dst = QByteArray(aDestSize, Qt::Uninitialized);
|
dst = QByteArray(aDestSize, Qt::Uninitialized);
|
||||||
// lzo_uint out = aDestSize;
|
lzo_uint out = aDestSize;
|
||||||
|
|
||||||
// int rc = lzo1x_decompress_safe(
|
int rc = lzo1x_decompress_safe(
|
||||||
// reinterpret_cast<const lzo_bytep>(aCompressedData.constData()),
|
reinterpret_cast<const lzo_bytep>(aCompressedData.constData()),
|
||||||
// static_cast<lzo_uint>(aCompressedData.size()),
|
static_cast<lzo_uint>(aCompressedData.size()),
|
||||||
// reinterpret_cast<lzo_bytep>(dst.data()),
|
reinterpret_cast<lzo_bytep>(dst.data()),
|
||||||
// &out,
|
&out,
|
||||||
// nullptr);
|
nullptr);
|
||||||
|
|
||||||
// if (rc != LZO_E_OK || out != aDestSize)
|
if (rc != LZO_E_OK || out != aDestSize)
|
||||||
// throw std::runtime_error("LZO decompression error");
|
throw std::runtime_error("LZO decompression error");
|
||||||
|
|
||||||
return dst;
|
return dst;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -3,13 +3,14 @@ TEMPLATE = lib
|
|||||||
CONFIG += staticlib c++17
|
CONFIG += staticlib c++17
|
||||||
DEFINES += MINILZO_USE_STATIC
|
DEFINES += MINILZO_USE_STATIC
|
||||||
|
|
||||||
SOURCES += $$files($$PWD/*.cpp, true)
|
SOURCES += $$files($$PWD/*.cpp, true) \
|
||||||
|
$$files($$PWD/*.c, true)
|
||||||
HEADERS += $$files($$PWD/*.h, true)
|
HEADERS += $$files($$PWD/*.h, true)
|
||||||
|
|
||||||
LIBS += \
|
LIBS += \
|
||||||
-L$$PWD/../../third_party/xbox_sdk/lib -lxcompress64 \
|
-L$$PWD/../../third_party/xbox_sdk/lib -lxcompress64 \
|
||||||
-L$$OUT_PWD/../libs/core -lcore \
|
-L$$OUT_PWD/../libs/core -lcore \
|
||||||
-L$$OUT_PWD/../libs/encryption -lencryption
|
-L$$OUT_PWD/../libs/encryption -lencryption
|
||||||
|
|
||||||
INCLUDEPATH += \
|
INCLUDEPATH += \
|
||||||
$$PWD/../../third_party/xbox_sdk/include \
|
$$PWD/../../third_party/xbox_sdk/include \
|
||||||
|
|||||||
@ -57,7 +57,7 @@
|
|||||||
|
|
||||||
/* get OS and architecture defines */
|
/* get OS and architecture defines */
|
||||||
#ifndef __LZODEFS_H_INCLUDED
|
#ifndef __LZODEFS_H_INCLUDED
|
||||||
#include <lzo/lzodefs.h>
|
#include <lzodefs.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -25,13 +25,6 @@
|
|||||||
http://www.oberhumer.com/opensource/lzo/
|
http://www.oberhumer.com/opensource/lzo/
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*
|
|
||||||
* NOTE:
|
|
||||||
* the full LZO package can be found at
|
|
||||||
* http://www.oberhumer.com/opensource/lzo/
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
|
||||||
#ifndef __MINILZO_H_INCLUDED
|
#ifndef __MINILZO_H_INCLUDED
|
||||||
#define __MINILZO_H_INCLUDED 1
|
#define __MINILZO_H_INCLUDED 1
|
||||||
|
|
||||||
|
|||||||
@ -2,8 +2,10 @@ QT += core widgets
|
|||||||
TEMPLATE = lib
|
TEMPLATE = lib
|
||||||
CONFIG += staticlib c++17
|
CONFIG += staticlib c++17
|
||||||
|
|
||||||
SOURCES += $$files($$PWD/*.cpp, true)
|
SOURCES += $$files($$PWD/*.cpp, true) \
|
||||||
HEADERS += $$files($$PWD/*.h, true)
|
xdatastream.cpp
|
||||||
|
HEADERS += $$files($$PWD/*.h, true) \
|
||||||
|
xdatastream.h
|
||||||
|
|
||||||
LIBS += -L$$OUT_PWD/../libs/xassets -lxassets
|
LIBS += -L$$OUT_PWD/../libs/xassets -lxassets
|
||||||
|
|
||||||
|
|||||||
@ -4,9 +4,9 @@
|
|||||||
#include <QString>
|
#include <QString>
|
||||||
|
|
||||||
enum IWI_VERSION {
|
enum IWI_VERSION {
|
||||||
IWI_VERSION_COD2 = 0x05, // 05 CoD2
|
IWI_VERSION_COD2 = 0x05, // 05 CoD2
|
||||||
IWI_VERSION_COD4 = 0x06, // 06 CoD4
|
IWI_VERSION_COD4 = 0x06, // 06 CoD4
|
||||||
IWI_VERSION_COD5 = 0x06, // 06 CoD5
|
IWI_VERSION_COD5 = 0x06, // 06 CoD5
|
||||||
IWI_VERSION_CODMW2 = 0x08, // 08 CoDMW2
|
IWI_VERSION_CODMW2 = 0x08, // 08 CoDMW2
|
||||||
IWI_VERSION_CODMW3 = 0x08, // 08 CoDMW3
|
IWI_VERSION_CODMW3 = 0x08, // 08 CoDMW3
|
||||||
IWI_VERSION_CODBO1 = 0x0D, // 13 CoDBO1
|
IWI_VERSION_CODBO1 = 0x0D, // 13 CoDBO1
|
||||||
@ -16,37 +16,37 @@ enum IWI_VERSION {
|
|||||||
enum IWI_FORMAT {
|
enum IWI_FORMAT {
|
||||||
// IWI Format
|
// IWI Format
|
||||||
IWI_FORMAT_ARGB32 = 0x01, // 01 ARGB32
|
IWI_FORMAT_ARGB32 = 0x01, // 01 ARGB32
|
||||||
IWI_FORMAT_RGB24 = 0x02, // 02 RGB24
|
IWI_FORMAT_RGB24 = 0x02, // 02 RGB24
|
||||||
IWI_FORMAT_GA16 = 0x03, // 03 GA16
|
IWI_FORMAT_GA16 = 0x03, // 03 GA16
|
||||||
IWI_FORMAT_A8 = 0x04, // 04 A8
|
IWI_FORMAT_A8 = 0x04, // 04 A8
|
||||||
IWI_FORMAT_DXT1 = 0x0B, // 11 DXT1
|
IWI_FORMAT_DXT1 = 0x0B, // 11 DXT1
|
||||||
IWI_FORMAT_DXT3 = 0x0C, // 12 DXT3
|
IWI_FORMAT_DXT3 = 0x0C, // 12 DXT3
|
||||||
IWI_FORMAT_DXT5 = 0x0D // 13 DXT5
|
IWI_FORMAT_DXT5 = 0x0D // 13 DXT5
|
||||||
};
|
};
|
||||||
|
|
||||||
enum DDS_FLAGS {
|
enum DDS_FLAGS {
|
||||||
DDSD_CAPS = 0x1,
|
DDSD_CAPS = 0x1,
|
||||||
DDSD_HEIGHT = 0x2,
|
DDSD_HEIGHT = 0x2,
|
||||||
DDSD_WIDTH = 0x4,
|
DDSD_WIDTH = 0x4,
|
||||||
DDSD_PITCH = 0x8,
|
DDSD_PITCH = 0x8,
|
||||||
DDSD_PIXELFORMAT = 0x1000,
|
DDSD_PIXELFORMAT = 0x1000,
|
||||||
DDSD_MIPMAPCOUNT = 0x20000,
|
DDSD_MIPMAPCOUNT = 0x20000,
|
||||||
DDSD_LINEARSIZE = 0x80000,
|
DDSD_LINEARSIZE = 0x80000,
|
||||||
DDSD_DEPTH = 0x800000
|
DDSD_DEPTH = 0x800000
|
||||||
};
|
};
|
||||||
|
|
||||||
enum DDS_PIXELFORMAT_FLAGS {
|
enum DDS_PIXELFORMAT_FLAGS {
|
||||||
DDPF_ALPHAPIXELS = 0x1,
|
DDPF_ALPHAPIXELS = 0x1,
|
||||||
DDPF_ALPHA = 0x2,
|
DDPF_ALPHA = 0x2,
|
||||||
DDPF_FOURCC = 0x4,
|
DDPF_FOURCC = 0x4,
|
||||||
DDPF_RGB = 0x40,
|
DDPF_RGB = 0x40,
|
||||||
DDPF_YUV = 0x200,
|
DDPF_YUV = 0x200,
|
||||||
DDPF_LUMINANCE = 0x20000
|
DDPF_LUMINANCE = 0x20000
|
||||||
};
|
};
|
||||||
|
|
||||||
enum DDS_CAPS_FLAGS {
|
enum DDS_CAPS_FLAGS {
|
||||||
DDSCAPS_COMPLEX = 0x8,
|
DDSCAPS_COMPLEX = 0x8,
|
||||||
DDSCAPS_MIPMAP = 0x400000,
|
DDSCAPS_MIPMAP = 0x400000,
|
||||||
DDSCAPS_TEXTURE = 0x1000
|
DDSCAPS_TEXTURE = 0x1000
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -189,15 +189,15 @@ enum MENU_ITEM_TYPE {
|
|||||||
ITEM_TYPE_RADIOBUTTON = 2, // toggle button, may be grouped
|
ITEM_TYPE_RADIOBUTTON = 2, // toggle button, may be grouped
|
||||||
ITEM_TYPE_CHECKBOX = 3, // check box
|
ITEM_TYPE_CHECKBOX = 3, // check box
|
||||||
ITEM_TYPE_EDITFIELD = 4, // editable text, associated with a dvar
|
ITEM_TYPE_EDITFIELD = 4, // editable text, associated with a dvar
|
||||||
ITEM_TYPE_COMBO = 5, // drop down list
|
ITEM_TYPE_COMBO = 5, // drop down list
|
||||||
ITEM_TYPE_LISTBOX = 6, // scrollable list
|
ITEM_TYPE_LISTBOX = 6, // scrollable list
|
||||||
ITEM_TYPE_MODEL = 7, // model
|
ITEM_TYPE_MODEL = 7, // model
|
||||||
ITEM_TYPE_OWNERDRAW = 8, // owner draw, name specs what it is
|
ITEM_TYPE_OWNERDRAW = 8, // owner draw, name specs what it is
|
||||||
ITEM_TYPE_NUMERICFIELD = 9, // editable text, associated with a dvar
|
ITEM_TYPE_NUMERICFIELD = 9, // editable text, associated with a dvar
|
||||||
ITEM_TYPE_SLIDER = 10, // mouse speed, volume, etc.
|
ITEM_TYPE_SLIDER = 10, // mouse speed, volume, etc.
|
||||||
ITEM_TYPE_YESNO = 11, // yes no dvar setting
|
ITEM_TYPE_YESNO = 11, // yes no dvar setting
|
||||||
ITEM_TYPE_MULTI = 12, // multiple list setting, enumerated
|
ITEM_TYPE_MULTI = 12, // multiple list setting, enumerated
|
||||||
ITEM_TYPE_DVARENUM = 13, // multiple list setting, enumerated from a dvar
|
ITEM_TYPE_DVARENUM = 13, // multiple list setting, enumerated from a dvar
|
||||||
ITEM_TYPE_BIND = 14, // bind
|
ITEM_TYPE_BIND = 14, // bind
|
||||||
ITEM_TYPE_MENUMODEL = 15, // special menu model
|
ITEM_TYPE_MENUMODEL = 15, // special menu model
|
||||||
ITEM_TYPE_VALIDFILEFIELD = 16, // text must be valid for use in a dos filename
|
ITEM_TYPE_VALIDFILEFIELD = 16, // text must be valid for use in a dos filename
|
||||||
|
|||||||
@ -223,7 +223,7 @@ public:
|
|||||||
|
|
||||||
return color;
|
return color;
|
||||||
}
|
}
|
||||||
static bool ReadUntilString(QDataStream* stream, const QString& targetString) {
|
static bool ReadUntilString(XDataStream* stream, const QString& targetString) {
|
||||||
if (!stream || targetString.isEmpty()) {
|
if (!stream || targetString.isEmpty()) {
|
||||||
return false; // Invalid input
|
return false; // Invalid input
|
||||||
}
|
}
|
||||||
@ -257,7 +257,7 @@ public:
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool ReadUntilHex(QDataStream* stream, const QString& hexString) {
|
static bool ReadUntilHex(XDataStream* stream, const QString& hexString) {
|
||||||
if (!stream || hexString.isEmpty() || hexString.size() % 2 != 0) {
|
if (!stream || hexString.isEmpty() || hexString.size() % 2 != 0) {
|
||||||
return false; // Invalid input
|
return false; // Invalid input
|
||||||
}
|
}
|
||||||
|
|||||||
225
libs/core/xdatastream.cpp
Normal file
225
libs/core/xdatastream.cpp
Normal file
@ -0,0 +1,225 @@
|
|||||||
|
#include "xdatastream.h"
|
||||||
|
|
||||||
|
#include <QIODevice>
|
||||||
|
#include <QDebug>
|
||||||
|
|
||||||
|
XDataStream::XDataStream(QIODevice *aDevice)
|
||||||
|
: QDataStream(aDevice)
|
||||||
|
, mDebug(false)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
XDataStream::XDataStream()
|
||||||
|
: QDataStream()
|
||||||
|
, mDebug(false)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
XDataStream::XDataStream(const QByteArray &aData)
|
||||||
|
: QDataStream(aData)
|
||||||
|
, mDebug(false)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
XDataStream::XDataStream(QByteArray *aData, OpenMode aFlags)
|
||||||
|
: QDataStream(aData, aFlags)
|
||||||
|
, mDebug(false)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
XDataStream::~XDataStream()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
void XDataStream::SetDebug(bool aDebug)
|
||||||
|
{
|
||||||
|
mDebug = aDebug;
|
||||||
|
}
|
||||||
|
|
||||||
|
qint8 XDataStream::ParseInt8(const QString& aDebugString)
|
||||||
|
{
|
||||||
|
qint64 start = this->device()->pos();
|
||||||
|
|
||||||
|
qint8 val;
|
||||||
|
*this >> val;
|
||||||
|
|
||||||
|
if (mDebug)
|
||||||
|
{
|
||||||
|
qDebug() << QString("[%1-%2] Parsed %3: %4")
|
||||||
|
.arg(start, 10, 10, QChar('0'))
|
||||||
|
.arg(this->device()->pos(), 10, 10, QChar('0'))
|
||||||
|
.arg(aDebugString)
|
||||||
|
.arg(val);
|
||||||
|
}
|
||||||
|
return val;
|
||||||
|
}
|
||||||
|
|
||||||
|
quint8 XDataStream::ParseUInt8(const QString& aDebugString)
|
||||||
|
{
|
||||||
|
qint64 start = this->device()->pos();
|
||||||
|
|
||||||
|
quint8 val;
|
||||||
|
*this >> val;
|
||||||
|
|
||||||
|
if (mDebug)
|
||||||
|
{
|
||||||
|
qDebug() << QString("[%1-%2] Parsed %3: %4")
|
||||||
|
.arg(start, 10, 10, QChar('0'))
|
||||||
|
.arg(this->device()->pos(), 10, 10, QChar('0'))
|
||||||
|
.arg(aDebugString)
|
||||||
|
.arg(val);
|
||||||
|
}
|
||||||
|
return val;
|
||||||
|
}
|
||||||
|
|
||||||
|
qint16 XDataStream::ParseInt16(const QString& aDebugString)
|
||||||
|
{
|
||||||
|
qint64 start = this->device()->pos();
|
||||||
|
|
||||||
|
qint16 val;
|
||||||
|
*this >> val;
|
||||||
|
|
||||||
|
if (mDebug)
|
||||||
|
{
|
||||||
|
qDebug() << QString("[%1-%2] Parsed %3: %4")
|
||||||
|
.arg(start, 10, 10, QChar('0'))
|
||||||
|
.arg(this->device()->pos(), 10, 10, QChar('0'))
|
||||||
|
.arg(aDebugString)
|
||||||
|
.arg(val);
|
||||||
|
}
|
||||||
|
return val;
|
||||||
|
}
|
||||||
|
|
||||||
|
quint16 XDataStream::ParseUInt16(const QString& aDebugString)
|
||||||
|
{
|
||||||
|
qint64 start = this->device()->pos();
|
||||||
|
|
||||||
|
quint16 val;
|
||||||
|
*this >> val;
|
||||||
|
|
||||||
|
if (mDebug)
|
||||||
|
{
|
||||||
|
qDebug() << QString("[%1-%2] Parsed %3: %4")
|
||||||
|
.arg(start, 10, 10, QChar('0'))
|
||||||
|
.arg(this->device()->pos(), 10, 10, QChar('0'))
|
||||||
|
.arg(aDebugString)
|
||||||
|
.arg(val);
|
||||||
|
}
|
||||||
|
return val;
|
||||||
|
}
|
||||||
|
|
||||||
|
qint32 XDataStream::ParseInt32(const QString& aDebugString)
|
||||||
|
{
|
||||||
|
qint64 start = this->device()->pos();
|
||||||
|
|
||||||
|
qint32 val;
|
||||||
|
*this >> val;
|
||||||
|
|
||||||
|
if (mDebug)
|
||||||
|
{
|
||||||
|
qDebug() << QString("[%1-%2] Parsed %3: %4")
|
||||||
|
.arg(start, 10, 10, QChar('0'))
|
||||||
|
.arg(this->device()->pos(), 10, 10, QChar('0'))
|
||||||
|
.arg(aDebugString)
|
||||||
|
.arg(val);
|
||||||
|
}
|
||||||
|
return val;
|
||||||
|
}
|
||||||
|
|
||||||
|
quint32 XDataStream::ParseUInt32(const QString& aDebugString)
|
||||||
|
{
|
||||||
|
qint64 start = this->device()->pos();
|
||||||
|
|
||||||
|
quint32 val;
|
||||||
|
*this >> val;
|
||||||
|
|
||||||
|
if (mDebug)
|
||||||
|
{
|
||||||
|
qDebug() << QString("[%1-%2] Parsed %3: %4")
|
||||||
|
.arg(start, 10, 10, QChar('0'))
|
||||||
|
.arg(this->device()->pos(), 10, 10, QChar('0'))
|
||||||
|
.arg(aDebugString)
|
||||||
|
.arg(val);
|
||||||
|
}
|
||||||
|
return val;
|
||||||
|
}
|
||||||
|
|
||||||
|
qint64 XDataStream::ParseInt64(const QString& aDebugString)
|
||||||
|
{
|
||||||
|
qint64 start = this->device()->pos();
|
||||||
|
|
||||||
|
qint64 val;
|
||||||
|
*this >> val;
|
||||||
|
|
||||||
|
if (mDebug)
|
||||||
|
{
|
||||||
|
qDebug() << QString("[%1-%2] Parsed %3: %4")
|
||||||
|
.arg(start, 10, 10, QChar('0'))
|
||||||
|
.arg(this->device()->pos(), 10, 10, QChar('0'))
|
||||||
|
.arg(aDebugString)
|
||||||
|
.arg(val);
|
||||||
|
}
|
||||||
|
return val;
|
||||||
|
}
|
||||||
|
|
||||||
|
quint64 XDataStream::ParseUInt64(const QString& aDebugString)
|
||||||
|
{
|
||||||
|
qint64 start = this->device()->pos();
|
||||||
|
|
||||||
|
quint64 val;
|
||||||
|
*this >> val;
|
||||||
|
|
||||||
|
if (mDebug)
|
||||||
|
{
|
||||||
|
qDebug() << QString("[%1-%2] Parsed %3: %4")
|
||||||
|
.arg(start, 10, 10, QChar('0'))
|
||||||
|
.arg(this->device()->pos(), 10, 10, QChar('0'))
|
||||||
|
.arg(aDebugString)
|
||||||
|
.arg(val);
|
||||||
|
}
|
||||||
|
return val;
|
||||||
|
}
|
||||||
|
|
||||||
|
float XDataStream::ParseSingle(const QString& aDebugString)
|
||||||
|
{
|
||||||
|
qint64 start = this->device()->pos();
|
||||||
|
|
||||||
|
|
||||||
|
float val;
|
||||||
|
quint32 rawVal;
|
||||||
|
*this >> rawVal;
|
||||||
|
memcpy(&val, &rawVal, sizeof(val));
|
||||||
|
|
||||||
|
if (mDebug)
|
||||||
|
{
|
||||||
|
qDebug() << QString("[%1-%2] Parsed %3: %4")
|
||||||
|
.arg(start, 10, 10, QChar('0'))
|
||||||
|
.arg(this->device()->pos(), 10, 10, QChar('0'))
|
||||||
|
.arg(aDebugString)
|
||||||
|
.arg(val);
|
||||||
|
}
|
||||||
|
return val;
|
||||||
|
}
|
||||||
|
|
||||||
|
double XDataStream::ParseDouble(const QString& aDebugString)
|
||||||
|
{
|
||||||
|
qint64 start = this->device()->pos();
|
||||||
|
|
||||||
|
float val;
|
||||||
|
*this >> val;
|
||||||
|
|
||||||
|
if (mDebug)
|
||||||
|
{
|
||||||
|
qDebug() << QString("[%1-%2] Parsed %3: %4")
|
||||||
|
.arg(start, 10, 10, QChar('0'))
|
||||||
|
.arg(this->device()->pos(), 10, 10, QChar('0'))
|
||||||
|
.arg(aDebugString)
|
||||||
|
.arg(val);
|
||||||
|
}
|
||||||
|
return val;
|
||||||
|
}
|
||||||
33
libs/core/xdatastream.h
Normal file
33
libs/core/xdatastream.h
Normal file
@ -0,0 +1,33 @@
|
|||||||
|
#ifndef XDATASTREAM_H
|
||||||
|
#define XDATASTREAM_H
|
||||||
|
|
||||||
|
#include <QDataStream>
|
||||||
|
#include <QString>
|
||||||
|
|
||||||
|
class XDataStream : public QDataStream
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
explicit XDataStream(QIODevice* aDevice);
|
||||||
|
XDataStream();
|
||||||
|
XDataStream(const QByteArray& aData);
|
||||||
|
XDataStream(QByteArray* aData, OpenMode aFlags);
|
||||||
|
~XDataStream();
|
||||||
|
|
||||||
|
void SetDebug(bool aDebug = true);
|
||||||
|
|
||||||
|
qint8 ParseInt8(const QString& aDebugString = "");
|
||||||
|
quint8 ParseUInt8(const QString& aDebugString = "");
|
||||||
|
qint16 ParseInt16(const QString& aDebugString = "");
|
||||||
|
quint16 ParseUInt16(const QString& aDebugString = "");
|
||||||
|
qint32 ParseInt32(const QString& aDebugString = "");
|
||||||
|
quint32 ParseUInt32(const QString& aDebugString = "");
|
||||||
|
qint64 ParseInt64(const QString& aDebugString = "");
|
||||||
|
quint64 ParseUInt64(const QString& aDebugString = "");
|
||||||
|
float ParseSingle(const QString& aDebugString = "");
|
||||||
|
double ParseDouble(const QString& aDebugString = "");
|
||||||
|
|
||||||
|
private:
|
||||||
|
bool mDebug;
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // XDATASTREAM_H
|
||||||
@ -24,9 +24,9 @@ enum FF_GAME {
|
|||||||
};
|
};
|
||||||
|
|
||||||
enum IWI_VERSION {
|
enum IWI_VERSION {
|
||||||
IWI_VERSION_COD2 = 0x05, // 05 CoD2
|
IWI_VERSION_COD2 = 0x05, // 05 CoD2
|
||||||
IWI_VERSION_COD4 = 0x06, // 06 CoD4
|
IWI_VERSION_COD4 = 0x06, // 06 CoD4
|
||||||
IWI_VERSION_COD5 = 0x06, // 06 CoD5
|
IWI_VERSION_COD5 = 0x06, // 06 CoD5
|
||||||
IWI_VERSION_CODMW2 = 0x08, // 08 CoDMW2
|
IWI_VERSION_CODMW2 = 0x08, // 08 CoDMW2
|
||||||
IWI_VERSION_CODMW3 = 0x08, // 08 CoDMW3
|
IWI_VERSION_CODMW3 = 0x08, // 08 CoDMW3
|
||||||
IWI_VERSION_CODBO1 = 0x0D, // 13 CoDBO1
|
IWI_VERSION_CODBO1 = 0x0D, // 13 CoDBO1
|
||||||
@ -36,37 +36,37 @@ enum IWI_VERSION {
|
|||||||
enum IWI_FORMAT {
|
enum IWI_FORMAT {
|
||||||
// IWI Format
|
// IWI Format
|
||||||
IWI_FORMAT_ARGB32 = 0x01, // 01 ARGB32
|
IWI_FORMAT_ARGB32 = 0x01, // 01 ARGB32
|
||||||
IWI_FORMAT_RGB24 = 0x02, // 02 RGB24
|
IWI_FORMAT_RGB24 = 0x02, // 02 RGB24
|
||||||
IWI_FORMAT_GA16 = 0x03, // 03 GA16
|
IWI_FORMAT_GA16 = 0x03, // 03 GA16
|
||||||
IWI_FORMAT_A8 = 0x04, // 04 A8
|
IWI_FORMAT_A8 = 0x04, // 04 A8
|
||||||
IWI_FORMAT_DXT1 = 0x0B, // 11 DXT1
|
IWI_FORMAT_DXT1 = 0x0B, // 11 DXT1
|
||||||
IWI_FORMAT_DXT3 = 0x0C, // 12 DXT3
|
IWI_FORMAT_DXT3 = 0x0C, // 12 DXT3
|
||||||
IWI_FORMAT_DXT5 = 0x0D // 13 DXT5
|
IWI_FORMAT_DXT5 = 0x0D // 13 DXT5
|
||||||
};
|
};
|
||||||
|
|
||||||
enum DDS_FLAGS {
|
enum DDS_FLAGS {
|
||||||
DDSD_CAPS = 0x1,
|
DDSD_CAPS = 0x1,
|
||||||
DDSD_HEIGHT = 0x2,
|
DDSD_HEIGHT = 0x2,
|
||||||
DDSD_WIDTH = 0x4,
|
DDSD_WIDTH = 0x4,
|
||||||
DDSD_PITCH = 0x8,
|
DDSD_PITCH = 0x8,
|
||||||
DDSD_PIXELFORMAT = 0x1000,
|
DDSD_PIXELFORMAT = 0x1000,
|
||||||
DDSD_MIPMAPCOUNT = 0x20000,
|
DDSD_MIPMAPCOUNT = 0x20000,
|
||||||
DDSD_LINEARSIZE = 0x80000,
|
DDSD_LINEARSIZE = 0x80000,
|
||||||
DDSD_DEPTH = 0x800000
|
DDSD_DEPTH = 0x800000
|
||||||
};
|
};
|
||||||
|
|
||||||
enum DDS_PIXELFORMAT_FLAGS {
|
enum DDS_PIXELFORMAT_FLAGS {
|
||||||
DDPF_ALPHAPIXELS = 0x1,
|
DDPF_ALPHAPIXELS = 0x1,
|
||||||
DDPF_ALPHA = 0x2,
|
DDPF_ALPHA = 0x2,
|
||||||
DDPF_FOURCC = 0x4,
|
DDPF_FOURCC = 0x4,
|
||||||
DDPF_RGB = 0x40,
|
DDPF_RGB = 0x40,
|
||||||
DDPF_YUV = 0x200,
|
DDPF_YUV = 0x200,
|
||||||
DDPF_LUMINANCE = 0x20000
|
DDPF_LUMINANCE = 0x20000
|
||||||
};
|
};
|
||||||
|
|
||||||
enum DDS_CAPS_FLAGS {
|
enum DDS_CAPS_FLAGS {
|
||||||
DDSCAPS_COMPLEX = 0x8,
|
DDSCAPS_COMPLEX = 0x8,
|
||||||
DDSCAPS_MIPMAP = 0x400000,
|
DDSCAPS_MIPMAP = 0x400000,
|
||||||
DDSCAPS_TEXTURE = 0x1000
|
DDSCAPS_TEXTURE = 0x1000
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -209,15 +209,15 @@ enum MENU_ITEM_TYPE {
|
|||||||
ITEM_TYPE_RADIOBUTTON = 2, // toggle button, may be grouped
|
ITEM_TYPE_RADIOBUTTON = 2, // toggle button, may be grouped
|
||||||
ITEM_TYPE_CHECKBOX = 3, // check box
|
ITEM_TYPE_CHECKBOX = 3, // check box
|
||||||
ITEM_TYPE_EDITFIELD = 4, // editable text, associated with a dvar
|
ITEM_TYPE_EDITFIELD = 4, // editable text, associated with a dvar
|
||||||
ITEM_TYPE_COMBO = 5, // drop down list
|
ITEM_TYPE_COMBO = 5, // drop down list
|
||||||
ITEM_TYPE_LISTBOX = 6, // scrollable list
|
ITEM_TYPE_LISTBOX = 6, // scrollable list
|
||||||
ITEM_TYPE_MODEL = 7, // model
|
ITEM_TYPE_MODEL = 7, // model
|
||||||
ITEM_TYPE_OWNERDRAW = 8, // owner draw, name specs what it is
|
ITEM_TYPE_OWNERDRAW = 8, // owner draw, name specs what it is
|
||||||
ITEM_TYPE_NUMERICFIELD = 9, // editable text, associated with a dvar
|
ITEM_TYPE_NUMERICFIELD = 9, // editable text, associated with a dvar
|
||||||
ITEM_TYPE_SLIDER = 10, // mouse speed, volume, etc.
|
ITEM_TYPE_SLIDER = 10, // mouse speed, volume, etc.
|
||||||
ITEM_TYPE_YESNO = 11, // yes no dvar setting
|
ITEM_TYPE_YESNO = 11, // yes no dvar setting
|
||||||
ITEM_TYPE_MULTI = 12, // multiple list setting, enumerated
|
ITEM_TYPE_MULTI = 12, // multiple list setting, enumerated
|
||||||
ITEM_TYPE_DVARENUM = 13, // multiple list setting, enumerated from a dvar
|
ITEM_TYPE_DVARENUM = 13, // multiple list setting, enumerated from a dvar
|
||||||
ITEM_TYPE_BIND = 14, // bind
|
ITEM_TYPE_BIND = 14, // bind
|
||||||
ITEM_TYPE_MENUMODEL = 15, // special menu model
|
ITEM_TYPE_MENUMODEL = 15, // special menu model
|
||||||
ITEM_TYPE_VALIDFILEFIELD = 16, // text must be valid for use in a dos filename
|
ITEM_TYPE_VALIDFILEFIELD = 16, // text must be valid for use in a dos filename
|
||||||
|
|||||||
@ -1,15 +1,5 @@
|
|||||||
/* ecrypt-portable.h */
|
/* ecrypt-portable.h */
|
||||||
|
|
||||||
/*
|
|
||||||
* WARNING: the conversions defined below are implemented as macros,
|
|
||||||
* and should be used carefully. They should NOT be used with
|
|
||||||
* parameters which perform some action. E.g., the following two lines
|
|
||||||
* are not equivalent:
|
|
||||||
*
|
|
||||||
* 1) ++x; y = ROTL32(x, n);
|
|
||||||
* 2) y = ROTL32(++x, n);
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* *** Please do not edit this file. ***
|
* *** Please do not edit this file. ***
|
||||||
*
|
*
|
||||||
|
|||||||
@ -31,7 +31,7 @@ QByteArray Encryption::InitIVTable(const QByteArray &feed) {
|
|||||||
if (static_cast<uchar>(feed.at(ptr)) == 0x00)
|
if (static_cast<uchar>(feed.at(ptr)) == 0x00)
|
||||||
ptr = 0;
|
ptr = 0;
|
||||||
int base = i * 20 + x * 4;
|
int base = i * 20 + x * 4;
|
||||||
table[base] = feed.at(ptr);
|
table[base] = feed.at(ptr);
|
||||||
table[base + 1] = feed.at(ptr);
|
table[base + 1] = feed.at(ptr);
|
||||||
table[base + 2] = feed.at(ptr);
|
table[base + 2] = feed.at(ptr);
|
||||||
table[base + 3] = feed.at(ptr);
|
table[base + 3] = feed.at(ptr);
|
||||||
@ -77,7 +77,7 @@ void Encryption::UpdateIVTable(QByteArray &table, int index, const QByteArray &s
|
|||||||
int hashIndex = 0;
|
int hashIndex = 0;
|
||||||
for (int x = 0; x < 4; ++x) {
|
for (int x = 0; x < 4; ++x) {
|
||||||
table[startIndex - 1] = table.at(startIndex - 1) ^ sectionHash.at(hashIndex);
|
table[startIndex - 1] = table.at(startIndex - 1) ^ sectionHash.at(hashIndex);
|
||||||
table[startIndex] = table.at(startIndex) ^ sectionHash.at(hashIndex + 1);
|
table[startIndex] = table.at(startIndex) ^ sectionHash.at(hashIndex + 1);
|
||||||
table[startIndex + 1] = table.at(startIndex + 1) ^ sectionHash.at(hashIndex + 2);
|
table[startIndex + 1] = table.at(startIndex + 1) ^ sectionHash.at(hashIndex + 2);
|
||||||
table[startIndex + 2] = table.at(startIndex + 2) ^ sectionHash.at(hashIndex + 3);
|
table[startIndex + 2] = table.at(startIndex + 2) ^ sectionHash.at(hashIndex + 3);
|
||||||
table[startIndex + 3] = table.at(startIndex + 3) ^ sectionHash.at(hashIndex + 4);
|
table[startIndex + 3] = table.at(startIndex + 3) ^ sectionHash.at(hashIndex + 4);
|
||||||
|
|||||||
@ -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];
|
||||||
int i;
|
u32 i;
|
||||||
|
|
||||||
if (!bytes) return;
|
if (!bytes) return;
|
||||||
|
|
||||||
@ -82,7 +82,10 @@ void ECRYPT_encrypt_bytes(ECRYPT_ctx *x,const u8 *m,u8 *c,u32 bytes)
|
|||||||
|
|
||||||
for (;;) {
|
for (;;) {
|
||||||
if (bytes < 64) {
|
if (bytes < 64) {
|
||||||
for (i = 0;i < bytes;++i) tmp[i] = m[i];
|
for (i = 0; i < bytes; ++i)
|
||||||
|
{
|
||||||
|
tmp[i] = m[i];
|
||||||
|
}
|
||||||
m = tmp;
|
m = tmp;
|
||||||
ctarget = c;
|
ctarget = c;
|
||||||
c = tmp;
|
c = tmp;
|
||||||
|
|||||||
@ -94,7 +94,6 @@ void SHA1_Transform(uint32_t state[5], const uint8_t buffer[64]);
|
|||||||
|
|
||||||
/* blk0() and blk() perform the initial expand. */
|
/* blk0() and blk() perform the initial expand. */
|
||||||
/* I got the idea of expanding during the round function from SSLeay */
|
/* I got the idea of expanding during the round function from SSLeay */
|
||||||
/* FIXME: can we do this in an endian-proof way? */
|
|
||||||
#ifdef WORDS_BIGENDIAN
|
#ifdef WORDS_BIGENDIAN
|
||||||
#define blk0(i) block->l[i]
|
#define blk0(i) block->l[i]
|
||||||
#else
|
#else
|
||||||
|
|||||||
@ -69,12 +69,12 @@ bool FastFile_COD10_360::Load(const QString aFilePath) {
|
|||||||
bool FastFile_COD10_360::Load(const QByteArray aData) {
|
bool FastFile_COD10_360::Load(const QByteArray aData) {
|
||||||
QByteArray decompressedData;
|
QByteArray decompressedData;
|
||||||
|
|
||||||
// Create a QDataStream on the input data.
|
// Create a XDataStream on the input data.
|
||||||
QDataStream fastFileStream(aData);
|
XDataStream fastFileStream(aData);
|
||||||
fastFileStream.setByteOrder(QDataStream::LittleEndian);
|
fastFileStream.setByteOrder(XDataStream::LittleEndian);
|
||||||
|
|
||||||
// For COD7/COD9, use BigEndian.
|
// For COD7/COD9, use BigEndian.
|
||||||
fastFileStream.setByteOrder(QDataStream::BigEndian);
|
fastFileStream.setByteOrder(XDataStream::BigEndian);
|
||||||
|
|
||||||
// Select key based on game.
|
// Select key based on game.
|
||||||
QByteArray key = QByteArray::fromHex("0E50F49F412317096038665622DD091332A209BA0A05A00E1377CEDB0A3CB1D3");
|
QByteArray key = QByteArray::fromHex("0E50F49F412317096038665622DD091332A209BA0A05A00E1377CEDB0A3CB1D3");
|
||||||
|
|||||||
@ -72,8 +72,8 @@ bool FastFile_COD11_360::Load(const QByteArray aData) {
|
|||||||
QByteArray decompressedData;
|
QByteArray decompressedData;
|
||||||
|
|
||||||
// Prepare data stream for parsing
|
// Prepare data stream for parsing
|
||||||
QDataStream fastFileStream(aData);
|
XDataStream fastFileStream(aData);
|
||||||
fastFileStream.setByteOrder(QDataStream::LittleEndian);
|
fastFileStream.setByteOrder(XDataStream::LittleEndian);
|
||||||
|
|
||||||
// Verify magic header
|
// Verify magic header
|
||||||
QByteArray fileMagic(8, Qt::Uninitialized);
|
QByteArray fileMagic(8, Qt::Uninitialized);
|
||||||
|
|||||||
@ -72,8 +72,8 @@ bool FastFile_COD12_360::Load(const QByteArray aData) {
|
|||||||
QByteArray decompressedData;
|
QByteArray decompressedData;
|
||||||
|
|
||||||
// Prepare data stream for parsing
|
// Prepare data stream for parsing
|
||||||
QDataStream fastFileStream(aData);
|
XDataStream fastFileStream(aData);
|
||||||
fastFileStream.setByteOrder(QDataStream::LittleEndian);
|
fastFileStream.setByteOrder(XDataStream::LittleEndian);
|
||||||
|
|
||||||
// Verify magic header
|
// Verify magic header
|
||||||
QByteArray fileMagic(8, Qt::Uninitialized);
|
QByteArray fileMagic(8, Qt::Uninitialized);
|
||||||
|
|||||||
@ -68,9 +68,9 @@ bool FastFile_COD2_360::Load(const QString aFilePath) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool FastFile_COD2_360::Load(const QByteArray aData) {
|
bool FastFile_COD2_360::Load(const QByteArray aData) {
|
||||||
// Create a QDataStream on the input data.
|
// Create a XDataStream on the input data.
|
||||||
QDataStream fastFileStream(aData);
|
XDataStream fastFileStream(aData);
|
||||||
fastFileStream.setByteOrder(QDataStream::LittleEndian);
|
fastFileStream.setByteOrder(XDataStream::LittleEndian);
|
||||||
|
|
||||||
Utils::ReadUntilHex(&fastFileStream, "78");
|
Utils::ReadUntilHex(&fastFileStream, "78");
|
||||||
QByteArray compressedData = aData.mid(fastFileStream.device()->pos());
|
QByteArray compressedData = aData.mid(fastFileStream.device()->pos());
|
||||||
|
|||||||
@ -80,9 +80,9 @@ bool FastFile_COD4_360::Load(const QByteArray aData) {
|
|||||||
// For COD5, simply decompress from offset 12.
|
// For COD5, simply decompress from offset 12.
|
||||||
decompressedData = Compression::DecompressZLIB(aData.mid(12));
|
decompressedData = Compression::DecompressZLIB(aData.mid(12));
|
||||||
} else if (header == "IWff0100") {
|
} else if (header == "IWff0100") {
|
||||||
// Create a QDataStream on the input data.
|
// Create a XDataStream on the input data.
|
||||||
QDataStream fastFileStream(aData.mid(12));
|
XDataStream fastFileStream(aData.mid(12));
|
||||||
fastFileStream.setByteOrder(QDataStream::LittleEndian);
|
fastFileStream.setByteOrder(XDataStream::LittleEndian);
|
||||||
|
|
||||||
QByteArray magic(8, Qt::Uninitialized);
|
QByteArray magic(8, Qt::Uninitialized);
|
||||||
fastFileStream.readRawData(magic.data(), 8);
|
fastFileStream.readRawData(magic.data(), 8);
|
||||||
|
|||||||
@ -83,7 +83,7 @@ bool FastFile_COD6_360::Load(const QByteArray aData) {
|
|||||||
if (decompressedData.isEmpty() || decompressedData.size() < 1024)
|
if (decompressedData.isEmpty() || decompressedData.size() < 1024)
|
||||||
{
|
{
|
||||||
QByteArray stripped = Compression::StripHashBlocks(compressed);
|
QByteArray stripped = Compression::StripHashBlocks(compressed);
|
||||||
QByteArray retry = Compression::DecompressZLIB(stripped);
|
QByteArray retry = Compression::DecompressZLIB(stripped);
|
||||||
if (!retry.isEmpty())
|
if (!retry.isEmpty())
|
||||||
decompressedData.swap(retry);
|
decompressedData.swap(retry);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -71,12 +71,12 @@ bool FastFile_COD7_360::Load(const QString aFilePath) {
|
|||||||
bool FastFile_COD7_360::Load(const QByteArray aData) {
|
bool FastFile_COD7_360::Load(const QByteArray aData) {
|
||||||
QByteArray decompressedData;
|
QByteArray decompressedData;
|
||||||
|
|
||||||
// Create a QDataStream on the input data.
|
// Create a XDataStream on the input data.
|
||||||
QDataStream fastFileStream(aData);
|
XDataStream fastFileStream(aData);
|
||||||
fastFileStream.skipRawData(12);
|
fastFileStream.skipRawData(12);
|
||||||
|
|
||||||
// For COD7/COD9, use BigEndian.
|
// For COD7/COD9, use BigEndian.
|
||||||
fastFileStream.setByteOrder(QDataStream::BigEndian);
|
fastFileStream.setByteOrder(XDataStream::BigEndian);
|
||||||
|
|
||||||
// Select key based on game.
|
// Select key based on game.
|
||||||
QByteArray key = QByteArray::fromHex("1ac1d12d527c59b40eca619120ff8217ccff09cd16896f81b829c7f52793405d");
|
QByteArray key = QByteArray::fromHex("1ac1d12d527c59b40eca619120ff8217ccff09cd16896f81b829c7f52793405d");
|
||||||
|
|||||||
@ -69,12 +69,12 @@ bool FastFile_COD8_360::Load(const QString aFilePath) {
|
|||||||
bool FastFile_COD8_360::Load(const QByteArray aData) {
|
bool FastFile_COD8_360::Load(const QByteArray aData) {
|
||||||
QByteArray decompressedData;
|
QByteArray decompressedData;
|
||||||
|
|
||||||
// Create a QDataStream on the input data.
|
// Create a XDataStream on the input data.
|
||||||
QDataStream fastFileStream(aData);
|
XDataStream fastFileStream(aData);
|
||||||
fastFileStream.setByteOrder(QDataStream::LittleEndian);
|
fastFileStream.setByteOrder(XDataStream::LittleEndian);
|
||||||
|
|
||||||
// For COD7/COD9, use BigEndian.
|
// For COD7/COD9, use BigEndian.
|
||||||
fastFileStream.setByteOrder(QDataStream::BigEndian);
|
fastFileStream.setByteOrder(XDataStream::BigEndian);
|
||||||
|
|
||||||
// Select key based on game.
|
// Select key based on game.
|
||||||
QByteArray key = QByteArray::fromHex("0E50F49F412317096038665622DD091332A209BA0A05A00E1377CEDB0A3CB1D3");
|
QByteArray key = QByteArray::fromHex("0E50F49F412317096038665622DD091332A209BA0A05A00E1377CEDB0A3CB1D3");
|
||||||
|
|||||||
@ -69,12 +69,12 @@ bool FastFile_COD9_360::Load(const QString aFilePath) {
|
|||||||
bool FastFile_COD9_360::Load(const QByteArray aData) {
|
bool FastFile_COD9_360::Load(const QByteArray aData) {
|
||||||
QByteArray decompressedData;
|
QByteArray decompressedData;
|
||||||
|
|
||||||
// Create a QDataStream on the input data.
|
// Create a XDataStream on the input data.
|
||||||
QDataStream fastFileStream(aData);
|
XDataStream fastFileStream(aData);
|
||||||
fastFileStream.setByteOrder(QDataStream::LittleEndian);
|
fastFileStream.setByteOrder(XDataStream::LittleEndian);
|
||||||
|
|
||||||
// For COD7/COD9, use BigEndian.
|
// For COD7/COD9, use BigEndian.
|
||||||
fastFileStream.setByteOrder(QDataStream::BigEndian);
|
fastFileStream.setByteOrder(XDataStream::BigEndian);
|
||||||
|
|
||||||
// Select key based on game.
|
// Select key based on game.
|
||||||
QByteArray key = QByteArray::fromHex("0E50F49F412317096038665622DD091332A209BA0A05A00E1377CEDB0A3CB1D3");
|
QByteArray key = QByteArray::fromHex("0E50F49F412317096038665622DD091332A209BA0A05A00E1377CEDB0A3CB1D3");
|
||||||
|
|||||||
@ -69,9 +69,9 @@ bool FastFile_COD10_PC::Load(const QString aFilePath) {
|
|||||||
bool FastFile_COD10_PC::Load(const QByteArray aData) {
|
bool FastFile_COD10_PC::Load(const QByteArray aData) {
|
||||||
QByteArray decompressedData;
|
QByteArray decompressedData;
|
||||||
|
|
||||||
// Create a QDataStream on the input data.
|
// Create a XDataStream on the input data.
|
||||||
QDataStream fastFileStream(aData);
|
XDataStream fastFileStream(aData);
|
||||||
fastFileStream.setByteOrder(QDataStream::LittleEndian);
|
fastFileStream.setByteOrder(XDataStream::LittleEndian);
|
||||||
|
|
||||||
// Parse header values.
|
// Parse header values.
|
||||||
SetCompany(pParseFFCompany(&fastFileStream));
|
SetCompany(pParseFFCompany(&fastFileStream));
|
||||||
@ -84,9 +84,9 @@ bool FastFile_COD10_PC::Load(const QByteArray aData) {
|
|||||||
SetGame("COD9");
|
SetGame("COD9");
|
||||||
|
|
||||||
// For COD7/COD9, use BigEndian.
|
// For COD7/COD9, use BigEndian.
|
||||||
fastFileStream.setByteOrder(QDataStream::BigEndian);
|
fastFileStream.setByteOrder(XDataStream::BigEndian);
|
||||||
if (GetPlatform() == "PC") {
|
if (GetPlatform() == "PC") {
|
||||||
fastFileStream.setByteOrder(QDataStream::LittleEndian);
|
fastFileStream.setByteOrder(XDataStream::LittleEndian);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Select key based on game.
|
// Select key based on game.
|
||||||
|
|||||||
@ -69,9 +69,9 @@ bool FastFile_COD11_PC::Load(const QString aFilePath) {
|
|||||||
bool FastFile_COD11_PC::Load(const QByteArray aData) {
|
bool FastFile_COD11_PC::Load(const QByteArray aData) {
|
||||||
QByteArray decompressedData;
|
QByteArray decompressedData;
|
||||||
|
|
||||||
// Create a QDataStream on the input data.
|
// Create a XDataStream on the input data.
|
||||||
QDataStream fastFileStream(aData);
|
XDataStream fastFileStream(aData);
|
||||||
fastFileStream.setByteOrder(QDataStream::LittleEndian);
|
fastFileStream.setByteOrder(XDataStream::LittleEndian);
|
||||||
|
|
||||||
// Parse header values.
|
// Parse header values.
|
||||||
SetCompany(pParseFFCompany(&fastFileStream));
|
SetCompany(pParseFFCompany(&fastFileStream));
|
||||||
@ -84,9 +84,9 @@ bool FastFile_COD11_PC::Load(const QByteArray aData) {
|
|||||||
SetGame("COD9");
|
SetGame("COD9");
|
||||||
|
|
||||||
// For COD7/COD9, use BigEndian.
|
// For COD7/COD9, use BigEndian.
|
||||||
fastFileStream.setByteOrder(QDataStream::BigEndian);
|
fastFileStream.setByteOrder(XDataStream::BigEndian);
|
||||||
if (GetPlatform() == "PC") {
|
if (GetPlatform() == "PC") {
|
||||||
fastFileStream.setByteOrder(QDataStream::LittleEndian);
|
fastFileStream.setByteOrder(XDataStream::LittleEndian);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Select key based on game.
|
// Select key based on game.
|
||||||
|
|||||||
@ -72,9 +72,9 @@ bool FastFile_COD12_PC::Load(const QString aFilePath) {
|
|||||||
bool FastFile_COD12_PC::Load(const QByteArray aData) {
|
bool FastFile_COD12_PC::Load(const QByteArray aData) {
|
||||||
QByteArray decompressedData;
|
QByteArray decompressedData;
|
||||||
|
|
||||||
// Create a QDataStream on the input data.
|
// Create a XDataStream on the input data.
|
||||||
QDataStream fastFileStream(aData);
|
XDataStream fastFileStream(aData);
|
||||||
fastFileStream.setByteOrder(QDataStream::LittleEndian);
|
fastFileStream.setByteOrder(XDataStream::LittleEndian);
|
||||||
|
|
||||||
// Skip header magic
|
// Skip header magic
|
||||||
fastFileStream.skipRawData(8);
|
fastFileStream.skipRawData(8);
|
||||||
|
|||||||
@ -75,9 +75,9 @@ bool FastFile_COD4_PC::Load(const QByteArray aData) {
|
|||||||
StatusBarManager::instance().updateStatus("Loading COD5 Fast File w/data", 1000);
|
StatusBarManager::instance().updateStatus("Loading COD5 Fast File w/data", 1000);
|
||||||
QByteArray decompressedData;
|
QByteArray decompressedData;
|
||||||
|
|
||||||
// Create a QDataStream on the input data.
|
// Create a XDataStream on the input data.
|
||||||
QDataStream fastFileStream(aData);
|
XDataStream fastFileStream(aData);
|
||||||
fastFileStream.setByteOrder(QDataStream::LittleEndian);
|
fastFileStream.setByteOrder(XDataStream::LittleEndian);
|
||||||
|
|
||||||
// For COD5, simply decompress from offset 12.
|
// For COD5, simply decompress from offset 12.
|
||||||
decompressedData = Compression::DecompressZLIB(aData.mid(12));
|
decompressedData = Compression::DecompressZLIB(aData.mid(12));
|
||||||
|
|||||||
@ -75,9 +75,9 @@ bool FastFile_COD5_PC::Load(const QByteArray aData) {
|
|||||||
StatusBarManager::instance().updateStatus("Loading COD5 Fast File w/data", 1000);
|
StatusBarManager::instance().updateStatus("Loading COD5 Fast File w/data", 1000);
|
||||||
QByteArray decompressedData;
|
QByteArray decompressedData;
|
||||||
|
|
||||||
// Create a QDataStream on the input data.
|
// Create a XDataStream on the input data.
|
||||||
QDataStream fastFileStream(aData);
|
XDataStream fastFileStream(aData);
|
||||||
fastFileStream.setByteOrder(QDataStream::LittleEndian);
|
fastFileStream.setByteOrder(XDataStream::LittleEndian);
|
||||||
|
|
||||||
// For COD5, simply decompress from offset 12.
|
// For COD5, simply decompress from offset 12.
|
||||||
decompressedData = Compression::DecompressZLIB(aData.mid(12));
|
decompressedData = Compression::DecompressZLIB(aData.mid(12));
|
||||||
|
|||||||
@ -72,9 +72,9 @@ bool FastFile_COD7_PC::Load(const QString aFilePath) {
|
|||||||
bool FastFile_COD7_PC::Load(const QByteArray aData) {
|
bool FastFile_COD7_PC::Load(const QByteArray aData) {
|
||||||
QByteArray decompressedData;
|
QByteArray decompressedData;
|
||||||
|
|
||||||
// Create a QDataStream on the input data.
|
// Create a XDataStream on the input data.
|
||||||
QDataStream fastFileStream(aData);
|
XDataStream fastFileStream(aData);
|
||||||
fastFileStream.setByteOrder(QDataStream::LittleEndian);
|
fastFileStream.setByteOrder(XDataStream::LittleEndian);
|
||||||
|
|
||||||
// Parse header values.
|
// Parse header values.
|
||||||
SetCompany(pParseFFCompany(&fastFileStream));
|
SetCompany(pParseFFCompany(&fastFileStream));
|
||||||
|
|||||||
@ -72,9 +72,9 @@ bool FastFile_COD8_PC::Load(const QString aFilePath) {
|
|||||||
bool FastFile_COD8_PC::Load(const QByteArray aData) {
|
bool FastFile_COD8_PC::Load(const QByteArray aData) {
|
||||||
QByteArray decompressedData;
|
QByteArray decompressedData;
|
||||||
|
|
||||||
// Create a QDataStream on the input data.
|
// Create a XDataStream on the input data.
|
||||||
QDataStream fastFileStream(aData);
|
XDataStream fastFileStream(aData);
|
||||||
fastFileStream.setByteOrder(QDataStream::LittleEndian);
|
fastFileStream.setByteOrder(XDataStream::LittleEndian);
|
||||||
|
|
||||||
// Parse header values.
|
// Parse header values.
|
||||||
SetCompany(pParseFFCompany(&fastFileStream));
|
SetCompany(pParseFFCompany(&fastFileStream));
|
||||||
@ -87,7 +87,7 @@ bool FastFile_COD8_PC::Load(const QByteArray aData) {
|
|||||||
SetGame("COD7");
|
SetGame("COD7");
|
||||||
|
|
||||||
// For COD7/COD9, use BigEndian.
|
// For COD7/COD9, use BigEndian.
|
||||||
fastFileStream.setByteOrder(QDataStream::LittleEndian);
|
fastFileStream.setByteOrder(XDataStream::LittleEndian);
|
||||||
|
|
||||||
// Select key based on game.
|
// Select key based on game.
|
||||||
QByteArray key;
|
QByteArray key;
|
||||||
|
|||||||
@ -69,9 +69,9 @@ bool FastFile_COD9_PC::Load(const QString aFilePath) {
|
|||||||
bool FastFile_COD9_PC::Load(const QByteArray aData) {
|
bool FastFile_COD9_PC::Load(const QByteArray aData) {
|
||||||
QByteArray decompressedData;
|
QByteArray decompressedData;
|
||||||
|
|
||||||
// Create a QDataStream on the input data.
|
// Create a XDataStream on the input data.
|
||||||
QDataStream fastFileStream(aData);
|
XDataStream fastFileStream(aData);
|
||||||
fastFileStream.setByteOrder(QDataStream::LittleEndian);
|
fastFileStream.setByteOrder(XDataStream::LittleEndian);
|
||||||
|
|
||||||
// Parse header values.
|
// Parse header values.
|
||||||
SetCompany(pParseFFCompany(&fastFileStream));
|
SetCompany(pParseFFCompany(&fastFileStream));
|
||||||
@ -84,9 +84,9 @@ bool FastFile_COD9_PC::Load(const QByteArray aData) {
|
|||||||
SetGame("COD9");
|
SetGame("COD9");
|
||||||
|
|
||||||
// For COD7/COD9, use BigEndian.
|
// For COD7/COD9, use BigEndian.
|
||||||
fastFileStream.setByteOrder(QDataStream::BigEndian);
|
fastFileStream.setByteOrder(XDataStream::BigEndian);
|
||||||
if (GetPlatform() == "PC") {
|
if (GetPlatform() == "PC") {
|
||||||
fastFileStream.setByteOrder(QDataStream::LittleEndian);
|
fastFileStream.setByteOrder(XDataStream::LittleEndian);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Select key based on game.
|
// Select key based on game.
|
||||||
|
|||||||
@ -69,9 +69,9 @@ bool FastFile_COD10_PS3::Load(const QString aFilePath) {
|
|||||||
bool FastFile_COD10_PS3::Load(const QByteArray aData) {
|
bool FastFile_COD10_PS3::Load(const QByteArray aData) {
|
||||||
QByteArray decompressedData;
|
QByteArray decompressedData;
|
||||||
|
|
||||||
// Create a QDataStream on the input data.
|
// Create a XDataStream on the input data.
|
||||||
QDataStream fastFileStream(aData);
|
XDataStream fastFileStream(aData);
|
||||||
fastFileStream.setByteOrder(QDataStream::LittleEndian);
|
fastFileStream.setByteOrder(XDataStream::LittleEndian);
|
||||||
|
|
||||||
// Parse header values.
|
// Parse header values.
|
||||||
SetCompany(pParseFFCompany(&fastFileStream));
|
SetCompany(pParseFFCompany(&fastFileStream));
|
||||||
@ -84,9 +84,9 @@ bool FastFile_COD10_PS3::Load(const QByteArray aData) {
|
|||||||
SetGame("COD9");
|
SetGame("COD9");
|
||||||
|
|
||||||
// For COD7/COD9, use BigEndian.
|
// For COD7/COD9, use BigEndian.
|
||||||
fastFileStream.setByteOrder(QDataStream::BigEndian);
|
fastFileStream.setByteOrder(XDataStream::BigEndian);
|
||||||
if (GetPlatform() == "PC") {
|
if (GetPlatform() == "PC") {
|
||||||
fastFileStream.setByteOrder(QDataStream::LittleEndian);
|
fastFileStream.setByteOrder(XDataStream::LittleEndian);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Select key based on game.
|
// Select key based on game.
|
||||||
|
|||||||
@ -69,9 +69,9 @@ bool FastFile_COD11_PS3::Load(const QString aFilePath) {
|
|||||||
bool FastFile_COD11_PS3::Load(const QByteArray aData) {
|
bool FastFile_COD11_PS3::Load(const QByteArray aData) {
|
||||||
QByteArray decompressedData;
|
QByteArray decompressedData;
|
||||||
|
|
||||||
// Create a QDataStream on the input data.
|
// Create a XDataStream on the input data.
|
||||||
QDataStream fastFileStream(aData);
|
XDataStream fastFileStream(aData);
|
||||||
fastFileStream.setByteOrder(QDataStream::LittleEndian);
|
fastFileStream.setByteOrder(XDataStream::LittleEndian);
|
||||||
|
|
||||||
// Parse header values.
|
// Parse header values.
|
||||||
SetCompany(pParseFFCompany(&fastFileStream));
|
SetCompany(pParseFFCompany(&fastFileStream));
|
||||||
@ -84,9 +84,9 @@ bool FastFile_COD11_PS3::Load(const QByteArray aData) {
|
|||||||
SetGame("COD9");
|
SetGame("COD9");
|
||||||
|
|
||||||
// For COD7/COD9, use BigEndian.
|
// For COD7/COD9, use BigEndian.
|
||||||
fastFileStream.setByteOrder(QDataStream::BigEndian);
|
fastFileStream.setByteOrder(XDataStream::BigEndian);
|
||||||
if (GetPlatform() == "PC") {
|
if (GetPlatform() == "PC") {
|
||||||
fastFileStream.setByteOrder(QDataStream::LittleEndian);
|
fastFileStream.setByteOrder(XDataStream::LittleEndian);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Select key based on game.
|
// Select key based on game.
|
||||||
|
|||||||
@ -69,9 +69,9 @@ bool FastFile_COD12_PS3::Load(const QString aFilePath) {
|
|||||||
bool FastFile_COD12_PS3::Load(const QByteArray aData) {
|
bool FastFile_COD12_PS3::Load(const QByteArray aData) {
|
||||||
QByteArray decompressedData;
|
QByteArray decompressedData;
|
||||||
|
|
||||||
// Create a QDataStream on the input data.
|
// Create a XDataStream on the input data.
|
||||||
QDataStream fastFileStream(aData);
|
XDataStream fastFileStream(aData);
|
||||||
fastFileStream.setByteOrder(QDataStream::LittleEndian);
|
fastFileStream.setByteOrder(XDataStream::LittleEndian);
|
||||||
|
|
||||||
// Parse header values.
|
// Parse header values.
|
||||||
SetCompany(pParseFFCompany(&fastFileStream));
|
SetCompany(pParseFFCompany(&fastFileStream));
|
||||||
@ -84,9 +84,9 @@ bool FastFile_COD12_PS3::Load(const QByteArray aData) {
|
|||||||
SetGame("COD9");
|
SetGame("COD9");
|
||||||
|
|
||||||
// For COD7/COD9, use BigEndian.
|
// For COD7/COD9, use BigEndian.
|
||||||
fastFileStream.setByteOrder(QDataStream::BigEndian);
|
fastFileStream.setByteOrder(XDataStream::BigEndian);
|
||||||
if (GetPlatform() == "PC") {
|
if (GetPlatform() == "PC") {
|
||||||
fastFileStream.setByteOrder(QDataStream::LittleEndian);
|
fastFileStream.setByteOrder(XDataStream::LittleEndian);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Select key based on game.
|
// Select key based on game.
|
||||||
|
|||||||
@ -75,9 +75,9 @@ bool FastFile_COD4_PS3::Load(const QByteArray aData) {
|
|||||||
StatusBarManager::instance().updateStatus("Loading COD5 Fast File w/data", 1000);
|
StatusBarManager::instance().updateStatus("Loading COD5 Fast File w/data", 1000);
|
||||||
QByteArray decompressedData;
|
QByteArray decompressedData;
|
||||||
|
|
||||||
// Create a QDataStream on the input data.
|
// Create a XDataStream on the input data.
|
||||||
QDataStream fastFileStream(aData);
|
XDataStream fastFileStream(aData);
|
||||||
fastFileStream.setByteOrder(QDataStream::LittleEndian);
|
fastFileStream.setByteOrder(XDataStream::LittleEndian);
|
||||||
|
|
||||||
// Parse header values.
|
// Parse header values.
|
||||||
SetCompany(pParseFFCompany(&fastFileStream));
|
SetCompany(pParseFFCompany(&fastFileStream));
|
||||||
@ -91,8 +91,8 @@ bool FastFile_COD4_PS3::Load(const QByteArray aData) {
|
|||||||
while (pos <= aData.size()) {
|
while (pos <= aData.size()) {
|
||||||
// Read 2-byte BIG-ENDIAN chunk size
|
// Read 2-byte BIG-ENDIAN chunk size
|
||||||
quint32 chunkSize;
|
quint32 chunkSize;
|
||||||
QDataStream chunkStream(aData.mid(pos, 2));
|
XDataStream chunkStream(aData.mid(pos, 2));
|
||||||
chunkStream.setByteOrder(QDataStream::BigEndian);
|
chunkStream.setByteOrder(XDataStream::BigEndian);
|
||||||
chunkStream >> chunkSize;
|
chunkStream >> chunkSize;
|
||||||
|
|
||||||
pos += 2;
|
pos += 2;
|
||||||
|
|||||||
@ -75,9 +75,9 @@ bool FastFile_COD5_PS3::Load(const QByteArray aData) {
|
|||||||
StatusBarManager::instance().updateStatus("Loading COD5 Fast File w/data", 1000);
|
StatusBarManager::instance().updateStatus("Loading COD5 Fast File w/data", 1000);
|
||||||
QByteArray decompressedData;
|
QByteArray decompressedData;
|
||||||
|
|
||||||
// Create a QDataStream on the input data.
|
// Create a XDataStream on the input data.
|
||||||
QDataStream fastFileStream(aData);
|
XDataStream fastFileStream(aData);
|
||||||
fastFileStream.setByteOrder(QDataStream::LittleEndian);
|
fastFileStream.setByteOrder(XDataStream::LittleEndian);
|
||||||
|
|
||||||
// Parse header values.
|
// Parse header values.
|
||||||
SetCompany(pParseFFCompany(&fastFileStream));
|
SetCompany(pParseFFCompany(&fastFileStream));
|
||||||
@ -91,8 +91,8 @@ bool FastFile_COD5_PS3::Load(const QByteArray aData) {
|
|||||||
while (pos <= aData.size()) {
|
while (pos <= aData.size()) {
|
||||||
// Read 2-byte BIG-ENDIAN chunk size
|
// Read 2-byte BIG-ENDIAN chunk size
|
||||||
quint32 chunkSize;
|
quint32 chunkSize;
|
||||||
QDataStream chunkStream(aData.mid(pos, 2));
|
XDataStream chunkStream(aData.mid(pos, 2));
|
||||||
chunkStream.setByteOrder(QDataStream::BigEndian);
|
chunkStream.setByteOrder(XDataStream::BigEndian);
|
||||||
chunkStream >> chunkSize;
|
chunkStream >> chunkSize;
|
||||||
|
|
||||||
pos += 2;
|
pos += 2;
|
||||||
|
|||||||
@ -75,9 +75,9 @@ bool FastFile_COD6_PS3::Load(const QByteArray aData) {
|
|||||||
StatusBarManager::instance().updateStatus("Loading COD5 Fast File w/data", 1000);
|
StatusBarManager::instance().updateStatus("Loading COD5 Fast File w/data", 1000);
|
||||||
QByteArray decompressedData;
|
QByteArray decompressedData;
|
||||||
|
|
||||||
// Create a QDataStream on the input data.
|
// Create a XDataStream on the input data.
|
||||||
QDataStream fastFileStream(aData);
|
XDataStream fastFileStream(aData);
|
||||||
fastFileStream.setByteOrder(QDataStream::LittleEndian);
|
fastFileStream.setByteOrder(XDataStream::LittleEndian);
|
||||||
|
|
||||||
// Parse header values.
|
// Parse header values.
|
||||||
SetCompany(pParseFFCompany(&fastFileStream));
|
SetCompany(pParseFFCompany(&fastFileStream));
|
||||||
|
|||||||
@ -72,9 +72,9 @@ bool FastFile_COD7_PS3::Load(const QString aFilePath) {
|
|||||||
bool FastFile_COD7_PS3::Load(const QByteArray aData) {
|
bool FastFile_COD7_PS3::Load(const QByteArray aData) {
|
||||||
QByteArray decompressedData;
|
QByteArray decompressedData;
|
||||||
|
|
||||||
// Create a QDataStream on the input data.
|
// Create a XDataStream on the input data.
|
||||||
QDataStream fastFileStream(aData);
|
XDataStream fastFileStream(aData);
|
||||||
fastFileStream.setByteOrder(QDataStream::LittleEndian);
|
fastFileStream.setByteOrder(XDataStream::LittleEndian);
|
||||||
|
|
||||||
// Parse header values.
|
// Parse header values.
|
||||||
SetCompany(pParseFFCompany(&fastFileStream));
|
SetCompany(pParseFFCompany(&fastFileStream));
|
||||||
@ -91,9 +91,9 @@ bool FastFile_COD7_PS3::Load(const QByteArray aData) {
|
|||||||
zoneFile->SetStem(GetBaseStem() + ".zone");
|
zoneFile->SetStem(GetBaseStem() + ".zone");
|
||||||
|
|
||||||
// For COD7/COD9, use BigEndian.
|
// For COD7/COD9, use BigEndian.
|
||||||
fastFileStream.setByteOrder(QDataStream::BigEndian);
|
fastFileStream.setByteOrder(XDataStream::BigEndian);
|
||||||
if (GetPlatform() == "PC") {
|
if (GetPlatform() == "PC") {
|
||||||
fastFileStream.setByteOrder(QDataStream::LittleEndian);
|
fastFileStream.setByteOrder(XDataStream::LittleEndian);
|
||||||
|
|
||||||
// Select key based on game.
|
// Select key based on game.
|
||||||
QByteArray key;
|
QByteArray key;
|
||||||
|
|||||||
@ -72,9 +72,9 @@ bool FastFile_COD8_PS3::Load(const QString aFilePath) {
|
|||||||
bool FastFile_COD8_PS3::Load(const QByteArray aData) {
|
bool FastFile_COD8_PS3::Load(const QByteArray aData) {
|
||||||
QByteArray decompressedData;
|
QByteArray decompressedData;
|
||||||
|
|
||||||
// Create a QDataStream on the input data.
|
// Create a XDataStream on the input data.
|
||||||
QDataStream fastFileStream(aData);
|
XDataStream fastFileStream(aData);
|
||||||
fastFileStream.setByteOrder(QDataStream::LittleEndian);
|
fastFileStream.setByteOrder(XDataStream::LittleEndian);
|
||||||
|
|
||||||
// Parse header values.
|
// Parse header values.
|
||||||
SetCompany(pParseFFCompany(&fastFileStream));
|
SetCompany(pParseFFCompany(&fastFileStream));
|
||||||
@ -90,9 +90,9 @@ bool FastFile_COD8_PS3::Load(const QByteArray aData) {
|
|||||||
zoneFile->SetStem(GetBaseStem() + ".zone");
|
zoneFile->SetStem(GetBaseStem() + ".zone");
|
||||||
|
|
||||||
// For COD7/COD9, use BigEndian.
|
// For COD7/COD9, use BigEndian.
|
||||||
fastFileStream.setByteOrder(QDataStream::BigEndian);
|
fastFileStream.setByteOrder(XDataStream::BigEndian);
|
||||||
if (GetPlatform() == "PC") {
|
if (GetPlatform() == "PC") {
|
||||||
fastFileStream.setByteOrder(QDataStream::LittleEndian);
|
fastFileStream.setByteOrder(XDataStream::LittleEndian);
|
||||||
|
|
||||||
// Select key based on game.
|
// Select key based on game.
|
||||||
QByteArray key;
|
QByteArray key;
|
||||||
|
|||||||
@ -69,9 +69,9 @@ bool FastFile_COD9_PS3::Load(const QString aFilePath) {
|
|||||||
bool FastFile_COD9_PS3::Load(const QByteArray aData) {
|
bool FastFile_COD9_PS3::Load(const QByteArray aData) {
|
||||||
QByteArray decompressedData;
|
QByteArray decompressedData;
|
||||||
|
|
||||||
// Create a QDataStream on the input data.
|
// Create a XDataStream on the input data.
|
||||||
QDataStream fastFileStream(aData);
|
XDataStream fastFileStream(aData);
|
||||||
fastFileStream.setByteOrder(QDataStream::LittleEndian);
|
fastFileStream.setByteOrder(XDataStream::LittleEndian);
|
||||||
|
|
||||||
// Parse header values.
|
// Parse header values.
|
||||||
SetCompany(pParseFFCompany(&fastFileStream));
|
SetCompany(pParseFFCompany(&fastFileStream));
|
||||||
@ -84,9 +84,9 @@ bool FastFile_COD9_PS3::Load(const QByteArray aData) {
|
|||||||
SetGame("COD9");
|
SetGame("COD9");
|
||||||
|
|
||||||
// For COD7/COD9, use BigEndian.
|
// For COD7/COD9, use BigEndian.
|
||||||
fastFileStream.setByteOrder(QDataStream::BigEndian);
|
fastFileStream.setByteOrder(XDataStream::BigEndian);
|
||||||
if (GetPlatform() == "PC") {
|
if (GetPlatform() == "PC") {
|
||||||
fastFileStream.setByteOrder(QDataStream::LittleEndian);
|
fastFileStream.setByteOrder(XDataStream::LittleEndian);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Select key based on game.
|
// Select key based on game.
|
||||||
|
|||||||
@ -69,9 +69,9 @@ bool FastFile_COD7_Wii::Load(const QString aFilePath) {
|
|||||||
bool FastFile_COD7_Wii::Load(const QByteArray aData) {
|
bool FastFile_COD7_Wii::Load(const QByteArray aData) {
|
||||||
QByteArray decompressedData;
|
QByteArray decompressedData;
|
||||||
|
|
||||||
// Create a QDataStream on the input data.
|
// Create a XDataStream on the input data.
|
||||||
QDataStream fastFileStream(aData);
|
XDataStream fastFileStream(aData);
|
||||||
fastFileStream.setByteOrder(QDataStream::LittleEndian);
|
fastFileStream.setByteOrder(XDataStream::LittleEndian);
|
||||||
|
|
||||||
// Parse header values.
|
// Parse header values.
|
||||||
SetCompany(pParseFFCompany(&fastFileStream));
|
SetCompany(pParseFFCompany(&fastFileStream));
|
||||||
@ -84,7 +84,7 @@ bool FastFile_COD7_Wii::Load(const QByteArray aData) {
|
|||||||
SetGame("COD7");
|
SetGame("COD7");
|
||||||
|
|
||||||
// For COD7/COD9, use BigEndian.
|
// For COD7/COD9, use BigEndian.
|
||||||
fastFileStream.setByteOrder(QDataStream::BigEndian);
|
fastFileStream.setByteOrder(XDataStream::BigEndian);
|
||||||
|
|
||||||
// For COD7, simply decompress from offset 12.
|
// For COD7, simply decompress from offset 12.
|
||||||
decompressedData = Compression::DecompressZLIB(aData.mid(12));
|
decompressedData = Compression::DecompressZLIB(aData.mid(12));
|
||||||
|
|||||||
@ -69,9 +69,9 @@ bool FastFile_COD8_Wii::Load(const QString aFilePath) {
|
|||||||
bool FastFile_COD8_Wii::Load(const QByteArray aData) {
|
bool FastFile_COD8_Wii::Load(const QByteArray aData) {
|
||||||
QByteArray decompressedData;
|
QByteArray decompressedData;
|
||||||
|
|
||||||
// Create a QDataStream on the input data.
|
// Create a XDataStream on the input data.
|
||||||
QDataStream fastFileStream(aData);
|
XDataStream fastFileStream(aData);
|
||||||
fastFileStream.setByteOrder(QDataStream::LittleEndian);
|
fastFileStream.setByteOrder(XDataStream::LittleEndian);
|
||||||
|
|
||||||
// Parse header values.
|
// Parse header values.
|
||||||
SetCompany(pParseFFCompany(&fastFileStream));
|
SetCompany(pParseFFCompany(&fastFileStream));
|
||||||
@ -81,7 +81,7 @@ bool FastFile_COD8_Wii::Load(const QByteArray aData) {
|
|||||||
SetVersion(pParseFFVersion(&fastFileStream));
|
SetVersion(pParseFFVersion(&fastFileStream));
|
||||||
|
|
||||||
// For COD7/COD9, use BigEndian.
|
// For COD7/COD9, use BigEndian.
|
||||||
fastFileStream.setByteOrder(QDataStream::BigEndian);
|
fastFileStream.setByteOrder(XDataStream::BigEndian);
|
||||||
|
|
||||||
// For COD7, simply decompress from offset 12.
|
// For COD7, simply decompress from offset 12.
|
||||||
decompressedData = Compression::DecompressZLIB(aData.mid(25));
|
decompressedData = Compression::DecompressZLIB(aData.mid(25));
|
||||||
|
|||||||
@ -67,9 +67,9 @@ bool FastFile_COD10_WiiU::Load(const QString aFilePath) {
|
|||||||
bool FastFile_COD10_WiiU::Load(const QByteArray aData) {
|
bool FastFile_COD10_WiiU::Load(const QByteArray aData) {
|
||||||
QByteArray decompressedData;
|
QByteArray decompressedData;
|
||||||
|
|
||||||
// Create a QDataStream on the input data.
|
// Create a XDataStream on the input data.
|
||||||
QDataStream fastFileStream(aData);
|
XDataStream fastFileStream(aData);
|
||||||
fastFileStream.setByteOrder(QDataStream::LittleEndian);
|
fastFileStream.setByteOrder(XDataStream::LittleEndian);
|
||||||
|
|
||||||
// Parse header values.
|
// Parse header values.
|
||||||
SetCompany(pParseFFCompany(&fastFileStream));
|
SetCompany(pParseFFCompany(&fastFileStream));
|
||||||
@ -82,9 +82,9 @@ bool FastFile_COD10_WiiU::Load(const QByteArray aData) {
|
|||||||
SetGame("COD9");
|
SetGame("COD9");
|
||||||
|
|
||||||
// For COD7/COD9, use BigEndian.
|
// For COD7/COD9, use BigEndian.
|
||||||
fastFileStream.setByteOrder(QDataStream::BigEndian);
|
fastFileStream.setByteOrder(XDataStream::BigEndian);
|
||||||
if (GetPlatform() == "PC") {
|
if (GetPlatform() == "PC") {
|
||||||
fastFileStream.setByteOrder(QDataStream::LittleEndian);
|
fastFileStream.setByteOrder(XDataStream::LittleEndian);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Select key based on game.
|
// Select key based on game.
|
||||||
|
|||||||
@ -67,9 +67,9 @@ bool FastFile_COD9_WiiU::Load(const QString aFilePath) {
|
|||||||
bool FastFile_COD9_WiiU::Load(const QByteArray aData) {
|
bool FastFile_COD9_WiiU::Load(const QByteArray aData) {
|
||||||
QByteArray decompressedData;
|
QByteArray decompressedData;
|
||||||
|
|
||||||
// Create a QDataStream on the input data.
|
// Create a XDataStream on the input data.
|
||||||
QDataStream fastFileStream(aData);
|
XDataStream fastFileStream(aData);
|
||||||
fastFileStream.setByteOrder(QDataStream::LittleEndian);
|
fastFileStream.setByteOrder(XDataStream::LittleEndian);
|
||||||
|
|
||||||
// Parse header values.
|
// Parse header values.
|
||||||
SetCompany(pParseFFCompany(&fastFileStream));
|
SetCompany(pParseFFCompany(&fastFileStream));
|
||||||
@ -82,9 +82,9 @@ bool FastFile_COD9_WiiU::Load(const QByteArray aData) {
|
|||||||
SetGame("COD9");
|
SetGame("COD9");
|
||||||
|
|
||||||
// For COD7/COD9, use BigEndian.
|
// For COD7/COD9, use BigEndian.
|
||||||
fastFileStream.setByteOrder(QDataStream::BigEndian);
|
fastFileStream.setByteOrder(XDataStream::BigEndian);
|
||||||
if (GetPlatform() == "PC") {
|
if (GetPlatform() == "PC") {
|
||||||
fastFileStream.setByteOrder(QDataStream::LittleEndian);
|
fastFileStream.setByteOrder(XDataStream::LittleEndian);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Select key based on game.
|
// Select key based on game.
|
||||||
|
|||||||
@ -115,7 +115,7 @@ void FastFile::SetPlatform(const QString aPlatform) {
|
|||||||
mPlatform = aPlatform;
|
mPlatform = aPlatform;
|
||||||
}
|
}
|
||||||
|
|
||||||
FF_COMPANY FastFile::pParseFFCompany(QDataStream *afastFileStream, quint32 &aCompanyInt) {
|
FF_COMPANY FastFile::pParseFFCompany(XDataStream *afastFileStream, quint32 &aCompanyInt) {
|
||||||
LogManager::instance().addEntry("Parsing company into reference...");
|
LogManager::instance().addEntry("Parsing company into reference...");
|
||||||
// Check for null datastream ptr
|
// Check for null datastream ptr
|
||||||
if (!afastFileStream) { return COMPANY_NONE; }
|
if (!afastFileStream) { return COMPANY_NONE; }
|
||||||
@ -137,7 +137,7 @@ FF_COMPANY FastFile::pParseFFCompany(QDataStream *afastFileStream, quint32 &aCom
|
|||||||
return COMPANY_NONE;
|
return COMPANY_NONE;
|
||||||
}
|
}
|
||||||
|
|
||||||
FF_COMPANY FastFile::pParseFFCompany(QDataStream *afastFileStream) {
|
FF_COMPANY FastFile::pParseFFCompany(XDataStream *afastFileStream) {
|
||||||
LogManager::instance().addEntry("Parsing company...");
|
LogManager::instance().addEntry("Parsing company...");
|
||||||
// Check for null datastream ptr
|
// Check for null datastream ptr
|
||||||
if (!afastFileStream) { return COMPANY_NONE; }
|
if (!afastFileStream) { return COMPANY_NONE; }
|
||||||
@ -157,7 +157,7 @@ FF_COMPANY FastFile::pParseFFCompany(QDataStream *afastFileStream) {
|
|||||||
return COMPANY_NONE;
|
return COMPANY_NONE;
|
||||||
}
|
}
|
||||||
|
|
||||||
FF_FILETYPE FastFile::pParseFFFileType(QDataStream *afastFileStream) {
|
FF_FILETYPE FastFile::pParseFFFileType(XDataStream *afastFileStream) {
|
||||||
// Parse filetype
|
// Parse filetype
|
||||||
QByteArray fileTypeData(2, Qt::Uninitialized);
|
QByteArray fileTypeData(2, Qt::Uninitialized);
|
||||||
afastFileStream->readRawData(fileTypeData.data(), 2);
|
afastFileStream->readRawData(fileTypeData.data(), 2);
|
||||||
@ -168,7 +168,7 @@ FF_FILETYPE FastFile::pParseFFFileType(QDataStream *afastFileStream) {
|
|||||||
return FILETYPE_NONE;
|
return FILETYPE_NONE;
|
||||||
}
|
}
|
||||||
|
|
||||||
FF_SIGNAGE FastFile::pParseFFSignage(QDataStream *afastFileStream) {
|
FF_SIGNAGE FastFile::pParseFFSignage(XDataStream *afastFileStream) {
|
||||||
// Parse filetype
|
// Parse filetype
|
||||||
QByteArray signedData(1, Qt::Uninitialized);
|
QByteArray signedData(1, Qt::Uninitialized);
|
||||||
afastFileStream->readRawData(signedData.data(), 1);
|
afastFileStream->readRawData(signedData.data(), 1);
|
||||||
@ -181,7 +181,7 @@ FF_SIGNAGE FastFile::pParseFFSignage(QDataStream *afastFileStream) {
|
|||||||
return SIGNAGE_NONE;
|
return SIGNAGE_NONE;
|
||||||
}
|
}
|
||||||
|
|
||||||
QString FastFile::pParseFFMagic(QDataStream *afastFileStream) {
|
QString FastFile::pParseFFMagic(XDataStream *afastFileStream) {
|
||||||
// Parse magic
|
// Parse magic
|
||||||
QByteArray magicData(3, Qt::Uninitialized);
|
QByteArray magicData(3, Qt::Uninitialized);
|
||||||
afastFileStream->readRawData(magicData.data(), 3);
|
afastFileStream->readRawData(magicData.data(), 3);
|
||||||
@ -192,7 +192,7 @@ QString FastFile::pParseFFMagic(QDataStream *afastFileStream) {
|
|||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
|
|
||||||
quint32 FastFile::pParseFFVersion(QDataStream *afastFileStream) {
|
quint32 FastFile::pParseFFVersion(XDataStream *afastFileStream) {
|
||||||
// Parse version
|
// Parse version
|
||||||
quint32 version;
|
quint32 version;
|
||||||
*afastFileStream >> version;
|
*afastFileStream >> version;
|
||||||
|
|||||||
@ -46,12 +46,12 @@ public:
|
|||||||
virtual void SetGame(const QString aGame);
|
virtual void SetGame(const QString aGame);
|
||||||
virtual void SetPlatform(const QString aPlatform);
|
virtual void SetPlatform(const QString aPlatform);
|
||||||
|
|
||||||
static FF_COMPANY pParseFFCompany(QDataStream *afastFileStream, quint32 &aCompanyInt);
|
static FF_COMPANY pParseFFCompany(XDataStream *afastFileStream, quint32 &aCompanyInt);
|
||||||
static FF_COMPANY pParseFFCompany(QDataStream *afastFileStream);
|
static FF_COMPANY pParseFFCompany(XDataStream *afastFileStream);
|
||||||
static FF_FILETYPE pParseFFFileType(QDataStream *afastFileStream);
|
static FF_FILETYPE pParseFFFileType(XDataStream *afastFileStream);
|
||||||
static FF_SIGNAGE pParseFFSignage(QDataStream *afastFileStream);
|
static FF_SIGNAGE pParseFFSignage(XDataStream *afastFileStream);
|
||||||
static QString pParseFFMagic(QDataStream *afastFileStream);
|
static QString pParseFFMagic(XDataStream *afastFileStream);
|
||||||
static quint32 pParseFFVersion(QDataStream *afastFileStream);
|
static quint32 pParseFFVersion(XDataStream *afastFileStream);
|
||||||
static QString pCalculateFFPlatform(quint32 aVersion);
|
static QString pCalculateFFPlatform(quint32 aVersion);
|
||||||
static QString pCalculateFFGame(quint32 aVersion);
|
static QString pCalculateFFGame(quint32 aVersion);
|
||||||
|
|
||||||
|
|||||||
@ -52,22 +52,22 @@ class FastFile;
|
|||||||
|
|
||||||
enum FastFile_Platform {
|
enum FastFile_Platform {
|
||||||
PLATFORM_NONE = 0x00,
|
PLATFORM_NONE = 0x00,
|
||||||
PLATFORM_PC = 0x01,
|
PLATFORM_PC = 0x01,
|
||||||
PLATFORM_360 = 0x02,
|
PLATFORM_360 = 0x02,
|
||||||
PLATFORM_PS3 = 0x03,
|
PLATFORM_PS3 = 0x03,
|
||||||
PLATFORM_WII = 0x04,
|
PLATFORM_WII = 0x04,
|
||||||
PLATFORM_WIIU = 0x05
|
PLATFORM_WIIU = 0x05
|
||||||
};
|
};
|
||||||
|
|
||||||
enum FastFile_Game {
|
enum FastFile_Game {
|
||||||
GAME_NONE = 0x00,
|
GAME_NONE = 0x00,
|
||||||
GAME_COD2 = 0x01,
|
GAME_COD2 = 0x01,
|
||||||
GAME_COD4 = 0x02,
|
GAME_COD4 = 0x02,
|
||||||
GAME_COD5 = 0x03,
|
GAME_COD5 = 0x03,
|
||||||
GAME_COD6 = 0x04,
|
GAME_COD6 = 0x04,
|
||||||
GAME_COD7 = 0x05,
|
GAME_COD7 = 0x05,
|
||||||
GAME_COD8 = 0x06,
|
GAME_COD8 = 0x06,
|
||||||
GAME_COD9 = 0x07,
|
GAME_COD9 = 0x07,
|
||||||
GAME_COD10 = 0x08,
|
GAME_COD10 = 0x08,
|
||||||
GAME_COD11 = 0x09,
|
GAME_COD11 = 0x09,
|
||||||
GAME_COD12 = 0x010
|
GAME_COD12 = 0x010
|
||||||
|
|||||||
@ -5,14 +5,10 @@ XAnimDeltaPart::XAnimDeltaPart()
|
|||||||
, mTrans()
|
, mTrans()
|
||||||
, mQuat()
|
, mQuat()
|
||||||
{
|
{
|
||||||
|
SetName("Animation Delta Part");
|
||||||
}
|
}
|
||||||
|
|
||||||
XAnimDeltaPart::~XAnimDeltaPart()
|
void XAnimDeltaPart::ParseData(XDataStream *aStream) {
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
void XAnimDeltaPart::ParseData(QDataStream *aStream) {
|
|
||||||
if (GetPtr() == -1) {
|
if (GetPtr() == -1) {
|
||||||
mTrans.ParsePtr(aStream);
|
mTrans.ParsePtr(aStream);
|
||||||
mQuat.ParsePtr(aStream);
|
mQuat.ParsePtr(aStream);
|
||||||
|
|||||||
@ -9,9 +9,9 @@ class XAnimDeltaPart : public XAsset
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
explicit XAnimDeltaPart();
|
explicit XAnimDeltaPart();
|
||||||
~XAnimDeltaPart();
|
~XAnimDeltaPart() = default;
|
||||||
|
|
||||||
void ParseData(QDataStream *aStream) override;
|
void ParseData(XDataStream *aStream) override;
|
||||||
void Clear() override;
|
void Clear() override;
|
||||||
|
|
||||||
const XAnimPartTrans& GetTrans() const;
|
const XAnimPartTrans& GetTrans() const;
|
||||||
|
|||||||
@ -1,12 +1,14 @@
|
|||||||
#include "xanimdeltapartquat.h"
|
#include "xanimdeltapartquat.h"
|
||||||
|
|
||||||
XAnimDeltaPartQuat::XAnimDeltaPartQuat()
|
XAnimDeltaPartQuat::XAnimDeltaPartQuat()
|
||||||
: XAsset() {
|
: XAsset()
|
||||||
|
{
|
||||||
|
SetName("Animation Delta Part Quat");
|
||||||
}
|
}
|
||||||
|
|
||||||
void XAnimDeltaPartQuat::ParseData(QDataStream *aStream) {
|
void XAnimDeltaPartQuat::ParseData(XDataStream *aStream) {
|
||||||
if (GetPtr() == -1) {
|
if (GetPtr() == -1) {
|
||||||
*aStream >> mSize;
|
mSize = aStream->ParseUInt32(QString("%1 size").arg(GetName()));
|
||||||
|
|
||||||
// Parse data
|
// Parse data
|
||||||
mData.ParseData(aStream);
|
mData.ParseData(aStream);
|
||||||
|
|||||||
@ -1,9 +1,3 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#ifndef XANIMDELTAPARTQUAT_H
|
#ifndef XANIMDELTAPARTQUAT_H
|
||||||
#define XANIMDELTAPARTQUAT_H
|
#define XANIMDELTAPARTQUAT_H
|
||||||
|
|
||||||
@ -14,8 +8,9 @@ class XAnimDeltaPartQuat : public XAsset
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
explicit XAnimDeltaPartQuat();
|
explicit XAnimDeltaPartQuat();
|
||||||
|
~XAnimDeltaPartQuat() = default;
|
||||||
|
|
||||||
void ParseData(QDataStream *aStream) override;
|
void ParseData(XDataStream *aStream) override;
|
||||||
|
|
||||||
quint32 GetSize() const;
|
quint32 GetSize() const;
|
||||||
void SetSize(quint32 size);
|
void SetSize(quint32 size);
|
||||||
@ -29,8 +24,3 @@ private:
|
|||||||
};
|
};
|
||||||
|
|
||||||
#endif // XANIMDELTAPARTQUAT_H
|
#endif // XANIMDELTAPARTQUAT_H
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -1,10 +1,12 @@
|
|||||||
#include "xanimdeltapartquatdata.h"
|
#include "xanimdeltapartquatdata.h"
|
||||||
|
|
||||||
XAnimDeltaPartQuatData::XAnimDeltaPartQuatData()
|
XAnimDeltaPartQuatData::XAnimDeltaPartQuatData()
|
||||||
: XAsset() {
|
: XAsset()
|
||||||
|
{
|
||||||
|
SetName("Animation Delta Part Quat Data");
|
||||||
}
|
}
|
||||||
|
|
||||||
void XAnimDeltaPartQuatData::ParseData(QDataStream *aStream) {
|
void XAnimDeltaPartQuatData::ParseData(XDataStream *aStream) {
|
||||||
if (GetPtr() == -1) {
|
if (GetPtr() == -1) {
|
||||||
// Parse frames
|
// Parse frames
|
||||||
mFrames.ParseData(aStream);
|
mFrames.ParseData(aStream);
|
||||||
|
|||||||
@ -1,9 +1,3 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#ifndef XANIMDELTAPARTQUATDATA_H
|
#ifndef XANIMDELTAPARTQUATDATA_H
|
||||||
#define XANIMDELTAPARTQUATDATA_H
|
#define XANIMDELTAPARTQUATDATA_H
|
||||||
|
|
||||||
@ -14,8 +8,9 @@ class XAnimDeltaPartQuatData : public XAsset
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
explicit XAnimDeltaPartQuatData();
|
explicit XAnimDeltaPartQuatData();
|
||||||
|
~XAnimDeltaPartQuatData() = default;
|
||||||
|
|
||||||
void ParseData(QDataStream *aStream) override;
|
void ParseData(XDataStream *aStream) override;
|
||||||
|
|
||||||
const XAnimDeltaPartQuatDataFrames& GetFrames() const;
|
const XAnimDeltaPartQuatDataFrames& GetFrames() const;
|
||||||
void SetFrames(const XAnimDeltaPartQuatDataFrames& frames);
|
void SetFrames(const XAnimDeltaPartQuatDataFrames& frames);
|
||||||
@ -29,8 +24,3 @@ private:
|
|||||||
};
|
};
|
||||||
|
|
||||||
#endif // XANIMDELTAPARTQUATDATA_H
|
#endif // XANIMDELTAPARTQUATDATA_H
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -1,7 +1,9 @@
|
|||||||
#include "xanimdeltapartquatdataframes.h"
|
#include "xanimdeltapartquatdataframes.h"
|
||||||
|
|
||||||
XAnimDeltaPartQuatDataFrames::XAnimDeltaPartQuatDataFrames()
|
XAnimDeltaPartQuatDataFrames::XAnimDeltaPartQuatDataFrames()
|
||||||
: XAsset() {
|
: XAsset()
|
||||||
|
{
|
||||||
|
SetName("Animation Delta Part Quat Data Frame");
|
||||||
}
|
}
|
||||||
|
|
||||||
quint32 XAnimDeltaPartQuatDataFrames::GetFramesPtr() const {
|
quint32 XAnimDeltaPartQuatDataFrames::GetFramesPtr() const {
|
||||||
@ -34,12 +36,12 @@ void XAnimDeltaPartQuatDataFrames::SetIndices(const XAnimDynamicIndices& indices
|
|||||||
mIndices = indices;
|
mIndices = indices;
|
||||||
}
|
}
|
||||||
|
|
||||||
void XAnimDeltaPartQuatDataFrames::ParseData(QDataStream *aStream) {
|
void XAnimDeltaPartQuatDataFrames::ParseData(XDataStream *aStream) {
|
||||||
if (GetPtr() == -1) {
|
if (GetPtr() == -1) {
|
||||||
*aStream
|
mFramesPtr = aStream->ParseInt32(QString("%1 frames ptr").arg(GetName()));
|
||||||
>> mFramesPtr
|
|
||||||
>> mFrames[0]
|
mFrames[0] = aStream->ParseInt16(QString("%1 frame %2").arg(GetName()).arg(0));
|
||||||
>> mFrames[1];
|
mFrames[1] = aStream->ParseInt16(QString("%1 frame %2").arg(GetName()).arg(1));
|
||||||
|
|
||||||
// Parse indices
|
// Parse indices
|
||||||
mIndices.ParseData(aStream);
|
mIndices.ParseData(aStream);
|
||||||
|
|||||||
@ -8,6 +8,7 @@ class XAnimDeltaPartQuatDataFrames : public XAsset
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
explicit XAnimDeltaPartQuatDataFrames();
|
explicit XAnimDeltaPartQuatDataFrames();
|
||||||
|
~XAnimDeltaPartQuatDataFrames() = default;
|
||||||
|
|
||||||
quint32 GetFramesPtr() const;
|
quint32 GetFramesPtr() const;
|
||||||
void SetFramesPtr(quint32 ptr);
|
void SetFramesPtr(quint32 ptr);
|
||||||
@ -19,11 +20,11 @@ public:
|
|||||||
const XAnimDynamicIndices& GetIndices() const;
|
const XAnimDynamicIndices& GetIndices() const;
|
||||||
void SetIndices(const XAnimDynamicIndices& indices);
|
void SetIndices(const XAnimDynamicIndices& indices);
|
||||||
|
|
||||||
void ParseData(QDataStream *aStream) override;
|
void ParseData(XDataStream *aStream) override;
|
||||||
void Clear() override;
|
void Clear() override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
quint32 mFramesPtr = 0;
|
qint32 mFramesPtr = 0;
|
||||||
qint16 mFrames[2] = {0};
|
qint16 mFrames[2] = {0};
|
||||||
XAnimDynamicIndices mIndices;
|
XAnimDynamicIndices mIndices;
|
||||||
};
|
};
|
||||||
|
|||||||
@ -4,24 +4,17 @@ XAnimDynamicFrames::XAnimDynamicFrames()
|
|||||||
: XAsset()
|
: XAsset()
|
||||||
, mFrames(3)
|
, mFrames(3)
|
||||||
{
|
{
|
||||||
|
SetName("Animation Dynamic Frames");
|
||||||
}
|
}
|
||||||
|
|
||||||
XAnimDynamicFrames::~XAnimDynamicFrames()
|
void XAnimDynamicFrames::ParseData(XDataStream *aStream) {
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
void XAnimDynamicFrames::ParseData(QDataStream *aStream) {
|
|
||||||
if (GetPtr() == -1) {
|
if (GetPtr() == -1) {
|
||||||
qint32 framePtr;
|
qint32 framePtr = aStream->ParseInt32(QString("%1 frames ptr").arg(GetName()));
|
||||||
*aStream >> framePtr;
|
|
||||||
|
|
||||||
if (framePtr == -1)
|
if (framePtr == -1)
|
||||||
{
|
{
|
||||||
*aStream
|
mFrames[0] = aStream->ParseUInt8(QString("%1 frame %2").arg(GetName()).arg(0));
|
||||||
>> mFrames[0]
|
mFrames[1] = aStream->ParseUInt8(QString("%1 frame %2").arg(GetName()).arg(1));
|
||||||
>> mFrames[1]
|
mFrames[2] = aStream->ParseUInt8(QString("%1 frame %2").arg(GetName()).arg(2));
|
||||||
>> mFrames[2];
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,4 +1,3 @@
|
|||||||
|
|
||||||
#ifndef XANIMDYNAMICFRAMES_H
|
#ifndef XANIMDYNAMICFRAMES_H
|
||||||
#define XANIMDYNAMICFRAMES_H
|
#define XANIMDYNAMICFRAMES_H
|
||||||
|
|
||||||
@ -10,9 +9,9 @@ class XAnimDynamicFrames : public XAsset
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
explicit XAnimDynamicFrames();
|
explicit XAnimDynamicFrames();
|
||||||
~XAnimDynamicFrames();
|
~XAnimDynamicFrames() = default;
|
||||||
|
|
||||||
void ParseData(QDataStream *aStream) override;
|
void ParseData(XDataStream *aStream) override;
|
||||||
void Clear() override;
|
void Clear() override;
|
||||||
|
|
||||||
QVector<quint8> GetFrames() const;
|
QVector<quint8> GetFrames() const;
|
||||||
|
|||||||
@ -4,16 +4,12 @@ XAnimDynamicIndices::XAnimDynamicIndices()
|
|||||||
: XAsset()
|
: XAsset()
|
||||||
, mIndices(1)
|
, mIndices(1)
|
||||||
{
|
{
|
||||||
|
SetName("Animation Dynamic Indices");
|
||||||
}
|
}
|
||||||
|
|
||||||
XAnimDynamicIndices::~XAnimDynamicIndices()
|
void XAnimDynamicIndices::ParseData(XDataStream *aStream) {
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
void XAnimDynamicIndices::ParseData(QDataStream *aStream) {
|
|
||||||
if (GetPtr() == -1) {
|
if (GetPtr() == -1) {
|
||||||
*aStream >> mIndices[0];
|
mIndices[0] = aStream->ParseUInt8(QString("%1 index").arg(GetName()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -9,9 +9,9 @@ class XAnimDynamicIndices : public XAsset
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
explicit XAnimDynamicIndices();
|
explicit XAnimDynamicIndices();
|
||||||
~XAnimDynamicIndices();
|
~XAnimDynamicIndices() = default;
|
||||||
|
|
||||||
void ParseData(QDataStream *aStream) override;
|
void ParseData(XDataStream *aStream) override;
|
||||||
void Clear() override;
|
void Clear() override;
|
||||||
|
|
||||||
QVector<quint8> GetIndices() const;
|
QVector<quint8> GetIndices() const;
|
||||||
|
|||||||
@ -4,21 +4,15 @@ XAnimIndices::XAnimIndices()
|
|||||||
: XAsset()
|
: XAsset()
|
||||||
, mIndex(0)
|
, mIndex(0)
|
||||||
{
|
{
|
||||||
|
SetName("Animation Indices");
|
||||||
}
|
}
|
||||||
|
|
||||||
XAnimIndices::~XAnimIndices()
|
void XAnimIndices::ParseData(XDataStream *aStream) {
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
void XAnimIndices::ParseData(QDataStream *aStream) {
|
|
||||||
if (GetPtr() == -1) {
|
if (GetPtr() == -1) {
|
||||||
qint32 indexPtr;
|
qint32 indexPtr = aStream->ParseInt32(QString("%1 index ptr").arg(GetName()));
|
||||||
*aStream >> indexPtr;
|
|
||||||
if (indexPtr == -1)
|
if (indexPtr == -1)
|
||||||
{
|
{
|
||||||
*aStream >> mIndex;
|
mIndex = aStream->ParseUInt32(QString("%1 index").arg(GetName()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -7,9 +7,9 @@ class XAnimIndices : public XAsset
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
explicit XAnimIndices();
|
explicit XAnimIndices();
|
||||||
~XAnimIndices();
|
~XAnimIndices() = default;
|
||||||
|
|
||||||
void ParseData(QDataStream *aStream) override;
|
void ParseData(XDataStream *aStream) override;
|
||||||
void Clear() override;
|
void Clear() override;
|
||||||
|
|
||||||
quint32 GetIndex() const;
|
quint32 GetIndex() const;
|
||||||
|
|||||||
@ -5,19 +5,14 @@ XAnimNotifyInfo::XAnimNotifyInfo()
|
|||||||
, mName(0)
|
, mName(0)
|
||||||
, mTime(0.0f)
|
, mTime(0.0f)
|
||||||
{
|
{
|
||||||
|
SetName("Animation Notify Info");
|
||||||
}
|
}
|
||||||
|
|
||||||
XAnimNotifyInfo::~XAnimNotifyInfo()
|
void XAnimNotifyInfo::ParseData(XDataStream *aStream) {
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
void XAnimNotifyInfo::ParseData(QDataStream *aStream) {
|
|
||||||
if (GetPtr() == -1) {
|
if (GetPtr() == -1) {
|
||||||
*aStream
|
|
||||||
>> mName
|
mName = aStream->ParseUInt32(QString("%1 name").arg(GetName()));
|
||||||
>> mTime;
|
mTime = aStream->ParseSingle(QString("%1 time").arg(GetName()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -26,19 +21,3 @@ void XAnimNotifyInfo::Clear()
|
|||||||
mName = 0;
|
mName = 0;
|
||||||
mTime = 0.0f;
|
mTime = 0.0f;
|
||||||
}
|
}
|
||||||
|
|
||||||
quint32 XAnimNotifyInfo::GetName() const {
|
|
||||||
return mName;
|
|
||||||
}
|
|
||||||
|
|
||||||
void XAnimNotifyInfo::SetName(quint32 name) {
|
|
||||||
mName = name;
|
|
||||||
}
|
|
||||||
|
|
||||||
float XAnimNotifyInfo::GetTime() const {
|
|
||||||
return mTime;
|
|
||||||
}
|
|
||||||
|
|
||||||
void XAnimNotifyInfo::SetTime(float time) {
|
|
||||||
mTime = time;
|
|
||||||
}
|
|
||||||
|
|||||||
@ -7,17 +7,11 @@ class XAnimNotifyInfo : public XAsset
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
explicit XAnimNotifyInfo();
|
explicit XAnimNotifyInfo();
|
||||||
~XAnimNotifyInfo();
|
~XAnimNotifyInfo() = default;
|
||||||
|
|
||||||
void ParseData(QDataStream *aStream) override;
|
void ParseData(XDataStream *aStream) override;
|
||||||
void Clear() override;
|
void Clear() override;
|
||||||
|
|
||||||
quint32 GetName() const;
|
|
||||||
void SetName(quint32 name);
|
|
||||||
|
|
||||||
float GetTime() const;
|
|
||||||
void SetTime(float time);
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
quint32 mName;
|
quint32 mName;
|
||||||
float mTime;
|
float mTime;
|
||||||
|
|||||||
@ -31,68 +31,49 @@ XAnimParts::XAnimParts()
|
|||||||
, mDeltaPart()
|
, mDeltaPart()
|
||||||
{
|
{
|
||||||
SetType(ASSET_TYPE_XANIMPARTS);
|
SetType(ASSET_TYPE_XANIMPARTS);
|
||||||
SetName("XAnimParts");
|
SetName("Animation Parts");
|
||||||
}
|
}
|
||||||
|
|
||||||
XAnimParts::~XAnimParts()
|
void XAnimParts::ParseData(XDataStream *aStream) {
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
void XAnimParts::ParseData(QDataStream *aStream) {
|
|
||||||
if (GetPtr() == -1) {
|
if (GetPtr() == -1) {
|
||||||
|
|
||||||
mName.ParsePtr(aStream, false);
|
mName.ParsePtr(aStream, false);
|
||||||
|
|
||||||
// Parse all fields
|
// Parse all fields
|
||||||
*aStream
|
mDataByteCount = aStream->ParseUInt32(QString("%1 data byte count").arg(GetName()));
|
||||||
>> mDataByteCount
|
mDataShortCount = aStream->ParseUInt32(QString("%1 data short count").arg(GetName()));
|
||||||
>> mDataShortCount
|
mDataIntCount = aStream->ParseUInt32(QString("%1 data int count").arg(GetName()));
|
||||||
>> mDataIntCount
|
mRandomDataByteCount = aStream->ParseUInt32(QString("%1 random date byte count").arg(GetName()));
|
||||||
>> mRandomDataByteCount
|
mRandomDataIntCount = aStream->ParseUInt32(QString("%1 random data int count").arg(GetName()));
|
||||||
>> mRandomDataIntCount
|
mNumFrames = aStream->ParseUInt32(QString("%1 # frames").arg(GetName()));
|
||||||
>> mNumFrames;
|
|
||||||
|
|
||||||
quint8 loopDelta;
|
quint8 loopDelta = aStream->ParseUInt8(QString("%1 loop delta").arg(GetName()));
|
||||||
*aStream >> loopDelta;
|
|
||||||
mIsLoop = (loopDelta & 0x1) != 0;
|
mIsLoop = (loopDelta & 0x1) != 0;
|
||||||
mIsDelta = (loopDelta & 0x2) != 0;
|
mIsDelta = (loopDelta & 0x2) != 0;
|
||||||
|
|
||||||
for (int i = 0; i < 12; i++)
|
for (int i = 0; i < 12; i++)
|
||||||
{
|
{
|
||||||
*aStream >> mBoneCount[i];
|
mBoneCount[i] = aStream->ParseUInt8(QString("%1 bone count %2").arg(GetName()).arg(i));
|
||||||
}
|
}
|
||||||
|
|
||||||
*aStream
|
mNotifyCount = aStream->ParseUInt8(QString("%1 notify count").arg(GetName()));
|
||||||
>> mNotifyCount
|
mAssetType = aStream->ParseUInt8(QString("%1 asset type").arg(GetName()));
|
||||||
>> mAssetType;
|
mPad = aStream->ParseUInt32(QString("%1 pad").arg(GetName())) != 0;
|
||||||
|
|
||||||
quint32 pad;
|
|
||||||
*aStream >> pad;
|
|
||||||
mPad = (pad != 0);
|
|
||||||
|
|
||||||
qint32 namesPtr, dataBytePtr, dataShortPtr, dataIntPtr,
|
qint32 namesPtr, dataBytePtr, dataShortPtr, dataIntPtr,
|
||||||
randomDataShortPtr, randomDataBytePtr, randomDataIntPtr;
|
randomDataShortPtr, randomDataBytePtr, randomDataIntPtr;
|
||||||
|
|
||||||
*aStream
|
mRandomDataShortCount = aStream->ParseUInt32(QString("%1 random data short count").arg(GetName()));
|
||||||
>> mRandomDataShortCount
|
mIndexCount = aStream->ParseUInt32(QString("%1 index count").arg(GetName()));
|
||||||
>> mIndexCount
|
mFramerate = aStream->ParseSingle(QString("%1 frame rate").arg(GetName()));
|
||||||
>> mFramerate
|
mFrequency = aStream->ParseSingle(QString("%1 frequency").arg(GetName()));
|
||||||
>> mFrequency
|
namesPtr = aStream->ParseInt32(QString("%1 names ptr").arg(GetName()));
|
||||||
>> namesPtr
|
dataBytePtr = aStream->ParseInt32(QString("%1 data byte ptr").arg(GetName()));
|
||||||
>> mNames
|
dataShortPtr = aStream->ParseInt32(QString("%1 data short ptr").arg(GetName()));
|
||||||
>> dataBytePtr
|
dataIntPtr = aStream->ParseInt32(QString("%1 data int ptr").arg(GetName()));
|
||||||
>> mDataByte
|
randomDataShortPtr = aStream->ParseInt32(QString("%1 random data short ptr").arg(GetName()));
|
||||||
>> dataShortPtr
|
randomDataBytePtr = aStream->ParseInt32(QString("%1 random data byte ptr").arg(GetName()));
|
||||||
>> mDataShort
|
randomDataIntPtr = aStream->ParseInt32(QString("%1 random data int ptr").arg(GetName()));
|
||||||
>> dataIntPtr
|
|
||||||
>> mDataInt
|
|
||||||
>> randomDataShortPtr
|
|
||||||
>> mRandomDataShort
|
|
||||||
>> randomDataBytePtr
|
|
||||||
>> mRandomDataByte
|
|
||||||
>> randomDataIntPtr
|
|
||||||
>> mRandomDataInt;
|
|
||||||
|
|
||||||
// Parse indices
|
// Parse indices
|
||||||
mIndices.ParseData(aStream);
|
mIndices.ParseData(aStream);
|
||||||
@ -102,33 +83,33 @@ void XAnimParts::ParseData(QDataStream *aStream) {
|
|||||||
mName.ParseData(aStream);
|
mName.ParseData(aStream);
|
||||||
if (namesPtr)
|
if (namesPtr)
|
||||||
{
|
{
|
||||||
|
mNames = aStream->ParseInt32(QString("%1 names").arg(GetName()));
|
||||||
}
|
}
|
||||||
mNotify.ParseData(aStream);
|
mNotify.ParseData(aStream);
|
||||||
mDeltaPart.ParseData(aStream);
|
mDeltaPart.ParseData(aStream);
|
||||||
if (dataBytePtr)
|
if (dataBytePtr)
|
||||||
{
|
{
|
||||||
*aStream >> mDataByte;
|
mDataByte = aStream->ParseUInt8(QString("%1 data byte").arg(GetName()));
|
||||||
}
|
}
|
||||||
if (dataShortPtr)
|
if (dataShortPtr)
|
||||||
{
|
{
|
||||||
*aStream >> mDataShort;
|
mDataShort = aStream->ParseInt16(QString("%1 data short").arg(GetName()));
|
||||||
}
|
}
|
||||||
if (dataIntPtr)
|
if (dataIntPtr)
|
||||||
{
|
{
|
||||||
*aStream >> mDataInt;
|
mDataInt = aStream->ParseInt32(QString("%1 data int").arg(GetName()));
|
||||||
}
|
}
|
||||||
if (randomDataShortPtr)
|
if (randomDataShortPtr)
|
||||||
{
|
{
|
||||||
*aStream >> mDataInt;
|
mRandomDataShort = aStream->ParseInt16(QString("%1 random data short").arg(GetName()));
|
||||||
}
|
}
|
||||||
if (randomDataBytePtr)
|
if (randomDataBytePtr)
|
||||||
{
|
{
|
||||||
*aStream >> mRandomDataByte;
|
mRandomDataByte = aStream->ParseUInt8(QString("%1 random data byte").arg(GetName()));
|
||||||
}
|
}
|
||||||
if (randomDataIntPtr)
|
if (randomDataIntPtr)
|
||||||
{
|
{
|
||||||
*aStream >> mRandomDataInt;
|
mRandomDataInt = aStream->ParseInt32(QString("%1 random data int").arg(GetName()));
|
||||||
}
|
}
|
||||||
mIndices.ParseData(aStream);
|
mIndices.ParseData(aStream);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -13,9 +13,9 @@ class XAnimParts : public XAsset
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
explicit XAnimParts();
|
explicit XAnimParts();
|
||||||
~XAnimParts();
|
~XAnimParts() = default;
|
||||||
|
|
||||||
void ParseData(QDataStream *aStream) override;
|
void ParseData(XDataStream *aStream) override;
|
||||||
void Clear() override;
|
void Clear() override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
@ -43,13 +43,13 @@ private:
|
|||||||
float mFramerate = 0.0f;
|
float mFramerate = 0.0f;
|
||||||
float mFrequency = 0.0f;
|
float mFrequency = 0.0f;
|
||||||
|
|
||||||
quint32 mNames = 0;
|
quint16 mNames = 0;
|
||||||
quint8 mDataByte = 0;
|
quint8 mDataByte = 0;
|
||||||
qint16 mDataShort = 0;
|
qint16 mDataShort = 0;
|
||||||
int mDataInt = 0;
|
qint32 mDataInt = 0;
|
||||||
qint16 mRandomDataShort = 0;
|
qint16 mRandomDataShort = 0;
|
||||||
quint8 mRandomDataByte = 0;
|
quint8 mRandomDataByte = 0;
|
||||||
int mRandomDataInt = 0;
|
qint32 mRandomDataInt = 0;
|
||||||
XAnimIndices mIndices;
|
XAnimIndices mIndices;
|
||||||
XAnimNotifyInfo mNotify;
|
XAnimNotifyInfo mNotify;
|
||||||
XAnimDeltaPart mDeltaPart;
|
XAnimDeltaPart mDeltaPart;
|
||||||
|
|||||||
@ -6,6 +6,7 @@ XAnimPartTrans::XAnimPartTrans()
|
|||||||
, mIsSmallTrans(false)
|
, mIsSmallTrans(false)
|
||||||
, mData()
|
, mData()
|
||||||
{
|
{
|
||||||
|
SetName("Animation Part Trans");
|
||||||
}
|
}
|
||||||
|
|
||||||
XAnimPartTrans::XAnimPartTrans(const XAnimPartTrans &aSrc)
|
XAnimPartTrans::XAnimPartTrans(const XAnimPartTrans &aSrc)
|
||||||
@ -17,18 +18,10 @@ XAnimPartTrans::XAnimPartTrans(const XAnimPartTrans &aSrc)
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
XAnimPartTrans::~XAnimPartTrans()
|
void XAnimPartTrans::ParseData(XDataStream *aStream) {
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
void XAnimPartTrans::ParseData(QDataStream *aStream) {
|
|
||||||
if (GetPtr() == -1) {
|
if (GetPtr() == -1) {
|
||||||
quint8 smallTransByte;
|
mSize = aStream->ParseUInt32(QString("%1 size").arg(GetName()));
|
||||||
*aStream
|
mIsSmallTrans = aStream->ParseUInt8(QString("%1 is small trans").arg(GetName())) != 0;
|
||||||
>> mSize
|
|
||||||
>> smallTransByte;
|
|
||||||
mIsSmallTrans = (smallTransByte != 0);
|
|
||||||
|
|
||||||
// Parse data
|
// Parse data
|
||||||
mData.ParseData(aStream);
|
mData.ParseData(aStream);
|
||||||
|
|||||||
@ -9,9 +9,9 @@ class XAnimPartTrans : public XAsset
|
|||||||
public:
|
public:
|
||||||
explicit XAnimPartTrans();
|
explicit XAnimPartTrans();
|
||||||
XAnimPartTrans(const XAnimPartTrans& aSrc);
|
XAnimPartTrans(const XAnimPartTrans& aSrc);
|
||||||
~XAnimPartTrans();
|
~XAnimPartTrans() = default;
|
||||||
|
|
||||||
void ParseData(QDataStream* aStream) override;
|
void ParseData(XDataStream* aStream) override;
|
||||||
void Clear() override;
|
void Clear() override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|||||||
@ -5,6 +5,7 @@ XAnimPartTransData::XAnimPartTransData()
|
|||||||
, mFrames()
|
, mFrames()
|
||||||
, mFrame()
|
, mFrame()
|
||||||
{
|
{
|
||||||
|
SetName("Animation Part Trans Data");
|
||||||
}
|
}
|
||||||
|
|
||||||
XAnimPartTransData::XAnimPartTransData(const XAnimPartTransData &aSrc)
|
XAnimPartTransData::XAnimPartTransData(const XAnimPartTransData &aSrc)
|
||||||
@ -15,12 +16,7 @@ XAnimPartTransData::XAnimPartTransData(const XAnimPartTransData &aSrc)
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
XAnimPartTransData::~XAnimPartTransData()
|
void XAnimPartTransData::ParseData(XDataStream *aStream) {
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
void XAnimPartTransData::ParseData(QDataStream *aStream) {
|
|
||||||
if (GetPtr() == -1) {
|
if (GetPtr() == -1) {
|
||||||
// We need to determine which part of the union to parse
|
// We need to determine which part of the union to parse
|
||||||
// For simplicity, we'll assume it's always frames for now
|
// For simplicity, we'll assume it's always frames for now
|
||||||
|
|||||||
@ -9,9 +9,9 @@ class XAnimPartTransData : public XAsset
|
|||||||
public:
|
public:
|
||||||
explicit XAnimPartTransData();
|
explicit XAnimPartTransData();
|
||||||
XAnimPartTransData(const XAnimPartTransData &aSrc);
|
XAnimPartTransData(const XAnimPartTransData &aSrc);
|
||||||
~XAnimPartTransData();
|
~XAnimPartTransData() = default;
|
||||||
|
|
||||||
void ParseData(QDataStream *aStream) override;
|
void ParseData(XDataStream *aStream) override;
|
||||||
void Clear() override;
|
void Clear() override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|||||||
@ -7,22 +7,17 @@ XAnimPartTransFrames::XAnimPartTransFrames()
|
|||||||
, mFrames()
|
, mFrames()
|
||||||
, mIndices()
|
, mIndices()
|
||||||
{
|
{
|
||||||
|
SetName("Animation Parts Trans Frames");
|
||||||
}
|
}
|
||||||
|
|
||||||
XAnimPartTransFrames::~XAnimPartTransFrames()
|
void XAnimPartTransFrames::ParseData(XDataStream *aStream) {
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
void XAnimPartTransFrames::ParseData(QDataStream *aStream) {
|
|
||||||
if (GetPtr() == -1) {
|
if (GetPtr() == -1) {
|
||||||
*aStream
|
mMins[0] = aStream->ParseSingle(QString("%1 min %2").arg(GetName()).arg(0));
|
||||||
>> mMins[0]
|
mMins[1] = aStream->ParseSingle(QString("%1 min %2").arg(GetName()).arg(1));
|
||||||
>> mMins[1]
|
mMins[2] = aStream->ParseSingle(QString("%1 min %2").arg(GetName()).arg(2));
|
||||||
>> mMins[2]
|
mMaxs[0] = aStream->ParseSingle(QString("%1 max %2").arg(GetName()).arg(0));
|
||||||
>> mMaxs[0]
|
mMaxs[1] = aStream->ParseSingle(QString("%1 max %2").arg(GetName()).arg(1));
|
||||||
>> mMaxs[1]
|
mMaxs[2] = aStream->ParseSingle(QString("%1 max %2").arg(GetName()).arg(2));
|
||||||
>> mMaxs[2];
|
|
||||||
|
|
||||||
// Parse frames
|
// Parse frames
|
||||||
mFrames.ParseData(aStream);
|
mFrames.ParseData(aStream);
|
||||||
|
|||||||
@ -11,9 +11,9 @@ class XAnimPartTransFrames : public XAsset
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
explicit XAnimPartTransFrames();
|
explicit XAnimPartTransFrames();
|
||||||
~XAnimPartTransFrames();
|
~XAnimPartTransFrames() = default;
|
||||||
|
|
||||||
void ParseData(QDataStream *aStream) override;
|
void ParseData(XDataStream *aStream) override;
|
||||||
void Clear() override;
|
void Clear() override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|||||||
@ -19,8 +19,6 @@
|
|||||||
#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)
|
||||||
@ -29,11 +27,6 @@ XAsset::XAsset()
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
XAsset::~XAsset()
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
void XAsset::SetPtr(qint32 aPtr) {
|
void XAsset::SetPtr(qint32 aPtr) {
|
||||||
mPtr = aPtr;
|
mPtr = aPtr;
|
||||||
}
|
}
|
||||||
@ -83,20 +76,9 @@ void XAsset::Clear()
|
|||||||
mType = ASSET_TYPE_NONE;
|
mType = ASSET_TYPE_NONE;
|
||||||
}
|
}
|
||||||
|
|
||||||
void XAsset::ParsePtr(QDataStream *aStream, bool aDataFlag) {
|
void XAsset::ParsePtr(XDataStream *aStream, bool aDataFlag) {
|
||||||
*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);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
mPtr = aStream->ParseInt32(QString("%1 ptr").arg(GetName()));
|
||||||
if (aDataFlag && mPtr == -1)
|
if (aDataFlag && mPtr == -1)
|
||||||
{
|
{
|
||||||
ParseData(aStream);
|
ParseData(aStream);
|
||||||
@ -105,10 +87,6 @@ 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:
|
||||||
|
|||||||
@ -3,7 +3,7 @@
|
|||||||
|
|
||||||
#include "xassettype.h"
|
#include "xassettype.h"
|
||||||
|
|
||||||
#include <QDataStream>
|
#include "xdatastream.h"
|
||||||
#include <QString>
|
#include <QString>
|
||||||
#include <QDebug>
|
#include <QDebug>
|
||||||
#include <QIODevice>
|
#include <QIODevice>
|
||||||
@ -12,7 +12,7 @@ class XAsset
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
XAsset();
|
XAsset();
|
||||||
virtual ~XAsset();
|
virtual ~XAsset() = default;
|
||||||
|
|
||||||
void SetPtr(qint32 aPtr);
|
void SetPtr(qint32 aPtr);
|
||||||
qint32 GetPtr() const;
|
qint32 GetPtr() const;
|
||||||
@ -27,8 +27,8 @@ public:
|
|||||||
bool IsDebug() const;
|
bool IsDebug() const;
|
||||||
|
|
||||||
virtual void Clear();
|
virtual void Clear();
|
||||||
virtual void ParsePtr(QDataStream *aStream, bool aDataFlag = true);
|
virtual void ParsePtr(XDataStream *aStream, bool aDataFlag = true);
|
||||||
virtual void ParseData(QDataStream *aStream) = 0;
|
virtual void ParseData(XDataStream *aStream) = 0;
|
||||||
|
|
||||||
static XAsset* Create(XAssetType aAssetType);
|
static XAsset* Create(XAssetType aAssetType);
|
||||||
static QString XAssetTypeToString(XAssetType type);
|
static QString XAssetTypeToString(XAssetType type);
|
||||||
|
|||||||
@ -3,41 +3,39 @@
|
|||||||
|
|
||||||
XAssetHeader::XAssetHeader()
|
XAssetHeader::XAssetHeader()
|
||||||
: XAsset()
|
: XAsset()
|
||||||
|
, mRawType(0)
|
||||||
, mAssetType()
|
, mAssetType()
|
||||||
, mAssetPtr(0)
|
, mAssetPtr(0)
|
||||||
, mZoneFile(nullptr)
|
, mZoneFile(nullptr)
|
||||||
{
|
{
|
||||||
|
SetName("Asset Header");
|
||||||
}
|
}
|
||||||
|
|
||||||
XAssetHeader::XAssetHeader(ZoneFile *aZoneFile)
|
XAssetHeader::XAssetHeader(ZoneFile *aZoneFile)
|
||||||
: XAsset()
|
: XAsset()
|
||||||
|
, mRawType(0)
|
||||||
, mAssetType()
|
, mAssetType()
|
||||||
, mAssetPtr(0)
|
, mAssetPtr(0)
|
||||||
, mZoneFile(aZoneFile)
|
, mZoneFile(aZoneFile)
|
||||||
{
|
{
|
||||||
|
SetName("Asset Header");
|
||||||
}
|
}
|
||||||
|
|
||||||
XAssetHeader::~XAssetHeader()
|
void XAssetHeader::ParseData(XDataStream *aStream)
|
||||||
{
|
{
|
||||||
|
mRawType = aStream->ParseUInt32(QString("%1 raw type").arg(GetName()));
|
||||||
|
mAssetPtr = aStream->ParseInt32(QString("%1 asset ptr").arg(GetName()));
|
||||||
|
|
||||||
}
|
mAssetType = mZoneFile->GetType(mRawType);
|
||||||
|
|
||||||
void XAssetHeader::ParseData(QDataStream *aStream)
|
qDebug() << "Found asset:" << XAssetTypeToString(mAssetType) << QString::number(mRawType, 16);
|
||||||
{
|
|
||||||
quint32 rawAssetType;
|
|
||||||
*aStream
|
|
||||||
>> rawAssetType
|
|
||||||
>> mAssetPtr;
|
|
||||||
|
|
||||||
mAssetType = mZoneFile->GetType(rawAssetType);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void XAssetHeader::Clear()
|
void XAssetHeader::Clear()
|
||||||
{
|
{
|
||||||
mAssetType = ASSET_TYPE_NONE;
|
mAssetType = ASSET_TYPE_NONE;
|
||||||
mAssetPtr = 0;
|
mAssetPtr = 0;
|
||||||
|
mRawType = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
XAssetType XAssetHeader::GetAssetType() const
|
XAssetType XAssetHeader::GetAssetType() const
|
||||||
@ -45,6 +43,11 @@ XAssetType XAssetHeader::GetAssetType() const
|
|||||||
return mAssetType;
|
return mAssetType;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
quint32 XAssetHeader::GetRawAssetType() const
|
||||||
|
{
|
||||||
|
return mRawType;
|
||||||
|
}
|
||||||
|
|
||||||
qint32 XAssetHeader::GetAssetPtr() const
|
qint32 XAssetHeader::GetAssetPtr() const
|
||||||
{
|
{
|
||||||
return mAssetPtr;
|
return mAssetPtr;
|
||||||
|
|||||||
@ -10,15 +10,17 @@ class XAssetHeader: public XAsset
|
|||||||
public:
|
public:
|
||||||
explicit XAssetHeader();
|
explicit XAssetHeader();
|
||||||
XAssetHeader(ZoneFile* aZoneFile);
|
XAssetHeader(ZoneFile* aZoneFile);
|
||||||
~XAssetHeader();
|
~XAssetHeader() = default;
|
||||||
|
|
||||||
void ParseData(QDataStream *aStream) override;
|
void ParseData(XDataStream *aStream) override;
|
||||||
void Clear() override;
|
void Clear() override;
|
||||||
|
|
||||||
XAssetType GetAssetType() const;
|
XAssetType GetAssetType() const;
|
||||||
|
quint32 GetRawAssetType() const;
|
||||||
qint32 GetAssetPtr() const;
|
qint32 GetAssetPtr() const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
quint32 mRawType;
|
||||||
XAssetType mAssetType;
|
XAssetType mAssetType;
|
||||||
qint32 mAssetPtr;
|
qint32 mAssetPtr;
|
||||||
ZoneFile *mZoneFile;
|
ZoneFile *mZoneFile;
|
||||||
|
|||||||
@ -10,6 +10,8 @@ XAssetList::XAssetList()
|
|||||||
, mAssetHeaders()
|
, mAssetHeaders()
|
||||||
, mZoneFile(nullptr)
|
, mZoneFile(nullptr)
|
||||||
{
|
{
|
||||||
|
SetType(ASSET_TYPE_ASSETLIST);
|
||||||
|
SetName("Asset List");
|
||||||
}
|
}
|
||||||
|
|
||||||
XAssetList::XAssetList(ZoneFile* aZoneFile)
|
XAssetList::XAssetList(ZoneFile* aZoneFile)
|
||||||
@ -29,30 +31,23 @@ XAssetList::~XAssetList()
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void XAssetList::ParseData(QDataStream *aStream) {
|
void XAssetList::ParseData(XDataStream *aStream) {
|
||||||
// Parse string list
|
// Parse string list
|
||||||
if (IsDebug())
|
if (IsDebug())
|
||||||
{
|
{
|
||||||
qDebug() << QString("[%1] Parsing data for %2").arg(aStream->device()->pos(), 10, 10, QChar('0')).arg(GetName());
|
qDebug() << QString("[%1] Parsing data for %2").arg(aStream->device()->pos(), 10, 10, QChar('0')).arg(GetName());
|
||||||
}
|
}
|
||||||
mStringList.ParsePtr(aStream);
|
mStringList.ParsePtr(aStream, false);
|
||||||
|
|
||||||
// Parse asset count and assets
|
// Parse asset count and assets
|
||||||
qint32 assetsPtr;
|
mAssetCount = aStream->ParseUInt32(QString("%1 asset count").arg(GetName()));
|
||||||
*aStream
|
qint32 assetsPtr = aStream->ParseInt32(QString("%1 assets ptr").arg(GetName()));
|
||||||
>> mAssetCount
|
|
||||||
>> assetsPtr;
|
|
||||||
if (IsDebug())
|
|
||||||
{
|
|
||||||
qDebug() << QString("[%1] mAssetCount = %2").arg(aStream->device()->pos(), 10, 10, QChar('0')).arg(mAssetCount);
|
|
||||||
qDebug() << QString("[%1] assetsPtr = %2").arg(aStream->device()->pos(), 10, 10, QChar('0')).arg(assetsPtr);
|
|
||||||
}
|
|
||||||
|
|
||||||
mStringList.ParseData(aStream);
|
mStringList.ParseData(aStream);
|
||||||
|
|
||||||
if (assetsPtr)
|
if (assetsPtr)
|
||||||
{
|
{
|
||||||
for (int i = 0; i < mAssetCount; i++)
|
for (quint32 i = 0; i < mAssetCount; i++)
|
||||||
{
|
{
|
||||||
XAssetHeader assetHeader(mZoneFile);
|
XAssetHeader assetHeader(mZoneFile);
|
||||||
assetHeader.ParseData(aStream);
|
assetHeader.ParseData(aStream);
|
||||||
@ -62,11 +57,19 @@ void XAssetList::ParseData(QDataStream *aStream) {
|
|||||||
|
|
||||||
for (int i = 0; i < mAssetHeaders.size(); i++)
|
for (int i = 0; i < mAssetHeaders.size(); i++)
|
||||||
{
|
{
|
||||||
|
if (aStream->device()->pos() > 98000)
|
||||||
|
{
|
||||||
|
qDebug() << "test";
|
||||||
|
}
|
||||||
XAssetHeader assetHeader = mAssetHeaders[i];
|
XAssetHeader assetHeader = mAssetHeaders[i];
|
||||||
XAsset* asset = XAsset::Create(assetHeader.GetAssetType());
|
XAsset* asset = XAsset::Create(assetHeader.GetAssetType());
|
||||||
asset->ParseData(aStream);
|
if (asset)
|
||||||
|
{
|
||||||
|
asset->SetPtr(assetHeader.GetAssetPtr());
|
||||||
|
asset->ParseData(aStream);
|
||||||
|
|
||||||
mAssets.append(asset);
|
mAssets.append(asset);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -14,9 +14,9 @@ class XAssetList : public XAsset
|
|||||||
public:
|
public:
|
||||||
explicit XAssetList();
|
explicit XAssetList();
|
||||||
XAssetList(ZoneFile* aZoneFile);
|
XAssetList(ZoneFile* aZoneFile);
|
||||||
~XAssetList();
|
~XAssetList() override;
|
||||||
|
|
||||||
void ParseData(QDataStream *aStream) override;
|
void ParseData(XDataStream *aStream) override;
|
||||||
void Clear() override;
|
void Clear() override;
|
||||||
|
|
||||||
XScriptStringList GetStringList() const;
|
XScriptStringList GetStringList() const;
|
||||||
|
|||||||
@ -5,7 +5,7 @@ XAudioChannelMap::XAudioChannelMap()
|
|||||||
, mEntryCount(0)
|
, mEntryCount(0)
|
||||||
, mEntries(QVector<XAudioChannelMapEntry*>())
|
, mEntries(QVector<XAudioChannelMapEntry*>())
|
||||||
{
|
{
|
||||||
|
SetName("Audio Channel Map");
|
||||||
}
|
}
|
||||||
|
|
||||||
XAudioChannelMap::~XAudioChannelMap()
|
XAudioChannelMap::~XAudioChannelMap()
|
||||||
@ -32,15 +32,13 @@ void XAudioChannelMap::SetMapEntry(int aIndex, XAudioChannelMapEntry *aEntry)
|
|||||||
mEntries[aIndex] = aEntry;
|
mEntries[aIndex] = aEntry;
|
||||||
}
|
}
|
||||||
|
|
||||||
void XAudioChannelMap::ParseData(QDataStream *aStream)
|
void XAudioChannelMap::ParseData(XDataStream *aStream)
|
||||||
{
|
{
|
||||||
*aStream >> mEntryCount;
|
mEntryCount = aStream->ParseUInt8(QString("%1 entry count").arg(GetName()));
|
||||||
|
|
||||||
aStream->skipRawData(3);
|
aStream->skipRawData(3);
|
||||||
|
|
||||||
quint32 entriesPtr;
|
quint32 entriesPtr = aStream->ParseInt32(QString("%1 entries ptr").arg(GetName()));
|
||||||
*aStream >> entriesPtr;
|
|
||||||
|
|
||||||
if (entriesPtr)
|
if (entriesPtr)
|
||||||
{
|
{
|
||||||
mEntries.resize(mEntryCount);
|
mEntries.resize(mEntryCount);
|
||||||
|
|||||||
@ -17,7 +17,7 @@ public:
|
|||||||
XAudioChannelMapEntry* GetMapEntry(int aIndex) const;
|
XAudioChannelMapEntry* GetMapEntry(int aIndex) const;
|
||||||
void SetMapEntry(int aIndex, XAudioChannelMapEntry* aEntry);
|
void SetMapEntry(int aIndex, XAudioChannelMapEntry* aEntry);
|
||||||
|
|
||||||
virtual void ParseData(QDataStream* aStream) override;
|
virtual void ParseData(XDataStream* aStream) override;
|
||||||
virtual void Clear() override;
|
virtual void Clear() override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|||||||
@ -6,7 +6,7 @@ XAudioChannelMapEntry::XAudioChannelMapEntry()
|
|||||||
, mOutputChannel(0)
|
, mOutputChannel(0)
|
||||||
, mVolume(0.0)
|
, mVolume(0.0)
|
||||||
{
|
{
|
||||||
|
SetName("Audio Channel Map Entry");
|
||||||
}
|
}
|
||||||
|
|
||||||
XAudioChannelMapEntry::~XAudioChannelMapEntry()
|
XAudioChannelMapEntry::~XAudioChannelMapEntry()
|
||||||
@ -44,16 +44,15 @@ void XAudioChannelMapEntry::SetVolume(float aVolume)
|
|||||||
mVolume = aVolume;
|
mVolume = aVolume;
|
||||||
}
|
}
|
||||||
|
|
||||||
void XAudioChannelMapEntry::ParseData(QDataStream *aStream)
|
void XAudioChannelMapEntry::ParseData(XDataStream *aStream)
|
||||||
{
|
{
|
||||||
*aStream
|
mInputChannel = aStream->ParseUInt8(QString("%1 input channel").arg(GetName()));
|
||||||
>> mInputChannel
|
mOutputChannel = aStream->ParseUInt8(QString("%1 output channel").arg(GetName()));
|
||||||
>> mOutputChannel;
|
|
||||||
|
|
||||||
// Skip padding bytes in struct
|
// Skip padding bytes in struct
|
||||||
aStream->skipRawData(2);
|
aStream->skipRawData(2);
|
||||||
|
|
||||||
*aStream >> mVolume;
|
mVolume = aStream->ParseSingle(QString("%1 volume").arg(GetName()));
|
||||||
}
|
}
|
||||||
|
|
||||||
void XAudioChannelMapEntry::Clear()
|
void XAudioChannelMapEntry::Clear()
|
||||||
|
|||||||
@ -18,7 +18,7 @@ public:
|
|||||||
float GetVolume() const;
|
float GetVolume() const;
|
||||||
void SetVolume(float aVolume);
|
void SetVolume(float aVolume);
|
||||||
|
|
||||||
virtual void ParseData(QDataStream* aStream) override;
|
virtual void ParseData(XDataStream* aStream) override;
|
||||||
virtual void Clear() override;
|
virtual void Clear() override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|||||||
@ -1,8 +1,10 @@
|
|||||||
#include "xaudioformatinfo.h"
|
#include "xaudioformatinfo.h"
|
||||||
|
|
||||||
XAudioFormatInfo::XAudioFormatInfo()
|
XAudioFormatInfo::XAudioFormatInfo()
|
||||||
|
: XAsset()
|
||||||
|
, mStream()
|
||||||
{
|
{
|
||||||
|
SetName("Audio Format Info");
|
||||||
}
|
}
|
||||||
|
|
||||||
XAudioFormatInfo::~XAudioFormatInfo()
|
XAudioFormatInfo::~XAudioFormatInfo()
|
||||||
@ -10,12 +12,14 @@ XAudioFormatInfo::~XAudioFormatInfo()
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void XAudioFormatInfo::ParseData(QDataStream *aStream)
|
void XAudioFormatInfo::ParseData(XDataStream *aStream)
|
||||||
{
|
{
|
||||||
|
Q_UNUSED(aStream);
|
||||||
|
|
||||||
|
// TODO: Implement ParseData(...) for XAudioFormatInfo
|
||||||
}
|
}
|
||||||
|
|
||||||
void XAudioFormatInfo::Clear()
|
void XAudioFormatInfo::Clear()
|
||||||
{
|
{
|
||||||
|
mStream.clear();
|
||||||
}
|
}
|
||||||
|
|||||||
@ -2,22 +2,21 @@
|
|||||||
#define XAUDIOFORMATINFO_H
|
#define XAUDIOFORMATINFO_H
|
||||||
|
|
||||||
#include "xasset.h"
|
#include "xasset.h"
|
||||||
|
#include "xaudioxmaformat.h"
|
||||||
|
|
||||||
#include <QVector>
|
#include <QVector>
|
||||||
|
|
||||||
class XAudioXmaFormat;
|
|
||||||
|
|
||||||
class XAudioFormatInfo : public XAsset
|
class XAudioFormatInfo : public XAsset
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
XAudioFormatInfo();
|
explicit XAudioFormatInfo();
|
||||||
~XAudioFormatInfo();
|
~XAudioFormatInfo();
|
||||||
|
|
||||||
virtual void ParseData(QDataStream* aStream) override;
|
virtual void ParseData(XDataStream* aStream) override;
|
||||||
virtual void Clear() override;
|
virtual void Clear() override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QVector<XAudioXmaFormat*> mStream;
|
QVector<XAudioXmaFormat> mStream;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // XAUDIOFORMATINFO_H
|
#endif // XAUDIOFORMATINFO_H
|
||||||
|
|||||||
@ -8,7 +8,7 @@ XAudioPacketAligned::XAudioPacketAligned()
|
|||||||
, aXmaLoop()
|
, aXmaLoop()
|
||||||
, mContext()
|
, mContext()
|
||||||
{
|
{
|
||||||
|
SetName("Audio Packet Aligned");
|
||||||
}
|
}
|
||||||
|
|
||||||
XAudioPacketAligned::~XAudioPacketAligned()
|
XAudioPacketAligned::~XAudioPacketAligned()
|
||||||
@ -16,14 +16,11 @@ XAudioPacketAligned::~XAudioPacketAligned()
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void XAudioPacketAligned::ParseData(QDataStream *aStream)
|
void XAudioPacketAligned::ParseData(XDataStream *aStream)
|
||||||
{
|
{
|
||||||
qint32 bufferPtr, contextPtr;
|
qint32 bufferPtr = aStream->ParseInt32(QString("%1 buffer ptr").arg(GetName()));
|
||||||
|
mBufferSize = aStream->ParseUInt32(QString("%1 buffer size").arg(GetName()));
|
||||||
*aStream
|
mLoopCount = aStream->ParseUInt32(QString("%1 loop count").arg(GetName()));
|
||||||
>> bufferPtr
|
|
||||||
>> mBufferSize
|
|
||||||
>> mLoopCount;
|
|
||||||
|
|
||||||
for (int i = 0; i < 6; i++)
|
for (int i = 0; i < 6; i++)
|
||||||
{
|
{
|
||||||
@ -31,15 +28,16 @@ void XAudioPacketAligned::ParseData(QDataStream *aStream)
|
|||||||
loop.ParseData(aStream);
|
loop.ParseData(aStream);
|
||||||
}
|
}
|
||||||
|
|
||||||
*aStream >> contextPtr;
|
qint32 contextPtr = aStream->ParseInt32(QString("%1 context ptr").arg(GetName()));
|
||||||
|
|
||||||
if (bufferPtr)
|
if (bufferPtr)
|
||||||
{
|
{
|
||||||
aStream->readRawData(mBuffer.data(), mBufferSize);
|
aStream->readRawData(mBuffer.data(), mBufferSize);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (contextPtr)
|
if (contextPtr)
|
||||||
{
|
{
|
||||||
*aStream >> mContext;
|
mContext = aStream->ParseInt8(QString("%1 context").arg(GetName()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -12,7 +12,7 @@ public:
|
|||||||
XAudioPacketAligned();
|
XAudioPacketAligned();
|
||||||
~XAudioPacketAligned();
|
~XAudioPacketAligned();
|
||||||
|
|
||||||
virtual void ParseData(QDataStream* aStream) override;
|
virtual void ParseData(XDataStream* aStream) override;
|
||||||
virtual void Clear() override;
|
virtual void Clear() override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|||||||
@ -5,7 +5,7 @@ XAudioReverbSettings::XAudioReverbSettings()
|
|||||||
, mPresetOverridden(0)
|
, mPresetOverridden(0)
|
||||||
, mReverbSettings(new XReverbSettings())
|
, mReverbSettings(new XReverbSettings())
|
||||||
{
|
{
|
||||||
|
SetName("Audio Reverb Settings");
|
||||||
}
|
}
|
||||||
|
|
||||||
void XAudioReverbSettings::Clear()
|
void XAudioReverbSettings::Clear()
|
||||||
@ -24,12 +24,11 @@ XReverbSettings* XAudioReverbSettings::GetReverbSettings() const
|
|||||||
return mReverbSettings;
|
return mReverbSettings;
|
||||||
}
|
}
|
||||||
|
|
||||||
void XAudioReverbSettings::ParseData(QDataStream *aStream)
|
void XAudioReverbSettings::ParseData(XDataStream *aStream)
|
||||||
{
|
{
|
||||||
if (GetPtr())
|
if (GetPtr())
|
||||||
{
|
{
|
||||||
*aStream
|
mPresetOverridden = aStream->ParseInt32(QString("%1 preset overidden").arg(GetName()));
|
||||||
>> mPresetOverridden;
|
|
||||||
|
|
||||||
if (mReverbSettings != nullptr)
|
if (mReverbSettings != nullptr)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -16,10 +16,10 @@ public:
|
|||||||
void SetReverbSettings(XReverbSettings* aReverbSettings);
|
void SetReverbSettings(XReverbSettings* aReverbSettings);
|
||||||
|
|
||||||
virtual void Clear() override;
|
virtual void Clear() override;
|
||||||
virtual void ParseData(QDataStream *aStream) override;
|
virtual void ParseData(XDataStream *aStream) override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
int mPresetOverridden;
|
qint32 mPresetOverridden;
|
||||||
XReverbSettings* mReverbSettings;
|
XReverbSettings* mReverbSettings;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@ -5,7 +5,7 @@ XAudioSeekTable::XAudioSeekTable()
|
|||||||
, mSize(0)
|
, mSize(0)
|
||||||
, mData()
|
, mData()
|
||||||
{
|
{
|
||||||
|
SetName("Audio Seek Table");
|
||||||
}
|
}
|
||||||
|
|
||||||
XAudioSeekTable::~XAudioSeekTable()
|
XAudioSeekTable::~XAudioSeekTable()
|
||||||
@ -13,13 +13,11 @@ XAudioSeekTable::~XAudioSeekTable()
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void XAudioSeekTable::ParseData(QDataStream *aStream)
|
void XAudioSeekTable::ParseData(XDataStream *aStream)
|
||||||
{
|
{
|
||||||
qint32 dataPtr;
|
mSize = aStream->ParseUInt32(QString("%1 size").arg(GetName()));
|
||||||
*aStream
|
|
||||||
>> mSize
|
|
||||||
>> dataPtr;
|
|
||||||
|
|
||||||
|
qint32 dataPtr = aStream->ParseInt32(QString("%1 data ptr").arg(GetName()));
|
||||||
if (dataPtr)
|
if (dataPtr)
|
||||||
{
|
{
|
||||||
aStream->readRawData(mData.data(), 4 * mSize);
|
aStream->readRawData(mData.data(), 4 * mSize);
|
||||||
|
|||||||
@ -11,7 +11,7 @@ public:
|
|||||||
XAudioSeekTable();
|
XAudioSeekTable();
|
||||||
~XAudioSeekTable();
|
~XAudioSeekTable();
|
||||||
|
|
||||||
virtual void ParseData(QDataStream* aStream) override;
|
virtual void ParseData(XDataStream* aStream) override;
|
||||||
virtual void Clear() override;
|
virtual void Clear() override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|||||||
@ -7,7 +7,7 @@ XAudioSound::XAudioSound()
|
|||||||
, mXmaDataInfo()
|
, mXmaDataInfo()
|
||||||
, mSeekTable()
|
, mSeekTable()
|
||||||
{
|
{
|
||||||
|
SetName("Audio Sound");
|
||||||
}
|
}
|
||||||
|
|
||||||
XAudioSound::~XAudioSound()
|
XAudioSound::~XAudioSound()
|
||||||
@ -15,7 +15,7 @@ XAudioSound::~XAudioSound()
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void XAudioSound::ParseData(QDataStream *aStream)
|
void XAudioSound::ParseData(XDataStream *aStream)
|
||||||
{
|
{
|
||||||
mPacket.ParseData(aStream);
|
mPacket.ParseData(aStream);
|
||||||
mFormat.ParseData(aStream);
|
mFormat.ParseData(aStream);
|
||||||
|
|||||||
@ -13,7 +13,7 @@ public:
|
|||||||
XAudioSound();
|
XAudioSound();
|
||||||
~XAudioSound();
|
~XAudioSound();
|
||||||
|
|
||||||
virtual void ParseData(QDataStream* aStream) override;
|
virtual void ParseData(XDataStream* aStream) override;
|
||||||
virtual void Clear() override;
|
virtual void Clear() override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|||||||
@ -1,8 +1,12 @@
|
|||||||
#include "xaudiosourceformat.h"
|
#include "xaudiosourceformat.h"
|
||||||
|
|
||||||
XAudioSourceFormat::XAudioSourceFormat()
|
XAudioSourceFormat::XAudioSourceFormat()
|
||||||
|
: XAsset()
|
||||||
|
, mSampleType(0)
|
||||||
|
, mStreamInfo()
|
||||||
|
, mAudioFormatInfo()
|
||||||
{
|
{
|
||||||
|
SetName("Audio Source Format");
|
||||||
}
|
}
|
||||||
|
|
||||||
XAudioSourceFormat::~XAudioSourceFormat()
|
XAudioSourceFormat::~XAudioSourceFormat()
|
||||||
@ -10,12 +14,23 @@ XAudioSourceFormat::~XAudioSourceFormat()
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void XAudioSourceFormat::ParseData(QDataStream *aStream)
|
void XAudioSourceFormat::ParseData(XDataStream *aStream)
|
||||||
{
|
{
|
||||||
|
mSampleType = aStream->ParseUInt8(QString("%1 sample type").arg(GetName()));
|
||||||
|
|
||||||
|
aStream->skipRawData(3);
|
||||||
|
|
||||||
|
mStreamInfo.ParsePtr(aStream, false);
|
||||||
|
mAudioFormatInfo.ParsePtr(aStream, false);
|
||||||
|
|
||||||
|
mStreamInfo.ParseData(aStream);
|
||||||
|
mAudioFormatInfo.ParseData(aStream);
|
||||||
}
|
}
|
||||||
|
|
||||||
void XAudioSourceFormat::Clear()
|
void XAudioSourceFormat::Clear()
|
||||||
{
|
{
|
||||||
|
|
||||||
|
mSampleType = 0;
|
||||||
|
mStreamInfo.Clear();
|
||||||
|
mAudioFormatInfo.Clear();
|
||||||
}
|
}
|
||||||
|
|||||||
@ -3,22 +3,21 @@
|
|||||||
|
|
||||||
#include "xasset.h"
|
#include "xasset.h"
|
||||||
#include "xaudioformatinfo.h"
|
#include "xaudioformatinfo.h"
|
||||||
|
#include "xaudiostreaminfo.h"
|
||||||
class XAudioStreamInfo;
|
|
||||||
|
|
||||||
class XAudioSourceFormat : public XAsset
|
class XAudioSourceFormat : public XAsset
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
XAudioSourceFormat();
|
explicit XAudioSourceFormat();
|
||||||
~XAudioSourceFormat();
|
~XAudioSourceFormat();
|
||||||
|
|
||||||
virtual void ParseData(QDataStream* aStream) override;
|
virtual void ParseData(XDataStream* aStream) override;
|
||||||
virtual void Clear() override;
|
virtual void Clear() override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
quint8 mSampleType;
|
quint8 mSampleType;
|
||||||
XAudioStreamInfo* mStreamInfo;
|
XAudioStreamInfo mStreamInfo;
|
||||||
XAudioFormatInfo* mAudioFormatInfo;
|
XAudioFormatInfo mAudioFormatInfo;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // XAUDIOSOURCEFORMAT_H
|
#endif // XAUDIOSOURCEFORMAT_H
|
||||||
|
|||||||
@ -1,18 +1,18 @@
|
|||||||
#include "xaudiostreaminfo.h"
|
#include "xaudiostreaminfo.h"
|
||||||
|
|
||||||
XAudioStreamInfo::XAudioStreamInfo()
|
XAudioStreamInfo::XAudioStreamInfo()
|
||||||
|
: XAsset()
|
||||||
|
, mNumStreams(0)
|
||||||
|
, mChannelCount(0)
|
||||||
{
|
{
|
||||||
|
SetName("Audio Stream Info");
|
||||||
}
|
}
|
||||||
|
|
||||||
XAudioStreamInfo::~XAudioStreamInfo()
|
void XAudioStreamInfo::ParseData(XDataStream *aStream)
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
void XAudioStreamInfo::ParseData(QDataStream *aStream)
|
|
||||||
{
|
{
|
||||||
|
Q_UNUSED(aStream);
|
||||||
|
|
||||||
|
// TODO: Fill in XAudioStreamInfo::ParseData
|
||||||
}
|
}
|
||||||
|
|
||||||
void XAudioStreamInfo::Clear()
|
void XAudioStreamInfo::Clear()
|
||||||
|
|||||||
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