Commit graph

92 commits

Author SHA1 Message Date
Rémi Verschelde 0ee0fa42e6 Style: Enforce braces around if blocks and loops
Using clang-tidy's `readability-braces-around-statements`.
https://clang.llvm.org/extra/clang-tidy/checks/readability-braces-around-statements.html
2020-05-14 21:57:34 +02:00
Rémi Verschelde 0be6d925dc Style: clang-format: Disable KeepEmptyLinesAtTheStartOfBlocks
Which means that reduz' beloved style which we all became used to
will now be changed automatically to remove the first empty line.

This makes us lean closer to 1TBS (the one true brace style) instead
of hybridating it with some Allman-inspired spacing.

There's still the case of braces around single-statement blocks that
needs to be addressed (but clang-format can't help with that, but
clang-tidy may if we agree about it).

Part of #33027.
2020-05-14 16:54:55 +02:00
Rémi Verschelde 1f6f364a56 Port member initialization from constructor to declaration (C++11)
Using `clang-tidy`'s `modernize-use-default-member-init` check and
manual review of the changes, and some extra manual changes that
`clang-tidy` failed to do.

Also went manually through all of `core` to find occurrences that
`clang-tidy` couldn't handle, especially all initializations done
in a constructor without using initializer lists.
2020-05-14 10:01:56 +02:00
Hugo Locurcio c6fbbdf15d Rename SSL certificate bundle setting to clarify the "overriding" aspect
This closes https://github.com/godotengine/godot-docs/issues/2531.
2020-05-12 10:13:27 +02:00
Rémi Verschelde fdf58a5858 Rename InputFilter back to Input
It changed name as part of the DisplayServer and input refactoring
in #37317, with the rationale that input no longer goes through the
main loop, so the previous Input singleton now only does filtering.

But the gains in consistency are quite limited in the renaming, and
it breaks compatibility for all scripts and tutorials that access
the Input singleton via the scripting language. A temporary option
was suggested to keep the scripting singleton named `Input` even if
its type is `InputFilter`, but that adds inconsistency and breaks C#.

Fixes godotengine/godot-proposals#639.
Fixes #37319.
Fixes #37690.
2020-04-28 15:19:49 +02:00
Ignacio Etcheverry 27ddb27da8 Fix C# bindings after recent breaking changes 2020-04-03 01:38:48 +02:00
lupoDharkael 95a1400a2a Replace NULL with nullptr 2020-04-02 13:38:00 +02: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 4396e98834 Refactored Input, create DisplayServer and DisplayServerX11 2020-03-26 15:49:32 +01:00
Mateo Dev .59 c933eb7acc Change when we can ERR_FAIL_COND and ERR_FAIL_CONV_V to static_assert 2020-03-04 04:44:47 -03:00
Juan Linietsky 475e4ea67b Removed interactive loader, added proper thread loading. 2020-02-28 11:20:45 -03: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
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 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
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
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
Fabio Alessandrelli cb31b8797e Add hashing context class 2019-08-21 16:59:38 +02:00
Fabio Alessandrelli 1b36aa662c Add Crypto custom class 2019-08-21 16:59:35 +02:00
Fabio Alessandrelli 32da4d7819 Add TCP connect timeout.
Default timeout is 30 seconds (i.e. after 30 seconds of calling
connect_to_host if the TCP peer is not connected the connection will
error out).

This value can be configured in project settings:
`network/limits/tcp/connect_timeout_seconds`
2019-07-08 09:18:46 +02:00
Ignacio Etcheverry 307eb34be0 Expose ResourceImporter to the scripting API
Fixes #30127
2019-07-04 16:11:57 +02: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
Chaosus 0bc37de744 Added 2D functions to AStar 2019-05-30 07:10:07 +03:00
Rémi Verschelde b7cc2bb1e2 Core: Ensure classes match their header filename
Also drop some unused files.

Renamed:
- `core/dvector.h` -> `pool_vector.h`
- `core/io/resource_import.h` -> `resource_importer.h`
- `core/sort.h` -> `sort_array.h`
- `core/string_db.h` -> `string_name.h`

