From 152f96e95300010765e20fe15998768836f76950 Mon Sep 17 00:00:00 2001 From: Gwilym Kuiper Date: Thu, 23 Feb 2023 21:22:53 +0000 Subject: [PATCH] Consistently use 'gba --- agb/src/display/blend.rs | 14 +++++++------- agb/src/display/object.rs | 8 ++++---- agb/src/display/window.rs | 6 +++--- 3 files changed, 14 insertions(+), 14 deletions(-) diff --git a/agb/src/display/blend.rs b/agb/src/display/blend.rs index f5182ffc..01443e63 100644 --- a/agb/src/display/blend.rs +++ b/agb/src/display/blend.rs @@ -45,22 +45,22 @@ pub enum BlendMode { /// Manages the blending, won't cause anything to change unless [Blend::commit] /// is called. -pub struct Blend<'a> { +pub struct Blend<'gba> { targets: u16, blend_weights: u16, fade_weight: u16, - phantom: PhantomData<&'a ()>, + phantom: PhantomData<&'gba ()>, } /// When making many modifications to a layer, it is convenient to operate on /// that layer directly. This is created by the [Blend::layer] function and /// operates on that layer. -pub struct BlendLayer<'blend, 'a> { - blend: &'blend mut Blend<'a>, +pub struct BlendLayer<'blend, 'gba> { + blend: &'blend mut Blend<'gba>, layer: Layer, } -impl<'a> BlendLayer<'_, 'a> { +impl<'gba> BlendLayer<'_, 'gba> { /// Set whether a background is enabled for blending on this layer. pub fn set_background_enable(&mut self, background: BackgroundID, enable: bool) -> &mut Self { self.blend @@ -98,7 +98,7 @@ const BLEND_ALPHAS: *mut u16 = 0x0400_0052 as *mut _; const BLEND_FADES: *mut u16 = 0x0400_0054 as *mut _; -impl<'a> Blend<'a> { +impl<'gba> Blend<'gba> { pub(crate) fn new() -> Self { let blend = Self { targets: 0, @@ -141,7 +141,7 @@ impl<'a> Blend<'a> { /// Creates a layer object whose functions work only on that layer, /// convenient when performing multiple operations on that layer without the /// need of specifying the layer every time. - pub fn layer(&mut self, layer: Layer) -> BlendLayer<'_, 'a> { + pub fn layer(&mut self, layer: Layer) -> BlendLayer<'_, 'gba> { BlendLayer { blend: self, layer } } diff --git a/agb/src/display/object.rs b/agb/src/display/object.rs index d0c70aed..df1eb842 100644 --- a/agb/src/display/object.rs +++ b/agb/src/display/object.rs @@ -694,12 +694,12 @@ impl ObjectControllerStatic { /// A controller that distributes objects and sprites. This controls sprites and /// objects being copied to vram when it needs to be. -pub struct ObjectController<'a> { - phantom: PhantomData<&'a ()>, +pub struct ObjectController<'gba> { + phantom: PhantomData<&'gba ()>, inner: ObjectControllerReference<'static>, } -impl<'a> Drop for ObjectController<'a> { +impl<'gba> Drop for ObjectController<'gba> { fn drop(&mut self) { unsafe { ObjectControllerReference::uninit(); @@ -709,7 +709,7 @@ impl<'a> Drop for ObjectController<'a> { const HIDDEN_VALUE: u16 = 0b10 << 8; -impl<'object> ObjectController<'object> { +impl<'gba> ObjectController<'gba> { /// Commits the objects to vram and delete sprites where possible. This /// should be called shortly after having waited for the next vblank to /// ensure what is displayed on screen doesn't change part way through. diff --git a/agb/src/display/window.rs b/agb/src/display/window.rs index b8705029..5a454b44 100644 --- a/agb/src/display/window.rs +++ b/agb/src/display/window.rs @@ -9,11 +9,11 @@ use super::{tiled::BackgroundID, DISPLAY_CONTROL, HEIGHT, WIDTH}; /// The windows feature of the Game Boy Advance can selectively display /// backgrounds or objects on the screen and can selectively enable and disable /// effects. This gives out references and holds changes before they can be committed. -pub struct Windows<'a> { +pub struct Windows<'gba> { wins: [MovableWindow; 2], out: Window, obj: Window, - phantom: PhantomData<&'a ()>, + phantom: PhantomData<&'gba ()>, } const REG_HORIZONTAL_BASE: *mut u16 = 0x0400_0040 as *mut _; @@ -29,7 +29,7 @@ pub enum WinIn { Win1, } -impl<'a> Windows<'a> { +impl<'gba> Windows<'gba> { pub(crate) fn new() -> Self { let s = Self { wins: [MovableWindow::new(), MovableWindow::new()],