mirror of
https://codeberg.org/demostf/parser.git
synced 2026-06-04 10:34:11 +02:00
fixes
This commit is contained in:
parent
1b1878a77b
commit
deb3375ac7
11 changed files with 97 additions and 32 deletions
|
|
@ -1,13 +1,26 @@
|
|||
use bitstream_reader::BitRead;
|
||||
use bitstream_reader::{BitRead, LittleEndian};
|
||||
use serde::Serialize;
|
||||
|
||||
#[derive(BitRead, Debug, Clone, Copy, Default)]
|
||||
use crate::{ReadResult, Stream};
|
||||
|
||||
#[derive(Debug, Clone, Copy, Default, Serialize)]
|
||||
pub struct Vector {
|
||||
pub x: f32,
|
||||
pub y: f32,
|
||||
pub z: f32,
|
||||
}
|
||||
|
||||
#[derive(BitRead, Debug, Clone, Copy, Default)]
|
||||
impl BitRead<LittleEndian> for Vector {
|
||||
fn read(stream: &mut Stream) -> ReadResult<Self> {
|
||||
Ok(Vector {
|
||||
x: stream.read()?,
|
||||
y: stream.read()?,
|
||||
z: stream.read()?,
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(BitRead, Debug, Clone, Copy, Default, Serialize)]
|
||||
pub struct VectorXY {
|
||||
pub x: f32,
|
||||
pub y: f32,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue