Commit graph

3169 commits

Author SHA1 Message Date
Rémi Verschelde 220c8e8344 callable_mp: Fix non-debug branch
Was missed in #36393 because no `callable_mp()` calls were actually
compiled with `tools=no` in that PR.

Also work around GCC warning that also affects the
`call_with_variant_args_ret_helper` variant.
2020-02-23 23:48:44 +01:00
Juan Linietsky 88f84c78ca Store arrays inside of Variant as shared.
Arrays inside of Variant are unique and use reference counting.
When you assign a variant containing a packed array to another, or
when you call non const functions to arrays, this will work even
if the array is inside a dictionary, so they will from now pass
as reference.

The difference with regular variant arrays is that, once passed
to a function in the C++ API, they are no longer shared. This is
required for security and thread safety, as those arrays are
mainly used to pass data back and forth even between threads.
2020-02-23 22:42:26 +01:00
PouleyKetchoupp a5505ce643 Fixed crash when connecting a signal in GDScript 2020-02-23 10:06:13 +01: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
SeleckyErik 4a8cb4a818 Fix Variant to Vector<Variant> conversion operator 2020-02-21 19:10:44 +00:00
Rémi Verschelde a77c862b18
Merge pull request #36400 from reduz/variant-string-name
Added StringName as a variant type.
2020-02-21 16:48:29 +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
Juan Linietsky 04bb6a708a Created the callable_mp macro, for signals to call method pointers directly. 2020-02-21 13:46:45 +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
nathanwfranke a31bc1b0ba Fix two signal errors
Update
2020-02-19 15:22:34 -06:00
Rémi Verschelde 4581a9373c
Merge pull request #36359 from vnen/variant-reference-fix
Fix Ref(Variant) constructor to properly check the object type
2020-02-19 16:51:32 +01:00
George Marques cb0b5eae8c
Fix Ref(Variant) constructor to properly check the object type
Otherwise it was saving any reference as valid, regardless of type.
2020-02-19 10:58:00 -03:00
George Marques d490648168
Revert "ClassDB: Workaround double-free for GDScript"
This reverts commit 8312ead0d9.
2020-02-19 09:14:39 -03:00
Rémi Verschelde 27326f8238
Merge pull request #36296 from Faless/dtls/enet_vulkan
DTLS support + optional ENet encryption
2020-02-18 15:01:53 +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
Fabio Alessandrelli 6fc50d785e New PacketPeerDTLS and DTLSServer classes.
Custom instance implementation via the mbedtls module.
2020-02-17 12:03:47 +01:00
Rémi Verschelde 8312ead0d9 ClassDB: Workaround double-free for GDScript
This is a temporary hack until vnen and reduz can work on a proper fix.
The changes in 867d073b98 exposed a
GDScript issue, which apparently triggers an automatic unreferencing.

This hack only makes it possible to use the editor again, but GDScript
is still broken.
2020-02-17 11:55:39 +01:00
Fabio Alessandrelli c4f6ab85b0 UDPServer and PacketPeerUDP connect_to_host.
UDP sockets can be "connected" to filter packets from a specific source.
In case of a bound socket (e.g. server), a new socket can be created on
the same address/port that will receive all packets that are not
filtered by a more specific socket (e.g. the previously connect socket).

This way, a UDPServer can listen to new packets, and return a new
PacketPeerUDP when receiving one, knowing that is a "new client".
2020-02-16 01:11:30 +01:00
Fabio Alessandrelli 2811f07084 Add peek option to NetSocket recv_from. 2020-02-16 01:11:30 +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 3dea5fd631 Remove incomplete battery status/power API
It was initially implemented in #5871 for Godot 3.0, but never really
completed or thoroughly tested for most platforms. It then stayed in
limbo and nobody seems really keen to finish it, so it's better to
remove it in 4.0, and re-add eventually (possibly with a different API)
if there's demand and an implementation confirmed working on all
platforms.

