Commit graph

6120 commits

Author SHA1 Message Date
Rémi Verschelde b7b3978684
Merge pull request #36556 from RandomShaper/rework_mutex
Reimplement `Mutex` with C++'s `<mutex>` (plus more)
2020-02-28 00:26:01 +01:00
Mateo Dev .59 7ea690b94f Signals: tab_changed now is emitted when it's on scene tree 2020-02-27 21:27:52 +01:00
Rémi Verschelde 2d904d2f80
Merge pull request #36232 from Calinou/add-soft-line-length-guideline
Add a soft line length guideline to the script editor
2020-02-27 21:10:42 +01:00
Rémi Verschelde f9d93ee819
Merge pull request #36288 from Calinou/meshlibrary-allow-non-tools-use
Allow using `MeshLibrary.get_item_preview()` in non-editor builds again
2020-02-27 21:10:09 +01:00
Rémi Verschelde 2b3431e2b7
Merge pull request #36581 from Calinou/doc-improve-add-child-below-node
Improve the `Node.add_child_below_node()` documentation
2020-02-27 19:44:27 +01:00
Hugo Locurcio 393a3c3122
Improve the Node.add_child_below_node() documentation
This closes https://github.com/godotengine/godot-docs/issues/2730.
2020-02-27 18:41:18 +01:00
Rémi Verschelde d94155e10b
Merge pull request #36050 from eswartz/line-edit-move-cursor-on-unselect
Use left/right arrow to move cursor when unselecting in LineEdit
2020-02-27 14:04:19 +01:00
Pedro J. Estébanez 18fbdbb456 Reimplement Mutex with C++'s <mutex>
Main:
- It's now implemented thanks to `<mutex>`. No more platform-specific implementations.
- `BinaryMutex` (non-recursive) is added, as an alternative for special cases.
- Doesn't need allocation/deallocation anymore. It can live in the stack and be part of other classes.
- Because of that, it's methods are now `const` and the inner mutex is `mutable` so it can be easily used in `const` contexts.
- A no-op implementation is provided if `NO_THREADS` is defined. No more need to add `#ifdef NO_THREADS` just for this.
- `MutexLock` now takes a reference. At this point the cases of null `Mutex`es are rare. If you ever need that, just don't use `MutexLock`.
- Thread-safe utilities are therefore simpler now.

