Commit graph

913 commits

Author SHA1 Message Date
reduz
8ab9b39707 Implement CanvasGroup and CanvasItem clipping
-Allows merging several 2D objects into a single draw operation
-Use current node to clip children nodes
-Further fixes to Vulkan barriers
-Changed font texture generation to white, fixes dark eges when blurred
-Other small misc fixes to backbuffer code.
2020-10-28 18:53:32 -03:00
Gilles Roudière
131a7b58c8 Fixes setting top_level not updating the global position 2020-10-27 13:44:35 +01:00
Hugo Locurcio
4dd5a17636
Fix uninitialized Viewport::use_debanding member variable 2020-10-26 21:37:33 +01:00
Rémi Verschelde
2de498d438
Merge pull request #42969 from Klowner/fixes/42967-popup-position
include parent display location in popup location calculation
2020-10-26 09:26:00 +01:00
reduz
84d734da0e Refactored 2D shader and lighting system
-Removed normal/specular properties from nodes
-Create CanvasTexture, which can contain normal/specular channels
-Refactored, optimized and simplified 2D shaders
-Use atlas for light textures.
-Use a shadow atlas for shadow textures.
-Use both items aboves to make light rendering stateless (faster).
-Reorganized uniform sets for more efficiency.
2020-10-24 15:57:25 -03:00
Mark Riedesel
5a507df255 include parent display location in popup location calculation 2020-10-21 12:58:39 -04:00
Juan Linietsky
85ebf40b6c
Merge pull request #38097 from Calinou/add-viewport-debanding
Add a debanding property to Viewport
2020-10-19 14:15:44 -03:00
reduz
ee06a70ea6 Refactor MethodBind to use variadic templates
Removed make_binders and the old style generated binders.
2020-10-18 12:28:44 +02:00
PouleyKetchoupp
4686200f0e Fix Popup crash in single window mode
focus_target->exclusive_child could be invalidated during the call to
focus_target->grab_focus(), now using the same logic with safe accesses
to focus_target.
2020-10-09 11:20:38 +02:00
Duroxxigar
4834e14493 Updated getters and setters names for toplevel 2020-10-02 19:09:01 -04:00
Rémi Verschelde
19f72beebb
Merge pull request #42451 from Duroxxigar/rename-toplevel
Renamed toplevel to be top_level
2020-10-02 10:57:23 +02:00
Rémi Verschelde
12091b39d2
Merge pull request #38743 from arrowinaknee/node-config-warnings
Update all get_configuration_warning() to retrieve warnings from the parent
2020-10-01 14:03:29 +02:00
Duroxxigar
b687ace7f9 Renamed toplevel to be top_level 2020-10-01 03:17:33 -04:00
Duroxxigar
85a8dbb7b6 Made toplevel a property for Node3D and CanvasItem 2020-10-01 02:43:30 -04:00
Rémi Verschelde
c217498aa6
Merge pull request #41895 from 11thPenguin/master
Fix minor typo, gui_hid -> gui_hide
2020-09-29 10:35:12 +02:00
Meriipu
e8804b9978 Make the currently hovered control get updated on mouse-release
Previously, when the mouse was released after dragging a scrollbar,
its highlight was not dropped (if the mouse cursor was still inside
the viewport). This seems to be because the currently hovered control
only gets updated when the mouse is moved.

