From b8b45804485f7ca18f035f1eeb7a1ac0cf591cac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Verschelde?= Date: Wed, 16 Feb 2022 13:56:32 +0100 Subject: Style: Cleanup single-line blocks, semicolons, dead code Remove currently unused implementation of TextureBasisU, could be re-added later on if needed and ported. --- platform/android/file_access_android.cpp | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) (limited to 'platform/android/file_access_android.cpp') diff --git a/platform/android/file_access_android.cpp b/platform/android/file_access_android.cpp index 26bdcb9520..c84a919b6b 100644 --- a/platform/android/file_access_android.cpp +++ b/platform/android/file_access_android.cpp @@ -29,30 +29,28 @@ /*************************************************************************/ #include "file_access_android.h" + #include "core/string/print_string.h" AAssetManager *FileAccessAndroid::asset_manager = nullptr; -/*void FileAccessAndroid::make_default() { - create_func=create_android; -}*/ - FileAccess *FileAccessAndroid::create_android() { return memnew(FileAccessAndroid); } Error FileAccessAndroid::_open(const String &p_path, int p_mode_flags) { String path = fix_path(p_path).simplify_path(); - if (path.begins_with("/")) + if (path.begins_with("/")) { path = path.substr(1, path.length()); - else if (path.begins_with("res://")) + } else if (path.begins_with("res://")) { path = path.substr(6, path.length()); + } ERR_FAIL_COND_V(p_mode_flags & FileAccess::WRITE, ERR_UNAVAILABLE); //can't write on android.. a = AAssetManager_open(asset_manager, path.utf8().get_data(), AASSET_MODE_STREAMING); - if (!a) + if (!a) { return ERR_CANT_OPEN; - //ERR_FAIL_COND_V(!a,ERR_FILE_NOT_FOUND); + } len = AAsset_getLength(a); pos = 0; eof = false; @@ -61,8 +59,9 @@ Error FileAccessAndroid::_open(const String &p_path, int p_mode_flags) { } void FileAccessAndroid::close() { - if (!a) + if (!a) { return; + } AAsset_close(a); a = nullptr; } @@ -146,15 +145,17 @@ void FileAccessAndroid::store_8(uint8_t p_dest) { bool FileAccessAndroid::file_exists(const String &p_path) { String path = fix_path(p_path).simplify_path(); - if (path.begins_with("/")) + if (path.begins_with("/")) { path = path.substr(1, path.length()); - else if (path.begins_with("res://")) + } else if (path.begins_with("res://")) { path = path.substr(6, path.length()); + } AAsset *at = AAssetManager_open(asset_manager, path.utf8().get_data(), AASSET_MODE_STREAMING); - if (!at) + if (!at) { return false; + } AAsset_close(at); return true; -- cgit v1.2.3