From 007cb5ccfb26db2494610114be033726fa4b24d4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pedro=20J=2E=20Est=C3=A9banez?= Date: Mon, 22 Feb 2021 22:54:12 +0100 Subject: Implement get_cache_path() for iOS, and improve it for Android and Windows --- platform/android/os_android.cpp | 7 +++++-- platform/android/os_android.h | 1 + 2 files changed, 6 insertions(+), 2 deletions(-) (limited to 'platform/android') diff --git a/platform/android/os_android.cpp b/platform/android/os_android.cpp index 21fb31d991..034885aa32 100644 --- a/platform/android/os_android.cpp +++ b/platform/android/os_android.cpp @@ -230,10 +230,13 @@ String OS_Android::get_user_data_dir() const { } String OS_Android::get_cache_path() const { + if (cache_dir_cache != String()) + return cache_dir_cache; + String cache_dir = godot_io_java->get_cache_dir(); if (cache_dir != "") { - cache_dir = _remove_symlink(cache_dir); - return cache_dir; + cache_dir_cache = _remove_symlink(cache_dir); + return cache_dir_cache; } return "."; } diff --git a/platform/android/os_android.h b/platform/android/os_android.h index c938297821..ce8083388f 100644 --- a/platform/android/os_android.h +++ b/platform/android/os_android.h @@ -57,6 +57,7 @@ private: #endif mutable String data_dir_cache; + mutable String cache_dir_cache; AudioDriverOpenSL audio_driver_android; -- cgit v1.2.3