From 7ad160e30f0758e17445b28f5d6d31cb45bcbd4d Mon Sep 17 00:00:00 2001 From: Corwin Date: Sat, 6 Aug 2022 18:40:59 +0100 Subject: [PATCH] use struct newtypes --- agb/src/display/mod.rs | 7 +++++-- agb/src/display/video.rs | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/agb/src/display/mod.rs b/agb/src/display/mod.rs index a747005a..620c1070 100644 --- a/agb/src/display/mod.rs +++ b/agb/src/display/mod.rs @@ -75,7 +75,7 @@ pub struct Display { } #[non_exhaustive] -pub struct ObjectDistribution {} +pub struct ObjectDistribution; impl ObjectDistribution { pub fn get(&mut self) -> ObjectController { @@ -84,7 +84,7 @@ impl ObjectDistribution { } #[non_exhaustive] -pub struct WindowDist {} +pub struct WindowDist; impl WindowDist { pub fn get(&mut self) -> Windows { @@ -104,6 +104,9 @@ impl BlendDist { impl Display { pub(crate) const unsafe fn new() -> Self { Display { + video: Video, + object: ObjectDistribution, + window: WindowDist, blend: BlendDist, } } diff --git a/agb/src/display/video.rs b/agb/src/display/video.rs index 6367eff0..9f62e3fa 100644 --- a/agb/src/display/video.rs +++ b/agb/src/display/video.rs @@ -9,7 +9,7 @@ use super::{ /// /// Most games will use tiled modes, as bitmap modes are too slow to run at the full 60 FPS. #[non_exhaustive] -pub struct Video {} +pub struct Video; impl Video { /// Bitmap mode that provides a 16-bit colour framebuffer