Commit graph

1080 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
Rémi Verschelde
5002f6de84
Merge pull request #36599 from AndreaCatania/gen_rpc_data_export
Generates the rpc and rset info for exported GDScript.
2020-03-13 10:19:30 +01:00
Rémi Verschelde
e147be6031
Merge pull request #36723 from AndreaCatania/fix-rset
Fixed rset method for gdscript and visual script
2020-03-13 10:18:56 +01:00
luz.paz
7bf6e5f773 Fix various typos
Found via `codespell`
2020-03-11 13:59:18 -04:00
Rémi Verschelde
cdbf033290
Merge pull request #36704 from ThakeeNathees/gdscript-duplicate-args-fix
GDScript duplicate arguments bug fixed
2020-03-10 13:10:00 +01:00
Rémi Verschelde
57ab10ccf3
Merge pull request #36767 from ThakeeNathees/class-pass-fix
fix: Classes can't have pass
2020-03-10 13:08:27 +01:00
Rémi Verschelde
95c9345b63
Merge pull request #36859 from ThakeeNathees/logic-error-for-loop-range-parsing
Fix: logic error in gdscript_parser.cpp for-loop-range
2020-03-10 13:08:01 +01:00
Rémi Verschelde
478337c412
Merge pull request #36751 from Faless/debugger/threads_and_profilers
ScriptDebugger refactor, threading, profilers.
2020-03-09 19:08:07 +01:00
Rémi Verschelde
d9524d8890
Merge pull request #36912 from Xrayez/resurrect-module-icons
Fix missing module editor icons
2020-03-09 12:15:44 +01:00
Andrii Doroshenko (Xrayez)
3acebdeecd Fix missing module editor icons
Module icons need to be renamed to PascalCase as well
for them to be registered in 4.0.

See godotengine/godot#36513.
2020-03-08 19:32:25 +02:00
Rémi Verschelde
7579a792be
Merge pull request #36683 from rafaeldelboni/master
Return only scenes for script owners on LSP completion
2020-03-08 16:19:31 +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
Rafael Delboni
2f08f4ef4e
fix: Return only scenes for script owners on LSP completion
Fix: #36680
2020-03-07 09:17:25 -03:00
Thakee Nathees
bcbcf0f1ea logic error in gdscript_parser.cpp for-loop-range
there was a logic error in for loop range argument that
check if all of the argument were constants, fixed
2020-03-06 23:14:21 +05:30
Thakee Nathees
5424b626f9 duplicate arguments in a function handled 2020-03-06 20:23:58 +05:30
Thakee Nathees
07c99340d1 typo in gdscript_workspace.cpp/remove_cache_parser() fixed 2020-03-05 20:51:02 +05:30
Thakee Nathees
63ce1fc438 pass keyword inside a class implemented 2020-03-05 16:19:06 +05:30
Andrea Catania
e967a92c1b Fixed rset method for gdscript and visual script 2020-03-02 10:22:07 +01:00
Juan Linietsky
475e4ea67b Removed interactive loader, added proper thread loading. 2020-02-28 11:20:45 -03:00
Andrea Catania
33ae58710b Generates the rpc and rset info for exported GDScript.
Improved the send rpc log message when fail.

This work has been kindly sponsored by IMVU.
2020-02-28 12:39:18 +01:00
Rémi Verschelde
807b511125
Merge pull request #36620 from Calinou/doc-linear2db-example
Add a practical example for `@GDScript.linear2db()`
2020-02-28 07:03:35 +01:00
Rémi Verschelde
ec74664af1
Merge pull request #36619 from Calinou/doc-improve-inverse-lerp
Improve the `@GDScript.inverse_lerp()` documentation
2020-02-28 07:02:03 +01:00
Rémi Verschelde
b7b3978684
Merge pull request #36556 from RandomShaper/rework_mutex
Reimplement `Mutex` with C++'s `<mutex>` (plus more)
2020-02-28 00:26:01 +01:00
Hugo Locurcio
a6fd6b78dd
Add a practical example for @GDScript.linear2db()
One of its most common applications in games is for volume sliders.

See https://www.dr-lex.be/info-stuff/volumecontrols.html for
more information.
2020-02-27 22:52:21 +01:00
Hugo Locurcio
6b5573700b
Improve the @GDScript.inverse_lerp() documentation
This closes https://github.com/godotengine/godot-docs/issues/2589.
2020-02-27 22:49:05 +01:00
Rémi Verschelde
ac446570d6
Merge pull request #36545 from nathanwfranke/syntax-highlight-int-types
Fix autocomplete and highlighting for new integer types
2020-02-27 14:20:10 +01:00
nathanwfranke
2dd498df70 Fix autocomplete and GDScript Highlighting for types
Types include new integer types and others
2020-02-26 16:13:28 -06:00
Pedro J. Estébanez
18fbdbb456 Reimplement Mutex with C++'s <mutex>
Main:
- It's now implemented thanks to `<mutex>`. No more platform-specific implementations.
- `BinaryMutex` (non-recursive) is added, as an alternative for special cases.
- Doesn't need allocation/deallocation anymore. It can live in the stack and be part of other classes.
- Because of that, it's methods are now `const` and the inner mutex is `mutable` so it can be easily used in `const` contexts.
- A no-op implementation is provided if `NO_THREADS` is defined. No more need to add `#ifdef NO_THREADS` just for this.
- `MutexLock` now takes a reference. At this point the cases of null `Mutex`es are rare. If you ever need that, just don't use `MutexLock`.
- Thread-safe utilities are therefore simpler now.

