1
Fork 0
mirror of https://github.com/redstrate/Physis.git synced 2025-04-25 05:47:45 +00:00

Improve TEX documentation

This commit is contained in:
Joshua Goins 2023-12-02 19:55:50 -05:00
parent 76b1f1e352
commit 7eb11e412f

View file

@ -70,12 +70,16 @@ struct TexHeader {
}
pub struct Texture {
/// Width of the texture in pixels
pub width: u32,
/// Height of the texture in pixels
pub height: u32,
/// Raw RGBA data
pub rgba: Vec<u8>,
}
impl Texture {
/// Reads an existing TEX file
pub fn from_existing(buffer: ByteSpan) -> Option<Texture> {
let mut cursor = Cursor::new(buffer);
let header = TexHeader::read(&mut cursor).unwrap();