From 376a5213ac82316e280ea7ffb371b6ad417aebde Mon Sep 17 00:00:00 2001 From: peony Date: Fri, 1 Nov 2024 21:53:59 +0100 Subject: [PATCH] Removed triangle drawing stuff --- sysdata/libraries/render/src/lib.hb | 2 - sysdata/libraries/render/src/software.hb | 64 ------------------------ sysdata/programs/mouse_driver/meta.toml | 12 ----- sysdata/system_config.toml | 6 +-- 4 files changed, 3 insertions(+), 81 deletions(-) diff --git a/sysdata/libraries/render/src/lib.hb b/sysdata/libraries/render/src/lib.hb index 15cf4b4..ae0624b 100644 --- a/sysdata/libraries/render/src/lib.hb +++ b/sysdata/libraries/render/src/lib.hb @@ -45,8 +45,6 @@ put_line := mode.put_line clear := mode.clear put_surface := mode.put_surface put_scaled := mode.put_scaled -put_tri := mode.put_tri -put_filled_tri := mode.put_filled_tri put_text := mode.put_text // thanks peony for these three! put_trirect := mode.put_trirect diff --git a/sysdata/libraries/render/src/software.hb b/sysdata/libraries/render/src/software.hb index ad38fa5..723cde0 100644 --- a/sysdata/libraries/render/src/software.hb +++ b/sysdata/libraries/render/src/software.hb @@ -350,70 +350,6 @@ put_hline := fn(surface: Surface, y: uint, x0: uint, x1: uint, color: Color): vo return } -put_tri := fn(surface: Surface, p0: Vec2(uint), p1: Vec2(uint), p2: Vec2(uint), color: Color): void { - @inline(put_line, surface, p0, p1, color) - @inline(put_line, surface, p1, p2, color) - @inline(put_line, surface, p2, p0, color) - return -} - -put_filled_tri := fn(surface: Surface, p0: Vec2(uint), p1: Vec2(uint), p2: Vec2(uint), color: Color): void { - if p2.y < p0.y { - tmp := p0 - p0 = p2 - p2 = tmp - } - - if p1.y < p0.y { - tmp := p0 - p0 = p1 - p1 = tmp - } - - if p2.y < p1.y { - tmp := p1 - p1 = p2 - p2 = tmp - } - - primary_dx := @as(int, @bitcast(p2.x - p0.x)) - primary_dy := @as(int, @bitcast(p2.y - p0.y)) - primary_x := p0.x - primary_step := @as(int, primary_dx) / @as(int, primary_dy) - primary_error := @as(int, 2) * primary_dx - primary_dy - - secondary_dx := @as(int, @bitcast(p1.x - p0.x)) - secondary_dy := @as(int, @bitcast(p1.y - p0.y)) - secondary_x := p0.x - secondary_step := secondary_dx / secondary_dy - secondary_error := @as(int, 2) * secondary_dx - secondary_dy - - y := p0.y - loop if y > p1.y break else { - put_pixel(surface, .(primary_x, y), color) - put_pixel(surface, .(secondary_x, y), color) - primary_x = @as(uint, @bitcast(@as(int, @bitcast(primary_x)) + primary_step)) - secondary_x = @as(uint, @bitcast(@as(int, @bitcast(secondary_x)) + secondary_step)) - y += 1 - } - - secondary_dx = @as(int, @bitcast(p2.x - p1.x)) - secondary_dy = @as(int, @bitcast(p2.y - p1.y)) - secondary_x = p1.x - secondary_step = secondary_dx / secondary_dy - secondary_error = @as(int, 2) * secondary_dx - secondary_dy - - loop if y > p2.y break else { - put_pixel(surface, .(primary_x, y), color) - put_pixel(surface, .(secondary_x, y), color) - primary_x = @as(uint, @bitcast(@as(int, @bitcast(primary_x)) + primary_step)) - secondary_x = @as(uint, @bitcast(@as(int, @bitcast(secondary_x)) + secondary_step)) - y += 1 - } - - return -} - put_circle := fn(surface: Surface, pos: Vec2(uint), radius: uint, color: Color): void { x := 0 y := radius diff --git a/sysdata/programs/mouse_driver/meta.toml b/sysdata/programs/mouse_driver/meta.toml index 949ad99..551d882 100644 --- a/sysdata/programs/mouse_driver/meta.toml +++ b/sysdata/programs/mouse_driver/meta.toml @@ -9,15 +9,3 @@ hblang.version = "1.0.0" [build] command = "hblang src/main.hb" - -[package] -name = "mouse_driver" -authors = [""] - -[dependants.libraries] - -[dependants.binaries] -hblang.version = "1.0.0" - -[build] -command = "hblang src/main.hb" diff --git a/sysdata/system_config.toml b/sysdata/system_config.toml index 8bf4afa..6f4aa2f 100644 --- a/sysdata/system_config.toml +++ b/sysdata/system_config.toml @@ -29,6 +29,9 @@ resolution = "1600x900x24" # [boot.limine.ableos.modules.render_example] # path = "boot:///render_example.hbf" +[boot.limine.ableos.modules.mouse_driver] +path = "boot:///mouse_driver.hbf" + # [boot.limine.ableos.modules.serial_driver] # path = "boot:///serial_driver.hbf" @@ -56,8 +59,5 @@ resolution = "1600x900x24" # [boot.limine.ableos.modules.pumpkin_print] # path = "boot:///pumpkin_print.hbf" -# [boot.limine.ableos.modules.mouse_driver] -# path = "boot:///mouse_driver.hbf" - # [boot.limine.ableos.modules.mouse_test] # path = "boot:///mouse_test.hbf"