You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-05 12:10:55 +00:00
Style: Cleanup single-line blocks, semicolons, dead code
Remove currently unused implementation of TextureBasisU, could be re-added later on if needed and ported.
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user