diff options
Diffstat (limited to 'editor')
-rw-r--r-- | editor/debugger/script_editor_debugger.cpp | 2 | ||||
-rw-r--r-- | editor/fileserver/editor_file_server.cpp | 5 | ||||
-rw-r--r-- | editor/fileserver/editor_file_server.h | 2 | ||||
-rw-r--r-- | editor/node_3d_editor_gizmos.cpp | 31 | ||||
-rw-r--r-- | editor/plugins/node_3d_editor_plugin.h | 1 |
5 files changed, 23 insertions, 18 deletions
diff --git a/editor/debugger/script_editor_debugger.cpp b/editor/debugger/script_editor_debugger.cpp index be2b98bf1a..c92e94270e 100644 --- a/editor/debugger/script_editor_debugger.cpp +++ b/editor/debugger/script_editor_debugger.cpp @@ -343,7 +343,7 @@ void ScriptEditorDebugger::_parse_message(const String &p_msg, const Array &p_da DebuggerMarshalls::ResourceUsage usage; usage.deserialize(p_data); - int total = 0; + uint64_t total = 0; for (List<DebuggerMarshalls::ResourceInfo>::Element *E = usage.infos.front(); E; E = E->next()) { TreeItem *it = vmem_tree->create_item(root); diff --git a/editor/fileserver/editor_file_server.cpp b/editor/fileserver/editor_file_server.cpp index 07edae833d..d80003a12a 100644 --- a/editor/fileserver/editor_file_server.cpp +++ b/editor/fileserver/editor_file_server.cpp @@ -43,7 +43,7 @@ void EditorFileServer::_close_client(ClientData *cd) { cd->connection->disconnect_from_host(); { MutexLock lock(cd->efs->wait_mutex); - cd->efs->to_wait.insert(&cd->thread); + cd->efs->to_wait.insert(cd->thread); } while (cd->files.size()) { memdelete(cd->files.front()->get()); @@ -278,7 +278,8 @@ void EditorFileServer::_thread_start(void *s) { cd->connection = self->server->take_connection(); cd->efs = self; cd->quit = false; - cd->thread.start(_subthread_start, cd); + cd->thread = memnew(Thread); + cd->thread->start(_subthread_start, cd); } } diff --git a/editor/fileserver/editor_file_server.h b/editor/fileserver/editor_file_server.h index e4c8327d76..8ffd4f9692 100644 --- a/editor/fileserver/editor_file_server.h +++ b/editor/fileserver/editor_file_server.h @@ -47,7 +47,7 @@ class EditorFileServer : public Object { }; struct ClientData { - Thread thread; + Thread *thread; Ref<StreamPeerTCP> connection; Map<int, FileAccess *> files; EditorFileServer *efs = nullptr; diff --git a/editor/node_3d_editor_gizmos.cpp b/editor/node_3d_editor_gizmos.cpp index e6b99fa63f..16eefb1ad3 100644 --- a/editor/node_3d_editor_gizmos.cpp +++ b/editor/node_3d_editor_gizmos.cpp @@ -198,7 +198,11 @@ void EditorNode3DGizmo::add_mesh(const Ref<ArrayMesh> &p_mesh, bool p_billboard, } void EditorNode3DGizmo::add_lines(const Vector<Vector3> &p_lines, const Ref<Material> &p_material, bool p_billboard, const Color &p_modulate) { - if (p_lines.is_empty()) { + add_vertices(p_lines, p_material, Mesh::PRIMITIVE_LINES, p_billboard, p_modulate); +} + +void EditorNode3DGizmo::add_vertices(const Vector<Vector3> &p_vertices, const Ref<Material> &p_material, Mesh::PrimitiveType p_primitive_type, bool p_billboard, const Color &p_modulate) { + if (p_vertices.is_empty()) { return; } @@ -209,13 +213,13 @@ void EditorNode3DGizmo::add_lines(const Vector<Vector3> &p_lines, const Ref<Mate Array a; a.resize(Mesh::ARRAY_MAX); - a[Mesh::ARRAY_VERTEX] = p_lines; + a[Mesh::ARRAY_VERTEX] = p_vertices; Vector<Color> color; - color.resize(p_lines.size()); + color.resize(p_vertices.size()); { Color *w = color.ptrw(); - for (int i = 0; i < p_lines.size(); i++) { + for (int i = 0; i < p_vertices.size(); i++) { if (is_selected()) { w[i] = Color(1, 1, 1, 0.8) * p_modulate; } else { @@ -226,13 +230,13 @@ void EditorNode3DGizmo::add_lines(const Vector<Vector3> &p_lines, const Ref<Mate a[Mesh::ARRAY_COLOR] = color; - mesh->add_surface_from_arrays(Mesh::PRIMITIVE_LINES, a); + mesh->add_surface_from_arrays(p_primitive_type, a); mesh->surface_set_material(0, p_material); if (p_billboard) { float md = 0; - for (int i = 0; i < p_lines.size(); i++) { - md = MAX(0, p_lines[i].length()); + for (int i = 0; i < p_vertices.size(); i++) { + md = MAX(0, p_vertices[i].length()); } if (md) { mesh->set_custom_aabb(AABB(Vector3(-md, -md, -md), Vector3(md, md, md) * 2.0)); @@ -1906,16 +1910,15 @@ void RayCast3DGizmoPlugin::redraw(EditorNode3DGizmo *p_gizmo) { p_gizmo->clear(); - Vector<Vector3> lines; + const Ref<StandardMaterial3D> material = raycast->is_enabled() ? raycast->get_debug_material() : get_material("shape_material_disabled"); - lines.push_back(Vector3()); - lines.push_back(raycast->get_target_position()); + p_gizmo->add_lines(raycast->get_debug_line_vertices(), material); - const Ref<StandardMaterial3D> material = - get_material(raycast->is_enabled() ? "shape_material" : "shape_material_disabled", p_gizmo); + if (raycast->get_debug_shape_thickness() > 1) { + p_gizmo->add_vertices(raycast->get_debug_shape_vertices(), material, Mesh::PRIMITIVE_TRIANGLE_STRIP); + } - p_gizmo->add_lines(lines, material); - p_gizmo->add_collision_segments(lines); + p_gizmo->add_collision_segments(raycast->get_debug_line_vertices()); } ///// diff --git a/editor/plugins/node_3d_editor_plugin.h b/editor/plugins/node_3d_editor_plugin.h index cf4aa33257..ff4a941b06 100644 --- a/editor/plugins/node_3d_editor_plugin.h +++ b/editor/plugins/node_3d_editor_plugin.h @@ -99,6 +99,7 @@ protected: public: void add_lines(const Vector<Vector3> &p_lines, const Ref<Material> &p_material, bool p_billboard = false, const Color &p_modulate = Color(1, 1, 1)); + void add_vertices(const Vector<Vector3> &p_vertices, const Ref<Material> &p_material, Mesh::PrimitiveType p_primitive_type, bool p_billboard = false, const Color &p_modulate = Color(1, 1, 1)); void add_mesh(const Ref<ArrayMesh> &p_mesh, bool p_billboard = false, const Ref<SkinReference> &p_skin_reference = Ref<SkinReference>(), const Ref<Material> &p_material = Ref<Material>()); void add_collision_segments(const Vector<Vector3> &p_lines); void add_collision_triangles(const Ref<TriangleMesh> &p_tmesh); |