Closes #8770.
2020-02-14 13:43:32 +01:00
Rémi Verschelde 54ac8eaba6 Remove more deprecated methods and code 2020-02-13 12:37:45 +01:00
Rémi Verschelde f1ac292084
Merge pull request #36169 from timothyqiu/memleak
Fixes some memory leaks
2020-02-13 11:28:35 +01:00
Rémi Verschelde 2f6ca917f7
Merge pull request #36174 from akien-mga/byebye-openghell-3
Remove obsolete GLES3 backend
2020-02-13 11:24:15 +01:00
Rémi Verschelde f505aae1d8
Merge pull request #36144 from akien-mga/remove-deprecated-allow-decoding
Remove deprecated PacketPeer allow_object_decoding
2020-02-13 10:48:38 +01: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
Rémi Verschelde 8d00a3a536 Remove deprecated PacketPeer allow_object_decoding
It was added for 3.2 in #27485 to preserve backwards compatibility,
but we can now remove it.

It is still needed in MultiplayerAPI as it's the only way to control
it for the internal put_var calls.
2020-02-13 09:02:41 +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
Haoyu Qiu a23a52db3f Fixes some memory leaks 2020-02-13 09:46:13 +08: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 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
Hanif Bin Ariffin 7bc1dc828f Remove deprecated Color::gray
It was marked to be removed in Godot 3.1.

Co-authored-by: Rémi Verschelde <rverschelde@gmail.com>
2020-02-12 11:22:33 +01:00
Rémi Verschelde 948d95897c
Merge pull request #36095 from timothyqiu/corrupted-resource
Fixes crash when resource file is corrupted
2020-02-11 21:35:03 +01:00
Rémi Verschelde db81928e08 Vulkan: Move thirdparty code out of drivers, style fixes
- `vk_enum_string_helper.h` is a generated file taken from the SDK
  (Vulkan-ValidationLayers).
- `vk_mem_alloc.h` is a library from GPUOpen:
  https://github.com/GPUOpen-LibrariesAndSDKs/VulkanMemoryAllocator
2020-02-11 14:08:44 +01:00
Juan Linietsky 2049dec79e Added normalmap guided roughness mipmap generator, and a global roughness limiter. 2020-02-11 12:16:01 +01:00
Juan Linietsky ee1e89f8c0 Modified rendering to use cluster instead of foward 2020-02-11 12:15:27 +01:00
Rémi Verschelde fff4240bb4 Fix code formatting issues and VS compilation
Also temporarily disable multicheck build so that we get a full build
even when there are style issues on Vulkan.

Fixes #33356.
2020-02-11 12:05:19 +01:00
Juan Linietsky da0457fa29 Several fixes to GIProbes 2020-02-11 12:04:56 +01:00
Pedro J. Estébanez e38ae8d7e4 Fix bugs in RID_Alloc
- Replace unintended `%` with `&`
- `get_owned_list()`: make thread-safe and fix logic
- Apply same logic fix to the destructor

Previously, the determination of owned RIDs was wrong. For instance, it could skip owned items or include duplicates in the list.

