mirror of
https://codeberg.org/icewind/vmdl.git
synced 2026-06-03 16:44:11 +02:00
skin texture info
This commit is contained in:
parent
d330108905
commit
5cd7c3d859
1 changed files with 5 additions and 4 deletions
|
|
@ -135,16 +135,17 @@ pub struct SkinTable<'a> {
|
|||
|
||||
impl<'a> SkinTable<'a> {
|
||||
pub fn texture(&self, index: i32) -> Option<&'a str> {
|
||||
let texture_index = self.table.get(index as usize)?;
|
||||
self.textures
|
||||
.get(*texture_index as usize)
|
||||
.map(|info| info.name.as_str())
|
||||
self.texture_info(index).map(|info| info.name.as_str())
|
||||
}
|
||||
|
||||
pub fn texture_index(&self, index: i32) -> Option<usize> {
|
||||
let texture_index = self.table.get(index as usize)?;
|
||||
Some(*texture_index as usize)
|
||||
}
|
||||
pub fn texture_info(&self, index: i32) -> Option<&'a TextureInfo> {
|
||||
let texture_index = self.table.get(index as usize)?;
|
||||
self.textures.get(*texture_index as usize)
|
||||
}
|
||||
}
|
||||
|
||||
pub struct Mesh<'a> {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue