Commit graph

1116 commits

Author SHA1 Message Date
Rémi Verschelde
84f64ddde9
Merge pull request #60723 from reduz/refactor-module-initialization 2022-05-04 19:08:43 +02:00
reduz
de0ca3b999 Refactor module initialization
* Changed to use the same stages as extensions.
* Makes the initialization more coherent, helping solve problems due to lack of stages.
* Makes it easier to port between module and extension.
* removed the DRIVER initialization level (no longer needed).
2022-05-04 17:34:51 +02:00
Hugo Locurcio
180e5d3028
Remove RES and REF typedefs in favor of spelled out Ref<>
These typedefs don't save much typing compared to the full `Ref<Resource>`
and `Ref<RefCounted>`, yet they sometimes introduce confusion among
new contributors.
2022-05-03 01:43:50 +02:00
Aaron Franke
0ae00a07d6
Rename variable names for some singletons 2022-04-26 22:53:50 -05:00
bruvzg
9381acb6a4
Make FileAccess and DirAccess classes reference counted. 2022-04-11 13:28:51 +03:00
bruvzg
f851c4aa33
Fix some issues found by cppcheck. 2022-04-06 14:34:37 +03:00
Jason Yundt
1cc7e7ec33 Improve autoload inheritance error message
Autoloaded scripts should always inherit from Node. When you run a
project that tries to autoload a script which doesn’t inherit from Node,
then Godot gives an error.

Before this change, the error said “Script does not inherit a Node”.
That error message is a little bit misleading. If a class inherits a
Node, then one of its superclasses has a Node. If a class inherits
_from_ Node, then one of its superclasses is Node. This change corrects
that mistake.

Fixes #59884.
2022-04-04 15:51:02 -04:00
Bastiaan Olij
9b7b9de0e5 Add action map editor for OpenXR 2022-04-04 18:43:29 +10:00
bruvzg
d2add64f91
Move OpenXR project settings to the main, to make them visible on unsupported platforms. 2022-03-29 23:25:33 +03:00
Fredy Huya-Kouadio
5711037bf6 Android port of the Godot Editor
These set of changes focus primarily on getting the core logic and overall Godot Editor UI and functionality up and running natively on Android devices.
UI tweaks / cleanup / polish, as well configuration for Android specific functionality / restrictions will be addressed in follow-up PRs iteratively based on feedback.

Co-authored-by: thebestnom <shoval.arad@gmail.com>
2022-03-28 14:04:51 -07:00
Rémi Verschelde
5c8bd6fd71
Merge pull request #58233 from bruvzg/gde_ts 2022-03-18 14:29:58 +01:00
Markus Sauermann
150161da33 Rename Project setting display/window/stretch/shrink to scale 2022-03-17 19:30:32 +01:00
bruvzg
f19cd44346
Unify TextServer built-in module and GDExtension code. 2022-03-17 08:15:29 +02:00
Rémi Verschelde
fb28025785
Merge pull request #59153 from Calinou/debug-stringnames-improve
Improve `--debug-stringnames` to be more useful
2022-03-15 20:26:18 +01:00
Hugo Locurcio
38995961df
Improve --debug-stringnames to be more useful
- Print all StringNames, not just the top 100.
- Print statistics at the end of the list of StringNames,
  with unreferenced and rarely referenced StringNames.
- List the CLI argument in `--help` and shell completion.
2022-03-15 18:54:51 +01:00
Hugo Locurcio
eae16f73a6
Make -q CLI argument toggle quiet stdout instead of quitting
`-q` is a common toggle in a command line applications for quiet mode
(see apt or dnf for examples). In contrast, `--quit` isn't needed
as often.
2022-03-13 23:55:01 +01:00
Hugo Locurcio
f4a0573379
Tweak the display order of CLI arguments in --help for consistency
`--profile-gpu` was renamed to `--gpu-profile` for consistency with
`--gpu-abort`.

This also updates the shell completion files to the latest `master`
branch.
2022-03-13 20:36:52 +01:00
kobewi
3c53752b4a Cleanup embed subwindows getters 2022-03-13 18:20:53 +01:00
Rémi Verschelde
768f9422bc Convert uses of DirAccess * to DirAccessRef to prevent memleaks
`DirAccess *` needs to be deleted manually, and this is often forgotten
especially when doing early returns with `ERR_FAIL_COND`.
`DirAccessRef` is deleted automatically when it goes out of scope.

Co-authored-by: bruvzg <7645683+bruvzg@users.noreply.github.com>
2022-03-11 09:13:11 +01:00
Rémi Verschelde
9b05f29894 Remove unused GDNative code
This has been superseded by GDExtension so this code is no longer useful
nor usable.

