Commit graph

1627 commits

Author SHA1 Message Date
Rémi Verschelde a8a2769bb6
Merge pull request #38713 from aaronfranke/string-64bit
Make all String integer conversion methods be 64-bit
2020-07-01 16:01:05 +02:00
Yuri Roubinsky c554d9e556 Added const qualifier support for function arguments in shaders 2020-07-01 12:55:00 +03:00
Rémi Verschelde 27605769c4
Merge pull request #35633 from Xrayez/physics-shape-property
Expose shape property for shape query parameters classes
2020-06-30 13:57:23 +02:00
Rémi Verschelde 5a33c77f0a
Merge pull request #39953 from neikeq/fix-missing-defval-regr-from-39827
Fix missing DEFVAL in RenderingDevice.storage_buffer_create
2020-06-30 09:40:43 +02:00
Rémi Verschelde 8e8699e36b
Merge pull request #39894 from madmiraal/fix-39768
Trigger broadphase update when changing collision layer/mask.
2020-06-29 21:34:45 +02:00
Ignacio Etcheverry 7c3ff85c71 Fix missing DEFVAL in RenderingDevice.storage_buffer_create 2020-06-29 17:13:09 +02:00
Juan Linietsky b1aa24ea3c Slight occlusion improvements. 2020-06-28 09:11:21 -03:00
Marcel Admiraal 79d3d3d17b Trigger broadphase update when changing collision layer/mask, and
check for collision layer/mask changes in 2D hash grid broadphase update.
2020-06-27 18:34:16 +01:00
Rémi Verschelde ff0583770a
Merge pull request #39869 from Chaosus/shader_fix_return
Prevents usage of return in main shader functions
2020-06-27 17:03:42 +02:00
Yuri Roubinsky 2ce77e4b57 Prevents usage of return in main shader functions 2020-06-27 17:36:45 +03:00
qarmin 997d367b51 Fixes recently introduced shader leaks 2020-06-27 15:08:20 +02:00
Juan Linietsky 201d606b3d Addition of SDFGI for open world global illumination
Move GI to a deferred pass
2020-06-26 11:06:48 -03:00
Andrii Doroshenko (Xrayez) da3fbc0296 Expose shape property for shape query parameters classes
Co-authored-by: PouleyKetchoupp <pouleyketchoup@gmail.com>
2020-06-26 16:54:05 +03:00
Yuri Roubinsky b6ca9536f2 Fix few places in shaders where const passing still incorrect 2020-06-25 10:40:19 +03:00
Marcel Admiraal 8ffe905c45 Check for motion in cast_motion() before doing Bullet convexSweepTest().
Also ensure that default closest_safe and closest_unsafe values are
defined in cast_motion() and before cast_motion() is called.
2020-06-21 16:20:26 +01:00
Yuri Roubinsky 636a9d9f50 Implemented global const array to shaders 2020-06-19 16:04:54 +03:00
Rémi Verschelde 93d79023ad
Merge pull request #39541 from Ev1lbl0w/feature/disable-rendering
Expose disable_render_loop property to GDScript
2020-06-16 20:48:41 +02:00
Ev1lbl0w 03879a564a
Expose disable_render_loop property to GDScript 2020-06-16 15:43:44 +01:00
Rémi Verschelde d3c10e8dd6
Merge pull request #39457 from bruvzg/kbd_layouts
Add keyboard layout enumeration / set / get functions.
2020-06-15 11:10:34 +02:00
Marcel Admiraal 62142c5416 Ensure pair callback data is set to null when it's null. 2020-06-13 14:43:25 +01:00
bruvzg 92352b1c23
Add keyboard layout enumeration / set / get functions (macOS, Windows, Linux/X11), remove latin variant function. 2020-06-13 11:02:00 +03:00
Marcel Admiraal a442526744 Test collision mask before creating constraint pair in Godot physics broadphase 2D and 3D. 2020-06-08 17:46:21 +01:00
jfons af3f9a854e Minor fix on GLSL shader parser 2020-06-06 19:53:16 +02:00
Marcel Admiraal b5e31b70dc Correct misspellings of damped spring. 2020-06-04 18:07:24 +01:00
Yuri Roubinsky 1a7e101324 Fix shader's length() function parsing in expressions 2020-06-03 19:39:48 +03:00
Aaron Franke e5ae89775a
Remove 32-bit String hex_to_int method 2020-06-03 00:03:34 -04:00
lawnjelly 61b3eb3b28 Light2D shadow mask construction fix
When using the default setting (layer 1 set only) nothing is stored in the tscn file for a Light2D, hence it relies on the value in the constructor.

The problem is the constructed value is 1 in Light2D, and -1 in RasterizerCanvas::Light. -1 results in all bits being set so all occluders are shown, rather than just those in layer 1.

This PR changes Rasterizer::Canvas constructor to set to 1. An alternative is to have -1 as the value for layer 1 throughout.

