mirror of
https://github.com/Almamu/linux-wallpaperengine.git
synced 2025-09-14 05:46:48 +08:00
chore: some cleanup everywhere
This commit is contained in:
parent
f74527d23b
commit
c3381c348d
@ -23,7 +23,7 @@ struct VirtualAdapter final : Adapter {
|
||||
[[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 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, MemoryStreamSharedPtr stream);
|
||||
|
||||
|
@ -39,7 +39,7 @@ X11FullScreenDetector::X11FullScreenDetector (
|
||||
try {
|
||||
// attempt casting to CGLFWOpenGLDriver, this will throw if it's not possible
|
||||
// so we can gracely handle the error
|
||||
dynamic_cast <GLFWOpenGLDriver&> (this->m_driver);
|
||||
std::ignore = dynamic_cast <GLFWOpenGLDriver&> (this->m_driver);
|
||||
} catch (std::exception&) {
|
||||
sLog.exception ("X11 FullScreen Detector initialized with the wrong video driver... This is a bug...");
|
||||
}
|
||||
|
@ -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 {
|
||||
const auto it = this->m_fbos.find (name);
|
||||
|
||||
if (it != this->m_fbos.end ())
|
||||
if (const auto it = this->m_fbos.find (name); it != this->m_fbos.end ()) {
|
||||
return it->second;
|
||||
}
|
||||
|
||||
if (this->m_parent == nullptr) {
|
||||
return nullptr;
|
||||
|
@ -431,12 +431,12 @@ void CPass::setupShaders () {
|
||||
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 ());
|
||||
|
||||
// compile the shaders
|
||||
const GLuint vertexShaderID = compileShader (shaders.first.c_str (), GL_VERTEX_SHADER);
|
||||
const GLuint fragmentShaderID = compileShader (shaders.second.c_str (), GL_FRAGMENT_SHADER);
|
||||
const GLuint vertexShaderID = compileShader (vertex.c_str (), GL_VERTEX_SHADER);
|
||||
const GLuint fragmentShaderID = compileShader (fragment.c_str (), GL_FRAGMENT_SHADER);
|
||||
// create the final program
|
||||
this->m_programID = glCreateProgram ();
|
||||
// link the shaders together
|
||||
|
@ -105,15 +105,15 @@ TBuiltInResource BuiltInResource = {
|
||||
.maxTaskWorkGroupSizeZ_NV = 1,
|
||||
.maxMeshViewCountNV = 4,
|
||||
.limits = {
|
||||
.nonInductiveForLoops = 1,
|
||||
.whileLoops = 1,
|
||||
.doWhileLoops = 1,
|
||||
.generalUniformIndexing = 1,
|
||||
.generalAttributeMatrixVectorIndexing = 1,
|
||||
.generalVaryingIndexing = 1,
|
||||
.generalSamplerIndexing = 1,
|
||||
.generalVariableIndexing = 1,
|
||||
.generalConstantMatrixVectorIndexing = 1,
|
||||
.nonInductiveForLoops = true,
|
||||
.whileLoops = true,
|
||||
.doWhileLoops = true,
|
||||
.generalUniformIndexing = true,
|
||||
.generalAttributeMatrixVectorIndexing = true,
|
||||
.generalVaryingIndexing = true,
|
||||
.generalSamplerIndexing = true,
|
||||
.generalVariableIndexing = true,
|
||||
.generalConstantMatrixVectorIndexing = true,
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -38,7 +38,6 @@ Shader::Shader (
|
||||
this->m_fragment.linkToUnit (&this->m_vertex);
|
||||
}
|
||||
|
||||
|
||||
const std::string& Shader::vertex () {
|
||||
return this->m_vertex.compile ();
|
||||
}
|
||||
@ -59,7 +58,7 @@ const std::map<std::string, int>& Shader::getCombos () const {
|
||||
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* fragment = nullptr;
|
||||
|
||||
|
@ -70,7 +70,7 @@ class Shader {
|
||||
* @param name
|
||||
* @return
|
||||
*/
|
||||
[[nodiscard]] ParameterSearchResult findParameter (const std::string& name);
|
||||
[[nodiscard]] ParameterSearchResult findParameter (const std::string& name) const;
|
||||
|
||||
private:
|
||||
/**
|
||||
|
@ -9,7 +9,7 @@ namespace WallpaperEngine::Render::Wallpapers {
|
||||
class CVideo final : public CWallpaper {
|
||||
public:
|
||||
CVideo (
|
||||
const Wallpaper& video, RenderContext& context, AudioContext& audioContext,
|
||||
const Wallpaper& wallpaper, RenderContext& context, AudioContext& audioContext,
|
||||
const WallpaperState::TextureUVsScaling& scalingMode,
|
||||
const uint32_t& clampMode);
|
||||
|
||||
|
@ -4,7 +4,7 @@
|
||||
#include "include/cef_scheme.h"
|
||||
|
||||
namespace WallpaperEngine::Data::Model {
|
||||
class Project;
|
||||
struct Project;
|
||||
}
|
||||
|
||||
namespace WallpaperEngine::WebBrowser::CEF {
|
||||
|
@ -1,4 +1,4 @@
|
||||
#!/bin/bash
|
||||
|
||||
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
|
Loading…
Reference in New Issue
Block a user