wgtk/space/section/
bwcs.rs

1use std::io::{Read, Seek};
2
3use super::{Section, SectionId};
4use crate::util::io::WgReadExt;
5
6
7/// CompiledSpaceSettings section.
8#[derive(Debug)]
9pub struct BWCS {
10    pub values: [f32; 6]
11}
12
13impl Section for BWCS {
14
15    const ID: &'static SectionId = b"BWCS";
16
17    fn decode<R: Read + Seek>(read: &mut R) -> std::io::Result<Self> {
18
19        let size = read.read_single_head()?;
20        assert_eq!(size, 24);
21
22        let mut values = [0.0; 6];
23        for value in &mut values {
24            *value = read.read_f32()?;
25        }
26
27        Ok(BWCS { values })
28
29    }
30
31}