There's still some GDNative-related stuff in platform export code which
needs to be adapted for GDExtension (e.g. to include GDExtension libraries
in exports).
2022-03-09 13:59:03 +01:00
Gilles Roudière
ce512b35c1 Reorder native extension types initialization, initializing editor last 2022-02-28 16:03:26 +01:00
Bastiaan Olij
a78a9fee71 Implementing OpenXR driver 2022-02-23 12:02:24 +01:00
Paulo Poiati
fe95aa2c90 Fix extension registration order. 2022-02-20 10:58:46 -03:00
Rémi Verschelde
e1c303fa79 Revert "Fix extension registration order."
This reverts commit 94ef200bab.

This broke extension loading.
Fixes #58273.
2022-02-18 14:18:24 +01:00
Hugo Locurcio
76bf7f169d
Make --doctool imply --headless to speed up class reference generation
This also prevents spawning an unnecessary splash screen window
while the class reference is generated.
2022-02-17 22:35:37 +01:00
Paulo Poiati
94ef200bab Fix extension registration order. 2022-02-16 14:46:33 -03:00
Rémi Verschelde
11572c6e30
Editor: Cleanup some includes dependencies
Removes some unnecessary includes from `editor_node.h`, and instead add
those where they're used.

Removes unnecessary `editor_node.h` includes in various editor classes.

Renames `dynamicfont` to `dynamic_font` in a couple files.

Misc cleanup while jumping through that rabbit hole.
2022-02-15 14:54:15 +01:00
TechnicalSoup
899057c710 Cleanup of preprocessor directives in main.cpp
Remove redundant set of preprocessor directives and combine duplicate if statements.
2022-02-14 16:20:31 +11:00
bruvzg
9739a2038a
Fix Project Manager crash on exit.
Fix editor settings loading / saving by Project Manager.
2022-02-12 21:55:11 +02:00
Hendrik Brucker
77fb65debf Use EditorFileDialog instead of FileDialog in the project manager 2022-02-12 12:06:51 +01:00
Rémi Verschelde
d22ac13bc2
Merge pull request #57715 from Faless/debugger/4.x_core_includes_and_servers
[Debugger] Move most profilers to ServersDebugger, fix core includes.
2022-02-09 21:57:32 +01:00
Rémi Verschelde
90162851a7
Core: Move generated VERSION_HASH to a .cpp file
This lets us have its definition in `core/version.h` and avoid
rebuilding a handful of files every time the commit hash changes.
2022-02-09 09:20:17 +01:00
Rémi Verschelde
317cd0b19a
Refactor some object type checking code with cast_to
Less stringly typed logic, and less String allocations and comparisons.
2022-02-08 10:08:34 +01:00
Fabio Alessandrelli
87f4bbd668 [Debugger] Move most profilers to ServersDebugger.
Also splits bandwidth/rpc profiler (RPCProfiler is now in
SceneDebugger).
2022-02-06 17:36:48 +01:00
Rémi Verschelde
f8f19b313d
Merge pull request #57562 from AnilBK/string-add-contains
String: Add contains().
2022-02-03 22:21:24 +01:00
Anilforextra
adbe948bda String: Add contains(). 2022-02-04 01:28:02 +05:45
Rémi Verschelde
ebe9495b7d
EditorProperty: Fix range hint parsing with optional step
This could lead to have a step of 0 when parsing e.g. "1,10,is_greater".
2022-02-03 12:57:59 +01:00
Hendrik Brucker
2f1e7c28a4 Minor fixes/refactoring of project and editor setting dialogs 2022-02-01 00:19:01 +01:00
Rémi Verschelde
cba2fd2e80
Revert "Add new scaling modes for splash screen"
This reverts commit fcc9f5ce39.

The feature is good but the implementation still needs more work.
A new PR will be made with a rework of this commit.
2022-01-19 16:09:52 +01:00
Samuel Pedrajas
fcc9f5ce39
Add new scaling modes for splash screen
Removes the `fullsize` option which is superseded by `stretch_mode`.

Co-authored-by: Rémi Verschelde <rverschelde@gmail.com>
2022-01-18 23:29:11 +01:00
Rémi Verschelde
7c771ea310
Merge pull request #47522 from madmiraal/rename-test_width-test_height 2022-01-18 13:39:57 +01:00
Max Hilbrunner
99cd4afb2b Doctool: Add error checks and exit code handling 2022-01-18 00:30:17 +01:00
Rémi Verschelde
d9a4ff7583
Merge pull request #55020 from bruvzg/vlk_device_surface_check 2022-01-17 13:34:23 +01:00
Rémi Verschelde
8bdef23f7f
Merge pull request #56012 from bruvzg/wt🤎4 2022-01-17 13:26:15 +01:00
Rémi Verschelde
7176a43260
Remove property hints referencing unsupported svgz extension
The wrongly claimed support for it was removed in #49645.
See also #56862.
2022-01-17 12:40:43 +01:00
Rémi Verschelde
8fce6166cb
Merge pull request #56311 from Calinou/default-allow-hidpi 2022-01-13 09:33:00 +01:00
Marcel Admiraal
f107139979 Rename Project Window width and height settings to match their function 2022-01-04 13:59:16 +00:00
Rémi Verschelde
fe52458154
Update copyright statements to 2022
Happy new year to the wonderful Godot community!
2022-01-03 21:27:34 +01:00
Yuri Roubinsky
fd9c92d4ab Add a shader warning when the uniform buffer limit is exceeded 2022-01-03 16:24:56 +03:00
Hugo Locurcio
0a86dd4718
Enable "Allow Hidpi" by default
This fixes window management issues across platforms on hiDPI monitors.

The `--low-dpi` command line argument has been removed as similar
functionality (forcing low-DPI mode on DPI-aware programs) is
already provided by Windows and macOS itself.
2021-12-30 22:24:49 +01:00
Hugo Locurcio
a924cb3b54
Print requested V-Sync mode when Print Fps is enabled
This can be used to diagnose why the printed FPS is locked to the
monitor refresh rate.
2021-12-20 19:56:04 +01:00
bruvzg
ea5bb8b47d
[Windows] Improve console handling and execute/create_process.
Always build with the GUI subsystem.
Redirect stdout and stderr output to the parent process console.
Use CreateProcessW for blocking `execute` calls with piped stdout and stderr (prevent console windows for popping up when used with the GUI subsystem build, and have more consistent behavior with `create_process`).
Add `open_console` argument to the `execute` and `create_process` to open a new console window.
Remove `interface/editor/hide_console_window` editor setting.
Remove `Toggle System Console` menu option.
Remove `set_console_visible` and `is_console_visible` functions.
2021-12-18 10:14:07 +02:00
Ansraer
c7a03412ac add 2d scale factor property 2021-12-17 19:19:41 +01:00
Haoyu Qiu
e4e4e475f8 Make --doctool locale aware
* Adds `indent(str)` to `String`:
    * Indent the (multiline) string with the given indentation.
    * This method is added in order to keep the translated XML correctly
      indented.
* Moves the loading of tool/doc translation into
  `editor/editor_translation.{h,cpp}`.
    * This will be used from both `EditorSettings` and the doc tool from
      `main`.
* Makes use of doc translation when generating XML class references, and
  setup the translation locale based on `-l LOCALE` CLI parameter.

The XML class reference won't be translated if `-l LOCALE` parameter is
not given, or when it's `-l en`.
2021-12-16 17:49:22 +08:00
Nathan Franke
49403cbfa0
Replace String comparisons with "", String() to is_empty()
Also:
- Adds two stress tests to test_string.h
- Changes to .empty() on std::strings
2021-12-09 04:48:38 -06:00
Rémi Verschelde
8c1fc562dc
Merge pull request #55483 from pycbouh/theme-load-and-order 2021-12-02 17:20:04 +01:00
Yuri Sizov
d567ce3582 Make default/project theme wait for modules before initializing 2021-11-30 19:09:29 +03:00
Rémi Verschelde
c283fce698
Remove editor splash screen with sponsors logo
The Godot Project Leadership Committe has decided to update the sponsoring
tiers so that the Platinum Sponsorship no longer includes a logo on the
editor splash screen.

This lets us reclaim the editor splash screen space for community-related
content instead of sponsors (e.g. a different community-designed splash
screen for each stable branch?).

