mirror of
https://github.com/redstrate/Novus.git
synced 2025-04-25 21:27:45 +00:00
Fix misc warnings, code errors and slight improvements
This commit is contained in:
parent
8bd7148b79
commit
88d80a64cf
35 changed files with 71 additions and 85 deletions
|
@ -47,7 +47,7 @@ private:
|
||||||
QComboBox *raceCombo = nullptr, *subraceCombo = nullptr, *genderCombo = nullptr;
|
QComboBox *raceCombo = nullptr, *subraceCombo = nullptr, *genderCombo = nullptr;
|
||||||
|
|
||||||
GameData *data = nullptr;
|
GameData *data = nullptr;
|
||||||
physis_CMP cmp;
|
physis_CMP cmp{};
|
||||||
|
|
||||||
float heightScale = 0.5f;
|
float heightScale = 0.5f;
|
||||||
float bustScale = 1.0f;
|
float bustScale = 1.0f;
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
#include "gearview.h"
|
#include "gearview.h"
|
||||||
|
|
||||||
BoneEditor::BoneEditor(GearView *gearView, QWidget *parent)
|
BoneEditor::BoneEditor(GearView *gearView, QWidget *parent)
|
||||||
: SklbPart()
|
: SklbPart(parent)
|
||||||
, gearView(gearView)
|
, gearView(gearView)
|
||||||
{
|
{
|
||||||
connect(&gearView->part(), &MDLPart::skeletonChanged, this, [this, gearView] {
|
connect(&gearView->part(), &MDLPart::skeletonChanged, this, [this, gearView] {
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
#include "cmpeditor.h"
|
#include "cmpeditor.h"
|
||||||
|
|
||||||
CmpEditor::CmpEditor(GameData *data, QWidget *parent)
|
CmpEditor::CmpEditor(GameData *data, QWidget *parent)
|
||||||
: CmpPart(data)
|
: CmpPart(data, parent)
|
||||||
{
|
{
|
||||||
setWindowTitle(QStringLiteral("CMP Editor"));
|
setWindowTitle(QStringLiteral("CMP Editor"));
|
||||||
|
|
||||||
|
|
|
@ -148,12 +148,12 @@ void FullModelViewer::addGear(GearInfo &info)
|
||||||
{
|
{
|
||||||
switch (info.slot) {
|
switch (info.slot) {
|
||||||
case Slot::Body:
|
case Slot::Body:
|
||||||
if (topSlot ? *topSlot != info : true) {
|
if (!topSlot || *topSlot != info) {
|
||||||
topSlot = info;
|
topSlot = info;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case Slot::Legs:
|
case Slot::Legs:
|
||||||
if (bottomSlot ? *bottomSlot != info : true) {
|
if (!bottomSlot || *bottomSlot != info) {
|
||||||
bottomSlot = info;
|
bottomSlot = info;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -3,7 +3,6 @@
|
||||||
|
|
||||||
#include "gearlistmodel.h"
|
#include "gearlistmodel.h"
|
||||||
|
|
||||||
#include <QDebug>
|
|
||||||
#include <QtConcurrent>
|
#include <QtConcurrent>
|
||||||
#include <magic_enum.hpp>
|
#include <magic_enum.hpp>
|
||||||
|
|
||||||
|
@ -76,7 +75,7 @@ int GearListModel::columnCount(const QModelIndex &parent) const
|
||||||
QModelIndex GearListModel::index(int row, int column, const QModelIndex &parent) const
|
QModelIndex GearListModel::index(int row, int column, const QModelIndex &parent) const
|
||||||
{
|
{
|
||||||
if (!hasIndex(row, column, parent))
|
if (!hasIndex(row, column, parent))
|
||||||
return QModelIndex();
|
return {};
|
||||||
|
|
||||||
TreeInformation *parentItem;
|
TreeInformation *parentItem;
|
||||||
|
|
||||||
|
@ -88,19 +87,19 @@ QModelIndex GearListModel::index(int row, int column, const QModelIndex &parent)
|
||||||
TreeInformation *childItem = parentItem->children[row];
|
TreeInformation *childItem = parentItem->children[row];
|
||||||
if (childItem)
|
if (childItem)
|
||||||
return createIndex(row, column, childItem);
|
return createIndex(row, column, childItem);
|
||||||
return QModelIndex();
|
return {};
|
||||||
}
|
}
|
||||||
|
|
||||||
QModelIndex GearListModel::parent(const QModelIndex &index) const
|
QModelIndex GearListModel::parent(const QModelIndex &index) const
|
||||||
{
|
{
|
||||||
if (!index.isValid())
|
if (!index.isValid())
|
||||||
return QModelIndex();
|
return {};
|
||||||
|
|
||||||
TreeInformation *childItem = static_cast<TreeInformation *>(index.internalPointer());
|
auto childItem = static_cast<TreeInformation *>(index.internalPointer());
|
||||||
TreeInformation *parentItem = childItem->parent;
|
TreeInformation *parentItem = childItem->parent;
|
||||||
|
|
||||||
if (parentItem == rootItem)
|
if (parentItem == rootItem)
|
||||||
return QModelIndex();
|
return {};
|
||||||
|
|
||||||
return createIndex(parentItem->row, 0, parentItem);
|
return createIndex(parentItem->row, 0, parentItem);
|
||||||
}
|
}
|
||||||
|
@ -109,13 +108,11 @@ QVariant GearListModel::data(const QModelIndex &index, int role) const
|
||||||
{
|
{
|
||||||
if (!index.isValid())
|
if (!index.isValid())
|
||||||
return {};
|
return {};
|
||||||
if (!index.isValid())
|
|
||||||
return QVariant();
|
|
||||||
|
|
||||||
if (role != Qt::DisplayRole)
|
if (role != Qt::DisplayRole)
|
||||||
return QVariant();
|
return {};
|
||||||
|
|
||||||
TreeInformation *item = static_cast<TreeInformation *>(index.internalPointer());
|
auto item = static_cast<TreeInformation *>(index.internalPointer());
|
||||||
|
|
||||||
if (item->type == TreeType::Category) {
|
if (item->type == TreeType::Category) {
|
||||||
return QLatin1String(magic_enum::enum_name(*item->slotType).data());
|
return QLatin1String(magic_enum::enum_name(*item->slotType).data());
|
||||||
|
@ -139,7 +136,7 @@ QVariant GearListModel::headerData(int section, Qt::Orientation orientation, int
|
||||||
|
|
||||||
std::optional<GearInfo> GearListModel::getGearFromIndex(const QModelIndex &index)
|
std::optional<GearInfo> GearListModel::getGearFromIndex(const QModelIndex &index)
|
||||||
{
|
{
|
||||||
TreeInformation *item = static_cast<TreeInformation *>(index.internalPointer());
|
auto item = static_cast<TreeInformation *>(index.internalPointer());
|
||||||
if (item->type == TreeType::Item) {
|
if (item->type == TreeType::Item) {
|
||||||
return item->gear;
|
return item->gear;
|
||||||
}
|
}
|
||||||
|
@ -173,7 +170,7 @@ void GearListModel::finished()
|
||||||
|
|
||||||
int i = 0;
|
int i = 0;
|
||||||
for (auto slot : magic_enum::enum_values<Slot>()) {
|
for (auto slot : magic_enum::enum_values<Slot>()) {
|
||||||
TreeInformation *categoryItem = new TreeInformation();
|
auto categoryItem = new TreeInformation();
|
||||||
categoryItem->type = TreeType::Category;
|
categoryItem->type = TreeType::Category;
|
||||||
categoryItem->slotType = slot;
|
categoryItem->slotType = slot;
|
||||||
categoryItem->parent = rootItem;
|
categoryItem->parent = rootItem;
|
||||||
|
@ -181,9 +178,9 @@ void GearListModel::finished()
|
||||||
rootItem->children.push_back(categoryItem);
|
rootItem->children.push_back(categoryItem);
|
||||||
|
|
||||||
int j = 0;
|
int j = 0;
|
||||||
for (auto gear : gears) {
|
for (const auto &gear : gears) {
|
||||||
if (gear.slot == slot) {
|
if (gear.slot == slot) {
|
||||||
TreeInformation *item = new TreeInformation();
|
auto item = new TreeInformation();
|
||||||
item->type = TreeType::Item;
|
item->type = TreeType::Item;
|
||||||
item->gear = gear;
|
item->gear = gear;
|
||||||
item->parent = categoryItem;
|
item->parent = categoryItem;
|
||||||
|
|
|
@ -3,7 +3,6 @@
|
||||||
|
|
||||||
#include "gearview.h"
|
#include "gearview.h"
|
||||||
|
|
||||||
#include <QDebug>
|
|
||||||
#include <QThreadPool>
|
#include <QThreadPool>
|
||||||
#include <QVBoxLayout>
|
#include <QVBoxLayout>
|
||||||
#include <QtConcurrent>
|
#include <QtConcurrent>
|
||||||
|
@ -353,7 +352,7 @@ void GearView::updatePart()
|
||||||
mdlPart->removeModel(queuedRemoval.mdl);
|
mdlPart->removeModel(queuedRemoval.mdl);
|
||||||
loadedGears.erase(std::remove_if(loadedGears.begin(),
|
loadedGears.erase(std::remove_if(loadedGears.begin(),
|
||||||
loadedGears.end(),
|
loadedGears.end(),
|
||||||
[queuedRemoval](const LoadedGear other) {
|
[queuedRemoval](const LoadedGear &other) {
|
||||||
return queuedRemoval.info == other.info;
|
return queuedRemoval.info == other.info;
|
||||||
}),
|
}),
|
||||||
loadedGears.end());
|
loadedGears.end());
|
||||||
|
|
|
@ -9,18 +9,13 @@
|
||||||
#include <QTableWidget>
|
#include <QTableWidget>
|
||||||
#include <QTimer>
|
#include <QTimer>
|
||||||
|
|
||||||
#include <KAboutApplicationDialog>
|
|
||||||
#include <KAboutData>
|
#include <KAboutData>
|
||||||
#include <QAction>
|
#include <QAction>
|
||||||
#include <QApplication>
|
#include <QApplication>
|
||||||
#include <QDesktopServices>
|
#include <QDesktopServices>
|
||||||
#include <QFileDialog>
|
#include <QFileDialog>
|
||||||
#include <QMenuBar>
|
#include <QMenuBar>
|
||||||
#include <QPushButton>
|
|
||||||
#include <QTreeWidget>
|
|
||||||
#include <glm/gtc/type_ptr.hpp>
|
|
||||||
#include <magic_enum.hpp>
|
#include <magic_enum.hpp>
|
||||||
#include <physis.hpp>
|
|
||||||
|
|
||||||
#include "cmpeditor.h"
|
#include "cmpeditor.h"
|
||||||
#include "filecache.h"
|
#include "filecache.h"
|
||||||
|
|
|
@ -337,7 +337,7 @@ void SingleGearView::importModel(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 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();
|
||||||
|
|
|
@ -22,7 +22,7 @@ Q_SIGNALS:
|
||||||
|
|
||||||
private:
|
private:
|
||||||
struct {
|
struct {
|
||||||
QDoubleSpinBox *x, *y, *z;
|
QDoubleSpinBox *x = nullptr, *y = nullptr, *z = nullptr;
|
||||||
} spinBoxes;
|
} spinBoxes;
|
||||||
|
|
||||||
glm::quat &quat;
|
glm::quat &quat;
|
||||||
|
|
|
@ -12,7 +12,7 @@ class MainWindow : public NovusMainWindow
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
MainWindow(GameData *data);
|
explicit MainWindow(GameData *data);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
GameData *data = nullptr;
|
GameData *data = nullptr;
|
||||||
|
|
|
@ -14,7 +14,7 @@ class MainWindow : public NovusMainWindow
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
MainWindow(GameData *data);
|
explicit MainWindow(GameData *data);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void setupFileMenu(QMenu *menu) override;
|
void setupFileMenu(QMenu *menu) override;
|
||||||
|
|
|
@ -25,8 +25,9 @@ const std::vector<RaceTree> raceTree = {{Race::Hyur, {Subrace::Midlander, Subrac
|
||||||
{Race::Hrothgar, {Subrace::Hellion, Subrace::Lost}},
|
{Race::Hrothgar, {Subrace::Hellion, Subrace::Lost}},
|
||||||
{Race::Viera, {Subrace::Rava, Subrace::Veena}}};
|
{Race::Viera, {Subrace::Rava, Subrace::Veena}}};
|
||||||
|
|
||||||
CmpPart::CmpPart(GameData *data)
|
CmpPart::CmpPart(GameData *data, QWidget *parent)
|
||||||
: data(data)
|
: QWidget(parent)
|
||||||
|
, data(data)
|
||||||
{
|
{
|
||||||
layout = new QHBoxLayout();
|
layout = new QHBoxLayout();
|
||||||
setLayout(layout);
|
setLayout(layout);
|
||||||
|
@ -41,7 +42,7 @@ void CmpPart::load(physis_Buffer file)
|
||||||
raceListWidget->setHeaderLabel(QStringLiteral("Race"));
|
raceListWidget->setHeaderLabel(QStringLiteral("Race"));
|
||||||
layout->addWidget(raceListWidget);
|
layout->addWidget(raceListWidget);
|
||||||
|
|
||||||
for (auto race : raceTree) {
|
for (const auto &race : raceTree) {
|
||||||
auto item = new QTreeWidgetItem();
|
auto item = new QTreeWidgetItem();
|
||||||
item->setText(0, QLatin1String(magic_enum::enum_name(race.baseRace).data()));
|
item->setText(0, QLatin1String(magic_enum::enum_name(race.baseRace).data()));
|
||||||
raceListWidget->addTopLevelItem(item);
|
raceListWidget->addTopLevelItem(item);
|
||||||
|
|
|
@ -28,7 +28,7 @@ class CmpPart : public QWidget
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit CmpPart(GameData *data);
|
explicit CmpPart(GameData *data, QWidget *parent = nullptr);
|
||||||
|
|
||||||
void load(physis_Buffer file);
|
void load(physis_Buffer file);
|
||||||
|
|
||||||
|
@ -36,7 +36,7 @@ private:
|
||||||
void loadRaceData(Race race, Subrace subrace);
|
void loadRaceData(Race race, Subrace subrace);
|
||||||
|
|
||||||
GameData *data = nullptr;
|
GameData *data = nullptr;
|
||||||
physis_CMP cmp;
|
physis_CMP cmp{};
|
||||||
|
|
||||||
QDoubleSpinBox *maleMinSize = nullptr;
|
QDoubleSpinBox *maleMinSize = nullptr;
|
||||||
QDoubleSpinBox *maleMaxSize = nullptr;
|
QDoubleSpinBox *maleMaxSize = nullptr;
|
||||||
|
|
|
@ -34,7 +34,7 @@ EXDPart::EXDPart(GameData *data)
|
||||||
contentsBoxLayout->addWidget(pageTabWidget);
|
contentsBoxLayout->addWidget(pageTabWidget);
|
||||||
}
|
}
|
||||||
|
|
||||||
void EXDPart::loadSheet(QString name, physis_Buffer buffer)
|
void EXDPart::loadSheet(const QString &name, physis_Buffer buffer)
|
||||||
{
|
{
|
||||||
pageTabWidget->clear();
|
pageTabWidget->clear();
|
||||||
|
|
||||||
|
@ -64,7 +64,7 @@ void EXDPart::loadSheet(QString name, physis_Buffer buffer)
|
||||||
auto exh = physis_parse_excel_sheet_header(buffer);
|
auto exh = physis_parse_excel_sheet_header(buffer);
|
||||||
|
|
||||||
QLayoutItem *child;
|
QLayoutItem *child;
|
||||||
while ((child = headerFormLayout->takeAt(0)) != 0) {
|
while ((child = headerFormLayout->takeAt(0)) != nullptr) {
|
||||||
delete child->widget();
|
delete child->widget();
|
||||||
delete child;
|
delete child;
|
||||||
}
|
}
|
||||||
|
|
|
@ -17,7 +17,7 @@ class EXDPart : public QWidget
|
||||||
public:
|
public:
|
||||||
explicit EXDPart(GameData *data);
|
explicit EXDPart(GameData *data);
|
||||||
|
|
||||||
void loadSheet(QString name, physis_Buffer buffer);
|
void loadSheet(const QString &name, physis_Buffer buffer);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
GameData *data = nullptr;
|
GameData *data = nullptr;
|
||||||
|
@ -27,7 +27,7 @@ private:
|
||||||
|
|
||||||
struct CachedExcel {
|
struct CachedExcel {
|
||||||
physis_EXH *exh = nullptr;
|
physis_EXH *exh = nullptr;
|
||||||
physis_EXD exd;
|
physis_EXD exd{};
|
||||||
};
|
};
|
||||||
QMap<QString, CachedExcel> cachedExcelSheets;
|
QMap<QString, CachedExcel> cachedExcelSheets;
|
||||||
Language getSuitableLanguage(physis_EXH *pExh);
|
Language getSuitableLanguage(physis_EXH *pExh);
|
||||||
|
|
|
@ -5,7 +5,6 @@
|
||||||
#include <QApplication>
|
#include <QApplication>
|
||||||
#include <QBuffer>
|
#include <QBuffer>
|
||||||
#include <QClipboard>
|
#include <QClipboard>
|
||||||
#include <QFile>
|
|
||||||
|
|
||||||
QHexDocument::QHexDocument(QHexBuffer *buffer, QObject *parent)
|
QHexDocument::QHexDocument(QHexBuffer *buffer, QObject *parent)
|
||||||
: QObject(parent)
|
: QObject(parent)
|
||||||
|
|
|
@ -6,7 +6,6 @@
|
||||||
#include <QApplication>
|
#include <QApplication>
|
||||||
#include <QFontDatabase>
|
#include <QFontDatabase>
|
||||||
#include <QHelpEvent>
|
#include <QHelpEvent>
|
||||||
#include <QPaintEvent>
|
|
||||||
#include <QPainter>
|
#include <QPainter>
|
||||||
#include <QScrollBar>
|
#include <QScrollBar>
|
||||||
#include <QToolTip>
|
#include <QToolTip>
|
||||||
|
|
|
@ -11,7 +11,6 @@
|
||||||
#include <QVBoxLayout>
|
#include <QVBoxLayout>
|
||||||
#include <QVulkanInstance>
|
#include <QVulkanInstance>
|
||||||
#include <QVulkanWindow>
|
#include <QVulkanWindow>
|
||||||
#include <QWindow>
|
|
||||||
#include <cmath>
|
#include <cmath>
|
||||||
#include <glm/gtc/quaternion.hpp>
|
#include <glm/gtc/quaternion.hpp>
|
||||||
#include <glm/gtc/type_ptr.inl>
|
#include <glm/gtc/type_ptr.inl>
|
||||||
|
@ -505,7 +504,7 @@ void MDLPart::removeModel(const physis_MDL &mdl)
|
||||||
{
|
{
|
||||||
models.erase(std::remove_if(models.begin(),
|
models.erase(std::remove_if(models.begin(),
|
||||||
models.end(),
|
models.end(),
|
||||||
[mdl](const RenderModel other) {
|
[mdl](const RenderModel &other) {
|
||||||
return mdl.lods == other.model.lods;
|
return mdl.lods == other.model.lods;
|
||||||
}),
|
}),
|
||||||
models.end());
|
models.end());
|
||||||
|
|
|
@ -12,7 +12,6 @@
|
||||||
struct GameData;
|
struct GameData;
|
||||||
|
|
||||||
class VulkanWindow;
|
class VulkanWindow;
|
||||||
class StandaloneWindow;
|
|
||||||
class FileCache;
|
class FileCache;
|
||||||
|
|
||||||
class MDLPart : public QWidget
|
class MDLPart : public QWidget
|
||||||
|
@ -77,12 +76,11 @@ private:
|
||||||
|
|
||||||
GameData *data = nullptr;
|
GameData *data = nullptr;
|
||||||
FileCache &cache;
|
FileCache &cache;
|
||||||
physis_PBD pbd;
|
physis_PBD pbd{};
|
||||||
|
|
||||||
std::vector<RenderModel> models;
|
std::vector<RenderModel> models;
|
||||||
|
|
||||||
Renderer *renderer;
|
Renderer *renderer = nullptr;
|
||||||
VulkanWindow *vkWindow;
|
VulkanWindow *vkWindow = nullptr;
|
||||||
StandaloneWindow *standaloneWindow;
|
|
||||||
bool firstTimeSkeletonDataCalculated = false;
|
bool firstTimeSkeletonDataCalculated = false;
|
||||||
};
|
};
|
|
@ -26,7 +26,7 @@ void SHPKPart::load(physis_Buffer buffer)
|
||||||
|
|
||||||
pageTabWidget->clear();
|
pageTabWidget->clear();
|
||||||
|
|
||||||
const auto addShader = [this](physis_Shader shader, QString name) {
|
const auto addShader = [this](physis_Shader shader, const QString &name) {
|
||||||
auto shaderTextEdit = new QTextEdit();
|
auto shaderTextEdit = new QTextEdit();
|
||||||
shaderTextEdit->setReadOnly(true);
|
shaderTextEdit->setReadOnly(true);
|
||||||
|
|
||||||
|
|
|
@ -7,7 +7,6 @@
|
||||||
#include <QGroupBox>
|
#include <QGroupBox>
|
||||||
#include <QHBoxLayout>
|
#include <QHBoxLayout>
|
||||||
#include <glm/gtc/type_ptr.hpp>
|
#include <glm/gtc/type_ptr.hpp>
|
||||||
#include <glm/gtx/matrix_decompose.hpp>
|
|
||||||
|
|
||||||
#include "quaternionedit.h"
|
#include "quaternionedit.h"
|
||||||
#include "vec3edit.h"
|
#include "vec3edit.h"
|
||||||
|
@ -29,7 +28,8 @@ void addItem(physis_Skeleton &skeleton, physis_Bone &bone, QTreeWidget *widget,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
SklbPart::SklbPart()
|
SklbPart::SklbPart(QWidget *parent)
|
||||||
|
: QWidget(parent)
|
||||||
{
|
{
|
||||||
auto layout = new QHBoxLayout();
|
auto layout = new QHBoxLayout();
|
||||||
setLayout(layout);
|
setLayout(layout);
|
||||||
|
|
|
@ -19,7 +19,7 @@ class SklbPart : public QWidget
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit SklbPart();
|
explicit SklbPart(QWidget *parent = nullptr);
|
||||||
|
|
||||||
void clear();
|
void clear();
|
||||||
void load(physis_Skeleton file);
|
void load(physis_Skeleton file);
|
||||||
|
|
|
@ -35,7 +35,7 @@ QPixmap ImageLabel::scaledPixmap() const
|
||||||
|
|
||||||
void ImageLabel::resizeEvent(QResizeEvent *e)
|
void ImageLabel::resizeEvent(QResizeEvent *e)
|
||||||
{
|
{
|
||||||
Q_UNUSED(e);
|
Q_UNUSED(e)
|
||||||
if (!pix.isNull()) {
|
if (!pix.isNull()) {
|
||||||
QLabel::setPixmap(scaledPixmap());
|
QLabel::setPixmap(scaledPixmap());
|
||||||
}
|
}
|
||||||
|
|
|
@ -12,7 +12,7 @@ struct RenderTarget;
|
||||||
class ImGuiPass
|
class ImGuiPass
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
ImGuiPass(Renderer &renderer);
|
explicit ImGuiPass(Renderer &renderer);
|
||||||
~ImGuiPass();
|
~ImGuiPass();
|
||||||
|
|
||||||
void render(VkCommandBuffer commandBuffer);
|
void render(VkCommandBuffer commandBuffer);
|
||||||
|
|
|
@ -11,7 +11,7 @@ class FilePropertiesWindow : public QWidget
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit FilePropertiesWindow(QString path, physis_Buffer buffer, QWidget *parent = nullptr);
|
explicit FilePropertiesWindow(const QString &path, physis_Buffer buffer, QWidget *parent = nullptr);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
GameData *data = nullptr;
|
GameData *data = nullptr;
|
||||||
|
|
|
@ -26,7 +26,7 @@ class FileTreeModel : public QAbstractItemModel
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit FileTreeModel(bool showUnknown, QString gamePath, GameData *data);
|
explicit FileTreeModel(bool showUnknown, const QString &gamePath, GameData *data);
|
||||||
|
|
||||||
int rowCount(const QModelIndex &parent = QModelIndex()) const override;
|
int rowCount(const QModelIndex &parent = QModelIndex()) const override;
|
||||||
int columnCount(const QModelIndex &parent = QModelIndex()) const override;
|
int columnCount(const QModelIndex &parent = QModelIndex()) const override;
|
||||||
|
@ -41,8 +41,8 @@ private:
|
||||||
GameData *gameData = nullptr;
|
GameData *gameData = nullptr;
|
||||||
TreeInformation *rootItem = nullptr;
|
TreeInformation *rootItem = nullptr;
|
||||||
|
|
||||||
void addKnownFolder(QString string);
|
void addKnownFolder(const QString &string);
|
||||||
void addFile(TreeInformation *parentItem, uint32_t filenameHash, QString name);
|
void addFile(TreeInformation *parentItem, uint32_t filenameHash, const QString &name);
|
||||||
void addFolder(TreeInformation *parentItem, uint32_t filenameHash);
|
void addFolder(TreeInformation *parentItem, uint32_t filenameHash);
|
||||||
|
|
||||||
QHash<uint32_t, TreeInformation *> knownDirHashes;
|
QHash<uint32_t, TreeInformation *> knownDirHashes;
|
||||||
|
|
|
@ -14,18 +14,18 @@ class FileTreeWindow : public QWidget
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit FileTreeWindow(QString gamePath, GameData *data, QWidget *parent = nullptr);
|
explicit FileTreeWindow(const QString &gamePath, GameData *data, QWidget *parent = nullptr);
|
||||||
|
|
||||||
Q_SIGNALS:
|
Q_SIGNALS:
|
||||||
void extractFile(QString path);
|
void extractFile(const QString &path);
|
||||||
void pathSelected(QString path);
|
void pathSelected(const QString &path);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void refreshModel();
|
void refreshModel();
|
||||||
|
|
||||||
GameData *data = nullptr;
|
GameData *data = nullptr;
|
||||||
FileTreeModel *m_fileModel;
|
FileTreeModel *m_fileModel = nullptr;
|
||||||
QSortFilterProxyModel *m_searchModel;
|
QSortFilterProxyModel *m_searchModel = nullptr;
|
||||||
QCheckBox *m_unknownCheckbox;
|
QCheckBox *m_unknownCheckbox = nullptr;
|
||||||
QString m_gamePath;
|
QString m_gamePath;
|
||||||
};
|
};
|
|
@ -12,16 +12,16 @@ class HashDatabase : public QObject
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
HashDatabase(QObject *parent = nullptr);
|
explicit HashDatabase(QObject *parent = nullptr);
|
||||||
|
|
||||||
void addFolder(QString folder);
|
void addFolder(const QString &folder);
|
||||||
void addFile(QString file);
|
void addFile(const QString &file);
|
||||||
|
|
||||||
QVector<QString> getKnownFolders();
|
QVector<QString> getKnownFolders();
|
||||||
|
|
||||||
bool knowsFile(const uint32_t i);
|
bool knowsFile(uint32_t i);
|
||||||
|
|
||||||
QString getFilename(const uint32_t i);
|
QString getFilename(uint32_t i);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QSqlDatabase m_db;
|
QSqlDatabase m_db;
|
||||||
|
|
|
@ -15,7 +15,7 @@ struct GameData;
|
||||||
class MainWindow : public NovusMainWindow
|
class MainWindow : public NovusMainWindow
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
MainWindow(QString gamePath, GameData *data);
|
MainWindow(const QString &gamePath, GameData *data);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QMdiArea *mdiArea = nullptr;
|
QMdiArea *mdiArea = nullptr;
|
||||||
|
@ -24,5 +24,5 @@ private:
|
||||||
QTabWidget *partHolder = nullptr;
|
QTabWidget *partHolder = nullptr;
|
||||||
FileCache fileCache;
|
FileCache fileCache;
|
||||||
|
|
||||||
void refreshParts(QString qString);
|
void refreshParts(const QString &path);
|
||||||
};
|
};
|
|
@ -9,7 +9,7 @@
|
||||||
|
|
||||||
#include "filepropertieswindow.h"
|
#include "filepropertieswindow.h"
|
||||||
|
|
||||||
FilePropertiesWindow::FilePropertiesWindow(QString path, physis_Buffer buffer, QWidget *parent)
|
FilePropertiesWindow::FilePropertiesWindow(const QString &path, physis_Buffer buffer, QWidget *parent)
|
||||||
: QWidget(parent)
|
: QWidget(parent)
|
||||||
{
|
{
|
||||||
setWindowTitle(QStringLiteral("Properties for ") + path);
|
setWindowTitle(QStringLiteral("Properties for ") + path);
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
|
|
||||||
#include <QtConcurrent>
|
#include <QtConcurrent>
|
||||||
|
|
||||||
FileTreeModel::FileTreeModel(bool showUnknown, QString gamePath, GameData *data)
|
FileTreeModel::FileTreeModel(bool showUnknown, const QString &gamePath, GameData *data)
|
||||||
: gameData(data)
|
: gameData(data)
|
||||||
, m_showUnknown(showUnknown)
|
, m_showUnknown(showUnknown)
|
||||||
, QAbstractItemModel()
|
, QAbstractItemModel()
|
||||||
|
@ -14,7 +14,7 @@ FileTreeModel::FileTreeModel(bool showUnknown, QString gamePath, GameData *data)
|
||||||
rootItem = new TreeInformation();
|
rootItem = new TreeInformation();
|
||||||
rootItem->type = TreeType::Root;
|
rootItem->type = TreeType::Root;
|
||||||
|
|
||||||
for (auto knownFolder : m_database.getKnownFolders()) {
|
for (const auto &knownFolder : m_database.getKnownFolders()) {
|
||||||
addKnownFolder(knownFolder);
|
addKnownFolder(knownFolder);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -146,7 +146,7 @@ QVariant FileTreeModel::headerData(int section, Qt::Orientation orientation, int
|
||||||
return QAbstractItemModel::headerData(section, orientation, role);
|
return QAbstractItemModel::headerData(section, orientation, role);
|
||||||
}
|
}
|
||||||
|
|
||||||
void FileTreeModel::addKnownFolder(QString string)
|
void FileTreeModel::addKnownFolder(const QString &string)
|
||||||
{
|
{
|
||||||
auto children = string.split(QStringLiteral("/"));
|
auto children = string.split(QStringLiteral("/"));
|
||||||
|
|
||||||
|
@ -175,7 +175,7 @@ void FileTreeModel::addKnownFolder(QString string)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void FileTreeModel::addFile(TreeInformation *parentItem, uint32_t name, QString realName)
|
void FileTreeModel::addFile(TreeInformation *parentItem, uint32_t name, const QString &realName)
|
||||||
{
|
{
|
||||||
if (realName.isEmpty() && !m_showUnknown) {
|
if (realName.isEmpty() && !m_showUnknown) {
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -8,10 +8,10 @@
|
||||||
#include <QMenu>
|
#include <QMenu>
|
||||||
#include <QTreeWidget>
|
#include <QTreeWidget>
|
||||||
|
|
||||||
FileTreeWindow::FileTreeWindow(QString gamePath, GameData *data, QWidget *parent)
|
FileTreeWindow::FileTreeWindow(const QString &gamePath, GameData *data, QWidget *parent)
|
||||||
: QWidget(parent)
|
: QWidget(parent)
|
||||||
, m_gamePath(gamePath)
|
|
||||||
, data(data)
|
, data(data)
|
||||||
|
, m_gamePath(gamePath)
|
||||||
{
|
{
|
||||||
auto layout = new QVBoxLayout();
|
auto layout = new QVBoxLayout();
|
||||||
layout->setContentsMargins(0, 0, 0, 0);
|
layout->setContentsMargins(0, 0, 0, 0);
|
||||||
|
|
|
@ -21,7 +21,7 @@ HashDatabase::HashDatabase(QObject *parent)
|
||||||
query.exec(QStringLiteral("CREATE TABLE IF NOT EXISTS file_hashes (hash INTEGER PRIMARY KEY, name TEXT NOT NULL)"));
|
query.exec(QStringLiteral("CREATE TABLE IF NOT EXISTS file_hashes (hash INTEGER PRIMARY KEY, name TEXT NOT NULL)"));
|
||||||
}
|
}
|
||||||
|
|
||||||
void HashDatabase::addFolder(QString folder)
|
void HashDatabase::addFolder(const QString &folder)
|
||||||
{
|
{
|
||||||
std::string folderStd = folder.toStdString();
|
std::string folderStd = folder.toStdString();
|
||||||
|
|
||||||
|
@ -34,7 +34,7 @@ void HashDatabase::addFolder(QString folder)
|
||||||
query.exec();
|
query.exec();
|
||||||
}
|
}
|
||||||
|
|
||||||
void HashDatabase::addFile(QString file)
|
void HashDatabase::addFile(const QString &file)
|
||||||
{
|
{
|
||||||
QString filename = file;
|
QString filename = file;
|
||||||
if (file.contains(QStringLiteral("/"))) {
|
if (file.contains(QStringLiteral("/"))) {
|
||||||
|
|
|
@ -3,7 +3,6 @@
|
||||||
|
|
||||||
#include <QApplication>
|
#include <QApplication>
|
||||||
|
|
||||||
#include <QStyle>
|
|
||||||
#include <physis.hpp>
|
#include <physis.hpp>
|
||||||
|
|
||||||
#include "aboutdata.h"
|
#include "aboutdata.h"
|
||||||
|
|
|
@ -21,7 +21,7 @@
|
||||||
#include "sklbpart.h"
|
#include "sklbpart.h"
|
||||||
#include "texpart.h"
|
#include "texpart.h"
|
||||||
|
|
||||||
MainWindow::MainWindow(QString gamePath, GameData *data)
|
MainWindow::MainWindow(const QString &gamePath, GameData *data)
|
||||||
: NovusMainWindow()
|
: NovusMainWindow()
|
||||||
, data(data)
|
, data(data)
|
||||||
, fileCache(*data)
|
, fileCache(*data)
|
||||||
|
@ -35,7 +35,7 @@ MainWindow::MainWindow(QString gamePath, GameData *data)
|
||||||
dummyWidget->setLayout(layout);
|
dummyWidget->setLayout(layout);
|
||||||
|
|
||||||
auto tree = new FileTreeWindow(gamePath, data);
|
auto tree = new FileTreeWindow(gamePath, data);
|
||||||
connect(tree, &FileTreeWindow::extractFile, this, [this, data](QString path) {
|
connect(tree, &FileTreeWindow::extractFile, this, [this, data](const QString &path) {
|
||||||
const QFileInfo info(path);
|
const QFileInfo info(path);
|
||||||
|
|
||||||
const QString savePath = QFileDialog::getSaveFileName(this, tr("Save File"), info.fileName(), QStringLiteral("*.%1").arg(info.completeSuffix()));
|
const QString savePath = QFileDialog::getSaveFileName(this, tr("Save File"), info.fileName(), QStringLiteral("*.%1").arg(info.completeSuffix()));
|
||||||
|
@ -50,7 +50,7 @@ MainWindow::MainWindow(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, [=](QString path) {
|
connect(tree, &FileTreeWindow::pathSelected, this, [=](const QString &path) {
|
||||||
refreshParts(path);
|
refreshParts(path);
|
||||||
});
|
});
|
||||||
tree->setMaximumWidth(200);
|
tree->setMaximumWidth(200);
|
||||||
|
@ -64,7 +64,7 @@ MainWindow::MainWindow(QString gamePath, GameData *data)
|
||||||
refreshParts({});
|
refreshParts({});
|
||||||
}
|
}
|
||||||
|
|
||||||
void MainWindow::refreshParts(QString path)
|
void MainWindow::refreshParts(const QString &path)
|
||||||
{
|
{
|
||||||
partHolder->clear();
|
partHolder->clear();
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue