mirror of
https://github.com/italicsjenga/agb.git
synced 2024-12-24 00:31:34 +11:00
Consistently use 'gba
This commit is contained in:
parent
33c65474de
commit
152f96e953
|
@ -45,22 +45,22 @@ pub enum BlendMode {
|
||||||
|
|
||||||
/// Manages the blending, won't cause anything to change unless [Blend::commit]
|
/// Manages the blending, won't cause anything to change unless [Blend::commit]
|
||||||
/// is called.
|
/// is called.
|
||||||
pub struct Blend<'a> {
|
pub struct Blend<'gba> {
|
||||||
targets: u16,
|
targets: u16,
|
||||||
blend_weights: u16,
|
blend_weights: u16,
|
||||||
fade_weight: u16,
|
fade_weight: u16,
|
||||||
phantom: PhantomData<&'a ()>,
|
phantom: PhantomData<&'gba ()>,
|
||||||
}
|
}
|
||||||
|
|
||||||
/// When making many modifications to a layer, it is convenient to operate on
|
/// 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
|
/// that layer directly. This is created by the [Blend::layer] function and
|
||||||
/// operates on that layer.
|
/// operates on that layer.
|
||||||
pub struct BlendLayer<'blend, 'a> {
|
pub struct BlendLayer<'blend, 'gba> {
|
||||||
blend: &'blend mut Blend<'a>,
|
blend: &'blend mut Blend<'gba>,
|
||||||
layer: Layer,
|
layer: Layer,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<'a> BlendLayer<'_, 'a> {
|
impl<'gba> BlendLayer<'_, 'gba> {
|
||||||
/// Set whether a background is enabled for blending on this layer.
|
/// Set whether a background is enabled for blending on this layer.
|
||||||
pub fn set_background_enable(&mut self, background: BackgroundID, enable: bool) -> &mut Self {
|
pub fn set_background_enable(&mut self, background: BackgroundID, enable: bool) -> &mut Self {
|
||||||
self.blend
|
self.blend
|
||||||
|
@ -98,7 +98,7 @@ const BLEND_ALPHAS: *mut u16 = 0x0400_0052 as *mut _;
|
||||||
|
|
||||||
const BLEND_FADES: *mut u16 = 0x0400_0054 as *mut _;
|
const BLEND_FADES: *mut u16 = 0x0400_0054 as *mut _;
|
||||||
|
|
||||||
impl<'a> Blend<'a> {
|
impl<'gba> Blend<'gba> {
|
||||||
pub(crate) fn new() -> Self {
|
pub(crate) fn new() -> Self {
|
||||||
let blend = Self {
|
let blend = Self {
|
||||||
targets: 0,
|
targets: 0,
|
||||||
|
@ -141,7 +141,7 @@ impl<'a> Blend<'a> {
|
||||||
/// Creates a layer object whose functions work only on that layer,
|
/// Creates a layer object whose functions work only on that layer,
|
||||||
/// convenient when performing multiple operations on that layer without the
|
/// convenient when performing multiple operations on that layer without the
|
||||||
/// need of specifying the layer every time.
|
/// 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 }
|
BlendLayer { blend: self, layer }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -694,12 +694,12 @@ impl ObjectControllerStatic {
|
||||||
|
|
||||||
/// A controller that distributes objects and sprites. This controls sprites and
|
/// A controller that distributes objects and sprites. This controls sprites and
|
||||||
/// objects being copied to vram when it needs to be.
|
/// objects being copied to vram when it needs to be.
|
||||||
pub struct ObjectController<'a> {
|
pub struct ObjectController<'gba> {
|
||||||
phantom: PhantomData<&'a ()>,
|
phantom: PhantomData<&'gba ()>,
|
||||||
inner: ObjectControllerReference<'static>,
|
inner: ObjectControllerReference<'static>,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<'a> Drop for ObjectController<'a> {
|
impl<'gba> Drop for ObjectController<'gba> {
|
||||||
fn drop(&mut self) {
|
fn drop(&mut self) {
|
||||||
unsafe {
|
unsafe {
|
||||||
ObjectControllerReference::uninit();
|
ObjectControllerReference::uninit();
|
||||||
|
@ -709,7 +709,7 @@ impl<'a> Drop for ObjectController<'a> {
|
||||||
|
|
||||||
const HIDDEN_VALUE: u16 = 0b10 << 8;
|
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
|
/// Commits the objects to vram and delete sprites where possible. This
|
||||||
/// should be called shortly after having waited for the next vblank to
|
/// should be called shortly after having waited for the next vblank to
|
||||||
/// ensure what is displayed on screen doesn't change part way through.
|
/// ensure what is displayed on screen doesn't change part way through.
|
||||||
|
|
|
@ -9,11 +9,11 @@ use super::{tiled::BackgroundID, DISPLAY_CONTROL, HEIGHT, WIDTH};
|
||||||
/// The windows feature of the Game Boy Advance can selectively display
|
/// The windows feature of the Game Boy Advance can selectively display
|
||||||
/// backgrounds or objects on the screen and can selectively enable and disable
|
/// 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.
|
/// effects. This gives out references and holds changes before they can be committed.
|
||||||
pub struct Windows<'a> {
|
pub struct Windows<'gba> {
|
||||||
wins: [MovableWindow; 2],
|
wins: [MovableWindow; 2],
|
||||||
out: Window,
|
out: Window,
|
||||||
obj: Window,
|
obj: Window,
|
||||||
phantom: PhantomData<&'a ()>,
|
phantom: PhantomData<&'gba ()>,
|
||||||
}
|
}
|
||||||
|
|
||||||
const REG_HORIZONTAL_BASE: *mut u16 = 0x0400_0040 as *mut _;
|
const REG_HORIZONTAL_BASE: *mut u16 = 0x0400_0040 as *mut _;
|
||||||
|
@ -29,7 +29,7 @@ pub enum WinIn {
|
||||||
Win1,
|
Win1,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<'a> Windows<'a> {
|
impl<'gba> Windows<'gba> {
|
||||||
pub(crate) fn new() -> Self {
|
pub(crate) fn new() -> Self {
|
||||||
let s = Self {
|
let s = Self {
|
||||||
wins: [MovableWindow::new(), MovableWindow::new()],
|
wins: [MovableWindow::new(), MovableWindow::new()],
|
||||||
|
|
Loading…
Reference in a new issue