mirror of
https://github.com/eried/portapack-mayhem.git
synced 2024-12-25 23:39:37 -05:00
Implement console "\n" -> crlf() behavior.
This commit is contained in:
parent
32319ddf9f
commit
ec977ccd05
@ -40,6 +40,9 @@ void Console::write(const std::string message) {
|
|||||||
const Font& font = s.font;
|
const Font& font = s.font;
|
||||||
const auto rect = screen_rect();
|
const auto rect = screen_rect();
|
||||||
for(const auto c : message) {
|
for(const auto c : message) {
|
||||||
|
if( c == '\n' ) {
|
||||||
|
crlf();
|
||||||
|
} else {
|
||||||
const auto glyph = font.glyph(c);
|
const auto glyph = font.glyph(c);
|
||||||
const auto advance = glyph.advance();
|
const auto advance = glyph.advance();
|
||||||
if( (pos.x + advance.x) > rect.width() ) {
|
if( (pos.x + advance.x) > rect.width() ) {
|
||||||
@ -53,6 +56,7 @@ void Console::write(const std::string message) {
|
|||||||
pos.x += advance.x;
|
pos.x += advance.x;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void Console::writeln(const std::string message) {
|
void Console::writeln(const std::string message) {
|
||||||
write(message);
|
write(message);
|
||||||
|
Loading…
Reference in New Issue
Block a user