Commit graph

3223 commits

Author SHA1 Message Date
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
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