summaryrefslogtreecommitdiff
path: root/core/io
diff options
context:
space:
mode:
Diffstat (limited to 'core/io')
-rw-r--r--core/io/logger.cpp5
-rw-r--r--core/io/logger.h2
-rw-r--r--core/io/marshalls.cpp20
-rw-r--r--core/io/resource_format_binary.cpp6
4 files changed, 14 insertions, 19 deletions
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 1d9d2dd959..37320d7a77 100644
--- a/core/io/marshalls.cpp
+++ b/core/io/marshalls.cpp
@@ -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();
diff --git a/core/io/resource_format_binary.cpp b/core/io/resource_format_binary.cpp
index 8dc396c362..aa51b00028 100644
--- a/core/io/resource_format_binary.cpp
+++ b/core/io/resource_format_binary.cpp
@@ -267,7 +267,6 @@ Error ResourceInteractiveLoaderBinary::parse_variant(Variant &r_v) {
Vector<StringName> names;
Vector<StringName> subnames;
- StringName property;
bool absolute;
int name_count = f->get_16();
@@ -279,9 +278,8 @@ Error ResourceInteractiveLoaderBinary::parse_variant(Variant &r_v) {
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;
@@ -1454,7 +1452,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 +1682,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: {}