Commit graph

454 commits

Author SHA1 Message Date
Duroxxigar b687ace7f9 Renamed toplevel to be top_level 2020-10-01 03:17:33 -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
Eric M 07cb95bbda Tooltip flickering and targeting fixes. 2020-09-15 17:34:29 +10:00
Jonah Stich f6b14238c7 Fixed minor typo, gui_hid -> gui_hide. 2020-09-08 18:08:21 -07: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
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
George Marques 5cbd032309
Fix input after removing multilevel calls 2020-07-27 15:23:57 -03: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
Juan Linietsky d3adc53ad9 Ensure cursor shape changes when exiting window, fixes #37724 2020-07-02 14:17:46 -03: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
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 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
ArrowInAKnee 9fc2b0fddc Update all get_configuration_warning to retrieve warnings from the parent 2020-05-16 16:07:42 +03: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 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 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
Rémi Verschelde b7b46093d8 doc: Sync classref with current source
Add missing enum bindings.
2020-04-20 11:48:00 +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 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 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
Michael Alexsander a9e43ac73c Re-expose a simplified version of the stretch properties in SubViewport 2020-04-03 14:11:22 -03: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
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 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
Rémi Verschelde c3a760c507 Fix build with disable_3d=yes, remove dependency on WorldEnvironment 2020-03-27 14:55:14 +01:00
Juan Linietsky eaae4b6408 Renamed 2D and 3D nodes to make their types explicit
Fixes #30736.
2020-03-27 14:54:04 +01:00
Juan Linietsky 9a5d15a2dc Implemented drag and drop across windows, both OS and embedded. 2020-03-26 15:49:46 +01:00
Juan Linietsky 047e0b7de5 Reworked tooltips to use the popup system. 2020-03-26 15:49:45 +01:00
Juan Linietsky 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
Juan Linietsky c7b4dcae2f Open sub-windows as embedded if the OS does not support them 2020-03-26 15:49:43 +01:00
Juan Linietsky 441f1a5fe9 Popups are now windows also (broken!) 2020-03-26 15:49:42 +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 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
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
Rasmus Vermeulen 760095e28d Clarify the Viewport size warning message 2020-03-17 22:47:20 +01:00
Rasmus Vermeulen 855f4dc193 Add size warning to Viewport Node 2020-03-17 21:33:39 +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
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
Rémi Verschelde 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
Juan Linietsky 33b5c57199 Variant: Added 64-bit packed arrays, renamed Variant::REAL to FLOAT.
- Renames PackedIntArray to PackedInt32Array.
- Renames PackedFloatArray to PackedFloat32Array.
- Adds PackedInt64Array and PackedFloat64Array.
- Renames Variant::REAL to Variant::FLOAT for consistency.

Packed arrays are for storing large amount of data and creating stuff like
meshes, buffers. textures, etc. Forcing them to be 64 is a huge waste of
memory. That said, many users requested the ability to have 64 bits packed
arrays for their games, so this is just an optional added type.

For Variant, the float datatype is always 64 bits, and exposed as `float`.

We still have `real_t` which is the datatype that can change from 32 to 64
bits depending on a compile flag (not entirely working right now, but that's
the idea). It affects math related datatypes and code only.

