Commit Graph

552 Commits

Author SHA1 Message Date
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
07cb95bbda Tooltip flickering and targeting fixes. 2020-09-15 17:34:29 +10:00
f6b14238c7 Fixed minor typo, gui_hid -> gui_hide. 2020-09-08 18:08:21 -07:00
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
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
5cbd032309 Fix input after removing multilevel calls 2020-07-27 15:23:57 -03:00
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
d3adc53ad9 Ensure cursor shape changes when exiting window, fixes #37724 2020-07-02 14:17:46 -03:00
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
39a77735bd Add ability to clamp embedded subwindows to parent, fixes #37792 2020-07-01 12:49:35 -03:00
058166fb6c Fix doubleclick on tree item, restore input focus on previous windows.
Closes #37335
2020-07-01 12:46:39 -03:00
239942cfef Ensure embedded mode works again
Also implemented application in/out notifications in X11.
2020-07-01 09:27:43 -03:00
438c380458 Add a separate application focus/in notification out from Window focus notification. 2020-06-30 10:40:06 -03:00
201d606b3d Addition of SDFGI for open world global illumination
Move GI to a deferred pass
2020-06-26 11:06:48 -03:00
9fc2b0fddc Update all get_configuration_warning to retrieve warnings from the parent 2020-05-16 16:07:42 +03:00
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
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
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
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
f7ca1c805b doc: Sync classref with current source 2020-05-04 16:55:01 +02:00
878adb22b7 Merge pull request #37717 from qarmin/world_fix
Change non-existent World to World3D
2020-05-04 16:37:40 +02:00
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
b7b46093d8 doc: Sync classref with current source
Add missing enum bindings.
2020-04-20 11:48:00 +02:00
559bc3ca87 Change non-existent World to World3D 2020-04-18 11:00:51 +02:00
b50d954cb0 Update many docs with recent rendering changes 2020-04-17 09:47:59 -07:00
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
16ae2cc1bf Add screen space AA option, with FXAA implementation. 2020-04-12 10:57:18 -03:00
afc8c6391c Renaming all ARVR nodes to XR 2020-04-09 15:33:01 +10:00
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
a9e43ac73c Re-expose a simplified version of the stretch properties in SubViewport 2020-04-03 14:11:22 -03:00
ea7b497065 Replace more occurrences of NULL with nullptr 2020-04-02 14:56:01 +02:00
95a1400a2a Replace NULL with nullptr 2020-04-02 13:38:00 +02:00
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
d1acbbce7f Rename more 2D and 3D nodes to follow convention
Rename editor plugins to match the new node names.
2020-03-27 16:26:34 +01:00
c3a760c507 Fix build with disable_3d=yes, remove dependency on WorldEnvironment 2020-03-27 14:55:14 +01:00
eaae4b6408 Renamed 2D and 3D nodes to make their types explicit
Fixes #30736.
2020-03-27 14:54:04 +01:00
9a5d15a2dc Implemented drag and drop across windows, both OS and embedded. 2020-03-26 15:49:46 +01:00
047e0b7de5 Reworked tooltips to use the popup system. 2020-03-26 15:49:45 +01:00
b3080bc2f4 Popups have also been converted to windows
Controls using the old modal API have been replaced to use popups.
2020-03-26 15:49:44 +01:00
c7b4dcae2f Open sub-windows as embedded if the OS does not support them 2020-03-26 15:49:43 +01:00
441f1a5fe9 Popups are now windows also (broken!) 2020-03-26 15:49:42 +01:00
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
9e08742de8 Added a Window node, and made it the scene root.
Still a lot of work to do.
2020-03-26 15:49:38 +01:00
f8a79a97c7 Effective DisplayServer separation, rename X11 -> LinuxBSD 2020-03-26 15:49:34 +01:00
4396e98834 Refactored Input, create DisplayServer and DisplayServerX11 2020-03-26 15:49:32 +01:00
760095e28d Clarify the Viewport size warning message 2020-03-17 22:47:20 +01:00
855f4dc193 Add size warning to Viewport Node 2020-03-17 21:33:39 +01:00
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
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
f742dabafe Signals: Manually port most of remaining connect_compat uses
It's tedious work...

Some can't be ported as they depend on private or protected methods
of different classes, which is not supported by callable_mp (even if
it's a class inherited by the current one).
2020-02-28 14:24:09 +01:00