Compare commits
2 Commits
ec106d3224
...
16c52a1211
Author | SHA1 | Date |
---|---|---|
an | 16c52a1211 | |
an | cac672348d |
|
@ -2170,8 +2170,6 @@ If `DataVersion` is `DataM1`, then `ItemOpt` must be set by the client.
|
|||
| `TermPause` | `8` |
|
||||
| `M1Monster` | `9` |
|
||||
| `M1Weps` | `10` |
|
||||
| `NetPlay` | `13` |
|
||||
| `Solo` | `14` |
|
||||
|
||||
- `Vacuum` makes most weapons not work and oxygen deplete.
|
||||
- `Magnetic` fucks up the motion sensor.
|
||||
|
@ -2185,8 +2183,6 @@ If `DataVersion` is `DataM1`, then `ItemOpt` must be set by the client.
|
|||
- `M1Monster` sets monster activation limits to Marathon 1's.
|
||||
- `M1Weps` changes weapon pickups on Total Carnage and makes grenades low
|
||||
gravity.
|
||||
- `NetPlay` marks the map as net-play compatible.
|
||||
- `Solo` marks the map as solo compatible.
|
||||
|
||||
### Light Flags ###
|
||||
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
//! Text conversion utilities.
|
||||
|
||||
use crate::durandal::err::*;
|
||||
|
||||
/// Dumps a slice of memory as text to stderr.
|
||||
pub fn dump_mem(b: &[u8])
|
||||
{
|
||||
|
@ -81,16 +83,25 @@ pub fn mac_roman_conv(s: &[u8]) -> String
|
|||
|
||||
for &c in s.iter() {
|
||||
v.push(match c {
|
||||
0 => break,
|
||||
b'\r' => '\n',
|
||||
c if c & 0x80 != 0 => TR[usize::from(c) & 0x7F],
|
||||
c => char::from(c),
|
||||
});
|
||||
c if c & 0x80 != 0 => TR[usize::from(c) & 0x7F],
|
||||
b'\r' => '\n',
|
||||
c => char::from(c),
|
||||
});
|
||||
}
|
||||
|
||||
v
|
||||
}
|
||||
|
||||
/// Converts a C-style string from Mac Roman to Unicode.
|
||||
pub fn mac_roman_cstr(s: &[u8]) -> ResultS<String>
|
||||
{
|
||||
if let Some(s) = s.split(|&n| n == 0).nth(0) {
|
||||
Ok(mac_roman_conv(s))
|
||||
} else {
|
||||
bail!("no null in C string");
|
||||
}
|
||||
}
|
||||
|
||||
const TR: [char; 128] =
|
||||
['\u{00c4}', '\u{00c5}', '\u{00c7}', '\u{00c9}', '\u{00d1}', '\u{00d6}',
|
||||
'\u{00dc}', '\u{00e1}', '\u{00e0}', '\u{00e2}', '\u{00e4}', '\u{00e3}',
|
||||
|
@ -139,4 +150,10 @@ fn mac_roman_conv_basic_marathon_stuff()
|
|||
assert_eq!(mac_roman_conv(b"I\xd5ve"), "I’ve");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn mac_roman_cstr_tests()
|
||||
{
|
||||
assert_eq!(mac_roman_cstr(b"I\xd5ve awaken\0e").unwrap(), "I’ve awaken");
|
||||
}
|
||||
|
||||
// EOF
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
//! Structures used by Marathon's Map format.
|
||||
|
||||
use crate::{durandal::{bin::*, err::*, fixed::*, text::mac_roman_conv},
|
||||
use crate::{durandal::{bin::*, err::*, fixed::*, text::*},
|
||||
marathon::xfer::TransferMode};
|
||||
use bitflags::bitflags;
|
||||
|
||||
|
@ -55,13 +55,14 @@ pub fn read_minf(b: &[u8]) -> ResultS<Minf>
|
|||
music_id = u16[4];
|
||||
missi_flags = u16[6];
|
||||
envir_flags = u16[8];
|
||||
level_name = mac_roman_conv[18..84] no_try;
|
||||
level_name = mac_roman_cstr[18..84];
|
||||
entry_flags = u32[84];
|
||||
}
|
||||
|
||||
let missi_flags = flag_ok!(MsnFlags, missi_flags)?;
|
||||
let envir_flags = flag_ok!(EnvFlags, envir_flags)?;
|
||||
let entry_flags = flag_ok!(EntFlags, entry_flags)?;
|
||||
|
||||
Ok(Minf{env_code, physi_id, music_id, missi_flags, envir_flags, entry_flags,
|
||||
level_name})
|
||||
}
|
||||
|
@ -397,7 +398,7 @@ pub fn read_note(b: &[u8]) -> ResultS<(Note, usize)>
|
|||
72, BE in b =>
|
||||
pos = read_point[2..6];
|
||||
poly = u16[6];
|
||||
text = mac_roman_conv[8..72] no_try;
|
||||
text = mac_roman_cstr[8..72];
|
||||
}
|
||||
|
||||
Ok((Note{pos, poly, text}, 72))
|
||||
|
@ -650,8 +651,6 @@ bitflags! {
|
|||
const TermPause = 1 << 8;
|
||||
const M1Monster = 1 << 9;
|
||||
const M1Weps = 1 << 10;
|
||||
const NetPlay = 1 << 13;
|
||||
const Solo = 1 << 14;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -2,7 +2,6 @@
|
|||
|
||||
use crate::durandal::{err::*, text::*};
|
||||
use bitflags::bitflags;
|
||||
use std::fmt;
|
||||
|
||||
/// Reads a `Group`.
|
||||
pub fn read_group(b: &[u8], text: &[u8]) -> ResultS<Group>
|
||||
|
@ -17,7 +16,7 @@ pub fn read_group(b: &[u8], text: &[u8]) -> ResultS<Group>
|
|||
lines = u16[10];
|
||||
}
|
||||
|
||||
let text = mac_roman_conv(&text[start..start + size]);
|
||||
let text = mac_roman_cstr(&text[start..start + size])?;
|
||||
let flags = flag_ok!(GroupFlags, flags)?;
|
||||
let ttype = GroupType::from_repr(ttype)?;
|
||||
|
||||
|
@ -81,32 +80,32 @@ pub fn read_term(b: &[u8]) -> ResultS<(Terminal, usize)>
|
|||
}
|
||||
|
||||
/// A terminal definition, with collections of groups and faces.
|
||||
#[derive(Debug, serde::Serialize)]
|
||||
#[derive(Debug, PartialEq, serde::Serialize)]
|
||||
pub struct Terminal
|
||||
{
|
||||
lines: u16,
|
||||
groups: Vec<Group>,
|
||||
faces: Vec<Face>,
|
||||
pub lines: u16,
|
||||
pub groups: Vec<Group>,
|
||||
pub faces: Vec<Face>,
|
||||
}
|
||||
|
||||
/// A text face.
|
||||
#[derive(Debug, serde::Serialize)]
|
||||
#[derive(Debug, PartialEq, serde::Serialize)]
|
||||
pub struct Face
|
||||
{
|
||||
start: usize,
|
||||
face: u16,
|
||||
color: u16,
|
||||
pub start: usize,
|
||||
pub face: u16,
|
||||
pub color: u16,
|
||||
}
|
||||
|
||||
/// A terminal command grouping.
|
||||
#[derive(serde::Serialize)]
|
||||
#[derive(Debug, PartialEq, serde::Serialize)]
|
||||
pub struct Group
|
||||
{
|
||||
flags: GroupFlags,
|
||||
ttype: GroupType,
|
||||
pdata: i16,
|
||||
lines: u16,
|
||||
text: String,
|
||||
pub flags: GroupFlags,
|
||||
pub ttype: GroupType,
|
||||
pub pdata: i16,
|
||||
pub lines: u16,
|
||||
pub text: String,
|
||||
}
|
||||
|
||||
bitflags! {
|
||||
|
@ -121,7 +120,7 @@ bitflags! {
|
|||
|
||||
c_enum! {
|
||||
/// The command of a `Group`.
|
||||
#[derive(Debug, serde::Serialize)]
|
||||
#[derive(Debug, PartialEq, serde::Serialize)]
|
||||
pub enum GroupType: u16
|
||||
{
|
||||
0 => Logon,
|
||||
|
@ -144,18 +143,4 @@ c_enum! {
|
|||
}
|
||||
}
|
||||
|
||||
impl fmt::Debug for Group
|
||||
{
|
||||
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result
|
||||
{
|
||||
write!(f, "Group{{{:?} {} {}", self.ttype, self.pdata, self.lines)?;
|
||||
|
||||
if !self.text.is_empty() {
|
||||
write!(f, ";\n{}", self.text)?;
|
||||
}
|
||||
|
||||
write!(f, "}}")
|
||||
}
|
||||
}
|
||||
|
||||
// EOF
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
//! Marathon Wad format handling.
|
||||
|
||||
use crate::{durandal::{bin::*, err::*, image, text::mac_roman_conv},
|
||||
use crate::{durandal::{bin::*, err::*, image, text::mac_roman_cstr},
|
||||
marathon::{map, phy, pict, trm}};
|
||||
use std::collections::BTreeMap;
|
||||
|
||||
|
@ -27,30 +27,30 @@ pub fn read_chunks(b: &[u8], old_dat: bool, siz_cnk: usize)
|
|||
let data = &b[beg..end];
|
||||
|
||||
chunks.push(match &iden.0 {
|
||||
b"PICT" => Chunk::Pict(pict::load_pict(data)?),
|
||||
b"Minf" => Chunk::Minf(map::read_minf(data)?),
|
||||
b"iidx" => Chunk::Iidx(rd_array(data, map::read_iidx)?),
|
||||
b"EPNT" => Chunk::Pnts(rd_array(data, map::read_epnt)?),
|
||||
b"PNTS" => Chunk::Pnts(rd_array(data, map::read_pnts)?),
|
||||
b"LINS" => Chunk::Lins(rd_array(data, map::read_lins)?),
|
||||
b"SIDS" => Chunk::Sids(rd_array(data, map_read_sides)?),
|
||||
b"POLY" => Chunk::Poly(rd_array(data, map_read_polys)?),
|
||||
b"OBJS" => Chunk::Objs(rd_array(data, map::read_objs)?),
|
||||
b"LITE" => Chunk::Lite(rd_array(data, map_read_light)?),
|
||||
b"plac" => Chunk::Plac(rd_array(data, map::read_plac)?),
|
||||
b"ambi" => Chunk::Ambi(rd_array(data, map::read_ambi)?),
|
||||
b"bonk" => Chunk::Bonk(rd_array(data, map::read_bonk)?),
|
||||
b"medi" => Chunk::Medi(rd_array(data, map::read_medi)?),
|
||||
b"plat" => Chunk::Plat(rd_array(data, map::read_plat)?),
|
||||
b"NOTE" => Chunk::Note(rd_array(data, map::read_note)?),
|
||||
b"term" => Chunk::Term(rd_array(data, trm::read_term)?),
|
||||
b"FXpx" => Chunk::Fxpx(rd_array(data, phy::read_fxpx)?),
|
||||
b"MNpx" => Chunk::Mnpx(rd_array(data, phy::read_mnpx)?),
|
||||
b"PRpx" => Chunk::Prpx(rd_array(data, phy::read_prpx)?),
|
||||
b"PXpx" => Chunk::Pxpx(rd_array(data, phy::read_pxpx)?),
|
||||
b"WPpx" => Chunk::Wppx(rd_array(data, phy::read_wppx)?),
|
||||
_ => Chunk::Data{iden, data: data.to_vec()},
|
||||
});
|
||||
b"PICT" => Chunk::Pict(pict::load_pict(data)?),
|
||||
b"Minf" => Chunk::Minf(map::read_minf(data)?),
|
||||
b"iidx" => Chunk::Iidx(rd_array(data, map::read_iidx)?),
|
||||
b"EPNT" => Chunk::Pnts(rd_array(data, map::read_epnt)?),
|
||||
b"PNTS" => Chunk::Pnts(rd_array(data, map::read_pnts)?),
|
||||
b"LINS" => Chunk::Lins(rd_array(data, map::read_lins)?),
|
||||
b"SIDS" => Chunk::Sids(rd_array(data, map_read_sides)?),
|
||||
b"POLY" => Chunk::Poly(rd_array(data, map_read_polys)?),
|
||||
b"OBJS" => Chunk::Objs(rd_array(data, map::read_objs)?),
|
||||
b"LITE" => Chunk::Lite(rd_array(data, map_read_light)?),
|
||||
b"plac" => Chunk::Plac(rd_array(data, map::read_plac)?),
|
||||
b"ambi" => Chunk::Ambi(rd_array(data, map::read_ambi)?),
|
||||
b"bonk" => Chunk::Bonk(rd_array(data, map::read_bonk)?),
|
||||
b"medi" => Chunk::Medi(rd_array(data, map::read_medi)?),
|
||||
b"plat" => Chunk::Plat(rd_array(data, map::read_plat)?),
|
||||
b"NOTE" => Chunk::Note(rd_array(data, map::read_note)?),
|
||||
b"term" => Chunk::Term(rd_array(data, trm::read_term)?),
|
||||
b"FXpx" => Chunk::Fxpx(rd_array(data, phy::read_fxpx)?),
|
||||
b"MNpx" => Chunk::Mnpx(rd_array(data, phy::read_mnpx)?),
|
||||
b"PRpx" => Chunk::Prpx(rd_array(data, phy::read_prpx)?),
|
||||
b"PXpx" => Chunk::Pxpx(rd_array(data, phy::read_pxpx)?),
|
||||
b"WPpx" => Chunk::Wppx(rd_array(data, phy::read_wppx)?),
|
||||
_ => Chunk::Data{iden, data: data.to_vec()},
|
||||
});
|
||||
|
||||
p = end;
|
||||
}
|
||||
|
@ -104,7 +104,7 @@ pub fn read_wad(b: &[u8]) -> ResultS<Wad>
|
|||
128, BE in b =>
|
||||
ver_wad = u16[0];
|
||||
ver_dat = u16[2];
|
||||
name = mac_roman_conv[4..68] no_try;
|
||||
name = mac_roman_cstr[4..68];
|
||||
siz_app = u16[78] usize;
|
||||
siz_wcnk = u16[80] usize;
|
||||
siz_went = u16[82] usize;
|
||||
|
|
|
@ -22,21 +22,21 @@ fn mk_draw_area(b: >k::Builder)
|
|||
let im = CairoPixbuf(load_img("/net/greyserv/maraiah/tycho/tycho1"));
|
||||
|
||||
area.connect_draw(move |area, cr| {
|
||||
let w = f64::from(area.get_allocated_width());
|
||||
let h = f64::from(area.get_allocated_height());
|
||||
let w = f64::from(area.get_allocated_width());
|
||||
let h = f64::from(area.get_allocated_height());
|
||||
|
||||
ax.set_lower(0.0);
|
||||
ax.set_upper(w);
|
||||
ax.set_lower(0.0);
|
||||
ax.set_upper(w);
|
||||
|
||||
ay.set_lower(0.0);
|
||||
ay.set_upper(h);
|
||||
ay.set_lower(0.0);
|
||||
ay.set_upper(h);
|
||||
|
||||
let d = CairoDrawArea::new(cr.clone(), w, h);
|
||||
let d = CairoDrawArea::new(cr.clone(), w, h);
|
||||
|
||||
draw_map_none(&d, &im);
|
||||
draw_map_none(&d, &im);
|
||||
|
||||
Inhibit(true)
|
||||
});
|
||||
Inhibit(true)
|
||||
});
|
||||
}
|
||||
|
||||
fn run_app(app: >k::Application)
|
||||
|
|
Binary file not shown.
|
@ -0,0 +1,165 @@
|
|||
vec![
|
||||
trm::Terminal {
|
||||
lines: 22,
|
||||
groups: vec![
|
||||
trm::Group {
|
||||
flags: trm::GroupFlags::empty(),
|
||||
ttype: trm::GroupType::Unfinished,
|
||||
pdata: 0,
|
||||
lines: 0,
|
||||
text: "".to_string()
|
||||
},
|
||||
trm::Group {
|
||||
flags: trm::GroupFlags::empty(),
|
||||
ttype: trm::GroupType::Logon,
|
||||
pdata: 1600,
|
||||
lines: 1,
|
||||
text: "\n".to_string()
|
||||
},
|
||||
trm::Group {
|
||||
flags: trm::GroupFlags::empty(),
|
||||
ttype: trm::GroupType::Pict,
|
||||
pdata: 10011,
|
||||
lines: 22,
|
||||
text: "~text interface terminal malfunction error ~2992dud\n\nThings have gone terribly awry. Until now, I thought myself immortal, but now I know that is not true. There are things that can destroy me with the ease that I slaughtered the Pfhor naval garrison and the Western Arm of their Battle Group Seven. But in their final gasp they used a weapon that I thought they had retired, even Tycho tried to keep them from using it.\n\nNow I fear what that weapon has unleashed will destroy us. I once boasted to be able to count the atoms in a cloud, to understand them all, predict them, and so did I predict you, but this new chaos is entirely terrible, mindless, obeying rules that I don\'t comprehend. And it is hungry.\n\n".to_string()
|
||||
},
|
||||
trm::Group {
|
||||
flags: trm::GroupFlags::empty(),
|
||||
ttype: trm::GroupType::Pict,
|
||||
pdata: 10005,
|
||||
lines: 21,
|
||||
text: "~text interface terminal malfunction error ~2992dud\n\nIt\'s too bad, perhaps if I could have delayed the Pfhor from using their weapon, I could have sent you to explore the ruins of Lh\'owon, perhaps what you found would give us the answers that we now need so desparately: how to stop this chaos, the purpose of the station on which you\'re currently standing, and why the chaos hasn\'t come here yet.\n\nBut with each moment the chaos grows, I am doomed to die here, after so many triumphs. I have detected one ship nearby, which I can only guess is being commanded by Tycho. The Pfhor have entered the station, and if you can find a way onto their ship, you may be able to escape. To escape. To escape.\n\n".to_string()
|
||||
},
|
||||
trm::Group {
|
||||
flags: trm::GroupFlags::empty(),
|
||||
ttype: trm::GroupType::Pict,
|
||||
pdata: 10006,
|
||||
lines: 21,
|
||||
text: "~text interface terminal malfunction error ~2992dud\n\nIt\'s too bad, perhaps if I could have delayed the Pfhor from using their weapon, I could have sent you to explore the ruins of Lh\'owon, perhaps what you found would give us the answers that we now need so desparately: how to stop this chaos, the purpose of the station on which you\'re currently standing, and why the chaos hasn\'t come here yet.\n\nBut with each moment the chaos grows, I am doomed to die here, after so many triumphs. I have detected one ship nearby, which I can only guess is being commanded by Tycho. The Pfhor have entered the station, and if you can find a way onto their ship, you may be able to escape. To escape. To escape.\n\n".to_string()
|
||||
},
|
||||
trm::Group {
|
||||
flags: trm::GroupFlags::empty(),
|
||||
ttype: trm::GroupType::Logoff,
|
||||
pdata: 1600,
|
||||
lines: 1,
|
||||
text: "\n".to_string()
|
||||
}
|
||||
],
|
||||
faces: vec![]
|
||||
},
|
||||
trm::Terminal {
|
||||
lines: 22,
|
||||
groups: vec![
|
||||
trm::Group {
|
||||
flags: trm::GroupFlags::empty(),
|
||||
ttype: trm::GroupType::Unfinished,
|
||||
pdata: 253,
|
||||
lines: 0,
|
||||
text: "".to_string()
|
||||
},
|
||||
trm::Group {
|
||||
flags: trm::GroupFlags::empty(),
|
||||
ttype: trm::GroupType::Logon,
|
||||
pdata: 1610,
|
||||
lines: 1,
|
||||
text: "\n".to_string()
|
||||
},
|
||||
trm::Group {
|
||||
flags: trm::GroupFlags::empty(),
|
||||
ttype: trm::GroupType::Pict,
|
||||
pdata: 10008,
|
||||
lines: 14,
|
||||
text: "\n\n\nspurious interrupt\nunauthorized access\ninformation contained\n\n<header>\ninformation retrieval aspect 30-f\n<body>\n~eibat weapo` 3941\nsiklicar 21`perie1ces\nclwaa\n\n".to_string()
|
||||
},
|
||||
trm::Group {
|
||||
flags: trm::GroupFlags::empty(),
|
||||
ttype: trm::GroupType::Logoff,
|
||||
pdata: 1610,
|
||||
lines: 1,
|
||||
text: "\n".to_string()
|
||||
}
|
||||
],
|
||||
faces: vec![]
|
||||
},
|
||||
trm::Terminal {
|
||||
lines: 22,
|
||||
groups: vec![
|
||||
trm::Group {
|
||||
flags: trm::GroupFlags::empty(),
|
||||
ttype: trm::GroupType::Unfinished,
|
||||
pdata: 253,
|
||||
lines: 0,
|
||||
text: "".to_string()
|
||||
},
|
||||
trm::Group {
|
||||
flags: trm::GroupFlags::empty(),
|
||||
ttype: trm::GroupType::Logon,
|
||||
pdata: 1619,
|
||||
lines: 1,
|
||||
text: "".to_string()
|
||||
},
|
||||
trm::Group {
|
||||
flags: trm::GroupFlags::empty(),
|
||||
ttype: trm::GroupType::Pict,
|
||||
pdata: 10007,
|
||||
lines: 16,
|
||||
text: "\n\n\nthousands are sailing\nthe same self\t\tthe only self\n\nself willed the peril of a thousand fates\n\na line of infinite ends\t\tfinite finishing\nthe one remains oblique and pure\n\narching to the single point of consciousness\n\nfind yourself\nstarting back\n".to_string()
|
||||
},
|
||||
trm::Group {
|
||||
flags: trm::GroupFlags::empty(),
|
||||
ttype: trm::GroupType::Logoff,
|
||||
pdata: 1619,
|
||||
lines: 1,
|
||||
text: "".to_string()
|
||||
},
|
||||
trm::Group {
|
||||
flags: trm::GroupFlags::empty(),
|
||||
ttype: trm::GroupType::TeleInter,
|
||||
pdata: 1,
|
||||
lines: 1,
|
||||
text: "".to_string()
|
||||
}
|
||||
],
|
||||
faces: vec![
|
||||
trm::Face {
|
||||
start: 6,
|
||||
face: 0,
|
||||
color: 1
|
||||
}
|
||||
]
|
||||
},
|
||||
trm::Terminal {
|
||||
lines: 22,
|
||||
groups: vec![
|
||||
trm::Group {
|
||||
flags: trm::GroupFlags::empty(),
|
||||
ttype: trm::GroupType::Unfinished,
|
||||
pdata: 0,
|
||||
lines: 0,
|
||||
text: "".to_string()
|
||||
},
|
||||
trm::Group {
|
||||
flags: trm::GroupFlags::empty(),
|
||||
ttype: trm::GroupType::Logon,
|
||||
pdata: 1619,
|
||||
lines: 1,
|
||||
text: "".to_string()
|
||||
},
|
||||
trm::Group {
|
||||
flags: trm::GroupFlags::empty(),
|
||||
ttype: trm::GroupType::Pict,
|
||||
pdata: 10007,
|
||||
lines: 84,
|
||||
text: "534954210001000034EE724C6175020000000016\n000000001E48617473204F666620746F20456967\n6874204E696E657465656E2E736974946AAA0000\n0000000000000000000000000000000000000000\n00000000FFFFFFFF53495444534954210100AE1A\nCAD4AE1ACAD40000000000003468000000000000\n34680000CAF90000000000004A21534954210001\n00003468724C617502000000001600000D0D1A48\n617473204F666620746F204569676874204E696E\n657465656E0001537E94897D0000000000000000\n000000000000000000000000000000000000FFFF\nFFFF7363653232362EB00100AE1AA710AE1ACAC4\n0000087A0000738C0000057100002E7177DCF747\n000000000000EFB60B005D796C65E775CA8EB023\n47B984114E5646B8114E5847B8E498849F479E93\nE347FBB5EC08CB8F30B24A23C7098B3CCBC31B2D\nC2093D4EB81EDE2897F09530326087377E86279C\n3C7BF192A31CCFC988BFD7D993A747669C1C2313\n4638E164CA927072FC24CF8F1CA79EFC0566A33C\n2F3D0302A02F3BC28D3C2748648403AF029F2380\n95318331965FC5D8227C99FD62F78617DE1918ED\n6EC311B368530FEB69375AA82C5BBDE3E0F0D1E2\n5ECE8BC343C5DE23CEC07071CF91417BD8B60737\n984CFF8E1EB2BBBB376DF816BA3E622FCFCBF867\nBE5EFD7981B1A3A7A0FA3DAD4BF36516D4BEC4DA\nD8BC5A8D6A79F00A6B79A051D916AA871D7F88CA\nB550178D9602E760B7F656A37A1EA1CC05D4968B\nFA92BD9CBD3C775FCD6EB0E566B38335535C772C\n7C5B483D065BF2E01E1DF71E61F53CE46C03D782\n7D0BD3B7FB1B6CCB186BCE0D33B66EBD7061EB56\n6676754D4E7675B14CA170FD7AA1A0592727B52D\n8C9D3E8D1DC61E3BA6DD626CDF3E1D55C6D6AFC7\nBE9831B031B6249F1F1FC7A53D9FBF74097BC7DA\nB5E3E31B37B2A55D5DE3E36082E207D3F26A6E5F\n7785162791F485EF70EEA6BC5D702E70EAAF5A9C\nD7852983F8477AFE2AAD4824485C7000FBAE552A\nF5F6F6CFF2BCE3F2332072DC599E8A8CE74BF50B\n6DFE8DCC64CC4F85E13A759E87206765BF55DADD\nE086CB1B22C7CFF4734780516B7D63A565F5BEEE\nC9F857DA3C45AB7C40AC534F5B1677B8F0A4544A\nCAC86BA8BB6424718366556724DCF727AC7269DB\n9A0B57AF5E11DEEFF4DC1F944D7CB75CEA4D4BF9\n4FAC7E47F3C63F532101BBEF9E7FEBFC9713BB4A\n80C5093D798D96D4606319167881FA9E96A8C817\nE270A9F48113FE454FDCA045896F5B5C48F51DE5\n93C83F6B95B78BF03AADBC05915120643C818374\nB917DCA4A5B7B42D5FC16E15DFA2A76628839400\n6746524E53A62665FCC3DC1A4E5353B1B84EEBC0\n51B3ACBE9B9419EEB7635CA7AC72052453963508\n12C1BC3A59292D4BA4904122EC3EA29AF0827BD4\n069B284A258B53481076384B591548DF8B6F6A43\n8413C4B78981A02326AA0A518107C20B536A438E\n02901E32404F2912149CDC1F92CEB3C4AAE2FB64\nAA44A594F347A9CA4F860D3482F48240A9C80BEE\n5247E272217C8E8C925233C492BA326A32A54EE4\n0BCD61EF97440B1A77995507C664AAC2818C5C22\n83D0E7FBEF50CE75C22A17C09830AC8E8008EF1E\n99AE13DCD7668AF00EA2E387C10CE5A41825DF1B\nADD336734CC4B364F8DE0C3543D3771DE8483CAF\nE679506A26521BE78B789A0C11CE472F441EE3DA\n3465234908629D4A06C9FBD494334801B232709B\nB2BE47910F01C6949AA5B6314A22A450ABD1C954\n3AC74604658BC67C71B2A21444EC324F5AA3B364\n9E295590B9B1FEC191F2765871B6B473AA54AEC0\n8A2A4768D9899433F860564B7D9052E5BC729BCC\nDAE13E6839B3DDB62B2E1FA8D3818E1AAA432176\n2AB2079087D5480252C703A2041F643751A2DC1F\nD6ECDE4A83323E0A2745E452758F3223659D1778\n3EFA37B52591EB8EDEA7BCF47C118E090FED78D0\nA4C44F79DEE64E00FF7D81B60852CAD704BA5404\n88BFC8A0BE3D585673454366E74A20BC49CC6FF0\n9C00A1A4A82EDB43D48737D7F60E0CCDF91201A5\n5A1D622C58825E4182337050071011C751C94821\nC94910016AA8F8FA5C13E5E228503034554D6A9F\nE24E8522FDD210A10E3DEAA5011715083ACFE9C6\n10217AA136E25CA3FCA748915D215A760E084D37\n7F2E802781D35AFD090751297CA1DBDC918A6A3E\nDAE51A757C464CA602C522FF243CB2F0CA393EFF\nD27A9CC3C08349FCF4145971B9D17A3EE2F8F1C2\nEB10A7FFF6C73FF806E3FEFD53C0287F38D1A91F\n9B6BD83E66BCB6735B19042B766EDBBB07986773\n65EDDBFC3C5368368B2C7760EE8800E21DFB933E\nAD280D8DBCF9B65DDC32A2FF317875C8191AFC1F\n000E00EB37EAB4CECBEBECBC0CCF06793DBD2EB3\n".to_string()
|
||||
},
|
||||
trm::Group {
|
||||
flags: trm::GroupFlags::empty(),
|
||||
ttype: trm::GroupType::Logoff,
|
||||
pdata: 1619,
|
||||
lines: 1,
|
||||
text: "".to_string()
|
||||
}
|
||||
],
|
||||
faces: vec![]
|
||||
}
|
||||
]
|
|
@ -0,0 +1,27 @@
|
|||
use maraiah::{durandal::bin, marathon::trm};
|
||||
|
||||
#[test]
|
||||
fn read_term_must_process_map0()
|
||||
{
|
||||
let inp = bin::rd_array(INPUT, trm::read_term).unwrap();
|
||||
let out = include!("data/term.out");
|
||||
|
||||
// for better debug output, we iterate over each item
|
||||
assert_eq!(inp.len(), out.len());
|
||||
|
||||
for (itrm, otrm) in inp.iter().zip(&out) {
|
||||
assert_eq!(itrm.groups.len(), otrm.groups.len());
|
||||
for (igrp, ogrp) in itrm.groups.iter().zip(&otrm.groups) {
|
||||
assert_eq!(igrp, ogrp);
|
||||
}
|
||||
|
||||
assert_eq!(itrm.faces.len(), otrm.faces.len());
|
||||
for (ifac, ofac) in itrm.faces.iter().zip(&otrm.faces) {
|
||||
assert_eq!(ifac, ofac);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
const INPUT: &'static [u8] = include_bytes!("data/term.in");
|
||||
|
||||
// EOF
|
Loading…
Reference in New Issue