mirror of
https://github.com/redstrate/Novus.git
synced 2025-04-26 13:47:46 +00:00
Fix most warnings
This commit is contained in:
parent
2e033e1ee1
commit
81e9c09be8
36 changed files with 134 additions and 118 deletions
|
@ -10,7 +10,6 @@ target_link_libraries(novus-argcracker
|
||||||
Physis::Physis
|
Physis::Physis
|
||||||
Qt6::Core
|
Qt6::Core
|
||||||
Qt6::Core5Compat)
|
Qt6::Core5Compat)
|
||||||
target_include_directories(novus-argcracker PUBLIC include)
|
|
||||||
|
|
||||||
if (${CMAKE_SYSTEM_NAME} STREQUAL "Darwin")
|
if (${CMAKE_SYSTEM_NAME} STREQUAL "Darwin")
|
||||||
target_compile_definitions(novus-argcracker PUBLIC MACOS)
|
target_compile_definitions(novus-argcracker PUBLIC MACOS)
|
||||||
|
|
|
@ -30,7 +30,7 @@ FullModelViewer::FullModelViewer(GameData *data, FileCache &cache, QWidget *pare
|
||||||
|
|
||||||
auto datOpenAction = fileMenu->addAction(QStringLiteral("Load character DAT..."));
|
auto datOpenAction = fileMenu->addAction(QStringLiteral("Load character DAT..."));
|
||||||
datOpenAction->setIcon(QIcon::fromTheme(QStringLiteral("document-open")));
|
datOpenAction->setIcon(QIcon::fromTheme(QStringLiteral("document-open")));
|
||||||
connect(datOpenAction, &QAction::triggered, [=] {
|
connect(datOpenAction, &QAction::triggered, [this] {
|
||||||
auto fileName =
|
auto fileName =
|
||||||
QFileDialog::getOpenFileName(nullptr, QStringLiteral("Open DAT File"), QStringLiteral("~"), QStringLiteral("FFXIV Character DAT File (*.dat)"));
|
QFileDialog::getOpenFileName(nullptr, QStringLiteral("Open DAT File"), QStringLiteral("~"), QStringLiteral("FFXIV Character DAT File (*.dat)"));
|
||||||
|
|
||||||
|
@ -210,7 +210,7 @@ void FullModelViewer::reloadGear()
|
||||||
void FullModelViewer::updateHeightScaling(float scale)
|
void FullModelViewer::updateHeightScaling(float scale)
|
||||||
{
|
{
|
||||||
auto &boneData = *gearView->part().skeleton;
|
auto &boneData = *gearView->part().skeleton;
|
||||||
for (int i = 0; i < boneData.num_bones; i++) {
|
for (uint32_t i = 0; i < boneData.num_bones; i++) {
|
||||||
const std::string_view name{boneData.bones[i].name};
|
const std::string_view name{boneData.bones[i].name};
|
||||||
if (name == "n_root") {
|
if (name == "n_root") {
|
||||||
auto racialScaling = physis_cmp_get_racial_scaling_parameters(cmp, gearView->currentRace, gearView->currentSubrace);
|
auto racialScaling = physis_cmp_get_racial_scaling_parameters(cmp, gearView->currentRace, gearView->currentSubrace);
|
||||||
|
@ -234,7 +234,7 @@ void FullModelViewer::updateHeightScaling(float scale)
|
||||||
void FullModelViewer::updateBustScaling(float scale)
|
void FullModelViewer::updateBustScaling(float scale)
|
||||||
{
|
{
|
||||||
auto &boneData = *gearView->part().skeleton;
|
auto &boneData = *gearView->part().skeleton;
|
||||||
for (int i = 0; i < boneData.num_bones; i++) {
|
for (uint32_t i = 0; i < boneData.num_bones; i++) {
|
||||||
const std::string_view name{boneData.bones[i].name};
|
const std::string_view name{boneData.bones[i].name};
|
||||||
if (name == "j_mune_l" || name == "j_mune_r") {
|
if (name == "j_mune_l" || name == "j_mune_r") {
|
||||||
auto racialScaling = physis_cmp_get_racial_scaling_parameters(cmp, gearView->currentRace, gearView->currentSubrace);
|
auto racialScaling = physis_cmp_get_racial_scaling_parameters(cmp, gearView->currentRace, gearView->currentSubrace);
|
||||||
|
@ -275,19 +275,19 @@ QGroupBox *FullModelViewer::addFaceGroup()
|
||||||
faceGroup->setLayout(faceGroupLayout);
|
faceGroup->setLayout(faceGroupLayout);
|
||||||
|
|
||||||
auto faceRadio1 = new QRadioButton(QStringLiteral("Face 1"));
|
auto faceRadio1 = new QRadioButton(QStringLiteral("Face 1"));
|
||||||
connect(faceRadio1, &QRadioButton::clicked, this, [=] {
|
connect(faceRadio1, &QRadioButton::clicked, this, [this] {
|
||||||
gearView->setFace(1);
|
gearView->setFace(1);
|
||||||
});
|
});
|
||||||
faceGroupLayout->addWidget(faceRadio1);
|
faceGroupLayout->addWidget(faceRadio1);
|
||||||
|
|
||||||
auto faceRadio2 = new QRadioButton(QStringLiteral("Face 2"));
|
auto faceRadio2 = new QRadioButton(QStringLiteral("Face 2"));
|
||||||
connect(faceRadio2, &QRadioButton::clicked, this, [=] {
|
connect(faceRadio2, &QRadioButton::clicked, this, [this] {
|
||||||
gearView->setFace(2);
|
gearView->setFace(2);
|
||||||
});
|
});
|
||||||
faceGroupLayout->addWidget(faceRadio2);
|
faceGroupLayout->addWidget(faceRadio2);
|
||||||
|
|
||||||
auto faceRadio3 = new QRadioButton(QStringLiteral("Face 3"));
|
auto faceRadio3 = new QRadioButton(QStringLiteral("Face 3"));
|
||||||
connect(faceRadio3, &QRadioButton::clicked, this, [=] {
|
connect(faceRadio3, &QRadioButton::clicked, this, [this] {
|
||||||
gearView->setFace(3);
|
gearView->setFace(3);
|
||||||
});
|
});
|
||||||
faceGroupLayout->addWidget(faceRadio3);
|
faceGroupLayout->addWidget(faceRadio3);
|
||||||
|
@ -302,19 +302,19 @@ QGroupBox *FullModelViewer::addHairGroup()
|
||||||
hairGroup->setLayout(hairGroupLayout);
|
hairGroup->setLayout(hairGroupLayout);
|
||||||
|
|
||||||
auto hairRadio1 = new QRadioButton(QStringLiteral("Hair 1"));
|
auto hairRadio1 = new QRadioButton(QStringLiteral("Hair 1"));
|
||||||
connect(hairRadio1, &QRadioButton::clicked, this, [=] {
|
connect(hairRadio1, &QRadioButton::clicked, this, [this] {
|
||||||
gearView->setHair(1);
|
gearView->setHair(1);
|
||||||
});
|
});
|
||||||
hairGroupLayout->addWidget(hairRadio1);
|
hairGroupLayout->addWidget(hairRadio1);
|
||||||
|
|
||||||
auto hairRadio2 = new QRadioButton(QStringLiteral("Hair 2"));
|
auto hairRadio2 = new QRadioButton(QStringLiteral("Hair 2"));
|
||||||
connect(hairRadio2, &QRadioButton::clicked, this, [=] {
|
connect(hairRadio2, &QRadioButton::clicked, this, [this] {
|
||||||
gearView->setHair(2);
|
gearView->setHair(2);
|
||||||
});
|
});
|
||||||
hairGroupLayout->addWidget(hairRadio2);
|
hairGroupLayout->addWidget(hairRadio2);
|
||||||
|
|
||||||
auto hairRadio3 = new QRadioButton(QStringLiteral("Hair 3"));
|
auto hairRadio3 = new QRadioButton(QStringLiteral("Hair 3"));
|
||||||
connect(hairRadio3, &QRadioButton::clicked, this, [=] {
|
connect(hairRadio3, &QRadioButton::clicked, this, [this] {
|
||||||
gearView->setHair(3);
|
gearView->setHair(3);
|
||||||
});
|
});
|
||||||
hairGroupLayout->addWidget(hairRadio3);
|
hairGroupLayout->addWidget(hairRadio3);
|
||||||
|
@ -329,19 +329,19 @@ QGroupBox *FullModelViewer::addEarGroup()
|
||||||
earGroup->setLayout(earGroupLayout);
|
earGroup->setLayout(earGroupLayout);
|
||||||
|
|
||||||
auto earRadio1 = new QRadioButton(QStringLiteral("Ears 1"));
|
auto earRadio1 = new QRadioButton(QStringLiteral("Ears 1"));
|
||||||
connect(earRadio1, &QRadioButton::clicked, this, [=] {
|
connect(earRadio1, &QRadioButton::clicked, this, [this] {
|
||||||
gearView->setEar(1);
|
gearView->setEar(1);
|
||||||
});
|
});
|
||||||
earGroupLayout->addWidget(earRadio1);
|
earGroupLayout->addWidget(earRadio1);
|
||||||
|
|
||||||
auto earRadio2 = new QRadioButton(QStringLiteral("Ears 2"));
|
auto earRadio2 = new QRadioButton(QStringLiteral("Ears 2"));
|
||||||
connect(earRadio2, &QRadioButton::clicked, this, [=] {
|
connect(earRadio2, &QRadioButton::clicked, this, [this] {
|
||||||
gearView->setEar(2);
|
gearView->setEar(2);
|
||||||
});
|
});
|
||||||
earGroupLayout->addWidget(earRadio2);
|
earGroupLayout->addWidget(earRadio2);
|
||||||
|
|
||||||
auto earRadio3 = new QRadioButton(QStringLiteral("Ears 3"));
|
auto earRadio3 = new QRadioButton(QStringLiteral("Ears 3"));
|
||||||
connect(earRadio3, &QRadioButton::clicked, this, [=] {
|
connect(earRadio3, &QRadioButton::clicked, this, [this] {
|
||||||
gearView->setEar(3);
|
gearView->setEar(3);
|
||||||
});
|
});
|
||||||
earGroupLayout->addWidget(earRadio3);
|
earGroupLayout->addWidget(earRadio3);
|
||||||
|
@ -356,19 +356,19 @@ QGroupBox *FullModelViewer::addTailGroup()
|
||||||
tailGroup->setLayout(tailGroupLayout);
|
tailGroup->setLayout(tailGroupLayout);
|
||||||
|
|
||||||
auto tailRadio1 = new QRadioButton(QStringLiteral("Tail 1"));
|
auto tailRadio1 = new QRadioButton(QStringLiteral("Tail 1"));
|
||||||
connect(tailRadio1, &QRadioButton::clicked, this, [=] {
|
connect(tailRadio1, &QRadioButton::clicked, this, [this] {
|
||||||
gearView->setTail(1);
|
gearView->setTail(1);
|
||||||
});
|
});
|
||||||
tailGroupLayout->addWidget(tailRadio1);
|
tailGroupLayout->addWidget(tailRadio1);
|
||||||
|
|
||||||
auto tailRadio2 = new QRadioButton(QStringLiteral("Tail 2"));
|
auto tailRadio2 = new QRadioButton(QStringLiteral("Tail 2"));
|
||||||
connect(tailRadio2, &QRadioButton::clicked, this, [=] {
|
connect(tailRadio2, &QRadioButton::clicked, this, [this] {
|
||||||
gearView->setTail(2);
|
gearView->setTail(2);
|
||||||
});
|
});
|
||||||
tailGroupLayout->addWidget(tailRadio2);
|
tailGroupLayout->addWidget(tailRadio2);
|
||||||
|
|
||||||
auto tailRadio3 = new QRadioButton(QStringLiteral("Tail 3"));
|
auto tailRadio3 = new QRadioButton(QStringLiteral("Tail 3"));
|
||||||
connect(tailRadio3, &QRadioButton::clicked, this, [=] {
|
connect(tailRadio3, &QRadioButton::clicked, this, [this] {
|
||||||
gearView->setTail(3);
|
gearView->setTail(3);
|
||||||
});
|
});
|
||||||
tailGroupLayout->addWidget(tailRadio3);
|
tailGroupLayout->addWidget(tailRadio3);
|
||||||
|
|
|
@ -35,7 +35,7 @@ GearListModel::GearListModel(GameData *data, QObject *parent)
|
||||||
connect(exdFuture, &QFutureWatcher<physis_EXD>::finished, this, &GearListModel::finished);
|
connect(exdFuture, &QFutureWatcher<physis_EXD>::finished, this, &GearListModel::finished);
|
||||||
|
|
||||||
QVector<int> pages;
|
QVector<int> pages;
|
||||||
for (int i = 0; i < exh->page_count; i++) {
|
for (uint32_t i = 0; i < exh->page_count; i++) {
|
||||||
pages.push_back(i);
|
pages.push_back(i);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -69,6 +69,7 @@ int GearListModel::rowCount(const QModelIndex &parent) const
|
||||||
|
|
||||||
int GearListModel::columnCount(const QModelIndex &parent) const
|
int GearListModel::columnCount(const QModelIndex &parent) const
|
||||||
{
|
{
|
||||||
|
Q_UNUSED(parent)
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -147,10 +148,10 @@ void GearListModel::exdFinished(int index)
|
||||||
{
|
{
|
||||||
auto exd = exdFuture->resultAt(index);
|
auto exd = exdFuture->resultAt(index);
|
||||||
|
|
||||||
for (int i = 0; i < exd.row_count; i++) {
|
for (unsigned int i = 0; i < exd.row_count; i++) {
|
||||||
const auto row = exd.row_data[i];
|
const auto row = exd.row_data[i];
|
||||||
auto primaryModel = row.column_data[47].u_int64._0;
|
auto primaryModel = row.column_data[47].u_int64._0;
|
||||||
auto secondaryModel = row.column_data[48].u_int64._0;
|
// auto secondaryModel = row.column_data[48].u_int64._0;
|
||||||
|
|
||||||
int16_t parts[4];
|
int16_t parts[4];
|
||||||
memcpy(parts, &primaryModel, sizeof(int16_t) * 4);
|
memcpy(parts, &primaryModel, sizeof(int16_t) * 4);
|
||||||
|
|
|
@ -49,10 +49,10 @@ GearView::GearView(GameData *data, FileCache &cache, QWidget *parent)
|
||||||
|
|
||||||
Q_EMIT loadingChanged(true);
|
Q_EMIT loadingChanged(true);
|
||||||
|
|
||||||
QtConcurrent::run(QThreadPool::globalInstance(), [this] {
|
Q_UNUSED(QtConcurrent::run(QThreadPool::globalInstance(), [this] {
|
||||||
updatePart();
|
updatePart();
|
||||||
Q_EMIT loadingChanged(false);
|
Q_EMIT loadingChanged(false);
|
||||||
});
|
}));
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@ -61,7 +61,7 @@ std::vector<std::pair<Race, Subrace>> GearView::supportedRaces() const
|
||||||
{
|
{
|
||||||
std::vector<std::pair<Race, Subrace>> races;
|
std::vector<std::pair<Race, Subrace>> races;
|
||||||
for (const auto &gear : loadedGears) {
|
for (const auto &gear : loadedGears) {
|
||||||
for (const auto [race, race_name] : magic_enum::enum_entries<Race>()) {
|
for (const auto &[race, race_name] : magic_enum::enum_entries<Race>()) {
|
||||||
for (const auto subrace : physis_get_supported_subraces(race).subraces) {
|
for (const auto subrace : physis_get_supported_subraces(race).subraces) {
|
||||||
auto equip_path = physis_build_equipment_path(gear.info.modelInfo.primaryID, race, subrace, currentGender, gear.info.slot);
|
auto equip_path = physis_build_equipment_path(gear.info.modelInfo.primaryID, race, subrace, currentGender, gear.info.slot);
|
||||||
|
|
||||||
|
@ -314,7 +314,7 @@ void GearView::updatePart()
|
||||||
auto mdl = physis_mdl_parse(mdl_data);
|
auto mdl = physis_mdl_parse(mdl_data);
|
||||||
|
|
||||||
std::vector<physis_Material> materials;
|
std::vector<physis_Material> materials;
|
||||||
for (int i = 0; i < mdl.num_material_names; i++) {
|
for (uint32_t i = 0; i < mdl.num_material_names; i++) {
|
||||||
const char *material_name = mdl.material_names[i];
|
const char *material_name = mdl.material_names[i];
|
||||||
|
|
||||||
const std::string mtrl_path = gearAddition.info.getMtrlPath(material_name);
|
const std::string mtrl_path = gearAddition.info.getMtrlPath(material_name);
|
||||||
|
@ -375,7 +375,7 @@ void GearView::updatePart()
|
||||||
auto mdl = physis_mdl_parse(mdl_data);
|
auto mdl = physis_mdl_parse(mdl_data);
|
||||||
|
|
||||||
std::vector<physis_Material> materials;
|
std::vector<physis_Material> materials;
|
||||||
for (int i = 0; i < mdl.num_material_names; i++) {
|
for (uint32_t i = 0; i < mdl.num_material_names; i++) {
|
||||||
const char *material_name = mdl.material_names[i];
|
const char *material_name = mdl.material_names[i];
|
||||||
const std::string skinmtrl_path =
|
const std::string skinmtrl_path =
|
||||||
physis_build_face_material_path(physis_get_race_code(currentRace, currentSubrace, currentGender), *face, material_name);
|
physis_build_face_material_path(physis_get_race_code(currentRace, currentSubrace, currentGender), *face, material_name);
|
||||||
|
@ -398,7 +398,7 @@ void GearView::updatePart()
|
||||||
auto mdl = physis_mdl_parse(mdl_data);
|
auto mdl = physis_mdl_parse(mdl_data);
|
||||||
|
|
||||||
std::vector<physis_Material> materials;
|
std::vector<physis_Material> materials;
|
||||||
for (int i = 0; i < mdl.num_material_names; i++) {
|
for (uint32_t i = 0; i < mdl.num_material_names; i++) {
|
||||||
const char *material_name = mdl.material_names[i];
|
const char *material_name = mdl.material_names[i];
|
||||||
const std::string skinmtrl_path =
|
const std::string skinmtrl_path =
|
||||||
physis_build_hair_material_path(physis_get_race_code(currentRace, currentSubrace, currentGender), *hair, material_name);
|
physis_build_hair_material_path(physis_get_race_code(currentRace, currentSubrace, currentGender), *hair, material_name);
|
||||||
|
@ -421,7 +421,7 @@ void GearView::updatePart()
|
||||||
auto mdl = physis_mdl_parse(mdl_data);
|
auto mdl = physis_mdl_parse(mdl_data);
|
||||||
|
|
||||||
std::vector<physis_Material> materials;
|
std::vector<physis_Material> materials;
|
||||||
for (int i = 0; i < mdl.num_material_names; i++) {
|
for (uint32_t i = 0; i < mdl.num_material_names; i++) {
|
||||||
const char *material_name = mdl.material_names[i];
|
const char *material_name = mdl.material_names[i];
|
||||||
const std::string skinmtrl_path =
|
const std::string skinmtrl_path =
|
||||||
physis_build_ear_material_path(physis_get_race_code(currentRace, currentSubrace, currentGender), *ear, material_name);
|
physis_build_ear_material_path(physis_get_race_code(currentRace, currentSubrace, currentGender), *ear, material_name);
|
||||||
|
|
|
@ -36,13 +36,13 @@ MainWindow::MainWindow(GameData *in_data)
|
||||||
|
|
||||||
auto gearListWidget = new GearListWidget(&data);
|
auto gearListWidget = new GearListWidget(&data);
|
||||||
gearListWidget->setMaximumWidth(350);
|
gearListWidget->setMaximumWidth(350);
|
||||||
connect(gearListWidget, &GearListWidget::gearSelected, this, [=](const GearInfo &gear) {
|
connect(gearListWidget, &GearListWidget::gearSelected, this, [this](const GearInfo &gear) {
|
||||||
gearView->setGear(gear);
|
gearView->setGear(gear);
|
||||||
});
|
});
|
||||||
layout->addWidget(gearListWidget);
|
layout->addWidget(gearListWidget);
|
||||||
|
|
||||||
gearView = new SingleGearView(&data, cache);
|
gearView = new SingleGearView(&data, cache);
|
||||||
connect(gearView, &SingleGearView::addToFullModelViewer, this, [=](GearInfo &info) {
|
connect(gearView, &SingleGearView::addToFullModelViewer, this, [this](GearInfo &info) {
|
||||||
fullModelViewer->addGear(info);
|
fullModelViewer->addGear(info);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -51,7 +51,7 @@ MainWindow::MainWindow(GameData *in_data)
|
||||||
layout->addWidget(tabWidget);
|
layout->addWidget(tabWidget);
|
||||||
|
|
||||||
fullModelViewer = new FullModelViewer(&data, cache);
|
fullModelViewer = new FullModelViewer(&data, cache);
|
||||||
connect(fullModelViewer, &FullModelViewer::loadingChanged, this, [=](const bool loading) {
|
connect(fullModelViewer, &FullModelViewer::loadingChanged, this, [this](const bool loading) {
|
||||||
gearView->setFMVAvailable(!loading);
|
gearView->setFMVAvailable(!loading);
|
||||||
});
|
});
|
||||||
fullModelViewer->show();
|
fullModelViewer->show();
|
||||||
|
|
|
@ -30,7 +30,7 @@ SettingsWindow::SettingsWindow(QWidget *parent)
|
||||||
outputBoxLayout->setContentsMargins(0, 0, 0, 0);
|
outputBoxLayout->setContentsMargins(0, 0, 0, 0);
|
||||||
|
|
||||||
KConfig config(QStringLiteral("novusrc"));
|
KConfig config(QStringLiteral("novusrc"));
|
||||||
KConfigGroup game = config.group("Armoury");
|
KConfigGroup game = config.group(QStringLiteral("Armoury"));
|
||||||
|
|
||||||
m_outputLineEdit = new QLineEdit();
|
m_outputLineEdit = new QLineEdit();
|
||||||
m_outputLineEdit->setText(game.readEntry("PenumbraOutputDirectory"));
|
m_outputLineEdit->setText(game.readEntry("PenumbraOutputDirectory"));
|
||||||
|
@ -67,6 +67,6 @@ SettingsWindow::SettingsWindow(QWidget *parent)
|
||||||
void SettingsWindow::applySettings()
|
void SettingsWindow::applySettings()
|
||||||
{
|
{
|
||||||
KConfig config(QStringLiteral("novusrc"));
|
KConfig config(QStringLiteral("novusrc"));
|
||||||
KConfigGroup game = config.group("Armoury");
|
KConfigGroup game = config.group(QStringLiteral("Armoury"));
|
||||||
game.writeEntry("PenumbraOutputDirectory", m_outputLineEdit->text());
|
game.writeEntry("PenumbraOutputDirectory", m_outputLineEdit->text());
|
||||||
}
|
}
|
||||||
|
|
|
@ -134,16 +134,16 @@ SingleGearView::SingleGearView(GameData *data, FileCache &cache, QWidget *parent
|
||||||
Q_EMIT gotMDLPath();
|
Q_EMIT gotMDLPath();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
connect(this, &SingleGearView::raceChanged, this, [=] {
|
connect(this, &SingleGearView::raceChanged, this, [this] {
|
||||||
gearView->setRace(currentRace);
|
gearView->setRace(currentRace);
|
||||||
});
|
});
|
||||||
connect(this, &SingleGearView::subraceChanged, this, [=] {
|
connect(this, &SingleGearView::subraceChanged, this, [this] {
|
||||||
gearView->setSubrace(currentSubrace);
|
gearView->setSubrace(currentSubrace);
|
||||||
});
|
});
|
||||||
connect(this, &SingleGearView::genderChanged, this, [=] {
|
connect(this, &SingleGearView::genderChanged, this, [this] {
|
||||||
gearView->setGender(currentGender);
|
gearView->setGender(currentGender);
|
||||||
});
|
});
|
||||||
connect(this, &SingleGearView::levelOfDetailChanged, this, [=] {
|
connect(this, &SingleGearView::levelOfDetailChanged, this, [this] {
|
||||||
gearView->setLevelOfDetail(currentLod);
|
gearView->setLevelOfDetail(currentLod);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -324,8 +324,8 @@ void SingleGearView::importModel(const QString &filename)
|
||||||
gearView->part().reloadModel(0);
|
gearView->part().reloadModel(0);
|
||||||
|
|
||||||
KConfig config(QStringLiteral("novusrc"));
|
KConfig config(QStringLiteral("novusrc"));
|
||||||
KConfigGroup game = config.group("Armoury");
|
KConfigGroup game = config.group(QStringLiteral("Armoury"));
|
||||||
QString outputDirectory = game.readEntry("PenumbraOutputDirectory");
|
QString outputDirectory = game.readEntry(QStringLiteral("PenumbraOutputDirectory"));
|
||||||
|
|
||||||
auto buffer = physis_mdl_write(&mdl.model);
|
auto buffer = physis_mdl_write(&mdl.model);
|
||||||
QFile file(QStringLiteral("%1/%2").arg(outputDirectory, gearView->getLoadedGearPath()));
|
QFile file(QStringLiteral("%1/%2").arg(outputDirectory, gearView->getLoadedGearPath()));
|
||||||
|
|
|
@ -15,8 +15,11 @@ protected:
|
||||||
|
|
||||||
virtual void setupFileMenu(QMenu *menu)
|
virtual void setupFileMenu(QMenu *menu)
|
||||||
{
|
{
|
||||||
|
Q_UNUSED(menu)
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void setupAdditionalMenus(QMenuBar *menuBar)
|
virtual void setupAdditionalMenus(QMenuBar *menuBar)
|
||||||
{
|
{
|
||||||
|
Q_UNUSED(menuBar)
|
||||||
}
|
}
|
||||||
};
|
};
|
1
extern/CMakeLists.txt
vendored
1
extern/CMakeLists.txt
vendored
|
@ -2,6 +2,7 @@
|
||||||
# SPDX-License-Identifier: CC0-1.0
|
# SPDX-License-Identifier: CC0-1.0
|
||||||
|
|
||||||
set(BUILD_SHARED_LIBS OFF)
|
set(BUILD_SHARED_LIBS OFF)
|
||||||
|
add_compile_options(-w)
|
||||||
|
|
||||||
find_package(Corrosion REQUIRED)
|
find_package(Corrosion REQUIRED)
|
||||||
|
|
||||||
|
|
2
extern/dxbc
vendored
2
extern/dxbc
vendored
|
@ -1 +1 @@
|
||||||
Subproject commit 9db12735951da73adb2818c492ce70c80b663f75
|
Subproject commit 907b70249bcc4c0889778b0c47902ef359afacc0
|
|
@ -33,7 +33,7 @@ MainWindow::MainWindow(GameData *data)
|
||||||
auto listWidget = new QListWidget();
|
auto listWidget = new QListWidget();
|
||||||
|
|
||||||
auto names = physis_gamedata_get_all_sheet_names(data);
|
auto names = physis_gamedata_get_all_sheet_names(data);
|
||||||
for (int i = 0; i < names.name_count; i++) {
|
for (uint32_t i = 0; i < names.name_count; i++) {
|
||||||
listWidget->addItem(QString::fromStdString(names.names[i]));
|
listWidget->addItem(QString::fromStdString(names.names[i]));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -51,7 +51,7 @@ MainWindow::MainWindow()
|
||||||
auto formLayout = new QFormLayout();
|
auto formLayout = new QFormLayout();
|
||||||
|
|
||||||
KConfig config(QStringLiteral("novusrc"));
|
KConfig config(QStringLiteral("novusrc"));
|
||||||
KConfigGroup game = config.group("Game");
|
KConfigGroup game = config.group(QStringLiteral("Game"));
|
||||||
|
|
||||||
auto gameCombo = new QComboBox();
|
auto gameCombo = new QComboBox();
|
||||||
formLayout->addRow(QStringLiteral("Current Game"), gameCombo);
|
formLayout->addRow(QStringLiteral("Current Game"), gameCombo);
|
||||||
|
|
|
@ -42,7 +42,7 @@ void MainWindow::setupFileMenu(QMenu *menu)
|
||||||
{
|
{
|
||||||
auto openMDLFile = menu->addAction(QStringLiteral("Open MDL..."));
|
auto openMDLFile = menu->addAction(QStringLiteral("Open MDL..."));
|
||||||
openMDLFile->setIcon(QIcon::fromTheme(QStringLiteral("document-open")));
|
openMDLFile->setIcon(QIcon::fromTheme(QStringLiteral("document-open")));
|
||||||
connect(openMDLFile, &QAction::triggered, [=] {
|
connect(openMDLFile, &QAction::triggered, [this] {
|
||||||
auto fileName = QFileDialog::getOpenFileName(nullptr, QStringLiteral("Open MDL File"), QStringLiteral("~"), QStringLiteral("FFXIV Model File (*.mdl)"));
|
auto fileName = QFileDialog::getOpenFileName(nullptr, QStringLiteral("Open MDL File"), QStringLiteral("~"), QStringLiteral("FFXIV Model File (*.mdl)"));
|
||||||
|
|
||||||
auto buffer = physis_read_file(fileName.toStdString().c_str());
|
auto buffer = physis_read_file(fileName.toStdString().c_str());
|
||||||
|
|
|
@ -58,6 +58,7 @@ void CmpPart::load(physis_Buffer file)
|
||||||
raceListWidget->expandAll();
|
raceListWidget->expandAll();
|
||||||
|
|
||||||
connect(raceListWidget, &QTreeWidget::itemClicked, [this](QTreeWidgetItem *item, int column) {
|
connect(raceListWidget, &QTreeWidget::itemClicked, [this](QTreeWidgetItem *item, int column) {
|
||||||
|
Q_UNUSED(column)
|
||||||
if (auto treeData = qvariant_cast<RaceTreeData *>(item->data(0, Qt::UserRole))) {
|
if (auto treeData = qvariant_cast<RaceTreeData *>(item->data(0, Qt::UserRole))) {
|
||||||
loadRaceData(treeData->race, treeData->subrace);
|
loadRaceData(treeData->race, treeData->subrace);
|
||||||
}
|
}
|
||||||
|
|
|
@ -75,7 +75,7 @@ void EXDPart::loadSheet(const QString &name, physis_Buffer buffer)
|
||||||
headerFormLayout->addRow(QStringLiteral("Num Pages"), new QLabel(QString::number(exh->page_count)));
|
headerFormLayout->addRow(QStringLiteral("Num Pages"), new QLabel(QString::number(exh->page_count)));
|
||||||
headerFormLayout->addRow(QStringLiteral("Num Languages"), new QLabel(QString::number(exh->language_count)));
|
headerFormLayout->addRow(QStringLiteral("Num Languages"), new QLabel(QString::number(exh->language_count)));
|
||||||
|
|
||||||
for (int i = 0; i < exh->page_count; i++) {
|
for (uint32_t i = 0; i < exh->page_count; i++) {
|
||||||
auto tableWidget = new QTableWidget();
|
auto tableWidget = new QTableWidget();
|
||||||
|
|
||||||
tableWidget->setColumnCount(exh->column_count);
|
tableWidget->setColumnCount(exh->column_count);
|
||||||
|
@ -85,7 +85,7 @@ void EXDPart::loadSheet(const QString &name, physis_Buffer buffer)
|
||||||
|
|
||||||
tableWidget->setRowCount(exd.row_count);
|
tableWidget->setRowCount(exd.row_count);
|
||||||
|
|
||||||
for (int z = 0; z < exd.column_count; z++) {
|
for (unsigned int z = 0; z < exd.column_count; z++) {
|
||||||
auto columnData = exd.row_data[0].column_data[z];
|
auto columnData = exd.row_data[0].column_data[z];
|
||||||
|
|
||||||
QString columnType;
|
QString columnType;
|
||||||
|
@ -125,7 +125,7 @@ void EXDPart::loadSheet(const QString &name, physis_Buffer buffer)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (definitionList.contains(z)) {
|
if (definitionList.contains(static_cast<int>(z))) {
|
||||||
columnType = definitionList[z].toObject()[QLatin1String("name")].toString();
|
columnType = definitionList[z].toObject()[QLatin1String("name")].toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -135,8 +135,8 @@ void EXDPart::loadSheet(const QString &name, physis_Buffer buffer)
|
||||||
tableWidget->setHorizontalHeaderItem(z, headerItem);
|
tableWidget->setHorizontalHeaderItem(z, headerItem);
|
||||||
}
|
}
|
||||||
|
|
||||||
for (int j = 0; j < exd.row_count; j++) {
|
for (unsigned int j = 0; j < exd.row_count; j++) {
|
||||||
for (int z = 0; z < exd.column_count; z++) {
|
for (unsigned int z = 0; z < exd.column_count; z++) {
|
||||||
auto columnData = exd.row_data[j].column_data[z];
|
auto columnData = exd.row_data[j].column_data[z];
|
||||||
|
|
||||||
QString columnString;
|
QString columnString;
|
||||||
|
@ -185,7 +185,7 @@ void EXDPart::loadSheet(const QString &name, physis_Buffer buffer)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (definitionList.contains(z)) {
|
if (definitionList.contains(static_cast<int>(z))) {
|
||||||
auto definition = definitionList[z].toObject();
|
auto definition = definitionList[z].toObject();
|
||||||
if (definition.contains(QLatin1String("converter"))
|
if (definition.contains(QLatin1String("converter"))
|
||||||
&& definition[QLatin1String("converter")].toObject()[QLatin1String("type")].toString() == QLatin1String("link")) {
|
&& definition[QLatin1String("converter")].toObject()[QLatin1String("type")].toString() == QLatin1String("link")) {
|
||||||
|
@ -193,7 +193,7 @@ void EXDPart::loadSheet(const QString &name, physis_Buffer buffer)
|
||||||
|
|
||||||
if (cachedExcelSheets.contains(linkName)) {
|
if (cachedExcelSheets.contains(linkName)) {
|
||||||
auto cachedExcel = cachedExcelSheets[linkName];
|
auto cachedExcel = cachedExcelSheets[linkName];
|
||||||
if (columnRow < cachedExcel.exd.row_count) {
|
if (static_cast<unsigned int>(columnRow) < cachedExcel.exd.row_count) {
|
||||||
columnString = QString::fromStdString(cachedExcel.exd.row_data[columnRow].column_data->string._0);
|
columnString = QString::fromStdString(cachedExcel.exd.row_data[columnRow].column_data->string._0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -214,7 +214,7 @@ void EXDPart::loadSheet(const QString &name, physis_Buffer buffer)
|
||||||
|
|
||||||
Language EXDPart::getSuitableLanguage(physis_EXH *pExh)
|
Language EXDPart::getSuitableLanguage(physis_EXH *pExh)
|
||||||
{
|
{
|
||||||
for (int i = 0; i < pExh->language_count; i++) {
|
for (uint32_t i = 0; i < pExh->language_count; i++) {
|
||||||
if (pExh->languages[i] == Language::English) {
|
if (pExh->languages[i] == Language::English) {
|
||||||
return Language::English;
|
return Language::English;
|
||||||
}
|
}
|
||||||
|
|
|
@ -24,7 +24,7 @@ void QHexBuffer::replace(qint64 offset, const QByteArray &data)
|
||||||
this->insert(offset, data);
|
this->insert(offset, data);
|
||||||
}
|
}
|
||||||
|
|
||||||
void QHexBuffer::read(char *data, int size)
|
void QHexBuffer::readRaw(char *data, int size)
|
||||||
{
|
{
|
||||||
QBuffer *buffer = new QBuffer(this);
|
QBuffer *buffer = new QBuffer(this);
|
||||||
buffer->setData(data, size);
|
buffer->setData(data, size);
|
||||||
|
@ -32,10 +32,10 @@ void QHexBuffer::read(char *data, int size)
|
||||||
if (!buffer->isOpen())
|
if (!buffer->isOpen())
|
||||||
buffer->open(QBuffer::ReadWrite);
|
buffer->open(QBuffer::ReadWrite);
|
||||||
|
|
||||||
this->read(buffer);
|
this->readDevice(buffer);
|
||||||
}
|
}
|
||||||
|
|
||||||
void QHexBuffer::read(const QByteArray &ba)
|
void QHexBuffer::readArray(const QByteArray &ba)
|
||||||
{
|
{
|
||||||
QBuffer *buffer = new QBuffer(this);
|
QBuffer *buffer = new QBuffer(this);
|
||||||
|
|
||||||
|
@ -43,7 +43,7 @@ void QHexBuffer::read(const QByteArray &ba)
|
||||||
if (!buffer->isOpen())
|
if (!buffer->isOpen())
|
||||||
buffer->open(QBuffer::ReadWrite);
|
buffer->open(QBuffer::ReadWrite);
|
||||||
|
|
||||||
this->read(buffer);
|
this->readDevice(buffer);
|
||||||
}
|
}
|
||||||
|
|
||||||
#include "moc_qhexbuffer.cpp"
|
#include "moc_qhexbuffer.cpp"
|
||||||
|
|
|
@ -17,16 +17,16 @@ public:
|
||||||
public:
|
public:
|
||||||
virtual uchar at(qint64 idx);
|
virtual uchar at(qint64 idx);
|
||||||
virtual void replace(qint64 offset, const QByteArray &data);
|
virtual void replace(qint64 offset, const QByteArray &data);
|
||||||
virtual void read(char *data, int size);
|
virtual void readRaw(char *data, int size);
|
||||||
virtual void read(const QByteArray &ba);
|
virtual void readArray(const QByteArray &ba);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
virtual qint64 length() const = 0;
|
virtual qint64 length() const = 0;
|
||||||
virtual void insert(qint64 offset, const QByteArray &data) = 0;
|
virtual void insert(qint64 offset, const QByteArray &data) = 0;
|
||||||
virtual void remove(qint64 offset, int length) = 0;
|
virtual void remove(qint64 offset, int length) = 0;
|
||||||
virtual QByteArray read(qint64 offset, int length) = 0;
|
virtual QByteArray read(qint64 offset, int length) = 0;
|
||||||
virtual bool read(QIODevice *iodevice) = 0;
|
virtual bool readDevice(QIODevice *iodevice) = 0;
|
||||||
virtual void write(QIODevice *iodevice) = 0;
|
virtual void writeDevice(QIODevice *iodevice) = 0;
|
||||||
|
|
||||||
virtual qint64 indexOf(const QByteArray &ba, qint64 from) = 0;
|
virtual qint64 indexOf(const QByteArray &ba, qint64 from) = 0;
|
||||||
virtual qint64 lastIndexOf(const QByteArray &ba, qint64 from) = 0;
|
virtual qint64 lastIndexOf(const QByteArray &ba, qint64 from) = 0;
|
||||||
|
|
|
@ -28,12 +28,12 @@ QByteArray QMemoryBuffer::read(qint64 offset, int length)
|
||||||
return m_buffer.mid(static_cast<int>(offset), length);
|
return m_buffer.mid(static_cast<int>(offset), length);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool QMemoryBuffer::read(QIODevice *device)
|
bool QMemoryBuffer::readDevice(QIODevice *device)
|
||||||
{
|
{
|
||||||
m_buffer = device->readAll();
|
m_buffer = device->readAll();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
void QMemoryBuffer::write(QIODevice *device)
|
void QMemoryBuffer::writeDevice(QIODevice *device)
|
||||||
{
|
{
|
||||||
device->write(m_buffer);
|
device->write(m_buffer);
|
||||||
}
|
}
|
||||||
|
|
|
@ -16,8 +16,8 @@ public:
|
||||||
void insert(qint64 offset, const QByteArray &data) override;
|
void insert(qint64 offset, const QByteArray &data) override;
|
||||||
void remove(qint64 offset, int length) override;
|
void remove(qint64 offset, int length) override;
|
||||||
QByteArray read(qint64 offset, int length) override;
|
QByteArray read(qint64 offset, int length) override;
|
||||||
bool read(QIODevice *device) override;
|
bool readDevice(QIODevice *device) override;
|
||||||
void write(QIODevice *device) override;
|
void writeDevice(QIODevice *device) override;
|
||||||
|
|
||||||
qint64 indexOf(const QByteArray &ba, qint64 from) override;
|
qint64 indexOf(const QByteArray &ba, qint64 from) override;
|
||||||
qint64 lastIndexOf(const QByteArray &ba, qint64 from) override;
|
qint64 lastIndexOf(const QByteArray &ba, qint64 from) override;
|
||||||
|
|
|
@ -33,7 +33,7 @@ QByteArray QMemoryRefBuffer::read(qint64 offset, int length)
|
||||||
return m_buffer->read(length);
|
return m_buffer->read(length);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool QMemoryRefBuffer::read(QIODevice *device)
|
bool QMemoryRefBuffer::readDevice(QIODevice *device)
|
||||||
{
|
{
|
||||||
m_buffer = qobject_cast<QBuffer *>(device);
|
m_buffer = qobject_cast<QBuffer *>(device);
|
||||||
if (m_buffer) {
|
if (m_buffer) {
|
||||||
|
@ -43,7 +43,7 @@ bool QMemoryRefBuffer::read(QIODevice *device)
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
void QMemoryRefBuffer::write(QIODevice *device)
|
void QMemoryRefBuffer::writeDevice(QIODevice *device)
|
||||||
{
|
{
|
||||||
m_buffer->seek(0);
|
m_buffer->seek(0);
|
||||||
if (m_buffer->size() < INT_MAX) {
|
if (m_buffer->size() < INT_MAX) {
|
||||||
|
|
|
@ -16,8 +16,8 @@ public:
|
||||||
void insert(qint64 offset, const QByteArray &data) override;
|
void insert(qint64 offset, const QByteArray &data) override;
|
||||||
void remove(qint64 offset, int length) override;
|
void remove(qint64 offset, int length) override;
|
||||||
QByteArray read(qint64 offset, int length) override;
|
QByteArray read(qint64 offset, int length) override;
|
||||||
bool read(QIODevice *device) override;
|
bool readDevice(QIODevice *device) override;
|
||||||
void write(QIODevice *device) override;
|
void writeDevice(QIODevice *device) override;
|
||||||
|
|
||||||
qint64 indexOf(const QByteArray &ba, qint64 from) override;
|
qint64 indexOf(const QByteArray &ba, qint64 from) override;
|
||||||
qint64 lastIndexOf(const QByteArray &ba, qint64 from) override;
|
qint64 lastIndexOf(const QByteArray &ba, qint64 from) override;
|
||||||
|
|
|
@ -186,16 +186,22 @@ void QHexDocument::replace(qint64 offset, uchar b)
|
||||||
|
|
||||||
void QHexDocument::insert(qint64 offset, const QByteArray &data)
|
void QHexDocument::insert(qint64 offset, const QByteArray &data)
|
||||||
{
|
{
|
||||||
|
Q_UNUSED(offset)
|
||||||
|
Q_UNUSED(data)
|
||||||
Q_EMIT documentChanged();
|
Q_EMIT documentChanged();
|
||||||
}
|
}
|
||||||
|
|
||||||
void QHexDocument::replace(qint64 offset, const QByteArray &data)
|
void QHexDocument::replace(qint64 offset, const QByteArray &data)
|
||||||
{
|
{
|
||||||
|
Q_UNUSED(offset)
|
||||||
|
Q_UNUSED(data)
|
||||||
Q_EMIT documentChanged();
|
Q_EMIT documentChanged();
|
||||||
}
|
}
|
||||||
|
|
||||||
void QHexDocument::remove(qint64 offset, int len)
|
void QHexDocument::remove(qint64 offset, int len)
|
||||||
{
|
{
|
||||||
|
Q_UNUSED(offset)
|
||||||
|
Q_UNUSED(len)
|
||||||
Q_EMIT documentChanged();
|
Q_EMIT documentChanged();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -209,7 +215,7 @@ bool QHexDocument::saveTo(QIODevice *device)
|
||||||
if (!device->isWritable())
|
if (!device->isWritable())
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
m_buffer->write(device);
|
m_buffer->writeDevice(device);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -92,7 +92,7 @@ QHexDocument *QHexDocument::fromDevice(QIODevice *iodevice, QObject *parent)
|
||||||
}
|
}
|
||||||
|
|
||||||
QHexBuffer *hexbuffer = new T();
|
QHexBuffer *hexbuffer = new T();
|
||||||
if (hexbuffer->read(iodevice)) {
|
if (hexbuffer->readDevice(iodevice)) {
|
||||||
if (needsclose)
|
if (needsclose)
|
||||||
iodevice->close();
|
iodevice->close();
|
||||||
|
|
||||||
|
@ -119,7 +119,7 @@ template<typename T>
|
||||||
QHexDocument *QHexDocument::fromMemory(char *data, int size, QObject *parent)
|
QHexDocument *QHexDocument::fromMemory(char *data, int size, QObject *parent)
|
||||||
{
|
{
|
||||||
QHexBuffer *hexbuffer = new T();
|
QHexBuffer *hexbuffer = new T();
|
||||||
hexbuffer->read(data, size);
|
hexbuffer->readRaw(data, size);
|
||||||
return new QHexDocument(hexbuffer, parent);
|
return new QHexDocument(hexbuffer, parent);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -127,6 +127,6 @@ template<typename T>
|
||||||
QHexDocument *QHexDocument::fromMemory(const QByteArray &ba, QObject *parent)
|
QHexDocument *QHexDocument::fromMemory(const QByteArray &ba, QObject *parent)
|
||||||
{
|
{
|
||||||
QHexBuffer *hexbuffer = new T();
|
QHexBuffer *hexbuffer = new T();
|
||||||
hexbuffer->read(ba);
|
hexbuffer->readArray(ba);
|
||||||
return new QHexDocument(hexbuffer, parent);
|
return new QHexDocument(hexbuffer, parent);
|
||||||
}
|
}
|
||||||
|
|
|
@ -19,16 +19,16 @@ public:
|
||||||
void setReadOnly(bool b);
|
void setReadOnly(bool b);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual bool event(QEvent *e);
|
bool event(QEvent *e) override;
|
||||||
virtual void keyPressEvent(QKeyEvent *e);
|
void keyPressEvent(QKeyEvent *e) override;
|
||||||
virtual void mousePressEvent(QMouseEvent *e);
|
void mousePressEvent(QMouseEvent *e) override;
|
||||||
virtual void mouseMoveEvent(QMouseEvent *e);
|
void mouseMoveEvent(QMouseEvent *e) override;
|
||||||
virtual void mouseReleaseEvent(QMouseEvent *e);
|
void mouseReleaseEvent(QMouseEvent *e) override;
|
||||||
virtual void focusInEvent(QFocusEvent *e);
|
void focusInEvent(QFocusEvent *e) override;
|
||||||
virtual void focusOutEvent(QFocusEvent *e);
|
void focusOutEvent(QFocusEvent *e) override;
|
||||||
virtual void wheelEvent(QWheelEvent *e);
|
void wheelEvent(QWheelEvent *e) override;
|
||||||
virtual void resizeEvent(QResizeEvent *e);
|
void resizeEvent(QResizeEvent *e) override;
|
||||||
virtual void paintEvent(QPaintEvent *e);
|
void paintEvent(QPaintEvent *e) override;
|
||||||
|
|
||||||
private Q_SLOTS:
|
private Q_SLOTS:
|
||||||
void renderCurrentLine();
|
void renderCurrentLine();
|
||||||
|
|
|
@ -21,12 +21,12 @@ void exportModel(const QString &name, const physis_MDL &model, const physis_Skel
|
||||||
auto &gltfSkeletonNode = gltfModel.nodes.emplace_back();
|
auto &gltfSkeletonNode = gltfModel.nodes.emplace_back();
|
||||||
gltfSkeletonNode.name = skeleton.root_bone->name;
|
gltfSkeletonNode.name = skeleton.root_bone->name;
|
||||||
|
|
||||||
for (int i = 0; i < model.num_affected_bones; i++) {
|
for (uint32_t i = 0; i < model.num_affected_bones; i++) {
|
||||||
auto &node = gltfModel.nodes.emplace_back();
|
auto &node = gltfModel.nodes.emplace_back();
|
||||||
node.name = model.affected_bone_names[i];
|
node.name = model.affected_bone_names[i];
|
||||||
|
|
||||||
int real_bone_id = 0;
|
int real_bone_id = 0;
|
||||||
for (int k = 0; k < skeleton.num_bones; k++) {
|
for (uint32_t k = 0; k < skeleton.num_bones; k++) {
|
||||||
if (strcmp(skeleton.bones[k].name, model.affected_bone_names[i]) == 0) {
|
if (strcmp(skeleton.bones[k].name, model.affected_bone_names[i]) == 0) {
|
||||||
real_bone_id = k;
|
real_bone_id = k;
|
||||||
}
|
}
|
||||||
|
@ -39,9 +39,9 @@ void exportModel(const QString &name, const physis_MDL &model, const physis_Skel
|
||||||
}
|
}
|
||||||
|
|
||||||
// setup parenting
|
// setup parenting
|
||||||
for (int i = 0; i < model.num_affected_bones; i++) {
|
for (uint32_t i = 0; i < model.num_affected_bones; i++) {
|
||||||
int real_bone_id = 0;
|
int real_bone_id = 0;
|
||||||
for (int k = 0; k < skeleton.num_bones; k++) {
|
for (uint32_t k = 0; k < skeleton.num_bones; k++) {
|
||||||
if (strcmp(skeleton.bones[k].name, model.affected_bone_names[i]) == 0) {
|
if (strcmp(skeleton.bones[k].name, model.affected_bone_names[i]) == 0) {
|
||||||
real_bone_id = k;
|
real_bone_id = k;
|
||||||
}
|
}
|
||||||
|
@ -50,7 +50,7 @@ void exportModel(const QString &name, const physis_MDL &model, const physis_Skel
|
||||||
auto &real_bone = skeleton.bones[real_bone_id];
|
auto &real_bone = skeleton.bones[real_bone_id];
|
||||||
if (real_bone.parent_bone != nullptr) {
|
if (real_bone.parent_bone != nullptr) {
|
||||||
bool found = false;
|
bool found = false;
|
||||||
for (int k = 0; k < model.num_affected_bones; k++) {
|
for (uint32_t k = 0; k < model.num_affected_bones; k++) {
|
||||||
if (strcmp(model.affected_bone_names[k], real_bone.parent_bone->name) == 0) {
|
if (strcmp(model.affected_bone_names[k], real_bone.parent_bone->name) == 0) {
|
||||||
gltfModel.nodes[k + 1].children.push_back(i + 1); // +1 for the skeleton node taking up the first index
|
gltfModel.nodes[k + 1].children.push_back(i + 1); // +1 for the skeleton node taking up the first index
|
||||||
found = true;
|
found = true;
|
||||||
|
@ -70,7 +70,7 @@ void exportModel(const QString &name, const physis_MDL &model, const physis_Skel
|
||||||
auto &gltfSkin = gltfModel.skins.emplace_back();
|
auto &gltfSkin = gltfModel.skins.emplace_back();
|
||||||
gltfSkin.name = gltfSkeletonNode.name;
|
gltfSkin.name = gltfSkeletonNode.name;
|
||||||
gltfSkin.skeleton = 0;
|
gltfSkin.skeleton = 0;
|
||||||
for (int i = 1; i < gltfModel.nodes.size(); i++) {
|
for (size_t i = 1; i < gltfModel.nodes.size(); i++) {
|
||||||
gltfSkin.joints.push_back(i);
|
gltfSkin.joints.push_back(i);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -88,9 +88,9 @@ void exportModel(const QString &name, const physis_MDL &model, const physis_Skel
|
||||||
inverseBufferView.buffer = gltfModel.buffers.size();
|
inverseBufferView.buffer = gltfModel.buffers.size();
|
||||||
|
|
||||||
auto &inverseBuffer = gltfModel.buffers.emplace_back();
|
auto &inverseBuffer = gltfModel.buffers.emplace_back();
|
||||||
for (int i = 0; i < model.num_affected_bones; i++) {
|
for (uint32_t i = 0; i < model.num_affected_bones; i++) {
|
||||||
int real_bone_id = 0;
|
int real_bone_id = 0;
|
||||||
for (int k = 0; k < skeleton.num_bones; k++) {
|
for (uint32_t k = 0; k < skeleton.num_bones; k++) {
|
||||||
if (strcmp(skeleton.bones[k].name, model.affected_bone_names[i]) == 0) {
|
if (strcmp(skeleton.bones[k].name, model.affected_bone_names[i]) == 0) {
|
||||||
real_bone_id = k;
|
real_bone_id = k;
|
||||||
}
|
}
|
||||||
|
@ -106,7 +106,7 @@ void exportModel(const QString &name, const physis_MDL &model, const physis_Skel
|
||||||
inverseBufferView.byteLength = inverseBuffer.data.size();
|
inverseBufferView.byteLength = inverseBuffer.data.size();
|
||||||
}
|
}
|
||||||
|
|
||||||
for (int i = 0; i < lod.num_parts; i++) {
|
for (uint32_t i = 0; i < lod.num_parts; i++) {
|
||||||
gltfSkeletonNode.children.push_back(gltfModel.nodes.size());
|
gltfSkeletonNode.children.push_back(gltfModel.nodes.size());
|
||||||
|
|
||||||
auto &gltfNode = gltfModel.nodes.emplace_back();
|
auto &gltfNode = gltfModel.nodes.emplace_back();
|
||||||
|
|
|
@ -30,7 +30,6 @@ void importModel(physis_MDL &existingModel, const QString &filename)
|
||||||
qInfo() << "Importing" << node.name;
|
qInfo() << "Importing" << node.name;
|
||||||
|
|
||||||
const QStringList parts = QString::fromStdString(node.name).split(QLatin1Char(' '));
|
const QStringList parts = QString::fromStdString(node.name).split(QLatin1Char(' '));
|
||||||
const QString &name = parts[0];
|
|
||||||
const QStringList lodPartNumber = parts[2].split(QLatin1Char('.'));
|
const QStringList lodPartNumber = parts[2].split(QLatin1Char('.'));
|
||||||
|
|
||||||
// const int lodNumber = lodPartNumber[0].toInt();
|
// const int lodNumber = lodPartNumber[0].toInt();
|
||||||
|
@ -69,7 +68,7 @@ void importModel(physis_MDL &existingModel, const QString &filename)
|
||||||
qInfo() << "- Importing mesh of" << vertexAccessor.count << "vertices and" << indexAccessor.count << "indices.";
|
qInfo() << "- Importing mesh of" << vertexAccessor.count << "vertices and" << indexAccessor.count << "indices.";
|
||||||
|
|
||||||
std::vector<Vertex> newVertices;
|
std::vector<Vertex> newVertices;
|
||||||
for (int i = 0; i < vertexAccessor.count; i++) {
|
for (uint32_t i = 0; i < vertexAccessor.count; i++) {
|
||||||
auto vertexData = (glm::vec3 *)(vertexBuffer.data.data() + (std::max(vertexView.byteStride, sizeof(float) * 3) * i) + vertexView.byteOffset
|
auto vertexData = (glm::vec3 *)(vertexBuffer.data.data() + (std::max(vertexView.byteStride, sizeof(float) * 3) * i) + vertexView.byteOffset
|
||||||
+ vertexAccessor.byteOffset);
|
+ vertexAccessor.byteOffset);
|
||||||
|
|
||||||
|
|
|
@ -140,8 +140,8 @@ void MDLPart::reloadBoneData()
|
||||||
for (auto &model : models) {
|
for (auto &model : models) {
|
||||||
// we want to map the actual affected bones to bone ids
|
// we want to map the actual affected bones to bone ids
|
||||||
std::map<int, int> boneMapping;
|
std::map<int, int> boneMapping;
|
||||||
for (int i = 0; i < model.model.num_affected_bones; i++) {
|
for (uint32_t i = 0; i < model.model.num_affected_bones; i++) {
|
||||||
for (int k = 0; k < skeleton->num_bones; k++) {
|
for (uint32_t k = 0; k < skeleton->num_bones; k++) {
|
||||||
if (std::string_view{skeleton->bones[k].name} == std::string_view{model.model.affected_bone_names[i]}) {
|
if (std::string_view{skeleton->bones[k].name} == std::string_view{model.model.affected_bone_names[i]}) {
|
||||||
boneMapping[i] = k;
|
boneMapping[i] = k;
|
||||||
}
|
}
|
||||||
|
@ -149,7 +149,7 @@ void MDLPart::reloadBoneData()
|
||||||
}
|
}
|
||||||
|
|
||||||
std::vector<glm::mat4> deformBones(model.model.num_affected_bones);
|
std::vector<glm::mat4> deformBones(model.model.num_affected_bones);
|
||||||
for (int i = 0; i < model.model.num_affected_bones; i++) {
|
for (uint32_t i = 0; i < model.model.num_affected_bones; i++) {
|
||||||
deformBones[i] = glm::mat4(1.0f);
|
deformBones[i] = glm::mat4(1.0f);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -159,7 +159,7 @@ void MDLPart::reloadBoneData()
|
||||||
for (int i = 0; i < deform.num_bones; i++) {
|
for (int i = 0; i < deform.num_bones; i++) {
|
||||||
auto deformBone = deform.bones[i];
|
auto deformBone = deform.bones[i];
|
||||||
|
|
||||||
for (int k = 0; k < model.model.num_affected_bones; k++) {
|
for (uint32_t k = 0; k < model.model.num_affected_bones; k++) {
|
||||||
if (std::string_view{model.model.affected_bone_names[k]} == std::string_view{deformBone.name}) {
|
if (std::string_view{model.model.affected_bone_names[k]} == std::string_view{deformBone.name}) {
|
||||||
deformBones[k] = glm::mat4{deformBone.deform[0],
|
deformBones[k] = glm::mat4{deformBone.deform[0],
|
||||||
deformBone.deform[1],
|
deformBone.deform[1],
|
||||||
|
@ -182,7 +182,7 @@ void MDLPart::reloadBoneData()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
for (int i = 0; i < model.model.num_affected_bones; i++) {
|
for (uint32_t i = 0; i < model.model.num_affected_bones; i++) {
|
||||||
const int originalBoneId = boneMapping[i];
|
const int originalBoneId = boneMapping[i];
|
||||||
model.boneData[i] = boneData[originalBoneId].localTransform * deformBones[i] * boneData[originalBoneId].inversePose;
|
model.boneData[i] = boneData[originalBoneId].localTransform * deformBones[i] * boneData[originalBoneId].inversePose;
|
||||||
}
|
}
|
||||||
|
@ -194,7 +194,7 @@ RenderMaterial MDLPart::createMaterial(const physis_Material &material)
|
||||||
{
|
{
|
||||||
RenderMaterial newMaterial;
|
RenderMaterial newMaterial;
|
||||||
|
|
||||||
for (int i = 0; i < material.num_textures; i++) {
|
for (uint32_t i = 0; i < material.num_textures; i++) {
|
||||||
std::string t = material.textures[i];
|
std::string t = material.textures[i];
|
||||||
|
|
||||||
if (t.find("skin") != std::string::npos) {
|
if (t.find("skin") != std::string::npos) {
|
||||||
|
@ -209,7 +209,7 @@ RenderMaterial MDLPart::createMaterial(const physis_Material &material)
|
||||||
auto tex = renderer->addTexture(texture.width, texture.height, texture.rgba, texture.rgba_size);
|
auto tex = renderer->addTexture(texture.width, texture.height, texture.rgba, texture.rgba_size);
|
||||||
|
|
||||||
newMaterial.multiTexture = new RenderTexture(tex);
|
newMaterial.multiTexture = new RenderTexture(tex);
|
||||||
}
|
} break;
|
||||||
case 'd': {
|
case 'd': {
|
||||||
auto texture = physis_texture_parse(cache.lookupFile(QLatin1String(material.textures[i])));
|
auto texture = physis_texture_parse(cache.lookupFile(QLatin1String(material.textures[i])));
|
||||||
auto tex = renderer->addTexture(texture.width, texture.height, texture.rgba, texture.rgba_size);
|
auto tex = renderer->addTexture(texture.width, texture.height, texture.rgba, texture.rgba_size);
|
||||||
|
@ -248,7 +248,7 @@ void MDLPart::calculateBoneInversePose(physis_Skeleton &skeleton, physis_Bone &b
|
||||||
|
|
||||||
boneData[bone.index].inversePose = parentMatrix * local;
|
boneData[bone.index].inversePose = parentMatrix * local;
|
||||||
|
|
||||||
for (int i = 0; i < skeleton.num_bones; i++) {
|
for (uint32_t i = 0; i < skeleton.num_bones; i++) {
|
||||||
if (skeleton.bones[i].parent_bone != nullptr && std::string_view{skeleton.bones[i].parent_bone->name} == std::string_view{bone.name}) {
|
if (skeleton.bones[i].parent_bone != nullptr && std::string_view{skeleton.bones[i].parent_bone->name} == std::string_view{bone.name}) {
|
||||||
calculateBoneInversePose(skeleton, skeleton.bones[i], &bone);
|
calculateBoneInversePose(skeleton, skeleton.bones[i], &bone);
|
||||||
}
|
}
|
||||||
|
@ -267,7 +267,7 @@ void MDLPart::calculateBone(physis_Skeleton &skeleton, physis_Bone &bone, const
|
||||||
boneData[bone.index].localTransform = parent_matrix * local;
|
boneData[bone.index].localTransform = parent_matrix * local;
|
||||||
boneData[bone.index].finalTransform = parent_matrix;
|
boneData[bone.index].finalTransform = parent_matrix;
|
||||||
|
|
||||||
for (int i = 0; i < skeleton.num_bones; i++) {
|
for (uint32_t i = 0; i < skeleton.num_bones; i++) {
|
||||||
if (skeleton.bones[i].parent_bone != nullptr && std::string_view{skeleton.bones[i].parent_bone->name} == std::string_view{bone.name}) {
|
if (skeleton.bones[i].parent_bone != nullptr && std::string_view{skeleton.bones[i].parent_bone->name} == std::string_view{bone.name}) {
|
||||||
calculateBone(skeleton, skeleton.bones[i], &bone);
|
calculateBone(skeleton, skeleton.bones[i], &bone);
|
||||||
}
|
}
|
||||||
|
|
|
@ -76,7 +76,7 @@ bool VulkanWindow::event(QEvent *e)
|
||||||
part->cameraDistance * part->pitch,
|
part->cameraDistance * part->pitch,
|
||||||
part->cameraDistance * std::cos(part->yaw));
|
part->cameraDistance * std::cos(part->yaw));
|
||||||
|
|
||||||
const glm::quat rot = glm::quatLookAt((part->position + position) - part->position, {0, 1, 0});
|
// const glm::quat rot = glm::quatLookAt((part->position + position) - part->position, {0, 1, 0});
|
||||||
|
|
||||||
part->position += glm::vec3{0, 1, 0} * (float)deltaY * 0.01f;
|
part->position += glm::vec3{0, 1, 0} * (float)deltaY * 0.01f;
|
||||||
part->position.y = std::clamp(part->position.y, 0.0f, 10.0f);
|
part->position.y = std::clamp(part->position.y, 0.0f, 10.0f);
|
||||||
|
@ -92,6 +92,8 @@ bool VulkanWindow::event(QEvent *e)
|
||||||
part->cameraDistance -= (scrollEvent->angleDelta().y() / 120.0f) * 0.1f; // FIXME: why 120?
|
part->cameraDistance -= (scrollEvent->angleDelta().y() / 120.0f) * 0.1f; // FIXME: why 120?
|
||||||
part->cameraDistance = std::clamp(part->cameraDistance, 1.0f, 4.0f);
|
part->cameraDistance = std::clamp(part->cameraDistance, 1.0f, 4.0f);
|
||||||
} break;
|
} break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
return QWindow::event(e);
|
return QWindow::event(e);
|
||||||
|
|
|
@ -22,7 +22,7 @@ void addItem(physis_Skeleton &skeleton, physis_Bone &bone, QTreeWidget *widget,
|
||||||
parent_item->addChild(item);
|
parent_item->addChild(item);
|
||||||
}
|
}
|
||||||
|
|
||||||
for (int i = 0; i < skeleton.num_bones; i++) {
|
for (uint32_t i = 0; i < skeleton.num_bones; i++) {
|
||||||
if (skeleton.bones[i].parent_bone != nullptr && strcmp(skeleton.bones[i].parent_bone->name, bone.name) == 0)
|
if (skeleton.bones[i].parent_bone != nullptr && strcmp(skeleton.bones[i].parent_bone->name, bone.name) == 0)
|
||||||
addItem(skeleton, skeleton.bones[i], widget, item);
|
addItem(skeleton, skeleton.bones[i], widget, item);
|
||||||
}
|
}
|
||||||
|
@ -74,7 +74,7 @@ SklbPart::SklbPart(QWidget *parent)
|
||||||
|
|
||||||
void SklbPart::treeItemClicked(QTreeWidgetItem *item, int column)
|
void SklbPart::treeItemClicked(QTreeWidgetItem *item, int column)
|
||||||
{
|
{
|
||||||
for (int i = 0; i < skeleton.num_bones; i++) {
|
for (uint32_t i = 0; i < skeleton.num_bones; i++) {
|
||||||
if (strcmp(skeleton.bones[i].name, item->text(column).toStdString().c_str()) == 0) {
|
if (strcmp(skeleton.bones[i].name, item->text(column).toStdString().c_str()) == 0) {
|
||||||
currentPosition = glm::make_vec3(skeleton.bones[i].position);
|
currentPosition = glm::make_vec3(skeleton.bones[i].position);
|
||||||
currentRotation = glm::make_quat(skeleton.bones[i].rotation);
|
currentRotation = glm::make_quat(skeleton.bones[i].rotation);
|
||||||
|
|
|
@ -3,6 +3,7 @@
|
||||||
|
|
||||||
add_library(renderer STATIC)
|
add_library(renderer STATIC)
|
||||||
target_sources(renderer PRIVATE
|
target_sources(renderer PRIVATE
|
||||||
|
include/renderer.hpp
|
||||||
src/renderer.cpp
|
src/renderer.cpp
|
||||||
src/imguipass.cpp
|
src/imguipass.cpp
|
||||||
src/imguipass.h)
|
src/imguipass.h)
|
||||||
|
@ -13,7 +14,7 @@ qt_add_resources(renderer "shaders"
|
||||||
shaders/imgui.vert.spv
|
shaders/imgui.vert.spv
|
||||||
shaders/mesh.frag.spv
|
shaders/mesh.frag.spv
|
||||||
shaders/mesh.vert.spv)
|
shaders/mesh.vert.spv)
|
||||||
target_include_directories(renderer PUBLIC include)
|
target_include_directories(renderer PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/include)
|
||||||
target_link_libraries(renderer PUBLIC
|
target_link_libraries(renderer PUBLIC
|
||||||
Qt6::Core
|
Qt6::Core
|
||||||
Vulkan::Vulkan
|
Vulkan::Vulkan
|
||||||
|
|
|
@ -69,7 +69,7 @@ public:
|
||||||
void resize(VkSurfaceKHR surface, int width, int height);
|
void resize(VkSurfaceKHR surface, int width, int height);
|
||||||
|
|
||||||
RenderModel addModel(const physis_MDL &model, int lod);
|
RenderModel addModel(const physis_MDL &model, int lod);
|
||||||
void reloadModel(RenderModel &model, int lod);
|
void reloadModel(RenderModel &model, uint32_t lod);
|
||||||
RenderTexture addTexture(uint32_t width, uint32_t height, const uint8_t *data, uint32_t data_size);
|
RenderTexture addTexture(uint32_t width, uint32_t height, const uint8_t *data, uint32_t data_size);
|
||||||
|
|
||||||
void render(std::vector<RenderModel> models);
|
void render(std::vector<RenderModel> models);
|
||||||
|
|
|
@ -36,6 +36,10 @@ VKAPI_ATTR VkBool32 VKAPI_CALL DebugCallback(VkDebugUtilsMessageSeverityFlagBits
|
||||||
const VkDebugUtilsMessengerCallbackDataEXT *pCallbackData,
|
const VkDebugUtilsMessengerCallbackDataEXT *pCallbackData,
|
||||||
void *pUserData)
|
void *pUserData)
|
||||||
{
|
{
|
||||||
|
Q_UNUSED(messageSeverity)
|
||||||
|
Q_UNUSED(messageType)
|
||||||
|
Q_UNUSED(pUserData)
|
||||||
|
|
||||||
qInfo() << pCallbackData->pMessage;
|
qInfo() << pCallbackData->pMessage;
|
||||||
|
|
||||||
return VK_FALSE;
|
return VK_FALSE;
|
||||||
|
@ -52,8 +56,6 @@ Renderer::Renderer()
|
||||||
|
|
||||||
ImGui::StyleColorsDark();
|
ImGui::StyleColorsDark();
|
||||||
|
|
||||||
VkApplicationInfo applicationInfo = {};
|
|
||||||
|
|
||||||
std::vector<const char *> instanceExtensions = {"VK_EXT_debug_utils"};
|
std::vector<const char *> instanceExtensions = {"VK_EXT_debug_utils"};
|
||||||
|
|
||||||
uint32_t extensionCount = 0;
|
uint32_t extensionCount = 0;
|
||||||
|
@ -189,8 +191,6 @@ Renderer::Renderer()
|
||||||
deviceCeateInfo.ppEnabledExtensionNames = deviceExtensions.data();
|
deviceCeateInfo.ppEnabledExtensionNames = deviceExtensions.data();
|
||||||
deviceCeateInfo.enabledExtensionCount = static_cast<uint32_t>(deviceExtensions.size());
|
deviceCeateInfo.enabledExtensionCount = static_cast<uint32_t>(deviceExtensions.size());
|
||||||
|
|
||||||
VkPhysicalDeviceFeatures enabledFeatures = {};
|
|
||||||
|
|
||||||
vkCreateDevice(physicalDevice, &deviceCeateInfo, nullptr, &device);
|
vkCreateDevice(physicalDevice, &deviceCeateInfo, nullptr, &device);
|
||||||
|
|
||||||
// get queues
|
// get queues
|
||||||
|
@ -488,7 +488,7 @@ void Renderer::render(std::vector<RenderModel> models)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
for (const auto &part : model.parts) {
|
for (const auto &part : model.parts) {
|
||||||
if (part.materialIndex >= model.materials.size()) {
|
if (static_cast<size_t>(part.materialIndex) >= model.materials.size()) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -643,14 +643,14 @@ RenderModel Renderer::addModel(const physis_MDL &model, int lod)
|
||||||
return renderModel;
|
return renderModel;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Renderer::reloadModel(RenderModel &renderModel, int lod)
|
void Renderer::reloadModel(RenderModel &renderModel, uint32_t lod)
|
||||||
{
|
{
|
||||||
if (lod < 0 || lod > renderModel.model.num_lod)
|
if (lod > renderModel.model.num_lod)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
renderModel.parts.clear();
|
renderModel.parts.clear();
|
||||||
|
|
||||||
for (int i = 0; i < renderModel.model.lods[lod].num_parts; i++) {
|
for (uint32_t i = 0; i < renderModel.model.lods[lod].num_parts; i++) {
|
||||||
RenderPart renderPart;
|
RenderPart renderPart;
|
||||||
|
|
||||||
const physis_Part part = renderModel.model.lods[lod].parts[i];
|
const physis_Part part = renderModel.model.lods[lod].parts[i];
|
||||||
|
@ -1173,6 +1173,8 @@ void Renderer::inlineTransitionImageLayout(VkCommandBuffer commandBuffer,
|
||||||
VkPipelineStageFlags src_stage_mask,
|
VkPipelineStageFlags src_stage_mask,
|
||||||
VkPipelineStageFlags dst_stage_mask)
|
VkPipelineStageFlags dst_stage_mask)
|
||||||
{
|
{
|
||||||
|
Q_UNUSED(format)
|
||||||
|
|
||||||
VkImageMemoryBarrier barrier = {};
|
VkImageMemoryBarrier barrier = {};
|
||||||
barrier.sType = VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER;
|
barrier.sType = VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER;
|
||||||
barrier.oldLayout = oldLayout;
|
barrier.oldLayout = oldLayout;
|
||||||
|
|
|
@ -25,7 +25,7 @@ FileTreeModel::FileTreeModel(bool showUnknown, const QString &gamePath, GameData
|
||||||
if (info.exists() && (info.completeSuffix() == QStringLiteral("win32.index"))) {
|
if (info.exists() && (info.completeSuffix() == QStringLiteral("win32.index"))) {
|
||||||
std::string pathStd = info.filePath().toStdString();
|
std::string pathStd = info.filePath().toStdString();
|
||||||
auto indexEntries = physis_index_parse(pathStd.c_str());
|
auto indexEntries = physis_index_parse(pathStd.c_str());
|
||||||
for (int i = 0; i < indexEntries.num_entries; i++) {
|
for (uint32_t i = 0; i < indexEntries.num_entries; i++) {
|
||||||
if (knownDirHashes.contains(indexEntries.dir_entries[i])) {
|
if (knownDirHashes.contains(indexEntries.dir_entries[i])) {
|
||||||
QString name;
|
QString name;
|
||||||
if (m_database.knowsFile(indexEntries.filename_entries[i])) {
|
if (m_database.knowsFile(indexEntries.filename_entries[i])) {
|
||||||
|
@ -56,6 +56,7 @@ int FileTreeModel::rowCount(const QModelIndex &parent) const
|
||||||
|
|
||||||
int FileTreeModel::columnCount(const QModelIndex &parent) const
|
int FileTreeModel::columnCount(const QModelIndex &parent) const
|
||||||
{
|
{
|
||||||
|
Q_UNUSED(parent)
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -53,7 +53,7 @@ FileTreeWindow::FileTreeWindow(const QString &gamePath, GameData *data, QWidget
|
||||||
auto menu = new QMenu();
|
auto menu = new QMenu();
|
||||||
|
|
||||||
auto extractAction = menu->addAction(QStringLiteral("Extract.."));
|
auto extractAction = menu->addAction(QStringLiteral("Extract.."));
|
||||||
connect(extractAction, &QAction::triggered, this, [=] {
|
connect(extractAction, &QAction::triggered, this, [this, path] {
|
||||||
Q_EMIT extractFile(path);
|
Q_EMIT extractFile(path);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -185,7 +185,7 @@ int main(int argc, char *argv[])
|
||||||
|
|
||||||
auto sheetNames = physis_gamedata_get_all_sheet_names(data);
|
auto sheetNames = physis_gamedata_get_all_sheet_names(data);
|
||||||
|
|
||||||
for (int i = 0; i < sheetNames.name_count; i++) {
|
for (uint32_t i = 0; i < sheetNames.name_count; i++) {
|
||||||
auto sheetName = sheetNames.names[i];
|
auto sheetName = sheetNames.names[i];
|
||||||
auto nameLowercase = QString::fromStdString(sheetName).toLower().toStdString();
|
auto nameLowercase = QString::fromStdString(sheetName).toLower().toStdString();
|
||||||
|
|
||||||
|
@ -195,8 +195,8 @@ int main(int argc, char *argv[])
|
||||||
|
|
||||||
std::string headerNameStd = headerName.toStdString();
|
std::string headerNameStd = headerName.toStdString();
|
||||||
auto exh = physis_parse_excel_sheet_header(physis_gamedata_extract_file(data, headerNameStd.c_str()));
|
auto exh = physis_parse_excel_sheet_header(physis_gamedata_extract_file(data, headerNameStd.c_str()));
|
||||||
for (int j = 0; j < exh->page_count; j++) {
|
for (uint32_t j = 0; j < exh->page_count; j++) {
|
||||||
for (int z = 0; z < exh->language_count; z++) {
|
for (uint32_t z = 0; z < exh->language_count; z++) {
|
||||||
std::string path = physis_gamedata_get_exd_filename(nameLowercase.c_str(), exh, exh->languages[z], j);
|
std::string path = physis_gamedata_get_exd_filename(nameLowercase.c_str(), exh, exh->languages[z], j);
|
||||||
|
|
||||||
database.addFile(QStringLiteral("exd/") + QString::fromStdString(path));
|
database.addFile(QStringLiteral("exd/") + QString::fromStdString(path));
|
||||||
|
|
|
@ -50,7 +50,7 @@ MainWindow::MainWindow(const QString &gamePath, GameData *data)
|
||||||
file.write(reinterpret_cast<const char *>(fileData.data), fileData.size);
|
file.write(reinterpret_cast<const char *>(fileData.data), fileData.size);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
connect(tree, &FileTreeWindow::pathSelected, this, [=](const QString &path) {
|
connect(tree, &FileTreeWindow::pathSelected, this, [this](const QString &path) {
|
||||||
refreshParts(path);
|
refreshParts(path);
|
||||||
});
|
});
|
||||||
tree->setMaximumWidth(200);
|
tree->setMaximumWidth(200);
|
||||||
|
|
Loading…
Add table
Reference in a new issue