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

Function resolve_bundle_path

native/watchos/src/textures.rs:147–156  ·  view source on GitHub ↗

Resolve a possibly-bundle-relative path to an absolute filesystem path. On watchOS the Swift shell populates `BUNDLE_RESOURCE_PATH` on startup via `bloom_watchos_set_bundle_path`; if it hasn't, paths are returned unchanged.

(p: &str)

Source from the content-addressed store, hash-verified

145/// via `bloom_watchos_set_bundle_path`; if it hasn't, paths are returned
146/// unchanged.
147pub fn resolve_bundle_path(p: &str) -> String {
148 if p.starts_with('/') {
149 return p.to_string();
150 }
151 let bundle = BUNDLE_PATH.lock().unwrap();
152 if bundle.is_empty() {
153 return p.to_string();
154 }
155 format!("{}/{}", bundle, p)
156}
157
158static BUNDLE_PATH: Mutex<String> = Mutex::new(String::new());
159

Callers 5

load_withFunction · 0.85
bloom_file_existsFunction · 0.85
bloom_read_fileFunction · 0.85
bloom_load_modelFunction · 0.85
loadFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected