From b1ff3526237bae0c9ffcde058158a33446fe4a6c Mon Sep 17 00:00:00 2001 From: Corwin Kuiper Date: Fri, 4 Jun 2021 22:39:10 +0100 Subject: [PATCH] use lifetimes to prevent affine matrix dropping --- agb/src/display/object.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/agb/src/display/object.rs b/agb/src/display/object.rs index fd9fe0ac..4aaef8d1 100644 --- a/agb/src/display/object.rs +++ b/agb/src/display/object.rs @@ -116,7 +116,7 @@ impl ObjectStandard<'_> { } } -impl ObjectAffine<'_> { +impl<'a> ObjectAffine<'a> { /// Commits the object to OAM such that the updated version is displayed on /// screen. Recommend to do this during VBlank. pub fn commit(&self) { @@ -153,7 +153,7 @@ impl ObjectAffine<'_> { } /// Sets the affine matrix to use. Changing the affine matrix will change /// how the sprite is rendered. - pub fn set_affine_mat(&mut self, aff: &AffineMatrix) { + pub fn set_affine_mat(&mut self, aff: &'a AffineMatrix) { self.attributes.set_affine(aff.loan.index); self.aff_id = Some(aff.loan.index); }