From 60ab186b5ce1ee2e3b3226edeb6e4ef9d51cdcf4 Mon Sep 17 00:00:00 2001 From: Swung0x48 Date: Sat, 10 Jan 2026 00:43:54 +0800 Subject: [PATCH] [Fix] (MG_Backend/DirectGLES): patches for Photon (cont.) --- MobileGL/MG_Backend/DirectGLES/Managers.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/MobileGL/MG_Backend/DirectGLES/Managers.cpp b/MobileGL/MG_Backend/DirectGLES/Managers.cpp index 999cc8bd..b4b67dea 100644 --- a/MobileGL/MG_Backend/DirectGLES/Managers.cpp +++ b/MobileGL/MG_Backend/DirectGLES/Managers.cpp @@ -893,17 +893,19 @@ namespace MobileGL::MG_Backend::DirectGLES { String findStr = "if (distance_weight_sum == 0.0)"; String replaceStr = "if (distance_weight_sum <= 0.0001)"; auto pos = source.find(findStr); - if (pos != String::npos) { + while (pos != String::npos) { MGLOG_D("Applying patch #1 to Photon..."); source.replace(pos, findStr.length(), replaceStr); + pos = source.find(findStr, pos); } findStr = "1000000.0"; replaceStr = "65500.0"; pos = source.find(findStr); - if (pos != String::npos) { + while (pos != String::npos) { MGLOG_D("Applying patch #2 to Photon..."); source.replace(pos, findStr.length(), replaceStr); + pos = source.find(findStr, pos); } const char* sourceCStr = source.c_str();