Misc.:
- `ScopedMutexLock` is dropped and replaced by `MutexLock`, because they were pretty much the same.
- Every case of lock, do-something, unlock is replaced by `MutexLock` (complex cases where it's not straightfoward are kept as as explicit lock and unlock).
- `ShaderRD` contained an `std::mutex`, which has been replaced by `Mutex`.
2020-02-26 20:40:10 +01:00
Yuri Roubinsky 1e8108310a Changed float type to int for INDEX visual shader input 2020-02-26 16:39:42 +03:00
Rémi Verschelde 1e57b558f2
Merge pull request #36536 from Chaosus/vs_int
Add support for integer type in visual shaders
2020-02-26 10:11:24 +01:00
Yuri Roubinsky 4a3d277623 Add support for integer type in visual shaders 2020-02-26 10:12:06 +03:00
Dominik 'dreamsComeTrue' Jasiński 51cbf414fc Added missing destructor for Navigation2D
Although destructor call was missing, it still doesn't heal #36537 memory leaks. Further description how that might be overcome - on GitHub

Partialy covers #36537
2020-02-25 23:43:59 +01:00
Rémi Verschelde dace1ec912
Merge pull request #36532 from Faless/debugger/weakref_crash_vulkan
Fix debugger crash inspecting freed object.
2020-02-25 16:45:12 +01:00
Fabio Alessandrelli d8ba07ea8f Fix debugger crash inspecting freed object.
This seems to be the correct way to validate a reference.
Why is cast_to failing? Is this the correct way of checking if the
object is valid?
2020-02-25 15:00:52 +01:00
Juan Linietsky 33b5c57199 Variant: Added 64-bit packed arrays, renamed Variant::REAL to FLOAT.
- Renames PackedIntArray to PackedInt32Array.
- Renames PackedFloatArray to PackedFloat32Array.
- Adds PackedInt64Array and PackedFloat64Array.
- Renames Variant::REAL to Variant::FLOAT for consistency.

Packed arrays are for storing large amount of data and creating stuff like
meshes, buffers. textures, etc. Forcing them to be 64 is a huge waste of
memory. That said, many users requested the ability to have 64 bits packed
arrays for their games, so this is just an optional added type.

For Variant, the float datatype is always 64 bits, and exposed as `float`.

We still have `real_t` which is the datatype that can change from 32 to 64
bits depending on a compile flag (not entirely working right now, but that's
the idea). It affects math related datatypes and code only.

Neither Variant nor PackedArray make use of real_t, which is only intended
for math precision, so the term is removed from there to keep only float.
2020-02-25 12:55:53 +01:00
Rémi Verschelde b9757545ca
Merge pull request #36488 from Chaosus/capsule_y
Changed default capsule axis to vertical
2020-02-24 00:19:21 +01:00
Rémi Verschelde 194fd2d5a5
Merge pull request #36089 from dreamsComeTrue/fix-autocomplete-quotes
Fix: auto brace complete for quoted strings
2020-02-23 22:13:27 +01:00
Yuri Roubinsky 3b0638fe1c Changed default capsule axis to vertical
Co-authored-by: Hugo Locurcio <https://hugo.pro>
2020-02-23 23:18:01 +03:00
Rémi Verschelde c9e1d98c62
Merge pull request #36411 from Janglee123/rect2-tween
Added tween support for Rect2
2020-02-23 08:46:48 +01:00
janglee 4bbe87abb7 Added tween support for Rect2
Fixes #34575
2020-02-23 07:21:04 +05:30
Rémi Verschelde 2cf6ac6c50 Replace FALLTHROUGH macro by C++17 [[fallthrough]]
This attribute is now part of the standard we target so we no longer
need compiler-specific hacks.

Also enables -Wimplicit-fallthrough for Clang now that we can properly
support it. It's already on by default for GCC's -Wextra.

Fixes new warnings raised by Clang's -Wimplicit-fallthrough.
2020-02-23 00:52:50 +01:00
Rémi Verschelde bf7d6de556
Merge pull request #36441 from YeldhamDev/tabs_unused_constants
Remove unused theme constants in Tab(Container)
2020-02-22 08:17:33 +01:00
Michael Alexsander e9244c4c23 Remove unused theme constants in Tab(Container) 2020-02-22 01:24:16 -03:00
Dominik 'dreamsComeTrue' Jasiński 6a404a88e4 Fix: auto brace complete for quoted strings
Fixes #36002
2020-02-21 23:01:13 +01:00
Yuri Roubinsky 7c1415b99b
Merge pull request #36421 from Chaosus/vs_sort_custom_nods
Refactor node processing in visual shader member dialog
2020-02-21 21:34:03 +03:00
Yuri Roubinsky b78b37ed3f Refactor node processing in visual shader member dialog 2020-02-21 18:34:31 +03:00
Juan Linietsky 3c0059650d Added StringName as a variant type.
Also changed all relevant properties defined manually to StringName.
2020-02-21 14:25:29 +01:00
Rémi Verschelde 7ac0973e9a
Merge pull request #36415 from reduz/skeleton-skin-named
Add support for named binds in Skin.
2020-02-21 14:12:19 +01:00
Juan Linietsky 9a34f39d32 Add support for named binds in Skin.
Helps better reutilization of skeletons from Maya exported files.
2020-02-21 09:40:29 -03:00
Fabio Alessandrelli cbc450c0e5 Huge Debugger/EditorDebugger refactor. 2020-02-21 11:12:03 +01:00
Juan Linietsky 69c95f4b4c Reworked signal connection system, added support for Callable and Signal objects and made them default. 2020-02-20 08:24:50 +01:00
Rémi Verschelde f8c87c0ac4
Merge pull request #36375 from Xrayez/pimpmaps-typos
Fix MIMPAMPS typos in constants throughout the engine
2020-02-20 07:00:25 +01:00
Haoyu Qiu a7578459c2 Fixes crash when loading StreamTexture from file 2020-02-20 09:45:00 +08:00
Andrii Doroshenko (Xrayez) fa766265a7 Fix MIMPAMPS typos in constants throughout the engine 2020-02-20 01:31:43 +02:00
Rémi Verschelde 49fec646cb Fix compilation warnings and re-enable werror=yes on Travis
Fix -Wunused-variable, -Wunused-but-set-variable and -Wswitch warnings
raised by GCC 8 and 9.

Fix -Wunused-function, -Wunused-private-field and
-Wtautological-constant-out-of-range-compare raised by Clang.

Fix MSVC 2019 warning C4804 (unsafe use of type 'bool' in comparison
operation).

GCC -Wcpp warnings/Clang -W#warnings (`#warning`) are no longer raising
errors and will thus not abort compilation with `werror=yes`.

Treat glslang headers are system headers to avoid raising warnings.

Re-enables us to build with `werror=yes` on Linux and macOS, thus
catching warnings that would be introduced by new code.

Fixes #36132.
2020-02-18 20:51:25 +01:00
Andrea Catania 79fc7d7d6a Added utility functions to the new NavigationServer:
- Vector3 get_closest_point_to_segment(const Vector3 &p_from, const Vector3 &p_to, const bool &p_use_collision = false);
- Vector3 get_closest_point(const Vector3 &p_point);
- Vector3 get_closest_point_normal(const Vector3 &p_point);
- Object *get_closest_point_owner(const Vector3 &p_point);
2020-02-18 17:12:45 +01:00
Rémi Verschelde e1b6a0f3b6
Merge pull request #36318 from akien-mga/fix-mono-build
Fix CanvasItem bindings and Mono build
2020-02-18 13:57:06 +01:00
Rémi Verschelde ae99439667
Merge pull request #36317 from godotengine/revert-36182-how_to_text_file
Revert "Remove TextFile from public API"
2020-02-18 12:59:15 +01:00
Rémi Verschelde a16be762ed Fix arguments/default values in CanvasItem bindings 2020-02-18 11:28:26 +01:00
Rémi Verschelde 77b05256d6
Revert "Remove TextFile from public API" 2020-02-18 10:35:30 +01:00
Juan Linietsky 3205a92ad8 PoolVector is gone, replaced by Vector
Typed `PoolTypeArray` types are now renamed `PackedTypeArray` and are
sugar for `Vector<Type>`.
2020-02-18 10:10:36 +01:00
Rémi Verschelde c92c434299
Merge pull request #36229 from dreamsComeTrue/rich-text-label-key-events
RichTextLabel: proper handling of internal key events
2020-02-17 09:56:38 +01:00
Rémi Verschelde c3f2b84694
Merge pull request #36233 from WARIO-MDMA/audiostreamplayer-pitch-scale
[AudioStreamPlayer/2D/3D] Reduce the max value of pitch_scale's inspector slider
2020-02-17 09:54:02 +01:00
Yuri Roubinsky ed05e27c81 Fix GDCLASS for Texture2D/TextureLayered 2020-02-17 08:21:10 +03:00
Hugo Locurcio 64fac9dd5d
Allow using MeshLibrary.get_item_preview() in non-editor builds again
This closes #36268.
2020-02-17 00:07:44 +01:00
Haoyu Qiu 3584e27948 Fixes memory leak when loading StreamTexture 2020-02-16 13:22:25 +08:00
Ed Swartz ee39093ce3 Use left/right arrow to move cursor when unselecting in LineEdit
-- useful for rename dialog (the filename portion is selected by
default, and usually, want to change the end of the name, not the
beginning)
2020-02-15 09:24:20 -06:00
Juan Linietsky 867d073b98 Changed logic and optimized ObjectID in ObjectDB and Variant, removed RefPtr. 2020-02-15 08:36:04 -03:00
WARIO-MDMA 61d20b1f56 Reduce AudioStreamPlayer's pitch_scale max value 2020-02-15 22:26:08 +11:00
Michael Alexsander 5f5ccfc361 Fix hiding ColorPicker's presets not fully hiding its controls 2020-02-15 02:19:28 -03:00