maraiah: rename Minf to Info
parent
cb9d844404
commit
d64a4167d8
|
@ -96,7 +96,7 @@ pub enum Chunk
|
||||||
/** `LINS` chunks. */ Lins(Vec<map::lins::Line>),
|
/** `LINS` chunks. */ Lins(Vec<map::lins::Line>),
|
||||||
/** `LITE` chunks. */ Lite(Vec<map::lite::Light>),
|
/** `LITE` chunks. */ Lite(Vec<map::lite::Light>),
|
||||||
/** `MNpx` chunks. */ Mnpx(Vec<map::mnpx::Monster>),
|
/** `MNpx` chunks. */ Mnpx(Vec<map::mnpx::Monster>),
|
||||||
/** `Minf` chunks. */ Minf(map::minf::Minf),
|
/** `Minf` chunks. */ Minf(map::minf::Info),
|
||||||
/** `NAME` chunks. */ Name(Vec<String>),
|
/** `NAME` chunks. */ Name(Vec<String>),
|
||||||
/** `NOTE` chunks. */ Note(Vec<map::note::Note>),
|
/** `NOTE` chunks. */ Note(Vec<map::note::Note>),
|
||||||
/** `OBJS` chunks. */ Objs(Vec<map::objs::Object>),
|
/** `OBJS` chunks. */ Objs(Vec<map::objs::Object>),
|
||||||
|
|
|
@ -1,10 +1,10 @@
|
||||||
//! `Minf` type.
|
//! `Info` type.
|
||||||
|
|
||||||
use crate::{err::*, text::*};
|
use crate::{err::*, text::*};
|
||||||
use bitflags::bitflags;
|
use bitflags::bitflags;
|
||||||
|
|
||||||
/// Reads a `Minf` chunk.
|
/// Reads a `Minf` chunk.
|
||||||
pub fn read(b: &[u8]) -> ResultS<Minf>
|
pub fn read(b: &[u8]) -> ResultS<Info>
|
||||||
{
|
{
|
||||||
read_data! {
|
read_data! {
|
||||||
endian: BIG, buf: b, size: 88, start: 0, data {
|
endian: BIG, buf: b, size: 88, start: 0, data {
|
||||||
|
@ -18,12 +18,12 @@ pub fn read(b: &[u8]) -> ResultS<Minf>
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Ok(Minf{texture_id, physics_id, skypict_id, miss_flags, envi_flags,
|
Ok(Info{texture_id, physics_id, skypict_id, miss_flags, envi_flags,
|
||||||
entr_flags, level_name})
|
entr_flags, level_name})
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Writes a `Minf` chunk.
|
/// Writes a `Minf` chunk.
|
||||||
pub fn write(v: &Minf) -> Vec<u8>
|
pub fn write(v: &Info) -> Vec<u8>
|
||||||
{
|
{
|
||||||
let mut o = Vec::with_capacity(4);
|
let mut o = Vec::with_capacity(4);
|
||||||
o.extend(&v.texture_id.to_be_bytes());
|
o.extend(&v.texture_id.to_be_bytes());
|
||||||
|
@ -37,7 +37,7 @@ pub fn write(v: &Minf) -> Vec<u8>
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Reads an old `Minf` chunk.
|
/// Reads an old `Minf` chunk.
|
||||||
pub fn read_old(b: &[u8]) -> ResultS<Minf>
|
pub fn read_old(b: &[u8]) -> ResultS<Info>
|
||||||
{
|
{
|
||||||
let minf = read(b)?;
|
let minf = read(b)?;
|
||||||
|
|
||||||
|
@ -51,10 +51,10 @@ pub fn read_old(b: &[u8]) -> ResultS<Minf>
|
||||||
entr_flags.insert(EntFlags::CO_OP)
|
entr_flags.insert(EntFlags::CO_OP)
|
||||||
}
|
}
|
||||||
|
|
||||||
Ok(Minf{entr_flags, ..minf})
|
Ok(Info{entr_flags, ..minf})
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Default for Minf
|
impl Default for Info
|
||||||
{
|
{
|
||||||
fn default() -> Self
|
fn default() -> Self
|
||||||
{
|
{
|
||||||
|
@ -71,7 +71,7 @@ impl Default for Minf
|
||||||
/// Static map information.
|
/// Static map information.
|
||||||
#[cfg_attr(feature = "serde_obj", derive(serde::Serialize))]
|
#[cfg_attr(feature = "serde_obj", derive(serde::Serialize))]
|
||||||
#[derive(Clone, Debug, Eq, PartialEq)]
|
#[derive(Clone, Debug, Eq, PartialEq)]
|
||||||
pub struct Minf
|
pub struct Info
|
||||||
{
|
{
|
||||||
pub texture_id: u16,
|
pub texture_id: u16,
|
||||||
pub physics_id: u16,
|
pub physics_id: u16,
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
map::minf::Minf{
|
map::minf::Info{
|
||||||
texture_id: 0,
|
texture_id: 0,
|
||||||
physics_id: 1,
|
physics_id: 1,
|
||||||
skypict_id: 1,
|
skypict_id: 1,
|
||||||
|
|
Loading…
Reference in New Issue