From f9d9220eadb5358ccd5c770876e2cfaf6b698a1d Mon Sep 17 00:00:00 2001 From: Corwin Date: Thu, 4 Aug 2022 21:49:21 +0100 Subject: [PATCH] function to reset the window --- agb/src/display/window.rs | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/agb/src/display/window.rs b/agb/src/display/window.rs index a4ccb7cb..0a218733 100644 --- a/agb/src/display/window.rs +++ b/agb/src/display/window.rs @@ -74,6 +74,12 @@ impl Window { self.window_bits &= u8::MAX ^ (1 << bit); self.window_bits |= (value as u8) << bit; } + + pub fn reset(&mut self) -> &mut Self { + *self = Self::new(); + + self + } pub fn set_blend_enable(&mut self, blnd: bool) -> &mut Self { self.set_bit(5, blnd); @@ -109,6 +115,11 @@ impl MovableWindow { } } + pub fn reset(&mut self) -> &mut Self { + *self = Self::new(); + + self + } pub fn set_blend_enable(&mut self, blnd: bool) -> &mut Self { self.inner.set_blend_enable(blnd); self