diff options
Diffstat (limited to 'scene/main')
-rw-r--r-- | scene/main/http_request.cpp | 48 | ||||
-rw-r--r-- | scene/main/http_request.h | 6 | ||||
-rw-r--r-- | scene/main/instance_placeholder.cpp | 2 | ||||
-rw-r--r-- | scene/main/resource_preloader.cpp | 8 | ||||
-rw-r--r-- | scene/main/resource_preloader.h | 2 | ||||
-rw-r--r-- | scene/main/scene_tree.cpp | 6 |
6 files changed, 36 insertions, 36 deletions
diff --git a/scene/main/http_request.cpp b/scene/main/http_request.cpp index 3c89069816..c4fb3335dc 100644 --- a/scene/main/http_request.cpp +++ b/scene/main/http_request.cpp @@ -118,7 +118,7 @@ Error HTTPRequest::request(const String &p_url, const Vector<String> &p_custom_h client->set_blocking_mode(false); err = _request(); if (err != OK) { - call_deferred("_request_done", RESULT_CANT_CONNECT, 0, PoolStringArray(), PoolByteArray()); + call_deferred("_request_done", RESULT_CANT_CONNECT, 0, PackedStringArray(), PackedByteArray()); return ERR_CANT_CONNECT; } @@ -135,7 +135,7 @@ void HTTPRequest::_thread_func(void *p_userdata) { Error err = hr->_request(); if (err != OK) { - hr->call_deferred("_request_done", RESULT_CANT_CONNECT, 0, PoolStringArray(), PoolByteArray()); + hr->call_deferred("_request_done", RESULT_CANT_CONNECT, 0, PackedStringArray(), PackedByteArray()); } else { while (!hr->thread_request_quit) { @@ -180,7 +180,7 @@ void HTTPRequest::cancel_request() { bool HTTPRequest::_handle_response(bool *ret_value) { if (!client->has_response()) { - call_deferred("_request_done", RESULT_NO_RESPONSE, 0, PoolStringArray(), PoolByteArray()); + call_deferred("_request_done", RESULT_NO_RESPONSE, 0, PackedStringArray(), PackedByteArray()); *ret_value = true; return true; } @@ -200,7 +200,7 @@ bool HTTPRequest::_handle_response(bool *ret_value) { if (max_redirects >= 0 && redirections >= max_redirects) { - call_deferred("_request_done", RESULT_REDIRECT_LIMIT_REACHED, response_code, response_headers, PoolByteArray()); + call_deferred("_request_done", RESULT_REDIRECT_LIMIT_REACHED, response_code, response_headers, PackedByteArray()); *ret_value = true; return true; } @@ -246,7 +246,7 @@ bool HTTPRequest::_update_connection() { switch (client->get_status()) { case HTTPClient::STATUS_DISCONNECTED: { - call_deferred("_request_done", RESULT_CANT_CONNECT, 0, PoolStringArray(), PoolByteArray()); + call_deferred("_request_done", RESULT_CANT_CONNECT, 0, PackedStringArray(), PackedByteArray()); return true; // End it, since it's doing something } break; case HTTPClient::STATUS_RESOLVING: { @@ -255,7 +255,7 @@ bool HTTPRequest::_update_connection() { return false; } break; case HTTPClient::STATUS_CANT_RESOLVE: { - call_deferred("_request_done", RESULT_CANT_RESOLVE, 0, PoolStringArray(), PoolByteArray()); + call_deferred("_request_done", RESULT_CANT_RESOLVE, 0, PackedStringArray(), PackedByteArray()); return true; } break; @@ -266,7 +266,7 @@ bool HTTPRequest::_update_connection() { } break; // Connecting to IP case HTTPClient::STATUS_CANT_CONNECT: { - call_deferred("_request_done", RESULT_CANT_CONNECT, 0, PoolStringArray(), PoolByteArray()); + call_deferred("_request_done", RESULT_CANT_CONNECT, 0, PackedStringArray(), PackedByteArray()); return true; } break; @@ -283,7 +283,7 @@ bool HTTPRequest::_update_connection() { if (_handle_response(&ret_value)) return ret_value; - call_deferred("_request_done", RESULT_SUCCESS, response_code, response_headers, PoolByteArray()); + call_deferred("_request_done", RESULT_SUCCESS, response_code, response_headers, PackedByteArray()); return true; } if (body_len < 0) { @@ -292,7 +292,7 @@ bool HTTPRequest::_update_connection() { return true; } - call_deferred("_request_done", RESULT_CHUNKED_BODY_SIZE_MISMATCH, response_code, response_headers, PoolByteArray()); + call_deferred("_request_done", RESULT_CHUNKED_BODY_SIZE_MISMATCH, response_code, response_headers, PackedByteArray()); return true; // Request migh have been done } else { @@ -300,7 +300,7 @@ bool HTTPRequest::_update_connection() { Error err = client->request(method, request_string, headers, request_data); if (err != OK) { - call_deferred("_request_done", RESULT_CONNECTION_ERROR, 0, PoolStringArray(), PoolByteArray()); + call_deferred("_request_done", RESULT_CONNECTION_ERROR, 0, PackedStringArray(), PackedByteArray()); return true; } @@ -325,7 +325,7 @@ bool HTTPRequest::_update_connection() { if (!client->is_response_chunked() && client->get_response_body_length() == 0) { - call_deferred("_request_done", RESULT_SUCCESS, response_code, response_headers, PoolByteArray()); + call_deferred("_request_done", RESULT_SUCCESS, response_code, response_headers, PackedByteArray()); return true; } @@ -334,7 +334,7 @@ bool HTTPRequest::_update_connection() { body_len = client->get_response_body_length(); if (body_size_limit >= 0 && body_len > body_size_limit) { - call_deferred("_request_done", RESULT_BODY_SIZE_LIMIT_EXCEEDED, response_code, response_headers, PoolByteArray()); + call_deferred("_request_done", RESULT_BODY_SIZE_LIMIT_EXCEEDED, response_code, response_headers, PackedByteArray()); return true; } @@ -342,7 +342,7 @@ bool HTTPRequest::_update_connection() { file = FileAccess::open(download_to_file, FileAccess::WRITE); if (!file) { - call_deferred("_request_done", RESULT_DOWNLOAD_FILE_CANT_OPEN, response_code, response_headers, PoolByteArray()); + call_deferred("_request_done", RESULT_DOWNLOAD_FILE_CANT_OPEN, response_code, response_headers, PackedByteArray()); return true; } } @@ -350,14 +350,14 @@ bool HTTPRequest::_update_connection() { client->poll(); - PoolByteArray chunk = client->read_response_body_chunk(); + PackedByteArray chunk = client->read_response_body_chunk(); downloaded += chunk.size(); if (file) { - PoolByteArray::Read r = chunk.read(); - file->store_buffer(r.ptr(), chunk.size()); + const uint8_t *r = chunk.ptr(); + file->store_buffer(r, chunk.size()); if (file->get_error() != OK) { - call_deferred("_request_done", RESULT_DOWNLOAD_FILE_WRITE_ERROR, response_code, response_headers, PoolByteArray()); + call_deferred("_request_done", RESULT_DOWNLOAD_FILE_WRITE_ERROR, response_code, response_headers, PackedByteArray()); return true; } } else { @@ -365,7 +365,7 @@ bool HTTPRequest::_update_connection() { } if (body_size_limit >= 0 && downloaded > body_size_limit) { - call_deferred("_request_done", RESULT_BODY_SIZE_LIMIT_EXCEEDED, response_code, response_headers, PoolByteArray()); + call_deferred("_request_done", RESULT_BODY_SIZE_LIMIT_EXCEEDED, response_code, response_headers, PackedByteArray()); return true; } @@ -384,11 +384,11 @@ bool HTTPRequest::_update_connection() { } break; // Request resulted in body: break which must be read case HTTPClient::STATUS_CONNECTION_ERROR: { - call_deferred("_request_done", RESULT_CONNECTION_ERROR, 0, PoolStringArray(), PoolByteArray()); + call_deferred("_request_done", RESULT_CONNECTION_ERROR, 0, PackedStringArray(), PackedByteArray()); return true; } break; case HTTPClient::STATUS_SSL_HANDSHAKE_ERROR: { - call_deferred("_request_done", RESULT_SSL_HANDSHAKE_ERROR, 0, PoolStringArray(), PoolByteArray()); + call_deferred("_request_done", RESULT_SSL_HANDSHAKE_ERROR, 0, PackedStringArray(), PackedByteArray()); return true; } break; } @@ -396,7 +396,7 @@ bool HTTPRequest::_update_connection() { ERR_FAIL_V(false); } -void HTTPRequest::_request_done(int p_status, int p_code, const PoolStringArray &headers, const PoolByteArray &p_data) { +void HTTPRequest::_request_done(int p_status, int p_code, const PackedStringArray &headers, const PackedByteArray &p_data) { cancel_request(); emit_signal("request_completed", p_status, p_code, headers, p_data); @@ -505,12 +505,12 @@ int HTTPRequest::get_timeout() { void HTTPRequest::_timeout() { cancel_request(); - call_deferred("_request_done", RESULT_TIMEOUT, 0, PoolStringArray(), PoolByteArray()); + call_deferred("_request_done", RESULT_TIMEOUT, 0, PackedStringArray(), PackedByteArray()); } void HTTPRequest::_bind_methods() { - ClassDB::bind_method(D_METHOD("request", "url", "custom_headers", "ssl_validate_domain", "method", "request_data"), &HTTPRequest::request, DEFVAL(PoolStringArray()), DEFVAL(true), DEFVAL(HTTPClient::METHOD_GET), DEFVAL(String())); + ClassDB::bind_method(D_METHOD("request", "url", "custom_headers", "ssl_validate_domain", "method", "request_data"), &HTTPRequest::request, DEFVAL(PackedStringArray()), DEFVAL(true), DEFVAL(HTTPClient::METHOD_GET), DEFVAL(String())); ClassDB::bind_method(D_METHOD("cancel_request"), &HTTPRequest::cancel_request); ClassDB::bind_method(D_METHOD("get_http_client_status"), &HTTPRequest::get_http_client_status); @@ -548,7 +548,7 @@ void HTTPRequest::_bind_methods() { ADD_PROPERTY(PropertyInfo(Variant::INT, "max_redirects", PROPERTY_HINT_RANGE, "-1,64"), "set_max_redirects", "get_max_redirects"); ADD_PROPERTY(PropertyInfo(Variant::INT, "timeout", PROPERTY_HINT_RANGE, "0,86400"), "set_timeout", "get_timeout"); - ADD_SIGNAL(MethodInfo("request_completed", PropertyInfo(Variant::INT, "result"), PropertyInfo(Variant::INT, "response_code"), PropertyInfo(Variant::POOL_STRING_ARRAY, "headers"), PropertyInfo(Variant::POOL_BYTE_ARRAY, "body"))); + ADD_SIGNAL(MethodInfo("request_completed", PropertyInfo(Variant::INT, "result"), PropertyInfo(Variant::INT, "response_code"), PropertyInfo(Variant::PACKED_STRING_ARRAY, "headers"), PropertyInfo(Variant::PACKED_BYTE_ARRAY, "body"))); BIND_ENUM_CONSTANT(RESULT_SUCCESS); //BIND_ENUM_CONSTANT( RESULT_NO_BODY ); diff --git a/scene/main/http_request.h b/scene/main/http_request.h index 94b323ae8a..a3d95cd652 100644 --- a/scene/main/http_request.h +++ b/scene/main/http_request.h @@ -73,12 +73,12 @@ private: bool request_sent; Ref<HTTPClient> client; - PoolByteArray body; + PackedByteArray body; volatile bool use_threads; bool got_response; int response_code; - PoolVector<String> response_headers; + Vector<String> response_headers; String download_to_file; @@ -108,7 +108,7 @@ private: Thread *thread; - void _request_done(int p_status, int p_code, const PoolStringArray &headers, const PoolByteArray &p_data); + void _request_done(int p_status, int p_code, const PackedStringArray &headers, const PackedByteArray &p_data); static void _thread_func(void *p_userdata); protected: diff --git a/scene/main/instance_placeholder.cpp b/scene/main/instance_placeholder.cpp index f1b3f91920..fe238af1c4 100644 --- a/scene/main/instance_placeholder.cpp +++ b/scene/main/instance_placeholder.cpp @@ -115,7 +115,7 @@ Node *InstancePlaceholder::create_instance(bool p_replace, const Ref<PackedScene Dictionary InstancePlaceholder::get_stored_values(bool p_with_order) { Dictionary ret; - PoolStringArray order; + PackedStringArray order; for (List<PropSet>::Element *E = stored_values.front(); E; E = E->next()) { ret[E->get().name] = E->get().value; diff --git a/scene/main/resource_preloader.cpp b/scene/main/resource_preloader.cpp index 5582ed59b0..43a61834eb 100644 --- a/scene/main/resource_preloader.cpp +++ b/scene/main/resource_preloader.cpp @@ -35,7 +35,7 @@ void ResourcePreloader::_set_resources(const Array &p_data) { resources.clear(); ERR_FAIL_COND(p_data.size() != 2); - PoolVector<String> names = p_data[0]; + Vector<String> names = p_data[0]; Array resdata = p_data[1]; ERR_FAIL_COND(names.size() != resdata.size()); @@ -53,7 +53,7 @@ void ResourcePreloader::_set_resources(const Array &p_data) { Array ResourcePreloader::_get_resources() const { - PoolVector<String> names; + Vector<String> names; Array arr; arr.resize(resources.size()); names.resize(resources.size()); @@ -129,9 +129,9 @@ RES ResourcePreloader::get_resource(const StringName &p_name) const { return resources[p_name]; } -PoolVector<String> ResourcePreloader::_get_resource_list() const { +Vector<String> ResourcePreloader::_get_resource_list() const { - PoolVector<String> res; + Vector<String> res; res.resize(resources.size()); int i = 0; for (Map<StringName, RES>::Element *E = resources.front(); E; E = E->next(), i++) { diff --git a/scene/main/resource_preloader.h b/scene/main/resource_preloader.h index d03c784883..9ad219dd92 100644 --- a/scene/main/resource_preloader.h +++ b/scene/main/resource_preloader.h @@ -41,7 +41,7 @@ class ResourcePreloader : public Node { void _set_resources(const Array &p_data); Array _get_resources() const; - PoolVector<String> _get_resource_list() const; + Vector<String> _get_resource_list() const; protected: static void _bind_methods(); diff --git a/scene/main/scene_tree.cpp b/scene/main/scene_tree.cpp index a27f8c4d94..818ae93d95 100644 --- a/scene/main/scene_tree.cpp +++ b/scene/main/scene_tree.cpp @@ -873,11 +873,11 @@ Ref<ArrayMesh> SceneTree::get_debug_contact_mesh() { }; /* clang-format on */ - PoolVector<int> indices; + Vector<int> indices; for (int i = 0; i < 8 * 3; i++) indices.push_back(diamond_faces[i]); - PoolVector<Vector3> vertices; + Vector<Vector3> vertices; for (int i = 0; i < 6; i++) vertices.push_back(diamond[i] * 0.1); @@ -1933,7 +1933,7 @@ void SceneTree::_bind_methods() { ADD_SIGNAL(MethodInfo("idle_frame")); ADD_SIGNAL(MethodInfo("physics_frame")); - ADD_SIGNAL(MethodInfo("files_dropped", PropertyInfo(Variant::POOL_STRING_ARRAY, "files"), PropertyInfo(Variant::INT, "screen"))); + ADD_SIGNAL(MethodInfo("files_dropped", PropertyInfo(Variant::PACKED_STRING_ARRAY, "files"), PropertyInfo(Variant::INT, "screen"))); ADD_SIGNAL(MethodInfo("global_menu_action", PropertyInfo(Variant::NIL, "id"), PropertyInfo(Variant::NIL, "meta"))); ADD_SIGNAL(MethodInfo("network_peer_connected", PropertyInfo(Variant::INT, "id"))); ADD_SIGNAL(MethodInfo("network_peer_disconnected", PropertyInfo(Variant::INT, "id"))); |