summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorquou <quou@disroot.org>2024-08-04 15:33:14 +1000
committerquou <quou@disroot.org>2024-08-04 15:33:14 +1000
commita0c6f0eea627058beb834c72cd3d521f8ed08459 (patch)
tree56212f3a5d80f5ca0420ab2fb93ec5920b33978a
parentd5e84753f4201730c6953c3b978fc934f2cacedb (diff)
expose line API
-rw-r--r--render.c7
-rw-r--r--render.h19
2 files changed, 19 insertions, 7 deletions
diff --git a/render.c b/render.c
index 13eb99e..a55e062 100644
--- a/render.c
+++ b/render.c
@@ -408,13 +408,6 @@ Colour sample_tex(
return r;
}
-typedef struct {
- int x, y;
- int dx, dy;
- int sx, sy;
- int e;
-} Line;
-
void init_line(
Line* l,
const int* f,
diff --git a/render.h b/render.h
index e7d459f..a30331f 100644
--- a/render.h
+++ b/render.h
@@ -6,6 +6,25 @@
struct Map;
typedef struct {
+ int x, y;
+ int dx, dy;
+ int sx, sy;
+ int e;
+} Line;
+
+void init_line(
+ Line* l,
+ const int* f,
+ const int* t
+);
+void init_lerp(
+ Line* l,
+ int a, int b,
+ int x, int y
+);
+void step_line(Line* l);
+
+typedef struct {
unsigned char r, g, b, a;
} Colour;