Commit graph

3328 commits

Author SHA1 Message Date
Juan Linietsky
1bea8e1eac New lightmapper
-Added LocalVector (needed it)
-Added stb_rect_pack (It's pretty cool, we could probably use it for other stuff too)
-Fixes and changes all around the place
-Added library for 128 bits fixed point (required for Delaunay3D)
2020-05-10 15:59:09 -03:00
Rémi Verschelde
6a0473bcc2
Merge pull request #38548 from kuruk-mm/add_string_join_to_gdscript
GDScript: Add join method on String
2020-05-10 16:54:45 +02:00
Rémi Verschelde
94721f5ab8 Revert "Renamed plane's d to distance"
This reverts commit ec7b481170.

This was wrong, `d` is not a distance but the `d` constant in the
parametric equation `ax + by + cz = d` describing the plane.
2020-05-10 16:47:11 +02:00
Rémi Verschelde
69de7ce38c Style: clang-format: Disable AllowShortCaseLabelsOnASingleLine
Part of #33027.
2020-05-10 13:13:54 +02:00
Rémi Verschelde
e956e80c1f Style: clang-format: Disable AllowShortIfStatementsOnASingleLine
Part of #33027, also discussed in #29848.

Enforcing the use of brackets even on single line statements would be
preferred, but `clang-format` doesn't have this functionality yet.
2020-05-10 13:12:16 +02:00
Rémi Verschelde
03b13e0c69 Style: Add missing copyright headers 2020-05-10 13:12:16 +02:00
Rémi Verschelde
a128dd97d6
Merge pull request #37020 from aaronfranke/range
Allow using integer vectors for iteration and make range() use them
2020-05-10 13:11:07 +02:00
Marcus Elg
ec7b481170 Renamed plane's d to distance 2020-05-10 12:12:51 +02:00
Rémi Verschelde
a4b829410c
Merge pull request #38481 from RandomShaper/improve_yield
Fix object leaks caused by unfulfilled yields
2020-05-09 22:02:52 +02:00
Aaron Franke
38a0ff2249
Allow Vector2/Vector3 iterators to have non-integer values 2020-05-09 13:43:35 -04:00
Aaron Franke
f7b50992b5
Allow using integer vectors for iteration and make range() use them 2020-05-09 13:43:35 -04:00
Mateo Kuruk Miccino
8c2dc177b6 GDScript: Add join method on String
Docs: Add join on String.xml
2020-05-09 12:16:21 -03:00
Andrea Catania
97f9bbcfa3
Removed const from OAHashMap iterator value
to allows to mutate the value while iterating over it.
2020-05-08 14:21:46 +02:00
hoontee
9aa29b85a8
Re-add __XINPUT_DEVICE__
Required for `JoypadWindows::probe_joypads`.
Partially reverts 510e83498e. Fixes #38554.
2020-05-07 22:19:42 -05:00
Rémi Verschelde
ae33cf5f45
Merge pull request #36379 from aaronfranke/color-constructors
Add a Color constructor for Color with alpha
2020-05-07 21:16:51 +02:00
Rémi Verschelde
bd75e2538b
Merge pull request #38536 from ThakeeNathees/trnasform-2-transform2d-convert-fix
Fix: can't convert Transform -> Transform2D
2020-05-07 20:56:50 +02:00
Thakee Nathees
e32cdbe568 Fix: can't convert Transform -> Transform2D
Fix: #38528
2020-05-07 21:40:53 +05:30
Rémi Verschelde
77e19d116e
Merge pull request #38522 from ThakeeNathees/printing-empty-string-fix
Fix: printing empty string does nothing in editor output pannel
2020-05-07 18:05:36 +02:00
Thakee Nathees
5640cad1e1 Fix: printing empty string does nothing in editor output pannel
Fix: #38490
2020-05-07 05:56:29 +05:30
Rémi Verschelde
33d0b9e169
Merge pull request #38393 from nekomatata/printerr-remote-debugger-4.0
Format remote printerr properly in script debugger output
2020-05-06 07:31:57 +02:00
Pedro J. Estébanez
46bfe4452f Fix object leaks caused by unfulfilled yields
Now the stack saved in a `GDScriptFunctionState` is cleared as soon as the `yield()` operation is known not to be resumed because either the script, the instance or both are deleted.

This clears problems like leaked objects by eliminating cases of circular references between `GDScriptFunctionState`s preventing them and the objects they refer to in their saved stacks from being released. As an example, this makes using `SceneTreeTimer` safer.

Furthermore, with this change it's now possible to print early warnings about `yield()`s to released script/instances, as now we know they won't be successfully resumed as the condition for that happens. However, this PR doesn't add such messages, to keep the observed behavior the same for the time being.

Also, now a backup of the function name in `GDScriptFunctionState` is used, since the script may not be valid by the time the function name is needed for the resume-after-yield error messages.
2020-05-05 17:54:15 +02:00
Rémi Verschelde
8227947d41
Merge pull request #38415 from madmiraal/fix-array-slicing
Fix array slicing.
2020-05-05 16:44:52 +02:00
bruvzg
d978658f81
[Windows] Add support for the WinTab API for pen input. 2020-05-05 14:16:02 +03:00
Marcel Admiraal
54c36adbec Check for empty vectors before trying to access a pointer to the first
element in Octree<T, use_pairs, AL>::cull_convex().
2020-05-04 21:02:58 +01:00
Rémi Verschelde
97c787b84d
Merge pull request #37937 from HaSa1002/fix-pck
Priorize Embedded PCKs on loading
2020-05-04 16:14:39 +02:00
HaSa1002
fba98950c7 Priorize Embedded PCKs on loading
If existing, embedded PCKs are loaded before the pcks the engine might
find next to it.

Fixes #37568
2020-05-04 15:24:25 +02:00
Rémi Verschelde
ec542db782
Merge pull request #38394 from reduz/implement-skew
Implement Skew in Node2D
2020-05-03 18:17:08 +02:00
Hugo Locurcio
596d426151
Remove some C++11 polyfill defines that are no longer needed 2020-05-03 00:42:04 +02:00
Marcel Admiraal
4409f3cc68 Fix array slicing. 2020-05-02 14:42:16 +01:00
Juan Linietsky
efb1f7d76b Implement Skew in Node2D
Skew is x-axis only, because it must be bidirectionally convertible to a 2x3 matrix, but you can subtract it  to the rotation to get the effect on y-axis
2020-05-01 13:38:04 -03:00
PouleyKetchoupp
aacf69bad2 Format remote printerr properly in script debugger output 2020-05-01 18:23:51 +02:00
Kiri Jolly
87ba4daf4b Fixed false positives in the culling system.
This fixes numerous false positives coming out of the culling system.

AABB checks are now a full separating-axis check against the frustum, with the points of the frustum being compared to the planes of the box just as the points of the box were being compared to the planes of the frustum. This fixes large objects behind the camera not being culled correctly.

Some systems that used frustums that were (sometimes mistakenly?) unbounded on one or more side have been modified to be fully enclosed.
2020-04-29 19:33:42 -07:00
Aaron Franke
90df1d67cb
Color with alpha constructor 2020-04-29 14:41:12 -04:00
Rémi Verschelde
b99b212855
Merge pull request #38307 from Calinou/shell-open-res-user-warning
Warn when trying to open `res://` or `user://` with `OS.shell_open()`
2020-04-29 16:07:34 +02:00
Aaron Franke
540156b387
[Core] Rename linear_interpolate to lerp 2020-04-29 04:02:49 -04:00
Rémi Verschelde
10273e9de6
Merge pull request #38034 from punto-/punto-/vibration_info_protected
makes VibrationInfo protected
2020-04-29 09:57:17 +02:00
Rémi Verschelde
5cae0f3402
Merge pull request #37580 from aaronfranke/xform
Print errors when passing an invalid type to xform
2020-04-29 09:32:51 +02:00
punto-
41a7d07095 Input: make VibrationInfo protected to allow implementors to use it 2020-04-29 09:11:14 +02:00
Rémi Verschelde
e445be6944
Merge pull request #38064 from aaronfranke/rotated
Improve the Vector2 rotated code
2020-04-28 20:49:22 +02:00
Aaron Franke
72ecd36cb3
Print errors when passing an invalid type to xform 2020-04-28 14:24:16 -04:00
Hugo Locurcio
d46e411b44
Warn when trying to open res:// or user:// with OS.shell_open()
`OS.shell_open()` will pass on the path directly to the OS' shell
handler (which can handle file paths or URLs). It can't handle
Godot-specific paths, so these need to be converted with
`ProjectSettings.globalize_path()` first.
2020-04-28 19:37:09 +02:00
Rémi Verschelde
d44c5cfcf7
Merge pull request #38295 from akien-mga/input-is-back
Rename InputFilter back to Input
2020-04-28 16:20:20 +02:00
Rémi Verschelde
fdf58a5858 Rename InputFilter back to Input
It changed name as part of the DisplayServer and input refactoring
in #37317, with the rationale that input no longer goes through the
main loop, so the previous Input singleton now only does filtering.

But the gains in consistency are quite limited in the renaming, and
it breaks compatibility for all scripts and tutorials that access
the Input singleton via the scripting language. A temporary option
was suggested to keep the scripting singleton named `Input` even if
its type is `InputFilter`, but that adds inconsistency and breaks C#.

Fixes godotengine/godot-proposals#639.
Fixes #37319.
Fixes #37690.
2020-04-28 15:19:49 +02:00
Rémi Verschelde
510e83498e Input: Drop obsolete versions of SDL gamecontrollerdb
The 204 and 205 are the older, SDL 2.0.4 and 2.0.5 compatible mappings,
but since all new mappings have only been added to the main
gamecontrollerdb.txt which overrides the older entries, it doesn't make
much sense for us to keep the old databases.

We do not support the SDL2 half axes and inverted axes features from
gamecontrollerdb.txt, but this only impacts the specific controllers
which can use those features, the rest are parsed and used properly.

As for godotcontrollerdb.txt, it doesn't make sense for us to maintain
our own custom mappings instead of submitting them upstream. The only
exception is the Javascript and UWP platforms for which no bindings are
available upstream, so we keep those entries.
2020-04-28 14:51:44 +02:00
Tobias Mansfield-Williams
982efb1864 Add const to InputEventMouseButton::get_factor 2020-04-25 13:25:00 +02:00
Aaron Franke
23a349c427
Improve the Vector2 rotated code 2020-04-21 14:06:41 -04:00
Juan Linietsky
f8ef38efed Add proper type to most public API uses of Array 2020-04-21 12:16:45 -03:00
Juan Linietsky
5d4dc2d45c Add ability to bind typed arrays to script API
Note: Only replaced 2 instances to test, Node.get_children and TileMap.get_used_cells
Note: Will do a mass replace on later PRs of whathever I can find, but probably need
a tool to grep through doc.
Warning: Mono will break, needs to be fixed (and so do TypeScript and NativeScript, need to ask respective maintainers)
2020-04-21 10:15:40 +02:00
Juan Linietsky
ae09b55a19 Exposed RenderingDevice to script API
Also added an easier way to load native GLSL shaders.

Extras:

Had to fix no-cache for subresources in resource loader, it was not properly working, making shaders not properly reload.

Note:

The precommit hooks are broken because they don't seem to support enums from one class being used in another.
Feel free to fix this after merging this PR.
2020-04-20 21:21:58 -03:00
Rémi Verschelde
114ffb19e6
Merge pull request #37982 from DrMoriarty/fix_square_resize
Fix square image resize
2020-04-20 23:56:23 +02:00
Rémi Verschelde
2cd952bd84 Fix handling of PROPERTY_USAGE_SUBGROUP in DocData and editor
Subgroups were added in #37678 but not properly handled everywhere
where PROPERTY_USAGE_GROUP is.
2020-04-20 17:13:06 +02:00
Rémi Verschelde
9cf48b3e99
Merge pull request #38039 from akien-mga/docdata-skip-unexposed
DocData: Skip unexposed classes
2020-04-20 15:21:49 +02:00
Rémi Verschelde
0ef8bcac4d DocData: Skip unexposed classes
Properly expose classes that we actually want accessible.
2020-04-20 12:51:10 +02:00
Rémi Verschelde
515fe0f29b Revert "Made possible to specify where to dump the contents when loading a ".pck" file"
This reverts commit 3c261e0dfa.

This was not so useful as is due to the way dependency paths are stored
in scenes and resources.
2020-04-20 10:57:05 +02:00
Vasiliy Makarov
d45e8734d1 Fix square image resize
Fixes #37980
2020-04-18 13:29:01 +03:00
Michael Alexsander
3c261e0dfa Made possible to specify where to dump the contents when loading a ".pck" file 2020-04-16 22:52:26 -03:00
qarmin
943ec79859 Fixes leaks in ResourceCache, Vulkan and X11 2020-04-15 10:27:57 +02:00
Marcel Admiraal
8e6e91f2cd Remove unnecessary check for zero determinant in Basis::orthonormalize(). 2020-04-14 17:20:45 +01:00
Juan Linietsky
5944eb6e7f Implement decals
Also implemented decal atlas, so projectors and other stuff can be added.
Sidenote: Had to make RID hashable, so some unrelated includes changed
in order to include it in hashfuncs.h
2020-04-14 11:13:34 -03:00
Rémi Verschelde
0826b63c7e
Merge pull request #37450 from SkyLucilfer/profilerBug
Fix profiler frame number stops updating when window is minimized
2020-04-10 17:56:28 +02:00
Rémi Verschelde
d41444b0d8
Merge pull request #37693 from lupoDharkael/remove-hint
Remove obsolete enums
2020-04-10 11:47:44 +02:00
Rémi Verschelde
95db658672
Merge pull request #37699 from lupoDharkael/committing-typo
Replace is_commiting_action with is_committing_action
2020-04-10 11:47:19 +02:00
Marcel Admiraal
0b9e95cac5 Fix Engine get_target_fps() returning float instead of int. 2020-04-10 06:48:22 +01:00
lupoDharkael
5021dcfcd6 Remove obsolete enums 2020-04-08 20:44:01 +02:00
lupoDharkael
406c2790e3 Replace is_commiting_action with is_committing_action 2020-04-08 18:52:04 +02:00
Juan Linietsky
4ffc0d6b3f Refactored shadowmapping.
- Made shadow bias size independent, so it will remain when changing light or camera size.
- Implemented normal offset bias, which greatly enhances quality.
- Added transmission to subsurface scattering
- Reimplemented shadow filter modes

Closes #17260
2020-04-08 11:19:43 -03:00
Rémi Verschelde
8c8e3ba918
Merge pull request #37579 from Calinou/improve-shader-error-output
Improve the shader error console output
2020-04-07 09:17:37 +02:00
Bastiaan Olij
94fab21348 Fix aspect ratio on hmd projection matrix
(cherry picked from commit a7438f0e61)
2020-04-05 12:41:29 +02:00
Hugo Locurcio
5fae0c454a
Improve the shader error console output
This makes the line gutter look more like an actual line gutter,
which makes it less confusing.
2020-04-04 14:27:44 +02:00
Ignacio Etcheverry
27ddb27da8 Fix C# bindings after recent breaking changes 2020-04-03 01:38:48 +02:00
Rémi Verschelde
ea7b497065 Replace more occurrences of NULL with nullptr 2020-04-02 14:56:01 +02:00
lupoDharkael
95a1400a2a Replace NULL with nullptr 2020-04-02 13:38:00 +02:00
Rémi Verschelde
5f11e15571
Merge pull request #37504 from qarmin/out_of_bound_cursor
Fix array out of bounds access caused by uninitialised variables
2020-04-02 13:07:55 +02:00
Zak Grumbles
d648f77119
Make dict erase node sequenced godotengine#37477
* Updated macro call to make the visual Dictionary Erase node sequenced.
2020-04-01 22:10:12 -05:00
Rafał Mikrut
359bebd8c0 Fix out of bound array access caused by unassigned variable 2020-04-01 19:29:35 +02:00
Thakee Nathees
cb53b1d88e some typo in method binds fixed 2020-04-01 14:01:18 +05:30
SkyJJ
c1ee20a05d Fix profiler frame number stops updating when window is minimized 2020-03-31 03:49:29 +02:00
Rémi Verschelde
cd4e46ee65 SCons: Format buildsystem files with psf/black
Configured for a max line length of 120 characters.

psf/black is very opinionated and purposely doesn't leave much room for
configuration. The output is mostly OK so that should be fine for us,
but some things worth noting:

- Manually wrapped strings will be reflowed, so by using a line length
  of 120 for the sake of preserving readability for our long command
  calls, it also means that some manually wrapped strings are back on
  the same line and should be manually merged again.

- Code generators using string concatenation extensively look awful,
  since black puts each operand on a single line. We need to refactor
  these generators to use more pythonic string formatting, for which
  many options are available (`%`, `format` or f-strings).

- CI checks and a pre-commit hook will be added to ensure that future
  buildsystem changes are well-formatted.
2020-03-30 09:05:53 +02:00
Juan Linietsky
0c24a844ec Ensure COWData does not reallocate on push back, fixes #22561 2020-03-27 21:52:42 -03:00
Juan Linietsky
a6f3bc7c69 Renaming of servers for coherency.
VisualServer -> RenderingServer
PhysicsServer -> PhysicsServer3D
Physics2DServer -> PhysicsServer2D
NavigationServer -> NavigationServer3D
Navigation2DServer -> NavigationServer2D

Also renamed corresponding files.
2020-03-27 15:21:27 -03:00
Rémi Verschelde
f725bd99f4 Fix some -Wmaybe-uninitialized warnings
Namely:
```
modules/basis_universal/register_types.cpp: In function 'Ref<Image> basis_universal_unpacker(const Vector<unsigned char>&)':
modules/basis_universal/register_types.cpp:266:15: warning: 'imgfmt' may be used uninitialized in this function [-Wmaybe-uninitialized]
  266 |  image->create(info.m_width, info.m_height, info.m_total_levels > 1, imgfmt, gpudata);
      |  ~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
modules/basis_universal/register_types.cpp:255:39: warning: 'format' may be used uninitialized in this function [-Wmaybe-uninitialized]
  255 |    bool ret = tr.transcode_image_level(ptr, size, 0, i, dst + ofs, level.m_total_blocks - i, format);
      |               ~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```

```
servers/visual_server.cpp: In member function 'Error VisualServer::_surface_set_data(Array, uint32_t, uint32_t*, uint32_t, Vector<unsigned char>&, int, Vector<unsigned char>&, int, AABB&, Vector<AABB>&)':
servers/visual_server.cpp:636:15: warning: 'iw' may be used uninitialized in this function [-Wmaybe-uninitialized]
  636 |       copymem(&iw[i * 2], &v, 2);
      |               ^
```

```
core/image.cpp: In member function 'Error Image::generate_mipmap_roughness(Image::RoughnessChannel, const Ref<Image>&)':
core/image.cpp:1683:11: warning: 'roughness' may be used uninitialized in this function [-Wmaybe-uninitialized]
 1683 |     float roughness;
      |           ^~~~~~~~~
```
2020-03-27 14:33:06 +01:00
bruvzg
15a9f94346 Add macOS DisplayServer implementation.
Change global menu to use Callable, add support for check items and submenus.
2020-03-26 16:24:05 +01:00
Juan Linietsky
543fb1c4da Separate DisplayServer from OS on Windows 2020-03-26 15:49:41 +01:00
Juan Linietsky
4758057f20 Working multiple window support, including editor 2020-03-26 15:49:40 +01:00
Juan Linietsky
8e6960a69e Refactored input, goes all via windows now.
Also renamed Input to InputFilter because all it does is filter events.
2020-03-26 15:49:39 +01:00
Juan Linietsky
f8a79a97c7 Effective DisplayServer separation, rename X11 -> LinuxBSD 2020-03-26 15:49:34 +01:00
Juan Linietsky
4396e98834 Refactored Input, create DisplayServer and DisplayServerX11 2020-03-26 15:49:32 +01:00
Rémi Verschelde
3d2dd79ecd SCons: Drop support for Python 2
We now require SCons 3.0+ (first version with Python 3 support),
and we set min required Python 3 version to 3.5 (3.4 and earlier are
EOL).
2020-03-25 15:25:37 +01:00
Rémi Verschelde
13a9bfbca7 Style: Harmonize header guards to style guide [Core] 2020-03-25 11:22:19 +01:00
Hugo Locurcio
8d8c7a9383 Tweak the message queue maximum size property hint
The minimum slider value no longer allows decreasing the value below
the default, as this can cause things to break in the editor.

The maximum slider value was also increased to 4096 since it can safely
be increased to that value (some add-ons may require it).

This closes #37052.
2020-03-24 15:05:07 +01:00
Rémi Verschelde
20edf69f96
Merge pull request #33508 from nekomatata/object-has-signal
Added has_signal method for Object
2020-03-23 16:16:25 +01:00
PouleyKetchoupp
258d91f883 Added has_signal method for Object 2020-03-23 11:27:17 +01:00
Rémi Verschelde
ca4e4506db Fix potential divisions by 0 reported by MSVC
The `TextEdit` one was indeed a potential bug.
The `PCKPacker` one seems to be a false positive, it's already in a
`for` loop that depends on `files.size()`.
2020-03-21 11:54:08 +01:00
Thakee Nathees
8c3ad2af93 i18n: Fix parsing of multiple escapes before quotes
See https://github.com/godotengine/godot/pull/37114#issuecomment-601463765
2020-03-20 08:48:11 +01:00
Rémi Verschelde
4857648a16 i18n: Add support for translating the class reference
- Parse `.po` files from `doc/translations/*.po` like already done
  with `editor/translations/*.po`.
- Add logic to register a doc translation mapping in `TranslationServer`
  and `EditorSettings`.
- Add `DTR()` to lookup the doc translation mapping (similar to `TTR()`).
  Strings are automatically dedented and stripped of whitespace to ensure
  that they would match the translation catalog.
- Use `DTR()` to translate relevant strings in `EditorHelp`,
  `EditorInspector`, `CreateDialog`, `ConnectionsDialog`.
- Small simplification to `TranslationLoaderPO`, the path argument was
  not really meaningful.
2020-03-20 08:48:11 +01:00
Rémi Verschelde
256ac9a51d
Merge pull request #37039 from Chaosus/astar2d_cost
Implements estimate/compute_cost for AStar2D
2020-03-19 08:19:59 +01:00
Rémi Verschelde
a2d3ba3372 doc: Sync classref with current source
Fix wrong binding after #37111.
2020-03-18 09:14:57 +01:00
Ignacio Etcheverry
6a85cdf640 Fix C# bindings after recent breaking changes
Implementation for new Variant types Callable, Signal, StringName.
Added support for PackedInt64Array and PackedFloat64Array.

Add generation of signal members as events, as well as support for
user created signals as events.
NOTE: As of now, raising such events will not emit the signal. As such,
one must use `EmitSignal` instead of raising the event directly.

Removed old ThreadLocal fallback class. It's safe to use thread_local now since
it's supported on all minimum versions of compilers we support.
2020-03-17 16:30:04 +01:00
Rémi Verschelde
0159787864
Merge pull request #37111 from RandomShaper/imvu/unexpose_include_drive
Remove meaningless parameter from bindings
2020-03-17 14:52:43 +01:00
Pedro J. Estébanez
a69e88e467 Remove meaningless parameter from bindings 2020-03-17 14:32:03 +01:00
Rémi Verschelde
cb282c6ef0 Style: Set clang-format Standard to Cpp11
For us, it practically only changes the fact that `A<A<int>>` is now
used instead of the C++03 compatible `A<A<int> >`.

Note: clang-format 10+ changed the `Standard` arguments to fully
specified `c++11`, `c++14`, etc. versions, but we can't use `c++17`
now if we want to preserve compatibility with clang-format 8 and 9.
`Cpp11` is still supported as deprecated alias for `Latest`.
2020-03-17 07:36:24 +01:00
Rémi Verschelde
56175bb6fa
Merge pull request #36896 from kuruk-mm/doc_return_variant_2
Doctool and core: Fix return type in docs for some Variant methods...
2020-03-16 19:55:07 +01:00
Hugo Locurcio
05c95837cb
Tweak the invalid Unicode error message to be more descriptive
This closes #28503.
2020-03-16 18:55:34 +01:00
Yuri Roubinsky
bad77bcb52 Implements estimate/compute_cost for AStar2D 2020-03-14 18:01:06 +03:00
Rémi Verschelde
5002f6de84
Merge pull request #36599 from AndreaCatania/gen_rpc_data_export
Generates the rpc and rset info for exported GDScript.
2020-03-13 10:19:30 +01:00
Rémi Verschelde
36a414eb03
Merge pull request #36994 from akien-mga/typedefs-cleanup
typedefs: Cleanup unused macros and unnecessary checks
2020-03-12 22:02:18 +01:00
Rémi Verschelde
1c2f2a805d typedefs: Cleanup unused macros and unnecessary checks
We now require a compiler with C++17 support, so we don't need to
check for features added to GCC 5 or Clang 3.2.

Clang builtin availability checks were unused anyway as Clang defines
`__GNUC__` as it's also a GNU C implementation.

Fixes #36986.
2020-03-11 21:44:56 +01:00
luz.paz
7bf6e5f773 Fix various typos
Found via `codespell`
2020-03-11 13:59:18 -04:00
Rémi Verschelde
05d9d1c0e7
Merge pull request #36905 from Faless/js/restore_and_ci
Resurrect HTML5 platform, add it to CI (no rendering yet)
2020-03-11 07:31:16 +01:00
Rémi Verschelde
e1c3c6ba45 Fix -Wshadow=local warning in EngineDebugger 2020-03-10 10:24:23 +01:00
Mateo Miccino
64cd5d197d Doctool and core: Fix return type in docs for some Variant methods assigning PROPERTY_USAGE_NIL_IS_VARIANT to MethodInfo usage when we have something to return 2020-03-09 13:36:03 -03:00
Fabio Alessandrelli
b8ddaf9c33 Refactor ScriptDebugger.
EngineDebugger is the new interface to access the debugger.
It tries to be as agnostic as possible on the data that various
subsystems can expose.

It allows 2 types of interactions:

- Profilers:
  A subsystem can register a profiler, assigning it a unique name.
  That name can be used to activate the profiler or add data to it.
  The registered profiler can be composed of up to 3 functions:
    - Toggle: called when the profiler is activated/deactivated.
    - Add: called whenever data is added to the debugger
      (via `EngineDebugger::profiler_add_frame_data`)
    - Tick: called every frame (during idle), receives frame times.

- Captures: (Only relevant in remote debugger for now)
  A subsystem can register a capture, assigning it a unique name.
  When receiving a message, the remote debugger will check if it starts
  with `[prefix]:` and call the associated capture with name `prefix`.

Port MultiplayerAPI, Servers, Scripts, Visual, Performance to the new
profiler system.

Port SceneDebugger and RemoteDebugger to the new capture system.
The LocalDebugger also uses the new profiler system for scripts
profiling.
2020-03-08 12:36:39 +01:00
Fabio Alessandrelli
d0009636df ScriptDebuggerRemote use threads 2020-03-08 12:16:09 +01:00
Fabio Alessandrelli
74051c77dc Add TCP poll function (not exposed).
Used to know if we can read or write without blocking.
2020-03-08 12:16:09 +01:00
Fabio Alessandrelli
d96179be75 Fix mutex when building with no threads. 2020-03-08 01:53:13 +01:00
fhuya
f097defba1 Re-architecture of the Godot Android plugin. 2020-03-05 10:00:19 -08:00
Rémi Verschelde
42595085a5
Merge pull request #36752 from RandomShaper/rework_semaphore
Drop old semaphore implementation
2020-03-05 16:33:45 +01:00
Rémi Verschelde
f7c87ed3dd ConfigFile: Improve error messages and complete docs 2020-03-05 11:01:25 +01:00
Rémi Verschelde
e89754fa1f
Merge pull request #36021 from YeldhamDev/intersects_touch_expose
Turn Rect2's 'intersects_touch()' into an extra argument of 'intersects()'
2020-03-04 20:32:20 +01:00
Rémi Verschelde
080b5df625
Merge pull request #36682 from nekomatata/android-compilation-fix
Compilation fixes on Android
2020-03-04 16:22:16 +01:00
Rémi Verschelde
a0e33e17fb
Merge pull request #36733 from qarmin/static_analyzer_fixes
Fixes bugs found by Sonarcloud and Coverity
2020-03-04 13:41:38 +01:00
Michael Alexsander
8c8c48a7ad Turn Rect2's 'intersects_touch()' into an extra argument of 'intersects()' 2020-03-04 09:32:34 -03:00
Rémi Verschelde
f83f1d7c9b
Merge pull request #36069 from RandomShaper/imvu/improve_drives_ux
Improve UX of drive letters
2020-03-04 13:19:55 +01:00
Rémi Verschelde
2856740e6b
Merge pull request #36385 from kuruk-mm/some_static_asserts
Change when we can ERR_FAIL_COND and ERR_FAIL_CONV_V to static_assert
2020-03-04 13:18:48 +01:00
PouleyKetchoupp
ed0655cdfb Compilation fixes on Android 2020-03-04 13:15:37 +01:00
Rémi Verschelde
c7ab0de23a
Merge pull request #36783 from ThakeeNathees/error_macros.h-typo-fix
Typo: in error_macros.h fixed
2020-03-04 12:54:13 +01:00
Rémi Verschelde
59290f98ef
Merge pull request #36042 from sumit0190/exportInfNan
Read and write exported infs/nans correctly (#35388)
2020-03-04 10:19:52 +01:00
Mateo Dev .59
c933eb7acc Change when we can ERR_FAIL_COND and ERR_FAIL_CONV_V to static_assert 2020-03-04 04:44:47 -03:00
Thakee Nathees
08fef074c2 error_macros.h typo fixed 2020-03-04 10:35:31 +05:30
Pedro J. Estébanez
9a3a2b03b8 Drop old semaphore implementation
- Removed platform-specific implementations.
- Now all semaphores are in-object, unless they need to be conditionally created.
- Similarly to `Mutex`, provided a dummy implementation for when `NO_THREADS` is defined.
- Similarly to `Mutex`, methods are made `const` for easy use in such contexts.
- Language bindings updated: `wait()` and `post()` are now `void`.
- Language bindings updated: `try_wait()` added.

Bonus:
- Rewritten the `#ifdef` in `mutex.h` to meet the code style.
2020-03-03 13:20:42 +01:00
Pedro J. Estébanez
aee586553a Improve UX of drive letters
Namely, move the drive dropdown to just the left of the path text box and don't include the former
in the latter.

This improves the UX on Windows.

In the UNIX case, since its concept of drives is (ab)used to provide shortcuts to useful paths, its
dropdown is kept at the original location.
2020-03-03 10:38:34 +01:00
qarmin
1f209bfc41 Fixes bugs found by Sonarcloud and Coverity 2020-03-02 19:17:20 +01:00
Rémi Verschelde
e2b66cacf7
Merge pull request #18020 from bruvzg/input_fix_non_latin_and_add_hw_scancodes
Fix non-latin layout scancodes on Linux, adds access to physical scancodes.
2020-03-01 23:00:42 +01:00
Rémi Verschelde
0e25f54755
Merge pull request #36404 from rxlecky/fix-variant-conversion
Fix Variant to Vector<Variant> conversion operator
2020-03-01 09:30:28 +01:00
Rémi Verschelde
323ef1acdb
Merge pull request #36696 from Chaosus/fix_echo
Fix InputEventKey::echo property type from INT to BOOL
2020-03-01 09:28:01 +01:00
Rémi Verschelde
1ab695bf37
Merge pull request #36695 from clayjohn/ETC-mipmaps-4
Force mipmaps off when importing RGBA4444 textures
2020-03-01 08:29:42 +01:00
Yuri Roubinsky
5e3c64828a Fix InputEventKey::echo type from INT to BOOL 2020-03-01 09:52:37 +03:00
clayjohn
0c3af32d77 Force mipmaps off when importing RGBA4444 textures 2020-02-29 19:46:06 -08:00
Rémi Verschelde
16486a9055 doc: Sync classref with current source 2020-02-29 14:22:57 +01:00
Rémi Verschelde
620030b600
Merge pull request #36640 from reduz/resource-loader-refactor
Removed ResourceInteractiveLoader, add built-in threaded loading.
2020-02-28 17:21:16 +01:00
Juan Linietsky
475e4ea67b Removed interactive loader, added proper thread loading. 2020-02-28 11:20:45 -03:00
Rémi Verschelde
32ccf306f9 ConnectionsDock: Fix error when parsing CustomCallable connections 2020-02-28 14:32:36 +01:00
Rémi Verschelde
01afc442c7 Signals: Port connect calls to use callable_mp
Remove now unnecessary bindings of signal callbacks in the public API.
There might be some false positives that need rebinding if they were
meant to be public.

No regular expressions were harmed in the making of this commit.
(Nah, just kidding.)
2020-02-28 14:24:09 +01:00
Andrea Catania
33ae58710b Generates the rpc and rset info for exported GDScript.
Improved the send rpc log message when fail.

This work has been kindly sponsored by IMVU.
2020-02-28 12:39:18 +01:00
Pedro J. Estébanez
0115d88072 Fix shadowed variable build error 2020-02-28 11:02:20 +01:00
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
Rémi Verschelde
ed0f1940cb
Merge pull request #36579 from dreamsComeTrue/remove-refbase-reference
Remove friend reference to non-existing class RefBase
2020-02-27 14:48:01 +01:00
Andrea Catania
1afd60d8f5 Optimized rpc packet size when only the PackedByteArray is sent.
This work has been kindly sponsored by IMVU.
2020-02-27 08:19:59 +01:00
Dominik 'dreamsComeTrue' Jasiński
64cf691d32 Remove friend reference to non-existing class RefBase
Commit
7ad14e7a3e
removed RefBase class - but still there is hanging reference in....Reference :) class (no pun intended)
2020-02-26 22:36:40 +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