Commit graph

134 commits

Author SHA1 Message Date
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
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
Rémi Verschelde f742dabafe Signals: Manually port most of remaining connect_compat uses
It's tedious work...

Some can't be ported as they depend on private or protected methods
of different classes, which is not supported by callable_mp (even if
it's a class inherited by the current one).
2020-02-28 14:24:09 +01:00
Rémi Verschelde 01afc442c7 Signals: Port connect calls to use callable_mp
Remove now unnecessary bindings of signal callbacks in the public API.
There might be some false positives that need rebinding if they were
meant to be public.

No regular expressions were harmed in the making of this commit.
(Nah, just kidding.)
2020-02-28 14:24:09 +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
Juan Linietsky 3c0059650d Added StringName as a variant type.
Also changed all relevant properties defined manually to StringName.
2020-02-21 14:25:29 +01:00
Fabio Alessandrelli cbc450c0e5 Huge Debugger/EditorDebugger refactor. 2020-02-21 11:12:03 +01:00
Juan Linietsky 69c95f4b4c Reworked signal connection system, added support for Callable and Signal objects and made them default. 2020-02-20 08:24:50 +01:00
Rémi Verschelde 49fec646cb Fix compilation warnings and re-enable werror=yes on Travis
Fix -Wunused-variable, -Wunused-but-set-variable and -Wswitch warnings
raised by GCC 8 and 9.

Fix -Wunused-function, -Wunused-private-field and
-Wtautological-constant-out-of-range-compare raised by Clang.

Fix MSVC 2019 warning C4804 (unsafe use of type 'bool' in comparison
operation).

GCC -Wcpp warnings/Clang -W#warnings (`#warning`) are no longer raising
errors and will thus not abort compilation with `werror=yes`.

Treat glslang headers are system headers to avoid raising warnings.

Re-enables us to build with `werror=yes` on Linux and macOS, thus
catching warnings that would be introduced by new code.

Fixes #36132.
2020-02-18 20:51:25 +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 dd3682e5fe Modernized default 3D material, fixes material bugs. 2020-02-11 12:01:24 +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 449df8f688 Base 3D engine done, still untested, though. 2020-02-11 11:59:25 +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 6472e09a85 SceneTree: Abort change_scene if we're quitting
Otherwise we can have a segmentation fault if we try to call
`add_child` on an already freed node.

Fixes #35323.
2020-01-19 22:08:40 +01:00
Rémi Verschelde eb89254690 Fix crash when confirming dialogs with Return key
Regression from #34040, apparently making this a const reference
introduces issues (not sure why, but previous code worked fine).

Fixes #34691.

Co-authored-by: dankan1890 <mewuidev2@gmail.com>
2020-01-17 12:47:23 +01:00
Hugo Locurcio cc626acf45
Add a shorthand for setting the exit code using SceneTree::quit()
This reduces the amount of code required to exit a process with a
non-zero exit code. This pattern is also found in most other
programming languages.
2020-01-03 11:41:46 +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
Rafał Mikrut ed1c4bc77d Removed unused variables, add some constants numbers 2019-12-10 05:13:02 +01:00
Holger Dammertz 1b9c2ec92e Rename External MSAA to AndroidVR MSAA
A new external MSAA setting was introduced in https://github.com/godotengine/godot/pull/33518
that fixed issues on GLES2 and Oculus Mobile VR. To avoid misunderstanding it was suggested
by @BastiaanOlij and discussed on discord to rename it to AndroidVR.
2019-11-16 15:36:43 +01:00
Bastiaan Olij 4e2343160c Add special external MSAA modes for GLES2 Rift S/Quest and OpenXR optimisation 2019-11-11 21:02:06 +11: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
PouleyKetchoupp 1a9801f700 Fixed leak on exit when using yield with SceneTreeTimer
Use case:
yield(get_tree().create_timer(2), "timeout")

Some resources were never released because the SceneTreeTimer was keeping a reference to GDScriptFunctionState in its signal connections, while GDScriptFunctionState was holding a reference to the SceneTreeTimer object. Cleaning all signal connections on game exit fixes the issue.

Fixes #29946
2019-10-19 18:45:17 +02:00
qarmin 616ab4fac2 Small fixes to redundand code, copy paste bugs 2019-10-14 11:40:55 +02:00
Rémi Verschelde 7e3dcf54ea
Merge pull request #30919 from nekomatata/timer-update-transform-fix
Fix GPU particle transform delay when created on SceneTree timer timeout
2019-10-01 06:54:09 +02:00
fhuya a7712cc9e4 Add new events and accompanying logic to notify when the app is paused and resumed on Android devices. 2019-09-19 13:29:49 -07:00
Fabio Alessandrelli 768d637a1b
Merge pull request #31870 from JFonS/add_network_profiler
Add network profiler
2019-09-05 16:34:36 +02:00
jfons 8244f535cd Add network profiler 2019-09-05 09:48:36 +02:00
Tomasz Chabora 892318f5c7 Add autocomplete support for change_scene() 2019-09-02 19:07:02 +02:00
bruvzg db6d4352ea
[macOS] Add methods to modify global and dock menus. Add ability to open multiple editor/project manager instances, recent/favourite project list to project manager dock menu and opened scene list to editor dock menu. 2019-08-26 16:45:49 +03:00
Tomasz Chabora af5e0fff66 Remove ERR_EXPLAIN from scene/* code 2019-08-09 13:54:52 +02:00
merumelu dcd551bf78 Remove Editor dependency from SceneTree 2019-08-05 19:46:23 +02:00
PouleyKetchoupp c6b82f108a Update transforms after timers update to make sure changes are made before render
Fixes #29952
2019-07-29 12:44:16 +02:00
qarmin aab8da25ad Fix some code found by Coverity Scan and PVS Studio 2019-07-23 09:14:31 +02:00
Rémi Verschelde 21a2cd1a04
Merge pull request #23270 from silvanocerza/remote_scene_tree_filter
Implemented remote scene tree filtering
2019-07-19 15:38:07 +02:00
qarmin 01cc7a996b Use reference to constant in functions 2019-07-10 11:54:12 +02:00
Bojidar Marinov f7dad789e9
Fix various memory leaks and errors 2019-07-02 17:23:54 +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 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
Silvano Cerza f23e1aab34 Implemented remote scene tree filtering
User can now filter the remote scene tree, like the local one is filtered, while
the game is running
2019-05-27 17:46:57 +02:00
PouleyKetchoupp 3f174c86d0 Fixed scene tree update after changing node name in tool script 2019-05-24 15:27:22 +02:00
Rémi Verschelde 79040656e1
Merge pull request #27869 from jean-dao/scenetree_call_group
Fix: use function in SceneTree::call_group
2019-04-30 10:55:05 +02:00
Aaron Franke b659e1eb2b
Use approximate equallity methods in many places 2019-04-25 13:20:29 -04:00
Jean Dao 7240701ec9 Fix: use function in SceneTree::call_group
When calling call_group from C++, the function name is not passed on to
call_group_flags, resulting in first argument being mistakenly used
instead of function.
2019-04-09 22:06:33 +02:00
Juan Linietsky a18989602b Clean up notifications and merge Node and MainLoop ones for clarity, closes #27614 2019-04-04 10:34:41 -03:00
Hugo Locurcio 355d65aa8d
Fix a font oversampling warning being printed when it shouldn't 2019-01-31 19:49:10 +01:00
Juan Linietsky c2f59de212 Warn of invalid pointer when converting object to RID, closes #19023 2019-01-26 15:41:26 -03:00