MCPcopy Create free account
hub / github.com/TheRedDeveloper/ply-engine / resolve_asset_path

Function resolve_asset_path

src/renderer.rs:16–22  ·  view source on GitHub ↗

On Android, the APK asset root is the `assets/` directory, so paths like `"assets/fonts/x.ttf"` need the prefix stripped.

(path: &str)

Source from the content-addressed store, hash-verified

14/// On Android, the APK asset root is the `assets/` directory,
15/// so paths like `"assets/fonts/x.ttf"` need the prefix stripped.
16fn resolve_asset_path(path: &str) -> &str {
17 #[cfg(target_os = "android")]
18 if let Some(stripped) = path.strip_prefix("assets/") {
19 return stripped;
20 }
21 path
22}
23
24#[cfg(feature = "text-styling")]
25static ANIMATION_TRACKER: std::sync::LazyLock<std::sync::Mutex<FxHashMap<String, (usize, f64)>>> = std::sync::LazyLock::new(|| std::sync::Mutex::new(FxHashMap::default()));

Callers 4

load_defaultMethod · 0.85
ensureMethod · 0.85
get_or_loadMethod · 0.85
renderFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected