Commit graph

2725 commits

Author SHA1 Message Date
Rémi Verschelde f796779f7c
Merge pull request #23310 from aaronfranke/posmod-int
Add integer posmod and rename default arg names
2019-07-19 15:07:49 +02:00
Rémi Verschelde 2ca3e47d66
Merge pull request #22642 from YeldhamDev/inspector_metadata
Expose "meta" to the Inspector
2019-07-19 14:39:23 +02:00
Aaron Franke a60f242982 Add integer posmod and rename default arg names
"posmod" is the integer version of "fposmod". We do not need a "mod" because of the % operator.

I changed the default arg names from "x" and "y" to "a" and "b" because they are not coordinates. I also changed pow's arg names to "base" and "exp". Also, I reorganized the code in the VS built-in funcs switch statement.
2019-07-18 16:33:43 -04: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
Rémi Verschelde dfe228a865
Merge pull request #30341 from Toshiwoz/master
when doing Vector3 slerp it is not necessary to have it normalized.
2019-07-12 10:27:38 +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
Rémi Verschelde 34d7484039
Merge pull request #30455 from qarmin/const_reference
Pass by reference to const
2019-07-10 15:43:15 +02:00
qarmin 01cc7a996b Use reference to constant in functions 2019-07-10 11:54:12 +02:00
Rémi Verschelde 68081b3f6e
Merge pull request #30188 from Andrettin/Method-Binding-Free-Function-Support
Method Binding Free Function Support
2019-07-09 22:33:43 +02:00
Andrettin e2a3ed3cd8 Added support for passing functions pointers (with a class instance as the first parameter) to method bindings 2019-07-09 21:18:39 +02:00
Rémi Verschelde 2d77390170
Merge pull request #30433 from akien-mga/cryptocore-string-escape
SCons: Fix MBEDTLS_CONFIG_FILE string escape
2019-07-09 08:27:40 +02:00
Rémi Verschelde f1a37be69c SCons: Fix MBEDTLS_CONFIG_FILE string escape
Fixes #30431, regression from #30277.
2019-07-08 18:05:48 +02:00
Fabio Alessandrelli 2f91e250f6 Add NULL-terminator the string passed to strtol.
This is actually expected by the function although it was apparently
working in GCC without the terminator, it breaks (at least some) clang
versions.
2019-07-08 17:15:10 +02:00
Rémi Verschelde 36424a6763
Merge pull request #30422 from Faless/net/tcp_connect_timeout
Add TCP connect timeout.
2019-07-08 13:39:00 +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
Rémi Verschelde 74b00d1bea
Merge pull request #30392 from hbina/redundant_check_pool_vector
Removed a redundant check in PoolVector
2019-07-08 08:31:14 +02:00
Rémi Verschelde af80182016
Merge pull request #30407 from qarmin/small_fixess
Fixes minor issues found by static analyzer
2019-07-08 08:16:50 +02:00
hbina085 ff348e48f9 Removed a redundant check in PoolVector
The set method of PoolVector<T> performs an indexing check twice.
2019-07-07 19:04:56 -04:00
qarmin 9a77d748c0 Fixes minor issues found by static analyzer 2019-07-07 23:08:51 +02:00
Rémi Verschelde 44db85d6f6
Merge pull request #30382 from simonpuchert/geo-opt
Some small optimizations in core/math/geometry.h.
2019-07-06 21:07:52 +02:00
Simon Puchert 4b78e17b15 Optimize get_closest_point_to_segment*.
By combining all scalar factors we can get rid of a scalar * vector
multiplication and a square root operation, since the resulting formula
only uses the squared length.
2019-07-06 17:41:13 +02:00
Ibrahn Sahir 4e4697b1c4 Added release function to PoolVector::Access.
For clarity, assign-to-release idiom for PoolVector::Read/Write
replaced with a function call.
Existing uses replaced (or removed if already handled by scope)
2019-07-06 12:04:27 +01:00
LikeLakers2 e86f6faf64 MultiNodeEdit now only shows properties with the exact same PropertyInfo data 2019-07-05 17:40:06 -04:00
Toshiwo 3aff645114 when doing Vector3 slerp it is not necessary to have it normalized. 2019-07-05 11:17:52 -05:00
Rémi Verschelde 6e9cb44004
Merge pull request #30282 from neikeq/editor_in_cs_equals_win
Re-write mono module editor code in C#
2019-07-05 10:29:19 +02:00
Rémi Verschelde a149e412f7
Merge pull request #24086 from RandomShaper/bundle-pck-to-executable
Enhance game export
2019-07-05 10:28:29 +02:00
Ignacio Etcheverry 0639946c72 Fix localize_path not always working
We make sure the resource dir path ends with a trailing '/' for safety reasons, so we must make sure the path we compare it to does so as well.
2019-07-05 09:38:28 +02:00
Ignacio Etcheverry 270af6fa08 Re-write mono module editor code in C#
Make the build system automatically build the C# Api assemblies to be shipped with the editor.
Make the editor, editor player and debug export templates use Api assemblies built with debug symbols.
Always run MSBuild to build the editor tools and Api assemblies when building Godot.
Several bugs fixed related to assembly hot reloading and restoring state.
Fix StringExtensions internal calls not being registered correctly, resulting in MissingMethodException.
2019-07-05 09:38:23 +02:00
Rémi Verschelde 42a0148f17
Merge pull request #30296 from neikeq/issue-30127
Expose ResourceImporter to the scripting API
2019-07-05 09:20:05 +02:00
Rémi Verschelde 259a3fb1e9
Merge pull request #29744 from GodotExplorer/gdscript-completion-icons
Show icons for code completion options
2019-07-05 08:00:40 +02:00
Geequlim 10cfd87414 Show icons for code completion options 2019-07-05 09:25:50 +08:00
Ignacio Etcheverry 307eb34be0 Expose ResourceImporter to the scripting API
Fixes #30127
2019-07-04 16:11:57 +02:00
Rémi Verschelde 550f436f8f
Merge pull request #30263 from Faless/ws/wslay_pr
Use wslay as a WebSocket library
2019-07-04 15:55:33 +02:00
Fabio Alessandrelli 9e303ef71c WebSocket module now uses wslay library.
Both client and server are supported on native builds (as usual).

