aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authortslil clingman <>2021-10-25 21:50:12 -0400
committertslil clingman <>2021-10-25 21:50:12 -0400
commit681d7f8a489b4dbfa0712351c1d993d2df47469c (patch)
tree2064dc5512d7b328ec030f31051ef9ee1be1de93 /src
parent5cecadb81ccab1a2e6ff264349f5fa73a720db9f (diff)
Corrected bug in colour blending, chose black instead of transparent
Diffstat (limited to 'src')
-rw-r--r--src/render.zig6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/render.zig b/src/render.zig
index 6c54a00..f2f06ae 100644
--- a/src/render.zig
+++ b/src/render.zig
@@ -480,11 +480,11 @@ fn playerDistComp(pos: [2]f32, lhs: level.Object, rhs: level.Object) bool {
fn fasterColourBlend(onto: Colour, from: Colour) Colour {
const af: u16 = from.a;
- const of: u16 = onto.a;
+ const ao: u16 = onto.a;
- const ablend: u16 = @divTrunc(of * (255 - af), 255);
+ const ablend: u16 = @divTrunc(ao * (255 - af), 255);
const na: u16 = af + ablend;
- if (na == 0) return Colour.Black;
+ if (na == 0) return Colour.Transparent;
const rf: u16 = from.r;
const ro: u16 = onto.r;