Also removes two Platinum Sponsors whose sponsorship has expired earlier this
year.
2021-11-30 12:47:25 +01:00
Hugo Locurcio
15e8c4052e
Fix strip_edges() call that was removed in boot splash image change 2021-11-23 19:07:41 +01:00
Hugo Locurcio
3f34832dba
Add a project setting to disable the boot splash image
This allows disabling the boot splash image while keeping the
background color.
2021-11-23 02:20:25 +01:00
bruvzg
b11e619b19
[Vulkan] Check each device capabilities before selecting it.
Split instance and physical device selection function and move device selection to window creation, to reject devices without present capability.
Add device preferred type check in discrete > integrated > virtual > cpu > other order.
Add device list printout.
Add command line argument to override device selection.
2021-11-22 20:04:57 +02:00
kobewi
7dc97d6558 Ignore override.cfg when in editor 2021-11-22 16:10:31 +01:00
Rémi Verschelde
88c4380737
Modules: Make sure to include modules_enabled.gen.h where needed 2021-11-12 13:42:58 +01:00
Hugo Locurcio
a9a45ee7ee
Move Mono unhandled exception setting to be located within a subsection
Settings that aren't within a subsection are difficult to reach when
other settings do have a subsection.

This also adds documentation for the project setting.
2021-11-10 17:31:54 +01:00
Hugo Locurcio
f61ee47a2e
Display 2 decimals instead of 1 in editor frametime labels
When comparing different graphics settings or optimizations,
this makes precise measurements and frametime comparisons easier.
2021-11-09 17:17:55 +01:00
qarmin
071829acc5 Enable mono editor build in CI 2021-11-09 11:02:04 +01:00
Hugo Locurcio
665d29c16d
Fix new projects always being created with OpenGL
Only Vulkan is fully implemented for now, so OpenGL isn't available
in the project manager yet.

This also makes the rendering driver checks use lowercase names
everywhere for consistency.
2021-11-01 22:04:36 +01:00
bruvzg
0b6b8427c8 [macOS] Add create_instance function to spawn editor copies.
[macOS] Modify `create_project` function to detect and run app bundles using NSWorkspace to ensure app window is registered and activated correctly.
2021-11-01 11:48:23 +02:00
Clay John
8a10bb7d0d
Use OpenGL 3.3 core profile instead of compatibility profile
- Rename OpenGL to GLES3 in the source code per community feedback.
  - The renderer is still exposed as "OpenGL 3" to the user.
- Hide renderer selection dropdown until OpenGL support is more mature.
  - The renderer can still be changed in the Project Settings or using
    the `--rendering-driver opengl` command line argument.
- Remove commented out exporter code.
- Remove some OpenGL/DisplayServer-related debugging prints.
2021-10-31 15:56:45 +01:00
Hugo Locurcio
ce97ddbcb1
Rename GLES2 driver to OpenGL to prepare for the upgrade to GLES3
- Use lowercase driver names for the `--rendering-driver`
  command line argument.
2021-10-30 02:05:49 +02:00
lawnjelly
e3491a3744
Add GLES2 2D renderer + Linux display manager
First implementation with Linux display manager.

- Add single-threaded mode for EditorResourcePreview (needed for OpenGL).

Co-authored-by: clayjohn <claynjohn@gmail.com>
Co-authored-by: Fabio Alessandrelli <fabio.alessandrelli@gmail.com>
2021-10-30 02:05:48 +02:00
Rémi Verschelde
3a6be64c12
clang-format: Various fixes to comments alignment from clang-format 13
All reviewed manually and occasionally rewritten to avoid bad auto formatting.
2021-10-28 15:43:36 +02:00
Rémi Verschelde
3b11e33a09
clang-format: Disable alignment of operands, too unreliable
Sets `AlignOperands` to `DontAlign`.

