summaryrefslogtreecommitdiff
path: root/core
diff options
context:
space:
mode:
Diffstat (limited to 'core')
-rw-r--r--core/bind/core_bind.cpp15
-rw-r--r--core/bind/core_bind.h2
-rw-r--r--core/core_string_names.cpp47
-rw-r--r--core/dvector.h12
-rw-r--r--core/func_ref.cpp5
-rw-r--r--core/image.cpp12
-rw-r--r--core/io/file_access_compressed.cpp35
-rw-r--r--core/io/file_access_zip.cpp89
-rw-r--r--core/io/logger.cpp13
-rw-r--r--core/io/marshalls.cpp5
-rw-r--r--core/io/packet_peer.cpp7
-rw-r--r--core/io/packet_peer_udp.cpp13
-rw-r--r--core/io/resource_format_binary.cpp11
-rw-r--r--core/io/stream_peer_tcp.cpp11
-rw-r--r--core/io/tcp_server.cpp5
-rw-r--r--core/math/expression.cpp14
-rw-r--r--core/math/expression.h4
-rw-r--r--core/math/plane.h5
-rw-r--r--core/math/quat.h28
-rw-r--r--core/message_queue.cpp2
-rw-r--r--core/os/dir_access.cpp12
-rw-r--r--core/os/main_loop.cpp1
-rw-r--r--core/os/main_loop.h1
-rw-r--r--core/os/os.h4
-rw-r--r--core/reference.cpp4
-rw-r--r--core/ustring.h2
-rw-r--r--core/variant_parser.h3
27 files changed, 191 insertions, 171 deletions
diff --git a/core/bind/core_bind.cpp b/core/bind/core_bind.cpp
index 0032c43179..8641af84d9 100644
--- a/core/bind/core_bind.cpp
+++ b/core/bind/core_bind.cpp
@@ -378,12 +378,20 @@ bool _OS::get_borderless_window() const {
void _OS::set_ime_active(const bool p_active) {
- return OS::get_singleton()->set_ime_active(p_active);
+ OS::get_singleton()->set_ime_active(p_active);
}
void _OS::set_ime_position(const Point2 &p_pos) {
- return OS::get_singleton()->set_ime_position(p_pos);
+ OS::get_singleton()->set_ime_position(p_pos);
+}
+
+Point2 _OS::get_ime_selection() const {
+ return OS::get_singleton()->get_ime_selection();
+}
+
+String _OS::get_ime_text() const {
+ return OS::get_singleton()->get_ime_text();
}
void _OS::set_use_file_access_save_and_swap(bool p_enable) {
@@ -1134,7 +1142,10 @@ void _OS::_bind_methods() {
ClassDB::bind_method(D_METHOD("get_window_per_pixel_transparency_enabled"), &_OS::get_window_per_pixel_transparency_enabled);
ClassDB::bind_method(D_METHOD("set_window_per_pixel_transparency_enabled", "enabled"), &_OS::set_window_per_pixel_transparency_enabled);
+ ClassDB::bind_method(D_METHOD("set_ime_active", "active"), &_OS::set_ime_active);
ClassDB::bind_method(D_METHOD("set_ime_position", "position"), &_OS::set_ime_position);
+ ClassDB::bind_method(D_METHOD("get_ime_selection"), &_OS::get_ime_selection);
+ ClassDB::bind_method(D_METHOD("get_ime_text"), &_OS::get_ime_text);
ClassDB::bind_method(D_METHOD("set_screen_orientation", "orientation"), &_OS::set_screen_orientation);
ClassDB::bind_method(D_METHOD("get_screen_orientation"), &_OS::get_screen_orientation);
diff --git a/core/bind/core_bind.h b/core/bind/core_bind.h
index 720b14bf56..4cdf09d522 100644
--- a/core/bind/core_bind.h
+++ b/core/bind/core_bind.h
@@ -195,6 +195,8 @@ public:
virtual void set_ime_active(const bool p_active);
virtual void set_ime_position(const Point2 &p_pos);
+ virtual Point2 get_ime_selection() const;
+ virtual String get_ime_text() const;
Error native_video_play(String p_path, float p_volume, String p_audio_track, String p_subtitle_track);
bool native_video_is_playing();
diff --git a/core/core_string_names.cpp b/core/core_string_names.cpp
index ba596f7f16..8a3fdade64 100644
--- a/core/core_string_names.cpp
+++ b/core/core_string_names.cpp
@@ -47,28 +47,27 @@ CoreStringNames::CoreStringNames() :
#ifdef TOOLS_ENABLED
_sections_unfolded(StaticCString::create("_sections_unfolded")),
#endif
- _custom_features(StaticCString::create("_custom_features")) {
-
- x = StaticCString::create("x");
- y = StaticCString::create("y");
- z = StaticCString::create("z");
- w = StaticCString::create("w");
- r = StaticCString::create("r");
- g = StaticCString::create("g");
- b = StaticCString::create("b");
- a = StaticCString::create("a");
- position = StaticCString::create("position");
- size = StaticCString::create("size");
- end = StaticCString::create("end");
- basis = StaticCString::create("basis");
- origin = StaticCString::create("origin");
- normal = StaticCString::create("normal");
- d = StaticCString::create("d");
- h = StaticCString::create("h");
- s = StaticCString::create("s");
- v = StaticCString::create("v");
- r8 = StaticCString::create("r8");
- g8 = StaticCString::create("g8");
- b8 = StaticCString::create("b8");
- a8 = StaticCString::create("a8");
+ _custom_features(StaticCString::create("_custom_features")),
+ x(StaticCString::create("x")),
+ y(StaticCString::create("y")),
+ z(StaticCString::create("z")),
+ w(StaticCString::create("w")),
+ r(StaticCString::create("r")),
+ g(StaticCString::create("g")),
+ b(StaticCString::create("b")),
+ a(StaticCString::create("a")),
+ position(StaticCString::create("position")),
+ size(StaticCString::create("size")),
+ end(StaticCString::create("end")),
+ basis(StaticCString::create("basis")),
+ origin(StaticCString::create("origin")),
+ normal(StaticCString::create("normal")),
+ d(StaticCString::create("d")),
+ h(StaticCString::create("h")),
+ s(StaticCString::create("s")),
+ v(StaticCString::create("v")),
+ r8(StaticCString::create("r8")),
+ g8(StaticCString::create("g8")),
+ b8(StaticCString::create("b8")),
+ a8(StaticCString::create("a8")) {
}
diff --git a/core/dvector.h b/core/dvector.h
index 2830c57ec0..9760dcbcad 100644
--- a/core/dvector.h
+++ b/core/dvector.h
@@ -56,12 +56,12 @@ struct MemoryPool {
Alloc *free_list;
- Alloc() {
- mem = NULL;
- lock = 0;
- pool_id = POOL_ALLOCATOR_INVALID_ID;
- size = 0;
- free_list = NULL;
+ Alloc() :
+ lock(0),
+ mem(NULL),
+ pool_id(POOL_ALLOCATOR_INVALID_ID),
+ size(0),
+ free_list(NULL) {
}
};
diff --git a/core/func_ref.cpp b/core/func_ref.cpp
index c707f1c4cb..d9d1a2b799 100644
--- a/core/func_ref.cpp
+++ b/core/func_ref.cpp
@@ -69,7 +69,6 @@ void FuncRef::_bind_methods() {
ClassDB::bind_method(D_METHOD("set_function", "name"), &FuncRef::set_function);
}
-FuncRef::FuncRef() {
-
- id = 0;
+FuncRef::FuncRef() :
+ id(0) {
}
diff --git a/core/image.cpp b/core/image.cpp
index 698a0b0b98..dca8aedb8f 100644
--- a/core/image.cpp
+++ b/core/image.cpp
@@ -1931,7 +1931,8 @@ void Image::blit_rect(const Ref<Image> &p_src, const Rect2 &p_src_rect, const Po
if (clipped_src_rect.size.x <= 0 || clipped_src_rect.size.y <= 0)
return;
- Rect2i dest_rect = Rect2i(0, 0, width, height).clip(Rect2i(p_dest, clipped_src_rect.size));
+ Point2 src_underscan = Point2(MIN(0, p_src_rect.position.x), MIN(0, p_src_rect.position.y));
+ Rect2i dest_rect = Rect2i(0, 0, width, height).clip(Rect2i(p_dest - src_underscan, clipped_src_rect.size));
PoolVector<uint8_t>::Write wp = data.write();
uint8_t *dst_data_ptr = wp.ptr();
@@ -1985,7 +1986,8 @@ void Image::blit_rect_mask(const Ref<Image> &p_src, const Ref<Image> &p_mask, co
if (clipped_src_rect.size.x <= 0 || clipped_src_rect.size.y <= 0)
return;
- Rect2i dest_rect = Rect2i(0, 0, width, height).clip(Rect2i(p_dest, clipped_src_rect.size));
+ Point2 src_underscan = Point2(MIN(0, p_src_rect.position.x), MIN(0, p_src_rect.position.y));
+ Rect2i dest_rect = Rect2i(0, 0, width, height).clip(Rect2i(p_dest - src_underscan, clipped_src_rect.size));
PoolVector<uint8_t>::Write wp = data.write();
uint8_t *dst_data_ptr = wp.ptr();
@@ -2042,7 +2044,8 @@ void Image::blend_rect(const Ref<Image> &p_src, const Rect2 &p_src_rect, const P
if (clipped_src_rect.size.x <= 0 || clipped_src_rect.size.y <= 0)
return;
- Rect2i dest_rect = Rect2i(0, 0, width, height).clip(Rect2i(p_dest, clipped_src_rect.size));
+ Point2 src_underscan = Point2(MIN(0, p_src_rect.position.x), MIN(0, p_src_rect.position.y));
+ Rect2i dest_rect = Rect2i(0, 0, width, height).clip(Rect2i(p_dest - src_underscan, clipped_src_rect.size));
lock();
Ref<Image> img = p_src;
@@ -2096,7 +2099,8 @@ void Image::blend_rect_mask(const Ref<Image> &p_src, const Ref<Image> &p_mask, c
if (clipped_src_rect.size.x <= 0 || clipped_src_rect.size.y <= 0)
return;
- Rect2i dest_rect = Rect2i(0, 0, width, height).clip(Rect2i(p_dest, clipped_src_rect.size));
+ Point2 src_underscan = Point2(MIN(0, p_src_rect.position.x), MIN(0, p_src_rect.position.y));
+ Rect2i dest_rect = Rect2i(0, 0, width, height).clip(Rect2i(p_dest - src_underscan, clipped_src_rect.size));
lock();
Ref<Image> img = p_src;
diff --git a/core/io/file_access_compressed.cpp b/core/io/file_access_compressed.cpp
index 645d97ae7e..a3633dc1f4 100644
--- a/core/io/file_access_compressed.cpp
+++ b/core/io/file_access_compressed.cpp
@@ -373,24 +373,23 @@ uint64_t FileAccessCompressed::_get_modified_time(const String &p_file) {
return 0;
}
-FileAccessCompressed::FileAccessCompressed() {
-
- f = NULL;
- magic = "GCMP";
- cmode = Compression::MODE_ZSTD;
- writing = false;
- write_ptr = 0;
- write_buffer_size = 0;
- write_max = 0;
- block_size = 0;
- read_eof = false;
- at_end = false;
- read_total = 0;
- read_ptr = NULL;
- read_block = 0;
- read_block_count = 0;
- read_block_size = 0;
- read_pos = 0;
+FileAccessCompressed::FileAccessCompressed() :
+ cmode(Compression::MODE_ZSTD),
+ writing(false),
+ write_ptr(0),
+ write_buffer_size(0),
+ write_max(0),
+ block_size(0),
+ read_eof(false),
+ at_end(false),
+ read_ptr(NULL),
+ read_block(0),
+ read_block_count(0),
+ read_block_size(0),
+ read_pos(0),
+ read_total(0),
+ magic("GCMP"),
+ f(NULL) {
}
FileAccessCompressed::~FileAccessCompressed() {
diff --git a/core/io/file_access_zip.cpp b/core/io/file_access_zip.cpp
index 7b6385c3ff..d99cdf0d86 100644
--- a/core/io/file_access_zip.cpp
+++ b/core/io/file_access_zip.cpp
@@ -43,31 +43,31 @@ static void *godot_open(void *data, const char *p_fname, int mode) {
if (mode & ZLIB_FILEFUNC_MODE_WRITE) {
return NULL;
- };
+ }
FileAccess *f = (FileAccess *)data;
f->open(p_fname, FileAccess::READ);
return f->is_open() ? data : NULL;
-};
+}
static uLong godot_read(void *data, void *fdata, void *buf, uLong size) {
FileAccess *f = (FileAccess *)data;
f->get_buffer((uint8_t *)buf, size);
return size;
-};
+}
static uLong godot_write(voidpf opaque, voidpf stream, const void *buf, uLong size) {
return 0;
-};
+}
static long godot_tell(voidpf opaque, voidpf stream) {
FileAccess *f = (FileAccess *)opaque;
return f->get_position();
-};
+}
static long godot_seek(voidpf opaque, voidpf stream, uLong offset, int origin) {
@@ -84,36 +84,36 @@ static long godot_seek(voidpf opaque, voidpf stream, uLong offset, int origin) {
break;
default:
break;
- };
+ }
f->seek(pos);
return 0;
-};
+}
static int godot_close(voidpf opaque, voidpf stream) {
FileAccess *f = (FileAccess *)opaque;
f->close();
return 0;
-};
+}
static int godot_testerror(voidpf opaque, voidpf stream) {
FileAccess *f = (FileAccess *)opaque;
return f->get_error() != OK ? 1 : 0;
-};
+}
static voidpf godot_alloc(voidpf opaque, uInt items, uInt size) {
return memalloc(items * size);
-};
+}
static void godot_free(voidpf opaque, voidpf address) {
memfree(address);
-};
+}
-}; // extern "C"
+} // extern "C"
void ZipArchive::close_handle(unzFile p_file) const {
@@ -122,7 +122,7 @@ void ZipArchive::close_handle(unzFile p_file) const {
unzCloseCurrentFile(p_file);
unzClose(p_file);
memdelete(f);
-};
+}
unzFile ZipArchive::get_file_handle(String p_file) const {
@@ -155,10 +155,10 @@ unzFile ZipArchive::get_file_handle(String p_file) const {
unzClose(pkg);
ERR_FAIL_V(NULL);
- };
+ }
return pkg;
-};
+}
bool ZipArchive::try_open_pack(const String &p_path) {
@@ -215,36 +215,36 @@ bool ZipArchive::try_open_pack(const String &p_path) {
if ((i + 1) < gi.number_entry) {
unzGoToNextFile(zfile);
- };
- };
+ }
+ }
return true;
-};
+}
bool ZipArchive::file_exists(String p_name) const {
return files.has(p_name);
-};
+}
FileAccess *ZipArchive::get_file(const String &p_path, PackedData::PackedFile *p_file) {
return memnew(FileAccessZip(p_path, *p_file));
-};
+}
ZipArchive *ZipArchive::get_singleton() {
if (instance == NULL) {
instance = memnew(ZipArchive);
- };
+ }
return instance;
-};
+}
ZipArchive::ZipArchive() {
instance = this;
//fa_create_func = FileAccess::get_create_func();
-};
+}
ZipArchive::~ZipArchive() {
@@ -253,10 +253,10 @@ ZipArchive::~ZipArchive() {
FileAccess *f = (FileAccess *)unzGetOpaque(packages[i].zfile);
unzClose(packages[i].zfile);
memdelete(f);
- };
+ }
packages.clear();
-};
+}
Error FileAccessZip::_open(const String &p_path, int p_mode_flags) {
@@ -272,7 +272,7 @@ Error FileAccessZip::_open(const String &p_path, int p_mode_flags) {
ERR_FAIL_COND_V(err != UNZ_OK, FAILED);
return OK;
-};
+}
void FileAccessZip::close() {
@@ -283,50 +283,50 @@ void FileAccessZip::close() {
ERR_FAIL_COND(!arch);
arch->close_handle(zfile);
zfile = NULL;
-};
+}
bool FileAccessZip::is_open() const {
return zfile != NULL;
-};
+}
void FileAccessZip::seek(size_t p_position) {
ERR_FAIL_COND(!zfile);
unzSeekCurrentFile(zfile, p_position);
-};
+}
void FileAccessZip::seek_end(int64_t p_position) {
ERR_FAIL_COND(!zfile);
unzSeekCurrentFile(zfile, get_len() + p_position);
-};
+}
size_t FileAccessZip::get_position() const {
ERR_FAIL_COND_V(!zfile, 0);
return unztell(zfile);
-};
+}
size_t FileAccessZip::get_len() const {
ERR_FAIL_COND_V(!zfile, 0);
return file_info.uncompressed_size;
-};
+}
bool FileAccessZip::eof_reached() const {
ERR_FAIL_COND_V(!zfile, true);
return at_eof;
-};
+}
uint8_t FileAccessZip::get_8() const {
uint8_t ret = 0;
get_buffer(&ret, 1);
return ret;
-};
+}
int FileAccessZip::get_buffer(uint8_t *p_dst, int p_length) const {
@@ -339,20 +339,20 @@ int FileAccessZip::get_buffer(uint8_t *p_dst, int p_length) const {
if (read < p_length)
at_eof = true;
return read;
-};
+}
Error FileAccessZip::get_error() const {
if (!zfile) {
return ERR_UNCONFIGURED;
- };
+ }
if (eof_reached()) {
return ERR_FILE_EOF;
- };
+ }
return OK;
-};
+}
void FileAccessZip::flush() {
@@ -362,22 +362,21 @@ void FileAccessZip::flush() {
void FileAccessZip::store_8(uint8_t p_dest) {
ERR_FAIL();
-};
+}
bool FileAccessZip::file_exists(const String &p_name) {
return false;
-};
-
-FileAccessZip::FileAccessZip(const String &p_path, const PackedData::PackedFile &p_file) {
+}
- zfile = NULL;
+FileAccessZip::FileAccessZip(const String &p_path, const PackedData::PackedFile &p_file) :
+ zfile(NULL) {
_open(p_path, FileAccess::READ);
-};
+}
FileAccessZip::~FileAccessZip() {
close();
-};
+}
#endif
diff --git a/core/io/logger.cpp b/core/io/logger.cpp
index 01755c8ee9..3c4b4a1ac3 100644
--- a/core/io/logger.cpp
+++ b/core/io/logger.cpp
@@ -179,11 +179,10 @@ void RotatedFileLogger::rotate_file() {
file = FileAccess::open(base_path, FileAccess::WRITE);
}
-RotatedFileLogger::RotatedFileLogger(const String &p_base_path, int p_max_files) {
- file = NULL;
- base_path = p_base_path.simplify_path();
- max_files = p_max_files > 0 ? p_max_files : 1;
-
+RotatedFileLogger::RotatedFileLogger(const String &p_base_path, int p_max_files) :
+ base_path(p_base_path.simplify_path()),
+ max_files(p_max_files > 0 ? p_max_files : 1),
+ file(NULL) {
rotate_file();
}
@@ -240,8 +239,8 @@ void StdLogger::logv(const char *p_format, va_list p_list, bool p_err) {
StdLogger::~StdLogger() {}
-CompositeLogger::CompositeLogger(Vector<Logger *> p_loggers) {
- loggers = p_loggers;
+CompositeLogger::CompositeLogger(Vector<Logger *> p_loggers) :
+ loggers(p_loggers) {
}
void CompositeLogger::logv(const char *p_format, va_list p_list, bool p_err) {
diff --git a/core/io/marshalls.cpp b/core/io/marshalls.cpp
index 6338cee39d..c71903c94d 100644
--- a/core/io/marshalls.cpp
+++ b/core/io/marshalls.cpp
@@ -55,9 +55,8 @@ ObjectID EncodedObjectAsID::get_object_id() const {
return id;
}
-EncodedObjectAsID::EncodedObjectAsID() {
-
- id = 0;
+EncodedObjectAsID::EncodedObjectAsID() :
+ id(0) {
}
#define ENCODE_MASK 0xFF
diff --git a/core/io/packet_peer.cpp b/core/io/packet_peer.cpp
index b6dd4eaf6f..aadcca01d5 100644
--- a/core/io/packet_peer.cpp
+++ b/core/io/packet_peer.cpp
@@ -35,10 +35,9 @@
/* helpers / binders */
-PacketPeer::PacketPeer() {
-
- allow_object_decoding = false;
- last_get_error = OK;
+PacketPeer::PacketPeer() :
+ last_get_error(OK),
+ allow_object_decoding(false) {
}
void PacketPeer::set_allow_object_decoding(bool p_enable) {
diff --git a/core/io/packet_peer_udp.cpp b/core/io/packet_peer_udp.cpp
index d33ba6f855..2e916d6a48 100644
--- a/core/io/packet_peer_udp.cpp
+++ b/core/io/packet_peer_udp.cpp
@@ -239,13 +239,12 @@ void PacketPeerUDP::_bind_methods() {
ClassDB::bind_method(D_METHOD("set_dest_address", "host", "port"), &PacketPeerUDP::_set_dest_address);
}
-PacketPeerUDP::PacketPeerUDP() {
-
- _sock = Ref<NetSocket>(NetSocket::create());
- blocking = true;
- packet_port = 0;
- queue_count = 0;
- peer_port = 0;
+PacketPeerUDP::PacketPeerUDP() :
+ packet_port(0),
+ queue_count(0),
+ peer_port(0),
+ blocking(true),
+ _sock(Ref<NetSocket>(NetSocket::create())) {
rb.resize(16);
}
diff --git a/core/io/resource_format_binary.cpp b/core/io/resource_format_binary.cpp
index 6f3a8c3d2e..b91268dab2 100644
--- a/core/io/resource_format_binary.cpp
+++ b/core/io/resource_format_binary.cpp
@@ -970,12 +970,11 @@ String ResourceInteractiveLoaderBinary::recognize(FileAccess *p_f) {
return type;
}
-ResourceInteractiveLoaderBinary::ResourceInteractiveLoaderBinary() {
-
- f = NULL;
- stage = 0;
- error = OK;
- translation_remapped = false;
+ResourceInteractiveLoaderBinary::ResourceInteractiveLoaderBinary() :
+ translation_remapped(false),
+ f(NULL),
+ error(OK),
+ stage(0) {
}
ResourceInteractiveLoaderBinary::~ResourceInteractiveLoaderBinary() {
diff --git a/core/io/stream_peer_tcp.cpp b/core/io/stream_peer_tcp.cpp
index 28561e8cbc..4b86735aa3 100644
--- a/core/io/stream_peer_tcp.cpp
+++ b/core/io/stream_peer_tcp.cpp
@@ -349,12 +349,11 @@ void StreamPeerTCP::_bind_methods() {
BIND_ENUM_CONSTANT(STATUS_ERROR);
}
-StreamPeerTCP::StreamPeerTCP() {
-
- _sock = Ref<NetSocket>(NetSocket::create());
- status = STATUS_NONE;
- peer_host = IP_Address();
- peer_port = 0;
+StreamPeerTCP::StreamPeerTCP() :
+ _sock(Ref<NetSocket>(NetSocket::create())),
+ status(STATUS_NONE),
+ peer_host(IP_Address()),
+ peer_port(0) {
}
StreamPeerTCP::~StreamPeerTCP() {
diff --git a/core/io/tcp_server.cpp b/core/io/tcp_server.cpp
index b8194cb17f..be9176779e 100644
--- a/core/io/tcp_server.cpp
+++ b/core/io/tcp_server.cpp
@@ -116,9 +116,8 @@ void TCP_Server::stop() {
}
}
-TCP_Server::TCP_Server() {
-
- _sock = Ref<NetSocket>(NetSocket::create());
+TCP_Server::TCP_Server() :
+ _sock(Ref<NetSocket>(NetSocket::create())) {
}
TCP_Server::~TCP_Server() {
diff --git a/core/math/expression.cpp b/core/math/expression.cpp
index 0cfb54234c..7f3439e956 100644
--- a/core/math/expression.cpp
+++ b/core/math/expression.cpp
@@ -2157,13 +2157,13 @@ void Expression::_bind_methods() {
ClassDB::bind_method(D_METHOD("get_error_text"), &Expression::get_error_text);
}
-Expression::Expression() {
- output_type = Variant::NIL;
- error_set = true;
- root = NULL;
- nodes = NULL;
- sequenced = false;
- execution_error = false;
+Expression::Expression() :
+ output_type(Variant::NIL),
+ sequenced(false),
+ error_set(true),
+ root(NULL),
+ nodes(NULL),
+ execution_error(false) {
}
Expression::~Expression() {
diff --git a/core/math/expression.h b/core/math/expression.h
index ac2416d0dd..7f81542480 100644
--- a/core/math/expression.h
+++ b/core/math/expression.h
@@ -116,7 +116,9 @@ private:
Variant::Type type;
String name;
- Input() { type = Variant::NIL; }
+ Input() :
+ type(Variant::NIL) {
+ }
};
Vector<Input> inputs;
diff --git a/core/math/plane.h b/core/math/plane.h
index 4eedebb79e..5182dc67dd 100644
--- a/core/math/plane.h
+++ b/core/math/plane.h
@@ -74,10 +74,11 @@ public:
_FORCE_INLINE_ bool operator!=(const Plane &p_plane) const;
operator String() const;
- _FORCE_INLINE_ Plane() { d = 0; }
+ _FORCE_INLINE_ Plane() :
+ d(0) {}
_FORCE_INLINE_ Plane(real_t p_a, real_t p_b, real_t p_c, real_t p_d) :
normal(p_a, p_b, p_c),
- d(p_d){};
+ d(p_d) {}
_FORCE_INLINE_ Plane(const Vector3 &p_normal, real_t p_d);
_FORCE_INLINE_ Plane(const Vector3 &p_point, const Vector3 &p_normal);
diff --git a/core/math/quat.h b/core/math/quat.h
index c4f9b3a732..59a15f460b 100644
--- a/core/math/quat.h
+++ b/core/math/quat.h
@@ -115,20 +115,20 @@ public:
z = p_z;
w = p_w;
}
- inline Quat(real_t p_x, real_t p_y, real_t p_z, real_t p_w) {
- x = p_x;
- y = p_y;
- z = p_z;
- w = p_w;
+ inline Quat(real_t p_x, real_t p_y, real_t p_z, real_t p_w) :
+ x(p_x),
+ y(p_y),
+ z(p_z),
+ w(p_w) {
}
Quat(const Vector3 &axis, const real_t &angle) { set_axis_angle(axis, angle); }
Quat(const Vector3 &euler) { set_euler(euler); }
- Quat(const Quat &q) {
- x = q.x;
- y = q.y;
- z = q.z;
- w = q.w;
+ Quat(const Quat &q) :
+ x(q.x),
+ y(q.y),
+ z(q.z),
+ w(q.w) {
}
Quat(const Vector3 &v0, const Vector3 &v1) // shortest arc
@@ -153,9 +153,11 @@ public:
}
}
- inline Quat() {
- x = y = z = 0;
- w = 1;
+ inline Quat() :
+ x(0),
+ y(0),
+ z(0),
+ w(1) {
}
};
diff --git a/core/message_queue.cpp b/core/message_queue.cpp
index abfc73407a..2952593798 100644
--- a/core/message_queue.cpp
+++ b/core/message_queue.cpp
@@ -209,9 +209,9 @@ void MessageQueue::statistics() {
} break;
}
+ } else {
//object was deleted
print_line("Object was deleted while awaiting a callback");
- } else {
null_count++;
}
diff --git a/core/os/dir_access.cpp b/core/os/dir_access.cpp
index daa3eacd5f..8f4f2b6920 100644
--- a/core/os/dir_access.cpp
+++ b/core/os/dir_access.cpp
@@ -349,9 +349,9 @@ class DirChanger {
String original_dir;
public:
- DirChanger(DirAccess *p_da, String p_dir) {
- da = p_da;
- original_dir = p_da->get_current_dir();
+ DirChanger(DirAccess *p_da, String p_dir) :
+ da(p_da),
+ original_dir(p_da->get_current_dir()) {
p_da->change_dir(p_dir);
}
@@ -431,8 +431,12 @@ Error DirAccess::copy_dir(String p_from, String p_to, int p_chmod_flags) {
ERR_FAIL_COND_V(err, err);
}
+ if (!p_to.ends_with("/")) {
+ p_to = p_to + "/";
+ }
+
DirChanger dir_changer(this, p_from);
- Error err = _copy_dir(target_da, p_to + "/", p_chmod_flags);
+ Error err = _copy_dir(target_da, p_to, p_chmod_flags);
memdelete(target_da);
return err;
diff --git a/core/os/main_loop.cpp b/core/os/main_loop.cpp
index 0945cdd512..6e0b914367 100644
--- a/core/os/main_loop.cpp
+++ b/core/os/main_loop.cpp
@@ -60,6 +60,7 @@ void MainLoop::_bind_methods() {
BIND_CONSTANT(NOTIFICATION_TRANSLATION_CHANGED);
BIND_CONSTANT(NOTIFICATION_WM_ABOUT);
BIND_CONSTANT(NOTIFICATION_CRASH);
+ BIND_CONSTANT(NOTIFICATION_OS_IME_UPDATE);
};
void MainLoop::set_init_script(const Ref<Script> &p_init_script) {
diff --git a/core/os/main_loop.h b/core/os/main_loop.h
index 43f74302a8..e9b331ee45 100644
--- a/core/os/main_loop.h
+++ b/core/os/main_loop.h
@@ -65,6 +65,7 @@ public:
NOTIFICATION_TRANSLATION_CHANGED = 90,
NOTIFICATION_WM_ABOUT = 91,
NOTIFICATION_CRASH = 92,
+ NOTIFICATION_OS_IME_UPDATE = 93,
};
virtual void input_event(const Ref<InputEvent> &p_event);
diff --git a/core/os/os.h b/core/os/os.h
index 7786ffb26e..05ec3ac424 100644
--- a/core/os/os.h
+++ b/core/os/os.h
@@ -242,7 +242,8 @@ public:
virtual void set_ime_active(const bool p_active) {}
virtual void set_ime_position(const Point2 &p_pos) {}
- virtual void set_ime_intermediate_text_callback(ImeCallback p_callback, void *p_inp) {}
+ virtual Point2 get_ime_selection() const { return Point2(); }
+ virtual String get_ime_text() const { return String(); }
virtual Error open_dynamic_library(const String p_path, void *&p_library_handle, bool p_also_set_library_path = false) { return ERR_UNAVAILABLE; }
virtual Error close_dynamic_library(void *p_library_handle) { return ERR_UNAVAILABLE; }
@@ -480,6 +481,7 @@ public:
enum EngineContext {
CONTEXT_EDITOR,
CONTEXT_PROJECTMAN,
+ CONTEXT_ENGINE,
};
virtual void set_context(int p_context);
diff --git a/core/reference.cpp b/core/reference.cpp
index b79ad0bf3d..6ccc444b93 100644
--- a/core/reference.cpp
+++ b/core/reference.cpp
@@ -139,8 +139,8 @@ void WeakRef::set_ref(const REF &p_ref) {
ref = p_ref.is_valid() ? p_ref->get_instance_id() : 0;
}
-WeakRef::WeakRef() {
- ref = 0;
+WeakRef::WeakRef() :
+ ref(0) {
}
void WeakRef::_bind_methods() {
diff --git a/core/ustring.h b/core/ustring.h
index d2766ec7a3..8e4dbd8031 100644
--- a/core/ustring.h
+++ b/core/ustring.h
@@ -63,7 +63,7 @@ public:
CharString &operator+=(char p_char);
int length() const { return size() ? size() - 1 : 0; }
const char *get_data() const;
- operator const char *() { return get_data(); };
+ operator const char *() const { return get_data(); };
};
typedef wchar_t CharType;
diff --git a/core/variant_parser.h b/core/variant_parser.h
index 531c1d59cd..e183169ed8 100644
--- a/core/variant_parser.h
+++ b/core/variant_parser.h
@@ -45,7 +45,8 @@ public:
CharType saved;
- Stream() { saved = 0; }
+ Stream() :
+ saved(0) {}
virtual ~Stream() {}
};