Neither Variant nor PackedArray make use of real_t, which is only intended
for math precision, so the term is removed from there to keep only float.
2020-02-25 12:55:53 +01:00
Juan Linietsky 69c95f4b4c Reworked signal connection system, added support for Callable and Signal objects and made them default. 2020-02-20 08:24:50 +01:00
Andrii Doroshenko (Xrayez) fa766265a7 Fix MIMPAMPS typos in constants throughout the engine 2020-02-20 01:31:43 +02:00
Juan Linietsky cf8c679a23 ObjectID converted to a structure, fixes many bugs where used incorrectly as 32 bits. 2020-02-12 14:24:54 -03:00
Juan Linietsky bed8980ca5 Re-implemented screen space ambient occlusion 2020-02-11 12:15:46 +01:00
Juan Linietsky bd364d1447 Auto exposure re-implemented in Vulkan 2020-02-11 12:14:23 +01:00
Juan Linietsky 6deffa62fb Several fixes to 3D rendering, and multimesh implementation. 2020-02-11 12:01:22 +01:00
Juan Linietsky 449df8f688 Base 3D engine done, still untested, though. 2020-02-11 11:59:25 +01:00
Juan Linietsky dc3b47f3ab Vulkan/RD rasterizer now does clean exit. 2020-02-11 11:58:16 +01:00
Juan Linietsky e1b3444415 Bugfixes and ability to better specify filter and repeat modes everywhere.
Removes antialiased flag for draw_* methods.
2020-02-11 11:53:28 +01:00
Juan Linietsky 1b4281b895 basic 2D engine is more or less working with Vulkan, including editor.
Still a lot to do
2020-02-11 11:53:27 +01:00
Juan Linietsky 3f335ce3d4 Texture refactor
-Texture renamed to Texture2D
-TextureLayered as base now inherits 2Darray, cubemap and cubemap array
-Removed all references to flags in textures (they will go in the shader)
-Texture3D gone for now (will come back later done properly)
-Create base rasterizer for RenderDevice, RasterizerRD
2020-02-11 11:53:26 +01:00
Marcel Admiraal 6d69cd40bd Add do..while(0) wrappers to macros without one.
- Add do..while(0) wrapper to ERR_FAIL_NULL macros.
- Add do..while(0) wrapper to ERR_FAIL_COND macros.
- Add do..while(0) wrapper to ERR_CONTINUE macros.
- Add do..while(0) wrapper to ERR_BREAK macros.
- Add do..while(0) wrapper to CRASH_COND macros.
- Add do..while(0) wrapper to ERR_FAIL macros.
- Add do..while(0) wrapper to ERR_PRINT macros.
- Add do..while(0) wrapper to WARN_PRINT macros.
- Add do..while(0) wrapper to WARN_DEPRECATED macros.
- Add do..while(0) wrapper to CRASH_NOW macros.
2020-02-05 11:19:12 +01:00
Rémi Verschelde ce75a2f33d
Merge pull request #33987 from nekomatata/own-world-environment
Viewport environment is updated properly when set to own world
2020-01-06 15:26:52 +01:00
Rémi Verschelde a7f49ac9a1 Update copyright statements to 2020
Happy new year to the wonderful Godot community!

We're starting a new decade with a well-established, non-profit, free
and open source game engine, and tons of further improvements in the
pipeline from hundreds of contributors.

Godot will keep getting better, and we're looking forward to all the
games that the community will keep developing and releasing with it.
2020-01-01 11:16:22 +01:00
Rémi Verschelde 3d6f991a17 Revert "Allow tab key to be used for shortcuts"
This reverts commit cafb888361.

Fixes #34405.
Reopens #8799, #24064.
2019-12-18 08:30:39 +01:00
Tomasz Chabora 77a8657633 Scroll ScrollContainer to focused children 2019-12-11 14:29:36 +01:00
PouleyKetchoupp dc13750189 Viewport environment is updated properly when set to own world
When own_world property is set, the viewport stores a unique resource for the world. With this change it keeps being updated from changes made to the world property instead of storing a default empty world with environment settings that can't be modified.

Fixes #23412
2019-11-29 11:50:10 +01:00
volzhs cdae65c4a6 Rename External MSAA to AndroidVR MSAA on Viewport property
following up f392c4ea7a
2019-11-20 03:02:11 +09:00
Rémi Verschelde 4b8feff594
Merge pull request #33518 from BastiaanOlij/msaa_ext_modes
Add MSAA mode for Quest
2019-11-11 11:46:50 +01:00
Bastiaan Olij 4e2343160c Add special external MSAA modes for GLES2 Rift S/Quest and OpenXR optimisation 2019-11-11 21:02:06 +11:00
Rémi Verschelde 8ffc56c3ca
Merge pull request #29579 from mrcdk/fix_29575
Drop the physics mouseover whenever a input has been handled.
2019-11-11 09:37:27 +01:00
Rémi Verschelde 621dc7022f
Merge pull request #27742 from rxlecky/camera-replication
Game camera override
2019-11-08 10:02:18 +01:00
Rémi Verschelde 2d3fcd0ff0
Merge pull request #30721 from NilsIrl/tab_key
Allow tab key to be used for shortcuts
2019-11-07 18:32:54 +01:00
Erik 8b0546d93b Implement game camera override
Implemented uniform API in Viewport class to override 2D and/or
3D camera.

