From 43826c7839a6f2fb0ff721e487cc8e4304761ed9 Mon Sep 17 00:00:00 2001 From: ysj1173886760 <1173886760@qq.com> Date: Wed, 2 Jun 2021 21:15:15 +0800 Subject: [PATCH] GRAPHICS: MACGUI: clean the code for stripFormat in mactext --- graphics/macgui/mactext.cpp | 19 +++---------------- 1 file changed, 3 insertions(+), 16 deletions(-) diff --git a/graphics/macgui/mactext.cpp b/graphics/macgui/mactext.cpp index 52e101697e0..d74ef15b5da 100644 --- a/graphics/macgui/mactext.cpp +++ b/graphics/macgui/mactext.cpp @@ -1325,24 +1325,11 @@ Common::U32String stripFormat(const Common::U32String &str) { res += *l++; } } else if (*l == '\015') { // binary format - // 12 for total // we are skipping the formatting stuffs - l++; - l += 2; - l++; - l += 2; - l += 2; - l += 2; - l += 2; + // this number 12, and the number 23, is the size of our format + l += 12; } else if (*l == '\016') { // human-readable format - // 23 for total, should we replace it with l += 23; - l++; - l += 4; - l += 2; - l += 4; - l += 4; - l += 4; - l += 4; + l += 23; } else { res += *l++; }