Commit graph

953 commits

Author SHA1 Message Date
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
Andrea Catania c143b5c677 Flushes commands just before the navigation server is destroyed 2020-02-26 09:42:51 +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
bruvzg 1af06d3d46
Rename scancode to keycode.
Add `physical_keycode` (keyboard layout independent keycodes) to InputEventKey and InputMap.
Fix non-latin keyboard layout keycodes on Linux/X11 (fallback to physical keycodes).
2020-02-25 12:30:33 +02:00
Rémi Verschelde 2cf6ac6c50 Replace FALLTHROUGH macro by C++17 [[fallthrough]]
This attribute is now part of the standard we target so we no longer
need compiler-specific hacks.

Also enables -Wimplicit-fallthrough for Clang now that we can properly
support it. It's already on by default for GCC's -Wextra.

Fixes new warnings raised by Clang's -Wimplicit-fallthrough.
2020-02-23 00:52:50 +01:00
Fabio Alessandrelli cbc450c0e5 Huge Debugger/EditorDebugger refactor. 2020-02-21 11:12:03 +01:00
Juan Linietsky 3205a92ad8 PoolVector is gone, replaced by Vector
Typed `PoolTypeArray` types are now renamed `PackedTypeArray` and are
sugar for `Vector<Type>`.
2020-02-18 10:10:36 +01:00
Juan Linietsky 867d073b98 Changed logic and optimized ObjectID in ObjectDB and Variant, removed RefPtr. 2020-02-15 08:36:04 -03:00
Rémi Verschelde d2537407ef Fix various GCC compilation warnings after Vulkan merge
Part of #36132.
2020-02-14 10:02:31 +01:00
Rémi Verschelde 386968ea97 Remove obsolete GLES3 backend
Due to the port to Vulkan and complete redesign of the rendering backend,
the `drivers/gles3` code is no longer usable in this state and is not
planned to be ported to the new architecture.

The GLES2 backend is kept (while still disabled and non-working) as it
will eventually be ported to serve as the low-end renderer for Godot 4.0.

Some GLES3 features might be selectively ported to the updated GLES2
backend if there's a need for them, and extensions we can use for that.

So long, OpenGL driver bugs!
2020-02-13 10:36:44 +01:00
Yuri Roubinsky 6f162395ff Implementation of 'struct' for shaders 2020-02-11 20:00:42 +03:00
Juan Linietsky 6ee2f5e6b6 More GIProbe work and fixes 2020-02-11 12:03:49 +01:00
bruvzg 26318f3bd1 Fix Vector3 ambiguities and out of bounds init. 2020-02-11 12:03:39 +01:00
Juan Linietsky 920db604d2 Rewrote large part of rendering, omni and spot shadows now work. 2020-02-11 12:01:18 +01:00
Juan Linietsky 8cee7703a6 Yay very basic 3D (only white) finally shows. 2020-02-11 11:59:27 +01:00
Juan Linietsky 449df8f688 Base 3D engine done, still untested, though. 2020-02-11 11:59:25 +01:00
bruvzg b456bfad5c Add runtime GLES2 / Vulkan context selection. 2020-02-11 11:57:34 +01:00
bruvzg eb48be51db Add static Vulkan loader.
Initial Vulkan support for Windows.
Initial Vulkan support for macOS.
2020-02-11 11:57:11 +01:00
Juan Linietsky 4fe3ee1730 Moved the shader source compilation code outside RenderingDevice and Vulkan 2020-02-11 11:53:29 +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 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
Juan Linietsky 4f163972bb Refactored RID/RID_Owner to always use O(1) allocation.
* Implements a growing chunked allocator
* Removed redudant methods get and getptr, only getornull is supported now.
2020-02-11 11:53:26 +01:00
Andrea Catania e6be3f68da - Integrated NavigationServer and Navigation2DServer.
- Added Navigation Agents and Obstacles.
- Integrated Collision Avoidance.

