Kaynağa Gözat

fix: formatting went wrong

Almamu 1 ay önce
ebeveyn
işleme
14f5b9b458

+ 2 - 2
src/WallpaperEngine/Render/AlbumTexture.cpp

@@ -77,9 +77,9 @@ void AlbumTexture::copyContents (const TextureProvider& other) const noexcept {
     glBindTexture (GL_TEXTURE_2D, other.getTextureID (0));
 
     if (GLEW_VERSION_4_5) {
-        glGetnTexImage (GL_TEXTURE_2D, 0, GL_RGBA, GL_UNSIGNED_BYTE, bufferSize, buffer);
+	glGetnTexImage (GL_TEXTURE_2D, 0, GL_RGBA, GL_UNSIGNED_BYTE, bufferSize, buffer);
     } else {
-        glGetTexImage (GL_TEXTURE_2D, 0, GL_RGBA, GL_UNSIGNED_BYTE, buffer);
+	glGetTexImage (GL_TEXTURE_2D, 0, GL_RGBA, GL_UNSIGNED_BYTE, buffer);
     }
 
     // Upload into another texture

+ 7 - 13
src/WallpaperEngine/Render/Objects/CImage.cpp

@@ -213,10 +213,8 @@ CImage::CImage (Wallpapers::CScene& scene, const Image& image) :
     if ((size.x == 0.0f || size.y == 0.0f) && this->m_texture != nullptr) {
 	size.x = static_cast<float> (this->m_texture->getRealWidth ());
 	size.y = static_cast<float> (this->m_texture->getRealHeight ());
-    } else if (
-	(size.x == 0.0f || size.y == 0.0f) && this->getImage ().model->width.has_value ()
-	&& this->getImage ().model->height.has_value ()
-    ) {
+    } else if ((size.x == 0.0f || size.y == 0.0f) && this->getImage ().model->width.has_value ()
+	       && this->getImage ().model->height.has_value ()) {
 	size.x = static_cast<float> (this->getImage ().model->width.value ());
 	size.y = static_cast<float> (this->getImage ().model->height.value ());
     }
@@ -291,11 +289,9 @@ CImage::CImage (Wallpapers::CScene& scene, const Image& image) :
 	    / static_cast<float> (this->getTexture ()->getTextureHeight (0));
     }
     // calculate the correct texCoord limits for the texture based on the texture screen size and real size
-    else if (
-	this->getTexture () != nullptr
-	&& (this->getTexture ()->getTextureWidth (0) != this->getTexture ()->getRealWidth ()
-	    || this->getTexture ()->getTextureHeight (0) != this->getTexture ()->getRealHeight ())
-    ) {
+    else if (this->getTexture () != nullptr
+	     && (this->getTexture ()->getTextureWidth (0) != this->getTexture ()->getRealWidth ()
+		 || this->getTexture ()->getTextureHeight (0) != this->getTexture ()->getRealHeight ())) {
 	// Account for padding in non-power-of-two textures: clamp UVs to the real content
 	width = static_cast<float> (this->getTexture ()->getRealWidth ())
 	    / static_cast<float> (this->getTexture ()->getTextureWidth (0));
@@ -967,10 +963,8 @@ glm::vec2 CImage::resolveGeometrySize (float sceneWidth, float sceneHeight, glm:
     if ((size.x == 0.0f || size.y == 0.0f) && this->m_texture != nullptr) {
 	size.x = static_cast<float> (this->m_texture->getRealWidth ());
 	size.y = static_cast<float> (this->m_texture->getRealHeight ());
-    } else if (
-	(size.x == 0.0f || size.y == 0.0f) && this->getImage ().model->width.has_value ()
-	&& this->getImage ().model->height.has_value ()
-    ) {
+    } else if ((size.x == 0.0f || size.y == 0.0f) && this->getImage ().model->width.has_value ()
+	       && this->getImage ().model->height.has_value ()) {
 	size.x = static_cast<float> (this->getImage ().model->width.value ());
 	size.y = static_cast<float> (this->getImage ().model->height.value ());
     }

+ 6 - 7
src/WallpaperEngine/Render/Shaders/ShaderUnit.cpp

@@ -105,12 +105,10 @@ void ShaderUnit::preprocessVariables () {
 
 	if (combo != std::string::npos) {
 	    this->parseComboConfiguration (line.substr (combo + strlen ("// [COMBO] ")), 0);
-	} else if (
-	    uniform != std::string::npos && comment != std::string::npos && semicolon != std::string::npos &&
-	    // this check ensures that the comment is after the semicolon (so it's not a commented-out line)
-	    // this needs further refining as it's not taking into account block comments
-	    semicolon < comment
-	) {
+	} else if (uniform != std::string::npos && comment != std::string::npos && semicolon != std::string::npos &&
+		   // this check ensures that the comment is after the semicolon (so it's not a commented-out line)
+		   // this needs further refining as it's not taking into account block comments
+		   semicolon < comment) {
 	    // uniforms with comments should never have a value assigned, use this fact to detect the required parts
 	    const size_t last_space = line.find_last_of (' ', semicolon);
 
@@ -264,7 +262,8 @@ void ShaderUnit::preprocessIncludes () {
 	size_t current = 0;
 
 	while (
-	    std::regex_search (this->m_preprocessed.cbegin () + current, this->m_preprocessed.cend (), match, ifdef)) {
+	    std::regex_search (this->m_preprocessed.cbegin () + current, this->m_preprocessed.cend (), match, ifdef)
+	) {
 	    current += match.position ();
 
 	    // if it's opening an #ifdef keep track of the start of the block

+ 4 - 8
src/WallpaperEngine/Scripting/Adapters/VectorAdapter.cpp

@@ -223,19 +223,15 @@ int vector_property_set (
     void* into = nullptr;
 
     if (strcmp (name, "x") == 0) {
-	if constexpr (
-	    std::is_same_v<decltype (vec), glm::vec2> || std::is_same_v<decltype (vec), glm::vec3>
-	    || std::is_same_v<decltype (vec), glm::vec4>
-	) {
+	if constexpr (std::is_same_v<decltype (vec), glm::vec2> || std::is_same_v<decltype (vec), glm::vec3>
+		      || std::is_same_v<decltype (vec), glm::vec4>) {
 	    into = &vec.x;
 	} else if constexpr (std::is_same_v<decltype (vec), Color>) {
 	    into = &vec.r;
 	}
     } else if (strcmp (name, "y") == 0) {
-	if constexpr (
-	    std::is_same_v<decltype (vec), glm::vec2> || std::is_same_v<decltype (vec), glm::vec3>
-	    || std::is_same_v<decltype (vec), glm::vec4>
-	) {
+	if constexpr (std::is_same_v<decltype (vec), glm::vec2> || std::is_same_v<decltype (vec), glm::vec3>
+		      || std::is_same_v<decltype (vec), glm::vec4>) {
 	    into = &vec.y;
 	} else if constexpr (std::is_same_v<decltype (vec), Color>) {
 	    into = &vec.g;