pub struct SpriteFields<'p> {
pub pixels_to_units: f64,
pub rd: RenderData,
pub sprite_atlas: Option<Pptr>,
pub atlas_tag: Option<&'p [u8]>,
pub render_data_key: Option<AtlasKey>,
}Expand description
What render() and select_render_data read of
a Sprite, borrowing from its Parsed tree.
Fields§
§pixels_to_units: f64m_PixelsToUnits.
rd: RenderDatam_RD’s render data.
sprite_atlas: Option<Pptr>m_SpriteAtlas, where the version has it.
atlas_tag: Option<&'p [u8]>m_AtlasTags[0] (raw bytes, as the file holds them), where the
version has the field and it is not empty: the one tag UnityPy
reads. Borrowed, so a Sprite of many tags costs nothing here.
render_data_key: Option<AtlasKey>m_RenderDataKey, where the version has it.
Implementations§
Source§impl<'p> SpriteFields<'p>
impl<'p> SpriteFields<'p>
Sourcepub fn read(sprite: &'p Parsed, meter: &Arc<Meter>) -> Result<Self, SpriteError>
pub fn read(sprite: &'p Parsed, meter: &Arc<Meter>) -> Result<Self, SpriteError>
Reads them from a parsed Sprite, counting each lookup’s and the tag
check’s work on meter (module docs); a field missing, or of
another type than its typetree’s (a tag that is not a string among
them), is SpriteError::Malformed.
Sourcepub fn data(&self, rd: &RenderData) -> SpriteData
pub fn data(&self, rd: &RenderData) -> SpriteData
The render data rd (the Sprite’s own or its atlas’s) with the
Sprite’s m_PixelsToUnits.
Trait Implementations§
Source§impl<'p> Clone for SpriteFields<'p>
impl<'p> Clone for SpriteFields<'p>
Source§impl<'p> Debug for SpriteFields<'p>
impl<'p> Debug for SpriteFields<'p>
Source§impl<'p> PartialEq for SpriteFields<'p>
impl<'p> PartialEq for SpriteFields<'p>
impl<'p> StructuralPartialEq for SpriteFields<'p>
Auto Trait Implementations§
impl<'p> Forget for SpriteFields<'p>
impl<'p> Freeze for SpriteFields<'p>
impl<'p> Move for SpriteFields<'p>
impl<'p> RefUnwindSafe for SpriteFields<'p>
impl<'p> Send for SpriteFields<'p>
impl<'p> Sync for SpriteFields<'p>
impl<'p> Unpin for SpriteFields<'p>
impl<'p> UnsafeUnpin for SpriteFields<'p>
impl<'p> UnwindSafe for SpriteFields<'p>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more