Added buttons in 2D and 3D editor viewport toolbars that override
the running game camera transform with the editor viewport camera
transform. Implemented via remote debugger protocol and camera
override API.

Removed LiveEditFuncs function pointers from ScriptDebugger class.
Since the debugger got access to the SceneTree instance (if one
exists), there is no need to store the function pointers. The live
edit functions in SceneTree are used directly instead. Also removed
the static version of live edit functions in SceneTree for the same
reason. This reduced the SceneTree -> Debugger coupling too since
the function pointers don't need to be set from SceneTree anymore.

Moved script_debugger_remote.h/cpp from 'core/' to 'scene/debugger/'.
This is because the remote debugger is now using SceneTree directly
and 'core/' classes should not depend on 'scene/' classes.
2019-10-23 02:51:32 +01:00
PouleyKetchoupp e3d4b96ba7 Fixed crashes when renaming a state in AnimationNodeStateMachineEditor
Recursive calls to Control::_modal_stack_remove could cause a crash because of the list element not being invalidated while being erased from the list.

It happens in the state machine case by hiding a line edit control when it loses focus.

Fixes #23808
2019-10-22 16:28:11 +02:00
Michael Alexsander 82863b32de Make tooltips have the same scale as their Controls 2019-10-05 02:04:40 -03:00
Nils ANDRÉ-CHANG 0024dd7bb5 Merge branch 'master' into tab_key 2019-09-26 20:36:12 +01:00
Rémi Verschelde 351c45a461
Merge pull request #32047 from codecustard/fix_scrollwheel_triggering_focus_change
Fix scrollwheel triggering focus change
2019-09-25 15:23:47 +02:00
qarmin 17732fe698 Added some obvious errors explanations 2019-09-25 10:28:50 +02:00
Emmanuel Barroga b8007b3947 Fix scrollwheel triggering focus change
Clicking or using the scrollwheel outside of the focused control triggers a focus change. This makes sense for mouse clicks, but scrollwheeling outside the focuses control does not. This PR ignores scrollwheeling outside of the focused control.
2019-09-08 18:13:44 -07:00
PouleyKetchoupp 01c9ad1cdf Fixed UI navigation using joy axis inputs
Fixes #31879
2019-09-02 04:36:58 +02:00
Tomasz Chabora af5e0fff66 Remove ERR_EXPLAIN from scene/* code 2019-08-09 13:54:52 +02:00
Nils ANDRÉ-CHANG cafb888361 Allow tab key to be used for shortcuts 2019-07-20 22:32:49 +01:00
qarmin 6cbaf7662f Changed some code showed in LGTM and Coverage 2019-07-20 08:09:57 +02:00
Shiqing c16e764bb2 Fix #29478 multiple modals possibly freeze 2019-07-11 17:40:42 +08:00
Emmanuel Barroga 1eb9abd4c5 Fix issue with displaying empty tooltip hint
Closes #30448
2019-07-09 07:01:38 -07:00
Michael Alexsander Silva Dias 8255b88d11 Make 'size_override_stretch' a property in 'Viewport' 2019-07-05 22:57:03 -03:00
Rémi Verschelde 6b30f284a0
Merge pull request #29980 from Dentrax/directed-by-qarmin
Fix some editor crashes
2019-07-01 14:59:29 +02:00
Furkan Türkal 7d8d337b2c fix some crashes 2019-07-01 14:28:29 +03:00
qarmin 4e5310cc60 Some code changed with Clang-Tidy 2019-06-26 15:08:25 +02:00
Rémi Verschelde 5c66771e3e
Merge pull request #29283 from qarmin/fix_some_always_same_values
Remove always true/false values
2019-06-20 21:10:10 +02:00
qarmin 072e40368e Fix always true/false values 2019-06-20 16:59:48 +02:00
JohnJLight 38d3bfe971 Made use of semicolons more consitent, fixed formatting 2019-06-19 15:24:31 +02:00
MrCdK 1810a901d2 Drop the physics mouseover whenever a input has been handled.
Fixes #29575
2019-06-07 17:21:12 +02:00
Rémi Verschelde 62b868fd37
Merge pull request #26942 from RandomShaper/fix-vp-issues
Fix Viewport and Camera issues
2019-05-30 18:31:15 +02:00
clayjohn 65c211d303 Implement ability to render viewports directly to screen 2019-05-13 15:20:15 -07:00
James Buck bc7863775c Cancel tooltip when hiding the node it belongs to 2019-04-25 11:19:31 -05:00
Rémi Verschelde f25b057846 Fix disable_3d=yes -Wunused-variable errors 2019-04-20 11:07:58 +02:00
Hugo Locurcio 73ad31c0fa
Decrease the default tooltip delay to 0.5 seconds
This matches other applications' and OS' tooltip behaviors
more closely.
2019-04-10 19:45:29 +02:00
Pedro J. Estébanez 5b00cd89d3 Drop mouseover when mouse not in the window
Not that this is critical, but it makes behavior of GUI and 2D/3D picking consistent among them.

This also contributes to dropping GUI focus when the mouse leaves the window (in addition to when it loses focus).
2019-03-30 00:26:16 +01:00
Pedro J. Estébanez e3fc5fb1db Fix Viewport and Camera issues
1. Consider 'own_world' as well as 'world' to stop propagating enter/exit world notifications.
2. Clean & fix handling of camera currency.

This fixes some random crashes and error logs in the editor; namely
- when enabling/disabling own world in a Viewport;
- when switching back from a subscene displayed into a main scene's Viewport;
- when exiting the editor after any of them;
- memory corruption (can that explain certain other seemingly unrelated crash reports?).

This also fixes situations where a Viewport and its main Camera get out of sync about which World is relevant to them.
2019-03-30 00:25:26 +01:00
Rémi Verschelde 775e74e0d4
Merge pull request #26484 from Andrettin/Configurable-Tooltip-Offset
Make the Tooltip Position Offset Configurable
2019-03-13 20:12:22 +01:00
Rémi Verschelde bba854bac6
Merge pull request #26851 from RandomShaper/fix-26460-fake-event-flood
Fix fake null-motion mouse event flood
2019-03-09 22:40:53 +01:00
Pedro J. Estébanez f757460ec8 Fix fake null-motion mouse event flood
This commit also improves a bit the code quality by making the intent of fake events (and themselves) more explicit.

Fixes #26460.
2019-03-09 22:04:17 +01:00
Gilles Roudière ede5306d7c Fixes UI navigation with joysticks 2019-03-09 21:09:20 +01:00
Pedro J. Estébanez 82902656ac Improve/fix picking
Acknowledge mouse button events as position tellers (to make picking more solid; for instance, the touch mouse is raised with a mouse unpressed event that may have a more current position)
Forget mouse position for physics if touch mouse raised (because the position known as last is no longer meaningful)
Remove needless check for mouse over/exit (now there's code to inject an spurious move for cases where camera/objects have moved)
Restrict 2D mouse over/exit to mouse events (including emulated from touch; true touches shouldn't trigger the signals)

Fixes #26460.
2019-03-05 22:33:34 +01:00
Juan Linietsky 03cafd4895 Update focus mask only if there is a focused control, fixes #26524 2019-03-04 10:26:48 -03:00
clayjohn 95837049e8 hide hdr and shadow_contact in gles2 2019-03-02 19:01:26 -08:00
Andrettin 30c07c1ae1 Made the tooltip position offset configurable 2019-03-02 12:11:42 +01:00
Juan Linietsky 7f63b0e8cd Added a workaround to avoid crashes due to how TileSet editor works, fixes #23672
Also fixed a few uninitialized memory variables.
2019-02-22 17:42:29 -03:00
marxin 8d51618949 Add -Wshadow=local to warnings and fix reported issues.
Fixes #25316.
2019-02-20 19:44:12 +01:00
Marcelo Fernandez 761caac0b2 Fix possible crash with an invalid last_mouse_focus pointer 2019-02-14 22:16:56 -03:00
Rémi Verschelde 5fc86026ca Fix typos with codespell
Using codespell 1.14.0.

Method:
```
$ cat > ../godot-word-whitelist.txt << EOF
ang
doubleclick
lod
nd
numer
que
te
unselect
EOF
$ codespell -w -q 3 -I ../godot-word-whitelist.txt --skip="./thirdparty,*.po"
$ git diff // undo unwanted changes
```
2019-02-13 09:23:29 +01:00
Rémi Verschelde c5dcbeb160 Scene: Ensure classes match their header filename
Also drop some unused files.

Renamed:
- `scene/2d/navigation2d.h` -> `navigation_2d.h`
- `scene/2d/screen_button.h` -> `touch_screen_button.h`
- `scene/3d/scenario_fx.h` -> `world_environment.h`
- `scene/audio/audio_player.h` -> `audio_stream_player.h`
- `scene/resources/bit_mask.h` -> `bit_map.h`
- `scene/resources/color_ramp.h` -> `gradient.h`
- `scene/resources/shape_line_2d.h` -> `line_shape_2d.h`
- `scene/resources/scene_format_text.h` -> `resource_format_text.h`
- `scene/resources/sky_box.h` -> `sky.h`

Dropped:
- `scene/resources/bounds.h`
2019-02-12 17:21:48 +01:00
Juan Linietsky b203f80dfc Rewrite how font oversampling is updated more carefully, fixes #24338 2019-01-26 14:57:17 -03:00
Juan Linietsky 93d8f3cdd5 respect mouse mode when setting enter/exit notifications and signals, fixes #19785 2019-01-18 17:53:36 -03:00
Juan Linietsky 91290f0ded Added a flag to specify an exported node path must be supplied from scene root, fixes #24412 2019-01-14 15:46:56 -03:00
Rémi Verschelde b16c309f82 Update copyright statements to 2019
Happy new year to the wonderful Godot community!
2019-01-01 12:58:10 +01:00
Arjen van Staalduinen ef9313f415 fix near infinite loop when no previous mouse position
Added physics_has_last_mousepos to better deal with
situations where there is no last_mousepos
2018-12-19 13:35:41 +01:00
Konrad Nowakowski 7491e910f3 Fix touch release event on _gui_input 2018-12-14 18:28:11 +00:00
Rémi Verschelde bf59b73250
Merge pull request #20609 from YeldhamDev/menu_hover_explicit
Make opening menus with the same parent on mouse focus explicit
2018-12-09 23:15:33 +01:00
Guilherme Felipe 26c1af4848 Add missing validations
Add missing validations to prevent crash of multiple mouse buttons being
pressed
2018-12-02 22:38:54 -02:00
Guilherme Felipe ea6a5bb8fb Fix crash when multiple mouse buttons is pressed. 2018-12-01 11:25:43 -02:00
Juan Linietsky 167eb269ec Fixes crash, closes #24038 2018-11-28 13:10:23 -03:00
Juan Linietsky 39028cc161 Improved the mouse focus system (mouse keeps focus on a control while buttons are pressed). Fixes #19154 and likely many others.
WARNING: Test well in every OS, if mouse wheel events are not properly sent as pressed+unpressed pair, it will fail and break (and the OS needs to be fixed). Only tested on X11 so far.
2018-11-28 09:33:13 -03:00
Michael Alexsander Silva Dias da7d3c5a58 Make opening menus with the same parent on mouse focus explicit 2018-11-20 20:37:45 -02:00
Juan Linietsky 55ded6b2de Properly handle multiple parent drag, fixes #19460 2018-11-19 18:38:07 -03:00
Juan Linietsky 3331ececc4 Do not allow controls in ignore mouse to get focus via their children, fixes #17955 2018-11-16 13:47:21 -03:00
Juan Linietsky 80a90ca824 -Send mouse motion events again to CollisionObjects (Area/Body) if they move, even if mouse does not. Fixes #16536 (likely many others should check)
-Add ability for viewports to set input events as handled locally
2018-11-15 13:56:57 -03:00
Juan Linietsky daa1686772
Merge pull request #21386 from RandomShaper/fix-picking-in-canvas-layers
Fix picking in CanvasLayer
2018-11-07 17:51:27 -03:00
Juan Linietsky 65e3ef705b
Merge pull request #21962 from YeldhamDev/switch_hover_submenu
Fix MenuButton hover switching not happening with submenus open
2018-11-01 17:01:51 -03:00
Rémi Verschelde 9de724f327
Merge pull request #23091 from aaronfranke/mingw-warnings
Fix some compile warnings for Windows from Linux
2018-10-25 15:09:11 +02:00
Superwaitsum e5041ad0f5 Add some limits on the Editor Settings 2018-10-24 19:46:33 -05:00
Aaron Franke dc2e73499a Fix compile warnings for Windows from Linux
At least the ones I got when I compiled it using Mingw64 POSIX on Xubuntu 18.04. Plus use the Size2 of get_window_size() directly, rather than reconstructing it.
2018-10-19 09:11:14 -04:00
Rémi Verschelde d95bbb8922 Fix warnings about set but unused variables [-Wunused-but-set-variable]
Fixes the following GCC 5 warnings:
```
drivers/gles2/rasterizer_canvas_gles2.cpp:814:8: warning: variable 'rt_size' set but not used [-Wunused-but-set-variable]
drivers/gles2/rasterizer_scene_gles2.cpp:2270:11: warning: variable 'vp_height' set but not used [-Wunused-but-set-variable]
drivers/gles2/rasterizer_scene_gles2.cpp:2673:22: warning: variable 'e' set but not used [-Wunused-but-set-variable]
drivers/gles2/rasterizer_scene_gles2.cpp:715:7: warning: variable 'no_cull' set but not used [-Wunused-but-set-variable]
drivers/gles2/shader_gles2.cpp:693:14: warning: variable 'cc' set but not used [-Wunused-but-set-variable]
drivers/gles3/rasterizer_canvas_gles3.cpp:1226:8: warning: variable 'rt_size' set but not used [-Wunused-but-set-variable]
drivers/gles3/rasterizer_scene_gles3.cpp:3039:10: warning: variable 'contrib' set but not used [-Wunused-but-set-variable]
drivers/gles3/rasterizer_scene_gles3.cpp:4504:32: warning: variable 'vp_height' set but not used [-Wunused-but-set-variable]
editor/editor_inspector.cpp:272:9: warning: variable 'guide_color' set but not used [-Wunused-but-set-variable]
editor/editor_themes.cpp:1067:14: warning: variable 'alpha3' set but not used [-Wunused-but-set-variable]
editor/editor_themes.cpp:263:8: warning: variable 'script_bg_color' set but not used [-Wunused-but-set-variable]
editor/plugins/collision_shape_2d_editor_plugin.cpp:326:11: warning: variable 'cpoint' set but not used [-Wunused-but-set-variable]
editor/plugins/mesh_editor_plugin.cpp:72:9: warning: variable 'size' set but not used [-Wunused-but-set-variable]
editor/plugins/shader_editor_plugin.cpp:471:12: warning: variable 'mpos' set but not used [-Wunused-but-set-variable]
editor/plugins/shader_editor_plugin.cpp:89:8: warning: variable 'basetype_color' set but not used [-Wunused-but-set-variable]
editor/plugins/shader_editor_plugin.cpp:90:8: warning: variable 'type_color' set but not used [-Wunused-but-set-variable]
editor/plugins/shader_editor_plugin.cpp:92:8: warning: variable 'string_color' set but not used [-Wunused-but-set-variable]
modules/visual_script/visual_script_editor.cpp:2521:7: warning: variable 'seq_connect' set but not used [-Wunused-but-set-variable]
platform/android/export/export.cpp:580:12: warning: variable 'styles_count' set but not used [-Wunused-but-set-variable]
platform/android/export/export.cpp:584:12: warning: variable 'styles_offset' set but not used [-Wunused-but-set-variable]
platform/osx/export/export.cpp:464:9: warning: variable 'zerr' set but not used [-Wunused-but-set-variable]
scene/2d/tile_map.cpp:260:10: warning: variable 'tcenter' set but not used [-Wunused-but-set-variable]
scene/3d/light.cpp:166:7: warning: variable 'editor_ok' set but not used [-Wunused-but-set-variable]
scene/3d/navigation.cpp:566:11: warning: variable 'closest_navmesh' set but not used [-Wunused-but-set-variable]
scene/gui/rich_text_label.cpp:869:8: warning: variable 'size' set but not used [-Wunused-but-set-variable]
scene/main/viewport.cpp:705:14: warning: variable 'xform' set but not used [-Wunused-but-set-variable]
scene/main/viewport.cpp:706:8: warning: variable 'ss' set but not used [-Wunused-but-set-variable]
scene/main/viewport.cpp:726:14: warning: variable 'xform' set but not used [-Wunused-but-set-variable]
scene/main/viewport.cpp:727:8: warning: variable 'ss' set but not used [-Wunused-but-set-variable]
scene/resources/material.cpp:430:7: warning: variable 'using_world' set but not used [-Wunused-but-set-variable]
servers/visual/shader_language.cpp:2026:7: warning: variable 'all_const' set but not used [-Wunused-but-set-variable]
servers/visual/visual_server_scene.cpp:1383:28: warning: variable 'z_max_cam' set but not used [-Wunused-but-set-variable]
```

Also fixes two [-Wunused-value] warnings:
```
scene/gui/text_edit.cpp:4405:20: warning: statement has no effect [-Wunused-value]
servers/visual/visual_server_scene.cpp:905:48: warning: value computed is not used [-Wunused-value]
```

Some of those are bugs and need further work, they are identified with
`// FIXME` comments.
2018-09-27 16:25:24 +02:00
Michael Alexsander Silva Dias 585ad5c8ea Expose "get_modal_stack_top()" to GDScript 2018-09-14 16:35:52 -03:00
Rémi Verschelde 277b24dfb7 Make core/ includes absolute, remove subfolders from include path
This allows more consistency in the manner we include core headers,
where previously there would be a mix of absolute, relative and
include path-dependent includes.
2018-09-12 09:52:22 +02:00
Michael Alexsander Silva Dias 592eda7ad9 Fix MenuButton hover switching not happening with submenus open 2018-09-11 01:44:19 -03:00
Pedro J. Estébanez 6d0f4a4ad7 Fix picking in CanvasLayer
New APIs in 2D physics allow intersection queries filtered by CanvasLayer object instance id. Viewport keep an inventory of its descendant CanvasLayers and takes advantage of all that to test picking with the mouse/touch position correctly transformed for each CanvasLayer.
2018-08-25 00:03:26 +02:00
Juan Linietsky 683c3f2fcf Avoid misuse of set_drag_preview() function where it shouldn't be. Closes #20100 2018-08-24 10:30:11 -03:00
Rémi Verschelde 52466d57e9 Make some debug prints verbose-only, remove others 2018-08-24 14:59:01 +02:00
Juan Linietsky ee07fb5ebe Changes to ClippedCamera, RayCast,Raycast2D and 2D physics API to add ability to choose between bodies and areas when colliding. 2018-08-21 15:31:23 -03:00
Ibrahn Sahir 1626ae6421 fixed uninitialised variable that was causing menu crash. 2018-07-28 18:09:47 +01:00
Guilherme Felipe d1f5deabd8 Opens the menu with the same parent on mouse focus 2018-07-24 19:59:40 -03:00
Juan Linietsky 336db8bcd1 -Fix tooltips in inspector, now they show as rich text. 2018-07-20 18:16:19 -03:00
Max Hilbrunner a8a318161b
Merge pull request #19015 from toger5/fixed_scrolling_with_trackpad_in_new_inspector
fixed scrolling in new ispector when using trackpad pan gesture
2018-07-05 00:22:06 +02:00
Juan Linietsky 085483e885 -Fix fullscreen on Windows with a HiDPI monitor but a non-HiDPI project
-Replaced some viewport size calls to screen size, since viewport size should be deprecated at this point..
2018-07-03 18:53:27 -03:00