A bit more cleanup of render but kind of stuck on what to do further.
This commit is contained in:
parent
7cb03594a3
commit
c8fa68815b
2 changed files with 24 additions and 22 deletions
11
render.cpp
11
render.cpp
|
@ -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;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
TODAY'S GOAL:
|
TODAY'S GOAL:
|
||||||
|
|
||||||
* Clean up renderer.
|
|
||||||
* panels and everything except renderer should use character coodinates
|
* panels and everything except renderer should use character coodinates
|
||||||
* Image -> Text converter.
|
* Image -> Text converter.
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue