Maraiah/maraiah/map/trmf.rs

29 lines
483 B
Rust
Raw Normal View History

2019-04-01 02:09:01 -07:00
//! `Face` type.
2019-06-13 18:09:07 -07:00
use crate::err::*;
2019-04-01 02:09:01 -07:00
/// Reads a `Face`.
pub fn read(b: &[u8]) -> ResultS<(Face, usize)>
{
2019-07-05 20:21:11 -07:00
read_data! {
endian: BIG, buf: b, size: 6, start: 0, data {
let start = u16[0] usize;
let face = u16[2];
let color = u16[4];
}
}
2019-04-01 02:09:01 -07:00
2019-07-05 20:21:11 -07:00
Ok((Face{start, face, color}, 6))
2019-04-01 02:09:01 -07:00
}
/// A text face.
#[cfg_attr(feature = "serde_obj", derive(serde::Serialize))]
#[derive(Debug, Eq, PartialEq)]
2019-06-25 03:52:21 -07:00
pub struct Face {
2019-07-05 20:21:11 -07:00
pub start: usize,
pub face: u16,
pub color: u16,
2019-04-01 02:09:01 -07:00
}
// EOF