`clang-format` developers seem to mostly care about space-based indentation and
every other version of clang-format breaks the bad mismatch of tabs and spaces
that it seems to use for operand alignment. So it's better without, so that it
respects our two-tabs `ContinuationIndentWidth`.
2021-10-28 15:19:35 +02:00
Pawel Lampe
75ae3164a4 Fix exit code for --script --check-only, fixes #54087
this commit makes godot executable to return zero exit code
once a valid script is passed via --script during --check-only
2021-10-21 20:44:24 +02:00
Rémi Verschelde
f4c3192d0a
Main: Fixup --dump-extension-api after #54017
That removal was correct, but triggered a bug in our messy-as-heck main.cpp
detection logic for editor/project manager/project/command line tool...
Fixing this is for another day.
2021-10-21 09:43:39 +02:00
Rémi Verschelde
af976e4834
Merge pull request #50680 from Calinou/project-default-single-window-mode 2021-10-20 19:09:13 +02:00
Rémi Verschelde
da98357e6e
doctool: Fix differences between headless and Vulkan rendering backends
Fixes #53913.
2021-10-20 17:48:50 +02:00
Rémi Verschelde
73f6351e28
Main: Add documentation for --dump-extension-api 2021-10-20 12:05:05 +02:00
Bastiaan Olij
5d1ea92daf Rework XR positional trackers 2021-10-17 12:12:20 +11:00
Aaron Franke
7e51e4cb84
Fix some LGTM errors of "Multiplication result converted to larger type" 2021-10-12 00:17:27 -05:00
bruvzg
0c0b5c84b0 Implement TextServer GDExtension interface, remove TextServer GDNative interface. 2021-10-01 15:13:29 +03:00
Rémi Verschelde
3a19400889
Merge pull request #48685 from bruvzg/bundle_icon_4 2021-09-30 14:55:04 +02:00
Bastiaan Olij
0623d3676b Improve unregistering XR interfaces so we don't get crashes in GDExtensions by destroying the XRServer too early 2021-09-28 12:25:15 +10:00
Hugo Locurcio
87fb9297e3
Display an alert when attempting to run a project with no main scene
This gives visual feedback when not starting Godot from a terminal.
This could lead to confusion when placing a Godot binary within a
project folder that has no main scene defined.
2021-09-20 14:38:14 +02:00
Paulb23
1c08719d09 Add remaning code edit unit tests 2021-09-20 09:42:39 +01:00
Jacob Edie
2b292a1a2a
--single-window is passed through project manager.
This means you can start godot with --single-window
2021-09-15 10:20:50 +02:00
Rémi Verschelde
0e7beb183a
Merge pull request #52562 from BastiaanOlij/gd_extensions_register_drivers
Add driver types to GD extension initialisation levels
2021-09-15 08:46:43 +02:00
Rémi Verschelde
3cc01b2824
Merge pull request #52226 from Faless/debugger/4.x_start_options 2021-09-14 16:20:02 +02:00
Rémi Verschelde
70ba366743
Merge pull request #50375 from Paulb23/code_edit_unit_tests 2021-09-13 21:51:20 +02:00
Bastiaan Olij
f9849a2717 Add driver types to GD extension initialisation levels 2021-09-13 18:50:00 +10:00
Juan Linietsky
58388f8cec
Merge pull request #47391 from Calinou/platform-feature-tags-lowercase
Make platform feature tag names lowercase
2021-09-07 16:30:50 -03:00
Paulb23
427d3d7207 Allow unit testing SceneTree Ojects 2021-09-01 16:46:04 +01:00
Manuel Moos
6be702bace Fix negative delta arguments
Three attack points, all after the regular calculations:
1. Prevent negative physics timestep counts. They could occur if
   physics_jtter_fix is changed at runtime.
2. idle_step is not allowed to go below 1/8th of the input step.
   That could happen on physics_jitter_fix changes or heavily
   fluctuating performance.
3. Prevent that the idle_step modification breaks the promise
   that Engine.get_physics_interpolation_fraction() is between
   0 and 1 by doing more physics steps than the base system wants.

Fixes #26887

Co-authored-by: Hugo Locurcio <hugo.locurcio@hugo.pro>
2021-08-31 22:16:23 +02:00
Hugo Locurcio
2daaf0fdc3
Make platform feature tag names lowercase
Feature tag names are still case-sensitive, but this makes built-in
feature tags more consistent.

- `Windows` -> `windows`
- `OSX` -> `osx`
- `LinuxBSD` -> `linuxbsd`
- `Android` -> `android`
- `iOS` -> `ios`
- `HTML5` -> `html5`
- `JavaScript` -> `javascript`
- `UWP` -> `uwp`
2021-08-31 20:34:44 +02:00
Wilson E. Alvarez
d11c1afc04
Rename String::is_rel_path to String::is_relative_path 2021-08-29 20:41:29 -04:00
Fabio Alessandrelli
4123612eeb [Editor] Add "--debug-server <uri>" option.
Allow starting the editor debugger server for the given protocol (and
optionally bound to the given ip/port combination:

godot -e --debug-server tcp://*:8080
2021-08-29 18:03:20 +02:00
Lyuma
31f790299c Use OrderedHashMap for autoloads to preserve order 2021-08-26 21:55:26 -07:00
Michael Alexsander
88db541705
Merge pull request #51947 from AnilBK/redundant-assignments
[cppcheck] Remove some redundant assignments.
2021-08-23 13:23:45 +00:00
Hugo Locurcio
337574d7f2
Merge pull request #37260 from Calinou/define-minimum-window-size
Define a default minimum window size to workaround rendering issues
2021-08-22 09:08:33 +02:00
Hugo Locurcio
9396d408c8
Merge pull request #36872 from Calinou/default-stretch-aspect-expand
Use the `keep` stretch aspect by default
2021-08-22 08:30:21 +02:00
Hugo Locurcio
f02a040d48
Define a default minimum window size to workaround rendering issues
The minimum window size can still be set to `Vector2(0, 0)` in a script
if needed.

This closes #37242.
2021-08-22 08:19:49 +02:00
Anilforextra
c86db8b710 Remove redundant assignments.
Use used_in_transfer instead of used_in_compute twice.
2021-08-21 19:20:07 +05:45
Pedro J. Estébanez
abdfbef075 Add project setting for agile input event flushing
If enabled, key/touch/joystick events will be flushed just before every idle and physics frame.

Enabling this can greatly improve the responsiveness to input, specially in devices that need to run multiple physics frames per each idle frame, because of not being powerful enough to run at the target frame rate.

This will only work for platforms using input buffering (regardless event accumulation). Currenly, only Android does so, but could be implemented for iOS in an upcoming PR.
2021-08-13 11:45:50 +02:00
Pedro J. Estébanez
dc187324be Add input buffering framework
Input buffering is implicitly used by event accumulation, but this commit makes it more generic so it can be enabled for other uses.

For desktop OSs it's currently not feasible given main and UI threads are the same).
2021-08-13 11:19:19 +02:00
Rémi Verschelde
62047e4e48
Merge pull request #51486 from reduz/fixes-to-mobile-renderer
Fixes and optimizations to mobile renderer
2021-08-11 15:19:11 +02:00
reduz
ca117910da Fixes and optimizations to mobile renderer
* Only apply final actions to attachments used in the last pass.
* Fixes to draw list final action (was using continue instead of read/drop).
* Profiling regions inside draw lists now properly throw errors.
* Ability to enable gpu profile printing from project settings. (used to debug).
2021-08-10 23:17:28 -03:00
Hugo Locurcio
937c1a716c
Rename iterations_per_second to physics_ticks_per_second
This makes it clearer that this property is only about physics FPS,
not rendering FPS.

The `physics_fps` project setting was also renamed to
`physics_ticks_per_second` for consistency.
2021-08-11 02:37:02 +02:00
Fabio Alessandrelli
09386ba9fd [Headless] Add --headless switch (no rendering, no audio).
Also remove now unused "--no-window" option, and relative OS getter and
setter.
2021-08-03 17:45:50 +02:00
Hugo Locurcio
9c34db6cb4
Print a warning when the engine is started as root/superuser
This is a security risk (especially when hosting a game server)
and can make audio non-functional on Linux.
2021-07-31 16:23:26 +02:00
Aaron Franke
4ecb6fba80
Use doubles for time everywhere in Timer/SceneTree 2021-07-26 02:00:48 -04:00
Rémi Verschelde
2b1e6e303e
Merge pull request #50786 from reduz/implement-resource-uids
Implement Resource UIDs
2021-07-24 17:18:12 +02:00
reduz
32b43cfeb3 Implement Resource UIDs
* Most resource types now have unique identifiers.
* Applies to text, binary and imported resources.
* File formats reference both by text and UID (when available). UID always has priority.
* Resource UIDs are 64 bits for better compatibility with the engine.
* Can be represented and used textually, example `uuid://dapwmgsmnl28u`.
* A special binary cache file is used and exported, containing the mappings.

Example of how it looks:

```GDScript
[gd_scene load_steps=2 format=3 uid="uid://dw86wq31afig2"]

[ext_resource type="PackedScene" uid="uid://bt36ojelx8q6c" path="res://subscene.scn" id="1_t56hs"]
```

GDScript, shaders and other special resource files can't currently provide UIDs, but this should be doable with special keywords on the files.
This will be reserved for future PRs.
2021-07-24 09:16:52 -03:00
Aaron Franke
4e6efd1b07
Use C++ iterators for Lists in many situations 2021-07-23 17:38:28 -04:00
bruvzg
618eb27e8b Move alert function from DisplayServer to OS. 2021-07-22 21:50:35 +03:00
Hugo Locurcio
c9c5eec6f9
Enable single-window mode by default in projects
There are many issues with using multiple windows by default:

- Taking screenshots of a specific window will not capture subwindows.
  This also applies when recording a video using tools such as OBS.
- Subwindows may not behave correctly when fullscreen mode is enabled,
  especially if exclusive fullscreen is implemented in the future
  to decrease input lag on Windows.

"Subwindows" is quite general here, and also refers to dropdown menus
(e.g. those spawned by OptionButton) and Control tooltips.

Therefore, it's safer to embed subwindows by default in projects.
Multi-window mode remains the default in the editor.
2021-07-21 03:55:04 +02:00
reduz
cee905f04f Adds ability to debug stringnames
* References (which include hash tables) can be profiled with --debug-stringnames
2021-07-20 17:31:51 -03:00
reduz
5ad4f26659 Implement the ability to disable classes
* This PR adds the ability to disable classes when building.
* For now it's only possible to do this via command like:
  `scons disable_classes=RayCast2D,Area3D`
* Eventually, a proper UI will be implemented to create a build config file to do this at large scale, as well as detect what is used in the project.
2021-07-13 09:25:14 -03:00
Hendrik Brucker
74ab336fe3 Change VSync mode project setting enum type from string to integer 2021-07-12 03:35:51 +02:00
Hendrik Brucker
043ae91560 Restructure and reimplement vsync options
-Add a v-sync mode setting which allows to choose between DISABLED, ON, ADAPTIVE and MAILBOX
-Removed the V-Sync via Compositor option
2021-07-06 16:34:26 +02:00
reduz
6c55d2aad2 Fix Render Info
* Fixed and redone the process to obtain render information from a viewport
* Some stats, such as material changes are too difficult to guess on Vulkan, were removed.
* Separated visible and shadow stats, which causes confusion.
* Texture, buffer and general video memory can be queried now.
* Fixed the performance metrics too.
2021-07-03 10:15:04 -03:00
reduz
b1d15c51bc Implement native extension system
* Deprecates GDNative in favor of a simpler, lower level interface.
* New extension system allows registering core engine classes.
* Simple header interface in gdnative_interace.h
2021-06-25 17:32:45 -03:00
Lightning_A
e28fd07b2b Rename instance()->instantiate() when it's a verb 2021-06-19 20:49:18 -06:00
Hugo Locurcio
50187eb272
Use the keep stretch aspect by default
This makes Godot avoid distortion when resizing the window to an aspect
ratio that doesn't match the project's base aspect ratio.

Since this setting has no effect when the stretch mode is `disabled`
(the default), this won't impact projects not using the `canvas_items`
or `viewport` stretch modes.
2021-06-19 04:47:19 +02:00
Rémi Verschelde
aa2215e681
Main: Fixup bogus fallback to project manager with more bolognese
WARNING: Hacks everywhere!

The logic in `main.cpp` is due a full rewrite as it's extremely hacky,
splitting argument parsing over several functions, with a mess of global state
and assumptions about what combinations of arguments or lack thereof should
mean in terms of what we want to read: game, editor, project manager, or
command line tools such as `--doctool`, `--export` or `--script`.

Until this is fully rewritten, this patch hacks things some more to ensure
that we don't fall back to the project manager in cases where it's not
warranted, and especially not *too late*, as it can mean that we haven't
properly initialized stuff like `EditorPaths` needed by the PM (which in turn
impacts what kind of path will be used for logs and the shader cache, etc...
the rabbit hole goes deep).

Fixes #41435.
Fixes #49392.
Fixes #49658.
Fixes https://github.com/godotengine/godot/issues/38202#issuecomment-773158477.
2021-06-16 19:11:08 +02:00
Rémi Verschelde
529bf43134
Merge pull request #49432 from Calinou/tweak-physics-fps-property-hint
Tweak the physics FPS property hint to only allow reasonable values
2021-06-15 15:19:24 +02:00
Rémi Verschelde
1074017f04
Refactor editor paths validation in EditorPaths and EditorSettings
- EditorSettings: Ensure that `create()` makes a valid singleton.
  Fixes #49179, fixes #49450.
- EditorPaths: Cleanup code, properly set `paths_valid`.
- EditorPaths: Move more paths validation (check, mkdir) from
  EditorSettings for a better separation of concerns.
- EditorPaths: Move EditorFileSystem creation of `.godot/imported`
  next to other paths.
2021-06-14 19:56:20 +02:00
Rémi Verschelde
ac73059b56
Merge pull request #49123 from aaronfranke/it-is-time
Add a Time singleton
2021-06-12 22:55:25 +02:00
Aaron Franke
f64fea1b23
Add Time singleton 2021-06-11 09:32:39 -04:00
Rémi Verschelde
9e328bb5b7
Core: Move DirAccess and FileAccess to core/io
File handling APIs are typically considered part of I/O, and we did have most
`FileAccess` implementations in `core/io` already.
2021-06-11 14:52:39 +02:00
Hugo Locurcio
8f4ac7bc4a
Tweak the physics FPS property hint to only allow reasonable values
Physics FPS above 1000 cause the whole project to slow down
and are not very practical in the first place (since no CPU currently
available can keep up).
2021-06-08 19:52:48 +02:00
reduz
0d2e02945b Implement shader caching
* Shader compilation is now cached. Subsequent loads take less than a millisecond.
* Improved game, editor and project manager startup time.
* Editor uses .godot/shader_cache to store shaders.
* Game uses user://shader_cache
* Project manager uses $config_dir/shader_cache
* Options to tweak shader caching in project settings.
* Editor path configuration moved from EditorSettings to new class, EditorPaths, so it can be available early on (before shaders are compiled).
* Reworked ShaderCompilerRD to ensure deterministic shader code creation (else shader may change and cache will be invalidated).
* Added shader compression with SMOLV: https://github.com/aras-p/smol-v
2021-05-31 10:13:09 +02:00
Hugo Locurcio
660952a857
Use an enum to represent screen orientation in the Project Settings
- Tweak the setting property hint to be more informative.
- Make the setting a "basic" setting so it appears when Advanced Settings
  is disabled.
- Remove redundant orientation setting in the iOS export preset.
  The project setting is now used (like on Android).

Projects upgrading from a previous version will have to set the
screen orientation again in the Project Settings if it wasn't set
to the default value ("landscape").
2021-05-24 18:53:10 +02:00
bruvzg
11ccfad1aa
[macOS] Prefer .app bundle icon over the default one. 2021-05-13 09:25:09 +03:00
Hugo Locurcio
cf1e30a2ed
Tweak CanvasItem/material sampling property hints for readability
The "Anisotropic" term is abbreviated as spelling it out would cause
the PopupMenu to overflow the editor window when using the default
inspector width.
2021-05-06 03:05:37 +02:00
bruvzg
b56241f22f
ICU: Update to version 69.1, improve ICU data export process. 2021-04-22 16:56:53 +03:00
Rémi Verschelde
200d9a734c
Merge pull request #47701 from vnen/gdscript-test-runner 2021-04-16 10:34:39 +02:00
totlmstr
634ed3e128 Add option modules_enabled_by_default 2021-04-10 14:17:20 -07:00
Hugo Locurcio
157d8e4d36
Improve command line --print-fps display
- Display the frame time in addition to FPS.
  - Frame time is a more objective measurement in comparison to FPS,
    but FPS is more familiar to people less acquainted with profiling.
- Rename "Game" to "Project" for the project FPS printing line.
2021-04-09 14:59:10 +02:00
George Marques
c165814d36
Set up PackedData when setting up tests
Some tests need functions of ProjectSettings that rely on this being
available.
2021-04-08 09:35:06 -03:00
Rémi Verschelde
096ef0dc91
Main: Default --doctool path to '.' if none given 2021-04-06 10:23:50 +02:00
Hugo Locurcio
6c9259ff2f
Fix feature tag casing in the Windows pen tablet project setting name
Feature tags are case-sensitive.
2021-03-22 14:18:48 +01:00
Hugo Locurcio
ff2871f9ac
Tweak the editor splash screen color to better match the default theme
This helps achieve a visually "smoother" transition between the splash
screen and the editor.
2021-03-17 22:57:35 +01:00
Anshul7sp1
91181c2086 Fixes small typos and grammar correction 2021-03-12 19:05:16 +05:30
Johannes
2ac9f37b17
Move cursor shape loading after module loading
fixes #46685
2021-03-05 17:22:06 +01:00
Mateo Kuruk Miccino
89283b7b53 Logger: Cache 'flush_stdout_on_print' to improve performance, and works before ProjectSettings starts.
ProjectSetting: Now 'application/run/flush_stdout_on_print' requires a restart of the Editor to take effect
2021-02-28 19:36:10 -03:00
Emmanuel Leblond
60d2c1fd47
Remove GDScript bindings for OS.get/set_exit_code, SceneTree.quit(<exit_code>) should be used instead 2021-02-25 18:34:50 +01:00
Rémi Verschelde
88ee248db0
Merge pull request #46307 from RandomShaper/fix_crash_mono_glue
Make glue generation shutdown more graceful
2021-02-22 21:39:01 +01:00
Rémi Verschelde
a0cb81b119
Merge pull request #46313 from goostengine/tests-init-translation-server
Initialize `TranslationServer` in the test environment
2021-02-22 15:46:04 +01:00
Andrii Doroshenko (Xrayez)
c7b91309f2 Initialize TranslationServer in the test environment 2021-02-22 15:16:46 +02:00
Pedro J. Estébanez
23907e6f19 Make glue generation shutdown more graceful 2021-02-22 11:06:33 +01:00