summaryrefslogtreecommitdiff
path: root/core/io
diff options
context:
space:
mode:
Diffstat (limited to 'core/io')
-rw-r--r--core/io/file_access_buffered_fa.h4
-rw-r--r--core/io/file_access_compressed.cpp24
-rw-r--r--core/io/file_access_encrypted.cpp12
-rw-r--r--core/io/file_access_network.cpp6
-rw-r--r--core/io/http_client.cpp135
-rw-r--r--core/io/http_client.h12
-rw-r--r--core/io/logger.cpp5
-rw-r--r--core/io/logger.h2
-rw-r--r--core/io/marshalls.cpp32
-rw-r--r--core/io/resource_format_binary.cpp29
-rw-r--r--core/io/resource_format_binary.h1
-rw-r--r--core/io/stream_peer.cpp6
12 files changed, 139 insertions, 129 deletions
diff --git a/core/io/file_access_buffered_fa.h b/core/io/file_access_buffered_fa.h
index 309fc16d09..67751e840f 100644
--- a/core/io/file_access_buffered_fa.h
+++ b/core/io/file_access_buffered_fa.h
@@ -55,10 +55,10 @@ class FileAccessBufferedFA : public FileAccessBuffered {
// on dvector
//PoolVector<uint8_t>::Write write = cache.buffer.write();
- //f.get_buffer(write.ptr(), p_size);
+ //f.get_buffer(write.ptrw(), p_size);
// on vector
- f.get_buffer(cache.buffer.ptr(), p_size);
+ f.get_buffer(cache.buffer.ptrw(), p_size);
return p_size;
};
diff --git a/core/io/file_access_compressed.cpp b/core/io/file_access_compressed.cpp
index 514e3c65f0..c6f31dc8f0 100644
--- a/core/io/file_access_compressed.cpp
+++ b/core/io/file_access_compressed.cpp
@@ -51,7 +51,7 @@ void FileAccessCompressed::configure(const String &p_magic, Compression::Mode p_
if (write_max > write_buffer_size) { \
write_buffer_size = next_power_of_2(write_max); \
buffer.resize(write_buffer_size); \
- write_ptr = buffer.ptr(); \
+ write_ptr = buffer.ptrw(); \
} \
}
@@ -76,14 +76,14 @@ Error FileAccessCompressed::open_after_magic(FileAccess *p_base) {
comp_buffer.resize(max_bs);
buffer.resize(block_size);
- read_ptr = buffer.ptr();
- f->get_buffer(comp_buffer.ptr(), read_blocks[0].csize);
+ read_ptr = buffer.ptrw();
+ f->get_buffer(comp_buffer.ptrw(), read_blocks[0].csize);
at_end = false;
read_eof = false;
read_block_count = bc;
read_block_size = read_blocks.size() == 1 ? read_total : block_size;
- Compression::decompress(buffer.ptr(), read_block_size, comp_buffer.ptr(), read_blocks[0].csize, cmode);
+ Compression::decompress(buffer.ptrw(), read_block_size, comp_buffer.ptr(), read_blocks[0].csize, cmode);
read_block = 0;
read_pos = 0;
@@ -114,7 +114,7 @@ Error FileAccessCompressed::_open(const String &p_path, int p_mode_flags) {
write_buffer_size = 256;
buffer.resize(256);
write_max = 0;
- write_ptr = buffer.ptr();
+ write_ptr = buffer.ptrw();
//don't store anything else unless it's done saving!
} else {
@@ -160,7 +160,7 @@ void FileAccessCompressed::close() {
Vector<uint8_t> cblock;
cblock.resize(Compression::get_max_compressed_buffer_size(bl, cmode));
- int s = Compression::compress(cblock.ptr(), bp, bl, cmode);
+ int s = Compression::compress(cblock.ptrw(), bp, bl, cmode);
f->store_buffer(cblock.ptr(), s);
block_sizes.push_back(s);
@@ -211,8 +211,8 @@ void FileAccessCompressed::seek(size_t p_position) {
read_block = block_idx;
f->seek(read_blocks[read_block].offset);
- f->get_buffer(comp_buffer.ptr(), read_blocks[read_block].csize);
- Compression::decompress(buffer.ptr(), read_blocks.size() == 1 ? read_total : block_size, comp_buffer.ptr(), read_blocks[read_block].csize, cmode);
+ f->get_buffer(comp_buffer.ptrw(), read_blocks[read_block].csize);
+ Compression::decompress(buffer.ptrw(), read_blocks.size() == 1 ? read_total : block_size, comp_buffer.ptr(), read_blocks[read_block].csize, cmode);
read_block_size = read_block == read_block_count - 1 ? read_total % block_size : block_size;
}
@@ -282,8 +282,8 @@ uint8_t FileAccessCompressed::get_8() const {
if (read_block < read_block_count) {
//read another block of compressed data
- f->get_buffer(comp_buffer.ptr(), read_blocks[read_block].csize);
- Compression::decompress(buffer.ptr(), read_blocks.size() == 1 ? read_total : block_size, comp_buffer.ptr(), read_blocks[read_block].csize, cmode);
+ f->get_buffer(comp_buffer.ptrw(), read_blocks[read_block].csize);
+ Compression::decompress(buffer.ptrw(), read_blocks.size() == 1 ? read_total : block_size, comp_buffer.ptr(), read_blocks[read_block].csize, cmode);
read_block_size = read_block == read_block_count - 1 ? read_total % block_size : block_size;
read_pos = 0;
@@ -315,8 +315,8 @@ int FileAccessCompressed::get_buffer(uint8_t *p_dst, int p_length) const {
if (read_block < read_block_count) {
//read another block of compressed data
- f->get_buffer(comp_buffer.ptr(), read_blocks[read_block].csize);
- Compression::decompress(buffer.ptr(), read_blocks.size() == 1 ? read_total : block_size, comp_buffer.ptr(), read_blocks[read_block].csize, cmode);
+ f->get_buffer(comp_buffer.ptrw(), read_blocks[read_block].csize);
+ Compression::decompress(buffer.ptrw(), read_blocks.size() == 1 ? read_total : block_size, comp_buffer.ptr(), read_blocks[read_block].csize, cmode);
read_block_size = read_block == read_block_count - 1 ? read_total % block_size : block_size;
read_pos = 0;
diff --git a/core/io/file_access_encrypted.cpp b/core/io/file_access_encrypted.cpp
index e5da307153..71ebf57508 100644
--- a/core/io/file_access_encrypted.cpp
+++ b/core/io/file_access_encrypted.cpp
@@ -80,11 +80,11 @@ Error FileAccessEncrypted::open_and_parse(FileAccess *p_base, const Vector<uint8
data.resize(ds);
- uint32_t blen = p_base->get_buffer(data.ptr(), ds);
+ uint32_t blen = p_base->get_buffer(data.ptrw(), ds);
ERR_FAIL_COND_V(blen != ds, ERR_FILE_CORRUPT);
aes256_context ctx;
- aes256_init(&ctx, key.ptr());
+ aes256_init(&ctx, key.ptrw());
for (size_t i = 0; i < ds; i += 16) {
@@ -97,7 +97,7 @@ Error FileAccessEncrypted::open_and_parse(FileAccess *p_base, const Vector<uint8
MD5_CTX md5;
MD5Init(&md5);
- MD5Update(&md5, data.ptr(), data.size());
+ MD5Update(&md5, (uint8_t *)data.ptr(), data.size());
MD5Final(&md5);
ERR_FAIL_COND_V(String::md5(md5.digest) != String::md5(md5d), ERR_FILE_CORRUPT);
@@ -141,17 +141,17 @@ void FileAccessEncrypted::close() {
MD5_CTX md5;
MD5Init(&md5);
- MD5Update(&md5, data.ptr(), data.size());
+ MD5Update(&md5, (uint8_t *)data.ptr(), data.size());
MD5Final(&md5);
compressed.resize(len);
- zeromem(compressed.ptr(), len);
+ zeromem(compressed.ptrw(), len);
for (int i = 0; i < data.size(); i++) {
compressed[i] = data[i];
}
aes256_context ctx;
- aes256_init(&ctx, key.ptr());
+ aes256_init(&ctx, key.ptrw());
for (size_t i = 0; i < len; i += 16) {
diff --git a/core/io/file_access_network.cpp b/core/io/file_access_network.cpp
index a224abd9e7..61a0521cae 100644
--- a/core/io/file_access_network.cpp
+++ b/core/io/file_access_network.cpp
@@ -147,7 +147,7 @@ void FileAccessNetworkClient::_thread_func() {
Vector<uint8_t> block;
block.resize(len);
- client->get_data(block.ptr(), len);
+ client->get_data(block.ptrw(), len);
if (fa) //may have been queued
fa->_set_block(offset, block);
@@ -434,12 +434,12 @@ int FileAccessNetwork::get_buffer(uint8_t *p_dst, int p_length) const {
_queue_page(page + j);
}
- buff = pages[page].buffer.ptr();
+ buff = pages[page].buffer.ptrw();
//queue pages
buffer_mutex->unlock();
}
- buff = pages[page].buffer.ptr();
+ buff = pages[page].buffer.ptrw();
last_page_buff = buff;
last_page = page;
}
diff --git a/core/io/http_client.cpp b/core/io/http_client.cpp
index 46d52384e5..5097898314 100644
--- a/core/io/http_client.cpp
+++ b/core/io/http_client.cpp
@@ -30,6 +30,7 @@
#include "http_client.h"
#include "io/stream_peer_ssl.h"
+#ifndef JAVASCRIPT_ENABLED
Error HTTPClient::connect_to_host(const String &p_host, int p_port, bool p_ssl, bool p_verify_host) {
close();
@@ -405,38 +406,6 @@ Error HTTPClient::poll() {
return OK;
}
-Dictionary HTTPClient::_get_response_headers_as_dictionary() {
-
- List<String> rh;
- get_response_headers(&rh);
- Dictionary ret;
- for (const List<String>::Element *E = rh.front(); E; E = E->next()) {
- String s = E->get();
- int sp = s.find(":");
- if (sp == -1)
- continue;
- String key = s.substr(0, sp).strip_edges();
- String value = s.substr(sp + 1, s.length()).strip_edges();
- ret[key] = value;
- }
-
- return ret;
-}
-
-PoolStringArray HTTPClient::_get_response_headers() {
-
- List<String> rh;
- get_response_headers(&rh);
- PoolStringArray ret;
- ret.resize(rh.size());
- int idx = 0;
- for (const List<String>::Element *E = rh.front(); E; E = E->next()) {
- ret.set(idx++, E->get());
- }
-
- return ret;
-}
-
int HTTPClient::get_response_body_length() const {
return body_size;
@@ -612,6 +581,74 @@ Error HTTPClient::_get_http_data(uint8_t *p_buffer, int p_bytes, int &r_received
}
}
+void HTTPClient::set_read_chunk_size(int p_size) {
+ ERR_FAIL_COND(p_size < 256 || p_size > (1 << 24));
+ read_chunk_size = p_size;
+}
+
+HTTPClient::HTTPClient() {
+
+ tcp_connection = StreamPeerTCP::create_ref();
+ resolving = IP::RESOLVER_INVALID_ID;
+ status = STATUS_DISCONNECTED;
+ conn_port = 80;
+ body_size = 0;
+ chunked = false;
+ body_left = 0;
+ chunk_left = 0;
+ response_num = 0;
+ ssl = false;
+ blocking = false;
+ read_chunk_size = 4096;
+}
+
+HTTPClient::~HTTPClient() {
+}
+
+#endif // #ifndef JAVASCRIPT_ENABLED
+
+String HTTPClient::query_string_from_dict(const Dictionary &p_dict) {
+ String query = "";
+ Array keys = p_dict.keys();
+ for (int i = 0; i < keys.size(); ++i) {
+ query += "&" + String(keys[i]).http_escape() + "=" + String(p_dict[keys[i]]).http_escape();
+ }
+ query.erase(0, 1);
+ return query;
+}
+
+Dictionary HTTPClient::_get_response_headers_as_dictionary() {
+
+ List<String> rh;
+ get_response_headers(&rh);
+ Dictionary ret;
+ for (const List<String>::Element *E = rh.front(); E; E = E->next()) {
+ String s = E->get();
+ int sp = s.find(":");
+ if (sp == -1)
+ continue;
+ String key = s.substr(0, sp).strip_edges();
+ String value = s.substr(sp + 1, s.length()).strip_edges();
+ ret[key] = value;
+ }
+
+ return ret;
+}
+
+PoolStringArray HTTPClient::_get_response_headers() {
+
+ List<String> rh;
+ get_response_headers(&rh);
+ PoolStringArray ret;
+ ret.resize(rh.size());
+ int idx = 0;
+ for (const List<String>::Element *E = rh.front(); E; E = E->next()) {
+ ret.set(idx++, E->get());
+ }
+
+ return ret;
+}
+
void HTTPClient::_bind_methods() {
ClassDB::bind_method(D_METHOD("connect_to_host", "host", "port", "use_ssl", "verify_host"), &HTTPClient::connect_to_host, DEFVAL(false), DEFVAL(true));
@@ -717,37 +754,3 @@ void HTTPClient::_bind_methods() {
BIND_ENUM_CONSTANT(RESPONSE_INSUFFICIENT_STORAGE);
BIND_ENUM_CONSTANT(RESPONSE_NOT_EXTENDED);
}
-
-void HTTPClient::set_read_chunk_size(int p_size) {
- ERR_FAIL_COND(p_size < 256 || p_size > (1 << 24));
- read_chunk_size = p_size;
-}
-
-String HTTPClient::query_string_from_dict(const Dictionary &p_dict) {
- String query = "";
- Array keys = p_dict.keys();
- for (int i = 0; i < keys.size(); ++i) {
- query += "&" + String(keys[i]).http_escape() + "=" + String(p_dict[keys[i]]).http_escape();
- }
- query.erase(0, 1);
- return query;
-}
-
-HTTPClient::HTTPClient() {
-
- tcp_connection = StreamPeerTCP::create_ref();
- resolving = IP::RESOLVER_INVALID_ID;
- status = STATUS_DISCONNECTED;
- conn_port = 80;
- body_size = 0;
- chunked = false;
- body_left = 0;
- chunk_left = 0;
- response_num = 0;
- ssl = false;
- blocking = false;
- read_chunk_size = 4096;
-}
-
-HTTPClient::~HTTPClient() {
-}
diff --git a/core/io/http_client.h b/core/io/http_client.h
index f8a3349e6e..db5dd115bd 100644
--- a/core/io/http_client.h
+++ b/core/io/http_client.h
@@ -131,6 +131,7 @@ public:
};
private:
+#ifndef JAVASCRIPT_ENABLED
Status status;
IP::ResolverID resolving;
int conn_port;
@@ -152,13 +153,18 @@ private:
int response_num;
Vector<String> response_headers;
+ int read_chunk_size;
+
+ Error _get_http_data(uint8_t *p_buffer, int p_bytes, int &r_received);
+
+#else
+#include "platform/javascript/http_client.h.inc"
+#endif
- static void _bind_methods();
PoolStringArray _get_response_headers();
Dictionary _get_response_headers_as_dictionary();
- int read_chunk_size;
- Error _get_http_data(uint8_t *p_buffer, int p_bytes, int &r_received);
+ static void _bind_methods();
public:
//Error connect_and_get(const String& p_url,bool p_verify_host=true); //connects to a full url and perform request
diff --git a/core/io/logger.cpp b/core/io/logger.cpp
index ce2ce44b1d..7177359c8a 100644
--- a/core/io/logger.cpp
+++ b/core/io/logger.cpp
@@ -29,6 +29,7 @@
/*************************************************************************/
#include "logger.h"
+
#include "os/dir_access.h"
#include "os/os.h"
#include "print_string.h"
@@ -259,6 +260,10 @@ void CompositeLogger::log_error(const char *p_function, const char *p_file, int
}
}
+void CompositeLogger::add_logger(Logger *p_logger) {
+ loggers.push_back(p_logger);
+}
+
CompositeLogger::~CompositeLogger() {
for (int i = 0; i < loggers.size(); ++i) {
memdelete(loggers[i]);
diff --git a/core/io/logger.h b/core/io/logger.h
index cf0cc7699f..f8a394193f 100644
--- a/core/io/logger.h
+++ b/core/io/logger.h
@@ -101,6 +101,8 @@ public:
virtual void logv(const char *p_format, va_list p_list, bool p_err);
virtual void log_error(const char *p_function, const char *p_file, int p_line, const char *p_code, const char *p_rationale, ErrorType p_type = ERR_ERROR);
+ void add_logger(Logger *p_logger);
+
virtual ~CompositeLogger();
};
diff --git a/core/io/marshalls.cpp b/core/io/marshalls.cpp
index d388a622de..37320d7a77 100644
--- a/core/io/marshalls.cpp
+++ b/core/io/marshalls.cpp
@@ -159,7 +159,7 @@ Error decode_variant(Variant &r_variant, const uint8_t *p_buffer, int p_len, int
r_variant = str;
} break;
- // math types
+ // math types
case Variant::VECTOR2: {
@@ -245,10 +245,10 @@ Error decode_variant(Variant &r_variant, const uint8_t *p_buffer, int p_len, int
(*r_len) += 4 * 4;
} break;
- case Variant::RECT3: {
+ case Variant::AABB: {
ERR_FAIL_COND_V(len < (int)4 * 6, ERR_INVALID_DATA);
- Rect3 val;
+ AABB val;
val.position.x = decode_float(&buf[0]);
val.position.y = decode_float(&buf[4]);
val.position.z = decode_float(&buf[8]);
@@ -324,7 +324,6 @@ Error decode_variant(Variant &r_variant, const uint8_t *p_buffer, int p_len, int
ERR_FAIL_COND_V(len < 12, ERR_INVALID_DATA);
Vector<StringName> names;
Vector<StringName> subnames;
- StringName prop;
uint32_t namecount = strlen &= 0x7FFFFFFF;
uint32_t subnamecount = decode_uint32(buf + 4);
@@ -333,9 +332,10 @@ Error decode_variant(Variant &r_variant, const uint8_t *p_buffer, int p_len, int
len -= 12;
buf += 12;
+ if (flags & 2) // Obsolete format with property seperate from subpath
+ subnamecount++;
+
uint32_t total = namecount + subnamecount;
- if (flags & 2)
- total++;
if (r_len)
(*r_len) += 12;
@@ -359,10 +359,8 @@ Error decode_variant(Variant &r_variant, const uint8_t *p_buffer, int p_len, int
if (i < namecount)
names.push_back(str);
- else if (i < namecount + subnamecount)
- subnames.push_back(str);
else
- prop = str;
+ subnames.push_back(str);
buf += strlen + pad;
len -= strlen + pad;
@@ -371,7 +369,7 @@ Error decode_variant(Variant &r_variant, const uint8_t *p_buffer, int p_len, int
(*r_len) += 4 + strlen + pad;
}
- r_variant = NodePath(names, subnames, flags & 1, prop);
+ r_variant = NodePath(names, subnames, flags & 1);
} else {
//old format, just a string
@@ -919,8 +917,6 @@ Error encode_variant(const Variant &p_variant, uint8_t *r_buffer, int &r_len, bo
uint32_t flags = 0;
if (np.is_absolute())
flags |= 1;
- if (np.get_property() != StringName())
- flags |= 2;
encode_uint32(flags, buf + 8);
@@ -930,8 +926,6 @@ Error encode_variant(const Variant &p_variant, uint8_t *r_buffer, int &r_len, bo
r_len += 12;
int total = np.get_name_count() + np.get_subname_count();
- if (np.get_property() != StringName())
- total++;
for (int i = 0; i < total; i++) {
@@ -939,10 +933,8 @@ Error encode_variant(const Variant &p_variant, uint8_t *r_buffer, int &r_len, bo
if (i < np.get_name_count())
str = np.get_name(i);
- else if (i < np.get_name_count() + np.get_subname_count())
- str = np.get_subname(i - np.get_subname_count());
else
- str = np.get_property();
+ str = np.get_subname(i - np.get_name_count());
CharString utf8 = str.utf8();
@@ -967,7 +959,7 @@ Error encode_variant(const Variant &p_variant, uint8_t *r_buffer, int &r_len, bo
_encode_string(p_variant, buf, r_len);
} break;
- // math types
+ // math types
case Variant::VECTOR2: {
@@ -1045,10 +1037,10 @@ Error encode_variant(const Variant &p_variant, uint8_t *r_buffer, int &r_len, bo
r_len += 4 * 4;
} break;
- case Variant::RECT3: {
+ case Variant::AABB: {
if (buf) {
- Rect3 aabb = p_variant;
+ AABB aabb = p_variant;
encode_float(aabb.position.x, &buf[0]);
encode_float(aabb.position.y, &buf[4]);
encode_float(aabb.position.z, &buf[8]);
diff --git a/core/io/resource_format_binary.cpp b/core/io/resource_format_binary.cpp
index 03c3c5f615..df0d41ea9d 100644
--- a/core/io/resource_format_binary.cpp
+++ b/core/io/resource_format_binary.cpp
@@ -52,7 +52,7 @@ enum {
VARIANT_VECTOR3 = 12,
VARIANT_PLANE = 13,
VARIANT_QUAT = 14,
- VARIANT_RECT3 = 15,
+ VARIANT_AABB = 15,
VARIANT_MATRIX3 = 16,
VARIANT_TRANSFORM = 17,
VARIANT_MATRIX32 = 18,
@@ -84,8 +84,10 @@ enum {
OBJECT_INTERNAL_RESOURCE = 2,
OBJECT_EXTERNAL_RESOURCE_INDEX = 3,
//version 2: added 64 bits support for float and int
- FORMAT_VERSION = 2,
- FORMAT_VERSION_CAN_RENAME_DEPS = 1
+ //version 3: changed nodepath encoding
+ FORMAT_VERSION = 3,
+ FORMAT_VERSION_CAN_RENAME_DEPS = 1,
+ FORMAT_VERSION_NO_NODEPATH_PROPERTY = 3,
};
@@ -196,9 +198,9 @@ Error ResourceInteractiveLoaderBinary::parse_variant(Variant &r_v) {
r_v = v;
} break;
- case VARIANT_RECT3: {
+ case VARIANT_AABB: {
- Rect3 v;
+ AABB v;
v.position.x = f->get_real();
v.position.y = f->get_real();
v.position.z = f->get_real();
@@ -267,21 +269,22 @@ Error ResourceInteractiveLoaderBinary::parse_variant(Variant &r_v) {
Vector<StringName> names;
Vector<StringName> subnames;
- StringName property;
bool absolute;
int name_count = f->get_16();
uint32_t subname_count = f->get_16();
absolute = subname_count & 0x8000;
subname_count &= 0x7FFF;
+ if (ver_format < FORMAT_VERSION_NO_NODEPATH_PROPERTY) {
+ subname_count += 1; // has a property field, so we should count it as well
+ }
for (int i = 0; i < name_count; i++)
names.push_back(_get_string());
for (uint32_t i = 0; i < subname_count; i++)
subnames.push_back(_get_string());
- property = _get_string();
- NodePath np = NodePath(names, subnames, absolute, property);
+ NodePath np = NodePath(names, subnames, absolute);
r_v = np;
@@ -856,7 +859,7 @@ void ResourceInteractiveLoaderBinary::open(FileAccess *p_f) {
uint32_t ver_major = f->get_32();
uint32_t ver_minor = f->get_32();
- uint32_t ver_format = f->get_32();
+ ver_format = f->get_32();
print_bl("big endian: " + itos(big_endian));
#ifdef BIG_ENDIAN_ENABLED
@@ -1374,10 +1377,10 @@ void ResourceFormatSaverBinaryInstance::write_variant(const Variant &p_property,
f->store_real(val.w);
} break;
- case Variant::RECT3: {
+ case Variant::AABB: {
- f->store_32(VARIANT_RECT3);
- Rect3 val = p_property;
+ f->store_32(VARIANT_AABB);
+ AABB val = p_property;
f->store_real(val.position.x);
f->store_real(val.position.y);
f->store_real(val.position.z);
@@ -1454,7 +1457,6 @@ void ResourceFormatSaverBinaryInstance::write_variant(const Variant &p_property,
f->store_32(get_string_index(np.get_name(i)));
for (int i = 0; i < np.get_subname_count(); i++)
f->store_32(get_string_index(np.get_subname(i)));
- f->store_32(get_string_index(np.get_property()));
} break;
case Variant::_RID: {
@@ -1685,7 +1687,6 @@ void ResourceFormatSaverBinaryInstance::_find_resources(const Variant &p_variant
get_string_index(np.get_name(i));
for (int i = 0; i < np.get_subname_count(); i++)
get_string_index(np.get_subname(i));
- get_string_index(np.get_property());
} break;
default: {}
diff --git a/core/io/resource_format_binary.h b/core/io/resource_format_binary.h
index 2316f05b3c..687da0a9b4 100644
--- a/core/io/resource_format_binary.h
+++ b/core/io/resource_format_binary.h
@@ -41,6 +41,7 @@ class ResourceInteractiveLoaderBinary : public ResourceInteractiveLoader {
String res_path;
String type;
Ref<Resource> resource;
+ uint32_t ver_format;
FileAccess *f;
diff --git a/core/io/stream_peer.cpp b/core/io/stream_peer.cpp
index 2583eb369d..42a258a10d 100644
--- a/core/io/stream_peer.cpp
+++ b/core/io/stream_peer.cpp
@@ -220,7 +220,7 @@ void StreamPeer::put_var(const Variant &p_variant) {
encode_variant(p_variant, NULL, len);
buf.resize(len);
put_32(len);
- encode_variant(p_variant, buf.ptr(), len);
+ encode_variant(p_variant, buf.ptrw(), len);
put_data(buf.ptr(), buf.size());
}
@@ -340,7 +340,7 @@ String StreamPeer::get_utf8_string(int p_bytes) {
Vector<uint8_t> buf;
Error err = buf.resize(p_bytes);
ERR_FAIL_COND_V(err != OK, String());
- err = get_data(buf.ptr(), p_bytes);
+ err = get_data(buf.ptrw(), p_bytes);
ERR_FAIL_COND_V(err != OK, String());
String ret;
@@ -353,7 +353,7 @@ Variant StreamPeer::get_var() {
Vector<uint8_t> var;
Error err = var.resize(len);
ERR_FAIL_COND_V(err != OK, Variant());
- err = get_data(var.ptr(), len);
+ err = get_data(var.ptrw(), len);
ERR_FAIL_COND_V(err != OK, Variant());
Variant ret;