|
|
@ -110,13 +110,14 @@ void SFMLRender::render_text(std::wstring &text, float x, float y) { |
|
|
|
float width_delta = 0; |
|
|
|
float width_delta = 0; |
|
|
|
float height_delta = 0; |
|
|
|
float height_delta = 0; |
|
|
|
sf::Sprite &sprite = get_text_sprite(last_tile); |
|
|
|
sf::Sprite &sprite = get_text_sprite(last_tile); |
|
|
|
|
|
|
|
const float start_x = x; |
|
|
|
|
|
|
|
|
|
|
|
// make a copy so we don't modify the cached one
|
|
|
|
// make a copy so we don't modify the cached one
|
|
|
|
$ansi.parse(text, [&](sf::Color bg, sf::Color fg, wchar_t tile) { |
|
|
|
$ansi.parse(text, [&](sf::Color bg, sf::Color fg, wchar_t tile) { |
|
|
|
if(tile == '\n') { |
|
|
|
if(tile == '\n') { |
|
|
|
// don't bother processing newlines, just skip
|
|
|
|
// don't bother processing newlines, just skip
|
|
|
|
y += $line_spacing; |
|
|
|
y += $line_spacing; |
|
|
|
x = GAME_MAP_POS; |
|
|
|
x = start_x; |
|
|
|
} else if(tile == L'\r') { |
|
|
|
} else if(tile == L'\r') { |
|
|
|
return; // skip these, just windows junk
|
|
|
|
return; // skip these, just windows junk
|
|
|
|
} else { |
|
|
|
} else { |
|
|
|