From c3e5696a83fd3d2c78be267b55c433ebb45a6fb2 Mon Sep 17 00:00:00 2001 From: Quaternions Date: Tue, 31 Dec 2024 04:20:10 -0800 Subject: [PATCH] no stupid Bool thing --- src/v1.rs | 21 +++------------------ 1 file changed, 3 insertions(+), 18 deletions(-) diff --git a/src/v1.rs b/src/v1.rs index 7e8415b..621ba29 100644 --- a/src/v1.rs +++ b/src/v1.rs @@ -16,23 +16,6 @@ fn trey_double(f:f64)->f64{ f64::from_bits(m|(e<<52)|(s<<63)) } -#[binrw] -#[brw(little)] -#[derive(Clone,Copy,Debug)] -pub enum Bool{ - #[brw(magic=0u32)] - False, - #[brw(magic=1u32)] - True, -} -impl Into for Bool{ - fn into(self)->bool{ - match self{ - Bool::False=>false, - Bool::True=>true, - } - } -} #[binrw] #[brw(little)] pub struct Vector2{ @@ -124,7 +107,9 @@ pub struct WorldEventSetTime{ #[binrw] #[brw(little)] pub struct WorldEventSetPaused{ - pub paused:Bool, + #[br(map=|paused:u32|paused!=0)] + #[bw(map=|paused:&bool|*paused as u32)] + pub paused:bool, #[brw(magic=b"quatdata")] __:(), }