use Pos instead of Vec2<Int>

This commit is contained in:
2022-03-08 13:33:40 +01:00
parent edc3195192
commit de35f34173
13 changed files with 59 additions and 45 deletions

View File

@@ -1,6 +1,7 @@
package kernel.ui;
import util.Pos;
import util.Vec.Vec2;
import util.Color;
import kernel.ui.TermWriteable;
@@ -18,7 +19,7 @@ class TermBuffer implements TermWriteable {
**/
private var screenBuffer:Array<Array<Pixel>>;
private var cursorPos:Vec2<Int> = {x: 0, y: 0};
private var cursorPos:Pos = {x: 0, y: 0};
private var currentTextColor:Color = White;
private var currentBgColor:Color = Black;
private var cursorBlink: Bool = false;
@@ -90,7 +91,7 @@ class TermBuffer implements TermWriteable {
target.setBackgroundColor(currentBgColor);
}
private function safeWriteScreenBuffer(pos:Vec2<Int>, char:String) {
private function safeWriteScreenBuffer(pos:Pos, char:String) {
if (screenBuffer.length > pos.y && screenBuffer[pos.y].length > pos.x) {
screenBuffer[pos.y][pos.x].char = char;
screenBuffer[pos.y][pos.x].bg = currentBgColor;
@@ -120,7 +121,7 @@ class TermBuffer implements TermWriteable {
]);
}
public function getCursorPos():Vec2<Int> {
public function getCursorPos():Pos {
return cursorPos;
}