This work has been kindly sponsored by IMVU.
2020-02-10 14:38:52 +01:00
Rémi Verschelde f3726ee994 Use modules_enabled.gen.h to improve inter dependency checks
- Fix build with gdscript module disabled. Fixes #31011.
- Remove unused `gdscript` compile option.
- Fix build with regex module disabled.
- Fix ImageLoaderSVG to forward declare thirdparty structs.
2020-02-07 11:50:40 +01:00
Marcel Admiraal 5af3b4ca27 Remove duplicate ERR_PRINT macro. 2020-02-05 11:13:24 +01:00
Rémi Verschelde 22d4caa4bb
Merge pull request #35418 from Calinou/project-manager-viewport-usage-2d
Use a cheaper viewport usage mode in the project manager
2020-01-31 10:46:47 +01:00
Hugo Locurcio 2423f75585
Improve the error message displayed when the PCK file can't be found
This explains what to do if the executable was renamed, which is helpful
for people exporting projects.
2020-01-28 00:12:32 +01:00
Rémi Verschelde 72c44bafac Sync controller mappings DB with SDL2 community repo
Synced with gabomdq/SDL_GameControllerDB@fed28b1bf9.
2020-01-26 17:59:15 +01:00
Hugo Locurcio 1e2118ea22
Use a cheaper viewport usage mode in the project manager
This should speed up rendering slightly. While the project manager
is hardly demanding, this may help on high refresh-rate displays
or very slow machines.
2020-01-21 22:47:38 +01:00
Ignacio Etcheverry d5122ab31c Sync pending VisualServer commands after ScriptServer finalization
This is needed as C# may free resources from the finalizer thread during
CSharpLanguage::finish(). Previously this would result in RIDs not being freed.
2020-01-13 21:46:44 +01:00
Rémi Verschelde d88103172c Ignore command line --build-solutions when not editing project
This option is meant to use together with `--path` or from a project
folder. Otherwise the project manager is opened and the option triggers
a crash.

Fixes #25589.
2020-01-13 14:00:47 +01:00
Rémi Verschelde ab97f78fa5 Revert "Enable Vsync via Compositor by default"
This reverts commit 9600fd5dde.

Add comment warning about possible implications of using this option.

Fixes #35038.
2020-01-13 09:33:27 +01:00
Hugo Locurcio 0218494e6b
Be stricter on what's considered a scene path in CLI argument parsing
This closes #8721.
2020-01-10 13:18:24 +01:00
Rémi Verschelde 83d950b58e
Merge pull request #34968 from Calinou/enable-vsync-via-compositor
Enable Vsync via Compositor by default
2020-01-10 10:04:55 +01:00
Rémi Verschelde 5377f062d4 Main: Prevent Project Manager-ception in editor
Fixes #34904.
2020-01-10 09:48:03 +01:00
Hugo Locurcio 9600fd5dde
Enable Vsync via Compositor by default
This feature was added in #33414 but it was disabled by default.
Now that it got some testing, it's probably safe to enable it
by default.
2020-01-09 22:22:11 +01:00
Rémi Verschelde c456d87ee6
Merge pull request #34918 from vnen/gdscript-assign-op
GDScript: enable type checks on release mode
2020-01-08 18:22:38 +01:00
George Marques d26414f9fe
GDScript: enable type checks on release mode
Also make builtin GDScript functions report return type as Variant in
release so type is converted when needed.
2020-01-08 12:38:18 -03:00
Rémi Verschelde 5e4d465356
Merge pull request #34913 from akien-mga/main-add-export-pack
Export: Add dedicated --export-pack option to export data pack
2020-01-08 15:43:44 +01:00
Rémi Verschelde 7c29ce4375 Export: Add dedicated --export-pack option to export data pack
The previous behavior relying on the provided extension was problematic
on macOS since .zip is the main extension used for the full project
export (binary + data pack).

We add a dedicated `--export-pack` command line option to define when
only the data pack should be exported. Its extension will still be
inferred from the path.

Fixes #23073.
2020-01-08 14:57:46 +01:00
Rémi Verschelde 0749906d8a Gamepad: Fix parsing order for SDL2 controller databases
We were overriding values from `gamecontrollerdb.txt` (current, updated
upstream) with `gamecontrollerdb_205.txt` (legacy, SDL 2.0.5) and then
`gamecontrollerdb_204.txt` (legacy, SDL 2.0.4).

There was a comment to warn about this but it seems it did not prevent
using the wrong order for all this time...

