add NAME chunk

gui-branch
an 2019-04-12 21:46:51 -04:00
parent 0acfa18abd
commit 36307aca0a
4 changed files with 16 additions and 2 deletions

View File

@ -388,7 +388,7 @@ Map tags:
| `ambi` | Array of Ambient Sound |
| `bonk` | Array of Random Sound |
| `term` | Array of Terminal |
| `NAME` | Unknown |
| `NAME` | NTBS containing map name |
| `påth` | Unused, supposed to be guardpaths (å is $8C) |
| `door` | Unused, supposed to be extra door data |

View File

@ -15,6 +15,7 @@ pub mod ltfn;
pub mod medi;
pub mod minf;
pub mod mnpx;
pub mod name;
pub mod note;
pub mod objs;
pub mod plac;
@ -86,7 +87,7 @@ pub struct Wad
}
c_enum! {
/// The version of a `Wad`.
// The version of a `Wad`.
#[derive(Debug)]
enum Ver: u16
{

View File

@ -41,6 +41,7 @@ pub fn read(b: &[u8], old: bool, siz_cnk: usize) -> ResultS<Vec<Chunk>>
b"bonk" => Chunk::Bonk(rd_array(data, map::bonk::read)?),
b"medi" => Chunk::Medi(rd_array(data, map::medi::read)?),
b"plat" => Chunk::Plat(rd_array(data, map::plat::read)?),
b"NAME" => Chunk::Name(rd_array(data, map::name::read)?),
b"NOTE" => Chunk::Note(rd_array(data, map::note::read)?),
b"term" => Chunk::Term(rd_array(data, map::term::read)?),
b"FXpx" => Chunk::Fxpx(rd_array(data, map::fxpx::read)?),
@ -77,6 +78,7 @@ pub enum Chunk
/** A `bonk` chunk. */ Bonk(Vec<map::bonk::SoundRand>),
/** A `medi` chunk. */ Medi(Vec<map::medi::Media>),
/** A `plat` chunk. */ Plat(Vec<map::plat::Platform>),
/** A `NAME` chunk. */ Name(Vec<String>),
/** A `NOTE` chunk. */ Note(Vec<map::note::Note>),
/** A `term` chunk. */ Term(Vec<map::term::Terminal>),
/** A `FXpx` chunk. */ Fxpx(Vec<map::fxpx::Effect>),

View File

@ -0,0 +1,11 @@
//! `NAME` chunk.
use crate::{durandal::err::*, marathon::text::mac_roman_cstr};
/// Reads a `NAME` chunk.
pub fn read(b: &[u8]) -> ResultS<(String, usize)>
{
Ok((mac_roman_cstr(b), b.len()))
}
// EOF