This commit fixes the dropping of the cosmetic highlight by running
the check for whether the currently hovered control has changed on
mouse-clicks, in addition to to the existing mouse-movements.
2020-09-28 16:04:01 +02:00
Rémi Verschelde
7f24914b9e
Merge pull request #36374 from kuruk-mm/tilemap_filter_set_and_update
TileMap: Set texture_filter and texture_repeat to generated CanvasItems...
2020-09-15 17:15:09 +02:00
Rémi Verschelde
6f0fa8519f
Merge pull request #41776 from EricEzaM/PR/tooltip-bugfixes
Tooltip flickering and targeting fixes.
2020-09-15 10:24:17 +02:00
Eric M
07cb95bbda Tooltip flickering and targeting fixes. 2020-09-15 17:34:29 +10:00
Mateo Dev .59
bb7db2138b TileMap: Set texture_filter and texture_repeat to generated CanvasItems and update when it changes 2020-09-12 11:49:38 -03:00
Rémi Verschelde
a2a78a8066
doc: Sync classref with current source
Bind missing enums.
2020-09-11 12:22:10 +02:00
Yetizone
d12ddf6567 scene_tree.h: Update header guard 2020-09-10 17:20:50 +03:00
Jonah Stich
f6b14238c7 Fixed minor typo, gui_hid -> gui_hide. 2020-09-08 18:08:21 -07:00
Fabio Alessandrelli
2cb6b2ac6f
Merge pull request #38944 from Wavesonics/http-gzip
HttpRequest now handles gzipping response bodies
2020-09-07 17:03:19 +02:00
Meriipu
44657db3e2 If the mouse is held on notification_wm_mouse_exit, do not drop focus
This fixes a bug where users of the scrollbar had to be very careful
not to move the mouse outside the viewport, otherwise the scrollbar
would drop its drag-action and stop scrolling until clicked again.

The existing behaviour had the side-effect of also dropping the
cosmetic highlighting of the scrollbar (in addition to the dragging),
for the specific case where the mouse was move outside the window.
The previous behaviour did nothing to remove the highlight if the
mouse was released (but not moved) inside the viewport.

This separate issue with the lingering highlight of the scrollbar
(until a mouse-movement action is performed inside the viewport) is
fixed in an immediate followup to this commit.

Closes bug #39634
2020-09-07 04:11:27 +02:00
bruvzg
80b8eff6aa
[Complex Test Layouts] Change String to use UTF-32 encoding on all platforms. 2020-09-03 19:56:24 +03:00
Rémi Verschelde
2a8531cc56
Merge pull request #41456 from nekomatata/x11-fix-popups
Popup fixes for X11 display server
2020-09-03 00:09:19 +02:00
Adam Brown
6584db1538 HTTPRequest now accepts gzip
Added request_raw to HttpRequest
Added decompress_dynamic to Compression class
Added decompress_dynamic to BytePoolArray

Merge doc fix

revert
2020-09-02 12:59:59 -07:00
SekoiaTree
bdf614d3d7 Made get_child support negative indexes, with documentation 2020-09-01 11:34:36 +02:00
PouleyKetchoupp
bb306750ce Fix WINDOW_EVENT_FOCUS_IN for popups on Windows
On Windows, WINDOW_EVENT_FOCUS_IN was never sent by the display server
for popups, because WM_ACTIVATE events are received during the call to
_update_window_style, which happened before the callbacks were set.

This was causing some issues with the way Popup is now handling closing on
parent focus.

Now _update_window_style is only called during show_window, after Window
initialized callbacks.
2020-08-26 18:14:36 +02:00
PouleyKetchoupp
2b49cb0b73 Re-apply "Fixes for windows in X11 tiling WMs"
From PR #38727 which was reverted in #41373 because of regressions in Ubuntu
with Gnome.

Co-authored-by: Lorenzo Cerqua <lorenzocerqua@tutanota.com>
2020-08-22 18:42:42 +02:00
Juan Linietsky
9c5c1635b2
Revert "Fixes for windows in X11 tiling WMs" 2020-08-19 12:37:59 -03:00
Hugo Locurcio
8891579068
Add a debanding property to Viewport
It can be enabled in the Project Settings
(`rendering/quality/screen_filters/use_debanding`). It's disabled
by default as it has a small performance impact and can make
PNG screenshots much larger (due to how dithering works).
It will also slightly brighten the scene's dark areas.

As a result, it should be enabled only when banding is noticeable enough.

