Commit graph

540 commits

Author SHA1 Message Date
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) 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
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
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
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
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
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
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
Aaron Franke bb8aa107fd
Remove 32-bit String to_int method 2020-06-03 00:03:34 -04: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
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
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 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 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
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 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
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
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 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 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 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
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
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
Fabio Alessandrelli cbc450c0e5 Huge Debugger/EditorDebugger refactor. 2020-02-21 11:12:03 +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 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
Juan Linietsky 6ee2f5e6b6 More GIProbe work and fixes 2020-02-11 12:03:49 +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
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
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