Dropped:
- `core/allocators.h`
- `core/os/shell.h`
- `core/variant_construct_string.cpp`
2019-02-12 13:34:25 +01:00
Juan Linietsky 11642b92d1 Avoid cyclic resource loading of any type, fixes #22673 2019-01-27 19:24:55 -03:00
Marcelo Fernandez fd59732298 Expose InputEventMIDI to scripts 2019-01-23 09:09:03 -03:00
Rémi Verschelde e5f1d19352 Consistency in resource format saver/loader de-registration
Some used 'is_valid()' checks, others not. Validity is already checked in 'unref()',
and 'remove_resource_format_*()' has an ERR_FAIL condition on 'is_null()' already
(which shouldn't happen since we're only unregistering things that we previously
registered.

Also add missing GDCLASS statement in ResourceFormatLoaderVideoStreamGDNative,
missed in #20552 which was last amended before #19501 was merged.
2019-01-10 12:45:57 +01:00
Rémi Verschelde b16c309f82 Update copyright statements to 2019
Happy new year to the wonderful Godot community!
2019-01-01 12:58:10 +01:00
Marc Gilleron 065e2670af Added basic support for custom resource savers and loaders 2018-12-15 05:34:53 +00:00
Chaosus f8151a9e50 Implement random number generator
Co-authored-by: Zirak <zirakertan@gmail.com>
2018-11-13 10:50:07 +03:00
Superwaitsum e5041ad0f5 Add some limits on the Editor Settings 2018-10-24 19:46:33 -05:00
Fabio Alessandrelli 30327872e0 Unify StreamPeerTCP/TCP_Server with NetSocket API 2018-09-12 15:56:20 +02:00
Fabio Alessandrelli 1b99806b47 Unify PacketPeerUDP using NetSocket 2018-09-12 15:56:16 +02:00
Rémi Verschelde 277b24dfb7 Make core/ includes absolute, remove subfolders from include path
This allows more consistency in the manner we include core headers,
where previously there would be a mix of absolute, relative and
include path-dependent includes.
2018-09-12 09:52:22 +02:00
Juan Linietsky 934c641a15 -Add Expression class, used to evaluate expressions
-Added expression evaluation to EditorSpinSlider, fixes #20813, fixes #18932
2018-08-08 17:35:23 -03:00
Juan Linietsky 317dee95de It is now possible to import images as a separate resource, closes #5738 and likely many others 2018-07-29 16:45:23 -03:00
Juan Linietsky c69de2ba46 -Project/Editor settings now use new inspector
-Project/Editor settings now show tooltips properly
-Settings thar require restart now will show a restart warning
-Video driver is now visible all the time, can be changed easily
-Added function to request current video driver
2018-07-19 19:02:04 -03:00
Fabio Alessandrelli df391cc5be Add new MultiplayerAPI class
Handles all the high level networking stuff
2018-03-03 18:28:49 +01:00
Rémi Verschelde e4213e66b2 Add missing copyright headers and fix formatting
Using `misc/scripts/fix_headers.py` on all Godot files.
Some missing header guards were added, and the header inclusion order
was fixed in the Bullet module.
2018-01-05 01:22:23 +01:00
Rémi Verschelde b50a9114b1 Update copyright statements to 2018
Happy new year to the wonderful Godot community!
2018-01-01 14:40:47 +01:00
Andreas Haas c76a9b99b0
Core: Bind InputEventGesture events. 2017-11-24 19:23:04 +01:00
Leon Krause 9b7b46143d Move singleton management from ProjectSettings to Engine 2017-11-14 15:15:13 +01:00
Ignacio Etcheverry 0c2e882210 Adds 'exposed' field to ClassInfo
This field represents if the class is exposed to the scripting API.
The value is 'true' if the class was registered manually ('ClassDB::register_*class()'), otherwise it's false (registered on '_post_initialize').
- Added missing registration of classes that are meant to be exposed.
2017-10-09 23:49:17 +02:00
karroffel 308d20aba5 added JSON singleton
There was no way to access JSON functionality in scripting languages
apart from GDScript because the JSON class wasn't exposed to ClassDB.
2017-09-15 15:40:27 +02:00
Rémi Verschelde bd282ff43f Use HTTPS URL for Godot's website in the headers 2017-08-27 14:16:55 +02:00
Ignacio Etcheverry 32dd9a9f66 ClassDB: Provide the enum name of integer constants 2017-08-20 22:07:43 +02:00
Juan Linietsky dc62389739 -Properly check limits to objects sent (regarding to size), fixes #9034
-Changed the way objects are marshalled and sent to the debugger
-Editing debugged objects happens in the remote inspector now
2017-08-18 10:59:31 -03:00
Rémi Verschelde 76005a8e75 Style: Apply clang-format on all files
Thus fixing some invalid changes that had still made it to the master branch.
2017-07-30 22:53:40 +02:00
Juan Linietsky 25678b1876 -Renamed GlobalConfig to ProjectSettings, makes more sense.
-Added system for feature overrides, it's pretty cool :)
2017-07-19 17:06:03 -03:00