summaryrefslogtreecommitdiff
path: root/core/os
diff options
context:
space:
mode:
authorJuan Linietsky <reduzio@gmail.com>2017-05-28 21:46:48 -0300
committerJuan Linietsky <reduzio@gmail.com>2017-05-28 21:48:05 -0300
commitbb20f230ad307a2a5f18c03bece3793d29ae208a (patch)
treeb217d7c10054e23b0f456acee41bc208dc12bfdf /core/os
parent06fc9637966dafe8e06e1d4f823bf9e8b3475c97 (diff)
-Added .hdr format support
-Added default environment editor setting -Added environment created by default in new projects -Removed default light and ambient from spatial editor, to make the editor more PBR compliant
Diffstat (limited to 'core/os')
-rw-r--r--core/os/file_access.cpp21
-rw-r--r--core/os/file_access.h1
2 files changed, 22 insertions, 0 deletions
diff --git a/core/os/file_access.cpp b/core/os/file_access.cpp
index 375121c0cc..805b66b983 100644
--- a/core/os/file_access.cpp
+++ b/core/os/file_access.cpp
@@ -252,6 +252,27 @@ double FileAccess::get_double() const {
return m.d;
};
+String FileAccess::get_token() const {
+
+ CharString token;
+
+ CharType c = get_8();
+
+ while (!eof_reached()) {
+
+ if (c <= ' ') {
+ if (!token.empty())
+ break;
+ } else {
+ token.push_back(c);
+ }
+ c = get_8();
+ }
+
+ token.push_back(0);
+ return String::utf8(token.get_data());
+}
+
String FileAccess::get_line() const {
CharString line;
diff --git a/core/os/file_access.h b/core/os/file_access.h
index da15ddc544..6d3e491167 100644
--- a/core/os/file_access.h
+++ b/core/os/file_access.h
@@ -106,6 +106,7 @@ public:
virtual int get_buffer(uint8_t *p_dst, int p_length) const; ///< get an array of bytes
virtual String get_line() const;
+ virtual String get_token() const;
virtual Vector<String> get_csv_line(String delim = ",") const;
/**< use this for files WRITTEN in _big_ endian machines (ie, amiga/mac)