mirror of
https://github.com/italicsjenga/agb.git
synced 2024-12-24 00:31:34 +11:00
new function for blend
This commit is contained in:
parent
d0b3d9e7b3
commit
41ccd56919
|
@ -28,6 +28,17 @@ const BLEND_ALPHAS: *mut u16 = 0x0400_0052 as *mut _;
|
|||
const BLEND_FADES: *mut u16 = 0x0400_0054 as *mut _;
|
||||
|
||||
impl Blend {
|
||||
pub(crate) fn new() -> Self {
|
||||
let blend = Self {
|
||||
targets: 0,
|
||||
blend_weights: 0,
|
||||
fade_weight: 0,
|
||||
};
|
||||
blend.commit();
|
||||
|
||||
blend
|
||||
}
|
||||
|
||||
pub fn reset_targets(&mut self) -> &mut Self {
|
||||
self.targets = 0;
|
||||
|
||||
|
@ -107,3 +118,9 @@ impl Blend {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl Drop for Blend {
|
||||
fn drop(&mut self) {
|
||||
self.reset().commit();
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue