diff options
-rw-r--r-- | core/io/file_access_network.cpp | 2 | ||||
-rw-r--r-- | core/io/resource_format_binary.cpp | 2 | ||||
-rw-r--r-- | drivers/unix/os_unix.cpp | 2 | ||||
-rw-r--r-- | editor/animation_editor.cpp | 2 | ||||
-rw-r--r-- | editor/editor_resource_preview.cpp | 1 | ||||
-rw-r--r-- | editor/plugins/sprite_frames_editor_plugin.cpp | 2 | ||||
-rw-r--r-- | main/main.cpp | 16 | ||||
-rw-r--r-- | modules/mono/editor/mono_bottom_panel.cpp | 8 | ||||
-rw-r--r-- | platform/javascript/http_client.h.inc | 5 | ||||
-rw-r--r-- | platform/javascript/http_client_javascript.cpp | 47 | ||||
-rw-r--r-- | scene/2d/line_builder.cpp | 2 | ||||
-rw-r--r-- | scene/2d/physics_body_2d.cpp | 2 | ||||
-rw-r--r-- | scene/3d/physics_body.cpp | 2 | ||||
-rw-r--r-- | scene/gui/tree.cpp | 4 | ||||
-rw-r--r-- | scene/main/node.h | 2 | ||||
-rw-r--r-- | servers/audio/audio_filter_sw.cpp | 3 | ||||
-rw-r--r-- | servers/physics/shape_sw.cpp | 8 | ||||
-rw-r--r-- | servers/physics_2d/shape_2d_sw.cpp | 2 |
18 files changed, 64 insertions, 48 deletions
diff --git a/core/io/file_access_network.cpp b/core/io/file_access_network.cpp index ef886cdb3c..21e3a4172b 100644 --- a/core/io/file_access_network.cpp +++ b/core/io/file_access_network.cpp @@ -418,8 +418,6 @@ int FileAccessNetwork::get_buffer(uint8_t *p_dst, int p_length) const { if (page != last_page) { buffer_mutex->lock(); if (pages[page].buffer.empty()) { - //fuck - waiting_on_page = page; for (int j = 0; j < read_ahead; j++) { diff --git a/core/io/resource_format_binary.cpp b/core/io/resource_format_binary.cpp index 15c4835dc6..5dfe067902 100644 --- a/core/io/resource_format_binary.cpp +++ b/core/io/resource_format_binary.cpp @@ -1124,7 +1124,7 @@ Error ResourceFormatLoaderBinary::rename_dependencies(const String &p_path, cons DirAccess *da = DirAccess::create(DirAccess::ACCESS_FILESYSTEM); da->remove(p_path + ".depren"); memdelete(da); - //fuck it, use the old approach; + //use the old approach WARN_PRINT(("This file is old, so it can't refactor dependencies, opening and resaving: " + p_path).utf8().get_data()); diff --git a/drivers/unix/os_unix.cpp b/drivers/unix/os_unix.cpp index 5f45f06c79..aa01f22673 100644 --- a/drivers/unix/os_unix.cpp +++ b/drivers/unix/os_unix.cpp @@ -296,7 +296,7 @@ Error OS_Unix::execute(const String &p_path, const List<String> &p_arguments, bo Vector<char *> args; for (int i = 0; i < cs.size(); i++) - args.push_back((char *)cs[i].get_data()); // shitty C cast + args.push_back((char *)cs[i].get_data()); args.push_back(0); execvp(p_path.utf8().get_data(), &args[0]); diff --git a/editor/animation_editor.cpp b/editor/animation_editor.cpp index cd8233e460..c064f9cbdf 100644 --- a/editor/animation_editor.cpp +++ b/editor/animation_editor.cpp @@ -3362,7 +3362,7 @@ int AnimationKeyEditor::_confirm_insert(InsertData p_id, int p_last_track) { //wants a new tack { - //shitty hack + //hack NodePath np; animation->add_track(p_id.type); animation->track_set_path(animation->get_track_count() - 1, p_id.path); diff --git a/editor/editor_resource_preview.cpp b/editor/editor_resource_preview.cpp index 93787a7a4c..aa67ea03d7 100644 --- a/editor/editor_resource_preview.cpp +++ b/editor/editor_resource_preview.cpp @@ -253,7 +253,6 @@ void EditorResourcePreview::_thread() { img.instance(); if (img->load(cache_base + ".png") != OK) { - //well fuck cache_valid = false; } else { diff --git a/editor/plugins/sprite_frames_editor_plugin.cpp b/editor/plugins/sprite_frames_editor_plugin.cpp index 7a4eee0344..d8d0a6f013 100644 --- a/editor/plugins/sprite_frames_editor_plugin.cpp +++ b/editor/plugins/sprite_frames_editor_plugin.cpp @@ -398,8 +398,6 @@ void SpriteFramesEditor::_animation_add() { animations->grab_focus(); } void SpriteFramesEditor::_animation_remove() { - - //fuck everything if (updating) return; diff --git a/main/main.cpp b/main/main.cpp index e9eca4af39..f6b3bafc5a 100644 --- a/main/main.cpp +++ b/main/main.cpp @@ -514,12 +514,14 @@ Error Main::setup(const char *execpath, int argc, char *argv[], bool p_second_ph //video_mode.fullscreen=false; init_fullscreen = true; +#ifdef TOOLS_ENABLED } else if (I->get() == "-e" || I->get() == "--editor") { // starts editor editor = true; } else if (I->get() == "-p" || I->get() == "--project-manager") { // starts project manager project_manager = true; +#endif } else if (I->get() == "--no-window") { // disable window creation, Windows only OS::get_singleton()->set_no_window_mode(true); @@ -1226,24 +1228,27 @@ bool Main::start() { //parameters that do not have an argument to the right if (args[i] == "--no-docbase") { doc_base = false; +#ifdef TOOLS_ENABLED } else if (args[i] == "-e" || args[i] == "--editor") { editor = true; } else if (args[i] == "-p" || args[i] == "--project-manager") { project_manager = true; +#endif } else if (args[i].length() && args[i][0] != '-' && game_path == "") { game_path = args[i]; } //parameters that have an argument to the right else if (i < (args.size() - 1)) { bool parsed_pair = true; - if (args[i] == "--doctool") { - doc_tool = args[i + 1]; - for (int j = i + 2; j < args.size(); j++) - removal_docs.push_back(args[j]); - } else if (args[i] == "-s" || args[i] == "--script") { + if (args[i] == "-s" || args[i] == "--script") { script = args[i + 1]; } else if (args[i] == "--test") { test = args[i + 1]; +#ifdef TOOLS_ENABLED + } else if (args[i] == "--doctool") { + doc_tool = args[i + 1]; + for (int j = i + 2; j < args.size(); j++) + removal_docs.push_back(args[j]); } else if (args[i] == "--export") { editor = true; //needs editor if (i + 1 < args.size()) { @@ -1261,6 +1266,7 @@ bool Main::start() { return false; } export_debug = true; +#endif } else { // The parameter does not match anything known, don't skip the next argument parsed_pair = false; diff --git a/modules/mono/editor/mono_bottom_panel.cpp b/modules/mono/editor/mono_bottom_panel.cpp index ab62c62616..20378a0162 100644 --- a/modules/mono/editor/mono_bottom_panel.cpp +++ b/modules/mono/editor/mono_bottom_panel.cpp @@ -335,16 +335,14 @@ void MonoBuildTab::_update_issues_list() { Ref<Texture> MonoBuildTab::get_icon_texture() const { - // FIXME these icons were removed... find something better - if (build_exited) { if (build_result == RESULT_ERROR) { - return get_icon("DependencyChangedHl", "EditorIcons"); + return get_icon("StatusError", "EditorIcons"); } else { - return get_icon("DependencyOkHl", "EditorIcons"); + return get_icon("StatusSuccess", "EditorIcons"); } } else { - return get_icon("GraphTime", "EditorIcons"); + return get_icon("Stop", "EditorIcons"); } } diff --git a/platform/javascript/http_client.h.inc b/platform/javascript/http_client.h.inc index 23a74e68f5..d75d33a33a 100644 --- a/platform/javascript/http_client.h.inc +++ b/platform/javascript/http_client.h.inc @@ -46,3 +46,8 @@ String password; int polled_response_code; String polled_response_header; PoolByteArray polled_response; + +#ifdef DEBUG_ENABLED +bool has_polled; +uint64_t last_polling_frame; +#endif diff --git a/platform/javascript/http_client_javascript.cpp b/platform/javascript/http_client_javascript.cpp index 1cd2719723..118a77835e 100644 --- a/platform/javascript/http_client_javascript.cpp +++ b/platform/javascript/http_client_javascript.cpp @@ -81,6 +81,8 @@ Ref<StreamPeer> HTTPClient::get_connection() const { Error HTTPClient::prepare_request(Method p_method, const String &p_url, const Vector<String> &p_headers) { ERR_FAIL_INDEX_V(p_method, METHOD_MAX, ERR_INVALID_PARAMETER); + ERR_EXPLAIN("HTTP methods TRACE and CONNECT are not supported for the HTML5 platform"); + ERR_FAIL_COND_V(p_method == METHOD_TRACE || p_method == METHOD_CONNECT, ERR_UNAVAILABLE); ERR_FAIL_COND_V(status != STATUS_CONNECTED, ERR_INVALID_PARAMETER); ERR_FAIL_COND_V(host.empty(), ERR_UNCONFIGURED); ERR_FAIL_COND_V(port < 0, ERR_UNCONFIGURED); @@ -158,7 +160,7 @@ int HTTPClient::get_response_code() const { Error HTTPClient::get_response_headers(List<String> *r_response) { - if (!polled_response_header.size()) + if (polled_response_header.empty()) return ERR_INVALID_PARAMETER; Vector<String> header_lines = polled_response_header.split("\r\n", false); @@ -191,8 +193,6 @@ PoolByteArray HTTPClient::read_response_body_chunk() { if (response_read_offset == polled_response.size()) { status = STATUS_CONNECTED; polled_response.resize(0); - polled_response_code = 0; - polled_response_header = String(); godot_xhr_reset(xhr_id); } @@ -238,34 +238,47 @@ Error HTTPClient::poll() { return ERR_CONNECTION_ERROR; case STATUS_REQUESTING: - polled_response_code = godot_xhr_get_status(xhr_id); - int response_length = godot_xhr_get_response_length(xhr_id); - if (response_length == 0) { - godot_xhr_ready_state_t ready_state = godot_xhr_get_ready_state(xhr_id); - if (ready_state == XHR_READY_STATE_HEADERS_RECEIVED || ready_state == XHR_READY_STATE_LOADING) { - return OK; - } else { - status = STATUS_CONNECTION_ERROR; - return ERR_CONNECTION_ERROR; + +#ifdef DEBUG_ENABLED + if (!has_polled) { + has_polled = true; + } else { + // forcing synchronous requests is not possible on the web + if (last_polling_frame == Engine::get_singleton()->get_idle_frames()) { + WARN_PRINT("HTTPClient polled multiple times in one frame, " + "but request cannot progress more than once per " + "frame on the HTML5 platform."); } } + last_polling_frame = Engine::get_singleton()->get_idle_frames(); +#endif + + polled_response_code = godot_xhr_get_status(xhr_id); + if (godot_xhr_get_ready_state(xhr_id) != XHR_READY_STATE_DONE) { + return OK; + } else if (!polled_response_code) { + status = STATUS_CONNECTION_ERROR; + return ERR_CONNECTION_ERROR; + } status = STATUS_BODY; PoolByteArray bytes; int len = godot_xhr_get_response_headers_length(xhr_id); - bytes.resize(len); + bytes.resize(len + 1); + PoolByteArray::Write write = bytes.write(); godot_xhr_get_response_headers(xhr_id, reinterpret_cast<char *>(write.ptr()), len); + write[len] = 0; write = PoolByteArray::Write(); PoolByteArray::Read read = bytes.read(); polled_response_header = String::utf8(reinterpret_cast<const char *>(read.ptr())); read = PoolByteArray::Read(); - polled_response.resize(response_length); + polled_response.resize(godot_xhr_get_response_length(xhr_id)); write = polled_response.write(); - godot_xhr_get_response(xhr_id, write.ptr(), response_length); + godot_xhr_get_response(xhr_id, write.ptr(), polled_response.size()); write = PoolByteArray::Write(); break; } @@ -280,6 +293,10 @@ HTTPClient::HTTPClient() { port = -1; use_tls = false; polled_response_code = 0; +#ifdef DEBUG_ENABLED + has_polled = false; + last_polling_frame = 0; +#endif } HTTPClient::~HTTPClient() { diff --git a/scene/2d/line_builder.cpp b/scene/2d/line_builder.cpp index e78d2e9c34..b1a072729f 100644 --- a/scene/2d/line_builder.cpp +++ b/scene/2d/line_builder.cpp @@ -347,7 +347,7 @@ void LineBuilder::build() { } if (intersection_result != SEGMENT_INTERSECT) - // In this case the joint is too fucked up to be re-used, + // In this case the joint is too corrputed to be re-used, // start again the strip with fallback points strip_begin(pos_up0, pos_down0, color1, uvx1); } diff --git a/scene/2d/physics_body_2d.cpp b/scene/2d/physics_body_2d.cpp index cc99ce5f49..9908907ee9 100644 --- a/scene/2d/physics_body_2d.cpp +++ b/scene/2d/physics_body_2d.cpp @@ -372,9 +372,7 @@ bool RigidBody2D::_test_motion(const Vector2 &p_motion, float p_margin, const Re void RigidBody2D::_direct_state_changed(Object *p_state) { -//eh.. fuck #ifdef DEBUG_ENABLED - state = Object::cast_to<Physics2DDirectBodyState>(p_state); #else state = (Physics2DDirectBodyState *)p_state; //trust it diff --git a/scene/3d/physics_body.cpp b/scene/3d/physics_body.cpp index 25acd6deb0..5c814312dd 100644 --- a/scene/3d/physics_body.cpp +++ b/scene/3d/physics_body.cpp @@ -370,9 +370,7 @@ struct _RigidBodyInOut { void RigidBody::_direct_state_changed(Object *p_state) { -//eh.. fuck #ifdef DEBUG_ENABLED - state = Object::cast_to<PhysicsDirectBodyState>(p_state); #else state = (PhysicsDirectBodyState *)p_state; //trust it diff --git a/scene/gui/tree.cpp b/scene/gui/tree.cpp index e12044fca2..cdbdc9b0d7 100644 --- a/scene/gui/tree.cpp +++ b/scene/gui/tree.cpp @@ -2384,7 +2384,7 @@ void Tree::_gui_input(Ref<InputEvent> p_event) { if (mm.is_valid()) { - if (cache.font.is_null()) // avoid a strange case that may fuckup stuff + if (cache.font.is_null()) // avoid a strange case that may corrupt stuff update_cache(); Ref<StyleBox> bg = cache.bg; @@ -2483,7 +2483,7 @@ void Tree::_gui_input(Ref<InputEvent> p_event) { Ref<InputEventMouseButton> b = p_event; if (b.is_valid()) { - if (cache.font.is_null()) // avoid a strange case that may fuckup stuff + if (cache.font.is_null()) // avoid a strange case that may corrupt stuff update_cache(); if (!b->is_pressed()) { diff --git a/scene/main/node.h b/scene/main/node.h index dc6bda4621..4655071228 100644 --- a/scene/main/node.h +++ b/scene/main/node.h @@ -364,7 +364,7 @@ public: void queue_delete(); - //shitty hacks for speed + //hacks for speed static void set_human_readable_collision_renaming(bool p_enabled); static void init_node_hrcr(); diff --git a/servers/audio/audio_filter_sw.cpp b/servers/audio/audio_filter_sw.cpp index 70cb7beacb..551ca01109 100644 --- a/servers/audio/audio_filter_sw.cpp +++ b/servers/audio/audio_filter_sw.cpp @@ -58,8 +58,7 @@ void AudioFilterSW::prepare_coefficients(Coeffs *p_coeffs) { int sr_limit = (sampling_rate / 2) + 512; double final_cutoff = (cutoff > sr_limit) ? sr_limit : cutoff; - if (final_cutoff < 1) //avoid crapness - final_cutoff = 1; //don't allow less than this + if (final_cutoff < 1) final_cutoff = 1; //don't allow less than this double omega = 2.0 * Math_PI * final_cutoff / sampling_rate; diff --git a/servers/physics/shape_sw.cpp b/servers/physics/shape_sw.cpp index 5a58742958..b918a42ca5 100644 --- a/servers/physics/shape_sw.cpp +++ b/servers/physics/shape_sw.cpp @@ -672,7 +672,7 @@ Vector3 CapsuleShapeSW::get_closest_point_to(const Vector3 &p_point) const { Vector3 CapsuleShapeSW::get_moment_of_inertia(real_t p_mass) const { - // use crappy AABB approximation + // use bad AABB approximation Vector3 extents = get_aabb().size * 0.5; return Vector3( @@ -943,7 +943,7 @@ Vector3 ConvexPolygonShapeSW::get_closest_point_to(const Vector3 &p_point) const Vector3 ConvexPolygonShapeSW::get_moment_of_inertia(real_t p_mass) const { - // use crappy AABB approximation + // use bad AABB approximation Vector3 extents = get_aabb().size * 0.5; return Vector3( @@ -1331,7 +1331,7 @@ void ConcavePolygonShapeSW::cull(const AABB &p_local_aabb, Callback p_callback, Vector3 ConcavePolygonShapeSW::get_moment_of_inertia(real_t p_mass) const { - // use crappy AABB approximation + // use bad AABB approximation Vector3 extents = get_aabb().size * 0.5; return Vector3( @@ -1594,7 +1594,7 @@ void HeightMapShapeSW::cull(const AABB &p_local_aabb, Callback p_callback, void Vector3 HeightMapShapeSW::get_moment_of_inertia(real_t p_mass) const { - // use crappy AABB approximation + // use bad AABB approximation Vector3 extents = get_aabb().size * 0.5; return Vector3( diff --git a/servers/physics_2d/shape_2d_sw.cpp b/servers/physics_2d/shape_2d_sw.cpp index 4605516fe0..5893f19827 100644 --- a/servers/physics_2d/shape_2d_sw.cpp +++ b/servers/physics_2d/shape_2d_sw.cpp @@ -589,7 +589,7 @@ bool ConvexPolygonShape2DSW::intersect_segment(const Vector2 &p_begin, const Vec for (int i = 0; i < point_count; i++) { - //hmm crap.. no can do.. + //hmm.. no can do.. /* if (d.dot(points[i].normal)>=0) continue; |