Now `gamecontrollerdb.txt` mappings will properly override outdated
ones present in the `204` and `205` variants.
2020-01-08 12:26:53 +01:00
Rémi Verschelde 7d0342e87d Sync controller mappings DB with SDL2 community repo
Synced with gabomdq/SDL_GameControllerDB@67b49052b4.
2020-01-08 11:45:00 +01:00
Rémi Verschelde 0584c7f094 Gamepad: Parse SDL_GAMECONTROLLERCONFIG env after default mappings
Addresses comment https://github.com/godotengine/godot/issues/21918#issuecomment-458764923.
2020-01-08 11:43:44 +01:00
Rémi Verschelde 5011afcb6a Export: Improve usability of command line interface
I'm barely scratching the surface of the changes needed to make the
--export command line interface easy to use, but this should already
improve things somewhat.

- Streamline `can_export()` templates check in all platforms, checking
  first for the presence of official templates, then of any defined
  custom template, and reporting on the absence of any.
  Shouldn't change the actual return value much which is still true if
  either release or debug is usable - we might want to change that
  eventually and better validate against the requested target.

- Fix discrepancy between platforms using `custom_package/debug` and
  `custom_template/debug` (resp. `release`).
  All now use `custom_template`, which will break compatibility for
  `export_presets.cfg` with earlier projects (but is easy to fix).

- Use `can_export()` when attempting a command line export and report
  the same errors that would be shown in the editor.

- Improve error reporting after a failed export attempt, handling
  missing template and invalid path more gracefully.

- Cleanup of unused stuff in EditorNode around the export workflow.

- Improve --export documentation in --help a bit.

Fixes #16949 (at least many of the misunderstandings listed there).
Fixes #18470.
2020-01-07 14:25:56 +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 c2066fff3d
Merge pull request #34589 from Calinou/improve-cli-export-help
Fix and improve command-line exporting help
2019-12-30 16:33:11 +01:00
Hugo Locurcio b076b2bdd6
Fix and improve command-line exporting help
It was previously mentioning only one of the two required arguments.
This also mentions that the export path is relative to the project
directory.

This partially addresses #28646.
2019-12-24 22:20:44 +01:00
Haoyu Qiu 078c0d75f2 Cleans up headers included in editor_node.h 2019-12-24 21:46:05 +08:00
Rémi Verschelde cf3a863fa9
Merge pull request #34229 from NoFr1ends/fix-home-indicator-ios
Allow to change the home indicator behaviour on iOS
2019-12-13 14:00:14 +01:00
Rémi Verschelde 9432520449 Update AUTHORS and DONORS list
New contributors added to AUTHORS:
@allkhor, @Eoin-ONeill-Yokai, @timothyqiu, @madmiraal, @zaksnet

Update sponsors on splash screen.

Thanks to all contributors and donors for making Godot possible!
2019-12-13 13:50:33 +01:00
Jonas Bernemann 4d61118f64 Add project setting to hide home indicator on iOS
On iOS devices without a physical home button iOS
shows a home indicator instead. This is often in the
way of the UI or the game.
Added a project setting to disable hidden home indicator.
The default value is to hide the home indicator
2019-12-13 11:00:18 +01:00
TerminalJack e1dda5195c Added support for vertical syncing via the Windows OS compositor (DWM.) 2019-12-04 11:14:21 +01:00
bruvzg 2ef8c5fac5
iOS modular build and export implementation. 2019-12-01 21:57:18 +02:00
PouleyKetchoupp 85a955fc56 Flush remaining messages before quitting the game when loading fails
This change allows error messages to be printed in the editor debugger when the game fails on load, instead of displaying them in the console terminal only.
2019-11-29 14:01:56 +01:00
Rémi Verschelde 502a667070 Sync controller mappings DB with SDL2 community repo
Synced with gabomdq/SDL_GameControllerDB@d329cb6a71.
2019-11-29 10:56:55 +01:00
Pawel Lampe 9feb9aef42 godot exit code improvement for --script --check-only, fixes #33895
this commit causes godot executable to return non-zero exit code
once invalid script is passed via --script during --check-only
2019-11-26 10:53:42 +01:00
Marcel Admiraal 83069a3c0f Remove ERR_EXPLAIN macros and the scaffolding they needed. 2019-11-11 10:57:00 +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 ed373a60b1
Merge pull request #30556 from kawa-yoiko/astar-directed
Improve support for directed graphs in A*; docs update included
2019-11-07 12:33:27 +01:00
Rémi Verschelde c663d65ffc New contributors added to AUTHORS:
@DavidSichma, @ptrojahn

