Renderer of ANSI codes to SFML is now working. Does seem to be a little slow but that'll be easy to fix later.

This commit is contained in:
Zed A. Shaw 2024-11-02 03:53:33 -04:00
parent ae484bf425
commit a36b187879
8 changed files with 96 additions and 62 deletions

View file

@ -87,10 +87,10 @@ void SFMLRender::draw_screen(bool clear, float map_off_x, float map_off_y) {
// make a copy so we don't modify the cached one
auto bg_sprite = get_text_sprite(L'');
auto bg_bounds = bg_sprite.getLocalBounds();
sf::Color def_fg(color(Value::LIGHT_LIGHT));
sf::Color def_fg(color(Value::MID));
sf::Color def_bg(color(Value::BLACK));
parse_ansi(map_screenout, def_fg, def_bg, [&](sf::Color bg, sf::Color fg, char tile) {
parse_ansi(map_screen_utf8, def_fg, def_bg, [&](sf::Color bg, sf::Color fg, wchar_t tile) {
if(tile == '\n') {
// don't bother processing newlines, just skip
y += $line_spacing;