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:
parent
76b1f1e352
commit
7eb11e412f
1 changed files with 4 additions and 0 deletions
|
@ -70,12 +70,16 @@ struct TexHeader {
|
||||||
}
|
}
|
||||||
|
|
||||||
pub struct Texture {
|
pub struct Texture {
|
||||||
|
/// Width of the texture in pixels
|
||||||
pub width: u32,
|
pub width: u32,
|
||||||
|
/// Height of the texture in pixels
|
||||||
pub height: u32,
|
pub height: u32,
|
||||||
|
/// Raw RGBA data
|
||||||
pub rgba: Vec<u8>,
|
pub rgba: Vec<u8>,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Texture {
|
impl Texture {
|
||||||
|
/// Reads an existing TEX file
|
||||||
pub fn from_existing(buffer: ByteSpan) -> Option<Texture> {
|
pub fn from_existing(buffer: ByteSpan) -> Option<Texture> {
|
||||||
let mut cursor = Cursor::new(buffer);
|
let mut cursor = Cursor::new(buffer);
|
||||||
let header = TexHeader::read(&mut cursor).unwrap();
|
let header = TexHeader::read(&mut cursor).unwrap();
|
||||||
|
|
Loading…
Add table
Reference in a new issue