Misc.:
- `ScopedMutexLock` is dropped and replaced by `MutexLock`, because they were pretty much the same.
- Every case of lock, do-something, unlock is replaced by `MutexLock` (complex cases where it's not straightfoward are kept as as explicit lock and unlock).
- `ShaderRD` contained an `std::mutex`, which has been replaced by `Mutex`.
2020-02-26 20:40:10 +01:00
Rémi Verschelde
c1fe53a933
Merge pull request #36521 from rafaeldelboni/master
Improve LSP completion using scene owner
2020-02-26 08:24:59 +01:00
Rafael Delboni
06bce137e3
Improve LSP completion using scene owner
Fixes: #36473
2020-02-25 23:27:17 -03: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
Oliver Frank
ed482f6167 Fix crash after closing a GDScript LSP session 2020-02-23 19:25:41 +00:00
Rémi Verschelde
bd10c70458
Merge pull request #36461 from akien-mga/c++17-fallthrough-attribute
Replace FALLTHROUGH macro by C++17 [[fallthrough]]
2020-02-23 08:43:18 +01:00
Rémi Verschelde
2cf6ac6c50 Replace FALLTHROUGH macro by C++17 [[fallthrough]]
This attribute is now part of the standard we target so we no longer
need compiler-specific hacks.

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

Fixes new warnings raised by Clang's -Wimplicit-fallthrough.
2020-02-23 00:52:50 +01:00
Juan Linietsky
6da0eef9e6 Add support for Vector2i, Rect2i and Vector3i to Variant
WARNING: Requires C++17 'guaranteed copy elision' to fix ambiguous
operator problems in Variant.

This was added for this commit (and future C++17 uses) in #36457.
2020-02-22 23:16:44 +01: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
of9
24b27043fe Migrating language server from Websockets to raw TCP 2020-02-20 11:21:43 +00: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
George Marques
4d960efafc
GDScript: Remove self static reference and create one on calls
This is needed because of the new changes to Variant. The reference
counter is increased by adding it to a Variant, which means no GDScript
will be freed (or will be double freed if manually freed somewhere).
2020-02-19 09:15:16 -03:00
Rémi Verschelde
213a85521d doc: Sync classref with current source
Handle removal of Pool*Array types and other recent changes.
2020-02-18 14:02:02 +01:00
Juan Linietsky
3205a92ad8 PoolVector is gone, replaced by Vector
Typed `PoolTypeArray` types are now renamed `PackedTypeArray` and are
sugar for `Vector<Type>`.
2020-02-18 10:10:36 +01:00
Juan Linietsky
867d073b98 Changed logic and optimized ObjectID in ObjectDB and Variant, removed RefPtr. 2020-02-15 08:36:04 -03:00
Rémi Verschelde
54ac8eaba6 Remove more deprecated methods and code 2020-02-13 12:37:45 +01:00
Rémi Verschelde
1f39a2d3e6 Remove deprecated sync and slave networking keywords
Those keywords were deprecated for 3.1 in #22087.

Also fix token name for `TK_REMOTE`, should be "remote" like the keyword.
2020-02-13 08:59:36 +01:00
Rémi Verschelde
506df14595
Merge pull request #36142 from akien-mga/remove-deprecated-decimals
Remove deprecated decimals builtin
2020-02-12 21:48:33 +01:00
Juan Linietsky
cf8c679a23 ObjectID converted to a structure, fixes many bugs where used incorrectly as 32 bits. 2020-02-12 14:24:54 -03:00
Rémi Verschelde
0f90ddbcf4
Merge pull request #35522 from AndreaCatania/rpc_opt_2
Optmized data sent during RPC and RSet calls.
2020-02-12 16:56:17 +01:00
Rémi Verschelde
bd78b9f445 Remove deprecated decimals builtin
Replaced by 'step_decimals' in 3.2 via #21425.
2020-02-12 13:39:39 +01:00
Andrea Catania
eb07e87981 Optmized data sent during RPC and RSet calls.
- Now is sent the method ID rather the full function name.
- The passed IDs (Node and Method) are compressed so to use less possible space.
- The variant (INT and BOOL) is now encoded and compressed so to use much less data.
- Optimized RPCMode retrieval for GDScript functions.
- Added checksum to assert the methods are the same across peers.

This work has been kindly sponsored by IMVU.
2020-02-12 13:36:47 +01:00
geequlim
03d2d01082 Fix hover symbol content position 2020-02-12 17:59:20 +08:00