From 4a72a1035fb4ec7b4f1e64fa5e37b19e3d82dcd1 Mon Sep 17 00:00:00 2001 From: Michel Heily Date: Sat, 17 Aug 2019 21:27:36 +0300 Subject: [PATCH] Fix Rgb15::is_transparent bug Former-commit-id: f12729b993ec9bef94a58a4d48982c7d3939c45b --- src/core/gpu/mod.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/core/gpu/mod.rs b/src/core/gpu/mod.rs index 29b31bb..a3f8ef4 100644 --- a/src/core/gpu/mod.rs +++ b/src/core/gpu/mod.rs @@ -33,7 +33,6 @@ bitfield! { pub r, set_r: 4, 0; pub g, set_g: 9, 5; pub b, set_b: 14, 10; - pub is_transparent, _ : 15; } impl Rgb15 { @@ -56,6 +55,10 @@ impl Rgb15 { pub fn get_rgb(&self) -> (u16, u16, u16) { (self.r(), self.g(), self.b()) } + + pub fn is_transparent(&self) -> bool { + self.0 == 0x8000 + } } #[derive(Debug, Primitive, Copy, Clone)]