Avoids the engine crashing at exit.
2020-02-11 12:04:41 +01:00
Juan Linietsky 6ee2f5e6b6 More GIProbe work and fixes 2020-02-11 12:03:49 +01:00
bruvzg 26318f3bd1 Fix Vector3 ambiguities and out of bounds init. 2020-02-11 12:03:39 +01:00
Juan Linietsky acf0f6c8a7 GIProbes working. 2020-02-11 12:03:20 +01:00
Juan Linietsky 4aea9f74e6 Rewritten StreamTexture for better code reuse, added basis universal support 2020-02-11 12:02:36 +01:00
Juan Linietsky 123ee5995c Visual GPU profiler and related profiling support in Vulkan. 2020-02-11 12:01:26 +01:00
Juan Linietsky 6deffa62fb Several fixes to 3D rendering, and multimesh implementation. 2020-02-11 12:01:22 +01:00
Juan Linietsky 9d7b7f931b Reflection probes working 2020-02-11 12:01:21 +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
Rémi Verschelde 61cf68fb48 RID_Alloc: Fix locking in getornull and free early returns
Those missing unlocks were preventing the editor from starting.
2020-02-11 11:59:16 +01:00
Juan Linietsky dc3b47f3ab Vulkan/RD rasterizer now does clean exit. 2020-02-11 11:58:16 +01:00
Rémi Verschelde 6289e7d147 Merge pull request #29993 from bruvzg/vulkan
Initial Vulkan support for macOS (MoltenVK) and Windows
2020-02-11 11:57:40 +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 c613ead5fa Added a spinlock template as well as a thread work pool class.
Also, optimized shader compilation to happen on threads.
2020-02-11 11:53:29 +01:00
Juan Linietsky 0586e18449 Custom material support seems complete. 2020-02-11 11:53:29 +01:00
Juan Linietsky a7b2ac7bb1 Normalmapping and Specularmapping working in 2D engine
Added support for Sprite, AnimatedSprite and Polygon2D (should add for tileset eventually).
2020-02-11 11:53:28 +01:00
Juan Linietsky 1b4281b895 basic 2D engine is more or less working with Vulkan, including editor.
Still a lot to do
2020-02-11 11:53:27 +01:00
Juan Linietsky 42b44f43ee Basic 2D engine is more or less working, needs more work for editor to be usable. 2020-02-11 11:53:27 +01:00
Juan Linietsky 9b0dd4f571 A lot of progress with canvas rendering, still far from working. 2020-02-11 11:53:27 +01:00
Juan Linietsky 9ffe57a10e Modify RenderingDevice to use RIDs, now that they are O(1) 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
Juan Linietsky fd188ddd51 Initial work on Vulkan:
-Added VulkanContext
-Added an X11 implementation
-Added a rendering device abstraction
-added a Vulkan rendering device abstraction
-Engine does not work, only shows Godot logo (run it from bin/)
2020-02-11 11:53:26 +01:00
Rémi Verschelde 3e3f8a4761
Merge pull request #36097 from madmiraal/fix-c4715-warning
Prevent Visual Studio compiler throwing C4715: not all control paths return a value.
2020-02-11 11:43:58 +01:00
Haoyu Qiu 832a5c860b Fixes crash when resource file is corrupted 2020-02-11 17:29:25 +08:00
Marcel Admiraal 07d21b84a3 Refactor List operator[] to prevent compiler warnings.
Prevents GCC compiler throwing: control reaches end of non-void function.
Prevents Visual Studio throwing C4715: not all control paths return a value.
2020-02-11 10:29:01 +01:00
Rémi Verschelde 0b4b24883d
Merge pull request #33731 from madmiraal/fix-c4996-warning
Fix Visual Studio throwing C4996 warning in ustring.cpp.
2020-02-11 10:22:36 +01:00
Rémi Verschelde 6fb6405408
Merge pull request #36072 from RandomShaper/imvu/configfile_parse
Add ConfigFile::parse()
2020-02-11 09:21:45 +01:00
Rémi Verschelde b390ad5a64
Merge pull request #36073 from RandomShaper/imvu/fix_variantparser_eof
Fix VariantParser::StreamString EOF determination
2020-02-10 12:44:51 +01:00
Rémi Verschelde 0ead0eeabb Merge pull request #35301 from Calinou/improve-console-error-logging
Improve the console error logging appearance
2020-02-10 11:16:01 +01:00
Pedro J. Estébanez e5bd3b707f Add ConfigFile::parse() 2020-02-10 11:12:33 +01:00
Pedro J. Estébanez 521da75380 Fix VariantParser::StreamString EOF determination 2020-02-10 10:57:01 +01:00
sumit0190 c4dbd8a744 Read and write exported infs/nans correctly (#35388) 2020-02-09 00:46:13 -05:00
Rémi Verschelde b2a7c08cc4
Merge pull request #36011 from madmiraal/fix-33391
Remove do{ } while(0) wrapper around error macros.
2020-02-08 23:27:06 +01:00
Rémi Verschelde 3a5f45a6d1 Merge pull request #35682 from nathanwfranke/canvas-cull-control-fix
Fix bug where canvas culls things at origin with size 0
2020-02-08 14:14:10 +01:00
Marcel Admiraal d2b02a3d7b Remove do{ } while(0) wrapper around error macros.
As pointed out by Faless, a do{ } while(0) wrapper around a continue or
break just ends the do{ } while(0) loop. The do{ } while(0) loop exists
to enable the macro to be used as a function which requires a semicolon.

The alternative approach is to use an if(1) { } else ((void)0) wrapper.
Since the macro already has an if(unlikely(m_cond)) { } this patch simply
adds the else ((void)0) to this if statement instead.

For consistency all the macros have been updated in the same way, and
trailing else warnings corrected. However, the wrappers around ERR_PRINT
and WARN_PRINT were removed, because they generated too many ambiguous
trailing else warnings. They are also single line macros so a wrapper is
not needed.
2020-02-08 11:21:46 +01:00
nathanwfranke e5cb557b73 Fix bug where Control at origin with 0 size not rendered
Make a new method instead to make the code more elegant


Move Function down a bit
2020-02-07 14:43:27 -06:00
Rémi Verschelde b7297fb39c SCons: Generate header with info on which modules are enabled
We already had `MODULE_*_ENABLED` defines but only in the modules
environment, and a few custom `*_ENABLED` defines in the main env
when we needed the information in core.

Now this is defined in a single header which can be included in the
files that need this information.
2020-02-07 11:31:37 +01:00
Rémi Verschelde f120acceb8
Merge pull request #35887 from dankan1890/quick_fix
Fixed String::humanize_size crash.
2020-02-06 10:29:00 +01:00
Marcel Admiraal 677604685d Apply macro documentation from #35521. 2020-02-05 14:53:06 +01:00
Marcel Admiraal 110f4f2dc5 Remove trailing semicolons from do..while wrappers.
- Remove trailing semicolons from ERR_FAIL_INDEX macros.
- Remove trailing semicolons from ERR_FAIL_UNSIGNED_INDEX macros.
- Remove trailing semicolons from CRASH_BAD_INDEX macros.
- Remove trailing semicolons from CRASH_BAD_UNSIGNED_INDEX macros.
2020-02-05 11:19:40 +01:00
Marcel Admiraal 6d69cd40bd Add do..while(0) wrappers to macros without one.
- Add do..while(0) wrapper to ERR_FAIL_NULL macros.
- Add do..while(0) wrapper to ERR_FAIL_COND macros.
- Add do..while(0) wrapper to ERR_CONTINUE macros.
- Add do..while(0) wrapper to ERR_BREAK macros.
- Add do..while(0) wrapper to CRASH_COND macros.
- Add do..while(0) wrapper to ERR_FAIL macros.
- Add do..while(0) wrapper to ERR_PRINT macros.
- Add do..while(0) wrapper to WARN_PRINT macros.
- Add do..while(0) wrapper to WARN_DEPRECATED macros.
- Add do..while(0) wrapper to CRASH_NOW macros.
2020-02-05 11:19:12 +01:00
Marcel Admiraal f0db13502a Remove duplicate WARN_PRINT macro. 2020-02-05 11:13:24 +01:00
Marcel Admiraal 5af3b4ca27 Remove duplicate ERR_PRINT macro. 2020-02-05 11:13:24 +01:00
Marcel Admiraal 2b1084fab3 Clean up error_macros.h 2020-02-05 11:13:02 +01:00
dankan1890 ca0ee767cb Fixed String::humanize_size crash.
Close #35872
2020-02-03 17:59:24 +01:00
Rémi Verschelde 505fee0b6d Color: Fix deprecation warning mentioning 'get_v()' instead of 'v'
Fixes #35657.
2020-01-28 12:41:04 +01:00
Rémi Verschelde cab55bbb9d MessageQueue: Fix setting name in OOM error message
Cf. #35653.
2020-01-28 09:03:46 +01:00
Haoyu Qiu f7d4e6ef6b Fixes invalid writes in Image operations 2020-01-28 13:47:28 +08:00
Rémi Verschelde c8d64de766
Merge pull request #35521 from Calinou/improve-error-macros
Improve and document error macros
2020-01-26 16:39:11 +01:00
Rémi Verschelde cbdbfb00ca doc: Document named color constants
Busywork but it's good for our completion rate :)
2020-01-26 12:08:16 +01:00
Hugo Locurcio 37d55ff153
Improve and document error macros
Documentation can be visible in many IDEs by hovering the macro
anywhere it's used.

Error message styling was also tweaked for consistency.
2020-01-24 17:19:57 +01:00
Hugo Locurcio a002b93d86
Add explanations for errors related to Vector/Quat normalization 2020-01-24 14:19:23 +01:00
Rémi Verschelde c2e07db071
Merge pull request #35438 from MadEqua/virtual-keyboard-line-edit
Android virtual keyboard respecting LineEdit max length.
2020-01-23 08:20:24 +01:00
Bruno Lourenço a3bcdbeb78 Android virtual keyboard respecting LineEdit max length. 2020-01-23 01:52:49 +00:00
Hugo Locurcio 90a1f8d8a7
Make OS.execute() blocking by default if not specified
This makes `OS.execute()` calls quicker to set up when calling programs
in a blocking fashion.
2020-01-23 01:26:32 +01:00
Rémi Verschelde a8460bffd2
Merge pull request #35414 from Ovnuniarchos/AlsaMidiBadPitchBend
ALSA MIDI: Pitch bend and System Common messages
2020-01-22 22:12:57 +01:00
Rémi Verschelde 37897dba80
Merge pull request #35406 from lawnjelly/ortho-shadow
Replace CameraMatrix::get_viewport_size with get_viewport_half_extents, shadow culling with ortho camera and other affected issues
2020-01-22 22:02:09 +01:00
Ovnuniarchos 9c48eb1c59 ALSA MIDI driver:
Pith bend message now has correct size (was 2 bytes instead of 3).
	Recognized (but not implemented) 0xF? messages. SysEx messages will be reocognized as such, but their contents will be ignored.
2020-01-22 21:41:48 +01:00
lawnjelly eaf8e5ce52 Change CameraMatrix::get_viewport_size to get_viewport_half_extents
Fixes #26637.
Fixes #19900.

The viewport_size returned by get_viewport_size was previously incorrect, being half the correct value. The function is renamed to get_viewport_half_extents, and now returns a Vector2.

Code which called this function has also been modified accordingly.

This PR also fixes shadow culling when using ortho cameras, because the correct input for CameraMatrix::set_orthogonal should be the full HEIGHT from get_viewport_half_extents, and not half the width.

It also fixes state.ubo_data.viewport_size in rasterizer_scene_gles3.cpp to be the width and the height of the viewport in pixels as stated in the documentation, rather than the current value which is half the viewport extents in worldspace, presumed to be a bug.
2020-01-22 18:22:00 +00:00
Rémi Verschelde 409de53e72
Merge pull request #35423 from Faless/fix/object_emit_free
Make sure we know when deleting an emitting object
2020-01-22 14:52:54 +01:00
Fabio Alessandrelli 41f59ecfca Make sure we know when deleting an emitting object
We used a lock signals in the signal_map while emitting, because it was
not allowed to disconnect them while being emitted.
We used that lock to check if we where deleting an object during signal
emission.
Now that we allow to disconnect signals while they are being emitted, if
an object first disconnects, then gets deleted we can't know that a
signal was being emitted during the destructor.

This commit adds a new `_emitting` boolean member to Object to be set
while emitting and checked in the destructor, while removing the old
signal lock which is now unused.
2020-01-22 14:08:16 +01:00
Rémi Verschelde ff7e7bd260 Thread: Fix typo in destructor error message 2020-01-22 11:17:20 +01:00
Haoyu Qiu a7368a519e Fixes leak when importing zip in AssetLib 2020-01-22 09:34:18 +08:00
Rémi Verschelde 79aaafc686
Merge pull request #35408 from Faless/ws/fix_packet_count
Fix MultiplayerAPI crash when peer implementation misbehave.
2020-01-21 21:06:11 +01:00
Fabio Alessandrelli 50f1b035b8 Fix MultiplayerAPI crash when peer impl misbehave.
Also fix WebSocketMultiplayer::get_available_packet_count() return value
when peer is not configured to use the multiplayer API.
2020-01-21 20:46:32 +01:00
Eric Rybicki 439e0027ec Fix AtlasPacker ignoring semi-transparent pixels
Fixes #33106
2020-01-20 22:43:38 +01:00
Rémi Verschelde 11260fb87f
Merge pull request #35345 from timothyqiu/pck-packer-leak
Fixes leak when calling PCKPacker::pck_start multiple times
2020-01-20 07:00:11 +01:00
Haoyu Qiu 07941178f0 Fixes leak when pck_start multiple times 2020-01-20 12:16:37 +08:00
Haoyu Qiu aca0b2a459 Fixes XMLParser leak when open multiple times 2020-01-20 11:29:14 +08:00
Fabio Alessandrelli 534bf89976 PacketPeer use heap buffer for var encoding.
Used to allocate in stack (via alloca) which causes crashes when trying
to encode big variables.
The buffer grows as needed up to `encode_buffer_max_size` (which is
8MiB by default) and always in power of 2.
2020-01-19 11:49:10 +01:00
Hugo Locurcio 580b8cc012
Improve the console error logging appearance
This makes secondary information less visually prominent
to improve overall readability.

Various loggers were also tweaked for consistency.
2020-01-19 00:24:17 +01:00
Rémi Verschelde 870ec61417
Merge pull request #35092 from AndreaCatania/frames_exp
Exposed physics frame count and idle frame count
2020-01-14 08:25:46 +01:00
Rémi Verschelde 0aeb5bbf62 Object: Avoid error on emit_signal with freed target
As advised by @reduz.
2020-01-13 22:20:18 +01:00
Andrea Catania 9c60502357 Exposed physics frame count and idle frame count 2020-01-13 17:53:10 +01:00
Rémi Verschelde f38bfccf42 Object: Remove error on disconnect of locked signals
According to 22637beb2e (commitcomment-36651823)
and as confirmed by @reduz, this seems not to be necessary now that we
copy-on-write.

This triggered freeze scenarios in cases where a node would be deleted
while being used as a target in a signal emission.

Fixes #34650.
Fixes #34769.

Now those two errors go back to reporting:
```
ERROR: emit_signal: Condition ' !target ' is true. Continuing..:
   At: core/object.cpp:1191.
```
2020-01-13 17:03:02 +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
bruvzg d07cdc594f
[macOS] Load PCK from the .app bundle resources, instead of changing working directory. 2020-01-10 18:02:29 +02: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
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
George Marques 3718f8f592
GDScript: Validate object instance on is operation
Avoids crashes on debug mode. Instead it now breaks the execution and
show the error in-editor. Will still crash on release.

Also add a similar check to Marshalls to ensure the debugger doesn't
crash when trying to serialize the invalid instance.
2020-01-09 13:59:33 -03:00
Tomasz Chabora 97273ce378 Check if resource exists before loading 2020-01-08 15:24:43 +01:00
Rémi Verschelde 14b24b6a71
Merge pull request #34875 from neikeq/api-hash-no-underscore-methodbinds
ClassDB: Exclude method binds starting with '_' from API hash
2020-01-08 08:32:25 +01:00
Ignacio Etcheverry 4be87c6016 ClassDB: Exclude method binds starting with '_' from API hash
These methods are not meant to be part of the scripting API.
These are not the same as virtual methods starting with '_', e.g.: '_process'.
2020-01-07 00:08:49 +01:00
Rémi Verschelde 8aea5decc6
Merge pull request #34020 from gytsen/unify-pack-version
PCK: Set VERSION_PATCH in header, factor out header magic
2020-01-06 14:04:55 +01:00
Rémi Verschelde e62941fb53
Merge pull request #34296 from timothyqiu/lock-33072
Fixes crash when using Resource::_take_over_path
2020-01-06 14:04:23 +01:00
Joost Heitbrink dc61323b2c PCK: Set VERSION_PATCH in header, factor out header magic
Unify pack file version and magic to avoid hardcoded literals.

`version.py` now always includes `patch` even for the first release in
a new stable branch (e.g. 3.2). The public name stays without the patch
number, but `Engine.get_version_info()` already included `patch == 0`,
and we can remove some extra handling of undefined `VERSION_PATCH` this
way.

Co-authored-by: Rémi Verschelde <rverschelde@gmail.com>
2020-01-06 13:13:17 +01:00
Rémi Verschelde 8454804972
Merge pull request #33967 from Calinou/add-os-is-window-focused
Add an `OS.is_window_focused()` getter
2020-01-06 11:39:18 +01:00
Rémi Verschelde 0783874ff2
Merge pull request #34782 from akien-mga/multiplayerapi-set_network_peer-invalid
MultiplayerAPI: Fix disconnect errors when passing invalid peer
2020-01-03 14:33:25 +01:00
Rémi Verschelde 136846a6ec
Merge pull request #34772 from clayjohn/ETC-support-alpha
Fallback to RGBA4444 for textures with alpha set to ETC compression
2020-01-03 14:29:19 +01:00
Rémi Verschelde fa82664419
Merge pull request #34726 from nekomatata/polygon2d-antialiasing-fix
Fixed antialiasing option for Polygon2D with concave/hollow shapes
2020-01-03 14:17:05 +01:00
Rémi Verschelde 3cbfb11460 MultiplayerAPI: Fix disconnect errors when passing invalid peer
Fixes #34634.
2020-01-03 13:34:54 +01:00
Rémi Verschelde 9d3424f61d
Merge pull request #34688 from sheepandshepherd/gdnative_class_ptr
Expose is_class_ptr to GDNative for dynamic casts
2020-01-03 11:32:01 +01:00
clayjohn 7a9fc69a16 Fallback to RGBA4444 for textures with alpha set to ETC compression 2020-01-02 21:37:48 -08:00
sheepandshepherd 3056c4bd5a Expose cast_to to GDNative for dynamic casts 2020-01-03 04:27:13 +01:00
Rémi Verschelde eadf04e1dd
Merge pull request #34476 from volzhs/no-slash-localize_path
Make sure no additional slash being added with localize_path
2020-01-02 19:11:18 +01:00
Rémi Verschelde bde52cc688
Merge pull request #34618 from qarmin/vector_please_dont_crash
Don't use constant reference in Vector push_back, insert and append_array
2020-01-02 15:44:41 +01:00
Rémi Verschelde a97b08e7d2
Merge pull request #34745 from timothyqiu/vararg-return-nil-34743
Allows to doc vararg method return type as void
2020-01-02 15:20:58 +01:00
Rémi Verschelde e772a1241a Object::disconnect: Better errors when no signal or locked
It will now give information about the originating object instance
and when locked, the target callback.

This should help debugging editor and game issues that are now being
reported due to adding signal locking in
22637beb2e.
2020-01-02 14:51:50 +01:00
Haoyu Qiu 4d727f1ee6 Allows to doc vararg method return type as void 2020-01-02 21:37:26 +08:00
PouleyKetchoupp 1591677eb8 Fixed antialiasing option for Polygon2D
Some cases were not handled properly for Polygon2D after making changes in common code to fix Line2D antialiasing. Added an option for drawing polygons to differentiate the two use cases.

Fixes #34568
2020-01-01 11:40:14 +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 ccedda9c71
Merge pull request #34682 from Calinou/os-exit-code-nonportable-warning
Print a warning message if `OS.exit_code` is set to a non-portable value
2019-12-30 18:09:32 +01:00
Hugo Locurcio d441a6aefa
Print a warning message if OS.exit_code is set to a non-portable value
This also improves the related documentation.
2019-12-29 16:56:22 +01:00
Danil Alexeev 134755ebcf Add ord() function to Expression class
The ord() function was recently added in GDScript and VisualScript,
but was missed in the Expression class.
2019-12-29 09:20:10 +03:00
Rafał Mikrut 1ac701cc37 Don't use constant reference in Vector push_back, insert and append_array 2019-12-26 17:38:08 +01:00