New Platinum sponsor, added to splash screen:
Interblock

New Gold sponsor:
Image Campus
2019-11-07 10:22:04 +01:00
Hugo Locurcio 8ca0f1a71c
Remove unused editor/active project setting
This closes #33322.
2019-11-04 14:35:46 +01:00
Rafał Mikrut 9ddb3265e1 Fix some crashes, overflows and using variables without values 2019-11-01 16:16:31 +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
qarmin 616ab4fac2 Small fixes to redundand code, copy paste bugs 2019-10-14 11:40:55 +02:00
Hugo Locurcio c8a8be6dd1
Optimize images losslessly using oxipng -o6 --strip all --zopfli 2019-10-12 23:23:33 +02:00
Michael Alexsander d12a8940cb Make possible to use just one "size/test_*" value in the settings 2019-10-04 10:27:11 -03:00
Rémi Verschelde 664d7e7336 Update AUTHORS and DONORS list
New contributors added to AUTHORS:
@creikey, @IronicallySerious, @LikeLakers2, @minraws, @NilsIrl,
@profan, @raphael10241024

New Platinum sponsor, added to splash screen:
Heroic Labs

Merged some duplicates via .mailmap to allow better tracking of
commit counts with `git shortlog -s -n -e --no-merges`.

Thanks to all contributors and donors for making Godot possible!
2019-10-02 20:06:03 +02:00
Shiqing 0c35994f2f Add stress test between A* and Floyd-Warshall 2019-09-28 16:17:57 +08:00
Shiqing c2b824687d Reduce memory usage for edges in A* and add tests 2019-09-28 16:17:52 +08:00
Hugo Locurcio ca268dfecd
Validate audio/video driver command-line arguments
This will exit early if the audio/video driver specified doesn't exist.
2019-09-27 15:11:56 +02:00
Andrii Doroshenko (Xrayez) 752debe204 SCons: do not build tests with tools=no
This doesn't affect the resulting binary size, but allows to save
a phew seconds during compilation if building export templates.
2019-09-26 16:12:07 +03:00
Rémi Verschelde 084481b79d
Merge pull request #32230 from kawa-yoiko/oa-backward-shift
Implement backward shift deletion for OAHashMap
2019-09-26 08:03:46 +02:00
qarmin 17732fe698 Added some obvious errors explanations 2019-09-25 10:28:50 +02:00
Shiqing 78bee16e05 Implement backward shift deletion for OAHashMap 2019-09-21 14:32:40 +08:00
iwek7 617797c47c Adds skip-breakpoints feature 2019-09-03 20:49:09 +02:00
Hugo Locurcio 1c1928774c
Mark the V-Sync project setting to require an editor restart
The V-Sync project setting also applies to the editor, but
it will only take effect when the editor is restarted.
2019-08-27 23:16:55 +02:00
Rémi Verschelde 9ceab52892 Sync controller mappings DB with SDL2 community repo
Synced with gabomdq/SDL_GameControllerDB@ef8542c9f3.
2019-08-27 10:13:05 +02:00
Rémi Verschelde 6b7117ce3f
Merge pull request #31662 from profan/perf/astar-reserve
Allow to reserve space for nodes in A* and elements in OAHashMap explicitly.
2019-08-27 10:09:08 +02:00
Robin Hübner 1031833fb0
allow to reserve space in OAHashMap explicitly and also in AStar.
* also handle overflow occurring in _get_probe_length
2019-08-27 00:38:35 +02:00
Rémi Verschelde 4b53fdb25d
Merge pull request #31481 from Calinou/generate-gdnative-use-gles2
Always use the GLES2 backend when generating the GDNative API JSON
2019-08-26 14:05:20 +02:00
Hugo Locurcio 3d61ca5696
Register as an editor instance when generating the GDNative API JSON
This enables the automatic GLES2 fallback if the hardware
doesn't support the GLES3 backend.

