mirror of
https://github.com/eried/portapack-mayhem.git
synced 2025-06-29 09:07:17 -04:00
Clear with buffer clear
This commit is contained in:
parent
d175e33990
commit
ddffc69937
2 changed files with 6 additions and 6 deletions
|
@ -570,7 +570,10 @@ Console::Console(
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
void Console::clear() {
|
void Console::clear(bool clear_buffer = false) {
|
||||||
|
if(clear_buffer)
|
||||||
|
buffer.clear();
|
||||||
|
|
||||||
display.fill_rectangle(
|
display.fill_rectangle(
|
||||||
screen_rect(),
|
screen_rect(),
|
||||||
Color::black()
|
Color::black()
|
||||||
|
@ -595,10 +598,7 @@ void Console::write(std::string message) {
|
||||||
pen_color = s.foreground;
|
pen_color = s.foreground;
|
||||||
escape = false;
|
escape = false;
|
||||||
} else {
|
} else {
|
||||||
if (c=='\f') { //Add FORM FEED (clear screen)
|
if (c == '\n') {
|
||||||
clear();
|
|
||||||
buffer.clear();
|
|
||||||
} else if (c == '\n') {
|
|
||||||
crlf();
|
crlf();
|
||||||
} else if (c == '\x1B') {
|
} else if (c == '\x1B') {
|
||||||
escape = true;
|
escape = true;
|
||||||
|
|
|
@ -312,7 +312,7 @@ class Console : public Widget {
|
||||||
public:
|
public:
|
||||||
Console(Rect parent_rect);
|
Console(Rect parent_rect);
|
||||||
|
|
||||||
void clear();
|
void clear(bool clear_buffer);
|
||||||
void write(std::string message);
|
void write(std::string message);
|
||||||
void writeln(std::string message);
|
void writeln(std::string message);
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue