skin texture info

This commit is contained in:
Robin Appelman 2023-12-20 23:55:14 +01:00
commit 5cd7c3d859

View file

@ -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> {