SSL server is still not supported, but will soon be possible with this
new library.

The API stays the same, we just need to work out potential issues due to
this big library switch.
2019-07-04 15:03:04 +02:00
Geequlim ed7ed52151 Parse more informations for code completion 2019-07-04 14:00:14 +08:00
Pedro J. Estébanez 40f4d3cf0f Add embedded PCK option to PC platforms
The basic point is as in 2.1 (appending the PCK into the executable), but this implementation also patches a dedicated section in the ELF/PE executable so that it matches the appended data perfectly.

The usage of integer types is simplified in existing code; namely, using plain `int` for small quantities.
2019-07-03 21:58:12 +02:00
Fabio Alessandrelli c13be79594 Add TCP Server is_listening method 2019-07-03 18:42:46 +02:00
Fabio Alessandrelli 24c52f1c2e Add b64 to string helper in CryptoCore 2019-07-03 18:42:46 +02:00
Fabio Alessandrelli 6c512e21a9 Add sha1 functions to string (using new CryptoCore) 2019-07-03 18:42:46 +02:00
Rémi Verschelde b0d41847ed SCons: Use CPPDEFINES instead of CPPFLAGS for pre-processor defines
It's the recommended way to set those, and is more portable
(automatically prepends -D for GCC/Clang and /D for MSVC).

We still use CPPFLAGS for some pre-processor flags which are not
defines.
2019-07-03 09:59:04 +02:00
Fabio Alessandrelli c798173332 Fix editor crash when StreamPeerSSL is unavilable.
The fix for EditorNode is a bit hacky, but the handling of the buttons
and features there is hacky too (based on enums that might not reflect
the actual state).
2019-07-02 15:34:34 +02:00
Rémi Verschelde e9d624d7ce
Merge pull request #30239 from Faless/crypto/crypto_core
CryptoCore class to access to base crypto utils.
2019-07-02 14:52:43 +02:00
Fabio Alessandrelli 564d93ff10 CryptoCore class to access to base crypto utils.
Godot core needs MD5/SHA256/AES/Base64 which used to be provided by
separate libraries.
Since we bundle mbedtls in most cases, and we can easily only include
the needed sources if we so desire, let's use it.

To simplify library changes in the future, and better isolate header
dependencies all functions have been wrapped around inside a class in
`core/math/crypto_base.h`.

If the mbedtls module is disabled, we only bundle the needed source
files independently of the `builtin_mbedtls` option.
If the module is enabled, the `builtin_mbedtls` option works as usual.

