MCPcopy Create free account
hub / github.com/Bloom-Engine/engine / resolve_path

Function resolve_path

native/android/src/lib.rs:21–32  ·  view source on GitHub ↗

Resolve relative asset paths to the app's base asset directory. On Android, relative paths like "assets/models/tree.glb" won't resolve because the working directory isn't the app's data directory.

(path: &str)

Source from the content-addressed store, hash-verified

19/// On Android, relative paths like "assets/models/tree.glb" won't resolve
20/// because the working directory isn't the app's data directory.
21fn resolve_path(path: &str) -> String {
22 if path.starts_with('/') {
23 return path.to_string();
24 }
25 unsafe {
26 if let Some(ref base) = ASSET_BASE_PATH {
27 format!("{}/{}", base, path)
28 } else {
29 path.to_string()
30 }
31 }
32}
33
34/// Called by the Android Activity to set the base path for asset resolution.
35/// Should be set to the app's files directory where assets are extracted.

Callers 13

bloom_end_drawingFunction · 0.70
bloom_load_fontFunction · 0.70
bloom_load_soundFunction · 0.70
bloom_load_textureFunction · 0.70
bloom_load_imageFunction · 0.70
bloom_load_modelFunction · 0.70
bloom_load_musicFunction · 0.70
bloom_file_existsFunction · 0.70
bloom_read_fileFunction · 0.70
bloom_stage_textureFunction · 0.70
bloom_stage_modelFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected