chore: some cleanup everywhere

This commit is contained in:
Almamu 2025-09-13 22:08:59 +02:00
parent f74527d23b
commit c3381c348d
10 changed files with 21 additions and 23 deletions

View File

@ -23,7 +23,7 @@ struct VirtualAdapter final : Adapter {
[[nodiscard]] std::filesystem::path physicalPath (const std::filesystem::path& path) const override; [[nodiscard]] std::filesystem::path physicalPath (const std::filesystem::path& path) const override;
void add (const std::filesystem::path& path, const char* data); void add (const std::filesystem::path& path, const char* data);
void add (const std::filesystem::path& path, const JSON& contents); void add (const std::filesystem::path& path, const JSON& data);
void add (const std::filesystem::path& path, const std::string& data); void add (const std::filesystem::path& path, const std::string& data);
void add (const std::filesystem::path& path, MemoryStreamSharedPtr stream); void add (const std::filesystem::path& path, MemoryStreamSharedPtr stream);

View File

@ -39,7 +39,7 @@ X11FullScreenDetector::X11FullScreenDetector (
try { try {
// attempt casting to CGLFWOpenGLDriver, this will throw if it's not possible // attempt casting to CGLFWOpenGLDriver, this will throw if it's not possible
// so we can gracely handle the error // so we can gracely handle the error
dynamic_cast <GLFWOpenGLDriver&> (this->m_driver); std::ignore = dynamic_cast <GLFWOpenGLDriver&> (this->m_driver);
} catch (std::exception&) { } catch (std::exception&) {
sLog.exception ("X11 FullScreen Detector initialized with the wrong video driver... This is a bug..."); sLog.exception ("X11 FullScreen Detector initialized with the wrong video driver... This is a bug...");
} }

View File

@ -44,10 +44,9 @@ std::shared_ptr<CFBO> FBOProvider::alias (const std::string& newName, const std:
} }
std::shared_ptr<CFBO> FBOProvider::find (const std::string& name) const { std::shared_ptr<CFBO> FBOProvider::find (const std::string& name) const {
const auto it = this->m_fbos.find (name); if (const auto it = this->m_fbos.find (name); it != this->m_fbos.end ()) {
if (it != this->m_fbos.end ())
return it->second; return it->second;
}
if (this->m_parent == nullptr) { if (this->m_parent == nullptr) {
return nullptr; return nullptr;

View File

@ -431,12 +431,12 @@ void CPass::setupShaders () {
this->m_pass.textures, this->m_override.textures, this->m_override.constants this->m_pass.textures, this->m_override.textures, this->m_override.constants
); );
const auto shaders = Shaders::GLSLContext::get ().toGlsl ( const auto [vertex, fragment] = Shaders::GLSLContext::get ().toGlsl (
this->m_shader->vertex (), this->m_shader->fragment ()); this->m_shader->vertex (), this->m_shader->fragment ());
// compile the shaders // compile the shaders
const GLuint vertexShaderID = compileShader (shaders.first.c_str (), GL_VERTEX_SHADER); const GLuint vertexShaderID = compileShader (vertex.c_str (), GL_VERTEX_SHADER);
const GLuint fragmentShaderID = compileShader (shaders.second.c_str (), GL_FRAGMENT_SHADER); const GLuint fragmentShaderID = compileShader (fragment.c_str (), GL_FRAGMENT_SHADER);
// create the final program // create the final program
this->m_programID = glCreateProgram (); this->m_programID = glCreateProgram ();
// link the shaders together // link the shaders together

View File

@ -105,15 +105,15 @@ TBuiltInResource BuiltInResource = {
.maxTaskWorkGroupSizeZ_NV = 1, .maxTaskWorkGroupSizeZ_NV = 1,
.maxMeshViewCountNV = 4, .maxMeshViewCountNV = 4,
.limits = { .limits = {
.nonInductiveForLoops = 1, .nonInductiveForLoops = true,
.whileLoops = 1, .whileLoops = true,
.doWhileLoops = 1, .doWhileLoops = true,
.generalUniformIndexing = 1, .generalUniformIndexing = true,
.generalAttributeMatrixVectorIndexing = 1, .generalAttributeMatrixVectorIndexing = true,
.generalVaryingIndexing = 1, .generalVaryingIndexing = true,
.generalSamplerIndexing = 1, .generalSamplerIndexing = true,
.generalVariableIndexing = 1, .generalVariableIndexing = true,
.generalConstantMatrixVectorIndexing = 1, .generalConstantMatrixVectorIndexing = true,
} }
}; };

View File

@ -38,7 +38,6 @@ Shader::Shader (
this->m_fragment.linkToUnit (&this->m_vertex); this->m_fragment.linkToUnit (&this->m_vertex);
} }
const std::string& Shader::vertex () { const std::string& Shader::vertex () {
return this->m_vertex.compile (); return this->m_vertex.compile ();
} }
@ -59,7 +58,7 @@ const std::map<std::string, int>& Shader::getCombos () const {
return this->m_combos; return this->m_combos;
} }
Shader::ParameterSearchResult Shader::findParameter (const std::string& name) { Shader::ParameterSearchResult Shader::findParameter (const std::string& name) const {
Variables::ShaderVariable* vertex = nullptr; Variables::ShaderVariable* vertex = nullptr;
Variables::ShaderVariable* fragment = nullptr; Variables::ShaderVariable* fragment = nullptr;

View File

@ -70,7 +70,7 @@ class Shader {
* @param name * @param name
* @return * @return
*/ */
[[nodiscard]] ParameterSearchResult findParameter (const std::string& name); [[nodiscard]] ParameterSearchResult findParameter (const std::string& name) const;
private: private:
/** /**

View File

@ -9,7 +9,7 @@ namespace WallpaperEngine::Render::Wallpapers {
class CVideo final : public CWallpaper { class CVideo final : public CWallpaper {
public: public:
CVideo ( CVideo (
const Wallpaper& video, RenderContext& context, AudioContext& audioContext, const Wallpaper& wallpaper, RenderContext& context, AudioContext& audioContext,
const WallpaperState::TextureUVsScaling& scalingMode, const WallpaperState::TextureUVsScaling& scalingMode,
const uint32_t& clampMode); const uint32_t& clampMode);

View File

@ -4,7 +4,7 @@
#include "include/cef_scheme.h" #include "include/cef_scheme.h"
namespace WallpaperEngine::Data::Model { namespace WallpaperEngine::Data::Model {
class Project; struct Project;
} }
namespace WallpaperEngine::WebBrowser::CEF { namespace WallpaperEngine::WebBrowser::CEF {

View File

@ -1,4 +1,4 @@
#!/bin/bash #!/bin/bash
shopt -s globstar shopt -s globstar
clang-tidy --format-style file src/**/*.cpp -p cmake-build-debug clang-tidy --format-style file src/WallpaperEngine/**/*.cpp src/*.cpp src/Steam/**/*.cpp -p cmake-build-debug