Added the ability to load linedefs from a wad file. Also added functions to the linedef type to allow you to check the status of each bit of the flags value making it very easy to check linedef properties.
48 lines
981 B
Rust
48 lines
981 B
Rust
pub struct Linedef {
|
|
pub start_vertex: i16,
|
|
pub end_vertex: i16,
|
|
pub flags: i16,
|
|
pub special_type: i16,
|
|
pub sector_tag: i16,
|
|
pub front_sidedef: i16,
|
|
pub back_sidedef: i16,
|
|
}
|
|
|
|
impl Linedef {
|
|
pub fn blocks_players(&self) -> bool {
|
|
self.flags & (1 << 0) != 0
|
|
}
|
|
|
|
pub fn blocks_monsters(&self) -> bool {
|
|
self.flags & (1 << 1) != 0
|
|
}
|
|
|
|
pub fn is_two_sided(&self) -> bool {
|
|
self.flags & (1 << 2) != 0
|
|
}
|
|
|
|
pub fn is_upper_unpegged(&self) -> bool {
|
|
self.flags & (1 << 3) != 0
|
|
}
|
|
|
|
pub fn is_lower_unpegged(&self) -> bool {
|
|
self.flags & (1 << 4) != 0
|
|
}
|
|
|
|
pub fn is_secret(&self) -> bool {
|
|
self.flags & (1 << 5) != 0
|
|
}
|
|
|
|
pub fn blocks_sound(&self) -> bool {
|
|
self.flags & (1 << 6) != 0
|
|
}
|
|
|
|
pub fn never_automap(&self) -> bool {
|
|
self.flags & (1 << 7) != 0
|
|
}
|
|
|
|
pub fn always_automap(&self) -> bool {
|
|
self.flags & (1 << 8) != 0
|
|
}
|
|
}
|