Commit graph

953 commits

Author SHA1 Message Date
Marcel Admiraal 2a74b388d0 Split OS::execute into two methods
1. execute(): Executes a command and returns the results.
2. create_process(): Creates a new process and returns the new process' id.
2021-01-09 10:03:23 +00:00
Rémi Verschelde b5334d14f7
Update copyright statements to 2021
Happy new year to the wonderful Godot community!

2020 has been a tough year for most of us personally, but a good year for
Godot development nonetheless with a huge amount of work done towards Godot
4.0 and great improvements backported to the long-lived 3.2 branch.

We've had close to 400 contributors to engine code this year, authoring near
7,000 commit! (And that's only for the `master` branch and for the engine code,
there's a lot more when counting docs, demos and other first-party repos.)

Here's to a great year 2021 for all Godot users 🎆
2021-01-01 20:19:21 +01:00
Hugo Locurcio 5cd37de125
Fix warning spam when using --help or --version command line argument
When a project setting is not found, a warning message is printed.
This moves the default value declaration so it can be found when
the `--help` or `--version` command line arguments are used.
2020-12-29 22:52:16 +01:00
Marcel Admiraal d9e9eb8d04 Rename MainLoop methods to match Node methods 2020-12-22 12:34:57 +00:00
Hugo Locurcio 341b9cf15a
Add a project setting to enable stdout flushing in release builds
This can be used in server builds for journalctl compatibility.
2020-12-15 16:40:52 +01:00
reduz e93b2242c2 Reorganize rendering server.
-Made RenderingServerScene abstract, allowing reimplementation
-RenderingServerRaster -> RenderingServerDefault, but this class is going away soon.
2020-12-03 19:01:01 -03:00
Thakee Nathees 42bfa16996 Refactor DocData into core and editor (DocTools) parts 2020-12-02 00:48:39 +05:30
bruvzg 99666de00f
[Complex Text Layouts] Refactor Font class, default themes and controls to use Text Server interface.
Implement interface mirroring.
Add TextLine and TextParagraph classes.
Handle UTF-16 input on macOS and Windows.
2020-11-26 14:25:48 +02:00
bruvzg 493da99269
[Complex Text Layouts] Implement TextServer interface. Implement Fallback TextServer. 2020-11-26 13:55:26 +02:00
Rémi Verschelde 2ca1c17a5c
Merge pull request #43661 from EricEzaM/PR/INP2-rename_load_from_globals
load_from_globals() -> load_from_project_settings()
2020-11-19 07:40:21 +01:00
Eric M e5376fb129 load_from_globals() -> load_from_project_settings() 2020-11-19 09:21:21 +10:00
Jordan Schidlowsky e9527d0353 allow vulkan validation layers in release builds if explicity asked for 2020-11-18 14:07:28 -06:00
Fabio Alessandrelli 032a1c5dc3 Fix CLI export when export_path is in preset.
Export presets contains the export_path option, to specify the default
export location, but the CLI export option disregarded that, and always
required and export path to be specified.
After this commit, if the export path is not specified in the command,
the one in the preset will be used, erroring only if it's not present or
invalid.
2020-11-17 18:26:03 +01:00
Aaron Franke 02161aad5a
Remove empty lines around braces with the formatting script 2020-11-16 23:38:11 -05:00
Rémi Verschelde d7176e9040
Merge pull request #42167 from madmiraal/fix-42108
Remove the unnecessary sync() and the restrictions it imposes on 3D Physics.
2020-11-16 09:32:48 +01:00
Rémi Verschelde 5d89b1ad43
Merge pull request #43369 from Calinou/allow-svg-project-icon
Allow using SVG images as project icon
2020-11-10 09:37:18 +01:00
reduz 127458ed17 Reorganized core/ directory, it was too fatty already
-Removed FuncRef, since Callable makes it obsolete
-Removed int_types.h as its obsolete in c++11+
-Changed color names code
2020-11-07 20:17:12 -03:00
Hugo Locurcio 0f9432f060
Allow using SVG images as project icon
Since exporters will save their own icon, the target platforms
don't have to support SVG to display the icon correctly.

This closes #23068.
2020-11-06 23:09:44 +01:00
reduz f2397809a8 Refactored Variant Operators.
-Using classes to call and a table
-For typed code (GDS or GDNative), can obtain functions to call prevalidated or ptr.
2020-11-06 12:45:50 -03:00
reduz 0e6664539d Refactor pixel snapping.
-Rename pixel_snap to snap_2d_to_vertices
-Added snap_2d_to_transforms which is more useful

Fixes #41814
Solves proposal https://github.com/godotengine/godot-proposals/issues/1666
Supersedes #35606, supersedes #41535, supersedes #41534
2020-10-30 08:57:32 -03:00
Rémi Verschelde 2eaedcf14e
Merge pull request #42361 from akien-mga/vulkan-layers-opt-in
Vulkan: Make validation layers optional
2020-10-28 21:43:22 +01:00
Rémi Verschelde 4960894880
Update AUTHORS and DONORS list
New corporate sponsors:
  Spiffcode (Platinum)
  ASIFA-Hollywood (Silver)
  Zenva Academy (Silver)

Thanks to all contributors and donors for making Godot possible!
2020-10-28 14:06:22 +01:00
Rémi Verschelde 54e6338c9b
Vulkan: Make validation layers optional
They're now disabled by default, and can be enabled with the command line
argument `--vk-layers`.

When enabled, the errors about them being missing are now warnings, as
users were confused and thought this meant Vulkan is broken for them.

Fix crash in `~VulkanContext` when validation layers are disabled (exposed by
this PR since before they could not be disabled without source modification).

Also moved VulkanContext member initializations to header.

Fixes #37102.
2020-10-27 16:19:15 +01: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
Sergey Minakov 1d9b6b01db iOS: move touch delay to settings 2020-10-01 12:36:11 +03:00
Rémi Verschelde 819c3524a5
OS: Remove unused get_splash_tick_msec
It was added in 3e20391bf6 but it doesn't seem
particularly useful, and it was only implemented for the custom splash branch
and not the default one, so it could return an uninitialized int.
2020-09-24 15:40:30 +02:00
Fabio Alessandrelli f3c6ac1d71 Ignore thread models when compiling with NO_THREAD
The thread model option for physics (2D) and rendering (single-unsafe,
single-safe, multithread), was causing crashes/locks when set as
multithreaded and exported for a platform that does not support threads
(namely HTML5).

This commit ensures that when threads support is not available, that
option is ignored, and the equivalent of "single-unsafe" is always used
instead.
2020-09-23 11:24:01 +02:00
Marcel Admiraal 41209efa7f Remove the unnecessary sync() and the restrictions it imposes on 3D Physics. 2020-09-18 10:43:31 +01:00
Rémi Verschelde 92d1964d1a
Donors: Add Gamblify, remove Interblock from splash screen 2020-09-16 16:10:35 +02:00
Marcel Admiraal e3d698dae9 Remove unused Python imports. 2020-09-10 11:38:52 +01:00
Rémi Verschelde a77106bf7e
Merge pull request #41332 from bruvzg/win_subsys_option
Revert #41164, add subsystem build option.
2020-09-03 11:52:29 +02:00
Rémi Verschelde 358e209fa0
Merge pull request #41190 from Xrayez/main-loop-type-class
Accept global classes  for `MainLoop` type in project settings
2020-09-02 11:52:56 +02:00
Marcel Admiraal 5f092cf7bb Fix new black style check failures in various files. 2020-08-21 16:51:30 +01:00
bruvzg 03ffd6451a
Revert "[Windows] Attach to parent console instead of creating new one."
This reverts commit 4f7a49db53.
2020-08-17 19:05:48 +03:00
Andrii Doroshenko (Xrayez) 6f426c3360 Port ClassDB tests to use doctest
Extracted the most minimal core initialization functionality from
`setup()` and `setup2()` so that `ClassDB` could be tested properly
(input, audio, rendering, physics etc, are excluded).

Display and rendering servers/singletons are not initialized at all.

Due to the fact that most subsystems are disabled, fixed various crashes in the
process (in order):
- `AcceptDialog` OK/cancel swap behavior (used `DisplayServer` while
  `register_scene_types()`);
- `make_default_theme` which depends on `RenderingServer`;
- `XRServer` singleton access while calling `register_modules_types()`;
- hidden bug in a way joypads are cleaned up (MacOS and Linux only).

Removed manual `ClassDB` init/cleanup calls from `test_validate_testing.h`.

ClassDB tests:

Co-authored-by: Ignacio Etcheverry <ignalfonsore@gmail.com>
2020-08-16 16:41:02 +03:00
bruvzg 9d1cf0b6af
Fix "on top" incorrectly set on init (all platforms).
Fix "on top" reseting on window update. (macOS).
2020-08-15 17:53:18 +03:00
Rémi Verschelde 33b2070d2e Remove obsolete GLES2 backend code
This code currently isn't compiled (and cannot compile).

We plan to re-add OpenGL ES-based renderer(s) in Godot 4.0 alongside Vulkan
(probably ES 3.0, possibly also a low-end ES 2.0), but the code will be quite
different so it's not relevant to keep this old Godot 3.2 code.

The `drivers/gles2` code from the `3.2` branch can be used as a reference for
a potential new implementation.
2020-08-13 10:04:53 +02:00
Andrii Doroshenko (Xrayez) 871b1d76d2 Accept global classes for MainLoop type in project settings
`application/run/main_loop_type` setting can handle custom global
classes (`class_name`).  For instance: `MySceneTree`.

The setting's default is changed from empty to `SceneTree` as to give
some hint of what kind of input is accepted for the main loop type.
2020-08-11 20:20:30 +03:00
Rémi Verschelde 0e751ea7c3
Merge pull request #41164 from bruvzg/win_attach_console
[Windows] Attach to parent console instead of creating new one.
2020-08-11 12:58:12 +02:00
bruvzg 4f7a49db53
[Windows] Attach to parent console instead of creating new one. 2020-08-11 13:02:50 +03:00
Andrii Doroshenko (Xrayez) 6a495f4d04 Properly detect --test command-line argument
Do not prematurely parse anything which beings with `--test`
to run doctest. This allows other commands to be run, such as
`--test-gdscript` or other custom arguments.
2020-08-08 21:54:23 +03:00
Andrii Doroshenko (Xrayez) 63720648e8 Cleanup obsolete tests from displaying in help 2020-07-29 15:07:16 +03:00
Aaron Franke 56e2c6c704
Make all String float conversion methods be 64-bit 2020-07-27 18:38:53 -04:00
Andrii Doroshenko (Xrayez) d86de6c98e SCons: Refactor running commands through builders
A new `env.Run` method is added which allows to control the verbosity
of builders output automatically depending on whether the "verbose"
option is set. It also allows to optionally run any SCons commands in a
subprocess using the existing `run_in_subprocess` method, unifying
the interface. `Action` objects wrap all builder functions to include a
short build message associated with any action.

Notably, this removes quite verbose output generated by `make_doc_header`
and `make_editor_icons_action` builders.
2020-07-28 00:09:21 +03:00
Rémi Verschelde a3a980eb0d SCons: Build tests/ and main/ in cloned environments
Allows switching `tests=yes`/`no` and rebuilding only tests and main,
instead of the whole engine.

Co-authored-by: Andrii Doroshenko (Xrayez) <xrayez@gmail.com>
2020-07-26 16:03:11 +02:00
Andrii Doroshenko (Xrayez) 9f649efe5d Move tests to the top-level directory 2020-07-26 00:06:07 +03:00
Rémi Verschelde 6f292f906e
Merge pull request #38900 from bruvzg/docs_ignore_os_spec_def_vals
Docs: Ignore OS specific values (constants, project settings, properties)
2020-07-25 18:54:25 +02:00
Andrii Doroshenko (Xrayez) f6465f46b4 SCons: Add tests option to enable or disable unit tests 2020-07-25 18:44:18 +03:00
Gordon MacPherson a55b10a053 fix crash on shutdown 2020-07-24 14:48:14 +01:00
Gordon MacPherson 2bdbdc4702 Fix arguments always being found and returned some items back to normal 2020-07-24 14:16:02 +01:00
RevoluPowered 579342810f t Add unit testing to Godot using DocTest and added to GitHub Actions CI
Implements exit codes into the engine so tests can return their statuses.
Ideally we don't do this, and we use FIXUP logic to 'begin' and 'end' the engine execution for tests specifically.

Since realistically we're initialising the engine here we don't want to do that, since String should not require an engine startup to test a single header.

This lowers the complexity of running the unit tests and even for
physics should be possible to implement such a fix.
2020-07-24 13:05:33 +01:00
George Marques 5d6e853806
New GDScript tokenizer and parser
Sometimes to fix something you have to break it first.

This get GDScript mostly working with the new tokenizer and parser but
a lot of things isn't working yet. It compiles and it's usable, and that
should be enough for now.

Don't worry: other huge commits will come after this.
2020-07-20 11:38:39 -03:00
bruvzg 0181c3dde1
Docs: Ignore OS specific values (constants, project settings, properties). 2020-07-15 12:24:59 +03:00
Hugo Locurcio b89dc6ae00 Disable file logging for the project manager
Due to `user://` returning the current working directory when no
project is open, this caused logs to be written to `$HOME`
most of the time.

This closes #40305.
2020-07-14 12:42:51 +02:00
Rémi Verschelde 28e8347d6c
Merge pull request #40354 from bruvzg/add_vulkan_init_message
Display error popup instead of crashing if Vulkan init failed.
2020-07-14 09:03:25 +02:00
Aaron Franke 9986439352
Commit other files changed by file_format.sh 2020-07-13 14:14:11 -04:00
bruvzg 996910b627
Add error messages if Vulkan init failed, prevent Vulkan context freeing uninitialized device and instance. 2020-07-13 19:24:21 +03:00
Marcel Admiraal 26fcf2b04c Add override keywords. 2020-07-10 13:56:54 +01:00
Rémi Verschelde aeccd1e287
Merge pull request #40121 from Calinou/enable-file-logging
Enable file logging by default on desktops to help with troubleshooting
2020-07-10 11:02:57 +02:00
PouleyKetchoupp b2d27214aa Keep debug & verbose options after loading project from project manager 2020-07-09 09:51:32 +02:00
Hugo Locurcio 20af28ec06
Enable file logging by default on desktops to help with troubleshooting
- Use the `.log` file extension (recognized on Windows out of the box)
  to better hint that generated files are logs. Some editors provide
  dedicated syntax highlighting for those files.
- Use an underscore to separate the basename from the date and
  the date from the time in log filenames. This makes the filename
  easier to read.
- Keep only 5 log files by default to decrease disk usage in case
  messages are spammed.
2020-07-08 18:57:25 +02:00
George Marques 9654365547
Add a map of autoloads to ProjectSettings
So places that need to look into it can use the list instead of parsing
ProjectSettings details (like checking "*" in path for testing if it's
singleton).
2020-07-06 12:35:51 -03:00
Aaron Franke 5c21732da1
Fix string test code for MinGW 2020-07-05 04:57:21 -04:00
Rémi Verschelde c020eea184
Merge pull request #40092 from hinlopen/remove-find-last
Remove String::find_last (same as rfind)
2020-07-04 01:38:01 +02:00
Stijn Hinlopen 929b98d24b Remove String::find_last (same as rfind) 2020-07-03 15:26:22 +02:00
Juan Linietsky ac7e9479ce Fix content scale mode, closes #37941 2020-07-02 17:16:13 -03:00
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
Rémi Verschelde 58be2887f7
Merge pull request #36885 from Xrayez/doctool-err-msg
Fix doctool misleading error message
2020-07-01 15:10:09 +02:00
Fabio Alessandrelli 1b6e3458b2 Move frame delaying functions from Main to OS.
Will allow specific platforms to override it and avoid blocking on the
main/GUI thread.
2020-06-30 19:39:09 +02:00
simpu bfadb882b1 Added Custom Performance Monitor and feature to read intermediate values of Monitor
Custom monitors can be added/removed/checked using `Performance.add_custom_monitor`/`Performance.remove_custom_monitor`/`Performance.has_custom_monitor`

The value can be viewed in the `Monitor` tab of Debugger.

Text before `/` is used to categorize the custom monitor.

`EditorPerformanceProfiler` class is created to separate logic from `ScriptEditorDebugger`

User can click on the graph of monitors to read the value at that point.

Graph includes intermediate base lines.
2020-06-29 17:20:29 +05:30
Rémi Verschelde 23f7f86914 Style: Fix copyright headers 2020-06-25 16:33:44 +02:00
Rémi Verschelde 4dede9e644
Merge pull request #36052 from Calinou/improve-low-processor-sleep
Improve the low processor mode sleep precision
2020-06-24 23:14:05 +02:00
Rémi Verschelde 6480efba45 Main::cleanup: Move MessageQueue deletion further down where it's safer
Partial revert of #15702 which triggered the issue.

Fixes #39786.
2020-06-24 16:58:18 +02:00
Rémi Verschelde 2b6bbf8dce Mono: Always define options in main.cpp to keep them in docs
Otherwise generating docs with non-Mono builds removes them,
which is not so convenient for the documentation work.
2020-06-18 12:06:24 +02: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
Hugo Locurcio a9c60007a9 Add a suffix to the window title when running from a debug build
Since projects started from the editor or exported in debug mode
run slower than those exported in release mode, this should be
clearly presented to the user.

This partially addresses #20219.
2020-06-16 11:39:37 +02:00
Rémi Verschelde 6f938c761e
Merge pull request #39483 from AndreaCatania/euler
Added more euler rotation orders support.
2020-06-15 20:38:11 +02:00
Hugo Locurcio 1c28b269d8
Improve the low processor mode sleep precision
The Low Processor Usage Mode Sleep Usec setting is now used as a
FPS limiter rather than a constant sleep duration.

This will increase CPU/GPU usage slightly due to the higher
effective FPS, but the increase in overall smoothness is worth it.

If both Force Fps and Low Processor Usage Mode settings are enabled
in the project settings, only the setting that causes the highest
sleep duration will be retained.

This closes #11030.
2020-06-15 19:30:39 +02:00
Rémi Verschelde de9d43ae0f Main: Ensure existing of user data dir in setup()
When it was in `setup2()`, it would arrive too late for the optional file
logging feature.

Fixes #32488.
2020-06-15 14:33:39 +02:00
Andrea Catania 2331300989 - Added more euler rotation orders support.
- Fixed floating point issue on the old one.
- Fixed the equation on the get_euler_yxz function.
- Added unit tests.

This work has been kindly sponsored by IMVU.
2020-06-12 20:03:27 +02:00
Aaron Franke bb8aa107fd
Remove 32-bit String to_int method 2020-06-03 00:03:34 -04:00
Rémi Verschelde 1620669f4e
Merge pull request #39051 from Xrayez/geometry-split
Split `Geometry` singleton into `Geometry2D` and `Geometry3D`
2020-05-29 12:10:37 +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 f8005cb699
Merge pull request #28289 from aaronfranke/grid
Dynamic infinite 3D grid
2020-05-26 13:39:53 +02:00
Andrii Doroshenko (Xrayez) a96f0e98d7 Add custom_modules build option to compile external user modules
This patch adds ability to include external, user-defined C++ modules
to be compiled as part of Godot via `custom_modules` build option
which can be passed to `scons`.

```
scons platform=x11 tools=yes custom_modules="../project/modules"
```

Features:

- detects all available modules under `custom_modules` directory the
same way as it does for built-in modules (not recursive);
- works with both relative and absolute paths on the filesystem;
- multiple search paths can be specified as a comma-separated list.

Module custom documentation and editor icons collection and generation
process is adapted to work with absolute paths needed by such modules.

Also fixed doctool bug mixing absolute and relative paths respectively.

Implementation details:

- `env.module_list` is a dictionary now, which holds both module name as
  key and either a relative or absolute path to a module as a value.
- `methods.detect_modules` is run twice: once for built-in modules, and
  second for external modules, all combined later.
- `methods.detect_modules` was not doing what it says on the tin. It is
  split into `detect_modules` which collects a list of available modules
  and `write_modules` which generates `register_types` sources for each.
- whether a module is built-in or external is distinguished by relative
  or absolute paths respectively. `custom_modules` scons converter
  ensures that the path is absolute even if relative path is supplied,
  including expanding user paths and symbolic links.
- treats the parent directory as if it was Godot's base directory, so
  that there's no need to change include paths in cases where custom
  modules are included as dependencies in other modules.
2020-05-25 15:33:32 +03:00
Rémi Verschelde a55a97119b
Merge pull request #38887 from AndreaCatania/oahash_imp
OAHashMap crash fix and copy feature.
2020-05-25 11:55:06 +02:00
Andrea Catania 094a05d44e - Make sure it's impossible to initialize an OAHashMap with 0 capacity (would cause division by 0)
- Added possibility to copy an OAHashMap
- Added unit tests

This code is generously donated by IMVU.
2020-05-25 11:18:02 +02:00
Aaron Franke 8879625879
Dynamic infinite 3D grid
Well, infinite for all intents and purposes.
2020-05-22 19:43:59 -04:00
Rémi Verschelde 46450979db
Merge pull request #38942 from neikeq/hinjaku-hinjaku
Fix editor ignoring 'single_window_mode' with no main scene
2020-05-22 18:59:38 +02:00
Ignacio Etcheverry 6852b29658 Fix editor ignoring 'single_window_mode' with no main scene
Previously the editor would ignore the 'single_window_mode' editor setting if
the edited project didn't have a main scene configured in the project settings.
2020-05-22 17:41:09 +02:00
Ignacio Etcheverry ecd0cccc76 Fix condition in ClassDB tests that should return
Also changed the name of the test macros to be clearer.
2020-05-22 01:52:32 +02:00
Rémi Verschelde 1d573969c0
Merge pull request #38874 from bruvzg/tab_drv_sel_40
[Windows] Add tablet driver selection.
2020-05-20 13:58:20 +02:00
Rémi Verschelde c404fe5848
Merge pull request #38515 from Calinou/cli-scene-allow-res-tres
Allow `.res` and `.tres` extensions in the scene CLI positional argument
2020-05-20 11:46:27 +02:00
bruvzg d0b5174b6a
[Windows] Add tablet driver selection. 2020-05-20 09:37:32 +03:00
Rémi Verschelde 56343e13b0
Merge pull request #38723 from neikeq/initial-classdb-test
Added tests for ClassDB
2020-05-18 16:34:36 +02:00
Pedro J. Estébanez b720a01849 Fix leaks and crashes in OAHashMap
This changes the way the lifespan of items is managed to be consistent.

Bonus: Simplify cases of destroy-then-emplace.
2020-05-18 14:02:52 +02:00
Ignacio Etcheverry 9fa4b402a7 Added tests for ClassDB 2020-05-16 17:32:58 +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 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
Fabio Alessandrelli d79e28c302 Support multiple debug protocols. 2020-05-12 15:09:13 +02:00
Hugo Locurcio c6fbbdf15d Rename SSL certificate bundle setting to clarify the "overriding" aspect
This closes https://github.com/godotengine/godot-docs/issues/2531.
2020-05-12 10:13:27 +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
Marcus Elg ec7b481170 Renamed plane's d to distance 2020-05-10 12:12:51 +02:00
Hugo Locurcio 653334cc8d
Allow .res and .tres extensions in the scene CLI positional argument
This closes #35709.
2020-05-06 19:59:29 +02:00
bruvzg d978658f81
[Windows] Add support for the WinTab API for pen input. 2020-05-05 14:16:02 +03: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 b30014f93f DocData: Keep Mono properties on non-Mono builds
This doesn't make much sense API-wise, but it's important for the documentation
workflow that the Mono and non-Mono builds produce the same output, otherwise
we keep having non-Mono builds removing Mono properties and losing their
descriptions.

This is a terrible hack but it's ad hoc, and should be OK for the time being.
2020-04-20 17:59:07 +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
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
Rémi Verschelde 30ab5c9baa
Merge pull request #36868 from Calinou/improve-cli-script-error-message
Tweak the error message when trying to run an invalid script from CLI
2020-04-16 12:41:12 +02:00
bruvzg e92a14ac5f
Ignore process serial number (-psn_...) command line argument passed by macOS Gatekeeper. 2020-04-10 10:32:19 +03:00
Bastiaan Olij afc8c6391c Renaming all ARVR nodes to XR 2020-04-09 15:33:01 +10:00
Rémi Verschelde 9abb415d92
Merge pull request #37391 from dreamsComeTrue/embedded-windows-mode
Expose 'Embedded Windows Mode' as Editor and Project Settings
2020-04-04 07:58:53 +02:00
Dominik 'dreamsComeTrue' Jasiński 7af84d7213 Expose 'Embedded Windows Mode' as Editor and Project Settings 2020-04-03 21:15:22 +02:00
lupoDharkael 95a1400a2a Replace NULL with nullptr 2020-04-02 13:38:00 +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
Rémi Verschelde 0c320a6bf3 More server renames for consistency after #37361 2020-03-28 13:20:48 +01: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
Juan Linietsky 307b1b3a58
Merge pull request #37340 from reduz/rename-3d-nodes
Make 2D and 3D node names more explicit
2020-03-27 13:47:15 -03:00
Juan Linietsky eaae4b6408 Renamed 2D and 3D nodes to make their types explicit
Fixes #30736.
2020-03-27 14:54:04 +01:00
Rémi Verschelde fe3566e190 DisplayServer: Fix registration of GetRenderingDriversFunction
Also improve `--help` output.
2020-03-27 11:07:32 +01:00
bruvzg 15a9f94346 Add macOS DisplayServer implementation.
Change global menu to use Callable, add support for check items and submenus.
2020-03-26 16:24:05 +01:00
Mateo Kuruk Miccino f387b9b4f4 Multiple changes to DisplayServerX11
- Travis: Change x11 to linuxbsd
- SCons: Change x11 plataform to linuxbsd
- Plugins: Remove ; to avoid fallthrough warning
- DisplayServerX11: Implement set_icon
- DisplayServerX11: Fix X11 bug when a window was erased from windows
  map, all the changes from that erased windows are sending to the main
  window
- DisplayServerX11: Reorder create_window commands
- DisplayServerX11: Change every Size2 to Size2i and Rect2 to Rect2i
  where it belongs

+ More X11 fixes which have been integrated directly back into reduz's
original commits while rebasing the branch.
2020-03-26 15:49:54 +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 543fb1c4da Separate DisplayServer from OS on Windows 2020-03-26 15:49:41 +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
Rémi Verschelde 3d2dd79ecd SCons: Drop support for Python 2
We now require SCons 3.0+ (first version with Python 3 support),
and we set min required Python 3 version to 3.5 (3.4 and earlier are
EOL).
2020-03-25 15:25:37 +01:00
Rémi Verschelde cfd84625f0 Move DocData and Collada out of their subfolders
Now that the unused DocDump was removed, the `editor/doc` subfolder is
redundant.

Similarly, there's no reason for Collada to have a subfolder for itself
when glTF or OBJ don't.
2020-03-24 09:56:04 +01:00
Rémi Verschelde 9d24541597 Remove unused classes and stray headers
Found by reviewing headers with 1 or less matching includes:
```
find -name thirdparty -prune -o -name "*.h" -exec basename {} \; | sort -u > headers
for header in $(cat headers); do echo "$header: "; rg -l "#include \"(.*/)?$header\"" | wc -l; done > list-includes
```
2020-03-24 09:50:51 +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
Fabio Alessandrelli d0009636df ScriptDebuggerRemote use threads 2020-03-08 12:16:09 +01:00
Andrii Doroshenko (Xrayez) b0e8177306 Fix doctool misleading error message 2020-03-07 16:40:59 +02:00
Hugo Locurcio 2ab9515b07
Tweak the error message when trying to run an invalid script from CLI 2020-03-06 22:58:35 +01:00
Mateo Dev .59 c933eb7acc Change when we can ERR_FAIL_COND and ERR_FAIL_CONV_V to static_assert 2020-03-04 04:44:47 -03:00
Rémi Verschelde e2b66cacf7
Merge pull request #18020 from bruvzg/input_fix_non_latin_and_add_hw_scancodes
Fix non-latin layout scancodes on Linux, adds access to physical scancodes.
2020-03-01 23:00:42 +01:00
Andrea Catania 2e0fb66c6f Renamed PlaneShape to WorldMarginShape 2020-02-27 17:45:16 +01:00
Rémi Verschelde 3a4c128f07
Merge pull request #36551 from AndreaCatania/navigation_destruction_flush
Flushes commands just before the navigation server is destroyed
2020-02-26 10:09:43 +01:00