mirror of
https://github.com/godotengine/godot.git
synced 2025-10-20 00:13:30 +00:00
-fix local and global usage for DirAccess, fixes #791
please test anyway..
This commit is contained in:
parent
b66b86b05e
commit
1de1a04b78
5 changed files with 93 additions and 176 deletions
|
@ -176,7 +176,7 @@ bool DirAccessJAndroid::file_exists(String p_file){
|
|||
if (current_dir=="")
|
||||
sd=p_file;
|
||||
else
|
||||
sd=current_dir+"/"+p_file;
|
||||
sd=current_dir.plus_file(p_file);
|
||||
|
||||
FileAccessJAndroid *f = memnew(FileAccessJAndroid);
|
||||
bool exists = f->file_exists(sd);
|
||||
|
@ -190,12 +190,19 @@ bool DirAccessJAndroid::dir_exists(String p_dir) {
|
|||
JNIEnv *env = ThreadAndroid::get_env();
|
||||
|
||||
String sd;
|
||||
|
||||
|
||||
if (current_dir=="")
|
||||
sd=p_dir;
|
||||
else
|
||||
sd=current_dir+"/"+p_dir;
|
||||
else {
|
||||
if (p_dir.is_rel_path())
|
||||
sd=current_dir.plus_file(p_dir);
|
||||
else
|
||||
sd=fix_path(p_dir);
|
||||
}
|
||||
|
||||
String path=sd.simplify_path();
|
||||
|
||||
String path=fix_path(sd).simplify_path();
|
||||
if (path.begins_with("/"))
|
||||
path=path.substr(1,path.length());
|
||||
else if (path.begins_with("res://"))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue