From 8792146ddb8064305391f753eb8e2061054661a0 Mon Sep 17 00:00:00 2001 From: Corwin Date: Mon, 14 Feb 2022 20:57:11 +0000 Subject: [PATCH] use correct copys --- agb/src/display/object.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/agb/src/display/object.rs b/agb/src/display/object.rs index ea215817..b8770b52 100644 --- a/agb/src/display/object.rs +++ b/agb/src/display/object.rs @@ -277,7 +277,7 @@ impl<'a, 'b> Object<'a, 'b> { let attrs: [u8; 6] = core::mem::transmute(attrs); (OBJECT_ATTRIBUTE_MEMORY as *mut u8) .add(self.loan.index as usize * (4 * 2)) - .copy_from(attrs.as_ptr(), attrs.len()) + .copy_from_nonoverlapping(attrs.as_ptr(), attrs.len()) }; } } @@ -359,7 +359,7 @@ impl SpriteController { unsafe { dest.as_ptr() - .copy_from(sprite.data.as_ptr(), sprite.data.len()) + .copy_from_nonoverlapping(sprite.data.as_ptr(), sprite.data.len()) } let storage = Storage::from_sprite_ptr(dest); @@ -393,7 +393,7 @@ impl SpriteControllerInner { unsafe { dest.as_ptr() .cast::() - .copy_from(palette.colours.as_ptr(), palette.colours.len()) + .copy_from_nonoverlapping(palette.colours.as_ptr(), palette.colours.len()) } let storage = Storage::from_palette_ptr(dest);