pub struct MipTexture { /* private fields */ }
Expand description
Mip-mapped texture. Contains exactly 4 mips (including the full resolution image).
Textures mips are guaranteed to be valid, meaning that width and height of a mip is half that of the width and height of the previous mip.
Implementations§
Source§impl MipTexture
impl MipTexture
pub const MIP_COUNT: usize = 4usize
Sourcepub fn from_parts(name: [u8; 16], mips: [Image; 4]) -> Self
pub fn from_parts(name: [u8; 16], mips: [Image; 4]) -> Self
Assemble a texture from provided mips with the given name. Useful if name is already given by a WAD entry as a block of 16 bytes.
§Panic
Will panic if mips are not valid.
Sourcepub fn new(name: String, mips: [Image; 4]) -> Self
pub fn new(name: String, mips: [Image; 4]) -> Self
Assemble a texture from provided mips with name
converted to a block
of 16 bytes.
@ Panic
Will panic if mips are not valid or name
does not fit within 16 bytes.
Sourcepub fn name_to_cstring(&self) -> CString
pub fn name_to_cstring(&self) -> CString
Obtain the name as a C string. If the name is not already null-terminated (in which case the entry is not well-formed) a null byte is appended to make a valid C string.
Sourcepub fn name_to_string(&self) -> Result<String, IntoStringError>
pub fn name_to_string(&self) -> Result<String, IntoStringError>
Attempt to interpret the name as UTF-8 encoded string
pub fn name(&self) -> [u8; 16]
Trait Implementations§
Source§impl Clone for MipTexture
impl Clone for MipTexture
Source§fn clone(&self) -> MipTexture
fn clone(&self) -> MipTexture
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more