This closes #27768.
2019-08-24 00:09:52 +02:00
Rémi Verschelde 1a4dbd9ee2
Merge pull request #31437 from volzhs/vibrate-mobile
Support vibration for Android and iOS
2019-08-21 21:10:22 +02:00
Fabio Alessandrelli ce5a3f56a6 Rewrite StreamPeerSSL with SSLContext helper class
connect_to_stream now accepts optional parameter to specify which
certificates to trust.
Implement accept_stream (SSL server) with key/cert parameters to specify
the RSA key and X509 certificate resources.
2019-08-21 16:59:38 +02:00
volzhs 4061e5bb75 Support vibration for Android and iOS 2019-08-21 23:38:53 +09:00
Rémi Verschelde 0743a07447
Revert "Add Min/Max Window Size Setting" 2019-08-17 16:19:18 +02:00
Rémi Verschelde 822a41a8c0
Merge pull request #31367 from sparkart/add_minmax_winsize_setting
Add Min/Max Window Size Setting
2019-08-17 11:21:56 +02:00
Emmanuel Barroga a7bf643a7b Add Min/Max Window Size Setting
Add project settings to easily set the minimum and maximum window size.
2019-08-15 12:19:09 -07:00
IAmActuallyCthulhu 82b9557803
Remove redundant author doc comments 2019-08-12 04:26:38 -05:00
Rémi Verschelde 839cc98cb9
Merge pull request #31290 from nekomatata/fix-test-regex-disabled
Fixed link errors when building in debug with RegEx module disabled
2019-08-12 10:05:35 +02:00
PouleyKetchoupp 360fb0ffa8 Fixed link errors when building in debug with option module_regex_enabled=no 2019-08-11 12:17:18 +02:00
Michael Alexsander Silva Dias 5ca7460421 Replace 'ERR_EXPLAIN' with 'ERR_FAIL_*_MSG' in "main" and "servers" directories 2019-08-09 11:27:39 -03:00
Hugo Locurcio 47c615caf3
Cap the number of warnings/errors per second rather than per frame
This reproduces the behavior used for printing when using the remote
debugger. The default limit is 100 errors and 100 warnings per second,
which makes it possible to display much more GDScript warnings
before overflowing.

This also adds a "Too many warnings" message, so that warnings
don't look like errors when overflowing anymore.

This closes #21896.
2019-07-31 17:29:26 +02:00
Guilherme Felipe 508761e0cd Fix set_default_cursor_shape always sending motion event 2019-07-29 14:00:37 -03:00
Tomasz Chabora bd5b73108f Don't release action if it's not pressed 2019-07-24 18:18:03 +02:00
Chaosus 080c0bb7fe Added count method to String 2019-07-23 18:55:54 +03:00
Rémi Verschelde 66d09a6b4c SCons: Fix uses of [].append instead of env.add_source_files()
Also added support for SCons project-absolute paths (starting with #) and
warning about duplicates in add_source_files(), and fixed
default_controller_mappings.gen.cpp being included twice after first build
due to *.cpp globbing.

Part of #30270.
2019-07-22 15:08:32 +02:00
Rémi Verschelde 20a3bb9c48
Merge pull request #30226 from lawnjelly/interpolate
Add access to interpolation fraction for fixed timestep interpolation
2019-07-18 15:44:14 +02:00
Chaosus c37379456f Implemented local shader arrays 2019-07-15 15:57:39 +03:00
lawnjelly bf6c301b9c Add access to interpolation fraction for fixed timestep interpolation
Addresses #30068

This is a prerequisite for allowing proper support for fixed timestep interpolation, exposing the interpolation fraction to the engine, modules and gdscript.

The interpolation fraction is the fraction through the current physics tick at the time of the current frame.
2019-07-11 08:25:26 +01:00
Hugo Locurcio 28d3a6051c
Use base Color() constructors instead of Color::html()
This results in slightly smaller binaries (-17 KB for an editor binary)
as no strings need to be allocated.
2019-07-08 21:17:10 +02:00
Rémi Verschelde 56269e2db8
Merge pull request #29613 from Calinou/doctool-create-directories
Make `--doctool` create directories if they don't exist
2019-07-08 15:08:45 +02:00