Commit graph

483 commits

Author SHA1 Message Date
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
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 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 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
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
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
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
Michael Alexsander d12a8940cb Make possible to use just one "size/test_*" value in the settings 2019-10-04 10:27:11 -03: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
qarmin 17732fe698 Added some obvious errors explanations 2019-09-25 10:28:50 +02: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 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
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
Rémi Verschelde 0743a07447
Revert "Add Min/Max Window Size Setting" 2019-08-17 16:19:18 +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
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
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
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 a84124fd1d
Make --doctool create directories if they don't exist
This prevents errors due to missing directories when generating
engine documentation.

This closes #17297.
2019-07-04 17:01:07 +02:00
Rémi Verschelde 98e7ec1e26
Revert "Add godot version in backtrace message" 2019-07-01 13:58:57 +02:00
Rémi Verschelde d17eac735c
Merge pull request #29815 from NilsIrl/plus_file_1
Replace ` + "/" + ` with `String::file_add()`
2019-07-01 12:06:35 +02:00
Rémi Verschelde 336010d676
Merge pull request #28572 from lupoDharkael/trace-info
Add godot version in backtrace message
2019-07-01 09:44:53 +02:00
Rémi Verschelde b0809046be
Merge pull request #30154 from bojidar-bg/30149-export-flag-editor
Ensure --export implies --editor
2019-06-29 18:16:43 +02:00
Bojidar Marinov 9ebc146383
Ensure --export implies --editor
Fixes #30149
2019-06-28 15:34:09 +03:00
Bojidar Marinov 0c4c36d823
Add default values to the editor help, docs, and generated RST
Also, make spacing of "=" in the editor help a bit more consistent.
Closes #16086
2019-06-27 18:29:35 +03:00
Rémi Verschelde eaaff9da31
Merge pull request #29941 from qarmin/redundant_code_and_others
Remove redundant code, possible NULL pointers and others
2019-06-27 01:05:18 +02:00
qarmin 4e5310cc60 Some code changed with Clang-Tidy 2019-06-26 15:08:25 +02:00
Nils ANDRÉ-CHANG d2833d4f4d Replace + "/" + with String::file_add() 2019-06-23 13:33:50 +01:00
Luka Dornhecker ad504b926f Add option to toggle console window on Windows
This is an editor setting and its value can also be toggled
using an entry in the Editor toolbar. The console will still
appear briefly when starting the project manager or editor,
as it's still compiled as console application.

Does not impact exported games, which will still run without
console in release and with console in debug mode.

A project setting or export option could be added to disable
it in debug mode if there's demand for it, but that would
greatly reduce the usefulness of debug builds if Windows users
can no longer report error and crash messages.

Fixes #17889.

Co-authored-by: Rémi Verschelde <rverschelde@gmail.com>
2019-06-20 16:55:52 +02:00
Rémi Verschelde d2f38dbb28
Merge pull request #29470 from KoBeWi/_
Add a separator in debug output for readability
2019-06-19 00:19:14 +02:00
Rémi Verschelde 6ba1b4e371
Merge pull request #29764 from Calinou/boot-splash-no-filter-option
Add an option to disable boot splash filtering
2019-06-16 10:39:53 +02:00
Hugo Locurcio 786a7341a7
Add an option to disable boot splash filtering
Disabling filtering is usually desired in projects using a pixel art style.

This closes #19415.
2019-06-15 23:53:39 +02:00
Emmanuel Barroga 2cce5699ea Limit Physics Process FPS above 0
Resolves: #19734
2019-06-13 08:53:48 -07:00
Rémi Verschelde 0e6cac8ab8
Merge pull request #29465 from bruvzg/per_pixel_transp_impr
Removes redundant "splash" setting, improves per pixel transparency documentation.
2019-06-12 12:50:17 +02:00
Rémi Verschelde 6d16f2f053 Fix error macro calls not ending with semicolon
It's not necessary, but the vast majority of calls of error macros
do have an ending semicolon, so it's best to be consistent.
Most WARN_DEPRECATED calls did *not* have a semicolon, but there's
no reason for them to be treated differently.
2019-06-11 14:49:34 +02:00
Tomasz Chabora c478f2cb1a Add a separator in debug output for readability 2019-06-04 15:20:37 +02:00
bruvzg 54863b20e6
Removes redundant "display/window/per_pixel_transparency/splash" setting, improves per pixel transparency documentation. 2019-06-04 11:21:29 +03:00
Hugo Locurcio dc981d8af7
Display longer Git hashes in engine version dialogs
Due to the high number of commits in the Godot repository,
7-character hashes were starting to become occasionally ambiguous.

In contrast, 9-character hashes are currently unambiguous for
all commits.
2019-06-01 13:52:58 +02:00
Rémi Verschelde af2c742f53 Fix and expose String::strip_escapes(), use it in LineEdit paste
Supersedes #27736.
2019-05-31 15:49:14 +02:00
Rémi Verschelde b10dd110e5 Print engine version to stdout when starting Godot
Also include website URL and make it configurable via version.py
together with the rest of the engine branding.

Add mention to MIT license in --help output.
2019-05-28 11:19:21 +02:00
Rémi Verschelde e8fbb28e20
Merge pull request #29119 from bruvzg/native_icon_support
Add native window/taskbar icon support for Windows and macOS.
2019-05-27 12:09:42 +02:00
Rémi Verschelde a1a71c05ba
Merge pull request #28993 from Calinou/server-hide-noop-cli-arguments
Hide non-applicable CLI arguments in the server platform
2019-05-24 22:56:29 +02:00