Compare commits

...

3 Commits

Author SHA1 Message Date
5c1b142630 updated readme 2022-02-21 17:47:17 +01:00
ec00115216 default terminate action 2022-02-21 17:46:38 +01:00
fd1428c749 moved pixel 2022-02-21 17:04:36 +01:00
5 changed files with 18 additions and 9 deletions

View File

@@ -33,4 +33,4 @@ You could use minecraft to run the programm or you could use [craftos pc](https:
## Websconsole
Use `make webconsole` to run a http server that prints the log output of the programm to the terminal. Run `haxe` with the `-D webconsole` flag.
You may need to [allow connections](https://github.com/cc-tweaked/CC-Tweaked/wiki/Allowing-access-to-local-IPs) to any ip when using webconsole ingame.

View File

@@ -1,5 +1,6 @@
package kernel;
import cc.OS;
import util.Debug;
import kernel.ui.WindowManager;
import kernel.peripherals.Peripherals.Peripheral;
@@ -13,9 +14,14 @@ class Init {
WindowManager.instance = new WindowManager();
MainTerm.instance = new MainTerm();
Log.init();
Net.instance = new Net();
Log.init();
// Register default terminate handler
KernelEvents.instance.onTerminate.handle(_->{
OS.reboot();
});
Debug.printBuildInfo();
}

9
src/kernel/ui/Pixel.hx Normal file
View File

@@ -0,0 +1,9 @@
package kernel.ui;
import util.Color;
@:structInit class Pixel {
public var char:String;
public var bg:Color;
public var textColor:Color;
}

View File

@@ -6,12 +6,6 @@ import util.Vec.Vec2;
import util.Color;
import lib.TermWriteable;
@:structInit class Pixel {
public var char:String;
public var bg:Color;
public var textColor:Color;
}
class TermBuffer implements TermWriteable {
/**
format [y][x]. First index is the line. Second index the char in the line.

View File

@@ -1,7 +1,7 @@
package lib.ui;
import util.Vec.Vec2;
import kernel.ui.TermBuffer.Pixel;
import kernel.ui.Pixel;
abstract Canvas(Array<Array<Pixel>>) to Array<Array<Pixel>> {
inline public function new() {