1
Fork 0
mirror of https://github.com/redstrate/Novus.git synced 2025-04-22 20:17:46 +00:00

More small code improvements/cleanup

This commit is contained in:
Joshua Goins 2023-12-10 08:39:45 -05:00
parent 34082479ed
commit 039b6e6d30
11 changed files with 9 additions and 21 deletions

View file

@ -44,7 +44,7 @@ inline QString encryptGameArg(const QString &arg)
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 key = ticks & 0xFFFF0000u;

View file

@ -52,7 +52,7 @@ GearView::GearView(GameData *data, FileCache &cache, QWidget *parent)
Q_UNUSED(QtConcurrent::run(QThreadPool::globalInstance(), [this] {
updatePart();
Q_EMIT loadingChanged(false);
}));
}))
}
};
}

View file

@ -10,7 +10,7 @@ Vector3Edit::Vector3Edit(glm::vec3 &vec, QWidget *parent)
: QWidget(parent)
, vec(vec)
{
QHBoxLayout *itemsLayout = new QHBoxLayout(this);
auto itemsLayout = new QHBoxLayout(this);
spinBoxes.x = new QDoubleSpinBox();
spinBoxes.y = new QDoubleSpinBox();

View file

@ -3,15 +3,11 @@
#include "mainwindow.h"
#include <KAboutApplicationDialog>
#include <KAboutData>
#include <QAction>
#include <QApplication>
#include <QDesktopServices>
#include <QHBoxLayout>
#include <QListWidget>
#include <QMenuBar>
#include <QTableWidget>
#include <QUrl>
#include <physis.hpp>

View file

@ -3,8 +3,6 @@
#include "mainwindow.h"
#include <KAboutApplicationDialog>
#include <KAboutData>
#include <QAction>
#include <QApplication>
#include <QDesktopServices>
@ -12,8 +10,6 @@
#include <QHBoxLayout>
#include <QListWidget>
#include <QMenuBar>
#include <QTableWidget>
#include <QUrl>
#include <physis.hpp>
#include "mdlpart.h"

View file

@ -3,7 +3,6 @@
#include "exdpart.h"
#include <QDebug>
#include <QFile>
#include <QGroupBox>
#include <QJsonArray>

View file

@ -3,7 +3,6 @@
#include "exlpart.h"
#include <QDebug>
#include <QFile>
#include <QJsonArray>
#include <QJsonDocument>

View file

@ -44,7 +44,7 @@ bool VulkanWindow::event(QEvent *e)
render();
break;
case QEvent::Resize: {
QResizeEvent *resizeEvent = (QResizeEvent *)e;
auto resizeEvent = (QResizeEvent *)e;
auto surface = m_instance->surfaceForWindow(this);
if (surface != nullptr) {
m_renderer->resize(surface,
@ -53,7 +53,7 @@ bool VulkanWindow::event(QEvent *e)
}
} break;
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();
}
break;

View file

@ -74,7 +74,7 @@ public:
void reloadModel(RenderModel &model, uint32_t lod);
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;
VkPhysicalDevice physicalDevice = VK_NULL_HANDLE;
@ -114,9 +114,9 @@ public:
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();

View file

@ -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());

View file

@ -1,9 +1,7 @@
// SPDX-FileCopyrightText: 2023 Joshua Goins <josh@redstrate.com>
// SPDX-License-Identifier: GPL-3.0-or-later
#include <QDebug>
#include <QFormLayout>
#include <QHBoxLayout>
#include <QLabel>
#include <QTreeWidget>