Also remove some unused headers from StreamPeerMbedTLS which were
causing build issues.
2019-07-02 12:36:27 +02:00
Rémi Verschelde 98879be276
Merge pull request #27510 from fire/screenshot_editor
Add editor screenshot on control - f12.
2019-07-02 11:30:16 +02:00
Rémi Verschelde c486b8dac0
Merge pull request #30223 from qarmin/properly_delete_thread
Remove thread to prevent memory leak
2019-07-02 11:26:29 +02:00
K. S. Ernest (iFire) Lee 05de0eafab Add editor screenshot on control - f12. 2019-07-01 13:39:21 -07:00
qarmin 6edd06e566 Remove thread to prevent memory leak 2019-07-01 15:07:06 +02:00
Rémi Verschelde 6b30f284a0
Merge pull request #29980 from Dentrax/directed-by-qarmin
Fix some editor crashes
2019-07-01 14:59:29 +02:00
Rémi Verschelde b0ce9401ff
Merge pull request #30126 from qarmin/remove_unnecessary_code
Remove unnecessary code and add some error explanations
2019-07-01 14:32:04 +02:00
Furkan Türkal 7d8d337b2c fix some crashes 2019-07-01 14:28:29 +03:00
qarmin 3c154eb93b Remove unnecessary code and add some error explanations 2019-07-01 12:59:42 +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 0db138a621 doc: Enforce default values for OS properties
Otherwise we end up fetching values from the current OS instance
when running doctool, so they would change based on the system or
even simply due to changes to the system clipboard.
2019-06-30 13:58:07 +02:00
Rémi Verschelde 850a54a2a5 Fix uninitialized variables in Line2D, JSONParseResult and TileMap 2019-06-30 13:58:07 +02:00
Rémi Verschelde b4aba3ae7c
Merge pull request #30177 from hbina/use_FALLTHROUGH_macro
Applied some of FALLTHROUGH macro usage from #30122
2019-06-29 23:40:08 +02:00
hbina085 9f0c6a6009 Many fallthrough switch cases now have the FALLTHROUGH macro to tell the compiler that this is intended. 2019-06-29 16:08:48 -04:00
Bojidar Marinov 55234d62b0
Remove bogus nulls from generated default values
Also, fix crash in PluginScript destructor.
2019-06-29 15:51:33 +03:00
Rémi Verschelde 1df38f2372
Merge pull request #30112 from AgentEnder/master
AStar get_current_point enabled consideration
2019-06-29 13:45:17 +02:00
Rémi Verschelde 52355c638b
Merge pull request #29380 from bojidar-bg/16086-docs-default-value
Add default values to the editor help, docs, and generated RST
2019-06-29 12:28:30 +02:00
Craigory V Coppola dc9659a9bf AStar get_closest_point/get_closest_position_in_segment enabled consideration 2019-06-29 02:04:13 -05:00
Rémi Verschelde a5bd40aa48
Merge pull request #30121 from DrMoriarty/encrypted_configfile
Add encrypted files support to ConfigFile
2019-06-28 12:06:44 +02:00
Rémi Verschelde 3942c939e3
Merge pull request #30135 from qarmin/fix_memory_leak_os
Fix small memory leak in OS.cpp
2019-06-27 22:06:52 +02:00
qarmin d408c254a2 Fix small memory leak in OS.cpp 2019-06-27 21:35:27 +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
Vasiliy Makarov fcd8faf2f4 Add encrypted files support to ConfigFile
Fix #26477
Add in ConfigFile this methods:
load_encrypted(path, key)
load_encrypted_pass(path, password)
save_encrypted(path, key)
save_encrypted_pass(path, password)
2019-06-27 16:43:44 +03:00
Rémi Verschelde 1bf448dd87 Properly expose all Error constants to scripting languages 2019-06-27 12:48:26 +02:00
Rémi Verschelde 755b589384
Merge pull request #30096 from akien-mga/doc-misc-updates
doc: Proofread and complete various nodes
2019-06-27 08:12:34 +02: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
Andrii Doroshenko (Xrayez) 6f2233d13a Bind is_point_in_polygon in Geometry singleton 2019-06-27 00:20:22 +03:00
Rémi Verschelde 867dda1124 doc: Proofread and complete various nodes
All 100% completed: MainLoop, Node, Object, Path, Performance,
Reference, Resource, SceneState, SceneTree, UndoRedo.

