summaryrefslogtreecommitdiffstats
path: root/core/io/file_access_compressed.cpp
diff options
context:
space:
mode:
authorheppocogne <83043568+heppocogne@users.noreply.github.com>2022-12-30 10:26:51 +0900
committerheppocogne <83043568+heppocogne@users.noreply.github.com>2022-12-30 10:31:12 +0900
commitea11ffc88c22dea2b71d7863808cd65f64f9eded (patch)
tree79436a3e3c4508ac5ccbf47a2cf0a29320c7a62d /core/io/file_access_compressed.cpp
parenta75493091823020d858fabadbfa5994da0d658cb (diff)
downloadredot-engine-ea11ffc88c22dea2b71d7863808cd65f64f9eded.tar.gz
Fix `get_path()` is not working when files are opend with `open_compressed`
And also fixed `get_absolute_path()` in the same way
Diffstat (limited to 'core/io/file_access_compressed.cpp')
-rw-r--r--core/io/file_access_compressed.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/core/io/file_access_compressed.cpp b/core/io/file_access_compressed.cpp
index d2c8a88269..2a1847205c 100644
--- a/core/io/file_access_compressed.cpp
+++ b/core/io/file_access_compressed.cpp
@@ -184,6 +184,22 @@ bool FileAccessCompressed::is_open() const {
return f.is_valid();
}
+String FileAccessCompressed::get_path() const {
+ if (f.is_valid()) {
+ return f->get_path();
+ } else {
+ return "";
+ }
+}
+
+String FileAccessCompressed::get_path_absolute() const {
+ if (f.is_valid()) {
+ return f->get_path_absolute();
+ } else {
+ return "";
+ }
+}
+
void FileAccessCompressed::seek(uint64_t p_position) {
ERR_FAIL_COND_MSG(f.is_null(), "File must be opened before use.");