From 377a2e441bdc0d2b896af39b24f1fd561114c0d3 Mon Sep 17 00:00:00 2001 From: outfoxxed Date: Tue, 8 Aug 2023 00:03:28 -0700 Subject: [PATCH] do while --- src/render/OpenGL.cpp | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/src/render/OpenGL.cpp b/src/render/OpenGL.cpp index 71b884de..89ad3fdb 100644 --- a/src/render/OpenGL.cpp +++ b/src/render/OpenGL.cpp @@ -1723,17 +1723,19 @@ void CHyprOpenGLImpl::createBGTextureForMonitor(CMonitor* pMonitor) { texName += "2K.png"; } + // goto is banned? ok have a do while. std::string texPath = "/usr/share/hyprland/" + texName; - if (std::filesystem::exists(texPath)) - goto hastex; - texPath = "/usr/local/share/hyprland/" + texName; - if (std::filesystem::exists(texPath)) - goto hastex; - texPath = "assets/" + texName; - if (std::filesystem::exists(texPath)) - goto hastex; - texPath = ""; -hastex: + do { + if (std::filesystem::exists(texPath)) + break; + texPath = "/usr/local/share/hyprland/" + texName; + if (std::filesystem::exists(texPath)) + break; + texPath = "assets/" + texName; + if (std::filesystem::exists(texPath)) + break; + texPath = ""; + } while (false); PTEX->m_vSize = textureSize;