pub struct TextureCache { /* private fields */ }Implementations§
Source§impl TextureCache
impl TextureCache
Sourcepub fn new(asset_dir: PathBuf, palette: Option<Palette>) -> Self
pub fn new(asset_dir: PathBuf, palette: Option<Palette>) -> Self
Builds a texture cache by indexing TEXBSI.* files under asset_dir.
Sourcepub fn new_for_edition(
asset_dir: PathBuf,
palette: Option<Palette>,
software: bool,
) -> Self
pub fn new_for_edition( asset_dir: PathBuf, palette: Option<Palette>, software: bool, ) -> Self
Selects software TEXTURE banks or Glide TEXBSI banks explicitly.
Sourcepub fn from_data(
texbsi_data: HashMap<u16, Vec<u8>>,
palette: Option<Palette>,
) -> Self
pub fn from_data( texbsi_data: HashMap<u16, Vec<u8>>, palette: Option<Palette>, ) -> Self
Builds a texture cache from pre-loaded TEXBSI data (no filesystem access).
texbsi_data maps TEXBSI IDs (e.g. 302) to raw file bytes.
Used by the FFI layer where the caller provides all data in memory.
Sourcepub fn from_software_data(
data: HashMap<u16, Vec<u8>>,
palette: Option<Palette>,
) -> Result<Self>
pub fn from_software_data( data: HashMap<u16, Vec<u8>>, palette: Option<Palette>, ) -> Result<Self>
Builds a software cache from bank bytes without filesystem access.
pub const fn palette(&self) -> Option<&Palette>
Sourcepub const fn missing_requests(&self) -> &BTreeMap<(u16, u8), String>
pub const fn missing_requests(&self) -> &BTreeMap<(u16, u8), String>
Referenced texture/image failures retained by the existing fallback path.
Sourcepub fn resolve_texture_id(
texture_id: u16,
contains: impl Fn(u16) -> bool,
) -> u16
pub fn resolve_texture_id( texture_id: u16, contains: impl Fn(u16) -> bool, ) -> u16
Resolves an authored texture bank against available IDs using the exporter’s remapping rules.
pub fn ensure_bsi_available(&mut self, texture_id: u16)
pub fn image_count(&self, texture_id: u16) -> Option<usize>
pub fn get_image_rgba( &mut self, texture_id: u16, image_id: u8, ) -> Option<(Vec<u8>, u16, u16)>
pub fn get_image_rgba_with_frame_count( &mut self, texture_id: u16, image_id: u8, ) -> Option<(Vec<u8>, u16, u16, u16)>
pub fn get_all_frames_by_image_id( &mut self, texture_id: u16, image_id: u8, ) -> Option<AllFramesInfo>
Sourcepub fn get_image_dimensions(
&mut self,
texture_id: u16,
image_id: u8,
) -> Option<(u16, u16)>
pub fn get_image_dimensions( &mut self, texture_id: u16, image_id: u8, ) -> Option<(u16, u16)>
Returns dimensions for a texture/image pair without decoding PNG bytes.
Auto Trait Implementations§
impl Freeze for TextureCache
impl RefUnwindSafe for TextureCache
impl Send for TextureCache
impl Sync for TextureCache
impl Unpin for TextureCache
impl UnsafeUnpin for TextureCache
impl UnwindSafe for TextureCache
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
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<U, T> ToOwnedObj<U> for Twhere
U: FromObjRef<T>,
impl<U, T> ToOwnedObj<U> for Twhere
U: FromObjRef<T>,
Source§fn to_owned_obj(&self, data: FontData<'_>) -> U
fn to_owned_obj(&self, data: FontData<'_>) -> U
Convert this type into
T, using the provided data to resolve any offsets.