This closes #17006.
2020-08-14 23:12:33 +02:00
Tomasz Chabora
677796a2c3 Expose NOTIFICATION_POST_ENTER_TREE 2020-08-12 13:31:32 +02:00
George Marques
b8671b61fc
Fix _input being mistakenly called twice on script
Instead it calls both the script and the native method.
2020-08-03 08:40:08 -03:00
opl-
48d55e46d0 Fix window max_size acting as min_size 2020-07-31 17:38:34 +02:00
George Marques
5cbd032309
Fix input after removing multilevel calls 2020-07-27 15:23:57 -03:00
Rémi Verschelde
d7e00a20a6
Merge pull request #40724 from KoBeWi/weird_condition_🤔
Fix ultra long node names
2020-07-26 21:58:06 +02:00
Rémi Verschelde
3842e8c465
Merge pull request #38727 from Riteo/tiling-wm-issues-tests
Fixes for windows in X11 tiling WMs
2020-07-26 17:41:28 +02:00
Tomasz Chabora
d3f2062d86 Fix ultra long node names 2020-07-26 15:29:50 +02:00
George Marques
2b9d9bc364
Remove multilevel calls
In general they are more confusing to users because they expect
inheritance to fully override parent methods. This behavior can be
enabled by script writers using a simple super() call.
2020-07-24 14:13:58 -03:00
Lorenzo Cerqua
d670a49612 DisplayServer: separate window showing into another function
When creating a window, Godot would first register it to the WM(show it) and then set its flags.
This works fine on a floating WM, but on tiling WMs as soon as a window gets registered
the WM immediately acts on the window by scaling it up and treating it as a generic window,
being registered without any special flags.

This commit separates the showing of the window into another function and calls it after the most important flags are set,
making windows with special flags(eg. all popups) work again on tiling WMs.

Fixes #37930
2020-07-23 07:58:10 +02:00
Marcel Admiraal
26fcf2b04c Add override keywords. 2020-07-10 13:56:54 +01:00
bruvzg
9ffc1c19ad
Fix exclusive child focus grab, when there are more than two child windows. 2020-07-09 11:18:56 +03:00
bruvzg
df968d577a
[macOS] Implement seamless display scaling. 2020-07-04 10:36:33 +03:00
Rémi Verschelde
eeb61ec896
Merge pull request #40071 from reduz/fix-content-scale
Fix content scale mode, closes #37941
2020-07-03 07:50:50 +02:00
Juan Linietsky
ac7e9479ce Fix content scale mode, closes #37941 2020-07-02 17:16:13 -03:00
Juan Linietsky
d3adc53ad9 Ensure cursor shape changes when exiting window, fixes #37724 2020-07-02 14:17:46 -03:00
Rémi Verschelde
afe03e872b
Merge pull request #34926 from Xrayez/draw-transform-defaults
Provide `draw_set_transform` defaults for rotation and scale
2020-07-02 09:06:06 +02:00
Rémi Verschelde
0636e2a877
Merge pull request #40020 from reduz/fix-tree-edit-focus
Fix doubleclick on tree item, restore input focus on previous windows.
2020-07-02 07:26:13 +02:00
Juan Linietsky
39a77735bd Add ability to clamp embedded subwindows to parent, fixes #37792 2020-07-01 12:49:35 -03:00
Juan Linietsky
058166fb6c Fix doubleclick on tree item, restore input focus on previous windows.
Closes #37335
2020-07-01 12:46:39 -03:00
Andrii Doroshenko (Xrayez)
851c1050b2 Provide draw_set_transform defaults for rotation and scale 2020-07-01 18:09:11 +03:00
Juan Linietsky
239942cfef Ensure embedded mode works again
Also implemented application in/out notifications in X11.
2020-07-01 09:27:43 -03:00
Juan Linietsky
b19ab945ac Make dialogs exclusive by default, fixes #37732
Also fix on set_visible, not creating exclusive children as it should.
2020-06-30 14:02:37 -03:00
Juan Linietsky
438c380458 Add a separate application focus/in notification out from Window focus notification. 2020-06-30 10:40:06 -03: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
Rémi Verschelde
35414f1dec
Merge pull request #39053 from timoschwarzer/static-assert-variant-arg-max
Add static_assert checks where code assumes VARIANT_ARG_MAX == 5
2020-06-19 23:51:22 +02:00
Nathan Franke
dc1ca8fbd0
Change "ParentNode" to "Inherit" in Texture Options 2020-06-14 16:02:00 -05:00
Maganty Rushyendra
a2392039af Fix signal duplication bug when duplicating node with instanced children
Change error checking in `duplicate_signals()` to check for path to
`p_original`, thus adhering to the method used in `duplicate`, instead
of checking for ownership.
2020-06-09 21:24:05 +08:00
Timo Schwarzer
05b32fc01d
Add static_assert checks where code assumes VARIANT_ARG_MAX == 5 2020-05-25 21:55:03 +02:00
Rémi Verschelde
4c8832701b
Merge pull request #38695 from dreamsComeTrue/node-swap-order-arguments
Replace 'add_child_below_node' with 'add_sibling' in Node
2020-05-17 11:36:05 +02:00
unknown
634e9460b9 Fix popup window size calculation in popup_centered_ratio by using Rect2 2020-05-17 03:06:42 +05:30
ArrowInAKnee
9fc2b0fddc Update all get_configuration_warning to retrieve warnings from the parent 2020-05-16 16:07:42 +03:00
bruvzg
08e80ccd99
Fix popup positions on multiple screens (with same scaling only). 2020-05-16 14:11:43 +03:00
Dominik 'dreamsComeTrue' Jasiński
7f5c81c32f Replace 'add_child_below_node' with 'add_sibling' in Node
Fixes: #19642
2020-05-15 22:02:00 +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
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
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
Hugo Locurcio
3a11baaeac
Turn the anisotropic filtering setting into an enum
Since it only accepts power-of-two values, exposing it as an enum
makes more sense. This also allows for adding property hints to indicate
the performance cost of each value.