(cherry picked from commit bf54fa5a62)
2020-06-02 10:37:01 +02:00
Andrii Doroshenko (Xrayez) 69d5de632e Split Geometry singleton into Geometry2D and Geometry3D
Extra `_2d` suffixes are removed from 2D methods accoringly.
2020-05-27 14:28:34 +03:00
Rémi Verschelde 0b8cb945cf doc: Sync classref with current source 2020-05-20 15:29:37 +02:00
Rémi Verschelde aec07538f4
Merge pull request #38309 from SkyLucilfer/AndroidLineEdit
Fix Android LineEdit editing bugs
2020-05-20 11:45:59 +02:00
Rémi Verschelde ca3192d18a Style: Fix unnecessary semicolons that confused clang-format 2020-05-19 11:24:58 +02:00
Rémi Verschelde 37efaad8fb
Merge pull request #38816 from Faless/js/fix_audio_driver_4.0
AudioDriverJavaScript buffer size calculation.
2020-05-18 13:43:24 +02:00
Fabio Alessandrelli 90c7102b51 Move mix_rate, ouput_latency to AudioDriverManager
Each driver used to define the (same) project settings values
`audio/mix_rate` and `audio/output_latency`, but the setting names are
not driver specific.
Overriding is still possible via platform tags.
2020-05-18 13:02:06 +02:00
Rémi Verschelde c74d65cec8 GLSL: Change shader type specifier from [vertex] to #[vertex]
The added `#` prevents clang-format from misinterpreting the meaning
of this statement and thus messing up the formatting of the next
lines up until the first `layout` statement.

Similarly, a semicolon is now enforced on `versions` defines to
prevent clang-format from messing up formatting and putting them
all on a single line. Note: In its current state the code will
ignore chained statements on a single line separated by a semicolon.

Also removed some extraneous lines missed in previous style changes
or added by mistake with said changes (e.g. after uniform definitions
that clang-format messes up somewhat too, but we live with it).
2020-05-18 10:58:14 +02:00
SkyJJ cc473b948f Fix Android LineEdit editing bugs 2020-05-16 17:55:27 +02:00
Rémi Verschelde 0ee0fa42e6 Style: Enforce braces around if blocks and loops
Using clang-tidy's `readability-braces-around-statements`.
https://clang.llvm.org/extra/clang-tidy/checks/readability-braces-around-statements.html
2020-05-14 21:57:34 +02:00
Rémi Verschelde 07bc4e2f96 Style: Enforce separation line between function definitions
I couldn't find a tool that enforces it, so I went the manual route:
```
find -name "thirdparty" -prune \
  -o -name "*.cpp" -o -name "*.h" -o -name "*.m" -o -name "*.mm" \
  -o -name "*.glsl" > files
perl -0777 -pi -e 's/\n}\n([^#])/\n}\n\n\1/g' $(cat files)
misc/scripts/fix_style.sh -c
```

This adds a newline after all `}` on the first column, unless they
are followed by `#` (typically `#endif`). This leads to having lots
of places with two lines between function/class definitions, but
clang-format then fixes it as we enforce max one line of separation.

This doesn't fix potential occurrences of function definitions which
are indented (e.g. for a helper class defined in a .cpp), but it's
better than nothing. Also can't be made to run easily on CI/hooks so
we'll have to be careful with new code.

Part of #33027.
2020-05-14 16:54:55 +02:00
Rémi Verschelde 0be6d925dc Style: clang-format: Disable KeepEmptyLinesAtTheStartOfBlocks
Which means that reduz' beloved style which we all became used to
will now be changed automatically to remove the first empty line.

This makes us lean closer to 1TBS (the one true brace style) instead
of hybridating it with some Allman-inspired spacing.

There's still the case of braces around single-statement blocks that
needs to be addressed (but clang-format can't help with that, but
clang-tidy may if we agree about it).

Part of #33027.
2020-05-14 16:54:55 +02:00
Rémi Verschelde a1aaed5a84 Remove redundant void argument lists
Using clang-tidy's `modernize-redundant-void-arg`.
https://clang.llvm.org/extra/clang-tidy/checks/modernize-redundant-void-arg.html
2020-05-14 13:51:45 +02:00
Rémi Verschelde dcd1151d77 Enforce use of bool literals instead of integers
Using clang-tidy's `modernize-use-bool-literals`.
https://clang.llvm.org/extra/clang-tidy/checks/modernize-use-bool-literals.html
2020-05-14 13:45:01 +02:00
Rémi Verschelde 1a8167867b Modernize remaining uses of 0/NULL instead of nullptr (C++11)
Using clang-tidy's `modernize-use-nullptr`.
https://clang.llvm.org/extra/clang-tidy/checks/modernize-use-nullptr.html
2020-05-14 13:45:01 +02:00
Rémi Verschelde 1f6f364a56 Port member initialization from constructor to declaration (C++11)
Using `clang-tidy`'s `modernize-use-default-member-init` check and
manual review of the changes, and some extra manual changes that
`clang-tidy` failed to do.

Also went manually through all of `core` to find occurrences that
`clang-tidy` couldn't handle, especially all initializations done
in a constructor without using initializer lists.
2020-05-14 10:01:56 +02:00
Rémi Verschelde 092b2bd36f
Merge pull request #38691 from madmiraal/fix-eq-uninitialised-warning
Silence EQ::Band::c1, c2 and c3 may be used uninitialized warnings.
2020-05-12 11:50:50 +02:00
Marcel Admiraal d02143905f Silence EQ::Band::c1, c2 and c3 may be used uninitialized warnings. 2020-05-12 09:47:39 +01:00
qarmin d27f640a32 Fixes memory leak with lightmap part 2 2020-05-12 10:11:17 +02:00
qarmin 84867275bb Fix memory leak with light maps 2020-05-11 21:04:39 +02:00
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 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