From dc4bead590b8b7337bd4639b7a15056b11961eb4 Mon Sep 17 00:00:00 2001 From: Corwin Kuiper Date: Sun, 30 May 2021 19:53:36 +0100 Subject: [PATCH] write affine to oam --- agb/src/display/object.rs | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/agb/src/display/object.rs b/agb/src/display/object.rs index cc4f8ef8..0d5cf9bf 100644 --- a/agb/src/display/object.rs +++ b/agb/src/display/object.rs @@ -136,6 +136,17 @@ impl ObjectAttribute { } } +impl AffineMatrix { + #[allow(clippy::identity_op)] + pub fn commit(&self) { + let id = self.id as usize; + OBJECT_ATTRIBUTE_MEMORY.set((id + 0) * 4 + 3, self.attributes.p_a as u16); + OBJECT_ATTRIBUTE_MEMORY.set((id + 1) * 4 + 3, self.attributes.p_b as u16); + OBJECT_ATTRIBUTE_MEMORY.set((id + 2) * 4 + 3, self.attributes.p_c as u16); + OBJECT_ATTRIBUTE_MEMORY.set((id + 3) * 4 + 3, self.attributes.p_d as u16); + } +} + impl ObjectAttribute { fn new() -> Self { ObjectAttribute {