Also fixed some en_GB occurrences as the reference spelling is en_US.
2019-06-26 23:05:51 +02:00
Alexander Holland 8f23f4b44e UndoRedo add version changed signal
added some functions to manage undo buttons
2019-06-26 16:32:34 +02:00
qarmin 4e5310cc60 Some code changed with Clang-Tidy 2019-06-26 15:08:25 +02:00
Rémi Verschelde a9cff880d6 doc: Document EncodedObjectAsID, expose its property 2019-06-26 10:50:45 +02:00
Fabio Alessandrelli 679bb882fc Fix PoolVector resize and subarray.
The first used to accept negative values, the second would crash if out
of bound.
2019-06-24 09:24:09 +02:00
Nils ANDRÉ-CHANG d2833d4f4d Replace + "/" + with String::file_add() 2019-06-23 13:33:50 +01:00
Rémi Verschelde 05a0a68c72
Merge pull request #24448 from lukad/toggle-system-console
Add option to toggle console window
2019-06-21 23:43:16 +02:00
Rémi Verschelde 1e833cadbc
Merge pull request #29935 from Faless/net/get_if_multicast_pr
Multicast, more network interfaces info
2019-06-21 10:21:01 +02:00
Fabio Alessandrelli e5e3f86648 Multicast support in NetSocket/PacketPeerUDP 2019-06-21 00:14:42 +02:00
Fabio Alessandrelli b574e476ec Implement IP.get_local_interfaces.
Allow getting interfaces names and assigned names.

On UWP this is not supported, and the function will return one interface
for each local address (with interface name the local address itself).
2019-06-21 00:14:42 +02:00
Rémi Verschelde 5c66771e3e
Merge pull request #29283 from qarmin/fix_some_always_same_values
Remove always true/false values
2019-06-20 21:10:10 +02:00
qarmin 072e40368e Fix always true/false values 2019-06-20 16:59:48 +02: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
JohnJLight 38d3bfe971 Made use of semicolons more consitent, fixed formatting 2019-06-19 15:24:31 +02:00
Rémi Verschelde 43a9b8c76c
Merge pull request #27237 from Chaosus/astar_2d
Added 2D functions to AStar
2019-06-19 15:07:59 +02:00
Rémi Verschelde 2b52cd3e5c
Merge pull request #28648 from KoBeWi/substr-1
Make second parameter of substr optional
2019-06-19 12:43:46 +02:00
Rémi Verschelde 22afebcad7
Merge pull request #29598 from GodotExplorer/uri-encode
Expose String.http_escape and String.http_unescape
2019-06-19 10:47:34 +02:00
Rémi Verschelde d6176db271 Unexpose subclasses of ResourceFormatLoader and -Saver
ResourceFormatLoader and ResourceFormatSaver are meant to be overridden
to add support for different formats in ResourceLoader and ResourceSaver.
Those should be exposed as they can be overridden in plugins.

On the other hand, all predefined subclasses of those two base classes
are only meant to register support for new file and resource types, but
should not and cannot be used directly from script, so they should not
be exposed.

Also unexposed ResourceImporterOGGVorbis (and thus its base class
ResourceImporter) which are editor-only.
2019-06-18 17:56:23 +02:00
Yuri Roubinsky 3caed76eda
Merge pull request #29862 from Chaosus/fix_astar_crash
Fix AStar set/is_point_disabled crash
2019-06-18 08:18:23 +03:00
Chaosus cc94a95fc9 Fix AStar set/is_point_disabled crash 2019-06-18 08:02:41 +03:00
Rémi Verschelde 0d61fc2c0f
Merge pull request #29752 from bruvzg/window_size_limits
Add ability to limit maximum/minimum window size.
2019-06-17 11:58:00 +02:00
Rémi Verschelde e864237f1a i18n: Fix extract.py support for new TTRC
Also make compatible with Python 3.
2019-06-16 22:02:44 +02:00
bruvzg b924fb97d6
Add ability to limit maximum/minimum window size. 2019-06-15 09:49:11 +03:00
Rémi Verschelde 2f0f7db42b
Merge pull request #29735 from sparkart/master
Limit Physics Process FPS above 0
2019-06-14 15:16:53 +02:00
Rémi Verschelde bd937ea397
Merge pull request #29488 from Daw11/astar-remove-node
Fix the performance of remove_point of AStar
2019-06-13 20:36:25 +02:00
Emmanuel Barroga 2cce5699ea Limit Physics Process FPS above 0
Resolves: #19734
2019-06-13 08:53:48 -07:00
Bastiaan Olij a9581d2b3f Added constants for the main buttons and axis used in VR 2019-06-13 22:54:08 +10:00
Rémi Verschelde b44488d823
Merge pull request #29702 from KoBeWi/fix_random_crash
Validate parameters of randi_range()
2019-06-12 23:07:39 +02:00
Tomasz Chabora d89478975f Validate parameters of randi_range() 2019-06-12 19:46:07 +02:00
Rémi Verschelde f410e7a8a9
Merge pull request #29616 from Calinou/humanize-size-clearer-rounding
Make humanized size rounding clearer by padding decimals with zeroes
2019-06-12 16:25:10 +02:00
Rémi Verschelde 73960e585b
Merge pull request #27193 from toasteater/fix/pcg-randf
Improved uniformity of RandomPCG::randf.
2019-06-12 15:21:58 +02:00