summaryrefslogtreecommitdiff
path: root/core
diff options
context:
space:
mode:
Diffstat (limited to 'core')
-rw-r--r--core/crypto/hashing_context.cpp2
-rw-r--r--core/io/file_access_encrypted.cpp16
-rw-r--r--core/io/file_access_encrypted.h3
-rw-r--r--core/io/file_access_zip.cpp2
-rw-r--r--core/math/geometry.cpp2
-rw-r--r--core/os/main_loop.h2
-rw-r--r--core/ustring.cpp4
-rw-r--r--core/variant.cpp10
-rw-r--r--core/variant_parser.cpp2
9 files changed, 36 insertions, 7 deletions
diff --git a/core/crypto/hashing_context.cpp b/core/crypto/hashing_context.cpp
index bdccb258dd..bd863f546b 100644
--- a/core/crypto/hashing_context.cpp
+++ b/core/crypto/hashing_context.cpp
@@ -103,7 +103,7 @@ void HashingContext::_create_ctx(HashType p_type) {
}
void HashingContext::_delete_ctx() {
- return;
+
switch (type) {
case HASH_MD5:
memdelete((CryptoCore::MD5Context *)ctx);
diff --git a/core/io/file_access_encrypted.cpp b/core/io/file_access_encrypted.cpp
index 77decc107d..0eef0ee79f 100644
--- a/core/io/file_access_encrypted.cpp
+++ b/core/io/file_access_encrypted.cpp
@@ -176,6 +176,22 @@ bool FileAccessEncrypted::is_open() const {
return file != NULL;
}
+String FileAccessEncrypted::get_path() const {
+
+ if (file)
+ return file->get_path();
+ else
+ return "";
+}
+
+String FileAccessEncrypted::get_path_absolute() const {
+
+ if (file)
+ return file->get_path_absolute();
+ else
+ return "";
+}
+
void FileAccessEncrypted::seek(size_t p_position) {
if (p_position > (size_t)data.size())
diff --git a/core/io/file_access_encrypted.h b/core/io/file_access_encrypted.h
index d779a150ac..c3be0f7de8 100644
--- a/core/io/file_access_encrypted.h
+++ b/core/io/file_access_encrypted.h
@@ -60,6 +60,9 @@ public:
virtual void close(); ///< close a file
virtual bool is_open() const; ///< true when file is open
+ virtual String get_path() const; /// returns the path for the current open file
+ virtual String get_path_absolute() const; /// returns the absolute path for the current open file
+
virtual void seek(size_t p_position); ///< seek to a given position
virtual void seek_end(int64_t p_position = 0); ///< seek from the end of file
virtual size_t get_position() const; ///< get position in the file
diff --git a/core/io/file_access_zip.cpp b/core/io/file_access_zip.cpp
index be28c9a877..abc0bd064d 100644
--- a/core/io/file_access_zip.cpp
+++ b/core/io/file_access_zip.cpp
@@ -194,7 +194,7 @@ bool ZipArchive::try_open_pack(const String &p_path) {
packages.push_back(pkg);
int pkg_num = packages.size() - 1;
- for (unsigned int i = 0; i < gi.number_entry; i++) {
+ for (uint64_t i = 0; i < gi.number_entry; i++) {
char filename_inzip[256];
diff --git a/core/math/geometry.cpp b/core/math/geometry.cpp
index f37db90929..77383e2839 100644
--- a/core/math/geometry.cpp
+++ b/core/math/geometry.cpp
@@ -715,7 +715,7 @@ Vector<Vector<Vector2> > Geometry::decompose_polygon_in_convex(Vector<Point2> po
decomp.write[idx].resize(tp.GetNumPoints());
- for (int i = 0; i < tp.GetNumPoints(); i++) {
+ for (int64_t i = 0; i < tp.GetNumPoints(); i++) {
decomp.write[idx].write[i] = tp.GetPoint(i);
}
diff --git a/core/os/main_loop.h b/core/os/main_loop.h
index 54e61fd2fa..aca920efcb 100644
--- a/core/os/main_loop.h
+++ b/core/os/main_loop.h
@@ -60,6 +60,8 @@ public:
NOTIFICATION_WM_ABOUT = 1011,
NOTIFICATION_CRASH = 1012,
NOTIFICATION_OS_IME_UPDATE = 1013,
+ NOTIFICATION_APP_RESUMED = 1014,
+ NOTIFICATION_APP_PAUSED = 1015,
};
virtual void input_event(const Ref<InputEvent> &p_event);
diff --git a/core/ustring.cpp b/core/ustring.cpp
index fb4bd6d802..237e86aaf1 100644
--- a/core/ustring.cpp
+++ b/core/ustring.cpp
@@ -2147,13 +2147,13 @@ int64_t String::to_int(const CharType *p_str, int p_len) {
if (c >= '0' && c <= '9') {
- if (integer > INT32_MAX / 10) {
+ if (integer > INT64_MAX / 10) {
String number("");
str = p_str;
while (*str && str != limit) {
number += *(str++);
}
- ERR_FAIL_V_MSG(sign == 1 ? INT32_MAX : INT32_MIN, "Cannot represent " + number + " as integer, provided value is " + (sign == 1 ? "too big." : "too small."));
+ ERR_FAIL_V_MSG(sign == 1 ? INT64_MAX : INT64_MIN, "Cannot represent " + number + " as integer, provided value is " + (sign == 1 ? "too big." : "too small."));
}
integer *= 10;
integer += c - '0';
diff --git a/core/variant.cpp b/core/variant.cpp
index e7d0e58367..16bbf94c54 100644
--- a/core/variant.cpp
+++ b/core/variant.cpp
@@ -910,7 +910,15 @@ bool Variant::is_one() const {
void Variant::reference(const Variant &p_variant) {
- clear();
+ switch (type) {
+ case NIL:
+ case BOOL:
+ case INT:
+ case REAL:
+ break;
+ default:
+ clear();
+ }
type = p_variant.type;
diff --git a/core/variant_parser.cpp b/core/variant_parser.cpp
index 07212ec669..fe2c981c3c 100644
--- a/core/variant_parser.cpp
+++ b/core/variant_parser.cpp
@@ -1522,7 +1522,7 @@ Error VariantParser::parse_tag_assign_eof(Stream *p_stream, int &line, String &r
return err;
if (tk.type != TK_STRING) {
r_err_str = "Error reading quoted string";
- return err;
+ return ERR_INVALID_DATA;
}
what = tk.value;