diff options
-rw-r--r-- | .mailmap | 60 | ||||
-rw-r--r-- | AUTHORS.md | 11 | ||||
-rw-r--r-- | DONORS.md | 36 | ||||
-rw-r--r-- | core/io/resource_importer.cpp | 5 | ||||
-rw-r--r-- | core/io/resource_importer.h | 1 | ||||
-rw-r--r-- | core/math/geometry.cpp | 35 | ||||
-rw-r--r-- | core/math/geometry.h | 2 | ||||
-rw-r--r-- | core/object.cpp | 25 | ||||
-rw-r--r-- | editor/editor_file_dialog.cpp | 19 | ||||
-rw-r--r-- | editor/filesystem_dock.cpp | 35 | ||||
-rw-r--r-- | editor/filesystem_dock.h | 2 | ||||
-rw-r--r-- | editor/plugins/spatial_editor_plugin.cpp | 6 | ||||
-rw-r--r-- | main/input_default.cpp | 2 | ||||
-rw-r--r-- | misc/dist/ios_xcode/godot_ios/godot_ios-Info.plist | 2 | ||||
-rw-r--r-- | platform/iphone/export/export.cpp | 4 | ||||
-rw-r--r-- | scene/2d/collision_polygon_2d.cpp | 35 | ||||
-rw-r--r-- | scene/2d/tile_map.cpp | 26 | ||||
-rw-r--r-- | scene/gui/file_dialog.cpp | 3 | ||||
-rw-r--r-- | scene/resources/tile_set.cpp | 30 | ||||
-rw-r--r-- | scene/resources/tile_set.h | 2 |
20 files changed, 213 insertions, 128 deletions
@@ -1,29 +1,69 @@ +Alexander Holland <alexander.holland@live.de> +Alexander Holland <alexander.holland@live.de> <alexander.holland@haw-hamburg.de> +Alexander Holland <alexander.holland@live.de> <AlexHolly> Andrea Catania <info@andreacatania.com> Andreas Haas <liu.gam3@gmail.com> -Andreas Haas <Hinsbart@users.noreply.github.com> -Andreas Haas <entenflugstuhl@gmail.com> +Andreas Haas <liu.gam3@gmail.com> <hinsbart@gmail.com> +Andreas Haas <liu.gam3@gmail.com> <hinsbart@users.noreply.github.com> +Andreas Haas <liu.gam3@gmail.com> <entenflugstuhl@gmail.com> Ariel Manzur <ariel@godotengine.org> -Ariel Manzur <ariel@okamstudio.com> +Ariel Manzur <ariel@godotengine.org> <punto@godotengine.org> +Ariel Manzur <ariel@godotengine.org> <ariel@okamstudio.com> +Ariel Manzur <ariel@godotengine.org> <punto@Ariels-Mac-mini.local> +Ariel Manzur <ariel@godotengine.org> <punto@Ariels-Mac-mini-2.local> Bastiaan Olij <mux213@gmail.com> -Bernhard Liebl <poke1024@gmx.de> -Bernhard Liebl <poke1024@gmx.org> +Bernhard Liebl <Bernhard.Liebl@gmx.org> <poke1024@gmx.de> +Bernhard Liebl <Bernhard.Liebl@gmx.org> <poke1024@gmx.org> +Chris Bradfield <chris@kidscancode.org> <cb@scribe.net> +Clay John <claynjohn@gmail.com> +Clay John <claynjohn@gmail.com> <clayjohn@shaw.ca> +Dana Olson <dana@shineuponthee.com> <adolson@gmail.com> +Daniel J. Ramirez <djrmuv@gmail.com> +Ferenc Arn <tagcup@yahoo.com> +Ferenc Arn <tagcup@yahoo.com> <tagcup@users.noreply.github.com> Geequlim <geequlim@gmail.com> -Hugo Locurcio <hugo.locurcio@hugo.pro> +Gilles Roudiere <gilles.roudiere@gmail.com> +Gilles Roudiere <gilles.roudiere@gmail.com> <gilles.roudiere@laas.fr> +Guilherme Felipe <guilhermefelipecgs@gmail.com> Hugo Locurcio <hugo.locurcio@hugo.pro> <hugo.l@openmailbox.org> Hugo Locurcio <hugo.locurcio@hugo.pro> <Calinou@users.noreply.github.com> +Hugo Locurcio <hugo.locurcio@hugo.pro> Calinou <calinou@opmbx.org> +Ian Bishop <ianb96@gmail.com> Ignacio Etcheverry <ignalfonsore@gmail.com> +Ignacio Etcheverry <ignalfonsore@gmail.com> <neikeq@users.noreply.github.com> Indah Sylvia <ISylvox@yahoo.com> +J08nY <johny@neuromancer.sk> <jancar.jj@gmail.com> +J08nY <johny@neuromancer.sk> <J08nY@users.noreply.github.com> Jakub Grzesik <kubecz3k@gmail.com> +Jérôme Gully <jerome.gully0@gmail.com> Juan Linietsky <reduzio@gmail.com> -Juan Linietsky <juan@okamstudio.com> -Juan Linietsky <reduz@Juans-MBP.fibertel.com.ar> +Juan Linietsky <reduzio@gmail.com> <juan@godotengine.org> +Juan Linietsky <reduzio@gmail.com> <juan@okamstudio.com> +Juan Linietsky <reduzio@gmail.com> <reduz@Juans-MBP.fibertel.com.ar> +Juan Linietsky <reduzio@gmail.com> <red@kyoko> Julian Murgia <the.straton@gmail.com> -Leon Krause <eska@eska.me> -Leon Krause <eska@eska.me> <eska014@users.noreply.github.com> +Kelly Thomas <kelly.thomas@hotmail.com.au> +Leon Krause <lk@leonkrause.com> <eska@eska.me> +Leon Krause <lk@leonkrause.com> <eska014@users.noreply.github.com> Marcelo Fernandez <marcelofg55@gmail.com> +Marcin Zawiejski <dragmz@gmail.com> Mariano Javier Suligoy <marianognu.easyrpg@gmail.com> +Mario Schlack <m4r10.5ch14ck@gmail.com> +Max Hilbrunner <m.hilbrunner@gmail.com> +Max Hilbrunner <m.hilbrunner@gmail.com> <mhilbrunner@users.noreply.github.com> +Nathan Warden <nathan@nathanwarden.com> <nathanwardenlee@icloud.com> +Nuno Donato <nunodonato@gmail.com> <n.donato@estrelasustentavel.pt> +Pedro J. Estébanez <pedrojrulez@gmail.com> <RandomShaper@users.noreply.github.com> Paul Batty <p_batty@hotmail.co.uk> +Paul Batty <p_batty@hotmail.co.uk> <Paulb23@users.noreply.github.com> +Pieter-Jan Briers <pieterjan.briers+git@gmail.com> +Pieter-Jan Briers <pieterjan.briers+git@gmail.com> <pieterjan.briers@gmail.com> Poommetee Ketson <poommetee@protonmail.com> +Rémi Verschelde <rverschelde@gmail.com> <remi@verschelde.fr> +Ruslan Mustakov <r.mustakov@gmail.com> <ruslan.mustakov@xored.com> Saracen <SaracenOne@gmail.com> +Theo Hallenius <redsymbzone@hotmail.com> Thomas Herzog <therzog@mail.de> +Thomas Herzog <therzog@mail.de> <thomas.herzog@mail.com> +Thomas Herzog <therzog@mail.de> <thomas.herzog@simedis.com> Zher Huei Lee <lee.zh.92@gmail.com> diff --git a/AUTHORS.md b/AUTHORS.md index 7859a3cd37..b7eca2d9b1 100644 --- a/AUTHORS.md +++ b/AUTHORS.md @@ -25,16 +25,16 @@ name is available. ## Developers -(in alphabetical order, with 10 commits or more excluding merges) +(in alphabetical order, with over 10 commits excluding merges) Aaron Franke (aaronfranke) Alexander Holland (AlexHolly) - Alexey Velikiy (jonyrock) Alket Rexhepi (alketii) Andrea Catania (AndreaCatania) Andreas Haas (Hinsbart) Andrii Doroshenko (Xrayez) Andy Moss (MillionOstrich) + Anish Bhobe (KidRigger) Anton Yabchinskiy (a12n) Aren Villanueva (kurikaesu) Ariel Manzur (punto-) @@ -46,6 +46,7 @@ name is available. Bojidar Marinov (bojidar-bg) bruvzg Carl Olsson (not-surt) + Carter Anderson (cart) Chris Bradfield (cbscribe) Clay John (clayjohn) Dana Olson (adolson) @@ -61,13 +62,13 @@ name is available. Ferenc Arn (tagcup) Franklin Sobrinho (TheHX) Geequlim - Gen (dbsGen) George Marques (vnen) Gerrit Großkopf (Grosskopf) Gilles Roudiere (groud) Guilherme Felipe de C. G. da Silva (guilhermefelipecgs) Hein-Pieter van Braam (hpvb) Hiroshi Ogawa (hi-ogawa) + homer666 Hubert Jarosz (Marqin) Hugo Locurcio (Calinou) Ian Bishop (ianb96) @@ -76,7 +77,7 @@ name is available. Indah Sylvia (ISylvox) J08nY Jakub Grzesik (kubecz3k) - Jérôme GULLY (Nutriz) + Jérôme Gully (Nutriz) Joan Fons Sanchez (JFonS) Johan Manuel (29jm) Joshua Grams (JoshuaGrams) @@ -94,6 +95,7 @@ name is available. Mariano Javier Suligoy (MarianoGnu) Mario Schlack (hurikhan) Martin Capitanio (capnm) + Martin Liška (marxin) Martin Sjursen (binbitten) marynate Masoud BH (masoudbh3) @@ -124,6 +126,7 @@ name is available. Saniko (sanikoyes) SaracenOne sersoong + Simon Wenner (swenner) Theo Hallenius (TheoXD) Thomas Herzog (karroffel) Timo (toger5) @@ -18,10 +18,12 @@ generous deed immortalized in the next stable release of Godot Engine. Gamblify <https://www.gamblify.com> Image Campus <https://www.imagecampus.edu.ar> + Yakaz.com <https://yakaz.com> ## Mini sponsors Alan Beauchamp + Anandarup Mallik Andrew Dunai Arda Erol Brandon Lamb @@ -36,7 +38,6 @@ generous deed immortalized in the next stable release of Godot Engine. Jay Sistar Justin Arnold Kyle Szklenski - Leona Eden Leonard Meagher Ludosity AB Matthieu Huvé @@ -45,7 +46,6 @@ generous deed immortalized in the next stable release of Godot Engine. Nathan Warden Neal Gompa (Conan Kudo) Patrick Aarstad - Pers "Rainway " Ruslan Mustakov Slobodan Milnovic @@ -54,6 +54,7 @@ generous deed immortalized in the next stable release of Godot Engine. Stoney Meyerhoeffer thechris VilliHaukka + Zashi ## Gold donors @@ -61,17 +62,15 @@ generous deed immortalized in the next stable release of Godot Engine. Brandon Waite cheese65536 David Gehrig - Edward E Florian Krick + Jakub Grzesik K9Kraken Manuele Finocchiaro Nathanael Beisiegel Officine Pixel S.n.c. Retro Village - Zashi Zaven Muradyan - 13MHz Allen Schade Andreas Schüle Asher Glick @@ -79,6 +78,7 @@ generous deed immortalized in the next stable release of Godot Engine. Daniel James Daniel Lynn David Giardi + Edward E Florian Breisch Gary Oberbrunner Gero @@ -113,10 +113,9 @@ generous deed immortalized in the next stable release of Godot Engine. Dean Harmon Ivan Trombley Joan Fons - John Krzysztof Jankowski + Lord Bloodhound Lucas Ferreira Franca - Markus Wiesner Nathan Lundquist Pascal Grüter Petr Malac @@ -128,10 +127,10 @@ generous deed immortalized in the next stable release of Godot Engine. Thomas Bjarnelöf Wojciech Chojnacki Xavier PATRICELLI - Zaq Poi Alessandra Pereyra Alexey Dyadchenko + Andrew Bowen Benjamin W Flint Chau Siu Hung Chris Goddard @@ -159,10 +158,12 @@ generous deed immortalized in the next stable release of Godot Engine. Jose Malheiro Juan T Chen Juraj Móza + Kasper Jeppesen Klavdij Voncina Leandro Voltolino Lukáš Rendvanský Marius Kamm + Markus Wiesner Martin Eigel Marvin Matt Eunson @@ -170,6 +171,8 @@ generous deed immortalized in the next stable release of Godot Engine. Nick Nikitin Oliver Dick oziatek + Paul Hocker + Paul Von Zimmerman Pete Goodwin Ranoller ray-tracer @@ -199,16 +202,17 @@ generous deed immortalized in the next stable release of Godot Engine. Anthony Bongiovanni Arbor Interactive Arthur S. Muszynski - Artur Barichello Aubrey Falconer Avencherus Bailey + Balázs Batári Bastian Böhm Benedikt Ben Vercammen Bernd Jänichen Blair Allen Brandon + Brandon Schaffer Bryan Stevenson Carl Winder Carwyn Edwards @@ -226,7 +230,7 @@ generous deed immortalized in the next stable release of Godot Engine. David Cravens David May Dominik Wetzel - DOXA + Duobix Edward Herbert Egon Elbre Elmeri '- Duy Kevin Nguyen @@ -238,13 +242,13 @@ generous deed immortalized in the next stable release of Godot Engine. fengjiongmax Foomf G3Dev sàrl - George Lesica Gerrit Großkopf Grant Clarke Greg Olson Guldoman Haley Aycock Heribert Hirth + Hiroshi Naruo Hunter Jones ialex32x Igor Buzatovic @@ -254,13 +258,11 @@ generous deed immortalized in the next stable release of Godot Engine. Jeff Hungerford Jeremy Kahn Jesse Dubay - Joao Senerchia Joel Fivat Johannes Wuensch Jonas Rudlang Jonas Yamazaki Jonathan G - Jonathan Martin Jonathan Nieto Jonathon Jon Bonazza @@ -270,6 +272,7 @@ generous deed immortalized in the next stable release of Godot Engine. Juan Negrier Judd Julian Murgia + Kajornthep Piyanun KC Chan Kevin Boyer Kiyohiro Kawamura (kyorohiro) @@ -278,6 +281,7 @@ generous deed immortalized in the next stable release of Godot Engine. KsyTek Games Kuan Cheang kycho + Levi Lindsey Linus Lind Lundgren Luis Moraes Macil @@ -288,21 +292,26 @@ generous deed immortalized in the next stable release of Godot Engine. Matthias Grandis Matt Welke Maxwell + medecau Mertcan Mermerkaya + mhilbrunner Michael Dürwald Michael Gringauz Michael Labbe Mikael Olsson + Mikayla Hutchinson MoM Moritz Laass Moritz Weissenberger Natrim nee Neil Blakey-Milner + Nerdforge Nick Pavlica Niclas Eriksen Nicolás Montaña Nicolas SAN AGUSTIN + Oscar Norlander Pan Ip Patrick Nafarrete Paul Gieske @@ -331,7 +340,6 @@ generous deed immortalized in the next stable release of Godot Engine. Simon Wenner Sootstone Theo Cranmore - Théo Hay Thibault Barbaroux Thomas Bell Thomas Holmes diff --git a/core/io/resource_importer.cpp b/core/io/resource_importer.cpp index 69907a710a..b5fa412576 100644 --- a/core/io/resource_importer.cpp +++ b/core/io/resource_importer.cpp @@ -183,6 +183,11 @@ void ResourceFormatImporter::get_recognized_extensions_for_type(const String &p_ } } +bool ResourceFormatImporter::exists(const String &p_path) const { + + return FileAccess::exists(p_path + ".import"); +} + bool ResourceFormatImporter::recognize_path(const String &p_path, const String &p_for_type) const { return FileAccess::exists(p_path + ".import"); diff --git a/core/io/resource_importer.h b/core/io/resource_importer.h index ca40b47b85..1c146c33d7 100644 --- a/core/io/resource_importer.h +++ b/core/io/resource_importer.h @@ -69,6 +69,7 @@ public: virtual bool is_import_valid(const String &p_path) const; virtual void get_dependencies(const String &p_path, List<String> *p_dependencies, bool p_add_types = false); virtual bool is_imported(const String &p_path) const { return recognize_path(p_path); } + virtual bool exists(const String &p_path) const; virtual bool can_be_imported(const String &p_path) const; virtual int get_import_order(const String &p_path) const; diff --git a/core/math/geometry.cpp b/core/math/geometry.cpp index 12c88f43b3..194a6f6352 100644 --- a/core/math/geometry.cpp +++ b/core/math/geometry.cpp @@ -31,6 +31,7 @@ #include "geometry.h" #include "core/print_string.h" +#include "thirdparty/misc/triangulator.h" /* this implementation is very inefficient, commenting unless bugs happen. See the other one. bool Geometry::is_point_in_polygon(const Vector2 &p_point, const Vector<Vector2> &p_polygon) { @@ -737,6 +738,40 @@ PoolVector<Face3> Geometry::wrap_geometry(PoolVector<Face3> p_array, real_t *p_e return wrapped_faces; } +Vector<Vector<Vector2> > Geometry::decompose_polygon_in_convex(Vector<Point2> polygon) { + Vector<Vector<Vector2> > decomp; + List<TriangulatorPoly> in_poly, out_poly; + + TriangulatorPoly inp; + inp.Init(polygon.size()); + for (int i = 0; i < polygon.size(); i++) { + inp.GetPoint(i) = polygon[i]; + } + inp.SetOrientation(TRIANGULATOR_CCW); + in_poly.push_back(inp); + TriangulatorPartition tpart; + if (tpart.ConvexPartition_HM(&in_poly, &out_poly) == 0) { //failed! + ERR_PRINT("Convex decomposing failed!"); + return decomp; + } + + decomp.resize(out_poly.size()); + int idx = 0; + for (List<TriangulatorPoly>::Element *I = out_poly.front(); I; I = I->next()) { + TriangulatorPoly &tp = I->get(); + + decomp.write[idx].resize(tp.GetNumPoints()); + + for (int i = 0; i < tp.GetNumPoints(); i++) { + decomp.write[idx].write[i] = tp.GetPoint(i); + } + + idx++; + } + + return decomp; +} + Geometry::MeshData Geometry::build_convex_mesh(const PoolVector<Plane> &p_planes) { MeshData mesh; diff --git a/core/math/geometry.h b/core/math/geometry.h index f927a63ed5..4b478b6b16 100644 --- a/core/math/geometry.h +++ b/core/math/geometry.h @@ -950,6 +950,8 @@ public: return H; } + static Vector<Vector<Vector2> > decompose_polygon_in_convex(Vector<Point2> polygon); + static MeshData build_convex_mesh(const PoolVector<Plane> &p_planes); static PoolVector<Plane> build_sphere_planes(real_t p_radius, int p_lats, int p_lons, Vector3::Axis p_axis = Vector3::AXIS_Z); static PoolVector<Plane> build_box_planes(const Vector3 &p_extents); diff --git a/core/object.cpp b/core/object.cpp index c46ecc5193..8b693f039c 100644 --- a/core/object.cpp +++ b/core/object.cpp @@ -832,23 +832,22 @@ void Object::setvar(const Variant &p_key, const Variant &p_value, bool *r_valid) } Variant Object::callv(const StringName &p_method, const Array &p_args) { + const Variant **argptrs = NULL; - if (p_args.size() == 0) { - return call(p_method); - } - - Vector<Variant> args; - args.resize(p_args.size()); - Vector<const Variant *> argptrs; - argptrs.resize(p_args.size()); - - for (int i = 0; i < p_args.size(); i++) { - args.write[i] = p_args[i]; - argptrs.write[i] = &args[i]; + if (p_args.size() > 0) { + argptrs = (const Variant **)alloca(sizeof(Variant *) * p_args.size()); + for (int i = 0; i < p_args.size(); i++) { + argptrs[i] = &p_args[i]; + } } Variant::CallError ce; - return call(p_method, (const Variant **)argptrs.ptr(), p_args.size(), ce); + Variant ret = call(p_method, argptrs, p_args.size(), ce); + if (ce.error != Variant::CallError::CALL_OK) { + ERR_EXPLAIN("Error calling method from 'callv': " + Variant::get_call_error_text(this, p_method, argptrs, p_args.size(), ce)); + ERR_FAIL_V(Variant()); + } + return ret; } Variant Object::call(const StringName &p_name, VARIANT_ARG_DECLARE) { diff --git a/editor/editor_file_dialog.cpp b/editor/editor_file_dialog.cpp index cdc06503e9..da16c16966 100644 --- a/editor/editor_file_dialog.cpp +++ b/editor/editor_file_dialog.cpp @@ -1205,8 +1205,10 @@ void EditorFileDialog::_update_favorites() { if (name == current) setthis = true; name = "/"; + + favorites->add_item(name, folder_icon); } else if (name.ends_with("/")) { - if (name == current) + if (name == current || name == current + "/") setthis = true; name = name.substr(0, name.length() - 1); name = name.get_file(); @@ -1229,6 +1231,8 @@ void EditorFileDialog::_favorite_toggled(bool p_toggle) { bool res = access == ACCESS_RESOURCES; String cd = get_current_dir(); + if (!cd.ends_with("/")) + cd += "/"; Vector<String> favorited = EditorSettings::get_singleton()->get_favorites(); @@ -1244,13 +1248,10 @@ void EditorFileDialog::_favorite_toggled(bool p_toggle) { } } - if (found) { + if (found) favorited.erase(cd); - favorite->set_pressed(false); - } else { + else favorited.push_back(cd); - favorite->set_pressed(true); - } EditorSettings::get_singleton()->set_favorites(favorited); @@ -1494,7 +1495,9 @@ EditorFileDialog::EditorFileDialog() { HBoxContainer *pathhb = memnew(HBoxContainer); dir_prev = memnew(ToolButton); + dir_prev->set_tooltip(TTR("Previous Folder")); dir_next = memnew(ToolButton); + dir_next->set_tooltip(TTR("Next Folder")); dir_up = memnew(ToolButton); dir_up->set_tooltip(TTR("Go to parent folder")); @@ -1513,12 +1516,14 @@ EditorFileDialog::EditorFileDialog() { dir->set_h_size_flags(SIZE_EXPAND_FILL); refresh = memnew(ToolButton); + refresh->set_tooltip(TTR("Refresh")); refresh->connect("pressed", this, "_update_file_list"); pathhb->add_child(refresh); favorite = memnew(ToolButton); favorite->set_flat(true); favorite->set_toggle_mode(true); + favorite->set_tooltip(TTR("(Un)favorite current folder.")); favorite->connect("toggled", this, "_favorite_toggled"); pathhb->add_child(favorite); @@ -1532,6 +1537,7 @@ EditorFileDialog::EditorFileDialog() { mode_thumbnails->set_toggle_mode(true); mode_thumbnails->set_pressed(display_mode == DISPLAY_THUMBNAILS); mode_thumbnails->set_button_group(view_mode_group); + mode_thumbnails->set_tooltip(TTR("View items as a grid of thumbnails.")); pathhb->add_child(mode_thumbnails); mode_list = memnew(ToolButton); @@ -1539,6 +1545,7 @@ EditorFileDialog::EditorFileDialog() { mode_list->set_toggle_mode(true); mode_list->set_pressed(display_mode == DISPLAY_LIST); mode_list->set_button_group(view_mode_group); + mode_list->set_tooltip(TTR("View items as a list.")); pathhb->add_child(mode_list); drives = memnew(OptionButton); diff --git a/editor/filesystem_dock.cpp b/editor/filesystem_dock.cpp index 66deb42c11..0eabd6e731 100644 --- a/editor/filesystem_dock.cpp +++ b/editor/filesystem_dock.cpp @@ -283,7 +283,7 @@ void FileSystemDock::_notification(int p_what) { String ei = "EditorIcons"; button_reload->set_icon(get_icon("Reload", ei)); button_toggle_display_mode->set_icon(get_icon("Panels2", ei)); - button_file_list_display_mode->connect("toggled", this, "_toggle_file_display"); + button_file_list_display_mode->connect("pressed", this, "_toggle_file_display"); files->connect("item_activated", this, "_file_list_activate_file"); button_hist_next->connect("pressed", this, "_fw_history"); @@ -350,7 +350,7 @@ void FileSystemDock::_notification(int p_what) { button_toggle_display_mode->set_icon(get_icon("Panels2", ei)); button_hist_next->set_icon(get_icon("Forward", ei)); button_hist_prev->set_icon(get_icon("Back", ei)); - if (button_file_list_display_mode->is_pressed()) { + if (file_list_display_mode == FILE_LIST_DISPLAY_THUMBNAILS) { button_file_list_display_mode->set_icon(get_icon("FileThumbnail", "EditorIcons")); } else { button_file_list_display_mode->set_icon(get_icon("FileList", "EditorIcons")); @@ -501,8 +501,8 @@ void FileSystemDock::_tree_thumbnail_done(const String &p_path, const Ref<Textur } } -void FileSystemDock::_toggle_file_display(bool p_active) { - _set_file_display(p_active); +void FileSystemDock::_toggle_file_display() { + _set_file_display(file_list_display_mode != FILE_LIST_DISPLAY_LIST); emit_signal("display_mode_changed"); } @@ -1692,8 +1692,7 @@ void FileSystemDock::set_file_list_display_mode(FileListDisplayMode p_mode) { if (p_mode == file_list_display_mode) return; - button_file_list_display_mode->set_pressed(p_mode == FILE_LIST_DISPLAY_LIST); - _toggle_file_display(p_mode == FILE_LIST_DISPLAY_LIST); + _toggle_file_display(); } Variant FileSystemDock::get_drag_data_fw(const Point2 &p_point, Control *p_from) { @@ -2377,29 +2376,6 @@ FileSystemDock::FileSystemDock(EditorNode *p_editor) { tree_search_box->connect("text_changed", this, "_search_changed", varray(tree_search_box)); toolbar2_hbc->add_child(tree_search_box); - //toolbar_hbc->add_spacer(); - - //Control *spacer = memnew( Control); - - /* - button_open = memnew( Button ); - button_open->set_flat(true); - button_open->connect("pressed",this,"_tree_toggle_collapsed"); - toolbar_hbc->add_child(button_open); - button_open->hide(); - button_open->set_focus_mode(FOCUS_NONE); - button_open->set_tooltip("Open the selected file.\nOpen as scene if a scene, or as resource otherwise."); - - - button_instance = memnew( Button ); - button_instance->set_flat(true); - button_instance->connect("pressed",this,"_instance_pressed"); - toolbar_hbc->add_child(button_instance); - button_instance->hide(); - button_instance->set_focus_mode(FOCUS_NONE); - button_instance->set_tooltip(TTR("Instance the selected scene(s) as child of the selected node.")); - -*/ file_list_popup = memnew(PopupMenu); file_list_popup->set_hide_on_window_lose_focus(true); add_child(file_list_popup); @@ -2441,7 +2417,6 @@ FileSystemDock::FileSystemDock(EditorNode *p_editor) { path_hb->add_child(file_list_search_box); button_file_list_display_mode = memnew(ToolButton); - button_file_list_display_mode->set_toggle_mode(true); path_hb->add_child(button_file_list_display_mode); files = memnew(ItemList); diff --git a/editor/filesystem_dock.h b/editor/filesystem_dock.h index 7cf37a7634..cd052f9700 100644 --- a/editor/filesystem_dock.h +++ b/editor/filesystem_dock.h @@ -181,7 +181,7 @@ private: void _tree_gui_input(Ref<InputEvent> p_event); void _update_file_list(bool p_keep_selection); - void _toggle_file_display(bool p_active); + void _toggle_file_display(); void _set_file_display(bool p_active); void _fs_changed(); diff --git a/editor/plugins/spatial_editor_plugin.cpp b/editor/plugins/spatial_editor_plugin.cpp index 1e9ff87fd3..ed11d26f25 100644 --- a/editor/plugins/spatial_editor_plugin.cpp +++ b/editor/plugins/spatial_editor_plugin.cpp @@ -2108,9 +2108,11 @@ void SpatialEditorViewport::_notification(int p_what) { set_process(visible); - if (visible) + if (visible) { _update_camera(0); - + } else { + set_freelook_active(false); + } call_deferred("update_transform_gizmo_view"); } diff --git a/main/input_default.cpp b/main/input_default.cpp index fd76b91a0b..e8133f9eba 100644 --- a/main/input_default.cpp +++ b/main/input_default.cpp @@ -685,7 +685,7 @@ void InputDefault::set_use_accumulated_input(bool p_enable) { InputDefault::InputDefault() { - use_accumulated_input = false; + use_accumulated_input = true; mouse_button_mask = 0; emulate_touch_from_mouse = false; emulate_mouse_from_touch = false; diff --git a/misc/dist/ios_xcode/godot_ios/godot_ios-Info.plist b/misc/dist/ios_xcode/godot_ios/godot_ios-Info.plist index 1c68c72385..b7cd94e3d5 100644 --- a/misc/dist/ios_xcode/godot_ios/godot_ios-Info.plist +++ b/misc/dist/ios_xcode/godot_ios/godot_ios-Info.plist @@ -34,8 +34,6 @@ </array> <key>NSCameraUsageDescription</key> <string>$camera_usage_description</string> - <key>NSMicrophoneUsageDescription</key> - <string>$microphone_usage_description</string> <key>NSPhotoLibraryUsageDescription</key> <string>$photolibrary_usage_description</string> <key>UIRequiresFullScreen</key> diff --git a/platform/iphone/export/export.cpp b/platform/iphone/export/export.cpp index c45931fdfd..67034388b9 100644 --- a/platform/iphone/export/export.cpp +++ b/platform/iphone/export/export.cpp @@ -266,7 +266,6 @@ void EditorExportPlatformIOS::get_export_options(List<ExportOption> *r_options) r_options->push_back(ExportOption(PropertyInfo(Variant::BOOL, "capabilities/push_notifications"), false)); r_options->push_back(ExportOption(PropertyInfo(Variant::STRING, "privacy/camera_usage_description"), "Godot would like to use your camera")); - r_options->push_back(ExportOption(PropertyInfo(Variant::STRING, "privacy/microphone_usage_description"), "Godot would like to use your microphone")); r_options->push_back(ExportOption(PropertyInfo(Variant::STRING, "privacy/photolibrary_usage_description"), "Godot would like to use your photos")); r_options->push_back(ExportOption(PropertyInfo(Variant::BOOL, "orientation/portrait"), true)); @@ -396,9 +395,6 @@ void EditorExportPlatformIOS::_fix_config_file(const Ref<EditorExportPreset> &p_ } else if (lines[i].find("$camera_usage_description") != -1) { String description = p_preset->get("privacy/camera_usage_description"); strnew += lines[i].replace("$camera_usage_description", description) + "\n"; - } else if (lines[i].find("$microphone_usage_description") != -1) { - String description = p_preset->get("privacy/microphone_usage_description"); - strnew += lines[i].replace("$microphone_usage_description", description) + "\n"; } else if (lines[i].find("$photolibrary_usage_description") != -1) { String description = p_preset->get("privacy/photolibrary_usage_description"); strnew += lines[i].replace("$photolibrary_usage_description", description) + "\n"; diff --git a/scene/2d/collision_polygon_2d.cpp b/scene/2d/collision_polygon_2d.cpp index 5edd49b3a3..ef7644fcab 100644 --- a/scene/2d/collision_polygon_2d.cpp +++ b/scene/2d/collision_polygon_2d.cpp @@ -78,40 +78,7 @@ void CollisionPolygon2D::_build_polygon() { } Vector<Vector<Vector2> > CollisionPolygon2D::_decompose_in_convex() { - - Vector<Vector<Vector2> > decomp; - List<TriangulatorPoly> in_poly, out_poly; - - TriangulatorPoly inp; - inp.Init(polygon.size()); - for (int i = 0; i < polygon.size(); i++) { - inp.GetPoint(i) = polygon[i]; - } - inp.SetOrientation(TRIANGULATOR_CCW); - in_poly.push_back(inp); - TriangulatorPartition tpart; - if (tpart.ConvexPartition_HM(&in_poly, &out_poly) == 0) { //failed! - ERR_PRINT("Convex decomposing failed!"); - return decomp; - } - - decomp.resize(out_poly.size()); - int idx = 0; - - for (List<TriangulatorPoly>::Element *I = out_poly.front(); I; I = I->next()) { - - TriangulatorPoly &tp = I->get(); - - decomp.write[idx].resize(tp.GetNumPoints()); - - for (int i = 0; i < tp.GetNumPoints(); i++) { - - decomp.write[idx].write[i] = tp.GetPoint(i); - } - - idx++; - } - + Vector<Vector<Vector2> > decomp = Geometry::decompose_polygon_in_convex(polygon); return decomp; } diff --git a/scene/2d/tile_map.cpp b/scene/2d/tile_map.cpp index 91e4f061cb..ed0a9c4915 100644 --- a/scene/2d/tile_map.cpp +++ b/scene/2d/tile_map.cpp @@ -479,10 +479,28 @@ void TileMap::update_dirty_quadrants() { vs->canvas_item_add_set_transform(debug_canvas_item, xform); shape->draw(debug_canvas_item, debug_collision_color); } - ps->body_add_shape(q.body, shape->get_rid(), xform); - ps->body_set_shape_metadata(q.body, shape_idx, Vector2(E->key().x, E->key().y)); - ps->body_set_shape_as_one_way_collision(q.body, shape_idx, shapes[j].one_way_collision, shapes[j].one_way_collision_margin); - shape_idx++; + + if (shape->has_meta("decomposed")) { + Array _shapes = shape->get_meta("decomposed"); + for (int k = 0; k < _shapes.size(); k++) { + Ref<ConvexPolygonShape2D> convex = _shapes[k]; + if (convex.is_valid()) { + ps->body_add_shape(q.body, convex->get_rid(), xform); + ps->body_set_shape_metadata(q.body, shape_idx, Vector2(E->key().x, E->key().y)); + ps->body_set_shape_as_one_way_collision(q.body, shape_idx, shapes[j].one_way_collision, shapes[j].one_way_collision_margin); + shape_idx++; +#ifdef DEBUG_ENABLED + } else { + print_error("The TileSet asigned to the TileMap " + get_name() + " has an invalid convex shape."); +#endif + } + } + } else { + ps->body_add_shape(q.body, shape->get_rid(), xform); + ps->body_set_shape_metadata(q.body, shape_idx, Vector2(E->key().x, E->key().y)); + ps->body_set_shape_as_one_way_collision(q.body, shape_idx, shapes[j].one_way_collision, shapes[j].one_way_collision_margin); + shape_idx++; + } } } } diff --git a/scene/gui/file_dialog.cpp b/scene/gui/file_dialog.cpp index 5599c64daa..059e59ea21 100644 --- a/scene/gui/file_dialog.cpp +++ b/scene/gui/file_dialog.cpp @@ -861,7 +861,7 @@ FileDialog::FileDialog() { HBoxContainer *hbc = memnew(HBoxContainer); dir_up = memnew(ToolButton); - dir_up->set_tooltip(RTR("Go to parent folder")); + dir_up->set_tooltip(RTR("Go to parent folder.")); hbc->add_child(dir_up); dir_up->connect("pressed", this, "_go_up"); @@ -871,6 +871,7 @@ FileDialog::FileDialog() { dir->set_h_size_flags(SIZE_EXPAND_FILL); refresh = memnew(ToolButton); + refresh->set_tooltip(RTR("Refresh")); refresh->connect("pressed", this, "_update_file_list"); hbc->add_child(refresh); diff --git a/scene/resources/tile_set.cpp b/scene/resources/tile_set.cpp index 3c83de91fd..4ddfc0331b 100644 --- a/scene/resources/tile_set.cpp +++ b/scene/resources/tile_set.cpp @@ -30,6 +30,7 @@ #include "tile_set.h" #include "core/array.h" +#include "core/engine.h" bool TileSet::_set(const StringName &p_name, const Variant &p_value) { @@ -662,6 +663,7 @@ void TileSet::tile_set_shape(int p_id, int p_shape_id, const Ref<Shape2D> &p_sha if (tile_map[p_id].shapes_data.size() <= p_shape_id) tile_map[p_id].shapes_data.resize(p_shape_id + 1); tile_map[p_id].shapes_data.write[p_shape_id].shape = p_shape; + _decompose_convex_shape(p_shape); emit_changed(); } @@ -844,6 +846,9 @@ void TileSet::tile_set_shapes(int p_id, const Vector<ShapeData> &p_shapes) { ERR_FAIL_COND(!tile_map.has(p_id)); tile_map[p_id].shapes_data = p_shapes; + for (int i = 0; i < p_shapes.size(); i++) { + _decompose_convex_shape(p_shapes[i].shape); + } emit_changed(); } @@ -888,9 +893,10 @@ void TileSet::_tile_set_shapes(int p_id, const Array &p_shapes) { } else if (p_shapes[i].get_type() == Variant::DICTIONARY) { Dictionary d = p_shapes[i]; - if (d.has("shape") && d["shape"].get_type() == Variant::OBJECT) + if (d.has("shape") && d["shape"].get_type() == Variant::OBJECT) { s.shape = d["shape"]; - else + _decompose_convex_shape(s.shape); + } else continue; if (d.has("shape_transform") && d["shape_transform"].get_type() == Variant::TRANSFORM2D) @@ -956,6 +962,26 @@ Array TileSet::_get_tiles_ids() const { return arr; } +void TileSet::_decompose_convex_shape(Ref<Shape2D> p_shape) { + if (Engine::get_singleton()->is_editor_hint()) + return; + Ref<ConvexPolygonShape2D> convex = p_shape; + if (!convex.is_valid()) + return; + Vector<Vector<Vector2> > decomp = Geometry::decompose_polygon_in_convex(convex->get_points()); + if (decomp.size() > 1) { + Array sub_shapes; + for (int i = 0; i < decomp.size(); i++) { + Ref<ConvexPolygonShape2D> _convex = memnew(ConvexPolygonShape2D); + _convex->set_points(decomp[i]); + sub_shapes.append(_convex); + } + convex->set_meta("decomposed", sub_shapes); + } else { + convex->set_meta("decomposed", Variant()); + } +} + void TileSet::get_tile_list(List<int> *p_tiles) const { for (Map<int, TileData>::Element *E = tile_map.front(); E; E = E->next()) { diff --git a/scene/resources/tile_set.h b/scene/resources/tile_set.h index 4800371d3c..fac48243d0 100644 --- a/scene/resources/tile_set.h +++ b/scene/resources/tile_set.h @@ -35,6 +35,7 @@ #include "core/resource.h" #include "scene/2d/light_occluder_2d.h" #include "scene/2d/navigation_polygon.h" +#include "scene/resources/convex_polygon_shape_2d.h" #include "scene/resources/shape_2d.h" #include "scene/resources/texture.h" @@ -134,6 +135,7 @@ protected: void _tile_set_shapes(int p_id, const Array &p_shapes); Array _tile_get_shapes(int p_id) const; Array _get_tiles_ids() const; + void _decompose_convex_shape(Ref<Shape2D> p_shape); static void _bind_methods(); |