Cloud fixes

This commit is contained in:
luboslenco
2025-09-27 15:57:45 +02:00
parent 7d8f8f82db
commit 3a405aa717
2 changed files with 23 additions and 47 deletions
-24
View File
@@ -110,19 +110,7 @@ function file_cache_cloud(path: string, done: (s: string)=>void) {
dest += path;
if (iron_file_exists(dest)) {
///if (arm_macos || arm_ios)
done(dest);
///else
let p: string;
if (path_is_protected()) {
p = iron_internal_save_path();
}
else {
p = path_working_dir() + path_sep;
}
p += path;
done(p);
///end
return;
}
@@ -145,19 +133,7 @@ function file_cache_cloud(path: string, done: (s: string)=>void) {
fccd.done(null);
return;
}
///if (arm_macos || arm_ios)
fccd.done(fccd.dest);
///else
let p: string;
if (path_is_protected()) {
p = iron_internal_save_path();
}
else {
p = path_working_dir() + path_sep;
}
p += fccd.path;
fccd.done(p);
///end
}, map_get(file_cloud_sizes, path));
}
+23 -23
View File
@@ -5,11 +5,11 @@ let path_sep: string = "\\";
let path_sep: string = "/";
///end
///if arm_windows
let path_pwd: string = "cd";
///else
let path_pwd: string = "echo $PWD";
///end
// ///if arm_windows
// let path_pwd: string = "cd";
// ///else
// let path_pwd: string = "echo $PWD";
// ///end
let path_mesh_formats: string[] = ["obj", "blend"];
let path_texture_formats: string[] = ["jpg", "jpeg", "png", "tga", "bmp", "psd", "gif", "hdr", "k"];
@@ -25,7 +25,7 @@ let path_roughness_ext: string[] = ["roughness", "rough", "r", "rgh"];
let path_metallic_ext: string[] = ["metallic", "metal", "metalness", "m", "met"];
let path_displacement_ext: string[] = ["displacement", "height", "h", "disp"];
let path_working_dir_cache: string = null;
// let path_working_dir_cache: string = null;
function path_data(): string {
return iron_get_files_location() + path_sep + data_path();
@@ -75,23 +75,23 @@ function path_base_name(path: string): string {
return substring(path, string_last_index_of(path, path_sep) + 1, string_last_index_of(path, "."));
}
function path_working_dir(): string {
if (path_working_dir_cache == null) {
let cmd: string = path_pwd;
let save: string;
if (path_is_protected()) {
save = iron_internal_save_path();
}
else {
save = path_data() + path_sep;
}
save += "working_dir.txt";
iron_sys_command(cmd + " > \"" + save + "\"");
path_working_dir_cache = sys_buffer_to_string(iron_load_blob(save));
path_working_dir_cache = trim_end(path_working_dir_cache);
}
return path_working_dir_cache;
}
// function path_working_dir(): string {
// if (path_working_dir_cache == null) {
// let cmd: string = path_pwd;
// let save: string;
// if (path_is_protected()) {
// save = iron_internal_save_path();
// }
// else {
// save = path_data() + path_sep;
// }
// save += "working_dir.txt";
// iron_sys_command(cmd + " > \"" + save + "\"");
// path_working_dir_cache = sys_buffer_to_string(iron_load_blob(save));
// path_working_dir_cache = trim_end(path_working_dir_cache);
// }
// return path_working_dir_cache;
// }
function path_is_mesh(path: string): bool {
let p: string = to_lower_case(path);