mirror of
https://github.com/redstrate/Novus.git
synced 2025-04-23 04:27:45 +00:00
More small code improvements/cleanup
This commit is contained in:
parent
34082479ed
commit
039b6e6d30
11 changed files with 9 additions and 21 deletions
|
@ -44,7 +44,7 @@ inline QString encryptGameArg(const QString &arg)
|
||||||
return QStringLiteral("//**sqex0003%1%2**//").arg(base64, QLatin1String(&checksum, 1));
|
return QStringLiteral("//**sqex0003%1%2**//").arg(base64, QLatin1String(&checksum, 1));
|
||||||
}
|
}
|
||||||
|
|
||||||
inline QString decryptGameArg(uint32_t tickCount, QString sqexString)
|
inline QString decryptGameArg(uint32_t tickCount, const QString &sqexString)
|
||||||
{
|
{
|
||||||
unsigned int ticks = tickCount & 0xFFFFFFFFu;
|
unsigned int ticks = tickCount & 0xFFFFFFFFu;
|
||||||
unsigned int key = ticks & 0xFFFF0000u;
|
unsigned int key = ticks & 0xFFFF0000u;
|
||||||
|
|
|
@ -52,7 +52,7 @@ GearView::GearView(GameData *data, FileCache &cache, QWidget *parent)
|
||||||
Q_UNUSED(QtConcurrent::run(QThreadPool::globalInstance(), [this] {
|
Q_UNUSED(QtConcurrent::run(QThreadPool::globalInstance(), [this] {
|
||||||
updatePart();
|
updatePart();
|
||||||
Q_EMIT loadingChanged(false);
|
Q_EMIT loadingChanged(false);
|
||||||
}));
|
}))
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -10,7 +10,7 @@ Vector3Edit::Vector3Edit(glm::vec3 &vec, QWidget *parent)
|
||||||
: QWidget(parent)
|
: QWidget(parent)
|
||||||
, vec(vec)
|
, vec(vec)
|
||||||
{
|
{
|
||||||
QHBoxLayout *itemsLayout = new QHBoxLayout(this);
|
auto itemsLayout = new QHBoxLayout(this);
|
||||||
|
|
||||||
spinBoxes.x = new QDoubleSpinBox();
|
spinBoxes.x = new QDoubleSpinBox();
|
||||||
spinBoxes.y = new QDoubleSpinBox();
|
spinBoxes.y = new QDoubleSpinBox();
|
||||||
|
|
|
@ -3,15 +3,11 @@
|
||||||
|
|
||||||
#include "mainwindow.h"
|
#include "mainwindow.h"
|
||||||
|
|
||||||
#include <KAboutApplicationDialog>
|
|
||||||
#include <KAboutData>
|
|
||||||
#include <QAction>
|
|
||||||
#include <QApplication>
|
#include <QApplication>
|
||||||
#include <QDesktopServices>
|
#include <QDesktopServices>
|
||||||
#include <QHBoxLayout>
|
#include <QHBoxLayout>
|
||||||
#include <QListWidget>
|
#include <QListWidget>
|
||||||
#include <QMenuBar>
|
#include <QMenuBar>
|
||||||
#include <QTableWidget>
|
|
||||||
#include <QUrl>
|
#include <QUrl>
|
||||||
#include <physis.hpp>
|
#include <physis.hpp>
|
||||||
|
|
||||||
|
|
|
@ -3,8 +3,6 @@
|
||||||
|
|
||||||
#include "mainwindow.h"
|
#include "mainwindow.h"
|
||||||
|
|
||||||
#include <KAboutApplicationDialog>
|
|
||||||
#include <KAboutData>
|
|
||||||
#include <QAction>
|
#include <QAction>
|
||||||
#include <QApplication>
|
#include <QApplication>
|
||||||
#include <QDesktopServices>
|
#include <QDesktopServices>
|
||||||
|
@ -12,8 +10,6 @@
|
||||||
#include <QHBoxLayout>
|
#include <QHBoxLayout>
|
||||||
#include <QListWidget>
|
#include <QListWidget>
|
||||||
#include <QMenuBar>
|
#include <QMenuBar>
|
||||||
#include <QTableWidget>
|
|
||||||
#include <QUrl>
|
|
||||||
#include <physis.hpp>
|
#include <physis.hpp>
|
||||||
|
|
||||||
#include "mdlpart.h"
|
#include "mdlpart.h"
|
||||||
|
|
|
@ -3,7 +3,6 @@
|
||||||
|
|
||||||
#include "exdpart.h"
|
#include "exdpart.h"
|
||||||
|
|
||||||
#include <QDebug>
|
|
||||||
#include <QFile>
|
#include <QFile>
|
||||||
#include <QGroupBox>
|
#include <QGroupBox>
|
||||||
#include <QJsonArray>
|
#include <QJsonArray>
|
||||||
|
|
|
@ -3,7 +3,6 @@
|
||||||
|
|
||||||
#include "exlpart.h"
|
#include "exlpart.h"
|
||||||
|
|
||||||
#include <QDebug>
|
|
||||||
#include <QFile>
|
#include <QFile>
|
||||||
#include <QJsonArray>
|
#include <QJsonArray>
|
||||||
#include <QJsonDocument>
|
#include <QJsonDocument>
|
||||||
|
|
|
@ -44,7 +44,7 @@ bool VulkanWindow::event(QEvent *e)
|
||||||
render();
|
render();
|
||||||
break;
|
break;
|
||||||
case QEvent::Resize: {
|
case QEvent::Resize: {
|
||||||
QResizeEvent *resizeEvent = (QResizeEvent *)e;
|
auto resizeEvent = (QResizeEvent *)e;
|
||||||
auto surface = m_instance->surfaceForWindow(this);
|
auto surface = m_instance->surfaceForWindow(this);
|
||||||
if (surface != nullptr) {
|
if (surface != nullptr) {
|
||||||
m_renderer->resize(surface,
|
m_renderer->resize(surface,
|
||||||
|
@ -53,7 +53,7 @@ bool VulkanWindow::event(QEvent *e)
|
||||||
}
|
}
|
||||||
} break;
|
} break;
|
||||||
case QEvent::PlatformSurface:
|
case QEvent::PlatformSurface:
|
||||||
if (static_cast<QPlatformSurfaceEvent *>(e)->surfaceEventType() == QPlatformSurfaceEvent::SurfaceAboutToBeDestroyed && m_initialized) {
|
if (dynamic_cast<QPlatformSurfaceEvent *>(e)->surfaceEventType() == QPlatformSurfaceEvent::SurfaceAboutToBeDestroyed && m_initialized) {
|
||||||
m_renderer->destroySwapchain();
|
m_renderer->destroySwapchain();
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -74,7 +74,7 @@ public:
|
||||||
void reloadModel(RenderModel &model, uint32_t 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(const std::vector<RenderModel> &models);
|
||||||
|
|
||||||
VkInstance instance = VK_NULL_HANDLE;
|
VkInstance instance = VK_NULL_HANDLE;
|
||||||
VkPhysicalDevice physicalDevice = VK_NULL_HANDLE;
|
VkPhysicalDevice physicalDevice = VK_NULL_HANDLE;
|
||||||
|
@ -114,9 +114,9 @@ public:
|
||||||
|
|
||||||
uint32_t findMemoryType(uint32_t typeFilter, VkMemoryPropertyFlags properties);
|
uint32_t findMemoryType(uint32_t typeFilter, VkMemoryPropertyFlags properties);
|
||||||
|
|
||||||
VkShaderModule createShaderModule(const uint32_t *code, const int length);
|
VkShaderModule createShaderModule(const uint32_t *code, int length);
|
||||||
|
|
||||||
VkShaderModule loadShaderFromDisk(const std::string_view path);
|
VkShaderModule loadShaderFromDisk(std::string_view path);
|
||||||
|
|
||||||
VkCommandBuffer beginSingleTimeCommands();
|
VkCommandBuffer beginSingleTimeCommands();
|
||||||
|
|
||||||
|
|
|
@ -434,7 +434,7 @@ void Renderer::destroySwapchain()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Renderer::render(std::vector<RenderModel> models)
|
void Renderer::render(const std::vector<RenderModel> &models)
|
||||||
{
|
{
|
||||||
vkWaitForFences(device, 1, &inFlightFences[currentFrame], VK_TRUE, std::numeric_limits<uint64_t>::max());
|
vkWaitForFences(device, 1, &inFlightFences[currentFrame], VK_TRUE, std::numeric_limits<uint64_t>::max());
|
||||||
|
|
||||||
|
|
|
@ -1,9 +1,7 @@
|
||||||
// SPDX-FileCopyrightText: 2023 Joshua Goins <josh@redstrate.com>
|
// SPDX-FileCopyrightText: 2023 Joshua Goins <josh@redstrate.com>
|
||||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
|
|
||||||
#include <QDebug>
|
|
||||||
#include <QFormLayout>
|
#include <QFormLayout>
|
||||||
#include <QHBoxLayout>
|
|
||||||
#include <QLabel>
|
#include <QLabel>
|
||||||
#include <QTreeWidget>
|
#include <QTreeWidget>
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue