diff options
Diffstat (limited to 'core/io')
-rw-r--r-- | core/io/config_file.cpp | 6 | ||||
-rw-r--r-- | core/io/file_access_pack.cpp | 7 | ||||
-rw-r--r-- | core/io/http_client.cpp | 10 | ||||
-rw-r--r-- | core/io/packet_peer.cpp | 10 | ||||
-rw-r--r-- | core/io/packet_peer_udp.cpp | 4 | ||||
-rw-r--r-- | core/io/resource_format_binary.cpp | 6 | ||||
-rw-r--r-- | core/io/resource_format_binary.h | 8 | ||||
-rw-r--r-- | core/io/resource_import.h | 6 | ||||
-rw-r--r-- | core/io/resource_loader.cpp | 2 | ||||
-rw-r--r-- | core/io/stream_peer.cpp | 6 | ||||
-rw-r--r-- | core/io/stream_peer_ssl.cpp | 4 | ||||
-rw-r--r-- | core/io/tcp_server.cpp | 2 |
12 files changed, 35 insertions, 36 deletions
diff --git a/core/io/config_file.cpp b/core/io/config_file.cpp index 4067899068..edd090adf2 100644 --- a/core/io/config_file.cpp +++ b/core/io/config_file.cpp @@ -205,7 +205,7 @@ Error ConfigFile::load(const String &p_path) { void ConfigFile::_bind_methods() { ClassDB::bind_method(D_METHOD("set_value", "section", "key", "value"), &ConfigFile::set_value); - ClassDB::bind_method(D_METHOD("get_value:Variant", "section", "key", "default"), &ConfigFile::get_value, DEFVAL(Variant())); + ClassDB::bind_method(D_METHOD("get_value", "section", "key", "default"), &ConfigFile::get_value, DEFVAL(Variant())); ClassDB::bind_method(D_METHOD("has_section", "section"), &ConfigFile::has_section); ClassDB::bind_method(D_METHOD("has_section_key", "section", "key"), &ConfigFile::has_section_key); @@ -215,8 +215,8 @@ void ConfigFile::_bind_methods() { ClassDB::bind_method(D_METHOD("erase_section", "section"), &ConfigFile::erase_section); - ClassDB::bind_method(D_METHOD("load:Error", "path"), &ConfigFile::load); - ClassDB::bind_method(D_METHOD("save:Error", "path"), &ConfigFile::save); + ClassDB::bind_method(D_METHOD("load", "path"), &ConfigFile::load); + ClassDB::bind_method(D_METHOD("save", "path"), &ConfigFile::save); } ConfigFile::ConfigFile() { diff --git a/core/io/file_access_pack.cpp b/core/io/file_access_pack.cpp index 79aa39521f..c3bcfc840b 100644 --- a/core/io/file_access_pack.cpp +++ b/core/io/file_access_pack.cpp @@ -308,10 +308,9 @@ bool FileAccessPack::file_exists(const String &p_name) { return false; } -FileAccessPack::FileAccessPack(const String &p_path, const PackedData::PackedFile &p_file) { - - pf = p_file; - f = FileAccess::open(pf.pack, FileAccess::READ); +FileAccessPack::FileAccessPack(const String &p_path, const PackedData::PackedFile &p_file) + : pf(p_file), + f(FileAccess::open(pf.pack, FileAccess::READ)) { if (!f) { ERR_EXPLAIN("Can't open pack-referenced file: " + String(pf.pack)); ERR_FAIL_COND(!f); diff --git a/core/io/http_client.cpp b/core/io/http_client.cpp index 0c84a5213f..4d5b88cfa1 100644 --- a/core/io/http_client.cpp +++ b/core/io/http_client.cpp @@ -624,9 +624,9 @@ Error HTTPClient::_get_http_data(uint8_t *p_buffer, int p_bytes, int &r_received void HTTPClient::_bind_methods() { - ClassDB::bind_method(D_METHOD("connect_to_host:Error", "host", "port", "use_ssl", "verify_host"), &HTTPClient::connect_to_host, DEFVAL(false), DEFVAL(true)); - ClassDB::bind_method(D_METHOD("set_connection", "connection:StreamPeer"), &HTTPClient::set_connection); - ClassDB::bind_method(D_METHOD("get_connection:StreamPeer"), &HTTPClient::get_connection); + ClassDB::bind_method(D_METHOD("connect_to_host", "host", "port", "use_ssl", "verify_host"), &HTTPClient::connect_to_host, DEFVAL(false), DEFVAL(true)); + ClassDB::bind_method(D_METHOD("set_connection", "connection"), &HTTPClient::set_connection); + ClassDB::bind_method(D_METHOD("get_connection"), &HTTPClient::get_connection); ClassDB::bind_method(D_METHOD("request_raw", "method", "url", "headers", "body"), &HTTPClient::request_raw); ClassDB::bind_method(D_METHOD("request", "method", "url", "headers", "body"), &HTTPClient::request, DEFVAL(String())); ClassDB::bind_method(D_METHOD("send_body_text", "body"), &HTTPClient::send_body_text); @@ -646,9 +646,9 @@ void HTTPClient::_bind_methods() { ClassDB::bind_method(D_METHOD("is_blocking_mode_enabled"), &HTTPClient::is_blocking_mode_enabled); ClassDB::bind_method(D_METHOD("get_status"), &HTTPClient::get_status); - ClassDB::bind_method(D_METHOD("poll:Error"), &HTTPClient::poll); + ClassDB::bind_method(D_METHOD("poll"), &HTTPClient::poll); - ClassDB::bind_method(D_METHOD("query_string_from_dict:String", "fields"), &HTTPClient::query_string_from_dict); + ClassDB::bind_method(D_METHOD("query_string_from_dict", "fields"), &HTTPClient::query_string_from_dict); BIND_CONSTANT(METHOD_GET); BIND_CONSTANT(METHOD_HEAD); diff --git a/core/io/packet_peer.cpp b/core/io/packet_peer.cpp index 40082cc481..c028d7d197 100644 --- a/core/io/packet_peer.cpp +++ b/core/io/packet_peer.cpp @@ -120,11 +120,11 @@ Error PacketPeer::_get_packet_error() const { void PacketPeer::_bind_methods() { - ClassDB::bind_method(D_METHOD("get_var:Variant"), &PacketPeer::_bnd_get_var); - ClassDB::bind_method(D_METHOD("put_var", "var:Variant"), &PacketPeer::put_var); + ClassDB::bind_method(D_METHOD("get_var"), &PacketPeer::_bnd_get_var); + ClassDB::bind_method(D_METHOD("put_var", "var"), &PacketPeer::put_var); ClassDB::bind_method(D_METHOD("get_packet"), &PacketPeer::_get_packet); - ClassDB::bind_method(D_METHOD("put_packet:Error", "buffer"), &PacketPeer::_put_packet); - ClassDB::bind_method(D_METHOD("get_packet_error:Error"), &PacketPeer::_get_packet_error); + ClassDB::bind_method(D_METHOD("put_packet", "buffer"), &PacketPeer::_put_packet); + ClassDB::bind_method(D_METHOD("get_packet_error"), &PacketPeer::_get_packet_error); ClassDB::bind_method(D_METHOD("get_available_packet_count"), &PacketPeer::get_available_packet_count); }; @@ -138,7 +138,7 @@ void PacketPeerStream::_set_stream_peer(REF p_peer) { void PacketPeerStream::_bind_methods() { - ClassDB::bind_method(D_METHOD("set_stream_peer", "peer:StreamPeer"), &PacketPeerStream::_set_stream_peer); + ClassDB::bind_method(D_METHOD("set_stream_peer", "peer"), &PacketPeerStream::_set_stream_peer); ClassDB::bind_method(D_METHOD("set_input_buffer_max_size", "max_size_bytes"), &PacketPeerStream::set_input_buffer_max_size); ClassDB::bind_method(D_METHOD("set_output_buffer_max_size", "max_size_bytes"), &PacketPeerStream::set_output_buffer_max_size); } diff --git a/core/io/packet_peer_udp.cpp b/core/io/packet_peer_udp.cpp index 8bc3241cc5..d1729819a8 100644 --- a/core/io/packet_peer_udp.cpp +++ b/core/io/packet_peer_udp.cpp @@ -59,9 +59,9 @@ Error PacketPeerUDP::_set_dest_address(const String &p_address, int p_port) { void PacketPeerUDP::_bind_methods() { - ClassDB::bind_method(D_METHOD("listen:Error", "port", "bind_address", "recv_buf_size"), &PacketPeerUDP::listen, DEFVAL("*"), DEFVAL(65536)); + ClassDB::bind_method(D_METHOD("listen", "port", "bind_address", "recv_buf_size"), &PacketPeerUDP::listen, DEFVAL("*"), DEFVAL(65536)); ClassDB::bind_method(D_METHOD("close"), &PacketPeerUDP::close); - ClassDB::bind_method(D_METHOD("wait:Error"), &PacketPeerUDP::wait); + ClassDB::bind_method(D_METHOD("wait"), &PacketPeerUDP::wait); ClassDB::bind_method(D_METHOD("is_listening"), &PacketPeerUDP::is_listening); ClassDB::bind_method(D_METHOD("get_packet_ip"), &PacketPeerUDP::_get_packet_ip); //ClassDB::bind_method(D_METHOD("get_packet_address"),&PacketPeerUDP::_get_packet_address); diff --git a/core/io/resource_format_binary.cpp b/core/io/resource_format_binary.cpp index 9aa16ed7e7..fd8928b8a0 100644 --- a/core/io/resource_format_binary.cpp +++ b/core/io/resource_format_binary.cpp @@ -717,7 +717,7 @@ Error ResourceInteractiveLoaderBinary::poll() { if (!r) { error = ERR_FILE_CORRUPT; memdelete(obj); //bye - ERR_EXPLAIN(local_path + ":Resoucre type in resource field not a resource, type is: " + obj->get_class()); + ERR_EXPLAIN(local_path + ":Resource type in resource field not a resource, type is: " + obj->get_class()); ERR_FAIL_COND_V(!r, ERR_FILE_CORRUPT); } @@ -901,7 +901,7 @@ void ResourceInteractiveLoaderBinary::open(FileAccess *p_f) { uint32_t ext_resources_size = f->get_32(); for (uint32_t i = 0; i < ext_resources_size; i++) { - ExtResoucre er; + ExtResource er; er.type = get_unicode_string(); er.path = get_unicode_string(); external_resources.push_back(er); @@ -926,7 +926,7 @@ void ResourceInteractiveLoaderBinary::open(FileAccess *p_f) { for (uint32_t i = 0; i < int_resources_size; i++) { - IntResoucre ir; + IntResource ir; ir.path = get_unicode_string(); ir.offset = f->get_64(); internal_resources.push_back(ir); diff --git a/core/io/resource_format_binary.h b/core/io/resource_format_binary.h index 5da5a0fc37..1c66344e3e 100644 --- a/core/io/resource_format_binary.h +++ b/core/io/resource_format_binary.h @@ -56,19 +56,19 @@ class ResourceInteractiveLoaderBinary : public ResourceInteractiveLoader { StringName _get_string(); - struct ExtResoucre { + struct ExtResource { String path; String type; }; - Vector<ExtResoucre> external_resources; + Vector<ExtResource> external_resources; - struct IntResoucre { + struct IntResource { String path; uint64_t offset; }; - Vector<IntResoucre> internal_resources; + Vector<IntResource> internal_resources; String get_unicode_string(); void _advance_padding(uint32_t p_len); diff --git a/core/io/resource_import.h b/core/io/resource_import.h index 9d2a5180dc..d3f98cbc07 100644 --- a/core/io/resource_import.h +++ b/core/io/resource_import.h @@ -85,9 +85,9 @@ public: PropertyInfo option; Variant default_value; - ImportOption(const PropertyInfo &p_info, const Variant &p_default) { - option = p_info; - default_value = p_default; + ImportOption(const PropertyInfo &p_info, const Variant &p_default) + : option(p_info), + default_value(p_default) { } ImportOption() {} }; diff --git a/core/io/resource_loader.cpp b/core/io/resource_loader.cpp index 9b89fa3399..5347cd6ee1 100644 --- a/core/io/resource_loader.cpp +++ b/core/io/resource_loader.cpp @@ -84,7 +84,7 @@ void ResourceLoader::get_recognized_extensions_for_type(const String &p_type, Li void ResourceInteractiveLoader::_bind_methods() { - ClassDB::bind_method(D_METHOD("get_resource:Resource"), &ResourceInteractiveLoader::get_resource); + ClassDB::bind_method(D_METHOD("get_resource"), &ResourceInteractiveLoader::get_resource); ClassDB::bind_method(D_METHOD("poll"), &ResourceInteractiveLoader::poll); ClassDB::bind_method(D_METHOD("wait"), &ResourceInteractiveLoader::wait); ClassDB::bind_method(D_METHOD("get_stage"), &ResourceInteractiveLoader::get_stage); diff --git a/core/io/stream_peer.cpp b/core/io/stream_peer.cpp index 0dbcb3cf56..fdad7c7bdf 100644 --- a/core/io/stream_peer.cpp +++ b/core/io/stream_peer.cpp @@ -385,7 +385,7 @@ void StreamPeer::_bind_methods() { ClassDB::bind_method(D_METHOD("put_float", "val"), &StreamPeer::put_float); ClassDB::bind_method(D_METHOD("put_double", "val"), &StreamPeer::put_double); ClassDB::bind_method(D_METHOD("put_utf8_string", "val"), &StreamPeer::put_utf8_string); - ClassDB::bind_method(D_METHOD("put_var", "val:Variant"), &StreamPeer::put_var); + ClassDB::bind_method(D_METHOD("put_var", "val"), &StreamPeer::put_var); ClassDB::bind_method(D_METHOD("get_8"), &StreamPeer::get_8); ClassDB::bind_method(D_METHOD("get_u8"), &StreamPeer::get_u8); @@ -399,7 +399,7 @@ void StreamPeer::_bind_methods() { ClassDB::bind_method(D_METHOD("get_double"), &StreamPeer::get_double); ClassDB::bind_method(D_METHOD("get_string", "bytes"), &StreamPeer::get_string); ClassDB::bind_method(D_METHOD("get_utf8_string", "bytes"), &StreamPeer::get_utf8_string); - ClassDB::bind_method(D_METHOD("get_var:Variant"), &StreamPeer::get_var); + ClassDB::bind_method(D_METHOD("get_var"), &StreamPeer::get_var); } //////////////////////////////// @@ -412,7 +412,7 @@ void StreamPeerBuffer::_bind_methods() { ClassDB::bind_method(D_METHOD("set_data_array", "data"), &StreamPeerBuffer::set_data_array); ClassDB::bind_method(D_METHOD("get_data_array"), &StreamPeerBuffer::get_data_array); ClassDB::bind_method(D_METHOD("clear"), &StreamPeerBuffer::clear); - ClassDB::bind_method(D_METHOD("duplicate:StreamPeerBuffer"), &StreamPeerBuffer::duplicate); + ClassDB::bind_method(D_METHOD("duplicate"), &StreamPeerBuffer::duplicate); } Error StreamPeerBuffer::put_data(const uint8_t *p_data, int p_bytes) { diff --git a/core/io/stream_peer_ssl.cpp b/core/io/stream_peer_ssl.cpp index 57cffd073a..ef3c264375 100644 --- a/core/io/stream_peer_ssl.cpp +++ b/core/io/stream_peer_ssl.cpp @@ -51,8 +51,8 @@ bool StreamPeerSSL::is_available() { void StreamPeerSSL::_bind_methods() { - ClassDB::bind_method(D_METHOD("accept_stream:Error", "stream:StreamPeer"), &StreamPeerSSL::accept_stream); - ClassDB::bind_method(D_METHOD("connect_to_stream:Error", "stream:StreamPeer", "validate_certs", "for_hostname"), &StreamPeerSSL::connect_to_stream, DEFVAL(false), DEFVAL(String())); + ClassDB::bind_method(D_METHOD("accept_stream", "stream"), &StreamPeerSSL::accept_stream); + ClassDB::bind_method(D_METHOD("connect_to_stream", "stream", "validate_certs", "for_hostname"), &StreamPeerSSL::connect_to_stream, DEFVAL(false), DEFVAL(String())); ClassDB::bind_method(D_METHOD("get_status"), &StreamPeerSSL::get_status); ClassDB::bind_method(D_METHOD("disconnect_from_stream"), &StreamPeerSSL::disconnect_from_stream); BIND_CONSTANT(STATUS_DISCONNECTED); diff --git a/core/io/tcp_server.cpp b/core/io/tcp_server.cpp index 4c891188ee..29a80ecc19 100644 --- a/core/io/tcp_server.cpp +++ b/core/io/tcp_server.cpp @@ -49,7 +49,7 @@ void TCP_Server::_bind_methods() { ClassDB::bind_method(D_METHOD("listen", "port", "bind_address"), &TCP_Server::listen, DEFVAL("*")); ClassDB::bind_method(D_METHOD("is_connection_available"), &TCP_Server::is_connection_available); - ClassDB::bind_method(D_METHOD("take_connection:StreamPeerTCP"), &TCP_Server::take_connection); + ClassDB::bind_method(D_METHOD("take_connection"), &TCP_Server::take_connection); ClassDB::bind_method(D_METHOD("stop"), &TCP_Server::stop); } |