move text from durandal to marathon
parent
392e20ae65
commit
2875da07e1
|
@ -15,6 +15,5 @@ pub mod file;
|
||||||
pub mod fixed;
|
pub mod fixed;
|
||||||
pub mod image;
|
pub mod image;
|
||||||
pub mod sound;
|
pub mod sound;
|
||||||
pub mod text;
|
|
||||||
|
|
||||||
// EOF
|
// EOF
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
//! Binary data conversion utilities.
|
//! Binary data conversion utilities.
|
||||||
|
|
||||||
use crate::durandal::{err::*, text::mac_roman_conv};
|
use crate::durandal::err::*;
|
||||||
use std::{fmt, num::NonZeroU16};
|
use std::{fmt, num::NonZeroU16};
|
||||||
|
|
||||||
#[doc(hidden)]
|
#[doc(hidden)]
|
||||||
|
@ -489,14 +489,6 @@ impl fmt::Debug for OptU16
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl fmt::Debug for Ident
|
|
||||||
{
|
|
||||||
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result
|
|
||||||
{
|
|
||||||
write!(f, "\"{}\"", mac_roman_conv(&self.0))
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
impl PartialEq<[u8; 4]> for Ident
|
impl PartialEq<[u8; 4]> for Ident
|
||||||
{
|
{
|
||||||
#[inline]
|
#[inline]
|
||||||
|
@ -528,7 +520,7 @@ impl<'a> PartialEq<&'a [u8; 4]> for Ident
|
||||||
/// assert_eq!(&Ident(*b"POLY"), *b"POLY");
|
/// assert_eq!(&Ident(*b"POLY"), *b"POLY");
|
||||||
/// assert_eq!(&Ident(*b"POLY"), b"POLY");
|
/// assert_eq!(&Ident(*b"POLY"), b"POLY");
|
||||||
/// ```
|
/// ```
|
||||||
#[derive(Clone, Copy, Default, Eq, PartialEq)]
|
#[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
|
||||||
#[cfg_attr(feature = "serde_obj", derive(serde::Serialize, serde::Deserialize))]
|
#[cfg_attr(feature = "serde_obj", derive(serde::Serialize, serde::Deserialize))]
|
||||||
pub struct Ident(/** The individual bytes of this identifier. */ pub [u8; 4]);
|
pub struct Ident(/** The individual bytes of this identifier. */ pub [u8; 4]);
|
||||||
|
|
||||||
|
|
|
@ -8,6 +8,7 @@ pub mod pict;
|
||||||
pub mod ppm;
|
pub mod ppm;
|
||||||
pub mod shp;
|
pub mod shp;
|
||||||
pub mod snd;
|
pub mod snd;
|
||||||
|
pub mod text;
|
||||||
pub mod tga;
|
pub mod tga;
|
||||||
pub mod trm;
|
pub mod trm;
|
||||||
pub mod wad;
|
pub mod wad;
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
//! Structures used by Marathon's Map format.
|
//! Structures used by Marathon's Map format.
|
||||||
|
|
||||||
use crate::{durandal::{bin::*, err::*, fixed::*, text::*},
|
use crate::{durandal::{bin::*, err::*, fixed::*},
|
||||||
marathon::xfer::TransferMode};
|
marathon::{text::*, xfer::TransferMode}};
|
||||||
use bitflags::bitflags;
|
use bitflags::bitflags;
|
||||||
|
|
||||||
/// Reads a `LightFunc` object.
|
/// Reads a `LightFunc` object.
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
//! Marathon Shapes format handling.
|
//! Marathon Shapes format handling.
|
||||||
|
|
||||||
use crate::{durandal::{bin::*, err::*, fixed::*, image::*, text::*},
|
use crate::{durandal::{bin::*, err::*, fixed::*, image::*},
|
||||||
marathon::xfer::TransferMode};
|
marathon::{text::*, xfer::TransferMode}};
|
||||||
use bitflags::bitflags;
|
use bitflags::bitflags;
|
||||||
|
|
||||||
/// Reads a color from a color table into `clut`.
|
/// Reads a color from a color table into `clut`.
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
/// # Examples
|
/// # Examples
|
||||||
///
|
///
|
||||||
/// ```
|
/// ```
|
||||||
/// use maraiah::durandal::text::to_binsize;
|
/// use maraiah::marathon::text::to_binsize;
|
||||||
///
|
///
|
||||||
/// assert_eq!(to_binsize(5000), "5kB".to_string());
|
/// assert_eq!(to_binsize(5000), "5kB".to_string());
|
||||||
/// ```
|
/// ```
|
||||||
|
@ -57,7 +57,7 @@ pub fn fuck_string(s: &[u8]) -> Vec<u8>
|
||||||
/// # Examples
|
/// # Examples
|
||||||
///
|
///
|
||||||
/// ```
|
/// ```
|
||||||
/// use maraiah::durandal::text::pascal_str;
|
/// use maraiah::marathon::text::pascal_str;
|
||||||
///
|
///
|
||||||
/// assert_eq!(pascal_str(b"\x0bhello world"), b"hello world"[..].into());
|
/// assert_eq!(pascal_str(b"\x0bhello world"), b"hello world"[..].into());
|
||||||
/// assert_eq!(pascal_str(b"\x0chello world"), None);
|
/// assert_eq!(pascal_str(b"\x0chello world"), None);
|
||||||
|
@ -74,7 +74,7 @@ pub fn pascal_str(b: &[u8]) -> Option<&[u8]>
|
||||||
/// # Examples
|
/// # Examples
|
||||||
///
|
///
|
||||||
/// ```
|
/// ```
|
||||||
/// use maraiah::durandal::text::mac_roman_conv;
|
/// use maraiah::marathon::text::mac_roman_conv;
|
||||||
///
|
///
|
||||||
/// assert_eq!(mac_roman_conv(b"p\x8cth"), "påth");
|
/// assert_eq!(mac_roman_conv(b"p\x8cth"), "påth");
|
||||||
/// assert_eq!(mac_roman_conv(b"I\xd5ve"), "I’ve");
|
/// assert_eq!(mac_roman_conv(b"I\xd5ve"), "I’ve");
|
||||||
|
@ -99,7 +99,7 @@ pub fn mac_roman_conv(s: &[u8]) -> String
|
||||||
/// # Examples
|
/// # Examples
|
||||||
///
|
///
|
||||||
/// ```
|
/// ```
|
||||||
/// use maraiah::durandal::text::mac_roman_cstr;
|
/// use maraiah::marathon::text::mac_roman_cstr;
|
||||||
///
|
///
|
||||||
/// assert_eq!(mac_roman_cstr(b"I\xd5ve awaken\0ed"), "I’ve awaken");
|
/// assert_eq!(mac_roman_cstr(b"I\xd5ve awaken\0ed"), "I’ve awaken");
|
||||||
/// assert_eq!(mac_roman_cstr(b"I\xd5ve awaken\0"), "I’ve awaken");
|
/// assert_eq!(mac_roman_cstr(b"I\xd5ve awaken\0"), "I’ve awaken");
|
|
@ -1,6 +1,6 @@
|
||||||
//! Structures used by Marathon's Map format's terminal definitions.
|
//! Structures used by Marathon's Map format's terminal definitions.
|
||||||
|
|
||||||
use crate::durandal::{bin::*, err::*, text::*};
|
use crate::{durandal::{bin::*, err::*}, marathon::text::*};
|
||||||
use bitflags::bitflags;
|
use bitflags::bitflags;
|
||||||
|
|
||||||
/// Reads an `InterGroup`.
|
/// Reads an `InterGroup`.
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
//! Marathon Wad format handling.
|
//! Marathon Wad format handling.
|
||||||
|
|
||||||
use crate::{durandal::{bin::*, err::*, image, text::mac_roman_cstr},
|
use crate::{durandal::{bin::*, err::*, image},
|
||||||
marathon::{map, phy, pict, trm}};
|
marathon::{map, phy, pict, text::mac_roman_cstr, trm}};
|
||||||
use std::collections::BTreeMap;
|
use std::collections::BTreeMap;
|
||||||
|
|
||||||
/// Reads all chunks in an entry.
|
/// Reads all chunks in an entry.
|
||||||
|
|
Loading…
Reference in New Issue