Lotta asset changes
This commit is contained in:
parent
0943608bd8
commit
67050e6a67
@ -93,6 +93,7 @@ INCLUDEPATH += \
|
||||
$$PWD/../libs/ddsfile \
|
||||
$$PWD/../libs/ipakfile \
|
||||
$$PWD/../libs/iwifile \
|
||||
$$PWD/../libs/assets \
|
||||
$$PWD/../libs/zonefile
|
||||
|
||||
DEPENDPATH += \
|
||||
@ -106,6 +107,7 @@ DEPENDPATH += \
|
||||
$$PWD/../libs/ddsfile \
|
||||
$$PWD/../libs/ipakfile \
|
||||
$$PWD/../libs/iwifile \
|
||||
$$PWD/../libs/assets \
|
||||
$$PWD/../libs/zonefile
|
||||
|
||||
# Copy DLLs to Debug folder
|
||||
|
||||
@ -1,5 +1,4 @@
|
||||
#include "fastfileviewer.h"
|
||||
#include "asset_structs.h"
|
||||
#include "ui_fastfileviewer.h"
|
||||
|
||||
FastFileViewer::FastFileViewer(QWidget *parent)
|
||||
|
||||
@ -1,7 +1,6 @@
|
||||
#ifndef FASTFILEVIEWER_H
|
||||
#define FASTFILEVIEWER_H
|
||||
|
||||
#include "asset_structs.h"
|
||||
#include "fastfile.h"
|
||||
#include <QWidget>
|
||||
|
||||
|
||||
@ -13,16 +13,16 @@ ImageWidget::~ImageWidget()
|
||||
delete ui;
|
||||
}
|
||||
|
||||
void ImageWidget::SetImage(std::shared_ptr<Image> aImage)
|
||||
void ImageWidget::SetImage(std::shared_ptr<QImage> aImage)
|
||||
{
|
||||
mImage = aImage;
|
||||
|
||||
ui->lineEdit_Name->setText(aImage->name);
|
||||
ui->lineEdit_Role->setText(aImage->materialName);
|
||||
ui->comboBox_Compression->setCurrentIndex(aImage->compression);
|
||||
//ui->lineEdit_Name->setText(aImage->name);
|
||||
//ui->lineEdit_Role->setText(aImage->materialName);
|
||||
//ui->comboBox_Compression->setCurrentIndex(aImage->compression);
|
||||
}
|
||||
|
||||
std::shared_ptr<Image> ImageWidget::GetImage()
|
||||
std::shared_ptr<QImage> ImageWidget::GetImage()
|
||||
{
|
||||
return mImage;
|
||||
}
|
||||
|
||||
@ -4,7 +4,6 @@
|
||||
#include "enums.h"
|
||||
#include "dds_structs.h"
|
||||
#include "d3dbsp_structs.h"
|
||||
#include "asset_structs.h"
|
||||
#include "ipak_structs.h"
|
||||
|
||||
#include <QWidget>
|
||||
@ -21,11 +20,11 @@ public:
|
||||
explicit ImageWidget(QWidget *parent = nullptr);
|
||||
~ImageWidget();
|
||||
|
||||
void SetImage(std::shared_ptr<Image> aImage);
|
||||
std::shared_ptr<Image> GetImage();
|
||||
void SetImage(std::shared_ptr<QImage> aImage);
|
||||
std::shared_ptr<QImage> GetImage();
|
||||
|
||||
private:
|
||||
std::shared_ptr<Image> mImage;
|
||||
std::shared_ptr<QImage> mImage;
|
||||
Ui::ImageWidget *ui;
|
||||
};
|
||||
|
||||
|
||||
@ -37,26 +37,22 @@ void LocalStringViewer::SetFileNotes(const QString aFileNotes) {
|
||||
ui->plainTextEdit_FileNotes->setPlainText(mFileNotes);
|
||||
}
|
||||
|
||||
void LocalStringViewer::AddLocalString(LocalString aLocalString) {
|
||||
mLocalStrings.append(aLocalString);
|
||||
|
||||
ui->tableWidget_Strings->setRowCount(mLocalStrings.size());
|
||||
|
||||
ui->groupBox_LocalStrViewer->setTitle(QString("Entries (%1)").arg(mLocalStrings.size()));
|
||||
|
||||
QTableWidgetItem *aliasItem = new QTableWidgetItem(aLocalString.alias);
|
||||
QTableWidgetItem *stringItem = new QTableWidgetItem(aLocalString.string);
|
||||
|
||||
ui->tableWidget_Strings->setItem(mLocalStrings.size() - 1, 0, aliasItem);
|
||||
ui->tableWidget_Strings->setItem(mLocalStrings.size() - 1, 1, stringItem);
|
||||
}
|
||||
// void LocalStringViewer::AddLocalString(LocalizeEntry aLocalString) {
|
||||
// mLocalStrings.append(aLocalString);
|
||||
// ui->tableWidget_Strings->setRowCount(mLocalStrings.size());
|
||||
// ui->groupBox_LocalStrViewer->setTitle(QString("Entries (%1)").arg(mLocalStrings.size()));
|
||||
// QTableWidgetItem *aliasItem = new QTableWidgetItem(aLocalString.alias);
|
||||
// QTableWidgetItem *stringItem = new QTableWidgetItem(aLocalString.string);
|
||||
// ui->tableWidget_Strings->setItem(mLocalStrings.size() - 1, 0, aliasItem);
|
||||
// ui->tableWidget_Strings->setItem(mLocalStrings.size() - 1, 1, stringItem);
|
||||
// }
|
||||
|
||||
void LocalStringViewer::SetZoneFile(std::shared_ptr<ZoneFile> aZoneFile) {
|
||||
mLocalStrings.clear();
|
||||
ui->tableWidget_Strings->clear();
|
||||
// mLocalStrings.clear();
|
||||
// ui->tableWidget_Strings->clear();
|
||||
|
||||
ui->label_Title->setText(aZoneFile->GetStem().section('.', 0, 0) + ".str");
|
||||
for (const LocalString &localStr : aZoneFile->GetAssetMap().localStrings) {
|
||||
AddLocalString(localStr);
|
||||
}
|
||||
// ui->label_Title->setText(aZoneFile->GetStem().section('.', 0, 0) + ".str");
|
||||
// for (const LocalString &localStr : aZoneFile->GetAssetMap().localStrings) {
|
||||
// AddLocalString(localStr);
|
||||
// }
|
||||
}
|
||||
|
||||
@ -1,7 +1,6 @@
|
||||
#ifndef LOCALSTRINGVIEWER_H
|
||||
#define LOCALSTRINGVIEWER_H
|
||||
|
||||
#include "asset_structs.h"
|
||||
#include "zonefile.h"
|
||||
#include <QWidget>
|
||||
|
||||
@ -20,7 +19,7 @@ public:
|
||||
void SetVersion(quint32 aVersion);
|
||||
void SetConfigPath(const QString aConfigPath);
|
||||
void SetFileNotes(const QString aFileNotes);
|
||||
void AddLocalString(LocalString aLocalString);
|
||||
//void AddLocalString(LocalString aLocalString);
|
||||
void SetZoneFile(std::shared_ptr<ZoneFile> aZoneFile);
|
||||
|
||||
private:
|
||||
@ -28,7 +27,7 @@ private:
|
||||
quint32 mVersion;
|
||||
QString mConfigPath;
|
||||
QString mFileNotes;
|
||||
QVector<LocalString> mLocalStrings;
|
||||
//QVector<LocalString> mLocalStrings;
|
||||
};
|
||||
|
||||
#endif // LOCALSTRINGVIEWER_H
|
||||
|
||||
@ -1,4 +1,6 @@
|
||||
#include "mainwindow.h"
|
||||
#include "ui_mainwindow.h"
|
||||
|
||||
#include "aboutdialog.h"
|
||||
#include "fastfile.h"
|
||||
#include "highlighter_gsc.h"
|
||||
@ -7,12 +9,12 @@
|
||||
#include "highlighter_rumble.h"
|
||||
#include "materialviewer.h"
|
||||
#include "preferenceeditor.h"
|
||||
#include "reportissuedialog.h"
|
||||
#include "rumblefileviewer.h"
|
||||
#include "rumblegraphviewer.h"
|
||||
#include "soundviewer.h"
|
||||
#include "stringtableviewer.h"
|
||||
#include "techsetviewer.h"
|
||||
#include "ui_mainwindow.h"
|
||||
#include "fastfile_factory.h"
|
||||
#include "iwifile.h"
|
||||
#include "ddsfile.h"
|
||||
@ -23,7 +25,6 @@
|
||||
#include "iwiviewer.h"
|
||||
#include "localstringviewer.h"
|
||||
#include "imagewidget.h"
|
||||
#include "xtreewidget.h"
|
||||
#include "zonefileviewer.h"
|
||||
#include "techsetviewer.h"
|
||||
#include "logmanager.h"
|
||||
@ -39,7 +40,7 @@ MainWindow::MainWindow(QWidget *parent)
|
||||
mTypeMap = QMap<QString, int>();
|
||||
mTypeOrder = QStringList();
|
||||
mRawFileMap = QMap<QString, QString>();
|
||||
mImageMap = QMap<QString, Image>();
|
||||
//mImageMap = QMap<QString, Image>();
|
||||
mTreeMap = QMap<QString, QTreeWidgetItem *>();
|
||||
mStrTableMap = QMap<QString, QVector<QPair<QString, QString>>>();
|
||||
mBSPVersion = 0;
|
||||
@ -49,13 +50,23 @@ MainWindow::MainWindow(QWidget *parent)
|
||||
mTreeWidget = new XTreeWidget(this);
|
||||
mLogWidget = new QPlainTextEdit(this);
|
||||
|
||||
//ModelViewer *mModelViewer = new ModelViewer(container);
|
||||
//mModelViewer->setAcceptDrops(false);
|
||||
|
||||
mProgressBar = new QProgressBar(this);
|
||||
mProgressBar->setMaximum(100); // Default max value
|
||||
mProgressBar->setVisible(false); // Initially hidden
|
||||
|
||||
connect(ui->actionRun_Tests, &QAction::triggered, this, [](bool checked) {
|
||||
Q_UNUSED(checked);
|
||||
});
|
||||
|
||||
connect(ui->actionReport_Issue, &QAction::triggered, this, [this](bool checked) {
|
||||
Q_UNUSED(checked);
|
||||
|
||||
ReportIssueDialog issueDialog("https://git.redline.llc", "njohnson", "XPlor", "4738c4d2efd123efac1506c68c59b285c646df9f", this);
|
||||
if (issueDialog.exec() == QDialog::Accepted) {
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
connect(&StatusBarManager::instance(), &StatusBarManager::statusUpdated,
|
||||
this, &MainWindow::HandleStatusUpdate);
|
||||
|
||||
@ -157,13 +168,13 @@ MainWindow::MainWindow(QWidget *parent)
|
||||
scriptEditor->setProperty("PARENT_NAME", QVariant::fromValue(aParentName));
|
||||
scriptEditor->setFont(QFont("Consolas"));
|
||||
|
||||
if (rawFile->contents.isEmpty()) {
|
||||
scriptEditor->setPlainText("EMPTY");
|
||||
} else {
|
||||
scriptEditor->setPlainText(rawFile->contents);
|
||||
}
|
||||
// if (rawFile->contents.isEmpty()) {
|
||||
// scriptEditor->setPlainText("EMPTY");
|
||||
// } else {
|
||||
// scriptEditor->setPlainText(rawFile->contents);
|
||||
// }
|
||||
|
||||
QString fileStem = rawFile->path.split('/').last();
|
||||
QString fileStem;// = rawFile->path.split('/').last();
|
||||
for (int i = 0; i < ui->tabWidget->count(); i++) {
|
||||
if (ui->tabWidget->tabText(i) == fileStem) {
|
||||
delete scriptEditor;
|
||||
@ -175,7 +186,7 @@ MainWindow::MainWindow(QWidget *parent)
|
||||
QFontMetrics metrics(scriptEditor->font());
|
||||
scriptEditor->setTabStopDistance(tabStopSpaces * metrics.horizontalAdvance(' '));
|
||||
|
||||
QSyntaxHighlighter *highlighter;
|
||||
QSyntaxHighlighter *highlighter = nullptr;
|
||||
if (fileStem.contains(".gsc")) {
|
||||
highlighter = new Highlighter_GSC(scriptEditor->document());
|
||||
} else if (fileStem.contains(".cfg")) {
|
||||
@ -191,12 +202,12 @@ MainWindow::MainWindow(QWidget *parent)
|
||||
rawTabWidget->addTab(scriptEditor, "Text Editor");
|
||||
|
||||
ui->tabWidget->addTab(rawTabWidget, fileStem);
|
||||
ui->tabWidget->setTabIcon(ui->tabWidget->count() - 1, ZoneFile::AssetTypeToIcon(ASSET_RUMBLE));
|
||||
ui->tabWidget->setTabIcon(ui->tabWidget->count() - 1, Utils::CreateAssetIcon(Utils::ASSET_RUMBLE));
|
||||
ui->tabWidget->setCurrentIndex(ui->tabWidget->count() - 1);
|
||||
return;
|
||||
} else if (fileStem.contains(".shock")) {
|
||||
highlighter = new Highlighter_Shock(scriptEditor->document());
|
||||
} else if (rawFile->contents.left(6) == "RUMBLE") {
|
||||
} /*else if (rawFile->contents.left(6) == "RUMBLE") {
|
||||
RumbleFileViewer *rmbFileViewer = new RumbleFileViewer(this);
|
||||
rmbFileViewer->setProperty("PARENT_NAME", QVariant::fromValue(aParentName));
|
||||
rmbFileViewer->SetRumbleFile(rawFile);
|
||||
@ -205,38 +216,40 @@ MainWindow::MainWindow(QWidget *parent)
|
||||
rawTabWidget->addTab(scriptEditor, "Text Editor");
|
||||
|
||||
ui->tabWidget->addTab(rawTabWidget, fileStem);
|
||||
ui->tabWidget->setTabIcon(ui->tabWidget->count() - 1, ZoneFile::AssetTypeToIcon(ASSET_RUMBLE));
|
||||
ui->tabWidget->setTabIcon(ui->tabWidget->count() - 1, Utils::CreateAssetIcon(Utils::ASSET_RUMBLE));
|
||||
ui->tabWidget->setCurrentIndex(ui->tabWidget->count() - 1);
|
||||
return;
|
||||
}*/ else {
|
||||
delete highlighter;
|
||||
}
|
||||
|
||||
ui->tabWidget->addTab(scriptEditor, fileStem);
|
||||
ui->tabWidget->setTabIcon(ui->tabWidget->count() - 1, ZoneFile::AssetTypeToIcon(ASSET_RAW_FILE));
|
||||
ui->tabWidget->setTabIcon(ui->tabWidget->count() - 1, Utils::CreateAssetIcon(Utils::ASSET_RAWFILE));
|
||||
ui->tabWidget->setCurrentIndex(ui->tabWidget->count() - 1);
|
||||
});
|
||||
|
||||
connect(mTreeWidget, &XTreeWidget::ImageSelected, this, [this](std::shared_ptr<Image> image, const QString aParentName) {
|
||||
ImageWidget *mImageWidget = new ImageWidget(this);
|
||||
mImageWidget->setAcceptDrops(false);
|
||||
mImageWidget->SetImage(image);
|
||||
mImageWidget->setProperty("PARENT_NAME", QVariant::fromValue(aParentName));
|
||||
// connect(mTreeWidget, &XTreeWidget::ImageSelected, this, [this](std::shared_ptr<Image> image, const QString aParentName) {
|
||||
// ImageWidget *mImageWidget = new ImageWidget(this);
|
||||
// mImageWidget->setAcceptDrops(false);
|
||||
// mImageWidget->SetImage(image);
|
||||
// mImageWidget->setProperty("PARENT_NAME", QVariant::fromValue(aParentName));
|
||||
|
||||
QString fileStem = image->materialName;
|
||||
for (int i = 0; i < ui->tabWidget->count(); i++) {
|
||||
if (ui->tabWidget->tabText(i) == fileStem) {
|
||||
delete mImageWidget;
|
||||
return;
|
||||
}
|
||||
}
|
||||
// QString fileStem = image->materialName;
|
||||
// for (int i = 0; i < ui->tabWidget->count(); i++) {
|
||||
// if (ui->tabWidget->tabText(i) == fileStem) {
|
||||
// delete mImageWidget;
|
||||
// return;
|
||||
// }
|
||||
// }
|
||||
|
||||
ui->tabWidget->addTab(mImageWidget, fileStem);
|
||||
ui->tabWidget->setTabIcon(ui->tabWidget->count() - 1, ZoneFile::AssetTypeToIcon(ASSET_IMAGE));
|
||||
ui->tabWidget->setCurrentIndex(ui->tabWidget->count() - 1);
|
||||
});
|
||||
// ui->tabWidget->addTab(mImageWidget, fileStem);
|
||||
// ui->tabWidget->setTabIcon(ui->tabWidget->count() - 1, Utils::CreateAssetIcon(Utils::ASSET_IMAGE));
|
||||
// ui->tabWidget->setCurrentIndex(ui->tabWidget->count() - 1);
|
||||
// });
|
||||
|
||||
connect(mTreeWidget, &XTreeWidget::MenuSelected, this, [](std::shared_ptr<Menu> menu, const QString aParentName) {
|
||||
Q_UNUSED(menu);
|
||||
});
|
||||
// connect(mTreeWidget, &XTreeWidget::MenuSelected, this, [](std::shared_ptr<Menu> menu, const QString aParentName) {
|
||||
// Q_UNUSED(menu);
|
||||
// });
|
||||
|
||||
connect(mTreeWidget, &XTreeWidget::MaterialSelected, this, [this](std::shared_ptr<Material> material, const QString aParentName) {
|
||||
MaterialViewer *matViewer = new MaterialViewer(this);
|
||||
@ -244,16 +257,16 @@ MainWindow::MainWindow(QWidget *parent)
|
||||
matViewer->SetMaterial(material);
|
||||
matViewer->setProperty("PARENT_NAME", QVariant::fromValue(aParentName));
|
||||
|
||||
QString fileStem = material->name;
|
||||
for (int i = 0; i < ui->tabWidget->count(); i++) {
|
||||
if (ui->tabWidget->tabText(i) == fileStem) {
|
||||
delete matViewer;
|
||||
return;
|
||||
}
|
||||
}
|
||||
// QString fileStem = material->name;
|
||||
// for (int i = 0; i < ui->tabWidget->count(); i++) {
|
||||
// if (ui->tabWidget->tabText(i) == fileStem) {
|
||||
// delete matViewer;
|
||||
// return;
|
||||
// }
|
||||
// }
|
||||
|
||||
ui->tabWidget->addTab(matViewer, fileStem);
|
||||
ui->tabWidget->setTabIcon(ui->tabWidget->count() - 1, ZoneFile::AssetTypeToIcon(ASSET_MATERIAL));
|
||||
//ui->tabWidget->addTab(matViewer, fileStem);
|
||||
ui->tabWidget->setTabIcon(ui->tabWidget->count() - 1, Utils::CreateAssetIcon(Utils::ASSET_MATERIAL));
|
||||
ui->tabWidget->setCurrentIndex(ui->tabWidget->count() - 1);
|
||||
});
|
||||
|
||||
@ -272,7 +285,7 @@ MainWindow::MainWindow(QWidget *parent)
|
||||
}
|
||||
|
||||
ui->tabWidget->addTab(ddsViewer, fileStem);
|
||||
ui->tabWidget->setTabIcon(ui->tabWidget->count() - 1, ZoneFile::AssetTypeToIcon(ASSET_IMAGE));
|
||||
ui->tabWidget->setTabIcon(ui->tabWidget->count() - 1, Utils::CreateAssetIcon(Utils::ASSET_IMAGE));
|
||||
ui->tabWidget->setCurrentIndex(ui->tabWidget->count() - 1);
|
||||
});
|
||||
|
||||
@ -291,7 +304,7 @@ MainWindow::MainWindow(QWidget *parent)
|
||||
}
|
||||
|
||||
ui->tabWidget->addTab(iwiViewer, fileStem);
|
||||
ui->tabWidget->setTabIcon(ui->tabWidget->count() - 1, ZoneFile::AssetTypeToIcon(ASSET_IMAGE));
|
||||
ui->tabWidget->setTabIcon(ui->tabWidget->count() - 1, Utils::CreateAssetIcon(Utils::ASSET_IMAGE));
|
||||
ui->tabWidget->setCurrentIndex(ui->tabWidget->count() - 1);
|
||||
});
|
||||
|
||||
@ -310,7 +323,7 @@ MainWindow::MainWindow(QWidget *parent)
|
||||
}
|
||||
|
||||
ui->tabWidget->addTab(fastFileViewer, fileStem);
|
||||
ui->tabWidget->setTabIcon(ui->tabWidget->count() - 1, ZoneFile::AssetTypeToIcon(ASSET_FAST_FILE));
|
||||
ui->tabWidget->setTabIcon(ui->tabWidget->count() - 1, Utils::CreateAssetIcon(Utils::ASSET_FAST_FILE));
|
||||
ui->tabWidget->setCurrentIndex(ui->tabWidget->count() - 1);
|
||||
});
|
||||
|
||||
@ -341,7 +354,7 @@ MainWindow::MainWindow(QWidget *parent)
|
||||
scrollArea->setWidget(containerWidget);
|
||||
|
||||
ui->tabWidget->addTab(scrollArea, fileStem);
|
||||
ui->tabWidget->setTabIcon(ui->tabWidget->count() - 1, ZoneFile::AssetTypeToIcon(ASSET_ZONE_FILE));
|
||||
ui->tabWidget->setTabIcon(ui->tabWidget->count() - 1, Utils::CreateAssetIcon(Utils::ASSET_ZONE_FILE));
|
||||
ui->tabWidget->setCurrentIndex(ui->tabWidget->count() - 1);
|
||||
});
|
||||
|
||||
@ -360,11 +373,11 @@ MainWindow::MainWindow(QWidget *parent)
|
||||
}
|
||||
|
||||
ui->tabWidget->addTab(localStrViewer, fileStem);
|
||||
ui->tabWidget->setTabIcon(ui->tabWidget->count() - 1, ZoneFile::AssetTypeToIcon(ASSET_LOCAL_STRING));
|
||||
ui->tabWidget->setTabIcon(ui->tabWidget->count() - 1, Utils::CreateAssetIcon(Utils::ASSET_LOCALIZE_ENTRY));
|
||||
ui->tabWidget->setCurrentIndex(ui->tabWidget->count() - 1);
|
||||
});
|
||||
|
||||
connect(mTreeWidget, &XTreeWidget::TechSetSelected, this, [this](std::shared_ptr<TechSet> aTechSet, const QString aParentName) {
|
||||
connect(mTreeWidget, &XTreeWidget::TechSetSelected, this, [this](std::shared_ptr<MaterialTechSet> aTechSet, const QString aParentName) {
|
||||
TechSetViewer *techSetViewer = new TechSetViewer(this);
|
||||
techSetViewer->setAcceptDrops(false);
|
||||
techSetViewer->SetTechSet(aTechSet);
|
||||
@ -379,7 +392,7 @@ MainWindow::MainWindow(QWidget *parent)
|
||||
}
|
||||
|
||||
ui->tabWidget->addTab(techSetViewer, aTechSet->name);
|
||||
ui->tabWidget->setTabIcon(ui->tabWidget->count() - 1, ZoneFile::AssetTypeToIcon(ASSET_TECH_SET));
|
||||
ui->tabWidget->setTabIcon(ui->tabWidget->count() - 1, Utils::CreateAssetIcon(Utils::ASSET_TECHNIQUE_SET));
|
||||
ui->tabWidget->setCurrentIndex(ui->tabWidget->count() - 1);
|
||||
});
|
||||
|
||||
@ -398,28 +411,28 @@ MainWindow::MainWindow(QWidget *parent)
|
||||
}
|
||||
|
||||
ui->tabWidget->addTab(strTableViewer, fileStem);
|
||||
ui->tabWidget->setTabIcon(ui->tabWidget->count() - 1, ZoneFile::AssetTypeToIcon(ASSET_STRING_TABLE));
|
||||
ui->tabWidget->setTabIcon(ui->tabWidget->count() - 1, Utils::CreateAssetIcon(Utils::ASSET_STRINGTABLE));
|
||||
ui->tabWidget->setCurrentIndex(ui->tabWidget->count() - 1);
|
||||
});
|
||||
|
||||
connect(mTreeWidget, &XTreeWidget::SoundSelected, this, [this](std::shared_ptr<Sound> aSound, const QString aParentName) {
|
||||
SoundViewer *soundViewer = new SoundViewer(this);
|
||||
soundViewer->setAcceptDrops(false);
|
||||
soundViewer->SetSound(aSound);
|
||||
soundViewer->setProperty("PARENT_NAME", QVariant::fromValue(aParentName));
|
||||
// connect(mTreeWidget, &XTreeWidget::SoundSelected, this, [this](std::shared_ptr<Sound> aSound, const QString aParentName) {
|
||||
// SoundViewer *soundViewer = new SoundViewer(this);
|
||||
// soundViewer->setAcceptDrops(false);
|
||||
// soundViewer->SetSound(aSound);
|
||||
// soundViewer->setProperty("PARENT_NAME", QVariant::fromValue(aParentName));
|
||||
|
||||
QString fileStem = aSound->path.split('/').last();
|
||||
for (int i = 0; i < ui->tabWidget->count(); i++) {
|
||||
if (ui->tabWidget->tabText(i) == fileStem) {
|
||||
delete soundViewer;
|
||||
return;
|
||||
}
|
||||
}
|
||||
// QString fileStem = aSound->path.split('/').last();
|
||||
// for (int i = 0; i < ui->tabWidget->count(); i++) {
|
||||
// if (ui->tabWidget->tabText(i) == fileStem) {
|
||||
// delete soundViewer;
|
||||
// return;
|
||||
// }
|
||||
// }
|
||||
|
||||
ui->tabWidget->addTab(soundViewer, fileStem);
|
||||
ui->tabWidget->setTabIcon(ui->tabWidget->count() - 1, ZoneFile::AssetTypeToIcon(ASSET_SOUND));
|
||||
ui->tabWidget->setCurrentIndex(ui->tabWidget->count() - 1);
|
||||
});
|
||||
// ui->tabWidget->addTab(soundViewer, fileStem);
|
||||
// ui->tabWidget->setTabIcon(ui->tabWidget->count() - 1, Utils::CreateAssetIcon(Utils::ASSET_SOUND));
|
||||
// ui->tabWidget->setCurrentIndex(ui->tabWidget->count() - 1);
|
||||
// });
|
||||
|
||||
connect(mTreeWidget, &XTreeWidget::ItemSelected, this, [this](const QString itemText) {
|
||||
for (int i = 0; i < ui->tabWidget->count(); i++) {
|
||||
@ -535,8 +548,17 @@ bool MainWindow::OpenFastFile(const QString aFastFilePath) {
|
||||
and opens the selected file.
|
||||
*/
|
||||
bool MainWindow::OpenFastFile() {
|
||||
const QString fastFileName = Utils::GetOpenFastFileName();
|
||||
if (!OpenFastFile(fastFileName)) {
|
||||
// Open file dialog to steam apps
|
||||
const QString steamPath = "C:/Program Files (x86)/Steam/steamapps/common/Call of Duty World at War/zone/english/";
|
||||
const QString fastFilePath = QFileDialog::getOpenFileName(this, "Open Fast File", steamPath, "Fast File (*.ff);;All Files (*.*)");
|
||||
if (fastFilePath.isNull()) {
|
||||
// User pressed cancel
|
||||
return false;
|
||||
} else if (!QFile::exists(fastFilePath)) {
|
||||
QMessageBox::warning(this, "Warning!", QString("%1 does not exist!.").arg(fastFilePath));
|
||||
return false;
|
||||
}
|
||||
if (!OpenFastFile(fastFilePath)) {
|
||||
qDebug() << "Failed to open Fast file!";
|
||||
return false;
|
||||
}
|
||||
@ -564,8 +586,14 @@ bool MainWindow::OpenZoneFile(const QString aZoneFilePath, bool fromFF) {
|
||||
}
|
||||
|
||||
bool MainWindow::OpenZoneFile() {
|
||||
const QString zoneFileName = Utils::GetOpenZoneFileName();
|
||||
if (!OpenZoneFile(zoneFileName)) {
|
||||
// Open file dialog to steam apps
|
||||
const QString steamPath = "C:/Program Files (x86)/Steam/steamapps/common/Call of Duty World at War/zone/english/";
|
||||
const QString zoneFilePath = QFileDialog::getOpenFileName(this, "Open Zone File", steamPath, "Zone File (*.zone);;All Files (*.*)");
|
||||
if (zoneFilePath.isNull()) {
|
||||
// User pressed cancel
|
||||
return false;
|
||||
} else if (!QFile::exists(zoneFilePath)) {
|
||||
QMessageBox::warning(this, "Warning!", QString("%1 does not exist!.").arg(zoneFilePath));
|
||||
qDebug() << "Failed to open Zone file!";
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -2,7 +2,6 @@
|
||||
#define MAINWINDOW_H
|
||||
|
||||
#include "d3dbsp_structs.h"
|
||||
#include "asset_structs.h"
|
||||
#include "xtreewidget.h"
|
||||
|
||||
#include <QMainWindow>
|
||||
@ -64,7 +63,7 @@ private:
|
||||
quint32 mTagCount;
|
||||
quint32 mRecordCount;
|
||||
QMap<QString, QString> mRawFileMap;
|
||||
QMap<QString, Image> mImageMap;
|
||||
//QMap<QString, Image> mImageMap;
|
||||
QMap<QString, QTreeWidgetItem*> mTreeMap;
|
||||
QMap<QString, QVector<QPair<QString, QString>>> mStrTableMap;
|
||||
XTreeWidget *mTreeWidget;
|
||||
|
||||
@ -50,7 +50,7 @@
|
||||
<height>21</height>
|
||||
</rect>
|
||||
</property>
|
||||
<widget class="QMenu" name="menuFile">
|
||||
<widget class="QMenu" name="MenuDef">
|
||||
<property name="title">
|
||||
<string>File</string>
|
||||
</property>
|
||||
@ -117,9 +117,17 @@
|
||||
</property>
|
||||
<addaction name="actionAbout"/>
|
||||
<addaction name="actionCheck_for_Updates"/>
|
||||
<addaction name="actionReport_Issue"/>
|
||||
</widget>
|
||||
<addaction name="menuFile"/>
|
||||
<widget class="QMenu" name="menuTools">
|
||||
<property name="title">
|
||||
<string>Tools</string>
|
||||
</property>
|
||||
<addaction name="actionRun_Tests"/>
|
||||
</widget>
|
||||
<addaction name="MenuDef"/>
|
||||
<addaction name="menuEdit"/>
|
||||
<addaction name="menuTools"/>
|
||||
<addaction name="menuHelp"/>
|
||||
</widget>
|
||||
<widget class="QToolBar" name="toolBar">
|
||||
@ -353,6 +361,16 @@
|
||||
<string>Preferences...</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionReport_Issue">
|
||||
<property name="text">
|
||||
<string>Report Issue</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionRun_Tests">
|
||||
<property name="text">
|
||||
<string>Run Tests</string>
|
||||
</property>
|
||||
</action>
|
||||
</widget>
|
||||
<resources>
|
||||
<include location="../data/data.qrc"/>
|
||||
|
||||
@ -16,20 +16,20 @@ QString ToHexStr(quint32 in) {
|
||||
}
|
||||
|
||||
void MaterialViewer::SetMaterial(std::shared_ptr<Material> aMaterial) {
|
||||
ui->lineEdit_NamePtr->setText(ToHexStr(aMaterial->namePtr));
|
||||
ui->lineEdit_Name->setText(aMaterial->name);
|
||||
ui->lineEdit_RefPtr->setText(ToHexStr(aMaterial->refNamePtr));
|
||||
ui->lineEdit_RefName->setText(aMaterial->refName);
|
||||
QString unknownStr = "";
|
||||
foreach (quint32 unknownPtr, aMaterial->pointers) {
|
||||
unknownStr += ToHexStr(unknownPtr) + "\n";
|
||||
}
|
||||
ui->lineEdit_Unknowns->setText(unknownStr);
|
||||
ui->lineEdit_StateA->setText(ToHexStr(aMaterial->stateBits[0]));
|
||||
ui->lineEdit_StateA->setText(ToHexStr(aMaterial->stateBits[1]));
|
||||
ui->spinBox_TextureCount->setValue(aMaterial->textureCount);
|
||||
ui->spinBox_ConstCount->setValue(aMaterial->constCount);
|
||||
ui->lineEdit_TechSetPtr->setText(ToHexStr(aMaterial->techSetPtr));
|
||||
ui->lineEdit_TexturePtr->setText(ToHexStr(aMaterial->texturePtr));
|
||||
ui->lineEdit_ConstantPtr->setText(ToHexStr(aMaterial->constPtr));
|
||||
// ui->lineEdit_NamePtr->setText(ToHexStr(aMaterial->namePtr));
|
||||
// ui->lineEdit_Name->setText(aMaterial->name);
|
||||
// ui->lineEdit_RefPtr->setText(ToHexStr(aMaterial->refNamePtr));
|
||||
// ui->lineEdit_RefName->setText(aMaterial->refName);
|
||||
// QString unknownStr = "";
|
||||
// foreach (quint32 unknownPtr, aMaterial->pointers) {
|
||||
// unknownStr += ToHexStr(unknownPtr) + "\n";
|
||||
// }
|
||||
// ui->lineEdit_Unknowns->setText(unknownStr);
|
||||
// ui->lineEdit_StateA->setText(ToHexStr(aMaterial->stateBits[0]));
|
||||
// ui->lineEdit_StateA->setText(ToHexStr(aMaterial->stateBits[1]));
|
||||
// ui->spinBox_TextureCount->setValue(aMaterial->textureCount);
|
||||
// ui->spinBox_ConstCount->setValue(aMaterial->constCount);
|
||||
// ui->lineEdit_TechSetPtr->setText(ToHexStr(aMaterial->techSetPtr));
|
||||
// ui->lineEdit_TexturePtr->setText(ToHexStr(aMaterial->texturePtr));
|
||||
// ui->lineEdit_ConstantPtr->setText(ToHexStr(aMaterial->constPtr));
|
||||
}
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
#ifndef MATERIALVIEWER_H
|
||||
#define MATERIALVIEWER_H
|
||||
|
||||
#include "asset_structs.h"
|
||||
#include "material.h"
|
||||
|
||||
#include <QWidget>
|
||||
#include <QScrollArea>
|
||||
|
||||
@ -23,36 +23,36 @@ void RumbleFileViewer::SetRumbleFile(std::shared_ptr<RawFile> aRumbleFile) {
|
||||
|
||||
ui->tableWidget_Properties->clear();
|
||||
|
||||
const QString magic = aRumbleFile->contents.left(6);
|
||||
if (magic != "RUMBLE") {
|
||||
qDebug() << "Rumble file has invalid magic: " << magic;
|
||||
return;
|
||||
}
|
||||
|
||||
int firstIndex = 0;
|
||||
int secondIndex = 0;
|
||||
int thirdIndex = 0;
|
||||
|
||||
int startIndex = 0;
|
||||
for (int i = 0; i < aRumbleFile->contents.count("\\") / 2; i++) {
|
||||
ui->tableWidget_Properties->setRowCount(i + 1);
|
||||
ui->spinBox_Entries->setValue(i + 1);
|
||||
|
||||
firstIndex = aRumbleFile->contents.indexOf("\\", startIndex);
|
||||
secondIndex = aRumbleFile->contents.indexOf("\\", firstIndex + 1);
|
||||
thirdIndex = aRumbleFile->contents.indexOf("\\", secondIndex + 1);
|
||||
if (thirdIndex == -1) {
|
||||
thirdIndex = aRumbleFile->contents.size();
|
||||
}
|
||||
|
||||
const QString keyStr = aRumbleFile->contents.mid(firstIndex + 1, secondIndex - firstIndex - 1);
|
||||
QTableWidgetItem *keyItem = new QTableWidgetItem(keyStr);
|
||||
ui->tableWidget_Properties->setItem(i, 0, keyItem);
|
||||
|
||||
const QString valStr = aRumbleFile->contents.mid(secondIndex + 1, thirdIndex - secondIndex - 1);
|
||||
QTableWidgetItem *valueItem = new QTableWidgetItem(valStr);
|
||||
ui->tableWidget_Properties->setItem(i, 1, valueItem);
|
||||
|
||||
startIndex = thirdIndex;
|
||||
}
|
||||
// const QString magic = aRumbleFile->contents.left(6);
|
||||
// if (magic != "RUMBLE") {
|
||||
// qDebug() << "Rumble file has invalid magic: " << magic;
|
||||
// return;
|
||||
// }
|
||||
|
||||
// int firstIndex = 0;
|
||||
// int secondIndex = 0;
|
||||
// int thirdIndex = 0;
|
||||
|
||||
// int startIndex = 0;
|
||||
// for (int i = 0; i < aRumbleFile->contents.count("\\") / 2; i++) {
|
||||
// ui->tableWidget_Properties->setRowCount(i + 1);
|
||||
// ui->spinBox_Entries->setValue(i + 1);
|
||||
|
||||
// firstIndex = aRumbleFile->contents.indexOf("\\", startIndex);
|
||||
// secondIndex = aRumbleFile->contents.indexOf("\\", firstIndex + 1);
|
||||
// thirdIndex = aRumbleFile->contents.indexOf("\\", secondIndex + 1);
|
||||
// if (thirdIndex == -1) {
|
||||
// thirdIndex = aRumbleFile->contents.size();
|
||||
// }
|
||||
|
||||
// const QString keyStr = aRumbleFile->contents.mid(firstIndex + 1, secondIndex - firstIndex - 1);
|
||||
// QTableWidgetItem *keyItem = new QTableWidgetItem(keyStr);
|
||||
// ui->tableWidget_Properties->setItem(i, 0, keyItem);
|
||||
|
||||
// const QString valStr = aRumbleFile->contents.mid(secondIndex + 1, thirdIndex - secondIndex - 1);
|
||||
// QTableWidgetItem *valueItem = new QTableWidgetItem(valStr);
|
||||
// ui->tableWidget_Properties->setItem(i, 1, valueItem);
|
||||
|
||||
// startIndex = thirdIndex;
|
||||
// }
|
||||
}
|
||||
|
||||
@ -1,8 +1,8 @@
|
||||
#ifndef RUMBLEFILEVIEWER_H
|
||||
#define RUMBLEFILEVIEWER_H
|
||||
|
||||
#include "asset_structs.h"
|
||||
#include "zonefile.h"
|
||||
#include "rawfile.h"
|
||||
|
||||
#include <QWidget>
|
||||
|
||||
namespace Ui {
|
||||
|
||||
@ -22,7 +22,7 @@ RumbleGraphViewer::~RumbleGraphViewer() {
|
||||
void RumbleGraphViewer::SetRumbleGraphFile(const std::shared_ptr<RawFile> aRawFile) {
|
||||
mRumbleGraphFile = aRawFile;
|
||||
|
||||
QDataStream rawFileStream(mRumbleGraphFile->contents.toLatin1());
|
||||
QDataStream rawFileStream;//(mRumbleGraphFile->contents.toLatin1());
|
||||
|
||||
QByteArray magic(15, Qt::Uninitialized);
|
||||
rawFileStream.readRawData(magic.data(), 15);
|
||||
|
||||
@ -1,7 +1,6 @@
|
||||
#ifndef RUMBLEGRAPHVIEWER_H
|
||||
#define RUMBLEGRAPHVIEWER_H
|
||||
|
||||
#include "asset_structs.h"
|
||||
#include "zonefile.h"
|
||||
#include <QWidget>
|
||||
|
||||
|
||||
@ -61,17 +61,17 @@ SoundViewer::~SoundViewer()
|
||||
delete ui;
|
||||
}
|
||||
|
||||
void SoundViewer::SetSound(std::shared_ptr<Sound> aSound)
|
||||
{
|
||||
buffer->setData(aSound->data);
|
||||
if (!buffer->open(QIODevice::ReadOnly)) {
|
||||
qWarning() << "Failed to open QBuffer.";
|
||||
return;
|
||||
}
|
||||
// void SoundViewer::SetSound(std::shared_ptr<Sound> aSound)
|
||||
// {
|
||||
// buffer->setData(aSound->data);
|
||||
// if (!buffer->open(QIODevice::ReadOnly)) {
|
||||
// qWarning() << "Failed to open QBuffer.";
|
||||
// return;
|
||||
// }
|
||||
|
||||
ui->groupBox->setTitle(aSound->path);
|
||||
player->setSourceDevice(buffer);
|
||||
}
|
||||
// ui->groupBox->setTitle(aSound->path);
|
||||
// player->setSourceDevice(buffer);
|
||||
// }
|
||||
|
||||
void SoundViewer::SetOutput(QAudioOutput *aOutput) {
|
||||
if (!aOutput) { return; }
|
||||
|
||||
@ -1,8 +1,6 @@
|
||||
#ifndef SOUNDVIEWER_H
|
||||
#define SOUNDVIEWER_H
|
||||
|
||||
#include "asset_structs.h"
|
||||
|
||||
#include <QWidget>
|
||||
#include <QMediaPlayer>
|
||||
#include <QBuffer>
|
||||
@ -22,7 +20,7 @@ public:
|
||||
explicit SoundViewer(QWidget *parent = nullptr);
|
||||
~SoundViewer();
|
||||
|
||||
void SetSound(std::shared_ptr<Sound> aSound);
|
||||
//void SetSound(std::shared_ptr<Sound> aSound);
|
||||
|
||||
void SetOutput(QAudioOutput *aOutput);
|
||||
private:
|
||||
|
||||
@ -19,18 +19,18 @@ void StringTableViewer::SetStringTable(std::shared_ptr<StringTable> aStringTable
|
||||
ui->tableWidget_Strings->setRowCount(aStringTable->rowCount);
|
||||
ui->tableWidget_Strings->setColumnCount(aStringTable->columnCount);
|
||||
|
||||
int currentIndex = 0;
|
||||
for (const QString &key : aStringTable->content.keys()) {
|
||||
const QString value = aStringTable->content[key];
|
||||
// int currentIndex = 0;
|
||||
// for (const QString &key : aStringTable->content.keys()) {
|
||||
// const QString value = aStringTable->content[key];
|
||||
|
||||
QTableWidgetItem *tableKeyItem = new QTableWidgetItem();
|
||||
tableKeyItem->setText(key);
|
||||
ui->tableWidget_Strings->setItem(currentIndex, 0, tableKeyItem);
|
||||
// QTableWidgetItem *tableKeyItem = new QTableWidgetItem();
|
||||
// tableKeyItem->setText(key);
|
||||
// ui->tableWidget_Strings->setItem(currentIndex, 0, tableKeyItem);
|
||||
|
||||
QTableWidgetItem *tableValItem = new QTableWidgetItem();
|
||||
tableValItem->setText(value);
|
||||
ui->tableWidget_Strings->setItem(currentIndex, 1, tableValItem);
|
||||
// QTableWidgetItem *tableValItem = new QTableWidgetItem();
|
||||
// tableValItem->setText(value);
|
||||
// ui->tableWidget_Strings->setItem(currentIndex, 1, tableValItem);
|
||||
|
||||
currentIndex++;
|
||||
}
|
||||
// currentIndex++;
|
||||
// }
|
||||
}
|
||||
|
||||
@ -1,7 +1,8 @@
|
||||
#ifndef STRINGTABLEVIEWER_H
|
||||
#define STRINGTABLEVIEWER_H
|
||||
|
||||
#include "asset_structs.h"
|
||||
#include "stringtable.h"
|
||||
|
||||
#include <QWidget>
|
||||
|
||||
namespace Ui {
|
||||
|
||||
@ -13,13 +13,13 @@ TechSetViewer::~TechSetViewer()
|
||||
delete ui;
|
||||
}
|
||||
|
||||
void TechSetViewer::SetTechSet(std::shared_ptr<TechSet> aTechSet) {
|
||||
ui->listWidget_Ptrs->clear();
|
||||
void TechSetViewer::SetTechSet(std::shared_ptr<MaterialTechSet> aTechSet) {
|
||||
//ui->listWidget_Ptrs->clear();
|
||||
ui->label_Title->setText(aTechSet->name);
|
||||
|
||||
int ptrIndex = 1;
|
||||
for (auto ptr : aTechSet->pointers) {
|
||||
ui->listWidget_Ptrs->addItem(QString("Pointer %1: %2").arg(ptrIndex).arg(ptr));
|
||||
ptrIndex++;
|
||||
}
|
||||
// int ptrIndex = 1;
|
||||
//for (auto ptr : aTechSet->pointers) {
|
||||
// ui->listWidget_Ptrs->addItem(QString("Pointer %1: %2").arg(ptrIndex).arg(ptr));
|
||||
// ptrIndex++;
|
||||
//}
|
||||
}
|
||||
|
||||
@ -1,7 +1,8 @@
|
||||
#ifndef TECHSETVIEWER_H
|
||||
#define TECHSETVIEWER_H
|
||||
|
||||
#include "asset_structs.h"
|
||||
#include "materialtechset.h"
|
||||
|
||||
#include <QWidget>
|
||||
|
||||
namespace Ui {
|
||||
@ -16,7 +17,7 @@ public:
|
||||
explicit TechSetViewer(QWidget *parent = nullptr);
|
||||
~TechSetViewer();
|
||||
|
||||
void SetTechSet(std::shared_ptr<TechSet> aTechSet);
|
||||
void SetTechSet(std::shared_ptr<MaterialTechSet> aTechSet);
|
||||
|
||||
private:
|
||||
Ui::TechSetViewer *ui;
|
||||
|
||||
@ -6,14 +6,14 @@
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>961</width>
|
||||
<height>756</height>
|
||||
<width>880</width>
|
||||
<height>559</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Form</string>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_2">
|
||||
<layout class="QVBoxLayout" name="verticalLayout_3">
|
||||
<item>
|
||||
<widget class="QLabel" name="label_Title">
|
||||
<property name="font">
|
||||
@ -29,46 +29,120 @@
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_7">
|
||||
<item>
|
||||
<widget class="QGroupBox" name="groupBox">
|
||||
<property name="title">
|
||||
<string>Unknown Pointers:</string>
|
||||
<string>Set Parameters</string>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<item>
|
||||
<widget class="QListWidget" name="listWidget_Ptrs"/>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||
<item>
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="text">
|
||||
<string>Name:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLineEdit" name="lineEdit_Name">
|
||||
<property name="placeholderText">
|
||||
<string>Technique set name</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_2">
|
||||
<item>
|
||||
<widget class="QLabel" name="label_2">
|
||||
<property name="text">
|
||||
<string>World Vertex Format:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QSpinBox" name="spinBox_WorldVertFormat"/>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QListWidget" name="listWidget_Techniques"/>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="horizontalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Orientation::Horizontal</enum>
|
||||
<widget class="QGroupBox" name="groupBox_2">
|
||||
<property name="title">
|
||||
<string>Current Technique</string>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_2">
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_4">
|
||||
<item>
|
||||
<widget class="QLabel" name="label_4">
|
||||
<property name="text">
|
||||
<string>Name:</string>
|
||||
</property>
|
||||
</spacer>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLineEdit" name="lineEdit_TechniqueName">
|
||||
<property name="placeholderText">
|
||||
<string>Technique set name</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="verticalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Orientation::Vertical</enum>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_5">
|
||||
<item>
|
||||
<widget class="QLabel" name="label_5">
|
||||
<property name="text">
|
||||
<string>Flags:</string>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>363</height>
|
||||
</size>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QSpinBox" name="spinBox_Flags"/>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_6">
|
||||
<item>
|
||||
<widget class="QLabel" name="label_6">
|
||||
<property name="text">
|
||||
<string>Pass Count:</string>
|
||||
</property>
|
||||
</spacer>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QSpinBox" name="spinBox_PassCount"/>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QGroupBox" name="groupBox_3">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="MinimumExpanding">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="title">
|
||||
<string>Material Pass</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
|
||||
@ -90,13 +90,13 @@ void XTreeWidget::AddZoneFile(std::shared_ptr<ZoneFile> aZoneFile, XTreeWidgetIt
|
||||
} else {
|
||||
zoneItem = new XTreeWidgetItem(this);
|
||||
}
|
||||
zoneItem->setIcon(0, ZoneFile::AssetTypeToIcon(ASSET_ZONE_FILE));
|
||||
zoneItem->setIcon(0, Utils::CreateAssetIcon(Utils::ASSET_ZONE_FILE));
|
||||
zoneItem->setText(0, aZoneFile->GetBaseStem() + ".zone");
|
||||
|
||||
auto assetMap = aZoneFile->GetAssetMap();
|
||||
|
||||
if (!assetMap.localStrings.isEmpty()) {
|
||||
QIcon localStrIcon = ZoneFile::AssetTypeToIcon(ASSET_LOCAL_STRING);
|
||||
if (!assetMap.localizeEntries.isEmpty()) {
|
||||
QIcon localStrIcon = Utils::CreateAssetIcon(Utils::ASSET_LOCALIZE_ENTRY);
|
||||
|
||||
XTreeWidgetItem *localStrRoot = new XTreeWidgetItem(zoneItem);
|
||||
localStrRoot->setText(0, "String Files");
|
||||
@ -109,14 +109,14 @@ void XTreeWidget::AddZoneFile(std::shared_ptr<ZoneFile> aZoneFile, XTreeWidgetIt
|
||||
}
|
||||
|
||||
if (!assetMap.techSets.isEmpty()) {
|
||||
QIcon techSetIcon = ZoneFile::AssetTypeToIcon(ASSET_TECH_SET);
|
||||
QIcon techSetIcon = Utils::CreateAssetIcon(Utils::ASSET_TECHNIQUE_SET);
|
||||
|
||||
XTreeWidgetItem *techSetRoot = new XTreeWidgetItem(zoneItem);
|
||||
techSetRoot->setText(0, "Tech Sets");
|
||||
techSetRoot->setIcon(0, techSetIcon);
|
||||
techSetRoot->SetCategory(CATEGORY_TYPE);
|
||||
|
||||
for (TechSet techSet : assetMap.techSets) {
|
||||
for (auto techSet : assetMap.techSets) {
|
||||
XTreeWidgetItem *techSetItem = new XTreeWidgetItem(techSetRoot);
|
||||
techSetItem->setText(0, techSet.name);
|
||||
techSetItem->setIcon(0, techSetIcon);
|
||||
@ -124,122 +124,121 @@ void XTreeWidget::AddZoneFile(std::shared_ptr<ZoneFile> aZoneFile, XTreeWidgetIt
|
||||
}
|
||||
|
||||
if (!assetMap.rawFiles.isEmpty()) {
|
||||
QIcon rawFileIcon = ZoneFile::AssetTypeToIcon(ASSET_RAW_FILE);
|
||||
QIcon rawFileIcon = Utils::CreateAssetIcon(Utils::ASSET_RAWFILE);
|
||||
|
||||
XTreeWidgetItem *rawFileRoot = new XTreeWidgetItem(zoneItem);
|
||||
rawFileRoot->setText(0, "Raw Files");
|
||||
rawFileRoot->setIcon(0, rawFileIcon);
|
||||
rawFileRoot->SetCategory(CATEGORY_TYPE);
|
||||
for (RawFile rawFile : assetMap.rawFiles) {
|
||||
for (auto rawFile : assetMap.rawFiles) {
|
||||
if (!rawFile.length) { continue; }
|
||||
|
||||
XTreeWidgetItem *tempItem = rawFileRoot;
|
||||
const QStringList pathParts = rawFile.path.split('/');
|
||||
for (const QString &pathPart : pathParts) {
|
||||
bool childFound = false;
|
||||
for (int i = 0; i < tempItem->childCount(); i++) {
|
||||
QTreeWidgetItem *rawChildItem = tempItem->child(i);
|
||||
XTreeWidgetItem *childItem = dynamic_cast<XTreeWidgetItem*>(rawChildItem);
|
||||
if (childItem->text(0) == pathPart) {
|
||||
tempItem = childItem;
|
||||
// const QStringList pathParts = rawFile->path.split('/');
|
||||
// for (const QString &pathPart : pathParts) {
|
||||
// bool childFound = false;
|
||||
// for (int i = 0; i < tempItem->childCount(); i++) {
|
||||
// QTreeWidgetItem *rawChildItem = tempItem->child(i);
|
||||
// XTreeWidgetItem *childItem = dynamic_cast<XTreeWidgetItem*>(rawChildItem);
|
||||
// if (childItem->text(0) == pathPart) {
|
||||
// tempItem = childItem;
|
||||
|
||||
childFound = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
// childFound = true;
|
||||
// break;
|
||||
// }
|
||||
// }
|
||||
|
||||
const QString rawFileStr = QString("%1 [%2-%3]").arg(pathPart).arg(rawFile.startPos).arg(rawFile.endPos);
|
||||
//rawFileStr = pathPart;
|
||||
if (pathPart == pathParts.last()) {
|
||||
XTreeWidgetItem *rawFileItem = new XTreeWidgetItem(tempItem);
|
||||
rawFileItem->setText(0, rawFileStr);
|
||||
// const QString rawFileStr = pathPart;// = QString("%1 [%2-%3]").arg(pathPart).arg(rawFile.startPos).arg(rawFile.endPos);
|
||||
// if (pathPart == pathParts.last()) {
|
||||
// XTreeWidgetItem *rawFileItem = new XTreeWidgetItem(tempItem);
|
||||
// rawFileItem->setText(0, rawFileStr);
|
||||
|
||||
tempItem = rawFileItem;
|
||||
} else if (!childFound) {
|
||||
tempItem = new XTreeWidgetItem(tempItem);
|
||||
tempItem->setText(0, rawFileStr);
|
||||
}
|
||||
// tempItem = rawFileItem;
|
||||
// } else if (!childFound) {
|
||||
// tempItem = new XTreeWidgetItem(tempItem);
|
||||
// tempItem->setText(0, rawFileStr);
|
||||
// }
|
||||
|
||||
}
|
||||
// }
|
||||
tempItem->setIcon(0, rawFileIcon);
|
||||
}
|
||||
}
|
||||
|
||||
if (!assetMap.menuFiles.isEmpty()) {
|
||||
QIcon menuFileIcon = ZoneFile::AssetTypeToIcon(ASSET_MENU);
|
||||
if (!assetMap.menuDefinitions.isEmpty()) {
|
||||
// QIcon MenuDefIcon = Utils::CreateAssetIcon(Utils::ASSET_MENU);
|
||||
|
||||
XTreeWidgetItem *menuRoot = new XTreeWidgetItem(zoneItem);
|
||||
menuRoot->setText(0, "Menu Files");
|
||||
menuRoot->setIcon(0, menuFileIcon);
|
||||
menuRoot->SetCategory(CATEGORY_TYPE);
|
||||
// XTreeWidgetItem *menuRoot = new XTreeWidgetItem(zoneItem);
|
||||
// menuRoot->setText(0, "Menu Files");
|
||||
// menuRoot->setIcon(0, MenuDefIcon);
|
||||
// menuRoot->SetCategory(CATEGORY_TYPE);
|
||||
|
||||
int menuIndex = 1;
|
||||
for (MenuFile menuFile : assetMap.menuFiles) {
|
||||
XTreeWidgetItem *menuFileRoot = new XTreeWidgetItem(menuRoot);
|
||||
menuFileRoot->setText(0, QString("Menu %1").arg(menuIndex));
|
||||
for (Menu menu : menuFile.menuDefs) {
|
||||
XTreeWidgetItem *menuItem = new XTreeWidgetItem(menuFileRoot);
|
||||
menuItem->setText(0, menu.filePath);
|
||||
menuItem->setIcon(0, menuFileIcon);
|
||||
}
|
||||
menuIndex++;
|
||||
}
|
||||
// int menuIndex = 1;
|
||||
// for (MenuDef menuDef : assetMap.menuDefinitions) {
|
||||
// XTreeWidgetItem *MenuDefRoot = new XTreeWidgetItem(menuRoot);
|
||||
// MenuDefRoot->setText(0, QString("Menu %1").arg(menuIndex));
|
||||
// for (Menu menu : menuDef.men) {
|
||||
// XTreeWidgetItem *menuItem = new XTreeWidgetItem(MenuDefRoot);
|
||||
// menuItem->setText(0, menu.filePath);
|
||||
// menuItem->setIcon(0, MenuDefIcon);
|
||||
// }
|
||||
// menuIndex++;
|
||||
// }
|
||||
}
|
||||
|
||||
if (!assetMap.images.isEmpty()) {
|
||||
QIcon imageIcon = ZoneFile::AssetTypeToIcon(ASSET_IMAGE);
|
||||
// QIcon imageIcon = Utils::CreateAssetIcon(Utils::ASSET_IMAGE);
|
||||
|
||||
XTreeWidgetItem *imageRoot = new XTreeWidgetItem(zoneItem);
|
||||
imageRoot->setText(0, "Images");
|
||||
imageRoot->setIcon(0, imageIcon);
|
||||
imageRoot->SetCategory(CATEGORY_TYPE);
|
||||
// XTreeWidgetItem *imageRoot = new XTreeWidgetItem(zoneItem);
|
||||
// imageRoot->setText(0, "Images");
|
||||
// imageRoot->setIcon(0, imageIcon);
|
||||
// imageRoot->SetCategory(CATEGORY_TYPE);
|
||||
|
||||
for (Image image : assetMap.images) {
|
||||
XTreeWidgetItem *imageItem = new XTreeWidgetItem(imageRoot);
|
||||
imageItem->setText(0, image.materialName);
|
||||
imageItem->setIcon(0, imageIcon);
|
||||
}
|
||||
// for (Image image : assetMap.images) {
|
||||
// XTreeWidgetItem *imageItem = new XTreeWidgetItem(imageRoot);
|
||||
// imageItem->setText(0, image.materialName);
|
||||
// imageItem->setIcon(0, imageIcon);
|
||||
// }
|
||||
}
|
||||
|
||||
if (!assetMap.models.isEmpty()) {
|
||||
QIcon modelIcon = ZoneFile::AssetTypeToIcon(ASSET_MODEL);
|
||||
QIcon modelIcon = Utils::CreateAssetIcon(Utils::ASSET_XMODEL);
|
||||
|
||||
XTreeWidgetItem *modelsRoot = new XTreeWidgetItem(zoneItem);
|
||||
modelsRoot->setText(0, "Models");
|
||||
modelsRoot->setIcon(0, modelIcon);
|
||||
modelsRoot->SetCategory(CATEGORY_TYPE);
|
||||
|
||||
for (Model model: assetMap.models) {
|
||||
for (auto model: assetMap.models) {
|
||||
XTreeWidgetItem *modelItem = new XTreeWidgetItem(modelsRoot);
|
||||
modelItem->setText(0, model.modelName);
|
||||
modelItem->setText(0, model.name);
|
||||
modelItem->setIcon(0, modelIcon);
|
||||
}
|
||||
}
|
||||
|
||||
if (!assetMap.materials.isEmpty()) {
|
||||
QIcon materialIcon = ZoneFile::AssetTypeToIcon(ASSET_MATERIAL);
|
||||
QIcon materialIcon = Utils::CreateAssetIcon(Utils::ASSET_MATERIAL);
|
||||
|
||||
XTreeWidgetItem *materialsRoot = new XTreeWidgetItem(zoneItem);
|
||||
materialsRoot->setText(0, "Materials");
|
||||
materialsRoot->setIcon(0, materialIcon);
|
||||
materialsRoot->SetCategory(CATEGORY_TYPE);
|
||||
|
||||
for (Material material: assetMap.materials) {
|
||||
for (auto material: assetMap.materials) {
|
||||
XTreeWidgetItem *materialItem = new XTreeWidgetItem(materialsRoot);
|
||||
materialItem->setText(0, material.name);
|
||||
//materialItem->setText(0, material.name);
|
||||
materialItem->setIcon(0, materialIcon);
|
||||
}
|
||||
}
|
||||
|
||||
if (!assetMap.stringTables.isEmpty()) {
|
||||
QIcon stringTableIcon = ZoneFile::AssetTypeToIcon(ASSET_STRING_TABLE);
|
||||
QIcon stringTableIcon = Utils::CreateAssetIcon(Utils::ASSET_STRINGTABLE);
|
||||
|
||||
XTreeWidgetItem *strTableRoot = new XTreeWidgetItem(zoneItem);
|
||||
strTableRoot->setText(0, "String Tables");
|
||||
strTableRoot->setIcon(0, stringTableIcon);
|
||||
strTableRoot->SetCategory(CATEGORY_TYPE);
|
||||
|
||||
for (StringTable strTable: assetMap.stringTables) {
|
||||
for (auto strTable: assetMap.stringTables) {
|
||||
XTreeWidgetItem *modelItem = new XTreeWidgetItem(strTableRoot);
|
||||
modelItem->setText(0, strTable.name);
|
||||
modelItem->setIcon(0, stringTableIcon);
|
||||
@ -247,46 +246,12 @@ void XTreeWidget::AddZoneFile(std::shared_ptr<ZoneFile> aZoneFile, XTreeWidgetIt
|
||||
}
|
||||
|
||||
if (!assetMap.sounds.isEmpty()) {
|
||||
QIcon soundIcon = ZoneFile::AssetTypeToIcon(ASSET_SOUND);
|
||||
QIcon soundIcon = Utils::CreateAssetIcon(Utils::ASSET_SOUND);
|
||||
|
||||
XTreeWidgetItem *soundsRoot = new XTreeWidgetItem(zoneItem);
|
||||
soundsRoot->setText(0, "Sounds");
|
||||
soundsRoot->setIcon(0, soundIcon);
|
||||
soundsRoot->SetCategory(CATEGORY_TYPE);
|
||||
for (SoundAsset soundAsset : assetMap.sounds) {
|
||||
for (Sound sound : soundAsset.sounds) {
|
||||
XTreeWidgetItem *tempItem = soundsRoot;
|
||||
|
||||
if (!sound.dataLength) { continue; }
|
||||
|
||||
for (const QString &pathPart : sound.path.split('/')) {
|
||||
if (pathPart.isEmpty()) { continue; }
|
||||
|
||||
bool childFound = false;
|
||||
for (int i = 0; i < tempItem->childCount(); i++) {
|
||||
XTreeWidgetItem *childItem = dynamic_cast<XTreeWidgetItem*>(tempItem->child(i));
|
||||
if (childItem->text(0) == pathPart) {
|
||||
tempItem = childItem;
|
||||
|
||||
childFound = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (pathPart.contains(".wav")) {
|
||||
XTreeWidgetItem *soundItem = new XTreeWidgetItem(tempItem);
|
||||
soundItem->setText(0, pathPart);
|
||||
|
||||
tempItem = soundItem;
|
||||
} else if (!childFound) {
|
||||
tempItem = new XTreeWidgetItem(tempItem);
|
||||
tempItem->setText(0, pathPart);
|
||||
}
|
||||
|
||||
}
|
||||
tempItem->setIcon(0, soundIcon);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
mZoneFiles[aZoneFile->GetBaseStem() + ".zone"] = aZoneFile;
|
||||
@ -518,7 +483,7 @@ void XTreeWidget::PrepareContextMenu(const QPoint &pos) {
|
||||
const QString zoneFilePath = QFileDialog::getSaveFileName(
|
||||
nullptr, "Export Zone File...", QDir::currentPath(),
|
||||
"Zone File (*.zone);;All Files(*.*)");
|
||||
fastFile->GetZoneFile()->SaveZoneFile(zoneFilePath);
|
||||
//fastFile->GetZoneFile()->SaveZoneFile(zoneFilePath);
|
||||
});
|
||||
} else if (activeText.contains(".zone")) {
|
||||
const QString fileStem = activeText;
|
||||
@ -553,40 +518,40 @@ void XTreeWidget::PrepareContextMenu(const QPoint &pos) {
|
||||
}
|
||||
if (parentItem && parentItem != invisibleRootItem() && parentItem->text(0).contains(".zone")) {
|
||||
const QString fileStem = parentItem->text(0).section('.', 0, 0);
|
||||
QVector<SoundAsset> soundAssets = mZoneFiles[fileStem]->GetAssetMap().sounds;
|
||||
for (SoundAsset soundAsset : soundAssets) {
|
||||
for (Sound sound : soundAsset.sounds) {
|
||||
if (sound.path.contains(activeText)) {
|
||||
QMenu *exportSubmenu = new QMenu("Export...", this);
|
||||
contextMenu->addMenu(exportSubmenu);
|
||||
// QVector<LoadedSound> LoadedSounds = mZoneFiles[fileStem]->GetAssetMap().sounds;
|
||||
// for (LoadedSound LoadedSound : LoadedSounds) {
|
||||
// for (Sound sound : LoadedSound.sounds) {
|
||||
// if (sound.path.contains(activeText)) {
|
||||
// QMenu *exportSubmenu = new QMenu("Export...", this);
|
||||
// contextMenu->addMenu(exportSubmenu);
|
||||
|
||||
QAction *exportWAVAction = new QAction("Export as WAV File");
|
||||
exportSubmenu->addAction(exportWAVAction);
|
||||
connect(exportWAVAction, &QAction::triggered, this, [sound](bool checked) {
|
||||
Q_UNUSED(checked);
|
||||
// QAction *exportWAVAction = new QAction("Export as WAV File");
|
||||
// exportSubmenu->addAction(exportWAVAction);
|
||||
// connect(exportWAVAction, &QAction::triggered, this, [sound](bool checked) {
|
||||
// Q_UNUSED(checked);
|
||||
|
||||
QDir dir = QDir::currentPath();
|
||||
if (!dir.exists("exports/")) {
|
||||
dir.mkdir("exports/");
|
||||
}
|
||||
// QDir dir = QDir::currentPath();
|
||||
// if (!dir.exists("exports/")) {
|
||||
// dir.mkdir("exports/");
|
||||
// }
|
||||
|
||||
if (!dir.exists("exports/sounds/")) {
|
||||
dir.mkdir("exports/sounds/");
|
||||
}
|
||||
// if (!dir.exists("exports/sounds/")) {
|
||||
// dir.mkdir("exports/sounds/");
|
||||
// }
|
||||
|
||||
const QString fileName = "exports/sounds/" + sound.path.split('/').last();
|
||||
QFile wavFile(fileName);
|
||||
if (!wavFile.open(QIODevice::WriteOnly)) {
|
||||
qDebug() << "Failed to write wav file!";
|
||||
return;
|
||||
}
|
||||
wavFile.write(sound.data);
|
||||
wavFile.close();
|
||||
});
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
// const QString fileName = "exports/sounds/" + sound.path.split('/').last();
|
||||
// QFile wavFile(fileName);
|
||||
// if (!wavFile.open(QIODevice::WriteOnly)) {
|
||||
// qDebug() << "Failed to write wav file!";
|
||||
// return;
|
||||
// }
|
||||
// wavFile.write(sound.data);
|
||||
// wavFile.close();
|
||||
// });
|
||||
// break;
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
}
|
||||
} else if (activeItem && activeText == "Sounds") {
|
||||
XTreeWidgetItem *parentItem = dynamic_cast<XTreeWidgetItem*>(activeItem->parent());
|
||||
@ -609,29 +574,29 @@ void XTreeWidget::PrepareContextMenu(const QPoint &pos) {
|
||||
connect(exportAllWAVAction, &QAction::triggered, this, [zoneFile](bool checked) {
|
||||
Q_UNUSED(checked);
|
||||
|
||||
for (SoundAsset soundAsset : zoneFile->GetAssetMap().sounds) {
|
||||
for (Sound sound : soundAsset.sounds) {
|
||||
if (!sound.dataLength) { continue; }
|
||||
// for (LoadedSound LoadedSound : zoneFile->GetAssetMap().sounds) {
|
||||
// for (Sound sound : LoadedSound.sounds) {
|
||||
// if (!sound.dataLength) { continue; }
|
||||
|
||||
QDir dir = QDir::currentPath();
|
||||
if (!dir.exists("exports/")) {
|
||||
dir.mkdir("exports/");
|
||||
}
|
||||
// QDir dir = QDir::currentPath();
|
||||
// if (!dir.exists("exports/")) {
|
||||
// dir.mkdir("exports/");
|
||||
// }
|
||||
|
||||
if (!dir.exists("exports/sounds/")) {
|
||||
dir.mkdir("exports/sounds/");
|
||||
}
|
||||
// if (!dir.exists("exports/sounds/")) {
|
||||
// dir.mkdir("exports/sounds/");
|
||||
// }
|
||||
|
||||
const QString fileName = "exports/sounds/" + sound.path.split('/').last();
|
||||
QFile wavFile(fileName);
|
||||
if (!wavFile.open(QIODevice::WriteOnly)) {
|
||||
qDebug() << "Failed to write wav file!";
|
||||
return;
|
||||
}
|
||||
wavFile.write(sound.data);
|
||||
wavFile.close();
|
||||
}
|
||||
}
|
||||
// const QString fileName = "exports/sounds/" + sound.path.split('/').last();
|
||||
// QFile wavFile(fileName);
|
||||
// if (!wavFile.open(QIODevice::WriteOnly)) {
|
||||
// qDebug() << "Failed to write wav file!";
|
||||
// return;
|
||||
// }
|
||||
// wavFile.write(sound.data);
|
||||
// wavFile.close();
|
||||
// }
|
||||
// }
|
||||
});
|
||||
}
|
||||
}
|
||||
@ -688,13 +653,13 @@ void XTreeWidget::ItemSelectionChanged() {
|
||||
XTreeWidgetItem *grandpaItem = dynamic_cast<XTreeWidgetItem*>(parentItem->parent());
|
||||
if (grandpaItem && grandpaItem->text(0).contains(".zone")) {
|
||||
const QString fileStem = grandpaItem->text(0).section('.', 0, 0);
|
||||
QVector<Image> images = mZoneFiles[fileStem]->GetAssetMap().images;
|
||||
for (Image image : images) {
|
||||
if (image.materialName == selectedText) {
|
||||
emit ImageSelected(std::make_shared<Image>(image), fileStem);
|
||||
break;
|
||||
}
|
||||
}
|
||||
// QVector<Image> images = mZoneFiles[fileStem]->GetAssetMap().images;
|
||||
// for (Image image : images) {
|
||||
// if (image.materialName == selectedText) {
|
||||
// emit ImageSelected(std::make_shared<Image>(image), fileStem);
|
||||
// break;
|
||||
// }
|
||||
// }
|
||||
}
|
||||
} else if (parentItem && (parentItem->text(0) == "Tech Sets")) {
|
||||
XTreeWidgetItem *grandpaItem = dynamic_cast<XTreeWidgetItem*>(parentItem->parent());
|
||||
@ -703,19 +668,7 @@ void XTreeWidget::ItemSelectionChanged() {
|
||||
auto techsets = mZoneFiles[fileStem]->GetAssetMap().techSets;
|
||||
for (auto techset : techsets) {
|
||||
if (techset.name == selectedText) {
|
||||
emit TechSetSelected(std::make_shared<TechSet>(techset), fileStem);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
} else if (parentItem && (parentItem->text(0) == "Tech Sets")) {
|
||||
XTreeWidgetItem *grandpaItem = dynamic_cast<XTreeWidgetItem*>(parentItem->parent());
|
||||
if (grandpaItem && grandpaItem->text(0).contains(".zone")) {
|
||||
const QString fileStem = grandpaItem->text(0).section('.', 0, 0);
|
||||
auto techsets = mZoneFiles[fileStem]->GetAssetMap().techSets;
|
||||
for (auto techset : techsets) {
|
||||
if (techset.name == selectedText) {
|
||||
emit TechSetSelected(std::make_shared<TechSet>(techset), fileStem);
|
||||
emit TechSetSelected(std::make_shared<MaterialTechSet>(techset), fileStem);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -724,12 +677,12 @@ void XTreeWidget::ItemSelectionChanged() {
|
||||
XTreeWidgetItem *grandpaItem = dynamic_cast<XTreeWidgetItem*>(parentItem->parent());
|
||||
if (grandpaItem && grandpaItem->text(0).contains(".zone")) {
|
||||
const QString fileStem = grandpaItem->text(0).section('.', 0, 0);
|
||||
QVector<Material> materials = mZoneFiles[fileStem]->GetAssetMap().materials;
|
||||
for (Material material : materials) {
|
||||
if (material.name == selectedText) {
|
||||
emit MaterialSelected(std::make_shared<Material>(material), fileStem);
|
||||
break;
|
||||
}
|
||||
auto materials = mZoneFiles[fileStem]->GetAssetMap().materials;
|
||||
for (auto material : materials) {
|
||||
// if (material.name == selectedText) {
|
||||
// emit MaterialSelected(std::make_shared<Material>(material), fileStem);
|
||||
// break;
|
||||
// }
|
||||
}
|
||||
}
|
||||
} else if (parentItem && selectedText.contains(".wav")) {
|
||||
@ -743,15 +696,15 @@ void XTreeWidget::ItemSelectionChanged() {
|
||||
}
|
||||
if (grandpaItem && grandpaItem != invisibleRootItem() && grandpaItem->text(0).contains(".zone")) {
|
||||
const QString fileStem = grandpaItem->text(0).section('.', 0, 0);
|
||||
QVector<SoundAsset> soundAssets = mZoneFiles[fileStem]->GetAssetMap().sounds;
|
||||
for (SoundAsset soundAsset : soundAssets) {
|
||||
for (Sound sound : soundAsset.sounds) {
|
||||
if (sound.path.contains(selectedText)) {
|
||||
emit SoundSelected(std::make_shared<Sound>(sound), fileStem);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
// QVector<LoadedSound> LoadedSounds = mZoneFiles[fileStem]->GetAssetMap().sounds;
|
||||
// for (LoadedSound LoadedSound : LoadedSounds) {
|
||||
// for (Sound sound : LoadedSound.sounds) {
|
||||
// if (sound.path.contains(selectedText)) {
|
||||
// emit SoundSelected(std::make_shared<Sound>(sound), fileStem);
|
||||
// break;
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
}
|
||||
} else if (selectedItem->GetCategory() != CATEGORY_TYPE) {
|
||||
XTreeWidgetItem *zoneRoot = selectedItem;
|
||||
@ -772,12 +725,12 @@ void XTreeWidget::ItemSelectionChanged() {
|
||||
return;
|
||||
}
|
||||
|
||||
QVector<RawFile> rawFiles = mZoneFiles[fileStem]->GetAssetMap().rawFiles;
|
||||
for (RawFile rawFile : rawFiles) {
|
||||
if (rawFile.path.split('/').last() == selectedText) {
|
||||
emit RawFileSelected(std::make_shared<RawFile>(rawFile), fileStem);
|
||||
return;
|
||||
}
|
||||
auto rawFiles = mZoneFiles[fileStem]->GetAssetMap().rawFiles;
|
||||
for (auto rawFile : rawFiles) {
|
||||
//if (rawFile->path.split('/').last() == selectedText) {
|
||||
// emit RawFileSelected(std::make_shared<RawFile>(rawFile), fileStem);
|
||||
// return;
|
||||
//}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -819,7 +772,7 @@ void XTreeWidget::AddIWIFile(std::shared_ptr<IWIFile> aIWIFile) {
|
||||
}
|
||||
|
||||
XTreeWidgetItem *iwiItem = new XTreeWidgetItem(this);
|
||||
iwiItem->setIcon(0, ZoneFile::AssetTypeToIcon(ASSET_IMAGE));
|
||||
iwiItem->setIcon(0, Utils::CreateAssetIcon(Utils::ASSET_IMAGE));
|
||||
iwiItem->setText(0, iwiFileName);
|
||||
mIWIFiles[aIWIFile->fileStem.section(".", 0, 0)] = aIWIFile;
|
||||
}
|
||||
@ -835,7 +788,7 @@ void XTreeWidget::AddDDSFile(std::shared_ptr<DDSFile> aDDSFile) {
|
||||
}
|
||||
|
||||
XTreeWidgetItem *ddsItem = new XTreeWidgetItem(this);
|
||||
ddsItem->setIcon(0, ZoneFile::AssetTypeToIcon(ASSET_IMAGE));
|
||||
ddsItem->setIcon(0, Utils::CreateAssetIcon(Utils::ASSET_IMAGE));
|
||||
ddsItem->setText(0, ddsFileName);
|
||||
mDDSFiles[aDDSFile->fileStem.section(".", 0, 0)] = aDDSFile;
|
||||
}
|
||||
|
||||
@ -2,13 +2,15 @@
|
||||
#define XTREEWIDGET_H
|
||||
|
||||
#include "d3dbsp_structs.h"
|
||||
#include "asset_structs.h"
|
||||
#include "ddsfile.h"
|
||||
#include "iwifile.h"
|
||||
#include "fastfile.h"
|
||||
#include "xtreewidgetitem.h"
|
||||
#include "zonefile.h"
|
||||
#include "utils.h"
|
||||
#include "rawfile.h"
|
||||
#include "gfximage.h"
|
||||
#include "stringtable.h"
|
||||
#include "menudef.h"
|
||||
|
||||
#include <QTreeWidget>
|
||||
#include <QFileDialog>
|
||||
@ -39,11 +41,11 @@ signals:
|
||||
void ZoneFileSelected(std::shared_ptr<ZoneFile> aZoneFile, const QString aParentName);
|
||||
void LocalStringSelected(std::shared_ptr<ZoneFile> aZoneFile, const QString aParentName);
|
||||
void RawFileSelected(std::shared_ptr<RawFile> aRawFile, const QString aParentName);
|
||||
void ImageSelected(std::shared_ptr<Image> aImage, const QString aParentName);
|
||||
void TechSetSelected(std::shared_ptr<TechSet> aZoneFile, const QString aParentName);
|
||||
void ImageSelected(std::shared_ptr<GfxImage> aImage, const QString aParentName);
|
||||
void TechSetSelected(std::shared_ptr<MaterialTechSet> aZoneFile, const QString aParentName);
|
||||
void StrTableSelected(std::shared_ptr<StringTable> aStrTable, const QString aParentName);
|
||||
void MenuSelected(std::shared_ptr<Menu> aMenu, const QString aParentName);
|
||||
void SoundSelected(std::shared_ptr<Sound> aSound, const QString aParentName);
|
||||
void MenuSelected(std::shared_ptr<MenuDef> aMenu, const QString aParentName);
|
||||
void SoundSelected(std::shared_ptr<LoadedSound> aSound, const QString aParentName);
|
||||
void MaterialSelected(std::shared_ptr<Material> aMaterial, const QString aParentName);
|
||||
void ItemSelected(const QString itemText);
|
||||
|
||||
|
||||
@ -109,16 +109,16 @@ void ZoneFileViewer::SetZoneFile(std::shared_ptr<ZoneFile> aZoneFile) {
|
||||
int assetIndex = 0;
|
||||
foreach (auto assetOccurance, assetOccurances) {
|
||||
const QString record = assetOccurance.first;
|
||||
AssetType assetType = mZoneFile->AssetStrToEnum(record);
|
||||
Utils::AssetType assetType = mZoneFile->AssetStrToEnum(record);
|
||||
int assetCount = assetOccurance.second;
|
||||
|
||||
QIcon assetIcon = mZoneFile->AssetTypeToIcon(assetType);
|
||||
QIcon assetIcon = Utils::CreateAssetIcon(assetType);
|
||||
if (assetIcon.isNull()) {
|
||||
qDebug() << "Icon is null for record: " << record;
|
||||
}
|
||||
|
||||
QTableWidgetItem *recordItem = new QTableWidgetItem(record.toUpper());
|
||||
QTableWidgetItem *recordStrItem = new QTableWidgetItem(mZoneFile->AssetEnumToStr(assetType));
|
||||
QTableWidgetItem *recordStrItem = new QTableWidgetItem(Utils::AssetTypeToStr(assetType));
|
||||
QTableWidgetItem *recordCountItem = new QTableWidgetItem(QString::number(assetCount));
|
||||
recordItem->setIcon(assetIcon);
|
||||
|
||||
@ -133,8 +133,8 @@ void ZoneFileViewer::SetZoneFile(std::shared_ptr<ZoneFile> aZoneFile) {
|
||||
for (const QString &record : recordCounts.keys()) {
|
||||
int recordCount = recordCounts[record];
|
||||
|
||||
AssetType assetType = mZoneFile->AssetStrToEnum(record);
|
||||
QIcon assetIcon = mZoneFile->AssetTypeToIcon(assetType);
|
||||
Utils::AssetType assetType = mZoneFile->AssetStrToEnum(record);
|
||||
QIcon assetIcon = Utils::CreateAssetIcon(assetType);
|
||||
if (assetIcon.isNull()) {
|
||||
qDebug() << "Icon is null for record: " << record;
|
||||
}
|
||||
@ -142,7 +142,7 @@ void ZoneFileViewer::SetZoneFile(std::shared_ptr<ZoneFile> aZoneFile) {
|
||||
ui->tableWidget_RecordCounts->setRowCount(recordIndex + 1);
|
||||
|
||||
QTableWidgetItem *recordItem = new QTableWidgetItem(record.toUpper());
|
||||
QTableWidgetItem *recordCountStrItem = new QTableWidgetItem(mZoneFile->AssetEnumToStr(assetType));
|
||||
QTableWidgetItem *recordCountStrItem = new QTableWidgetItem(Utils::AssetTypeToStr(assetType));
|
||||
QTableWidgetItem *recordCountItem = new QTableWidgetItem(QString::number(recordCount));
|
||||
recordItem->setIcon(assetIcon);
|
||||
|
||||
|
||||
@ -1,6 +1,8 @@
|
||||
#include "assets_cod4_360.h"
|
||||
|
||||
Assets_COD4_360::Assets_COD4_360() {
|
||||
Assets_COD4_360::Assets_COD4_360(QObject *parent)
|
||||
: Assets(parent)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
@ -8,106 +10,3 @@ Assets_COD4_360::~Assets_COD4_360() {
|
||||
|
||||
}
|
||||
|
||||
std::shared_ptr<Animation> Assets_COD4_360::Load_Animation(QDataStream *aZoneFileStream) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
std::shared_ptr<Model> Assets_COD4_360::Load_Model(QDataStream *aZoneFileStream) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
std::shared_ptr<Material> Assets_COD4_360::Load_Material(QDataStream *aZoneFileStream) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
std::shared_ptr<MaterialPixelShader> Assets_COD4_360::Load_MaterialPixelShader(QDataStream *aZoneFileStream) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
std::shared_ptr<MaterialTechSet> Assets_COD4_360::Load_MaterialTechSet(QDataStream *aZoneFileStream) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
std::shared_ptr<GfxImage> Assets_COD4_360::Load_GfxImage(QDataStream *aZoneFileStream) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
std::shared_ptr<SoundAliasList> Assets_COD4_360::Load_SoundAliasList(QDataStream *aZoneFileStream) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
std::shared_ptr<SoundCurve> Assets_COD4_360::Load_SoundCurve(QDataStream *aZoneFileStream) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
std::shared_ptr<LoadedSound> Assets_COD4_360::Load_LoadedSound(QDataStream *aZoneFileStream) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
std::shared_ptr<ClipMap> Assets_COD4_360::Load_ClipMap(QDataStream *aZoneFileStream) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
std::shared_ptr<ComWorld> Assets_COD4_360::Load_ComWorld(QDataStream *aZoneFileStream) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
std::shared_ptr<GameWorldSp> Assets_COD4_360::Load_GameWorldSp(QDataStream *aZoneFileStream) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
std::shared_ptr<GameWorldMp> Assets_COD4_360::Load_GameWorldMp(QDataStream *aZoneFileStream) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
std::shared_ptr<MapEnts> Assets_COD4_360::Load_MapEnts(QDataStream *aZoneFileStream) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
std::shared_ptr<GfxWorld> Assets_COD4_360::Load_GfxWorld(QDataStream *aZoneFileStream){
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
std::shared_ptr<GfxLightDef> Assets_COD4_360::Load_GfxLightPtr(QDataStream *aZoneFileStream) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
std::shared_ptr<GameFont> Assets_COD4_360::Load_GameFont(QDataStream *aZoneFileStream) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
std::shared_ptr<MenuList> Assets_COD4_360::Load_MenuList(QDataStream *aZoneFileStream) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
std::shared_ptr<MenuDef> Assets_COD4_360::Load_MenuDef(QDataStream *aZoneFileStream) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
std::shared_ptr<LocalizeEntry> Assets_COD4_360::Load_LocalizeEntry(QDataStream *aZoneFileStream) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
std::shared_ptr<WeaponDef> Assets_COD4_360::Load_WeaponDef(QDataStream *aZoneFileStream) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
std::shared_ptr<SoundDriver> Assets_COD4_360::Load_SoundDriver(QDataStream *aZoneFileStream) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
std::shared_ptr<EffectDef> Assets_COD4_360::Load_EffectDef(QDataStream *aZoneFileStream) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
std::shared_ptr<ImpactTable> Assets_COD4_360::Load_ImpactTable(QDataStream *aZoneFileStream) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
std::shared_ptr<RawFile> Assets_COD4_360::Load_RawFile(QDataStream *aZoneFileStream) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
std::shared_ptr<StringTable> Assets_COD4_360::Load_StringTable(QDataStream *aZoneFileStream) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
@ -5,36 +5,11 @@
|
||||
|
||||
class Assets_COD4_360 : public Assets
|
||||
{
|
||||
public:
|
||||
Assets_COD4_360();
|
||||
~Assets_COD4_360();
|
||||
Q_OBJECT
|
||||
|
||||
std::shared_ptr<Animation> Load_Animation(QDataStream *aZoneFileStream) override;
|
||||
std::shared_ptr<Model> Load_Model(QDataStream *aZoneFileStream) override;
|
||||
std::shared_ptr<Material> Load_Material(QDataStream *aZoneFileStream) override;
|
||||
std::shared_ptr<MaterialPixelShader> Load_MaterialPixelShader(QDataStream *aZoneFileStream) override;
|
||||
std::shared_ptr<MaterialTechSet> Load_MaterialTechSet(QDataStream *aZoneFileStream) override;
|
||||
std::shared_ptr<GfxImage> Load_GfxImage(QDataStream *aZoneFileStream) override;
|
||||
std::shared_ptr<SoundAliasList> Load_SoundAliasList(QDataStream *aZoneFileStream) override;
|
||||
std::shared_ptr<SoundCurve> Load_SoundCurve(QDataStream *aZoneFileStream) override;
|
||||
std::shared_ptr<LoadedSound> Load_LoadedSound(QDataStream *aZoneFileStream) override;
|
||||
std::shared_ptr<ClipMap> Load_ClipMap(QDataStream *aZoneFileStream) override;
|
||||
std::shared_ptr<ComWorld> Load_ComWorld(QDataStream *aZoneFileStream) override;
|
||||
std::shared_ptr<GameWorldSp> Load_GameWorldSp(QDataStream *aZoneFileStream) override;
|
||||
std::shared_ptr<GameWorldMp> Load_GameWorldMp(QDataStream *aZoneFileStream) override;
|
||||
std::shared_ptr<MapEnts> Load_MapEnts(QDataStream *aZoneFileStream) override;
|
||||
std::shared_ptr<GfxWorld> Load_GfxWorld(QDataStream *aZoneFileStream) override;
|
||||
std::shared_ptr<GfxLightDef> Load_GfxLightPtr(QDataStream *aZoneFileStream) override;
|
||||
std::shared_ptr<GameFont> Load_GameFont(QDataStream *aZoneFileStream) override;
|
||||
std::shared_ptr<MenuList> Load_MenuList(QDataStream *aZoneFileStream) override;
|
||||
std::shared_ptr<MenuDef> Load_MenuDef(QDataStream *aZoneFileStream) override;
|
||||
std::shared_ptr<LocalizeEntry> Load_LocalizeEntry(QDataStream *aZoneFileStream) override;
|
||||
std::shared_ptr<WeaponDef> Load_WeaponDef(QDataStream *aZoneFileStream) override;
|
||||
std::shared_ptr<SoundDriver> Load_SoundDriver(QDataStream *aZoneFileStream) override;
|
||||
std::shared_ptr<EffectDef> Load_EffectDef(QDataStream *aZoneFileStream) override;
|
||||
std::shared_ptr<ImpactTable> Load_ImpactTable(QDataStream *aZoneFileStream) override;
|
||||
std::shared_ptr<RawFile> Load_RawFile(QDataStream *aZoneFileStream) override;
|
||||
std::shared_ptr<StringTable> Load_StringTable(QDataStream *aZoneFileStream) override;
|
||||
public:
|
||||
explicit Assets_COD4_360(QObject *parent = nullptr);
|
||||
~Assets_COD4_360();
|
||||
};
|
||||
|
||||
#endif // ASSETS_COD4_360_H
|
||||
|
||||
648
libs/assets/animparts.cpp
Normal file
648
libs/assets/animparts.cpp
Normal file
@ -0,0 +1,648 @@
|
||||
#include "animparts.h"
|
||||
|
||||
#include <QIODevice>
|
||||
|
||||
QDataStream &operator<<(QDataStream &aDataStream, const XAnimDynamicFrames &aAnimDynamicFramesIn)
|
||||
{
|
||||
aDataStream << aAnimDynamicFramesIn.framesPtr;
|
||||
|
||||
return aDataStream;
|
||||
}
|
||||
|
||||
QDataStream &operator>>(QDataStream &aDataStream, XAnimDynamicFrames &aAnimDynamicFramesOut)
|
||||
{
|
||||
aDataStream >> aAnimDynamicFramesOut.framesPtr;
|
||||
|
||||
return aDataStream;
|
||||
}
|
||||
QString XAnimDynamicFramesToString(const XAnimDynamicFrames &aAnimDynamicFrames) {
|
||||
QString debug;
|
||||
|
||||
debug.append("XAnimDynamicFrames(");
|
||||
|
||||
debug.append(QString("\n framesPtr: %1").arg(aAnimDynamicFrames.framesPtr));
|
||||
for (int i = 0; i < 3; i++) {
|
||||
debug.append(QString("\n frames %1: %2").arg(i).arg(aAnimDynamicFrames.frames[i]));
|
||||
}
|
||||
|
||||
debug.append("\n)");
|
||||
|
||||
return debug;
|
||||
}
|
||||
|
||||
QDataStream &operator<<(QDataStream &aDataStream, const XAnimDynamicIndices &aAnimDynamicIndicesIn)
|
||||
{
|
||||
aDataStream << aAnimDynamicIndicesIn.indices[0];
|
||||
|
||||
return aDataStream;
|
||||
}
|
||||
|
||||
QDataStream &operator>>(QDataStream &aDataStream, XAnimDynamicIndices &aAnimDynamicIndicesOut)
|
||||
{
|
||||
aDataStream >> aAnimDynamicIndicesOut.indices[0];
|
||||
|
||||
return aDataStream;
|
||||
}
|
||||
QString XAnimDynamicIndicesToString(const XAnimDynamicIndices &aAnimDynamicIndices) {
|
||||
QString debug;
|
||||
|
||||
debug.append("XAnimDynamicIndices(");
|
||||
|
||||
debug.append(QString("\n indices: %1").arg(aAnimDynamicIndices.indices[0]));
|
||||
|
||||
debug.append("\n)");
|
||||
|
||||
return debug;
|
||||
}
|
||||
|
||||
QDataStream &operator<<(QDataStream &aDataStream, const XAnimPartTransFrames &aAnimPartTransFramesIn)
|
||||
{
|
||||
for (int i = 0; i < 3; i++) {
|
||||
aDataStream << aAnimPartTransFramesIn.mins[i];
|
||||
}
|
||||
|
||||
for (int i = 0; i < 3; i++) {
|
||||
aDataStream << aAnimPartTransFramesIn.size[i];
|
||||
}
|
||||
|
||||
aDataStream
|
||||
<< aAnimPartTransFramesIn.frames
|
||||
<< aAnimPartTransFramesIn.indices;
|
||||
|
||||
return aDataStream;
|
||||
}
|
||||
|
||||
QDataStream &operator>>(QDataStream &aDataStream, XAnimPartTransFrames &aAnimPartTransFramesOut)
|
||||
{
|
||||
for (int i = 0; i < 3; i++) {
|
||||
aDataStream >> aAnimPartTransFramesOut.mins[i];
|
||||
}
|
||||
|
||||
for (int i = 0; i < 3; i++) {
|
||||
aDataStream >> aAnimPartTransFramesOut.size[i];
|
||||
}
|
||||
|
||||
aDataStream
|
||||
>> aAnimPartTransFramesOut.frames
|
||||
>> aAnimPartTransFramesOut.indices;
|
||||
|
||||
return aDataStream;
|
||||
}
|
||||
QString XAnimPartTransFramesToString(const XAnimPartTransFrames &aAnimPartTransFrames) {
|
||||
QString debug;
|
||||
|
||||
debug.append("XAnimPartTransFrames(");
|
||||
|
||||
for (int i = 0; i < 3; i++) {
|
||||
debug.append(QString("\n mins %1: %2").arg(i).arg(aAnimPartTransFrames.mins[i]));
|
||||
}
|
||||
for (int i = 0; i < 3; i++) {
|
||||
debug.append(QString("\n size %1: %2").arg(i).arg(aAnimPartTransFrames.size[i]));
|
||||
}
|
||||
debug.append(QString("\n frames: %1").arg(XAnimDynamicFramesToString(aAnimPartTransFrames.frames)));
|
||||
debug.append(QString("\n frames: %1").arg(XAnimDynamicIndicesToString(aAnimPartTransFrames.indices)));
|
||||
|
||||
debug.append("\n)");
|
||||
|
||||
return debug;
|
||||
}
|
||||
|
||||
QDataStream &operator<<(QDataStream &aDataStream, const XAnimPartTransData &aAnimPartTransDataIn)
|
||||
{
|
||||
aDataStream
|
||||
<< aAnimPartTransDataIn.frames;
|
||||
|
||||
for (int i = 0; i < 3; i++) {
|
||||
aDataStream << aAnimPartTransDataIn.frame0[i];
|
||||
}
|
||||
|
||||
return aDataStream;
|
||||
}
|
||||
|
||||
QDataStream &operator>>(QDataStream &aDataStream, XAnimPartTransData &aAnimPartTransDataOut)
|
||||
{
|
||||
aDataStream
|
||||
>> aAnimPartTransDataOut.frames;
|
||||
|
||||
for (int i = 0; i < 3; i++) {
|
||||
aDataStream >> aAnimPartTransDataOut.frame0[i];
|
||||
}
|
||||
|
||||
return aDataStream;
|
||||
}
|
||||
QString XAnimPartTransDataToString(const XAnimPartTransData &aAnimPartTransData) {
|
||||
QString debug;
|
||||
|
||||
debug.append("XAnimPartTransData(");
|
||||
|
||||
debug.append(QString("\n frames: %1").arg(XAnimPartTransFramesToString(aAnimPartTransData.frames)));
|
||||
|
||||
for (int i = 0; i < 3; i++) {
|
||||
debug.append(QString("\n smallTrans: %1").arg(aAnimPartTransData.frame0[i]));
|
||||
}
|
||||
debug.append("\n)");
|
||||
|
||||
return debug;
|
||||
}
|
||||
|
||||
QDataStream &operator<<(QDataStream &aDataStream, const XAnimPartTrans &aAnimPartTransIn)
|
||||
{
|
||||
aDataStream
|
||||
<< aAnimPartTransIn.size
|
||||
<< aAnimPartTransIn.smallTrans
|
||||
<< aAnimPartTransIn.data;
|
||||
|
||||
return aDataStream;
|
||||
}
|
||||
|
||||
QDataStream &operator>>(QDataStream &aDataStream, XAnimPartTrans &aAnimPartTransOut)
|
||||
{
|
||||
aDataStream
|
||||
>> aAnimPartTransOut.size
|
||||
>> aAnimPartTransOut.smallTrans
|
||||
>> aAnimPartTransOut.data;
|
||||
|
||||
return aDataStream;
|
||||
}
|
||||
QString XAnimPartTransToString(const XAnimPartTrans &aAnimPartTrans) {
|
||||
QString debug;
|
||||
|
||||
debug.append("XAnimPartTrans(");
|
||||
|
||||
debug.append(QString("\n size: %1").arg(aAnimPartTrans.size));
|
||||
debug.append(QString("\n smallTrans: %1").arg(aAnimPartTrans.smallTrans));
|
||||
debug.append(QString("\n data: %1").arg(XAnimPartTransDataToString(aAnimPartTrans.data)));
|
||||
debug.append("\n)");
|
||||
|
||||
return debug;
|
||||
}
|
||||
|
||||
QDataStream &operator<<(QDataStream &aDataStream, const XAnimDeltaPartQuatDataFrames &aAnimDeltaPartQuatDataFramesIn)
|
||||
{
|
||||
aDataStream
|
||||
<< aAnimDeltaPartQuatDataFramesIn.framesPtr
|
||||
<< aAnimDeltaPartQuatDataFramesIn.indices;
|
||||
|
||||
return aDataStream;
|
||||
}
|
||||
|
||||
QDataStream &operator>>(QDataStream &aDataStream, XAnimDeltaPartQuatDataFrames &aAnimDeltaPartQuatDataFramesOut)
|
||||
{
|
||||
aDataStream
|
||||
>> aAnimDeltaPartQuatDataFramesOut.framesPtr
|
||||
>> aAnimDeltaPartQuatDataFramesOut.indices;
|
||||
|
||||
return aDataStream;
|
||||
}
|
||||
QString XAnimDeltaPartQuatDataFramesToString(const XAnimDeltaPartQuatDataFrames &aAnimDeltaPartQuatDataFrames) {
|
||||
QString debug;
|
||||
|
||||
debug.append("XAnimDeltaPartQuatDataFrames(");
|
||||
|
||||
debug.append(QString("\n framesPtr: %1").arg(aAnimDeltaPartQuatDataFrames.framesPtr));
|
||||
for (int i = 0; i < 2; i++) {
|
||||
debug.append(QString("\n frames %1: %2").arg(i).arg(aAnimDeltaPartQuatDataFrames.frames[i]));
|
||||
}
|
||||
debug.append(QString("\n indices: %1").arg(XAnimDynamicIndicesToString(aAnimDeltaPartQuatDataFrames.indices)));
|
||||
debug.append("\n)");
|
||||
|
||||
return debug;
|
||||
}
|
||||
|
||||
QDataStream &operator<<(QDataStream &aDataStream, const XAnimDeltaPartQuatData &aAnimDeltaPartQuatDataIn)
|
||||
{
|
||||
aDataStream
|
||||
<< aAnimDeltaPartQuatDataIn.frames;
|
||||
|
||||
for (int i = 0; i < 2; i++) {
|
||||
aDataStream << aAnimDeltaPartQuatDataIn.frame0[i];
|
||||
}
|
||||
|
||||
return aDataStream;
|
||||
}
|
||||
|
||||
QDataStream &operator>>(QDataStream &aDataStream, XAnimDeltaPartQuatData &aAnimDeltaPartQuatDataOut)
|
||||
{
|
||||
aDataStream
|
||||
>> aAnimDeltaPartQuatDataOut.frames;
|
||||
|
||||
for (int i = 0; i < 2; i++) {
|
||||
aDataStream >> aAnimDeltaPartQuatDataOut.frame0[i];
|
||||
}
|
||||
|
||||
return aDataStream;
|
||||
}
|
||||
QString XAnimDeltaPartQuatDataToString(const XAnimDeltaPartQuatData &aAnimDeltaPartQuatData) {
|
||||
QString debug;
|
||||
|
||||
debug.append("XAnimDeltaPartQuatData(");
|
||||
|
||||
debug.append(QString("\n frames: %1").arg(XAnimDeltaPartQuatDataFramesToString(aAnimDeltaPartQuatData.frames)));
|
||||
for (int i = 0; i < 2; i++) {
|
||||
debug.append(QString("\n frame0 %1: %2").arg(i).arg(aAnimDeltaPartQuatData.frame0[i]));
|
||||
}
|
||||
debug.append("\n)");
|
||||
|
||||
return debug;
|
||||
}
|
||||
|
||||
QDataStream &operator<<(QDataStream &aDataStream, const XAnimDeltaPartQuat &aAnimDeltaPartQuatIn)
|
||||
{
|
||||
aDataStream
|
||||
<< aAnimDeltaPartQuatIn.size
|
||||
<< aAnimDeltaPartQuatIn.data;
|
||||
|
||||
return aDataStream;
|
||||
}
|
||||
|
||||
QDataStream &operator>>(QDataStream &aDataStream, XAnimDeltaPartQuat &aAnimDeltaPartQuatOut)
|
||||
{
|
||||
aDataStream
|
||||
>> aAnimDeltaPartQuatOut.size
|
||||
>> aAnimDeltaPartQuatOut.data;
|
||||
|
||||
return aDataStream;
|
||||
}
|
||||
QString XAnimDeltaPartQuatToString(const XAnimDeltaPartQuat &aAnimDeltaPartQuat) {
|
||||
QString debug;
|
||||
|
||||
debug.append("XAnimDeltaPartQuat(");
|
||||
|
||||
debug.append(QString("\n size: %1").arg(aAnimDeltaPartQuat.size));
|
||||
debug.append(QString("\n data: %1").arg(XAnimDeltaPartQuatDataToString(aAnimDeltaPartQuat.data)));
|
||||
debug.append("\n)");
|
||||
|
||||
return debug;
|
||||
}
|
||||
|
||||
QDataStream &operator<<(QDataStream &aDataStream, const XAnimDeltaPart &aAnimDeltaPartIn)
|
||||
{
|
||||
aDataStream
|
||||
<< aAnimDeltaPartIn.transPtr
|
||||
<< aAnimDeltaPartIn.quatPtr;
|
||||
|
||||
return aDataStream;
|
||||
}
|
||||
|
||||
QDataStream &operator>>(QDataStream &aDataStream, XAnimDeltaPart &aAnimDeltaPartOut)
|
||||
{
|
||||
aDataStream
|
||||
>> aAnimDeltaPartOut.transPtr
|
||||
>> aAnimDeltaPartOut.quatPtr;
|
||||
|
||||
return aDataStream;
|
||||
}
|
||||
QString XAnimDeltaPartToString(const XAnimDeltaPart &aAnimDeltaPart) {
|
||||
QString debug;
|
||||
|
||||
debug.append("XAnimDeltaPart(");
|
||||
|
||||
debug.append(QString("\n transPtr: %1").arg(aAnimDeltaPart.transPtr));
|
||||
debug.append(QString("\n trans: %1").arg(XAnimPartTransToString(aAnimDeltaPart.trans)));
|
||||
debug.append(QString("\n quatPtr: %1").arg(aAnimDeltaPart.quatPtr));
|
||||
debug.append(QString("\n quat: %1").arg(XAnimDeltaPartQuatToString(aAnimDeltaPart.quat)));
|
||||
debug.append("\n)");
|
||||
|
||||
return debug;
|
||||
}
|
||||
|
||||
QDataStream &operator<<(QDataStream &aDataStream, const XAnimNotifyInfo &aAnimNotifyInfoIn)
|
||||
{
|
||||
aDataStream
|
||||
<< aAnimNotifyInfoIn.name
|
||||
<< aAnimNotifyInfoIn.time;
|
||||
|
||||
return aDataStream;
|
||||
}
|
||||
QDebug operator<<(QDebug debug, const XAnimNotifyInfo &aAnimNotifyInfo) {
|
||||
QDebugStateSaver saver(debug);
|
||||
debug.noquote().nospace();
|
||||
|
||||
debug << "XAnimNotifyInfo(";
|
||||
|
||||
debug << "\n name: " << aAnimNotifyInfo.name;
|
||||
debug << "\n time: " << aAnimNotifyInfo.time;
|
||||
debug << "\n)";
|
||||
|
||||
return debug;
|
||||
}
|
||||
QString XAnimNotifyInfoToString(const XAnimNotifyInfo &aAnimNotifyInfo) {
|
||||
QString debug;
|
||||
|
||||
debug.append("XAnimNotifyInfo(");
|
||||
|
||||
debug.append(QString("\n name: %1").arg(aAnimNotifyInfo.name));
|
||||
debug.append(QString("\n time: %1").arg(aAnimNotifyInfo.time));
|
||||
debug.append("\n)");
|
||||
|
||||
return debug;
|
||||
}
|
||||
|
||||
QDataStream &operator>>(QDataStream &aDataStream, XAnimNotifyInfo &aAnimNotifyInfoOut)
|
||||
{
|
||||
aDataStream
|
||||
>> aAnimNotifyInfoOut.name
|
||||
>> aAnimNotifyInfoOut.time;
|
||||
|
||||
return aDataStream;
|
||||
}
|
||||
|
||||
QDataStream &operator<<(QDataStream &aDataStream, const XAnimIndices &aAnimIndicesIn)
|
||||
{
|
||||
aDataStream
|
||||
<< aAnimIndicesIn.indexPtr
|
||||
<< aAnimIndicesIn.index;
|
||||
|
||||
return aDataStream;
|
||||
}
|
||||
QDebug operator<<(QDebug debug, const XAnimIndices &aAnimIndices) {
|
||||
QDebugStateSaver saver(debug);
|
||||
debug.noquote().nospace();
|
||||
|
||||
debug << "XAnimIndices(";
|
||||
|
||||
debug << "\n name: " << aAnimIndices.indexPtr;
|
||||
debug << "\n namePtr: " << aAnimIndices.index;
|
||||
debug << "\n)";
|
||||
|
||||
return debug;
|
||||
}
|
||||
QString XAnimIndicesToString(const XAnimIndices &aAnimIndices) {
|
||||
QString debug;
|
||||
|
||||
debug.append("XAnimIndices(");
|
||||
|
||||
debug.append(QString("\n name: %1").arg(aAnimIndices.indexPtr));
|
||||
debug.append(QString("\n namePtr: %1").arg(aAnimIndices.index));
|
||||
debug.append("\n)");
|
||||
|
||||
return debug;
|
||||
}
|
||||
|
||||
QDataStream &operator>>(QDataStream &aDataStream, XAnimIndices &aAnimIndicesOut)
|
||||
{
|
||||
aDataStream
|
||||
>> aAnimIndicesOut.indexPtr
|
||||
>> aAnimIndicesOut.index;
|
||||
|
||||
return aDataStream;
|
||||
}
|
||||
|
||||
QDataStream &operator<<(QDataStream &aDataStream, const XAnimParts &aAnimPartIn)
|
||||
{
|
||||
aDataStream
|
||||
<< aAnimPartIn.name
|
||||
<< aAnimPartIn.dataByteCount
|
||||
<< aAnimPartIn.dataShortCount
|
||||
<< aAnimPartIn.dataIntCount
|
||||
<< aAnimPartIn.randomDataByteCount
|
||||
<< aAnimPartIn.randomDataIntCount
|
||||
<< aAnimPartIn.numframes
|
||||
<< aAnimPartIn.bLoop
|
||||
<< aAnimPartIn.bDelta;
|
||||
|
||||
for (int i = 0; i < 12; i++) {
|
||||
aDataStream << aAnimPartIn.boneCount[i];
|
||||
}
|
||||
|
||||
aDataStream
|
||||
<< aAnimPartIn.notifyCount
|
||||
<< aAnimPartIn.pad
|
||||
<< aAnimPartIn.randomDataShortCount
|
||||
<< aAnimPartIn.indexCount
|
||||
<< aAnimPartIn.framerate
|
||||
<< aAnimPartIn.frequency
|
||||
<< aAnimPartIn.namesPtr
|
||||
<< aAnimPartIn.dataBytePtr
|
||||
<< aAnimPartIn.dataShortPtr
|
||||
<< aAnimPartIn.dataIntPtr
|
||||
<< aAnimPartIn.randomDataShortPtr
|
||||
<< aAnimPartIn.randomDataBytePtr
|
||||
<< aAnimPartIn.randomDataIntPtr
|
||||
<< aAnimPartIn.indices
|
||||
<< aAnimPartIn.notifyPtr
|
||||
<< aAnimPartIn.deltaPartPtr;
|
||||
|
||||
return aDataStream;
|
||||
}
|
||||
|
||||
quint32 ROL4(quint32 value, int positions) {
|
||||
return (value << positions) | (value >> (32 - positions));
|
||||
}
|
||||
|
||||
QDataStream &operator>>(QDataStream &aDataStream, XAnimParts &aAnimPartOut)
|
||||
{
|
||||
aDataStream
|
||||
>> aAnimPartOut.namePtr
|
||||
>> aAnimPartOut.dataByteCount
|
||||
>> aAnimPartOut.dataShortCount
|
||||
>> aAnimPartOut.dataIntCount
|
||||
>> aAnimPartOut.randomDataByteCount
|
||||
>> aAnimPartOut.randomDataIntCount
|
||||
>> aAnimPartOut.numframes
|
||||
>> aAnimPartOut.bLoop
|
||||
>> aAnimPartOut.bDelta;
|
||||
|
||||
for (int i = 0; i < 12; i++) {
|
||||
aDataStream >> aAnimPartOut.boneCount[i];
|
||||
}
|
||||
|
||||
aDataStream
|
||||
>> aAnimPartOut.notifyCount
|
||||
>> aAnimPartOut.assetType
|
||||
>> aAnimPartOut.pad;
|
||||
|
||||
aDataStream.skipRawData(3);
|
||||
|
||||
aDataStream
|
||||
>> aAnimPartOut.randomDataShortCount
|
||||
>> aAnimPartOut.indexCount;
|
||||
|
||||
quint32 framerateInt, frequencyInt;
|
||||
aDataStream
|
||||
>> framerateInt
|
||||
>> frequencyInt
|
||||
>> aAnimPartOut.namesPtr
|
||||
>> aAnimPartOut.dataBytePtr
|
||||
>> aAnimPartOut.dataShortPtr
|
||||
>> aAnimPartOut.dataIntPtr
|
||||
>> aAnimPartOut.randomDataShortPtr
|
||||
>> aAnimPartOut.randomDataBytePtr
|
||||
>> aAnimPartOut.randomDataIntPtr
|
||||
>> aAnimPartOut.indices
|
||||
>> aAnimPartOut.notifyPtr
|
||||
>> aAnimPartOut.deltaPartPtr;
|
||||
|
||||
aAnimPartOut.framerate = *reinterpret_cast<float*>(&framerateInt);
|
||||
aAnimPartOut.frequency = *reinterpret_cast<float*>(&frequencyInt);
|
||||
|
||||
if (aAnimPartOut.namePtr) {
|
||||
aAnimPartOut.name = "";
|
||||
|
||||
char animNameChar;
|
||||
aDataStream >> animNameChar;
|
||||
while (animNameChar != '\0') {
|
||||
aAnimPartOut.name += animNameChar;
|
||||
|
||||
aDataStream >> animNameChar;
|
||||
}
|
||||
}
|
||||
if (aAnimPartOut.namesPtr) {
|
||||
int nameCount = aAnimPartOut.boneCount[11];
|
||||
aDataStream.skipRawData(2 * nameCount);
|
||||
|
||||
for (int i = 0; i < nameCount; i++) {
|
||||
aDataStream.skipRawData(2);
|
||||
}
|
||||
}
|
||||
if (aAnimPartOut.notifyPtr) {
|
||||
int notifyCount = aAnimPartOut.notifyCount;
|
||||
aDataStream.skipRawData(8 * notifyCount);
|
||||
|
||||
for (int i = 0; i < notifyCount; i++) {
|
||||
aDataStream.skipRawData(8);
|
||||
aDataStream >> aAnimPartOut.notify;
|
||||
}
|
||||
}
|
||||
if (aAnimPartOut.deltaPartPtr) {
|
||||
aDataStream >> aAnimPartOut.deltaPart;
|
||||
if (aAnimPartOut.deltaPart.transPtr) {
|
||||
aDataStream >> aAnimPartOut.deltaPart.trans;
|
||||
|
||||
if (aAnimPartOut.deltaPart.trans.size) {
|
||||
aDataStream >> aAnimPartOut.deltaPart.trans.data.frames;
|
||||
quint32 size = aAnimPartOut.deltaPart.trans.size;
|
||||
quint32 readSize;
|
||||
if (aAnimPartOut.numframes >= 0x100) {
|
||||
readSize = 2 * (size + 1);
|
||||
} else {
|
||||
readSize = size + 1;
|
||||
}
|
||||
aDataStream >> aAnimPartOut.deltaPart.trans.data.frames.indices;
|
||||
|
||||
if (aAnimPartOut.deltaPart.trans.smallTrans) {
|
||||
if (aAnimPartOut.deltaPart.trans.data.frames.frames.framesPtr) {
|
||||
aDataStream.skipRawData(3 * (aAnimPartOut.deltaPart.trans.size + 1));
|
||||
}
|
||||
} else if (aAnimPartOut.deltaPart.trans.data.frames.frames.framesPtr) {
|
||||
aDataStream.skipRawData(6 * (aAnimPartOut.deltaPart.trans.size + 1));
|
||||
}
|
||||
}
|
||||
}
|
||||
if (aAnimPartOut.deltaPart.quatPtr) {
|
||||
aDataStream >> aAnimPartOut.deltaPart.quat;
|
||||
|
||||
if (aAnimPartOut.deltaPart.quat.size) {
|
||||
aDataStream >> aAnimPartOut.deltaPart.quat.data.frames;
|
||||
aDataStream >> aAnimPartOut.deltaPart.quat.data.frames.indices;
|
||||
|
||||
if (aAnimPartOut.deltaPart.quat.data.frames.framesPtr) {
|
||||
aDataStream.skipRawData(4 * (aAnimPartOut.deltaPart.quat.size + 1));
|
||||
}
|
||||
} else {
|
||||
aDataStream >> aAnimPartOut.deltaPart.quat.data;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (aAnimPartOut.dataBytePtr) {
|
||||
aDataStream.skipRawData(aAnimPartOut.dataByteCount);
|
||||
}
|
||||
if (aAnimPartOut.dataShortPtr) {
|
||||
aDataStream.skipRawData(ROL4(aAnimPartOut.dataShortCount, 1));
|
||||
}
|
||||
if (aAnimPartOut.dataIntPtr) {
|
||||
aDataStream.skipRawData(ROL4(aAnimPartOut.dataIntCount, 2));
|
||||
}
|
||||
if (aAnimPartOut.randomDataShortPtr) {
|
||||
aDataStream.skipRawData(2 * aAnimPartOut.randomDataShortCount);
|
||||
}
|
||||
if (aAnimPartOut.randomDataBytePtr) {
|
||||
aDataStream.skipRawData(2 * aAnimPartOut.randomDataByteCount);
|
||||
}
|
||||
if (aAnimPartOut.randomDataIntPtr) {
|
||||
aDataStream.skipRawData(ROL4(aAnimPartOut.randomDataIntCount, 2));
|
||||
}
|
||||
|
||||
qDebug() << aDataStream.device()->pos();
|
||||
|
||||
return aDataStream;
|
||||
}
|
||||
|
||||
QString XAnimPartsToString(const XAnimParts &xAnimParts) {
|
||||
QString debug = "";
|
||||
|
||||
debug.append(QString("XAnimParts("));
|
||||
|
||||
debug.append(QString("\n name: %1").arg(xAnimParts.name));
|
||||
debug.append(QString("\n namePtr: %1").arg(QString::number(xAnimParts.namePtr, 16)));
|
||||
|
||||
debug.append(QString("\n dataByteCount: %1").arg(xAnimParts.dataByteCount));
|
||||
debug.append(QString("\n dataShortCount: %1").arg(xAnimParts.dataShortCount));
|
||||
debug.append(QString("\n dataIntCount: %1").arg(xAnimParts.dataIntCount));
|
||||
debug.append(QString("\n randomDataByteCount: %1").arg(xAnimParts.randomDataByteCount));
|
||||
debug.append(QString("\n randomDataIntCount: %1").arg(xAnimParts.randomDataIntCount));
|
||||
debug.append(QString("\n numframes: %1").arg(xAnimParts.numframes));
|
||||
|
||||
debug.append(QString("\n bLoop: %1").arg(xAnimParts.bLoop));
|
||||
debug.append(QString("\n bDelta: %1").arg(xAnimParts.bDelta));
|
||||
|
||||
for (int i = 0; i < 12; i++) {
|
||||
debug.append(QString("\n boneCount %1: %2").arg(i).arg(xAnimParts.boneCount[i]));
|
||||
}
|
||||
|
||||
debug.append(QString("\n notifyCount: %1").arg(xAnimParts.notifyCount));
|
||||
debug.append(QString("\n assetType: %1").arg(xAnimParts.assetType));
|
||||
|
||||
debug.append(QString("\n pad: %1").arg(xAnimParts.pad));
|
||||
|
||||
debug.append(QString("\n randomDataShortCount: %1").arg(xAnimParts.randomDataShortCount));
|
||||
debug.append(QString("\n indexCount: %1").arg(xAnimParts.indexCount));
|
||||
|
||||
debug.append(QString("\n framerate: %1").arg(xAnimParts.framerate));
|
||||
debug.append(QString("\n frequency: %1").arg(xAnimParts.frequency));
|
||||
|
||||
debug.append(QString("\n namesPtr: %1").arg(QString::number(xAnimParts.namesPtr, 16)));
|
||||
debug.append(QString("\n names: %1").arg(xAnimParts.names));
|
||||
|
||||
debug.append(QString("\n dataBytePtr: %1").arg(QString::number(xAnimParts.dataBytePtr, 16)));
|
||||
debug.append(QString("\n dataByte: %1").arg(xAnimParts.dataByte));
|
||||
|
||||
debug.append(QString("\n dataShortPtr: %1").arg(QString::number(xAnimParts.dataShortPtr, 16)));
|
||||
debug.append(QString("\n dataShort: %1").arg(xAnimParts.dataShort));
|
||||
|
||||
debug.append(QString("\n dataIntPtr: %1").arg(QString::number(xAnimParts.dataIntPtr, 16)));
|
||||
debug.append(QString("\n dataInt: %1").arg(xAnimParts.dataInt));
|
||||
|
||||
debug.append(QString("\n randomDataShortPtr: %1").arg(QString::number(xAnimParts.randomDataShortPtr, 16)));
|
||||
debug.append(QString("\n randomDataShort: %1").arg(xAnimParts.randomDataShort));
|
||||
|
||||
debug.append(QString("\n randomDataBytePtr: %1").arg(QString::number(xAnimParts.randomDataBytePtr, 16)));
|
||||
debug.append(QString("\n randomDataByte: %1").arg(xAnimParts.randomDataByte));
|
||||
|
||||
debug.append(QString("\n randomDataIntPtr: %1").arg(QString::number(xAnimParts.randomDataIntPtr, 16)));
|
||||
debug.append(QString("\n randomDataInt: %1").arg(xAnimParts.randomDataInt));
|
||||
|
||||
debug.append(QString("\n indices: %1").arg(XAnimIndicesToString(xAnimParts.indices)));
|
||||
|
||||
debug.append(QString("\n notifyPtr: %1").arg(QString::number(xAnimParts.notifyPtr, 16)));
|
||||
debug.append(QString("\n notify: %1").arg(XAnimNotifyInfoToString(xAnimParts.notify)));
|
||||
|
||||
debug.append(QString("\n deltaPartPtr: %1").arg(QString::number(xAnimParts.deltaPartPtr, 16)));
|
||||
debug.append(QString("\n deltaPart: %1").arg(XAnimDeltaPartToString(xAnimParts.deltaPart)));
|
||||
|
||||
debug.append(QString("\n)"));
|
||||
|
||||
return debug;
|
||||
}
|
||||
|
||||
QDebug operator<<(QDebug debug, const XAnimParts &xanimParts) {
|
||||
QDebugStateSaver saver(debug);
|
||||
debug.noquote().nospace();
|
||||
|
||||
debug << XAnimPartsToString(xanimParts);
|
||||
|
||||
return debug;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -3,18 +3,22 @@
|
||||
|
||||
#include <QString>
|
||||
#include <QDataStream>
|
||||
#include <QDebug>
|
||||
|
||||
union XAnimDynamicFrames
|
||||
struct XAnimDynamicFrames
|
||||
{
|
||||
quint8 (*_1)[3];
|
||||
quint16 (*_2)[3];
|
||||
quint32 framesPtr;
|
||||
quint8 frames[3];
|
||||
};
|
||||
QDataStream &operator<<(QDataStream &aDataStream, const XAnimDynamicFrames &aAnimDynamicFramesIn);
|
||||
QDataStream &operator>>(QDataStream &aDataStream, XAnimDynamicFrames &aAnimDynamicFramesOut);
|
||||
|
||||
union XAnimDynamicIndices
|
||||
struct XAnimDynamicIndices
|
||||
{
|
||||
quint8 _1[1];
|
||||
quint16 _2[1];
|
||||
quint8 indices[1];
|
||||
};
|
||||
QDataStream &operator<<(QDataStream &aDataStream, const XAnimDynamicIndices &aAnimDynamicIndicesIn);
|
||||
QDataStream &operator>>(QDataStream &aDataStream, XAnimDynamicIndices &aAnimDynamicIndicesOut);
|
||||
|
||||
struct XAnimPartTransFrames
|
||||
{
|
||||
@ -23,61 +27,87 @@ struct XAnimPartTransFrames
|
||||
XAnimDynamicFrames frames;
|
||||
XAnimDynamicIndices indices;
|
||||
};
|
||||
QDataStream &operator<<(QDataStream &aDataStream, const XAnimPartTransFrames &aAnimPartTransFramesIn);
|
||||
QDataStream &operator>>(QDataStream &aDataStream, XAnimPartTransFrames &aAnimPartTransFramesOut);
|
||||
|
||||
union XAnimPartTransData
|
||||
{
|
||||
XAnimPartTransFrames frames;
|
||||
float frame0[3];
|
||||
};
|
||||
QDataStream &operator<<(QDataStream &aDataStream, const XAnimPartTransData &aAnimPartTransDataIn);
|
||||
QDataStream &operator>>(QDataStream &aDataStream, XAnimPartTransData &aAnimPartTransDataOut);
|
||||
|
||||
struct XAnimPartTrans
|
||||
{
|
||||
quint16 size;
|
||||
quint8 smallTrans;
|
||||
XAnimPartTransData u;
|
||||
XAnimPartTransData data;
|
||||
};
|
||||
QDataStream &operator<<(QDataStream &aDataStream, const XAnimPartTrans &aAnimPartTransIn);
|
||||
QDataStream &operator>>(QDataStream &aDataStream, XAnimPartTrans &aAnimPartTransOut);
|
||||
|
||||
struct XAnimDeltaPartQuatDataFrames
|
||||
{
|
||||
qint16 (*frames)[2];
|
||||
quint32 framesPtr;
|
||||
qint16 frames[2];
|
||||
|
||||
XAnimDynamicIndices indices;
|
||||
};
|
||||
QDataStream &operator<<(QDataStream &aDataStream, const XAnimDeltaPartQuatDataFrames &aAnimDeltaPartQuatDataFramesIn);
|
||||
QDataStream &operator>>(QDataStream &aDataStream, XAnimDeltaPartQuatDataFrames &aAnimDeltaPartQuatDataFramesOut);
|
||||
|
||||
union XAnimDeltaPartQuatData
|
||||
struct XAnimDeltaPartQuatData
|
||||
{
|
||||
XAnimDeltaPartQuatDataFrames frames;
|
||||
qint16 frame0[2];
|
||||
};
|
||||
QDataStream &operator<<(QDataStream &aDataStream, const XAnimDeltaPartQuatData &aAnimDeltaPartQuatDataIn);
|
||||
QDataStream &operator>>(QDataStream &aDataStream, XAnimDeltaPartQuatData &aAnimDeltaPartQuatDataOut);
|
||||
|
||||
struct XAnimDeltaPartQuat
|
||||
{
|
||||
quint16 size;
|
||||
XAnimDeltaPartQuatData u;
|
||||
XAnimDeltaPartQuatData data;
|
||||
};
|
||||
QDataStream &operator<<(QDataStream &aDataStream, const XAnimDeltaPartQuat &aAnimDeltaPartQuatIn);
|
||||
QDataStream &operator>>(QDataStream &aDataStream, XAnimDeltaPartQuat &aAnimDeltaPartQuatOut);
|
||||
|
||||
struct XAnimDeltaPart
|
||||
{
|
||||
XAnimPartTrans *trans;
|
||||
XAnimDeltaPartQuat *quat;
|
||||
quint32 transPtr;
|
||||
XAnimPartTrans trans;
|
||||
|
||||
quint32 quatPtr;
|
||||
XAnimDeltaPartQuat quat;
|
||||
};
|
||||
QDataStream &operator<<(QDataStream &aDataStream, const XAnimDeltaPart &aAnimDeltaPartIn);
|
||||
QDataStream &operator>>(QDataStream &aDataStream, XAnimDeltaPart &aAnimDeltaPartOut);
|
||||
|
||||
struct XAnimNotifyInfo
|
||||
{
|
||||
quint16 name;
|
||||
float time;
|
||||
};
|
||||
QDataStream &operator<<(QDataStream &aDataStream, const XAnimNotifyInfo &aAnimNotifyInfoIn);
|
||||
QDataStream &operator>>(QDataStream &aDataStream, XAnimNotifyInfo &aAnimNotifyInfoOut);
|
||||
QDebug operator<<(QDebug debug, const XAnimNotifyInfo &aAnimNotifyInfo);
|
||||
QString XAnimNotifyInfoToString(const XAnimNotifyInfo &aAnimNotifyInfo);
|
||||
|
||||
struct XAnimIndices
|
||||
{
|
||||
quint8 *_1;
|
||||
quint16 *_2;
|
||||
void *data;
|
||||
quint32 indexPtr;
|
||||
quint16 index;
|
||||
};
|
||||
QDataStream &operator<<(QDataStream &aDataStream, const XAnimIndices &aAnimIndicesIn);
|
||||
QDataStream &operator>>(QDataStream &aDataStream, XAnimIndices &aAnimIndicesOut);
|
||||
QDebug operator<<(QDebug debug, const XAnimIndices &aAnimIndices);
|
||||
QString XAnimIndicesToString(const XAnimIndices &aAnimIndices);
|
||||
|
||||
struct XAnimParts
|
||||
{
|
||||
qint32 namePtr;
|
||||
QString name;
|
||||
quint32 namePtr;
|
||||
|
||||
quint16 dataByteCount;
|
||||
quint16 dataShortCount;
|
||||
@ -95,19 +125,32 @@ struct XAnimParts
|
||||
|
||||
bool pad;
|
||||
|
||||
unsigned int randomDataShortCount;
|
||||
unsigned int indexCount;
|
||||
quint16 randomDataShortCount;
|
||||
quint16 indexCount;
|
||||
|
||||
float framerate;
|
||||
float frequency;
|
||||
|
||||
quint16 *names;
|
||||
quint8 *dataByte;
|
||||
qint16 *dataShort;
|
||||
int *dataInt;
|
||||
qint16 *randomDataShort;
|
||||
quint8 *randomDataByte;
|
||||
int *randomDataInt;
|
||||
quint32 namesPtr;
|
||||
quint16 names;
|
||||
|
||||
quint32 dataBytePtr;
|
||||
quint8 dataByte;
|
||||
|
||||
quint32 dataShortPtr;
|
||||
qint16 dataShort;
|
||||
|
||||
quint32 dataIntPtr;
|
||||
int dataInt;
|
||||
|
||||
quint32 randomDataShortPtr;
|
||||
qint16 randomDataShort;
|
||||
|
||||
quint32 randomDataBytePtr;
|
||||
quint8 randomDataByte;
|
||||
|
||||
quint32 randomDataIntPtr;
|
||||
int randomDataInt;
|
||||
|
||||
XAnimIndices indices;
|
||||
|
||||
@ -117,74 +160,14 @@ struct XAnimParts
|
||||
qint32 deltaPartPtr;
|
||||
XAnimDeltaPart deltaPart;
|
||||
};
|
||||
|
||||
QDataStream& operator<<(QDataStream& out, const XAnimParts& in) {
|
||||
out.writeRawData(reinterpret_cast<const char*>(&in.namePtr), 4);
|
||||
out.writeRawData(reinterpret_cast<const char*>(&in.dataByteCount), 2);
|
||||
out.writeRawData(reinterpret_cast<const char*>(&in.dataShortCount), 2);
|
||||
out.writeRawData(reinterpret_cast<const char*>(&in.dataIntCount), 2);
|
||||
out.writeRawData(reinterpret_cast<const char*>(&in.randomDataByteCount), 2);
|
||||
out.writeRawData(reinterpret_cast<const char*>(&in.randomDataIntCount), 2);
|
||||
out.writeRawData(reinterpret_cast<const char*>(&in.numframes), 2);
|
||||
out.writeRawData(reinterpret_cast<const char*>(&in.bLoop), 1);
|
||||
out.writeRawData(reinterpret_cast<const char*>(&in.bDelta), 1);
|
||||
|
||||
for (int i = 0; i < 12; i++) {
|
||||
out.writeRawData(reinterpret_cast<const char*>(&in.boneCount[i]), 1);
|
||||
}
|
||||
|
||||
out.writeRawData(reinterpret_cast<const char*>(&in.notifyCount), 1);
|
||||
out.writeRawData(reinterpret_cast<const char*>(&in.assetType), 1);
|
||||
out.writeRawData(reinterpret_cast<const char*>(&in.pad), 1);
|
||||
out.writeRawData(reinterpret_cast<const char*>(&in.randomDataShortCount), 2);
|
||||
out.writeRawData(reinterpret_cast<const char*>(&in.indexCount), 2);
|
||||
out.writeRawData(reinterpret_cast<const char*>(&in.framerate), 4);
|
||||
out.writeRawData(reinterpret_cast<const char*>(&in.frequency), 4);
|
||||
|
||||
return out;
|
||||
}
|
||||
|
||||
QDataStream& operator>>(QDataStream& in, XAnimParts& out) {
|
||||
in.readRawData(reinterpret_cast<char*>(&out.namePtr), 4);
|
||||
in.readRawData(reinterpret_cast<char*>(&out.dataByteCount), 2);
|
||||
in.readRawData(reinterpret_cast<char*>(&out.dataShortCount), 2);
|
||||
in.readRawData(reinterpret_cast<char*>(&out.dataIntCount), 2);
|
||||
in.readRawData(reinterpret_cast<char*>(&out.randomDataByteCount), 2);
|
||||
in.readRawData(reinterpret_cast<char*>(&out.randomDataIntCount), 2);
|
||||
in.readRawData(reinterpret_cast<char*>(&out.numframes), 2);
|
||||
in.readRawData(reinterpret_cast<char*>(&out.bLoop), 1);
|
||||
in.readRawData(reinterpret_cast<char*>(&out.bDelta), 1);
|
||||
|
||||
for (int i = 0; i < 12; i++) {
|
||||
in.readRawData(reinterpret_cast<char*>(&out.boneCount[i]), 1);
|
||||
}
|
||||
|
||||
in.readRawData(reinterpret_cast<char*>(&out.notifyCount), 1);
|
||||
in.readRawData(reinterpret_cast<char*>(&out.assetType), 1);
|
||||
in.readRawData(reinterpret_cast<char*>(&out.pad), 1);
|
||||
in.readRawData(reinterpret_cast<char*>(&out.randomDataShortCount), 2);
|
||||
in.readRawData(reinterpret_cast<char*>(&out.indexCount), 2);
|
||||
in.readRawData(reinterpret_cast<char*>(&out.framerate), 4);
|
||||
in.readRawData(reinterpret_cast<char*>(&out.frequency), 4);
|
||||
|
||||
return in;
|
||||
}
|
||||
QDataStream &operator<<(QDataStream &aDataStream, const XAnimParts &aAnimPartIn);
|
||||
QDataStream &operator>>(QDataStream &aDataStream, XAnimParts &aAnimPartOut);
|
||||
QDebug operator<<(QDebug debug, const XAnimParts &xanimParts);
|
||||
QString XAnimPartsToString(const XAnimParts &xAnimParts);
|
||||
|
||||
struct Animation {
|
||||
QString name;
|
||||
std::shared_ptr<XAnimParts> parts;
|
||||
XAnimParts animParts;
|
||||
};
|
||||
|
||||
QDataStream& operator<<(QDataStream& out, const Animation& in) {
|
||||
out << *in.parts;
|
||||
|
||||
return out;
|
||||
}
|
||||
|
||||
QDataStream& operator>>(QDataStream& in, Animation& out) {
|
||||
in >> *out.parts;
|
||||
|
||||
return in;
|
||||
}
|
||||
|
||||
#endif // ANIMPARTS_H
|
||||
|
||||
1
libs/assets/asset.cpp
Normal file
1
libs/assets/asset.cpp
Normal file
@ -0,0 +1 @@
|
||||
#include "asset.h"
|
||||
1
libs/assets/assetlist.cpp
Normal file
1
libs/assets/assetlist.cpp
Normal file
@ -0,0 +1 @@
|
||||
#include "assetlist.h"
|
||||
@ -2,13 +2,7 @@
|
||||
#define ASSETLIST_H
|
||||
|
||||
#include "asset.h"
|
||||
|
||||
struct ScriptStringList
|
||||
{
|
||||
int count;
|
||||
QVector<qint32> stringPtrs;
|
||||
QStringList scriptStrings;
|
||||
};
|
||||
#include "scriptstringlist.h"
|
||||
|
||||
struct XAssetList
|
||||
{
|
||||
|
||||
60
libs/assets/assetmap.h
Normal file
60
libs/assets/assetmap.h
Normal file
@ -0,0 +1,60 @@
|
||||
#ifndef ASSETMAP_H
|
||||
#define ASSETMAP_H
|
||||
|
||||
#include "animparts.h"
|
||||
#include "model.h"
|
||||
#include "material.h"
|
||||
#include "materialpixelshader.h"
|
||||
#include "materialtechset.h"
|
||||
#include "gfximage.h"
|
||||
#include "soundalias.h"
|
||||
#include "soundcurve.h"
|
||||
#include "loadedsound.h"
|
||||
#include "clipmap.h"
|
||||
#include "comworld.h"
|
||||
#include "gameworld.h"
|
||||
#include "mapent.h"
|
||||
#include "gfxworld.h"
|
||||
#include "gfxlightdef.h"
|
||||
#include "gfximage.h"
|
||||
#include "font.h"
|
||||
#include "menulist.h"
|
||||
#include "menudef.h"
|
||||
#include "localizeentry.h"
|
||||
#include "weapondef.h"
|
||||
#include "sounddriver.h"
|
||||
#include "effectdef.h"
|
||||
#include "effecttable.h"
|
||||
#include "rawfile.h"
|
||||
#include "stringtable.h"
|
||||
|
||||
struct AssetMap {
|
||||
QVector<Animation> animations;
|
||||
QVector<Model> models;
|
||||
QVector<Material> materials;
|
||||
QVector<MaterialPixelShader> pixelShaders;
|
||||
QVector<MaterialTechSet> techSets;
|
||||
QVector<GfxWorld> gfxWorlds;
|
||||
QVector<GfxLightDef> gfxLightDefs;
|
||||
QVector<GfxImage> images;
|
||||
QVector<SoundAliasList> sounds;
|
||||
QVector<SoundCurve> soundCurves;
|
||||
QVector<LoadedSound> loadedSounds;
|
||||
QVector<ClipMap> clipMaps;
|
||||
QVector<ComWorld> comWorlds;
|
||||
QVector<GameWorldSp> gameWorldSPs;
|
||||
QVector<GameWorldMp> gameWorldMPs;
|
||||
QVector<MapEnts> mapEntities;
|
||||
QVector<GameFont> fonts;
|
||||
QVector<MenuList> menuLists;
|
||||
QVector<MenuDef> menuDefinitions;
|
||||
QVector<LocalizeEntry> localizeEntries;
|
||||
QVector<WeaponDef> weaponDefinitions;
|
||||
QVector<SoundDriver> soundDrivers;
|
||||
QVector<EffectDef> effectDefinitions;
|
||||
QVector<ImpactTable> impactTables;
|
||||
QVector<RawFile> rawFiles;
|
||||
QVector<StringTable> stringTables;
|
||||
};
|
||||
|
||||
#endif // ASSETMAP_H
|
||||
File diff suppressed because it is too large
Load Diff
3381
libs/assets/assets.h
3381
libs/assets/assets.h
File diff suppressed because it is too large
Load Diff
@ -5,6 +5,36 @@ CONFIG += staticlib c++17
|
||||
SOURCES += \
|
||||
# Base class
|
||||
assets.cpp \
|
||||
animparts.cpp \
|
||||
asset.cpp \
|
||||
assetlist.cpp \
|
||||
clipmap.cpp \
|
||||
comworld.cpp \
|
||||
d3dresource.cpp \
|
||||
effectdef.cpp \
|
||||
effecttable.cpp \
|
||||
file.cpp \
|
||||
font.cpp \
|
||||
gameworld.cpp \
|
||||
gfximage.cpp \
|
||||
gfxlightdef.cpp \
|
||||
gfxworld.cpp \
|
||||
loadedsound.cpp \
|
||||
localizeentry.cpp \
|
||||
mapent.cpp \
|
||||
material.cpp \
|
||||
materialpixelshader.cpp \
|
||||
materialtechset.cpp \
|
||||
menudef.cpp \
|
||||
menulist.cpp \
|
||||
model.cpp \
|
||||
rawfile.cpp \
|
||||
scriptstringlist.cpp \
|
||||
soundalias.cpp \
|
||||
soundcurve.cpp \
|
||||
sounddriver.cpp \
|
||||
stringtable.cpp \
|
||||
weapondef.cpp \
|
||||
# 360 classes
|
||||
360/assets_cod2_360.cpp \
|
||||
360/assets_cod4_360.cpp \
|
||||
@ -49,6 +79,7 @@ HEADERS += \
|
||||
animparts.h \
|
||||
asset.h \
|
||||
assetlist.h \
|
||||
assetmap.h \
|
||||
assets.h \
|
||||
# 360 classes
|
||||
360/assets_cod2_360.h \
|
||||
@ -109,6 +140,7 @@ HEADERS += \
|
||||
menulist.h \
|
||||
model.h \
|
||||
rawfile.h \
|
||||
scriptstringlist.h \
|
||||
soundalias.h \
|
||||
soundcurve.h \
|
||||
sounddriver.h \
|
||||
@ -119,11 +151,9 @@ LIBS += \
|
||||
-L$$OUT_PWD/../libs/core -lcore
|
||||
|
||||
INCLUDEPATH += \
|
||||
$$PWD/../core \
|
||||
$$PWD/../../third_party/dx9_sdk/include
|
||||
$$PWD/../core
|
||||
|
||||
DEPENDPATH += \
|
||||
$$PWD/../core \
|
||||
$$PWD/../../third_party/dx9_sdk/include
|
||||
$$PWD/../core
|
||||
|
||||
DESTDIR = $$OUT_PWD/../
|
||||
|
||||
1
libs/assets/clipmap.cpp
Normal file
1
libs/assets/clipmap.cpp
Normal file
@ -0,0 +1 @@
|
||||
#include "clipmap.h"
|
||||
@ -29,11 +29,11 @@ struct dmaterial_t
|
||||
|
||||
struct cNode_t
|
||||
{
|
||||
cplane_s *plane;
|
||||
CPlane *plane;
|
||||
__int16 children[2];
|
||||
};
|
||||
|
||||
struct cLeaf_t
|
||||
struct CLeaf
|
||||
{
|
||||
unsigned __int16 firstCollAabbIndex;
|
||||
unsigned __int16 collAabbCount;
|
||||
@ -45,30 +45,30 @@ struct cLeaf_t
|
||||
__int16 cluster;
|
||||
};
|
||||
|
||||
struct cLeafBrushNodeLeaf_t
|
||||
struct CLeafBrushNodeLeaf
|
||||
{
|
||||
unsigned __int16 *brushes;
|
||||
};
|
||||
|
||||
struct cLeafBrushNodeChildren_t
|
||||
struct CLeafBrushNodeChildren
|
||||
{
|
||||
float dist;
|
||||
float range;
|
||||
unsigned __int16 childOffset[2];
|
||||
};
|
||||
|
||||
union cLeafBrushNodeData_t
|
||||
union CLeafBrushNodeData
|
||||
{
|
||||
cLeafBrushNodeLeaf_t leaf;
|
||||
cLeafBrushNodeChildren_t children;
|
||||
CLeafBrushNodeLeaf leaf;
|
||||
CLeafBrushNodeChildren children;
|
||||
};
|
||||
|
||||
struct cLeafBrushNode_s
|
||||
struct CLeafBrushNode
|
||||
{
|
||||
unsigned __int8 axis;
|
||||
__int16 leafBrushCount;
|
||||
int contents;
|
||||
cLeafBrushNodeData_t data;
|
||||
CLeafBrushNodeData data;
|
||||
};
|
||||
|
||||
struct CollisionBorder
|
||||
@ -103,21 +103,21 @@ struct CollisionAabbTree
|
||||
CollisionAabbTreeIndex u;
|
||||
};
|
||||
|
||||
struct cmodel_t
|
||||
struct CModel
|
||||
{
|
||||
float mins[3];
|
||||
float maxs[3];
|
||||
float radius;
|
||||
cLeaf_t leaf;
|
||||
CLeaf leaf;
|
||||
};
|
||||
|
||||
struct __declspec(align(16)) cbrush_t
|
||||
struct __declspec(align(16)) CBrush
|
||||
{
|
||||
float mins[3];
|
||||
int contents;
|
||||
float maxs[3];
|
||||
unsigned int numsides;
|
||||
cbrushside_t *sides;
|
||||
CBrushSide *sides;
|
||||
__int16 axialMaterialNum[2][3];
|
||||
unsigned __int8 *baseAdjacentSide;
|
||||
__int16 firstAdjacentSideOffsets[2][3];
|
||||
@ -181,21 +181,21 @@ struct ClipMap
|
||||
const char *name;
|
||||
int isInUse;
|
||||
int planeCount;
|
||||
cplane_s *planes;
|
||||
CPlane *planes;
|
||||
unsigned int numStaticModels;
|
||||
cStaticModel_s *staticModelList;
|
||||
unsigned int numMaterials;
|
||||
dmaterial_t *materials;
|
||||
unsigned int numBrushSides;
|
||||
cbrushside_t *brushsides;
|
||||
CBrushSide *brushsides;
|
||||
unsigned int numBrushEdges;
|
||||
unsigned __int8 *brushEdges;
|
||||
unsigned int numNodes;
|
||||
cNode_t *nodes;
|
||||
unsigned int numLeafs;
|
||||
cLeaf_t *leafs;
|
||||
CLeaf *leafs;
|
||||
unsigned int leafbrushNodesCount;
|
||||
cLeafBrushNode_s *leafbrushNodes;
|
||||
CLeafBrushNode *leafbrushNodes;
|
||||
unsigned int numLeafBrushes;
|
||||
unsigned __int16 *leafbrushes;
|
||||
unsigned int numLeafSurfaces;
|
||||
@ -212,16 +212,16 @@ struct ClipMap
|
||||
int aabbTreeCount;
|
||||
CollisionAabbTree *aabbTrees;
|
||||
unsigned int numSubModels;
|
||||
cmodel_t *cmodels;
|
||||
CModel *cmodels;
|
||||
unsigned __int16 numBrushes;
|
||||
cbrush_t *brushes;
|
||||
CBrush *brushes;
|
||||
int numClusters;
|
||||
int clusterBytes;
|
||||
unsigned __int8 *visibility;
|
||||
int vised;
|
||||
MapEnts *mapEnts;
|
||||
cbrush_t *box_brush;
|
||||
cmodel_t box_model;
|
||||
CBrush *box_brush;
|
||||
CModel box_model;
|
||||
unsigned __int16 dynEntCount[2];
|
||||
DynEntityDef *dynEntDefList[2];
|
||||
DynEntityPose *dynEntPoseList[2];
|
||||
|
||||
1
libs/assets/comworld.cpp
Normal file
1
libs/assets/comworld.cpp
Normal file
@ -0,0 +1 @@
|
||||
#include "comworld.h"
|
||||
1
libs/assets/d3dresource.cpp
Normal file
1
libs/assets/d3dresource.cpp
Normal file
@ -0,0 +1 @@
|
||||
#include "d3dresource.h"
|
||||
1
libs/assets/effectdef.cpp
Normal file
1
libs/assets/effectdef.cpp
Normal file
@ -0,0 +1 @@
|
||||
#include "effectdef.h"
|
||||
@ -79,29 +79,45 @@ struct FxElemVisStateSample
|
||||
|
||||
struct FxElemMarkVisuals
|
||||
{
|
||||
Material *materials[2];
|
||||
qint32 materialPtrs[2];
|
||||
QVector<Material> materials;
|
||||
};
|
||||
|
||||
struct EffectDef;
|
||||
union EffectDefRef
|
||||
{
|
||||
qint32 handlePtr;
|
||||
const EffectDef *handle;
|
||||
|
||||
qint32 namePtr;
|
||||
const char *name;
|
||||
};
|
||||
|
||||
union FxElemVisuals
|
||||
{
|
||||
qint32 anonymousPtr;
|
||||
const void *anonymous;
|
||||
|
||||
qint32 materialPtr;
|
||||
Material *material;
|
||||
|
||||
qint32 modelPtr;
|
||||
Model *model;
|
||||
|
||||
EffectDefRef effectDef;
|
||||
|
||||
qint32 soundNamePtr;
|
||||
const char *soundName;
|
||||
};
|
||||
|
||||
union FxElemDefVisuals
|
||||
struct FxElemDefVisuals
|
||||
{
|
||||
FxElemMarkVisuals *markArray;
|
||||
FxElemVisuals *array;
|
||||
qint32 markArrayPtr;
|
||||
QVector<FxElemMarkVisuals> markArray;
|
||||
|
||||
qint32 arrayPtr;
|
||||
QVector<FxElemVisuals> array;
|
||||
|
||||
FxElemVisuals instance;
|
||||
};
|
||||
|
||||
@ -146,8 +162,10 @@ struct FxElemDef
|
||||
unsigned __int8 visualCount;
|
||||
unsigned __int8 velIntervalCount;
|
||||
unsigned __int8 visStateIntervalCount;
|
||||
const FxElemVelStateSample *velSamples;
|
||||
const FxElemVisStateSample *visSamples;
|
||||
qint32 velSamplesPtr;
|
||||
QVector<FxElemVelStateSample> velSamples;
|
||||
qint32 visSamplesPtr;
|
||||
QVector<FxElemVisStateSample> visSamples;
|
||||
FxElemDefVisuals visuals;
|
||||
float collMins[3];
|
||||
float collMaxs[3];
|
||||
@ -156,7 +174,10 @@ struct FxElemDef
|
||||
EffectDefRef effectEmitted;
|
||||
FxFloatRange emitDist;
|
||||
FxFloatRange emitDistVariance;
|
||||
|
||||
qint32 trailDefPtr;
|
||||
FxTrailDef *trailDef;
|
||||
|
||||
unsigned __int8 sortOrder;
|
||||
unsigned __int8 lightingFrac;
|
||||
unsigned __int8 useItemClip;
|
||||
@ -165,14 +186,18 @@ struct FxElemDef
|
||||
|
||||
struct EffectDef
|
||||
{
|
||||
const char *name;
|
||||
qint32 namePtr;
|
||||
QString name;
|
||||
|
||||
int flags;
|
||||
int totalSize;
|
||||
int msecLoopingLife;
|
||||
int elemDefCountLooping;
|
||||
int elemDefCountOneShot;
|
||||
int elemDefCountEmission;
|
||||
const FxElemDef *elemDefs;
|
||||
|
||||
qint32 elemDefsPtr;
|
||||
QVector<FxElemDef> elemDefs;
|
||||
};
|
||||
|
||||
#endif // EFFECTDEF_H
|
||||
|
||||
1
libs/assets/effecttable.cpp
Normal file
1
libs/assets/effecttable.cpp
Normal file
@ -0,0 +1 @@
|
||||
#include "effecttable.h"
|
||||
@ -5,14 +5,20 @@
|
||||
|
||||
struct FxImpactEntry
|
||||
{
|
||||
const EffectDef *nonflesh[29];
|
||||
const EffectDef *flesh[4];
|
||||
QVector<qint32> nonFleshPtrs;
|
||||
QVector<EffectDef> nonFlesh;
|
||||
|
||||
QVector<qint32> fleshPtrs;
|
||||
QVector<EffectDef> flesh;
|
||||
};
|
||||
|
||||
struct ImpactTable
|
||||
{
|
||||
const char *name;
|
||||
FxImpactEntry *table;
|
||||
qint32 namePtr;
|
||||
QString name;
|
||||
|
||||
qint32 tablePtr;
|
||||
QVector<FxImpactEntry> table;
|
||||
};
|
||||
|
||||
#endif // EFFECTTABLE_H
|
||||
|
||||
1
libs/assets/file.cpp
Normal file
1
libs/assets/file.cpp
Normal file
@ -0,0 +1 @@
|
||||
#include "file.h"
|
||||
1
libs/assets/font.cpp
Normal file
1
libs/assets/font.cpp
Normal file
@ -0,0 +1 @@
|
||||
#include "font.h"
|
||||
1
libs/assets/gameworld.cpp
Normal file
1
libs/assets/gameworld.cpp
Normal file
@ -0,0 +1 @@
|
||||
#include "gameworld.h"
|
||||
@ -27,7 +27,7 @@ enum nodeType : __int32
|
||||
NODE_DONTLINK = 0x14,
|
||||
};
|
||||
|
||||
struct pathlink_s
|
||||
struct PathLink
|
||||
{
|
||||
float fDist;
|
||||
unsigned __int16 nodeNum;
|
||||
@ -36,7 +36,7 @@ struct pathlink_s
|
||||
unsigned __int8 ubBadPlaceCount[4];
|
||||
};
|
||||
|
||||
struct pathnode_constant_t
|
||||
struct PathNodeConstant
|
||||
{
|
||||
nodeType type;
|
||||
unsigned __int16 spawnflags;
|
||||
@ -56,7 +56,7 @@ struct pathnode_constant_t
|
||||
__int16 wChainDepth;
|
||||
__int16 wChainParent;
|
||||
unsigned __int16 totalLinkCount;
|
||||
pathlink_s *Links;
|
||||
PathLink *Links;
|
||||
};
|
||||
|
||||
struct pathnode_dynamic_t
|
||||
@ -85,49 +85,49 @@ struct pathnode_transient_t
|
||||
|
||||
struct pathnode_t
|
||||
{
|
||||
pathnode_constant_t constant;
|
||||
PathNodeConstant constant;
|
||||
pathnode_dynamic_t dynamic;
|
||||
pathnode_transient_t transient;
|
||||
};
|
||||
|
||||
struct pathbasenode_t
|
||||
struct PathBaseNode
|
||||
{
|
||||
float vOrigin[3];
|
||||
unsigned int type;
|
||||
};
|
||||
|
||||
struct pathnode_tree_nodes_t
|
||||
struct PathNodeTreeNodes
|
||||
{
|
||||
int nodeCount;
|
||||
unsigned __int16 *nodes;
|
||||
};
|
||||
|
||||
struct pathnode_tree_t;
|
||||
union pathnode_tree_info_t
|
||||
struct PathNodeTree;
|
||||
union PathNodeTreeInfo
|
||||
{
|
||||
pathnode_tree_t *child[2];
|
||||
pathnode_tree_nodes_t s;
|
||||
PathNodeTree *child[2];
|
||||
PathNodeTreeNodes s;
|
||||
};
|
||||
|
||||
struct pathnode_tree_t
|
||||
struct PathNodeTree
|
||||
{
|
||||
int axis;
|
||||
float dist;
|
||||
pathnode_tree_info_t u;
|
||||
PathNodeTreeInfo u;
|
||||
};
|
||||
|
||||
struct PathData
|
||||
{
|
||||
unsigned int nodeCount;
|
||||
pathnode_t *nodes;
|
||||
pathbasenode_t *basenodes;
|
||||
PathBaseNode *basenodes;
|
||||
unsigned int chainNodeCount;
|
||||
unsigned __int16 *chainNodeForNode;
|
||||
unsigned __int16 *nodeForChainNode;
|
||||
int visBytes;
|
||||
unsigned __int8 *pathVis;
|
||||
int nodeTreeCount;
|
||||
pathnode_tree_t *nodeTree;
|
||||
PathNodeTree *nodeTree;
|
||||
};
|
||||
|
||||
struct GameWorldSp
|
||||
|
||||
1
libs/assets/gfximage.cpp
Normal file
1
libs/assets/gfximage.cpp
Normal file
@ -0,0 +1 @@
|
||||
#include "gfximage.h"
|
||||
@ -4,20 +4,29 @@
|
||||
#include "material.h"
|
||||
|
||||
struct GfxImageLoadDef;
|
||||
union GfxTexture
|
||||
struct GfxTexture
|
||||
{
|
||||
D3DBaseTexture *basemap;
|
||||
qint32 baseMapPtr;
|
||||
D3DBaseTexture *baseMap;
|
||||
|
||||
qint32 mapPtr;
|
||||
D3DTexture *map;
|
||||
D3DVolumeTexture *volmap;
|
||||
D3DCubeTexture *cubemap;
|
||||
|
||||
qint32 volMapPtr;
|
||||
D3DVolumeTexture *volMap;
|
||||
|
||||
qint32 cubeMapPtr;
|
||||
D3DCubeTexture *cubeMap;
|
||||
|
||||
qint32 loadDefPtr;
|
||||
GfxImageLoadDef *loadDef;
|
||||
};
|
||||
|
||||
struct GfxImageLoadDef
|
||||
{
|
||||
unsigned __int8 levelCount;
|
||||
unsigned __int8 flags;
|
||||
__int16 dimensions[3];
|
||||
quint8 levelCount;
|
||||
quint8 flags;
|
||||
quint16 dimensions[3];
|
||||
int format;
|
||||
GfxTexture texture;
|
||||
};
|
||||
@ -31,18 +40,23 @@ struct GfxImage
|
||||
{
|
||||
MapType mapType;
|
||||
GfxTexture texture;
|
||||
unsigned __int8 semantic;
|
||||
quint8 semantic;
|
||||
CardMemory cardMemory;
|
||||
unsigned __int16 width;
|
||||
unsigned __int16 height;
|
||||
unsigned __int16 depth;
|
||||
unsigned __int8 category;
|
||||
quint16 width;
|
||||
quint16 height;
|
||||
quint16 depth;
|
||||
quint8 category;
|
||||
bool delayLoadPixels;
|
||||
unsigned __int8 *pixels;
|
||||
|
||||
qint32 pixelsPtr;
|
||||
quint8 *pixels;
|
||||
|
||||
unsigned int baseSize;
|
||||
unsigned __int16 streamSlot;
|
||||
quint16 streamSlot;
|
||||
bool streaming;
|
||||
const char *name;
|
||||
|
||||
qint32 namePtr;
|
||||
QString name;
|
||||
};
|
||||
|
||||
#endif // GFXIMAGE_H
|
||||
|
||||
1
libs/assets/gfxlightdef.cpp
Normal file
1
libs/assets/gfxlightdef.cpp
Normal file
@ -0,0 +1 @@
|
||||
#include "gfxlightdef.h"
|
||||
1
libs/assets/gfxworld.cpp
Normal file
1
libs/assets/gfxworld.cpp
Normal file
@ -0,0 +1 @@
|
||||
#include "gfxworld.h"
|
||||
@ -84,7 +84,7 @@ struct GfxReflectionProbe
|
||||
struct GfxWorldDpvsPlanes
|
||||
{
|
||||
int cellCount;
|
||||
cplane_s *planes;
|
||||
CPlane *planes;
|
||||
unsigned __int16 *nodes;
|
||||
unsigned int *sceneEntCellBits;
|
||||
};
|
||||
@ -352,7 +352,7 @@ struct GfxWorldDpvsStatic
|
||||
GfxSurface *surfaces;
|
||||
GfxCullGroup *cullGroups;
|
||||
GfxStaticModelDrawInst *smodelDrawInsts;
|
||||
GfxDrawSurf *surfaceMaterials;
|
||||
GfxDrawSurfFields *surfaceMaterials;
|
||||
unsigned int *surfaceCastsSunShadow;
|
||||
volatile int usageCount;
|
||||
};
|
||||
|
||||
1
libs/assets/loadedsound.cpp
Normal file
1
libs/assets/loadedsound.cpp
Normal file
@ -0,0 +1 @@
|
||||
#include "loadedsound.h"
|
||||
1
libs/assets/localizeentry.cpp
Normal file
1
libs/assets/localizeentry.cpp
Normal file
@ -0,0 +1 @@
|
||||
#include "localizeentry.h"
|
||||
1
libs/assets/mapent.cpp
Normal file
1
libs/assets/mapent.cpp
Normal file
@ -0,0 +1 @@
|
||||
#include "mapent.h"
|
||||
1
libs/assets/material.cpp
Normal file
1
libs/assets/material.cpp
Normal file
@ -0,0 +1 @@
|
||||
#include "material.h"
|
||||
@ -5,35 +5,31 @@
|
||||
|
||||
struct GfxDrawSurfFields
|
||||
{
|
||||
unsigned __int64 objectId : 16;
|
||||
unsigned __int64 reflectionProbeIndex : 8;
|
||||
unsigned __int64 customIndex : 5;
|
||||
unsigned __int64 materialSortedIndex : 11;
|
||||
unsigned __int64 prepass : 2;
|
||||
unsigned __int64 primaryLightIndex : 8;
|
||||
unsigned __int64 surfType : 4;
|
||||
unsigned __int64 primarySortKey : 6;
|
||||
unsigned __int64 unused : 4;
|
||||
quint64 objectId : 16;
|
||||
quint64 reflectionProbeIndex : 8;
|
||||
quint64 customIndex : 5;
|
||||
quint64 materialSortedIndex : 11;
|
||||
quint64 prepass : 2;
|
||||
quint64 primaryLightIndex : 8;
|
||||
quint64 surfType : 4;
|
||||
quint64 primarySortKey : 6;
|
||||
quint64 unused : 4;
|
||||
};
|
||||
|
||||
union GfxDrawSurf
|
||||
struct MaterialInfo
|
||||
{
|
||||
GfxDrawSurfFields fields;
|
||||
unsigned __int64 packed;
|
||||
};
|
||||
qint32 namePtr;
|
||||
QString name;
|
||||
|
||||
struct __declspec(align(8)) MaterialInfo
|
||||
{
|
||||
const char *name;
|
||||
unsigned __int8 gameFlags;
|
||||
unsigned __int8 sortKey;
|
||||
unsigned __int8 textureAtlasRowCount;
|
||||
unsigned __int8 textureAtlasColumnCount;
|
||||
GfxDrawSurf drawSurf;
|
||||
quint8 gameFlags;
|
||||
quint8 sortKey;
|
||||
quint8 textureAtlasRowCount;
|
||||
quint8 textureAtlasColumnCount;
|
||||
GfxDrawSurfFields drawSurf;
|
||||
unsigned int surfaceTypeBits;
|
||||
};
|
||||
|
||||
enum MapType : __int32
|
||||
enum MapType : qint32
|
||||
{
|
||||
MAPTYPE_NONE = 0x0,
|
||||
MAPTYPE_INVALID1 = 0x1,
|
||||
@ -46,48 +42,49 @@ enum MapType : __int32
|
||||
|
||||
struct GPUTEXTURESIZE_1D
|
||||
{
|
||||
unsigned __int32 Width : 24;
|
||||
quint32 Width : 24;
|
||||
};
|
||||
|
||||
struct GPUTEXTURESIZE_2D
|
||||
{
|
||||
unsigned __int32 Width : 13;
|
||||
unsigned __int32 Height : 13;
|
||||
quint32 Width : 13;
|
||||
quint32 Height : 13;
|
||||
};
|
||||
|
||||
struct GPUTEXTURESIZE_3D
|
||||
{
|
||||
unsigned __int32 Width : 11;
|
||||
unsigned __int32 Height : 11;
|
||||
unsigned __int32 Depth : 10;
|
||||
quint32 Width : 11;
|
||||
quint32 Height : 11;
|
||||
quint32 Depth : 10;
|
||||
};
|
||||
|
||||
struct GPUTEXTURESIZE_STACK
|
||||
{
|
||||
unsigned __int32 Width : 13;
|
||||
unsigned __int32 Height : 13;
|
||||
unsigned __int32 Depth : 6;
|
||||
quint32 Width : 13;
|
||||
quint32 Height : 13;
|
||||
quint32 Depth : 6;
|
||||
};
|
||||
|
||||
struct $FD14676823C8BF1A2A32FD1720A565E9
|
||||
struct GPUTEXTURE_FETCH_CONSTANT
|
||||
{
|
||||
unsigned __int32 Type : 2;
|
||||
unsigned __int32 SignX : 2;
|
||||
unsigned __int32 SignY : 2;
|
||||
unsigned __int32 SignZ : 2;
|
||||
unsigned __int32 SignW : 2;
|
||||
unsigned __int32 ClampX : 3;
|
||||
unsigned __int32 ClampY : 3;
|
||||
unsigned __int32 ClampZ : 3;
|
||||
unsigned __int32 : 3;
|
||||
unsigned __int32 Pitch : 9;
|
||||
unsigned __int32 Tiled : 1;
|
||||
unsigned __int32 DataFormat : 6;
|
||||
unsigned __int32 Endian : 2;
|
||||
unsigned __int32 RequestSize : 2;
|
||||
unsigned __int32 Stacked : 1;
|
||||
unsigned __int32 ClampPolicy : 1;
|
||||
unsigned __int32 BaseAddress : 20;
|
||||
quint32 Type : 2;
|
||||
quint32 SignX : 2;
|
||||
quint32 SignY : 2;
|
||||
quint32 SignZ : 2;
|
||||
quint32 SignW : 2;
|
||||
quint32 ClampX : 3;
|
||||
quint32 ClampY : 3;
|
||||
quint32 ClampZ : 3;
|
||||
quint32 : 3;
|
||||
quint32 Pitch : 9;
|
||||
quint32 Tiled : 1;
|
||||
|
||||
quint32 DataFormat : 6;
|
||||
quint32 Endian : 2;
|
||||
quint32 RequestSize : 2;
|
||||
quint32 Stacked : 1;
|
||||
quint32 ClampPolicy : 1;
|
||||
quint32 BaseAddress : 20;
|
||||
union
|
||||
{
|
||||
GPUTEXTURESIZE_1D OneD;
|
||||
@ -95,41 +92,99 @@ struct $FD14676823C8BF1A2A32FD1720A565E9
|
||||
GPUTEXTURESIZE_3D ThreeD;
|
||||
GPUTEXTURESIZE_STACK Stack;
|
||||
} Size;
|
||||
unsigned __int32 NumFormat : 1;
|
||||
unsigned __int32 SwizzleX : 3;
|
||||
unsigned __int32 SwizzleY : 3;
|
||||
unsigned __int32 SwizzleZ : 3;
|
||||
unsigned __int32 SwizzleW : 3;
|
||||
__int32 ExpAdjust : 6;
|
||||
unsigned __int32 MagFilter : 2;
|
||||
unsigned __int32 MinFilter : 2;
|
||||
unsigned __int32 MipFilter : 2;
|
||||
unsigned __int32 AnisoFilter : 3;
|
||||
unsigned __int32 : 3;
|
||||
unsigned __int32 BorderSize : 1;
|
||||
unsigned __int32 VolMagFilter : 1;
|
||||
unsigned __int32 VolMinFilter : 1;
|
||||
unsigned __int32 MinMipLevel : 4;
|
||||
unsigned __int32 MaxMipLevel : 4;
|
||||
unsigned __int32 MagAnisoWalk : 1;
|
||||
unsigned __int32 MinAnisoWalk : 1;
|
||||
__int32 LODBias : 10;
|
||||
__int32 GradExpAdjustH : 5;
|
||||
__int32 GradExpAdjustV : 5;
|
||||
unsigned __int32 BorderColor : 2;
|
||||
unsigned __int32 ForceBCWToMax : 1;
|
||||
unsigned __int32 TriClamp : 2;
|
||||
__int32 AnisoBias : 4;
|
||||
unsigned __int32 Dimension : 2;
|
||||
unsigned __int32 PackedMips : 1;
|
||||
unsigned __int32 MipAddress : 20;
|
||||
|
||||
quint32 NumFormat : 1;
|
||||
quint32 SwizzleX : 3;
|
||||
quint32 SwizzleY : 3;
|
||||
quint32 SwizzleZ : 3;
|
||||
quint32 SwizzleW : 3;
|
||||
qint32 ExpAdjust : 6;
|
||||
quint32 MagFilter : 2;
|
||||
quint32 MinFilter : 2;
|
||||
quint32 MipFilter : 2;
|
||||
quint32 AnisoFilter : 3;
|
||||
quint32 : 3;
|
||||
quint32 BorderSize : 1;
|
||||
|
||||
quint32 VolMagFilter : 1;
|
||||
quint32 VolMinFilter : 1;
|
||||
quint32 MinMipLevel : 4;
|
||||
quint32 MaxMipLevel : 4;
|
||||
quint32 MagAnisoWalk : 1;
|
||||
quint32 MinAnisoWalk : 1;
|
||||
qint32 LODBias : 10;
|
||||
qint32 GradExpAdjustH : 5;
|
||||
qint32 GradExpAdjustV : 5;
|
||||
|
||||
quint32 BorderColor : 2;
|
||||
quint32 ForceBCWToMax : 1;
|
||||
quint32 TriClamp : 2;
|
||||
qint32 AnisoBias : 4;
|
||||
quint32 Dimension : 2;
|
||||
quint32 PackedMips : 1;
|
||||
quint32 MipAddress : 20;
|
||||
};
|
||||
|
||||
union GPUTEXTURE_FETCH_CONSTANT
|
||||
{
|
||||
$FD14676823C8BF1A2A32FD1720A565E9 __s0;
|
||||
unsigned int dword[6];
|
||||
};
|
||||
// QDataStream &operator>>(QDataStream &in, GPUTEXTURE_FETCH_CONSTANT &s)
|
||||
// {
|
||||
// quint32 raw1, raw2, raw3, raw4, raw5;
|
||||
// in >> raw1 >> raw2 >> raw3 >> raw4 >> raw5;
|
||||
|
||||
// s.Type = raw1 & 0b000000000000000000000011;
|
||||
// s.SignX = (raw1 >> 2) & 0b000000000000000000000011;
|
||||
// s.SignY = (raw1 >> 4) & 0b000000000000000000000011;
|
||||
// s.SignZ = (raw1 >> 6) & 0b000000000000000000000011;
|
||||
// s.SignW = (raw1 >> 8) & 0b000000000000000000000011;
|
||||
// s.ClampX = (raw1 >> 10) & 0b000000000000000000000111;
|
||||
// s.ClampY = (raw1 >> 13) & 0b000000000000000000000111;
|
||||
// s.ClampZ = (raw1 >> 16) & 0b000000000000000000000111;
|
||||
// s.Pitch = (raw1 >> 22) & 0b000000000000000111111111;
|
||||
// s.Tiled = (raw1 >> 31) & 0b000000000000000000000001;
|
||||
|
||||
// s.DataFormat = raw2 & 0b000000000000000000111111;
|
||||
// s.Endian = (raw2 >> 6) & 0b000000000000000000000011;
|
||||
// s.RequestSize = (raw2 >> 8) & 0b000000000000000000000011;
|
||||
// s.Stacked = (raw2 >> 10) & 0b000000000000000000000001;
|
||||
// s.ClampPolicy = (raw2 >> 11) & 0b000000000000000000000001;
|
||||
// s.BaseAddress = (raw2 >> 12) & 0b000011111111111111111111;
|
||||
// s.Size = (raw2 >> 32) & 0b000000000000000000001111;
|
||||
|
||||
// s.NumFormat = raw3 & 0b000000000000000000000001;
|
||||
// s.SwizzleX = (raw3 >> 32) & 0b000000000000000000000111;
|
||||
// s.SwizzleY = (raw3 >> 32) & 0b000000000000000000000111;
|
||||
// s.SwizzleZ = (raw3 >> 32) & 0b000000000000000000000111;
|
||||
// s.SwizzleW = (raw3 >> 32) & 0b000000000000000000000111;
|
||||
// s.ExpAdjust = (raw3 >> 32) & 0b000000000000000000111111;
|
||||
// s.MagFilter = (raw3 >> 32) & 0b000000000000000000001111;
|
||||
// s.MinFilter = (raw3 >> 32) & 0b000000000000000000001111;
|
||||
// s.MipFilter = (raw3 >> 32) & 0b000000000000000000001111;
|
||||
// s.AnisoFilter = (raw3 >> 32) & 0b000000000000000000001111;
|
||||
// s.: 3;
|
||||
// s.BorderSize =
|
||||
// s.VolMagFilter =
|
||||
// s.VolMinFilter =
|
||||
// s.MinMipLevel =
|
||||
// s.MaxMipLevel =
|
||||
// s.MagAnisoWalk =
|
||||
// s.MinAnisoWalk =
|
||||
// s.LODBias =
|
||||
// s.GradExpAdjustH =
|
||||
// s.GradExpAdjustV =
|
||||
// s.BorderColor =
|
||||
// s.ForceBCWToMax =
|
||||
// s.TriClamp =
|
||||
// s.AnisoBias =
|
||||
// s.Dimension =
|
||||
// s.PackedMips =
|
||||
// s.MipAddress =
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// return in;
|
||||
// }
|
||||
|
||||
struct D3DBaseTexture : D3DResource
|
||||
{
|
||||
@ -184,8 +239,8 @@ struct MaterialTextureDef
|
||||
unsigned int nameHash;
|
||||
char nameStart;
|
||||
char nameEnd;
|
||||
unsigned __int8 samplerState;
|
||||
unsigned __int8 semantic;
|
||||
quint8 samplerState;
|
||||
quint8 semantic;
|
||||
MaterialTextureDefInfo u;
|
||||
};
|
||||
|
||||
@ -204,15 +259,24 @@ struct GfxStateBits
|
||||
struct Material
|
||||
{
|
||||
MaterialInfo info;
|
||||
unsigned __int8 stateBitsEntry[26];
|
||||
unsigned __int8 textureCount;
|
||||
unsigned __int8 constantCount;
|
||||
unsigned __int8 stateBitsCount;
|
||||
unsigned __int8 stateFlags;
|
||||
unsigned __int8 cameraRegion;
|
||||
|
||||
quint8 stateBitsEntry[26];
|
||||
quint8 textureCount;
|
||||
quint8 constantCount;
|
||||
quint8 stateBitsCount;
|
||||
quint8 stateFlags;
|
||||
quint8 cameraRegion;
|
||||
|
||||
qint32 techSetPtr;
|
||||
MaterialTechSet *techniqueSet;
|
||||
|
||||
qint32 textureTablePtr;
|
||||
MaterialTextureDef *textureTable;
|
||||
|
||||
qint32 constantTablePtr;
|
||||
MaterialConstantDef *constantTable;
|
||||
|
||||
qint32 stateBitsTablePtr;
|
||||
GfxStateBits *stateBitsTable;
|
||||
};
|
||||
|
||||
|
||||
1
libs/assets/materialpixelshader.cpp
Normal file
1
libs/assets/materialpixelshader.cpp
Normal file
@ -0,0 +1 @@
|
||||
#include "materialpixelshader.h"
|
||||
@ -2,13 +2,17 @@
|
||||
#define MATERIAL_PIXERHSHADER_H
|
||||
|
||||
#include "d3dresource.h"
|
||||
#include "qcontainerfwd.h"
|
||||
#include "qtypes.h"
|
||||
|
||||
struct GfxPixelShaderLoadDef
|
||||
{
|
||||
unsigned __int8 *cachedPart;
|
||||
unsigned __int8 *physicalPart;
|
||||
unsigned __int16 cachedPartSize;
|
||||
unsigned __int16 physicalPartSize;
|
||||
quint16 cachedPartPtr;
|
||||
QVector<quint8> cachedPart;
|
||||
quint16 physicalPartPtr;
|
||||
QVector<quint8> physicalPart;
|
||||
quint16 cachedPartSize;
|
||||
quint16 physicalPartSize;
|
||||
};
|
||||
|
||||
struct D3DPixelShader : D3DResource
|
||||
|
||||
1
libs/assets/materialtechset.cpp
Normal file
1
libs/assets/materialtechset.cpp
Normal file
@ -0,0 +1 @@
|
||||
#include "materialtechset.h"
|
||||
@ -36,8 +36,10 @@ struct D3DVertexShader : D3DResource
|
||||
|
||||
struct GfxVertexShaderLoadDef
|
||||
{
|
||||
int *cachedPart;
|
||||
int *physicalPart;
|
||||
qint32 cachedPartPtr;
|
||||
QVector<int> cachedPart;
|
||||
qint32 physicalPartPtr;
|
||||
QVector<int> physicalPart;
|
||||
int cachedPartSize;
|
||||
int physicalPartSize;
|
||||
};
|
||||
@ -102,7 +104,11 @@ struct MaterialTechSet
|
||||
{
|
||||
QString name;
|
||||
int worldVertFormat;
|
||||
|
||||
qint32 remappedPtr;
|
||||
std::shared_ptr<MaterialTechSet> remappedTechniqueSet;
|
||||
|
||||
QVector<qint32> techPtrs;
|
||||
QVector<std::shared_ptr<MaterialTechnique>> techniques;
|
||||
};
|
||||
|
||||
|
||||
1
libs/assets/menudef.cpp
Normal file
1
libs/assets/menudef.cpp
Normal file
@ -0,0 +1 @@
|
||||
#include "menudef.h"
|
||||
@ -42,7 +42,7 @@ struct ItemKeyHandler
|
||||
ItemKeyHandler *next;
|
||||
};
|
||||
|
||||
enum operationEnum : __int32
|
||||
enum OperationEnum : __int32
|
||||
{
|
||||
OP_NOOP = 0x0,
|
||||
OP_RIGHTPAREN = 0x1,
|
||||
@ -135,7 +135,7 @@ enum expDataType : __int32
|
||||
VAL_STRING = 0x2,
|
||||
};
|
||||
|
||||
union operandInternalDataUnion
|
||||
union OperandInternalDataUnion
|
||||
{
|
||||
int intVal;
|
||||
float floatVal;
|
||||
@ -145,12 +145,12 @@ union operandInternalDataUnion
|
||||
struct Operand
|
||||
{
|
||||
expDataType dataType;
|
||||
operandInternalDataUnion internals;
|
||||
OperandInternalDataUnion internals;
|
||||
};
|
||||
|
||||
union entryInternalData
|
||||
{
|
||||
operationEnum op;
|
||||
OperationEnum op;
|
||||
Operand operand;
|
||||
};
|
||||
|
||||
@ -193,7 +193,7 @@ struct listBoxDef_s
|
||||
Material *selectIcon;
|
||||
};
|
||||
|
||||
struct editFieldDef_s
|
||||
struct EditFieldDef
|
||||
{
|
||||
float minVal;
|
||||
float maxVal;
|
||||
@ -205,7 +205,7 @@ struct editFieldDef_s
|
||||
int paintOffset;
|
||||
};
|
||||
|
||||
struct multiDef_s
|
||||
struct MultiDef
|
||||
{
|
||||
const char *dvarList[32];
|
||||
const char *dvarStr[32];
|
||||
@ -214,17 +214,17 @@ struct multiDef_s
|
||||
int strDef;
|
||||
};
|
||||
|
||||
union itemDefData_t
|
||||
union ItemDefData
|
||||
{
|
||||
listBoxDef_s *listBox;
|
||||
editFieldDef_s *editField;
|
||||
multiDef_s *multi;
|
||||
EditFieldDef *editField;
|
||||
MultiDef *multi;
|
||||
const char *enumDvarName;
|
||||
void *data;
|
||||
};
|
||||
|
||||
struct MenuDef;
|
||||
struct itemDef_s
|
||||
struct ItemDef
|
||||
{
|
||||
windowDef_t window;
|
||||
rectDef_s textRect[4];
|
||||
@ -258,7 +258,7 @@ struct itemDef_s
|
||||
SoundAliasList *focusSound;
|
||||
float special;
|
||||
int cursorPos[4];
|
||||
itemDefData_t typeData;
|
||||
ItemDefData typeData;
|
||||
int imageTrack;
|
||||
statement_s visibleExp;
|
||||
statement_s textExp;
|
||||
@ -295,7 +295,7 @@ struct MenuDef
|
||||
float disableColor[4];
|
||||
statement_s rectXExp;
|
||||
statement_s rectYExp;
|
||||
itemDef_s **items;
|
||||
ItemDef **items;
|
||||
};
|
||||
|
||||
#endif // MENUDEF_H
|
||||
|
||||
1
libs/assets/menulist.cpp
Normal file
1
libs/assets/menulist.cpp
Normal file
@ -0,0 +1 @@
|
||||
#include "menulist.h"
|
||||
1
libs/assets/model.cpp
Normal file
1
libs/assets/model.cpp
Normal file
@ -0,0 +1 @@
|
||||
#include "model.h"
|
||||
@ -2,17 +2,19 @@
|
||||
#define MODEL_H
|
||||
|
||||
#include "material.h"
|
||||
#include "scriptstringlist.h"
|
||||
|
||||
struct XSurfaceVertexInfo
|
||||
{
|
||||
__int16 vertCount[4];
|
||||
unsigned __int16 *vertsBlend;
|
||||
qint16 vertCount[4];
|
||||
qint32 vertsBlendPtr;
|
||||
quint16 vertsBlend;
|
||||
};
|
||||
|
||||
union GfxColor
|
||||
{
|
||||
unsigned int packed;
|
||||
unsigned __int8 array[4];
|
||||
quint8 array[4];
|
||||
};
|
||||
|
||||
union PackedTexCoords
|
||||
@ -60,20 +62,20 @@ struct D3DVertexBuffer : D3DResource
|
||||
|
||||
struct XSurfaceCollisionAabb
|
||||
{
|
||||
unsigned __int16 mins[3];
|
||||
unsigned __int16 maxs[3];
|
||||
quint16 mins[3];
|
||||
quint16 maxs[3];
|
||||
};
|
||||
|
||||
struct XSurfaceCollisionNode
|
||||
{
|
||||
XSurfaceCollisionAabb aabb;
|
||||
unsigned __int16 childBeginIndex;
|
||||
unsigned __int16 childCount;
|
||||
quint16 childBeginIndex;
|
||||
quint16 childCount;
|
||||
};
|
||||
|
||||
struct XSurfaceCollisionLeaf
|
||||
{
|
||||
unsigned __int16 triangleBeginIndex;
|
||||
quint16 triangleBeginIndex;
|
||||
};
|
||||
|
||||
struct XSurfaceCollisionTree
|
||||
@ -81,17 +83,17 @@ struct XSurfaceCollisionTree
|
||||
float trans[3];
|
||||
float scale[3];
|
||||
unsigned int nodeCount;
|
||||
XSurfaceCollisionNode *nodes;
|
||||
QVector<XSurfaceCollisionNode> nodes;
|
||||
unsigned int leafCount;
|
||||
XSurfaceCollisionLeaf *leafs;
|
||||
QVector<XSurfaceCollisionLeaf> leafs;
|
||||
};
|
||||
|
||||
struct XRigidVertList
|
||||
{
|
||||
unsigned __int16 boneOffset;
|
||||
unsigned __int16 vertCount;
|
||||
unsigned __int16 triOffset;
|
||||
unsigned __int16 triCount;
|
||||
quint16 boneOffset;
|
||||
quint16 vertCount;
|
||||
quint16 triOffset;
|
||||
quint16 triCount;
|
||||
XSurfaceCollisionTree *collisionTree;
|
||||
};
|
||||
|
||||
@ -103,11 +105,11 @@ struct D3DIndexBuffer : D3DResource
|
||||
|
||||
struct XSurface
|
||||
{
|
||||
unsigned __int8 tileMode;
|
||||
quint8 tileMode;
|
||||
bool deformed;
|
||||
unsigned __int16 vertCount;
|
||||
unsigned __int16 triCount;
|
||||
unsigned __int16 *triIndices;
|
||||
quint16 vertCount;
|
||||
quint16 triCount;
|
||||
quint16 *triIndices;
|
||||
XSurfaceVertexInfo vertInfo;
|
||||
GfxPackedVertex *verts0;
|
||||
D3DVertexBuffer vb0;
|
||||
@ -127,12 +129,12 @@ struct DObjAnimMat
|
||||
struct XModelLodInfo
|
||||
{
|
||||
float dist;
|
||||
unsigned __int16 numsurfs;
|
||||
unsigned __int16 surfIndex;
|
||||
quint16 numsurfs;
|
||||
quint16 surfIndex;
|
||||
int partBits[4];
|
||||
};
|
||||
|
||||
struct XModelCollSurf_s
|
||||
struct XModelCollSurf
|
||||
{
|
||||
float mins[3];
|
||||
float maxs[3];
|
||||
@ -161,34 +163,42 @@ struct XModelStreamInfo
|
||||
|
||||
struct PhysPreset
|
||||
{
|
||||
const char *name;
|
||||
qint32 namePtr;
|
||||
QString name;
|
||||
|
||||
int type;
|
||||
|
||||
float mass;
|
||||
float bounce;
|
||||
float friction;
|
||||
float bulletForceScale;
|
||||
float explosiveForceScale;
|
||||
const char *sndAliasPrefix;
|
||||
|
||||
qint32 sndAliasPrefixPtr;
|
||||
QString sndAliasPrefix;
|
||||
|
||||
float piecesSpreadFraction;
|
||||
float piecesUpwardVelocity;
|
||||
|
||||
bool tempDefaultToCylinder;
|
||||
};
|
||||
|
||||
struct cplane_s
|
||||
struct CPlane
|
||||
{
|
||||
float normal[3];
|
||||
float dist;
|
||||
unsigned __int8 type;
|
||||
unsigned __int8 signbits;
|
||||
unsigned __int8 pad[2];
|
||||
quint8 type;
|
||||
quint8 signbits;
|
||||
quint8 pad[2];
|
||||
};
|
||||
|
||||
struct cbrushside_t
|
||||
struct CBrushSide
|
||||
{
|
||||
cplane_s *plane;
|
||||
unsigned int materialNum;
|
||||
__int16 firstAdjacentSideOffset;
|
||||
unsigned __int8 edgeCount;
|
||||
qint32 planePtr;
|
||||
CPlane plane;
|
||||
uint materialNum;
|
||||
qint16 firstAdjacentSideOffset;
|
||||
quint8 edgeCount;
|
||||
};
|
||||
|
||||
struct BrushWrapper
|
||||
@ -197,13 +207,13 @@ struct BrushWrapper
|
||||
int contents;
|
||||
float maxs[3];
|
||||
unsigned int numsides;
|
||||
cbrushside_t *sides;
|
||||
CBrushSide *sides;
|
||||
__int16 axialMaterialNum[2][3];
|
||||
unsigned __int8 *baseAdjacentSide;
|
||||
quint8 *baseAdjacentSide;
|
||||
__int16 firstAdjacentSideOffsets[2][3];
|
||||
unsigned __int8 edgeCount[2][3];
|
||||
quint8 edgeCount[2][3];
|
||||
int totalEdgeCount;
|
||||
cplane_s *planes;
|
||||
CPlane *planes;
|
||||
};
|
||||
|
||||
struct PhysGeomInfo
|
||||
@ -231,33 +241,61 @@ struct PhysGeomList
|
||||
|
||||
struct Model
|
||||
{
|
||||
const char *name;
|
||||
unsigned __int8 numBones;
|
||||
unsigned __int8 numRootBones;
|
||||
unsigned __int8 numsurfs;
|
||||
unsigned __int8 lodRampType;
|
||||
unsigned __int16 *boneNames;
|
||||
unsigned __int8 *parentList;
|
||||
__int16 *quats;
|
||||
QString name;
|
||||
qint32 namePtr;
|
||||
quint8 numBones;
|
||||
quint8 numRootBones;
|
||||
quint8 numsurfs;
|
||||
quint8 lodRampType;
|
||||
|
||||
quint32 boneNamesPtr;
|
||||
ScriptStringList boneNames;
|
||||
|
||||
quint32 parentListPtr;
|
||||
quint8 *parentList;
|
||||
|
||||
qint32 quatsPtr;
|
||||
qint16 *quats;
|
||||
|
||||
qint32 transPtr;
|
||||
float *trans;
|
||||
unsigned __int8 *partClassification;
|
||||
|
||||
qint32 partClassPtr;
|
||||
quint8 *partClassification;
|
||||
|
||||
qint32 baseMatPtr;
|
||||
DObjAnimMat *baseMat;
|
||||
|
||||
qint32 surfsPtr;
|
||||
XSurface *surfs;
|
||||
|
||||
qint32 matHandlesPtr;
|
||||
Material **materialHandles;
|
||||
|
||||
XModelLodInfo lodInfo[4];
|
||||
XModelCollSurf_s *collSurfs;
|
||||
|
||||
qint32 collSurfsPtr;
|
||||
XModelCollSurf *collSurfs;
|
||||
|
||||
int numCollSurfs;
|
||||
int contents;
|
||||
|
||||
qint32 boneInfoPtr;
|
||||
XBoneInfo *boneInfo;
|
||||
|
||||
float radius;
|
||||
float mins[3];
|
||||
float maxs[3];
|
||||
__int16 numLods;
|
||||
__int16 collLod;
|
||||
|
||||
qint16 numLods;
|
||||
qint16 collLod;
|
||||
|
||||
XModelStreamInfo streamInfo;
|
||||
int memUsage;
|
||||
unsigned __int8 flags;
|
||||
PhysPreset *physPreset;
|
||||
quint8 flags;
|
||||
std::shared_ptr<PhysPreset> physPreset;
|
||||
|
||||
qint32 physGeomsPtr;
|
||||
PhysGeomList *physGeoms;
|
||||
};
|
||||
|
||||
|
||||
1
libs/assets/rawfile.cpp
Normal file
1
libs/assets/rawfile.cpp
Normal file
@ -0,0 +1 @@
|
||||
#include "rawfile.h"
|
||||
@ -3,18 +3,15 @@
|
||||
|
||||
#include <QString>
|
||||
|
||||
struct p_RawFile
|
||||
{
|
||||
const char *name;
|
||||
int length;
|
||||
const char *buffer;
|
||||
};
|
||||
|
||||
struct RawFile : p_RawFile
|
||||
struct RawFile
|
||||
{
|
||||
qint32 namePtr;
|
||||
QString name;
|
||||
QString path;
|
||||
int length;
|
||||
|
||||
quint32 length;
|
||||
|
||||
qint32 bufferPtr;
|
||||
QByteArray buffer;
|
||||
};
|
||||
|
||||
#endif // RAWFILE_H
|
||||
|
||||
1
libs/assets/scriptstringlist.cpp
Normal file
1
libs/assets/scriptstringlist.cpp
Normal file
@ -0,0 +1 @@
|
||||
#include "scriptstringlist.h"
|
||||
13
libs/assets/scriptstringlist.h
Normal file
13
libs/assets/scriptstringlist.h
Normal file
@ -0,0 +1,13 @@
|
||||
#ifndef SCRIPTSTRINGLIST_H
|
||||
#define SCRIPTSTRINGLIST_H
|
||||
|
||||
#include <QStringList>
|
||||
|
||||
struct ScriptStringList
|
||||
{
|
||||
int count;
|
||||
QVector<qint32> stringPtrs;
|
||||
QStringList scriptStrings;
|
||||
};
|
||||
|
||||
#endif // SCRIPTSTRINGLIST_H
|
||||
1
libs/assets/soundalias.cpp
Normal file
1
libs/assets/soundalias.cpp
Normal file
@ -0,0 +1 @@
|
||||
#include "soundalias.h"
|
||||
1
libs/assets/soundcurve.cpp
Normal file
1
libs/assets/soundcurve.cpp
Normal file
@ -0,0 +1 @@
|
||||
#include "soundcurve.h"
|
||||
1
libs/assets/sounddriver.cpp
Normal file
1
libs/assets/sounddriver.cpp
Normal file
@ -0,0 +1 @@
|
||||
#include "sounddriver.h"
|
||||
@ -1,6 +1,8 @@
|
||||
#ifndef SoundDriver_H
|
||||
#define SoundDriver_H
|
||||
|
||||
#include <QString>
|
||||
|
||||
struct XAUDIOREVERBSETTINGS
|
||||
{
|
||||
unsigned int ReflectionsDelay;
|
||||
@ -34,8 +36,11 @@ struct XaReverbSettings
|
||||
|
||||
struct SoundDriver
|
||||
{
|
||||
qint32 namePtr;
|
||||
QString name;
|
||||
|
||||
qint32 reverbPtr;
|
||||
XaReverbSettings *reverbSettings;
|
||||
const char *name;
|
||||
};
|
||||
|
||||
#endif // SoundDriver_H
|
||||
|
||||
1
libs/assets/stringtable.cpp
Normal file
1
libs/assets/stringtable.cpp
Normal file
@ -0,0 +1 @@
|
||||
#include "stringtable.h"
|
||||
@ -1,12 +1,19 @@
|
||||
#ifndef STRINGTABLESH_H
|
||||
#define STRINGTABLESH_H
|
||||
|
||||
#include <QString>
|
||||
#include <QList>
|
||||
|
||||
struct StringTable
|
||||
{
|
||||
const char *name;
|
||||
qint32 namePtr;
|
||||
QString name;
|
||||
|
||||
int columnCount;
|
||||
int rowCount;
|
||||
const char **values;
|
||||
|
||||
qint32 valuesPtr;
|
||||
QStringList values;
|
||||
};
|
||||
|
||||
#endif // STRINGTABLESH_H
|
||||
|
||||
1
libs/assets/weapondef.cpp
Normal file
1
libs/assets/weapondef.cpp
Normal file
@ -0,0 +1 @@
|
||||
#include "weapondef.h"
|
||||
@ -5,7 +5,7 @@
|
||||
#include "soundalias.h"
|
||||
#include "model.h"
|
||||
|
||||
enum weapType_t : __int32
|
||||
enum WeaponType : __int32
|
||||
{
|
||||
WEAPTYPE_BULLET = 0x0,
|
||||
WEAPTYPE_GRENADE = 0x1,
|
||||
@ -14,7 +14,7 @@ enum weapType_t : __int32
|
||||
WEAPTYPE_NUM = 0x4,
|
||||
};
|
||||
|
||||
enum weapClass_t : __int32
|
||||
enum WeaponClass : __int32
|
||||
{
|
||||
WEAPCLASS_RIFLE = 0x0,
|
||||
WEAPCLASS_MG = 0x1,
|
||||
@ -52,7 +52,7 @@ enum ImpactType : __int32
|
||||
IMPACT_TYPE_COUNT = 0x9,
|
||||
};
|
||||
|
||||
enum weapInventoryType_t : __int32
|
||||
enum WeaponInventoryType : __int32
|
||||
{
|
||||
WEAPINVENTORY_PRIMARY = 0x0,
|
||||
WEAPINVENTORY_OFFHAND = 0x1,
|
||||
@ -61,7 +61,7 @@ enum weapInventoryType_t : __int32
|
||||
WEAPINVENTORYCOUNT = 0x4,
|
||||
};
|
||||
|
||||
enum weapFireType_t : __int32
|
||||
enum WeaponFireType : __int32
|
||||
{
|
||||
WEAPON_FIRETYPE_FULLAUTO = 0x0,
|
||||
WEAPON_FIRETYPE_SINGLESHOT = 0x1,
|
||||
@ -80,7 +80,7 @@ enum OffhandClass : __int32
|
||||
OFFHAND_CLASS_COUNT = 0x4,
|
||||
};
|
||||
|
||||
enum weapStance_t : __int32
|
||||
enum WeaponStance : __int32
|
||||
{
|
||||
WEAPSTANCE_STAND = 0x0,
|
||||
WEAPSTANCE_DUCK = 0x1,
|
||||
@ -88,7 +88,7 @@ enum weapStance_t : __int32
|
||||
WEAPSTANCE_NUM = 0x3,
|
||||
};
|
||||
|
||||
enum activeReticleType_t : __int32
|
||||
enum ActiveReticleType : __int32
|
||||
{
|
||||
VEH_ACTIVE_RETICLE_NONE = 0x0,
|
||||
VEH_ACTIVE_RETICLE_PIP_ON_A_STICK = 0x1,
|
||||
@ -96,7 +96,7 @@ enum activeReticleType_t : __int32
|
||||
VEH_ACTIVE_RETICLE_COUNT = 0x3,
|
||||
};
|
||||
|
||||
enum weaponIconRatioType_t : __int32
|
||||
enum WeaponIconRatioType : __int32
|
||||
{
|
||||
WEAPON_ICON_RATIO_1TO1 = 0x0,
|
||||
WEAPON_ICON_RATIO_2TO1 = 0x1,
|
||||
@ -104,7 +104,7 @@ enum weaponIconRatioType_t : __int32
|
||||
WEAPON_ICON_RATIO_COUNT = 0x3,
|
||||
};
|
||||
|
||||
enum ammoCounterClipType_t : __int32
|
||||
enum AmmoCounterClipType : __int32
|
||||
{
|
||||
AMMO_COUNTER_CLIP_NONE = 0x0,
|
||||
AMMO_COUNTER_CLIP_MAGAZINE = 0x1,
|
||||
@ -116,7 +116,7 @@ enum ammoCounterClipType_t : __int32
|
||||
AMMO_COUNTER_CLIP_COUNT = 0x7,
|
||||
};
|
||||
|
||||
enum weapOverlayReticle_t : __int32
|
||||
enum WeaponOverlayReticle : __int32
|
||||
{
|
||||
WEAPOVERLAYRETICLE_NONE = 0x0,
|
||||
WEAPOVERLAYRETICLE_CROSSHAIR = 0x1,
|
||||
@ -131,7 +131,7 @@ enum WeapOverlayInteface_t : __int32
|
||||
WEAPOVERLAYINTERFACECOUNT = 0x3,
|
||||
};
|
||||
|
||||
enum weapProjExposion_t : __int32
|
||||
enum WeaponProjExposion : __int32
|
||||
{
|
||||
WEAPPROJEXP_GRENADE = 0x0,
|
||||
WEAPPROJEXP_ROCKET = 0x1,
|
||||
@ -152,7 +152,7 @@ enum WeapStickinessType : __int32
|
||||
WEAPSTICKINESS_COUNT = 0x4,
|
||||
};
|
||||
|
||||
enum guidedMissileType_t : __int32
|
||||
enum GuidedMissileType : __int32
|
||||
{
|
||||
MISSILE_GUIDANCE_NONE = 0x0,
|
||||
MISSILE_GUIDANCE_SIDEWINDER = 0x1,
|
||||
@ -174,14 +174,14 @@ struct WeaponDef
|
||||
unsigned __int16 notetrackSoundMapKeys[16];
|
||||
unsigned __int16 notetrackSoundMapValues[16];
|
||||
int playerAnimType;
|
||||
weapType_t weapType;
|
||||
weapClass_t weapClass;
|
||||
WeaponType weapType;
|
||||
WeaponClass weapClass;
|
||||
PenetrateType penetrateType;
|
||||
ImpactType impactType;
|
||||
weapInventoryType_t inventoryType;
|
||||
weapFireType_t fireType;
|
||||
WeaponInventoryType inventoryType;
|
||||
WeaponFireType fireType;
|
||||
OffhandClass offhandClass;
|
||||
weapStance_t stance;
|
||||
WeaponStance stance;
|
||||
const EffectDef *viewFlashEffect;
|
||||
const EffectDef *worldFlashEffect;
|
||||
SoundAliasList *pickupSound;
|
||||
@ -239,7 +239,7 @@ struct WeaponDef
|
||||
int iReticleCenterSize;
|
||||
int iReticleSideSize;
|
||||
int iReticleMinOfs;
|
||||
activeReticleType_t activeReticleType;
|
||||
ActiveReticleType activeReticleType;
|
||||
float vStandMove[3];
|
||||
float vStandRot[3];
|
||||
float vDuckedOfs[3];
|
||||
@ -264,10 +264,10 @@ struct WeaponDef
|
||||
Model *knifeModel;
|
||||
Model *worldKnifeModel;
|
||||
Material *hudIcon;
|
||||
weaponIconRatioType_t hudIconRatio;
|
||||
WeaponIconRatioType hudIconRatio;
|
||||
Material *ammoCounterIcon;
|
||||
weaponIconRatioType_t ammoCounterIconRatio;
|
||||
ammoCounterClipType_t ammoCounterClip;
|
||||
WeaponIconRatioType ammoCounterIconRatio;
|
||||
AmmoCounterClipType ammoCounterClip;
|
||||
int iStartAmmo;
|
||||
const char *szAmmoName;
|
||||
int iAmmoIndex;
|
||||
@ -338,7 +338,7 @@ struct WeaponDef
|
||||
float fAdsZoomOutFrac;
|
||||
Material *overlayMaterial;
|
||||
Material *overlayMaterialLowRes;
|
||||
weapOverlayReticle_t overlayReticle;
|
||||
WeaponOverlayReticle overlayReticle;
|
||||
WeapOverlayInteface_t overlayInterface;
|
||||
float overlayWidth;
|
||||
float overlayHeight;
|
||||
@ -395,10 +395,10 @@ struct WeaponDef
|
||||
int enhanced;
|
||||
int laserSightDuringNightvision;
|
||||
Material *killIcon;
|
||||
weaponIconRatioType_t killIconRatio;
|
||||
WeaponIconRatioType killIconRatio;
|
||||
int flipKillIcon;
|
||||
Material *dpadIcon;
|
||||
weaponIconRatioType_t dpadIconRatio;
|
||||
WeaponIconRatioType dpadIconRatio;
|
||||
int bNoPartialReload;
|
||||
int bSegmentedReload;
|
||||
int iReloadAmmoAdd;
|
||||
@ -422,7 +422,7 @@ struct WeaponDef
|
||||
float timeToAccelerate;
|
||||
float projectileCurvature;
|
||||
Model *projectileModel;
|
||||
weapProjExposion_t projExplosion;
|
||||
WeaponProjExposion projExplosion;
|
||||
const EffectDef *projExplosionEffect;
|
||||
int projExplosionEffectForceNormalUp;
|
||||
const EffectDef *projDudEffect;
|
||||
@ -440,7 +440,7 @@ struct WeaponDef
|
||||
float perpendicularBounce[29];
|
||||
const EffectDef *projTrailEffect;
|
||||
float vProjectileColor[3];
|
||||
guidedMissileType_t guidedMissileType;
|
||||
GuidedMissileType guidedMissileType;
|
||||
float maxSteeringAccel;
|
||||
int projIgnitionDelay;
|
||||
const EffectDef *projIgnitionEffect;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user