Skip to content

Commit 267e442

Browse files
committed
fixed resource management on android
- fixed default path to the resource registry - disable resource registry update on android, only load pre-existing registry
1 parent a3286f9 commit 267e442

File tree

2 files changed

+3
-5
lines changed

2 files changed

+3
-5
lines changed

fyrox-resource/src/manager.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -690,8 +690,7 @@ impl ResourceManagerState {
690690
);
691691

692692
// Try to update the registry first.
693-
// Wasm is an exception, because it does not have a file system.
694-
#[cfg(not(target_arch = "wasm32"))]
693+
#[cfg(not(any(target_arch = "wasm32", target_os = "android")))]
695694
fyrox_core::futures::executor::block_on(async move {
696695
let new_data =
697696
ResourceRegistry::scan(resource_io.clone(), task_loaders, &path, excluded_folders)
@@ -701,8 +700,7 @@ impl ResourceManagerState {
701700
registry_status.mark_as_loaded();
702701
});
703702

704-
// WASM can only try to asynchronously load the existing registry.
705-
#[cfg(target_arch = "wasm32")]
703+
#[cfg(any(target_arch = "wasm32", target_os = "android"))]
706704
self.task_pool.spawn_task(async move {
707705
use crate::registry::RegistryContainerExt;
708706
// Then load the registry.

fyrox-resource/src/registry.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -294,7 +294,7 @@ pub struct ResourceRegistry {
294294
impl ResourceRegistry {
295295
/// Default path of the registry. It can be overridden on a registry instance using
296296
/// [`Self::set_path`] method.
297-
pub const DEFAULT_PATH: &'static str = "./data/resources.registry";
297+
pub const DEFAULT_PATH: &'static str = "data/resources.registry";
298298

299299
/// Creates a new resource registry with the given resource IO.
300300
pub fn new(io: Arc<dyn ResourceIo>) -> Self {

0 commit comments

Comments
 (0)