Веб-сайт самохостера Lotigara

summaryrefslogtreecommitdiff
path: root/source/rendering
diff options
context:
space:
mode:
authorKae <80987908+Novaenia@users.noreply.github.com>2023-06-28 00:20:22 +1000
committerKae <80987908+Novaenia@users.noreply.github.com>2023-06-28 00:20:22 +1000
commit152af876550ec63bac9d7aa27b1994268c80f878 (patch)
treeec1ca9b7f013252505ad719990900a64cc3afc35 /source/rendering
parent2496789ea7632556486560f80590d5ba7f8da0f5 (diff)
Fix broken regex, make game timestep non-const
Diffstat (limited to 'source/rendering')
-rw-r--r--source/rendering/StarTextPainter.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/source/rendering/StarTextPainter.cpp b/source/rendering/StarTextPainter.cpp
index 6db4a34..eb161d4 100644
--- a/source/rendering/StarTextPainter.cpp
+++ b/source/rendering/StarTextPainter.cpp
@@ -6,9 +6,9 @@
namespace Star {
namespace Text {
+ static auto stripEscapeRegex = std::regex(strf("\\{:c}[^;]*{:c}", CmdEsc, EndEsc));
String stripEscapeCodes(String const& s) {
- String regex = strf("\\{}[^;]*{}", CmdEsc, EndEsc);
- return std::regex_replace(s.utf8(), std::regex(regex.utf8()), "");
+ return std::regex_replace(s.utf8(), stripEscapeRegex, "");
}
String preprocessEscapeCodes(String const& s) {