implemented terminal.clear function

This commit is contained in:
DaniTheSkunk 2022-10-21 05:29:46 +00:00
parent 477d08a1e3
commit 4957968eb8
1 changed files with 9 additions and 2 deletions

View File

@ -657,8 +657,7 @@ public class Terminal {
var y = rect.getY() + 1;
for(int iy = 0; iy < rect.getWidth() - 2; ++iy) {
for(int ix = 0; ix < rect.getWidth() - 2; ++ix) {
setBackgroundColor(
new Vec2i(x + ix, y + iy),
setBackgroundColor(new Vec2i(x + ix, y + iy),
backgroundColor
);
}
@ -666,6 +665,14 @@ public class Terminal {
}
}
public void clear(Color bg) {
for(var cell : cells) {
cell.halfWidth = false;
cell.fullChar = 0;
cell.bgColor = bg;
}
}
private class Cell {
int fullChar;
int secondChar;