Maraiah/source/marathon/map/note.rs

31 lines
613 B
Rust

//! `Note` type.
use crate::{durandal::err::*, marathon::text::*};
use super::pnts::*;
/// Reads a `NOTE` chunk.
pub fn read(b: &[u8]) -> ResultS<(Note, usize)>
{
read_data! {
endian: BIG, buf: b, size: 72, start: 0, data {
let pos = read_point[2; 4];
let poly = u16[6];
let text = mac_roman_cstr[8; 64] no_try;
}
}
Ok((Note{pos, poly, text}, 72))
}
/// Overhead map annotations.
#[cfg_attr(feature = "serde_obj", derive(serde::Serialize))]
#[derive(Debug, Eq, PartialEq)]
pub struct Note
{
pub pos: Point,
pub poly: u16,
pub text: String,
}
// EOF