This also improves property hints for MSAA and FXAA.
2020-05-08 12:07:35 +02:00
Rémi Verschelde
f7ca1c805b doc: Sync classref with current source 2020-05-04 16:55:01 +02:00
Rémi Verschelde
878adb22b7
Merge pull request #37717 from qarmin/world_fix
Change non-existent World to World3D
2020-05-04 16:37:40 +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
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
Rémi Verschelde
b7b46093d8 doc: Sync classref with current source
Add missing enum bindings.
2020-04-20 11:48:00 +02:00
Rémi Verschelde
088c2a0870
Merge pull request #37947 from clayjohn/DOCS-rendering-update
Update many docs with recent rendering changes
2020-04-20 11:16:12 +02:00
qarmin
559bc3ca87 Change non-existent World to World3D 2020-04-18 11:00:51 +02:00
clayjohn
b50d954cb0 Update many docs with recent rendering changes 2020-04-17 09:47:59 -07:00
Juan Linietsky
0e1c66d9fc Implement global and per instance shader uniforms.
Adds two keywords to shader language for uniforms:
-'global'
-'instance'

This allows them to reference values outside the material.
2020-04-17 12:35:41 -03: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
Juan Linietsky
a57dc398db Implement MSAA 2020-04-12 15:33:57 -03:00
Juan Linietsky
16ae2cc1bf Add screen space AA option, with FXAA implementation. 2020-04-12 10:57:18 -03:00
Bastiaan Olij
afc8c6391c Renaming all ARVR nodes to XR 2020-04-09 15:33:01 +10: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
026ec44b02
Merge pull request #37551 from KoBeWi/found_your_screen
Add the missing argument in files_dropped signal
2020-04-07 09:18:38 +02:00
Rémi Verschelde
6b07c72d76
Merge pull request #37556 from KoBeWi/kill_get_index
Remove Node.get_position_in_parent()
2020-04-06 09:44:38 +02:00
Tomasz Chabora
c1023157eb Remove Node.get_position_in_parent() 2020-04-06 01:19:20 +02:00
Michael Alexsander
a9e43ac73c Re-expose a simplified version of the stretch properties in SubViewport 2020-04-03 14:11:22 -03:00
Tomasz Chabora
16cbfcf0de Add the missing argument in files_dropped signal 2020-04-03 17:33:53 +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
96e654335a
Merge pull request #37481 from ThakeeNathees/bind-method-typo
some typo in method binds fixed
2020-04-01 12:57:26 +02:00
Thakee Nathees
cb53b1d88e some typo in method binds fixed 2020-04-01 14:01:18 +05:30
Rémi Verschelde
e5033d3952 doc: Sync classref with DisplayServer/Window changes 2020-03-31 11:56:58 +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