|
|
@ -122,13 +122,15 @@ void SFMLRender::render_grid(const std::wstring &text, float x, float y) { |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
[&](wchar_t tile) { |
|
|
|
[&](wchar_t tile) { |
|
|
|
if(tile == '\n') { |
|
|
|
switch(tile) { |
|
|
|
|
|
|
|
case '\r': break; // ignore it
|
|
|
|
|
|
|
|
case '\n': { |
|
|
|
// don't bother processing newlines, just skip
|
|
|
|
// don't bother processing newlines, just skip
|
|
|
|
y += $line_spacing; |
|
|
|
y += $line_spacing; |
|
|
|
x = start_x; |
|
|
|
x = start_x; |
|
|
|
} else if(tile == L'\r') { |
|
|
|
} |
|
|
|
return; // skip these, just windows junk
|
|
|
|
break; |
|
|
|
} else { |
|
|
|
default: { |
|
|
|
$bg_sprite.setPosition({x, y}); |
|
|
|
$bg_sprite.setPosition({x, y}); |
|
|
|
|
|
|
|
|
|
|
|
// only get a new sprite if the tile changed
|
|
|
|
// only get a new sprite if the tile changed
|
|
|
@ -146,6 +148,7 @@ void SFMLRender::render_grid(const std::wstring &text, float x, float y) { |
|
|
|
// next cell
|
|
|
|
// next cell
|
|
|
|
x += $base_glyph.advance; |
|
|
|
x += $base_glyph.advance; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
}); |
|
|
|
}); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|