Prechádzať zdrojové kódy

fix: formatting went wrong again

Almamu 1 mesiac pred
rodič
commit
38a5d60cf5

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

@@ -213,8 +213,10 @@ 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 ());
     }
@@ -289,9 +291,11 @@ 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));
@@ -963,8 +967,10 @@ 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 ());
     }

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

@@ -105,10 +105,12 @@ 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);
 
@@ -262,8 +264,7 @@ 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

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

@@ -223,15 +223,19 @@ 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;