From 095a5a793f75c1a1008955738302a6a10f3c8674 Mon Sep 17 00:00:00 2001 From: Nat Quayle Nelson Date: Mon, 18 Aug 2025 11:48:32 -0500 Subject: [PATCH] substitutions no longer needed --- src/game/boe.newgraph.cpp | 6 ------ src/gfx/render_text.cpp | 11 ----------- 2 files changed, 17 deletions(-) diff --git a/src/game/boe.newgraph.cpp b/src/game/boe.newgraph.cpp index 3a82e33f..5db0708a 100644 --- a/src/game/boe.newgraph.cpp +++ b/src/game/boe.newgraph.cpp @@ -1013,12 +1013,6 @@ void place_talk_str(std::string str_to_place,std::string str_to_place2,short col // The added spaces ensure that end-of-word boundaries are found std::string str = str_to_place + " |" + str_to_place2 + " "; - // TODO use a font where we don't need this - extern std::map substitutions; - for(auto it : substitutions){ - boost::replace_all(str, it.first, it.second); - } - std::vector hilites; std::vector nodes; int wordStart = 0, wordEnd = 0; diff --git a/src/gfx/render_text.cpp b/src/gfx/render_text.cpp index a86861c6..23745d48 100644 --- a/src/gfx/render_text.cpp +++ b/src/gfx/render_text.cpp @@ -108,18 +108,10 @@ static void push_snippets(size_t start, size_t end, text_params_t& options, size } while(start < upper_bound); } -std::map substitutions = { - {"–", "--"} -}; - break_info_t calculate_line_wrapping(rectangle dest_rect, std::string str, TextStyle style) { break_info_t break_info; if(str.empty()) return break_info; // Nothing to do! - for(auto it : substitutions){ - boost::replace_all(str, it.first, it.second); - } - sf::Text str_to_draw; style.applyTo(str_to_draw); short str_len = str.length(); @@ -260,9 +252,6 @@ static void win_draw_string(sf::RenderTarget& dest_window,rectangle dest_rect,st // TODO: Why the heck are we drawing a whole line higher than requested!? adjust_y -= str_to_draw.getLocalBounds().height; - for(auto it : substitutions){ - boost::replace_all(str, it.first, it.second); - } str_to_draw.setString(sf::String::fromUtf8(str.begin(), str.end())); short total_width = str_to_draw.getLocalBounds().width;