Commit Graph

4990 Commits

Author SHA1 Message Date
Rémi Verschelde ed395c6b99
Sync controller mappings DB with SDL2 community repo
Synced with gabomdq/SDL_GameControllerDB@265b43b789.
2021-12-17 00:14:44 +01:00
Rémi Verschelde 9c9cc1b222
Merge pull request #55978 from slouken/fix-switch-controller-event-spam
Fixed event spam when using the Nintendo Switch controller
2021-12-16 19:49:47 +01:00
Sam Lantinga 313815f818 Fixed event spam when using the Nintendo Switch controller
There is no filtering on the Nintendo Switch Pro controller thumbstick, so there will frequently be events with very slight change. These are turned into "not pressed" events, which cancel "pressed" events from keys and buttons.

This change filters out up to 5% jitter, but it might be worth revisiting whether "not pressed" events should cancel "pressed" events.
2021-12-16 09:04:58 -08:00
Haoyu Qiu e4e4e475f8 Make `--doctool` locale aware
* Adds `indent(str)` to `String`:
    * Indent the (multiline) string with the given indentation.
    * This method is added in order to keep the translated XML correctly
      indented.
* Moves the loading of tool/doc translation into
  `editor/editor_translation.{h,cpp}`.
    * This will be used from both `EditorSettings` and the doc tool from
      `main`.
* Makes use of doc translation when generating XML class references, and
  setup the translation locale based on `-l LOCALE` CLI parameter.

The XML class reference won't be translated if `-l LOCALE` parameter is
not given, or when it's `-l en`.
2021-12-16 17:49:22 +08:00
Fabio Alessandrelli f9c05333ef
Merge pull request #55657 from MorganKF/patch-multiplayer-peer-extension
Patch `MultiplayerPeerExtension` to allow derived classes
2021-12-15 11:40:52 +01:00
Xavier Sellier ba0abd399f
Defer the call to 'popup_str' to the next cycle to let Godot Engine's editor time to properly start 2021-12-14 20:08:19 +01:00
Yuri Roubinsky 526390c048 Fix highlight for completion options match (rebased)
Co-authored-by: Gustav Andersson <gvekan@users.noreply.github.com>
2021-12-12 10:39:49 +03:00
MorganKF 44b35c3759 Update MultiplayerPeerExtension class registration to non-virtual
Fix formatting
2021-12-11 11:05:03 -03:30
raphaelazev 82527df55c Added check to get_all_locales to avoid adding duplicate locales to array 2021-12-10 19:25:59 -03:00
Tomasz Chabora d04c2a554f Improve Directory content navigation 2021-12-10 17:24:04 +01:00
Rémi Verschelde 03e105f677
Sync controller mappings DB with SDL2 community repo
Synced with gabomdq/SDL_GameControllerDB@348cfa347f.
2021-12-10 10:59:30 +01:00
Nathan Franke 49403cbfa0
Replace String comparisons with "", String() to is_empty()
Also:
- Adds two stress tests to test_string.h
- Changes to .empty() on std::strings
2021-12-09 04:48:38 -06:00
Nathan Franke 41a20171eb
align to horizontal_alignment, valign to vertical_alignment, related 2021-12-09 01:38:46 -06:00
Rémi Verschelde 46d384060e
Merge pull request #35901 from nathanfranke/pool-byte-array-subarray-exclusive 2021-12-07 14:00:59 +01:00
Fabio Alessandrelli 3ae8eda1ed
Merge pull request #55603 from Calinou/add-os-crash-method
Add an `OS.crash()` method for testing system crash handler
2021-12-06 16:34:15 +01:00
Rémi Verschelde 1f5a3ba0ba
Merge pull request #55661 from KoBeWi/joys_of_connection 2021-12-06 14:03:01 +01:00
Rémi Verschelde 5baf20e638
Merge pull request #34005 from aaronfranke/minmax 2021-12-06 14:01:45 +01:00
Rémi Verschelde 608c9f8203
Merge pull request #47257 from timothyqiu/http-client-proxy 2021-12-06 13:30:53 +01:00
kobewi cb2bdcd286 Unexpose joy_connection_changed method 2021-12-06 13:10:17 +01:00
Hugo Locurcio 5761b90f3c
Add an `OS.crash()` method for testing system crash handler
This makes it possible to test the system's crash handler without
having to modify engine code or exploit an engine bug.
2021-12-03 22:11:46 +01:00
Yuri Sizov b3992f7e6e Make overridden properties link to parent definition
Co-authored-by: Josh DeGraw <joshmdegraw@gmail.com>
2021-12-03 17:47:22 +03:00
Rémi Verschelde aaabc0abcc
Merge pull request #55520 from pycbouh/docs-sort-group-newline-theme-and-enums 2021-12-03 15:29:29 +01:00
Rémi Verschelde 8762d8fa5d
Merge pull request #55470 from groud/move_godot_object_init_to_extension 2021-12-03 14:41:07 +01:00
Aaron Franke 24f57886d0
Expose max_axis_index and max_axis_index for Vector2(i)
Some cleanup with Vector3(i)'s methods so that it is consistent with Vector2, for example it returns enums internally (GDScript still gets ints).
2021-12-02 23:45:41 -06:00
Rémi Verschelde 892a5a72cd
Merge pull request #55474 from akien-mga/copy-operators-no-reference 2021-12-02 17:34:45 +01:00
Max Hilbrunner 837e6bdf18
Merge pull request #37626 from aaronfranke/rect2-warnings
Print warnings when using a Rect2 or AABB with a negative size
2021-12-02 14:41:02 +01:00
Rémi Verschelde 49d8925713
Merge pull request #47294 from sebastian-heinz/patch-1 2021-12-02 10:04:17 +01:00
Rémi Verschelde 02d6cbfd8c
Merge pull request #38604 from Calinou/astar-rename-get-point-ids 2021-12-02 09:35:57 +01:00
sebastian-heinz be90aadbcd allow variant construction in expressions 2021-12-02 15:30:10 +08:00
Raul Santos a367378f9e Rename Vector parameters to be consistent
Renames parameters that were named differently across different
scripting languages or their documentation to use the same name
everywhere.
2021-12-01 21:14:46 +01:00
Yuri Sizov 397e56964d Sort and group theme properties in docs, improve formatting for theme and enums 2021-12-01 21:02:20 +03:00
Aaron Franke 9687f6fca3
Warn when using an AABB or Rect2 with a negative size 2021-11-30 18:27:58 -06:00
Hugo Locurcio 89849a9ed9
Rename `AStar.get_points()` to `AStar.get_point_ids()` for clarity
The same has been done for AStar2D as well.
2021-11-30 22:14:39 +01:00
Gilles Roudière 4fc0fb826a Change gdnative interface so that Godot object initialization should be triggered from the extension side 2021-11-30 16:55:48 +01:00
Rémi Verschelde 7da392bcc5
Don't return reference on copy assignment operators
We prefer to prevent using chained assignment (`T a = b = c = T();`) as this
can lead to confusing code and subtle bugs.

According to https://en.wikipedia.org/wiki/Assignment_operator_(C%2B%2B), C++
allows any arbitrary return type, so this is standard compliant.

This could be re-assessed if/when we have an actual need for a behavior more
akin to that of the C++ STL, for now this PR simply changes a handful of
cases which were inconsistent with the rest of the codebase (`void` return
type was already the most common case prior to this commit).
2021-11-30 16:26:29 +01:00
Marcel Admiraal 272b3c3728 Enable sorting of operator methods in class documentation. 2021-11-29 14:51:44 +00:00
Nathan Franke dd30253cdc
PackedByteArray, Array slice end exclusive, rename subarray to slice 2021-11-26 22:13:12 -06:00
kleonc 4038bc0c36 Fix `Image.blit_rect/blend_rect()` for negative `p_dest` point 2021-11-26 22:23:04 +01:00
Ricardo Subtil 93396b3e51 Fix wrong comparison with default values 2021-11-26 14:04:13 +00:00
Yuri Roubinsky a4b7de6b23 Fix console colors on Windows 2021-11-26 13:10:55 +03:00
Aaron Franke 40cb86ba96
Don't show errors when getting nonexistent settings 2021-11-25 08:23:42 -06:00
Aaron Franke 9851d3c5b2
Move logic for saving project features to ProjectSettings save_custom 2021-11-25 03:08:05 -06:00
Aaron Franke e81c689592
Project feature warning system 2021-11-24 10:32:07 -06:00
Rémi Verschelde b1bf82d2b4
Merge pull request #52456 from kleonc/image-fill-rect 2021-11-24 16:34:01 +01:00
Haoyu Qiu c09ea8d45a Adds proxy support for HTTPClient
Also fixed a potential infinite loop when connecting to server.
2021-11-24 14:36:42 +08:00
Lightning_A e078f970db Rename `remove()` to `remove_at()` when removing by index 2021-11-23 18:58:57 -07:00
kleonc 92ca300ab1 Image Use memcpy() in fill(), fill_rect(), _put_pixelb(), _get_pixelb()
Co-authored-by: Lightning_A <aaronjrecord@gmail.com>
2021-11-23 18:06:26 +01:00
kleonc 91595b16e3 Add Image::fill_rect method 2021-11-23 18:06:23 +01:00
bruvzg 9877d91c4a
Add Input.is_physical_key_pressed method. 2021-11-23 11:14:19 +02:00
Rémi Verschelde 1e71cab797
Merge pull request #55223 from bruvzg/gde_dict_index 2021-11-23 09:18:30 +01:00
bruvzg b11e619b19
[Vulkan] Check each device capabilities before selecting it.
Split instance and physical device selection function and move device selection to window creation, to reject devices without present capability.
Add device preferred type check in discrete > integrated > virtual > cpu > other order.
Add device list printout.
Add command line argument to override device selection.
2021-11-22 20:04:57 +02:00
kobewi 7dc97d6558 Ignore override.cfg when in editor 2021-11-22 16:10:31 +01:00
bruvzg f214b2b194 [GDExtension] Implement missing Dictionary index operators.
Co-authored-by: Bastiaan Olij <mux213@gmail.com>
2021-11-22 12:43:00 +02:00
Haoyu Qiu 8253a45a1a Fix crash when executing PackedDataContainer._iter_init 2021-11-21 20:14:59 +08:00
Rémi Verschelde be16eb625b
Merge pull request #54932 from briansemrau/expose-main-thread-id 2021-11-20 10:48:46 +01:00
Fabio Alessandrelli 46fdba5f8b [HTML5] Add WebGL2 (GLES3) support using the OpenGL renderer.
Note, the editor build requires the mbedtls module to be manually
enabled, as it is currently needed as a ResourceUID dependency.

This will need to be addressed in a separate PR.
2021-11-19 16:59:27 +01:00
Rémi Verschelde fc9de5ba7f
Merge pull request #54499 from Faless/threads/4.x_work_pool_default 2021-11-19 09:39:21 +01:00
Paulb23 eb9100f085 Fix divide by zero in pck_packer 2021-11-17 18:07:29 +00:00
Rémi Verschelde 2b24629847
Merge pull request #55042 from nekomatata/fix-segment-intersection 2021-11-17 17:33:56 +01:00
Rémi Verschelde 7540da622d
Merge pull request #49793 from Chaosus/expose_randfn 2021-11-17 13:53:23 +01:00
Yuri Roubinsky a74acca858 Expose `randfn` to global scope 2021-11-17 14:29:19 +03:00
Xwdit 0bd96bd2cf
Fix the exceptions in signal disconnection
Use the correct method to get SignalData to fix exceptions in signal disconnection
2021-11-17 09:29:29 +01:00
PouleyKetchoupp 6d0c93dccf Fix segment intersection in Geometry2D
Doing a multiplication to reduce the amount of tests was causing
precision which lead to 2D raycast detecting false positive contacts
in some cases with convex polygons.
2021-11-16 18:09:33 -07:00
Bastiaan Olij 035468669a Fix array access in gdextensions 2021-11-17 10:36:29 +11:00
Hugo Locurcio 8fb7e622a6
Rename built-in `SGN()` macro to `SIGN()`
This matches the name of the GDScript function (except it's uppercase
here).
2021-11-16 20:40:49 +01:00
Rémi Verschelde 5341e6010e
Allow dehardcoding documentation branch and URL in docs links
This makes it possible to change the branch of the documentation that
URLs are pointing to without having to modify all class reference
files.

In the XML class reference, the `$DOCS_URL` placeholder should be used,
and will be replaced automatically in the editor and when generating
the RST class reference.

The documentation branch string is set in `version.py`.

Co-authored-by: Hugo Locurcio <hugo.locurcio@hugo.pro>
2021-11-15 13:02:21 +01:00
Rémi Verschelde d975b1bc37
Merge pull request #43072 from KoBeWi/point_to_angle 2021-11-15 09:56:21 +01:00
Rémi Verschelde 8bb163807a
Merge pull request #54976 from reduz/importer-options-by-path 2021-11-15 00:46:04 +01:00
Hugo Locurcio 315e94ee2a
Merge pull request #53710 from CaptainProton42/fix-extension-class-inspector-properties 2021-11-14 22:02:31 +01:00
reduz cd2a499084 Add path to functions that return iporter options
-Allows displaying custom options for specific file format variants
-Added support for scene format import to retrieve custom options

This PR is necessary for #54886 to be implemented properly.
2021-11-14 14:06:10 -03:00
Brian Semrau c558263d84 Expose Thread::get_main_id in core bindings 2021-11-12 19:28:49 -05:00
Aaron Franke 3c0fdcc8ac
Use "enum class" for input enums 2021-11-12 15:37:54 -06:00
Rémi Verschelde 1aa3c8419b
Merge pull request #54869 from akien-mga/string-remove-erase 2021-11-11 13:00:21 +01:00
Rémi Verschelde e2e9b08cc7
Color: Bind `from_hsv` as static method 2021-11-11 11:50:02 +01:00
Rémi Verschelde 2beaae4b6f
String: Remove `erase` method, bindings can't mutate String 2021-11-11 11:23:32 +01:00
Haoyu Qiu 367d75fab0 Add missing characters for property name quoting 2021-11-11 13:18:09 +08:00
Rémi Verschelde 06a33e590f
Merge pull request #53819 from TokageItLab/re-implement-ping-pong
Reimplement ping-pong animation and reverse playback
2021-11-09 22:11:04 +01:00
Tomasz Chabora 606cfa9a47 Fix Vector2.angle_to_point() being reversed 2021-11-09 16:59:58 +01:00
bruvzg ba9d737363 Fix incorrect encoding (Latin-1 instead of UTF-8) used in `_error_handler` functions. 2021-11-08 23:45:08 +02:00
Rémi Verschelde e87687a6d0
Merge pull request #54486 from ibrahn/thread-work-pool-lazier 2021-11-08 13:39:39 +01:00
Rémi Verschelde 63559f2c80
Merge pull request #54186 from miraz12/fix-packedByteArray-memcpy-crash 2021-11-08 13:33:07 +01:00
Brian Semrau dc11e73bf0 Rename AABB `get_area` to `get_volume` 2021-11-05 18:22:42 -04:00
Aaron Franke 744b43b527
Fix Quaternion multiplication operator 2021-11-04 11:24:46 -05:00
kobewi e393c2a734 Add is_built_in() method to Resource 2021-11-04 12:45:58 +01:00
Hugo Locurcio c012fbc8b2
Rename `PROPERTY_USAGE_NOEDITOR` to `PROPERTY_USAGE_NO_EDITOR`
This is consistent with other constants that include `NO`,
such as `PROPERTY_HINT_COLOR_NO_ALPHA`.
2021-11-03 23:06:17 +01:00
Rémi Verschelde 4b247e7ffa
Sync controller mappings DB with SDL2 community repo
Synced with gabomdq/SDL_GameControllerDB@322aac4bb7.

Also improve parser errors to allow identifying the problematic mappings.
2021-11-03 19:55:52 +01:00
Silc 'Tokage' Renew 953a7bce7e reimplement ping-pong 2021-11-03 13:39:33 +09:00
Rémi Verschelde ab6ec9310c
Merge pull request #54453 from KoBeWi/slice_of_string 2021-11-02 13:18:34 +01:00
kobewi e5725c7deb Expose String.get_slice 2021-11-02 11:24:07 +01:00
Fabio Alessandrelli 4ed1d977fc [OS] Add ThreadWorkPool default size to OS.
Some platforms (*cough* web *cough*) have hard limits on the number of
threads that can be spawned.

Currently, ThreadPoolWork (mostly used in rendering/physics servers)
will spawn as many threads as CPUs available causing exception on
machines with high CPU count.

This commit adds a new overridable method to OS that returns the default
thread pool size (still the CPU count by default), and overrides it for
the JavaScript platform so it always allocate only one thread.

We can likely improve the whole ThreadPoolWork in the future to always
allocate X amount of threads, and assign jobs to them on the fly, but
that will require some more architectural changes.
2021-11-02 04:16:00 +01:00
Emmanuel Leblond 795cd2eb38
Merge pull request #35816 from touilleMan/dictionary-operator==-true-comparison
Modify Array/Dictionary::operator== to do real key/value comparison
2021-11-02 00:00:38 +01:00
Rémi Verschelde 7b83039885
Merge pull request #54490 from q66/ppc 2021-11-01 23:27:21 +01:00
Rémi Verschelde 0fbf53dbc5
Merge pull request #54387 from Calinou/editor-translations-increase-zlib-compression-level 2021-11-01 23:22:55 +01:00
Daniel Kolesa 3a84a64d2f Add support for PowerPC family 2021-11-01 22:25:53 +01:00
Ibrahn Sahir 151d2e34ca ThreadWorkPool no longer starts worker threads if given zero work. 2021-11-01 19:19:25 +00:00
bruvzg 0b6b8427c8 [macOS] Add `create_instance` function to spawn editor copies.
[macOS] Modify `create_project` function to detect and run app bundles using NSWorkspace to ensure app window is registered and activated correctly.
2021-11-01 11:48:23 +02:00
Rémi Verschelde 1dd742777a
Merge pull request #53452 from aaronfranke/who-let-the-docs-out 2021-10-31 23:18:32 +01:00
Clay John 8a10bb7d0d
Use OpenGL 3.3 core profile instead of compatibility profile
- Rename OpenGL to GLES3 in the source code per community feedback.
  - The renderer is still exposed as "OpenGL 3" to the user.
- Hide renderer selection dropdown until OpenGL support is more mature.
  - The renderer can still be changed in the Project Settings or using
    the `--rendering-driver opengl` command line argument.
- Remove commented out exporter code.
- Remove some OpenGL/DisplayServer-related debugging prints.
2021-10-31 15:56:45 +01:00
Emmanuel Leblond f9ba2efe1e
Modify Dictionary::operator== to do real key/value comparison with recursive support (and add unittests) 2021-10-30 13:11:01 +02:00
Hugo Locurcio ce97ddbcb1
Rename GLES2 driver to OpenGL to prepare for the upgrade to GLES3
- Use lowercase driver names for the `--rendering-driver`
  command line argument.
2021-10-30 02:05:49 +02:00
lawnjelly e3491a3744
Add GLES2 2D renderer + Linux display manager
First implementation with Linux display manager.

- Add single-threaded mode for EditorResourcePreview (needed for OpenGL).

Co-authored-by: clayjohn <claynjohn@gmail.com>
Co-authored-by: Fabio Alessandrelli <fabio.alessandrelli@gmail.com>
2021-10-30 02:05:48 +02:00
Aaron Franke 6772ebcea0
Move the docs for constructors and operators out of methods section 2021-10-29 12:34:57 -05:00
Hugo Locurcio 89cf17c96f
Use maximum zlib compression when generating editor translation headers
With comments stripped, this reduces the combined generated translation
size from 28.7 MB to 28.4 MB (-240 KB).
2021-10-29 19:07:48 +02:00
Max Hilbrunner 82f88f5d56
Merge pull request #54340 from aaronfranke/time-doc
Update and fix Time documentation
2021-10-29 15:49:22 +02:00
Aaron Franke 2dabdda36a
Update Time documentation 2021-10-28 10:16:56 -05:00
Rémi Verschelde f42ef8d5f9
CI: Update to clang-format 13 using LLVM repo 2021-10-28 17:11:00 +02:00
Rémi Verschelde f7d852b532
Merge pull request #54350 from akien-mga/clang-format-dont-align-operands 2021-10-28 17:10:52 +02:00
Rémi Verschelde 0ae65472e7
clang-format: Enable `BreakBeforeTernaryOperators`
clang-format keeps breaking the way it handles break *after* ternary operators,
so I give up and go with the only style they seem to actually test.
2021-10-28 15:57:41 +02:00
Rémi Verschelde 6b090e325a
Merge pull request #53526 from KoBeWi/super_print 2021-10-28 15:47:52 +02:00
Rémi Verschelde 3a6be64c12
clang-format: Various fixes to comments alignment from `clang-format` 13
All reviewed manually and occasionally rewritten to avoid bad auto formatting.
2021-10-28 15:43:36 +02:00
Rémi Verschelde 3b11e33a09
clang-format: Disable alignment of operands, too unreliable
Sets `AlignOperands` to `DontAlign`.

`clang-format` developers seem to mostly care about space-based indentation and
every other version of clang-format breaks the bad mismatch of tabs and spaces
that it seems to use for operand alignment. So it's better without, so that it
respects our two-tabs `ContinuationIndentWidth`.
2021-10-28 15:19:35 +02:00
Gilles Roudière a51f92273a Remove ItemList editor and replace it by a property array 2021-10-28 10:16:51 +02:00
Anton Christoffersson 9ed8417271 Fixed crash in `variant_call` when trying to memcpy 0 bytes. 2021-10-27 19:01:33 +02:00
Max Hilbrunner 5dc02eb8b0 Save all 64 bits of get_ticks_msec() in more cases 2021-10-26 13:58:58 +02:00
reduz d03b7fbe09 Refactored Node3D rotation modes
* Made the Basis euler orders indexed via enum.
* Node3D has a new rotation_order property to choose Euler rotation order.
* Node3D has also a rotation_mode property to choose between Euler, Quaternion and Basis

Exposing these modes as well as the order makes Godot a lot friendlier for animators, which can choose the best way to interpolate rotations.
The new *Basis* mode makes the (exposed) transform property obsolete, so it was removed (can still be accessed by code of course).
2021-10-25 14:34:00 -03:00
Rémi Verschelde 24fdedfe94
Merge pull request #54050 from reduz/animation-compression 2021-10-25 14:27:58 +02:00
Anton Christoffersson fb7ba76325 Fixed implicit conversion of uint32_t to uint8_t in `image` 2021-10-25 12:51:28 +02:00
Aaron Franke 474d0f58f5
Add support for the RISC-V architecture
Supports RV64GC (RISC-V 64-bit with general-purpose and compressed-instruction extensions)
2021-10-22 12:51:10 -05:00
Rémi Verschelde f9be8b8e8e
Merge pull request #54081 from Rubonnek/add_bin_messages_master 2021-10-22 19:31:55 +02:00
Rémi Verschelde beb3875cdf
Merge pull request #53781 from m4gr3d/restrict_project_data_dir_config_master 2021-10-22 19:30:35 +02:00
Rémi Verschelde 6c35e74228
Merge pull request #53812 from RandomShaper/expose_flush_input 2021-10-22 17:20:33 +02:00
Pedro J. Estébanez 6dc3fae201 Expose Input::flush_buffered_events() 2021-10-22 14:28:48 +02:00
Rémi Verschelde 9f7218eb69
Merge pull request #54088 from madmiraal/remove-unimplemented-methods 2021-10-22 12:59:32 +02:00
reduz a69541da4c Implement Animation Compression
Roughly based on https://github.com/godotengine/godot-proposals/issues/3375 (used format is slightly different).

* Implement bitwidth based animation compression (see animation.h for format).
* Can compress imported animations up to 10 times.
* Compression format opens the door to streaming.
* Works transparently (happens all inside animation.h)
2021-10-21 18:27:34 -03:00
Marcel Admiraal 87a4ba492e Remove unimplemented methods 2021-10-21 18:44:25 +01:00
Rémi Verschelde b6f4f23a5e
Merge pull request #54078 from Rubonnek/add_hex_messages_master
Add error messages to `String::hex_to_int`, and accept capital X in prefix
2021-10-21 19:37:11 +02:00
Wilson E. Alvarez 5736a0ed3c
Accept capital B in String::bin_to_int prefix 2021-10-21 13:18:49 -04:00
Wilson E. Alvarez 549a48ccc9
Add error messages to String::hex_to_int, and accept capital X in prefix 2021-10-21 12:40:14 -04:00
bruvzg a975682ef6 Fix handling multiple "physical key" events in the single input map action. 2021-10-19 22:19:41 +03:00
Rémi Verschelde 4387f9645b
Merge pull request #52940 from groud/toast_notification 2021-10-19 09:57:13 +02:00
Rémi Verschelde 21f1ac8bf3
Merge pull request #53805 from groud/name_to_tileset_sources 2021-10-19 09:56:19 +02:00
ne0fhyk b5c750fa65 Restrict the project data directory configuration 2021-10-18 14:10:38 -07:00
Rémi Verschelde f4d9749e23
Merge pull request #53741 from DmitriySalnikov/exposed_sensor_setters_master 2021-10-18 23:00:56 +02:00
Rémi Verschelde c5f4bf2077
Merge pull request #53950 from qarmin/memory_leak_gdscript 2021-10-18 14:02:33 +02:00
qarmin 343d005e0f Fix memory leak in exported project 2021-10-18 11:19:31 +02:00
unknown 73c5e07051 Added better descriptive error messages for file operations in core_bind.cpp 2021-10-18 02:09:42 +05:30
mennomax b4eeeb315a
Swap args of Plane(point, normal) constructor
Now (normal, point)
2021-10-15 20:49:42 -05:00
Rémi Verschelde c133480531
SCons: List `.gen.cpp` sources explicitly to avoid globbing errors
Whenever we change the name (or remove) generated cpp files with the `.gen.cpp`
extension, users run into build issues when switching between branches (i.e.
switching before and after the name change/removal). This is because we glob
`*.cpp` so if a now-obsolete file from a previous build is present, we'll
include it too, potentially leading to bugs or compilation failure (due to
missing headers or invalid code).

So globbing patterns in `add_source_files` will now skip files ending with
`.gen.cpp`, which should instead be passed explicitly where they're used.
2021-10-15 22:14:11 +02:00
Rémi Verschelde cd21cc683a
SCons: Set `DEBUG_ENABLED` and `DEV_ENABLED` in SConstruct
They're the same for all platforms so they don't need to be repeated in all
platform definitions.
2021-10-15 10:26:58 +02:00
K. S. Ernest (iFire) Lee 8f0c056431 Fix specific warnings issues by Clang
Found by `scons dev=yes` on llvm-mingw.
2021-10-14 14:14:26 -07:00
George Marques 4c14051b3f
Zero Dictionary and Array variants when changing type with reset
So they don't reference to the old values anymore and instead refer to
a new value.
2021-10-14 11:22:17 -03:00
Gilles Roudière 3b42660105 Add a name to TileSet sources 2021-10-14 14:54:48 +02:00
Gilles Roudière 0587e5e018 Implement toast notifications in the editor 2021-10-14 13:30:54 +02:00
Rémi Verschelde a801a2031d
Merge pull request #53773 from nathanfranke/fix-license-character-encoding 2021-10-13 21:04:13 +02:00
Rémi Verschelde fd2dcba02c
Merge pull request #53772 from RandomShaper/fix_hash_map 2021-10-13 21:03:50 +02:00
Nathan Franke 28c163a432
Fix character encoding of Engine::get_copyright_info 2021-10-13 10:42:41 -05:00
Pedro J. Estébanez f80e4e4f4c Fix HashMap element copy leaving hash as zero 2021-10-13 17:25:31 +02:00
Rémi Verschelde 6569635ec0
Merge pull request #53757 from groud/fix_undo 2021-10-13 12:42:07 +02:00
Gilles Roudière cf7242dd8e Fix undo in inspector not working 2021-10-13 10:45:21 +02:00
Rémi Verschelde 6f1d2133bb
Merge pull request #52495 from kdiduk/issue-52491-fix-value-conversion-in-hashfuncs-header
#52491 Cosmetic: fix type cast so that it matches return value type
2021-10-12 22:38:39 +02:00
Rémi Verschelde b48c6418fe
Merge pull request #52293 from neikeq/class-db-api-type-bug
Fix ClassDB API type mismatch bug between --editor and player
2021-10-12 22:34:21 +02:00
Дмитрий Сальников 9b38e04fff Exposed setters for sensor values in Input class 2021-10-12 23:26:03 +03:00
CaptainProton42 a9aba86943 Fetch extension class props from ClassDB
Extension class properties that have been registered with
ClassDB(`GDNativeInterface::classdb_register_extension_class_property`)
were not fetched previously. (Only  directly providing a property
list using `GDNativeExtensionClassCreationInfo::get_property_list_func`
would work.) This especially caused problems with the C++
bindings since they exclusively rely on ClassDB to register properties.
2021-10-12 18:25:55 +02:00
Gilles Roudière 5504e11fb7 Fix useless debug print 2021-10-12 17:03:39 +02:00
Rémi Verschelde 480fc31450
Merge pull request #53713 from groud/add_force_keep_on_undo_redo_merge_ends 2021-10-12 15:33:20 +02:00
Fabio Alessandrelli 74b46bb220 [Net] Fix spawn/despawn custom callable argument.
Was always reporting it to be a spawn, even for despawns.
2021-10-12 14:18:16 +02:00
Gilles Roudière 1be00864b7 Add a way to force undo/redo operations to be kept in MERGE_ENDS mode 2021-10-12 14:03:05 +02:00
Rémi Verschelde 0fd50ff217
Merge pull request #52736 from aaronfranke/lgtm-mult
Fix some LGTM errors of "Multiplication result converted to larger type"
2021-10-12 08:38:46 +02:00
Rémi Verschelde 1bd6a2f020
Merge pull request #52548 from m4gr3d/customize_metadata_dir_master
Make the project data directory customizable
2021-10-12 08:26:47 +02:00
Aaron Franke 7e51e4cb84
Fix some LGTM errors of "Multiplication result converted to larger type" 2021-10-12 00:17:27 -05:00
Juan Linietsky 610de0974d
Revert "Implement reverse playback and ping-pong loop in AnimationPlayer and NodeAnimation" 2021-10-11 19:27:50 -03:00
ne0fhyk 3e44a6375e Make the project data directory customizable. 2021-10-11 14:40:14 -07:00
Rémi Verschelde 9ed4f8367b
Merge pull request #48332 from TokageItLab/implement-ping-pong 2021-10-11 22:55:01 +02:00
Yuri Roubinsky e270d1cce3 Fix autocompletion of built-in functions in GDScript 2021-10-11 19:06:17 +03:00
Tokage 372ba76663 implement ping-pong loop in animation
Co-authored-by: Chaosus <chaosus89@gmail.com>
2021-10-09 18:08:43 +09:00
mashumafi 575d4e00b6 Enhance and cleanup stringify for Vector 2021-10-09 06:19:25 +00:00
Pedro J. Estébanez 73697d4de6 Avoid the need for copy assignment in HashMap key/data types 2021-10-08 20:06:07 +02:00
Rémi Verschelde 26b3aff01d
Merge pull request #53517 from ColinKinloch/native_callback_typedef 2021-10-08 14:28:36 +02:00
Rémi Verschelde cdaa52a820
Merge pull request #53555 from Pineapple/faster-int-string-dictionary 2021-10-08 14:26:48 +02:00
Fabio Alessandrelli 54ec66a700 [Net] Rename RPCConfig.sync to call_local.
For consistency with the other user facing changes.
2021-10-08 12:39:09 +02:00
Bartłomiej T. Listwon 4a723842b6 Faster hash_compare for integer and string keys in dictionaries 2021-10-08 10:09:13 +02:00
Rémi Verschelde 49e7e049ab
Merge pull request #53422 from KoBeWi/add_LUA_to_Godot 2021-10-07 23:37:37 +02:00
Rémi Verschelde 6090f90743
Merge pull request #53545 from vnen/gdscript-release 2021-10-07 23:28:34 +02:00
Rémi Verschelde 5abc966be4
Merge pull request #53500 from vnen/variant-in-string-name 2021-10-07 22:51:00 +02:00
George Marques fafa8c7f6e
Enable method type information on release builds
This is needed to ensure GDScript compilation works properly on release
builds and make use of optimized typed instructions.
2021-10-07 16:13:44 -03:00
kobewi 31012fd060 Change print_line() to use any number of Variants 2021-10-07 16:28:22 +02:00
Hugo Locurcio bcf4a56c74
Replace references to VisualServer in code comments with RenderingServer
VisualServer no longer exists in the `master` branch.
2021-10-07 15:49:41 +02:00
Colin Kinloch a66e59be84 Add typedef to GDNativeInstanceBindingCallbacks 2021-10-07 11:59:18 +01:00
George Marques 13a2d03dde
Add Variant `in` operator for any String/StringName operands
Allow using String or StringName types as operand in any position of the
`in` operator, which is more convenient in scripting when interacting
with data in the engine (such as a Node name).
2021-10-06 22:07:32 -03:00
Brian Semrau f28c677f3d [core_bind] Add `is_alive` to Thread. Replace `is_active` with `is_started`.
Replacing `is_active` resolves an API discrepancy between core_bind Thread and core/os Thread.
2021-10-06 12:47:58 -04:00
Kirill Diduk 1f38b00242 #52491 Cosmetic: fix type cast and add comment with the algorithm source 2021-10-05 21:40:33 +02:00
Rémi Verschelde a7ba227631
Merge pull request #52711 from m4gr3d/provide_getter_for_project_data_dir_master 2021-10-05 21:02:27 +02:00
Rémi Verschelde a603b2d7c7
Merge pull request #47497 from briansemrau/nan-inf-tscn-parsing-bug 2021-10-05 19:57:33 +02:00
Thakee Nathees 3f3ed5d34c NaN, INF read/write bug fixed
Fix: #40589
2021-10-05 09:25:49 -04:00
Fabio Alessandrelli e8f7b79bb0 [File] Fix FileAccessCompressed::get_buffer return value.
It used to return the write index instead of the written bytes (i.e.
index + 1) when reading until last block.
2021-10-05 15:12:51 +02:00
Maxime Lapointe 29dc8de88b Improve error message when instantiating virtual class 2021-10-05 08:09:35 -04:00
kobewi 9e5fdbc79d Fix LUA-style assignment in Dictionary 2021-10-05 12:17:13 +02:00
Rémi Verschelde 2ac320681a
Merge pull request #53225 from aaronfranke/c-locale 2021-10-05 11:20:08 +02:00
Rémi Verschelde 3479aaa369
Merge pull request #53405 from winterpixelgames/PR-more-error-logging-release 2021-10-05 08:43:07 +02:00
Jordan Schidlowsky b78d399f91 revert 0d7409a so additional error information prints in release builds 2021-10-04 16:55:01 -06:00
kobewi cdac60759e Add support for unbinding in connection dialog 2021-10-04 21:41:21 +02:00
Rémi Verschelde b85dfd990e
GDScript completion: Handle quote style ad-hoc to remove editor dependency
`core` and `scene` shouldn't depend on `editor`, so they can't query this style
setting in `get_argument_options`. But we can handle it after the fact in
GDScript's completion code.

Also cleans up a couple extra unused invalid includes in `core`.
2021-10-04 16:16:05 +02:00
Rémi Verschelde 463dbe5210
Merge pull request #53270 from akien-mga/charproxy-add-copy-constructor 2021-10-04 10:39:37 +02:00
Rémi Verschelde 90f8eb7aa0
Merge pull request #53059 from timothyqiu/thread-obj
Fix crash when creating thread
2021-10-02 02:15:43 +02:00
Rémi Verschelde 01cb4d92f3
Merge pull request #47442 from Shatur/fix-connect-reference-counted 2021-10-01 22:41:11 +02:00
Fabio Alessandrelli 366e374f76
Merge pull request #53290 from Faless/mp/4.x_opts_names
[Net] Rename RPC constants and annotation arguments.
2021-10-01 21:35:08 +02:00
Fabio Alessandrelli 24a949ea11 [Net] Rename RPC constants and annotation arguments.
any -> any_peer
sync -> call_local
ordered -> unreliable_ordered

Multiplayer.RPC_MODE_ANY -> RPC_MODE_ANY_PEER
Multiplayer.TRANSFER_MODE_ORDERED -> TRANSFER_MODE_UNRELIABLE_ORDERED
2021-10-01 18:14:38 +02:00
bruvzg 0c0b5c84b0 Implement TextServer GDExtension interface, remove TextServer GDNative interface. 2021-10-01 15:13:29 +03:00
Eric M ad30b0a8dd Allow shortcuts to have any number of bindings. Updated UI as required. 2021-10-01 18:04:28 +10:00
Rémi Verschelde b32f84d473
Merge pull request #52850 from mashumafi/vector-bsearch 2021-10-01 07:52:51 +02:00
mashumafi 214bbfbefe Implement bsearch for Vector and Packed*Array 2021-09-30 23:57:26 +00:00
Lightning_A c63b18507d Use range iterators for `Map` 2021-09-30 15:09:12 -06:00
Rémi Verschelde cc57cbb73a
CharProxy: Add copy constructor
Adding the copy constructor is needed to solve a `-Wdeprecated-copy` warning
from GCC and Clang, which is raised when upgrading doctest from 2.4.4 to 2.4.6.
2021-09-30 23:06:40 +02:00
Juan Linietsky c370b4c4d0
Merge pull request #52544 from JFonS/lod_fixes
Auto LOD fixes and improvements
2021-09-30 14:49:11 -03:00
Rémi Verschelde 3a19400889
Merge pull request #48685 from bruvzg/bundle_icon_4 2021-09-30 14:55:04 +02:00
Rémi Verschelde bc0f5d3dde
Merge pull request #53251 from LATRio/53224 2021-09-30 13:42:45 +02:00
Max Hilbrunner ac7505e277
Merge pull request #53227 from Calinou/rename-getornull
Rename RID's `getornull()` to `get_or_null()`
2021-09-30 12:56:01 +02:00
LATRio 41c1cfe28e InputEventJoypadMotion::set_axis - reject invalid axis 2021-09-30 19:32:21 +09:00
Rémi Verschelde 4a9a231566
Merge pull request #53230 from nekomatata/fix-2d-bvh-overflow 2021-09-30 10:24:18 +02:00
Hugo Locurcio ba65730cbf
Rename RID's `getornull()` to `get_or_null()` 2021-09-29 23:58:02 +02:00
Rémi Verschelde 4028583e81
Merge pull request #53044 from lucypero/thread_override 2021-09-29 22:43:06 +02:00
PouleyKetchoupp d3c6395dcd Fix buffer overflow in 2D BVH
Some areas of code were missed and assumed Vector3.
2021-09-29 12:10:23 -07:00
Lucy 5fe1857496 Fix Platform Thread Override 2021-09-29 15:38:04 -03:00
Aaron Franke 1cbec15084
Add locale rename for the "C" locale 2021-09-29 11:57:53 -05:00
Rémi Verschelde 2fc31fdfca
Merge pull request #53217 from Faless/ext/fix_pointer_info 2021-09-29 17:41:58 +02:00
Haoyu Qiu 40e188f687 Fix crash when creating thread 2021-09-29 22:08:12 +08:00
Fabio Alessandrelli 0276c2e74a Fix const pointers types in docs and extension API.
The GDVIRTUAL_NATIVE_PTR did not declare the correct GDNativeConstPtr
template, resulting in "void*" being used as it's type info in both the
documentation and the extension API dump.
2021-09-29 16:04:20 +02:00
O01eg 9302b6547a
Implement override of get_message and get_plural_message 2021-09-29 14:19:14 +03:00
Anilforextra fc9767abb1 Use functions defined in the their classes. 2021-09-29 09:36:34 +05:45
Fabio Alessandrelli d18cbdf5e4
Merge pull request #52481 from Faless/net/4.x_native_peers
[Net] Extension system for network peers, webrtc.
2021-09-28 12:57:45 +02:00
fabriceci e4cfcfc424 Replace auto completion shortcut for mac 2021-09-28 11:25:11 +02:00
Rémi Verschelde ed5267f69f
Merge pull request #53053 from LATRio/callable_in_thread_start 2021-09-28 11:10:09 +02:00
Hennadii Chernyshchyk dbb37e586b
Fix inversed check inside register_singleton 2021-09-28 00:17:31 +03:00
jfons 9e1810695c Auto LOD fixes and improvements
* Fixed LODs for shadow meshes.
* Added a merging step before simplification. This helps with tesselated
  meshes that were previously left untouched. The angle difference at
  wich edges ar considered "hard" can be tweaked as an import setting.
* LODs will now start with the highest decimation possible and keep
  doubling (approximately) the number of triangles from there. This
  makes sure that very low triangle counts are included when possible.
* Given more weight to normal preservation.
* Modified MeshOptimizer to report distance-based error instead of
  including attributes in the reported metrics.
* Added attribute transference between the original mesh and the
  various LODs. Right now only normals are taken into account,
  but it could be expanded to other attributes in the future.
2021-09-27 17:04:56 +02:00
Haoyu Qiu b024d16bc1 Parse UTF-8 when getting path from resource UID 2021-09-27 19:10:32 +08:00
Rémi Verschelde 79e33f8b71
Merge pull request #53058 from LATRio/52191
check if 'shortcut' in InputEventShortcut is valid
2021-09-26 08:38:12 +02:00
LATRio eae7f1c1ae validate 'shortcut' in InputEventShortcut 2021-09-26 11:06:16 +09:00
Rémi Verschelde c7f67daccd
Merge pull request #52855 from Calinou/engine-editor-hint-getter-only 2021-09-25 22:09:51 +02:00
LATRio 97c68514c4 Use Callable in Thread::start 2021-09-25 22:07:13 +09:00
Rémi Verschelde 0abe464162
Merge pull request #52849 from KoBeWi/know_no_binds 2021-09-25 00:10:56 +02:00
John Wigg ccf05aeb9a
Fix Face3::get_random_point_inside()
Use correct overload of Math::random(from, to) to return floating point values within the correct range.
2021-09-24 21:41:17 +02:00
Fabio Alessandrelli 25226329be [Net] MultiplayerPeer cleanup, defaults. 2021-09-24 18:40:39 +02:00
Fabio Alessandrelli 7c81ce43ec [Net] Bind Multiplayer to GDExtension. 2021-09-24 18:40:39 +02:00
Fabio Alessandrelli 5f61b2c797 [Net] StreamPeer GDExtension. 2021-09-24 18:40:39 +02:00
Fabio Alessandrelli b9e6cc8f4f [Net] Enable PacketPeer native extensions. 2021-09-24 18:40:39 +02:00
kobewi 7bf5fc709e Remove binds from Signal.connect 2021-09-24 17:07:33 +02:00
Rémi Verschelde 32ab77ef8f
Merge pull request #52430 from AnilBK/vector2-replacements 2021-09-24 13:04:42 +02:00
Hugo Locurcio 6def32d643
Replace `#pragma once` by traditional include guards for consistency
`#pragma once` was used in a few files, yet we settled on using
traditional include guards instead.

The PooledList template comment was also moved to allow editors
such as Visual Studio Code to display the comment when hovering
PooledList.

`app.h` was renamed to `app_uwp.h` to be less generic for the
include guard.
2021-09-24 02:33:15 +02:00
Anilforextra cc51b045da Construct values only when necessary. 2021-09-23 22:26:07 +05:45
Fabio Alessandrelli f9ce9a8e10 [ClassDB] Unify construct/extension retrieval. 2021-09-22 18:33:29 +02:00
Fabio Alessandrelli f724bd1880 [Core] Add ClassDB functions to retrieve/construct extensions.
Calling the constructor alone is not enough if the class to be
instantiated is not a base class.

This commit adds two functions, one for retrieving the the extension
class reference, the other to construct an instance using the
constructor and the extension class reference.
2021-09-22 17:46:08 +02:00
Rémi Verschelde ba57252bd8
Merge pull request #52878 from AnilBK/add-get-center 2021-09-21 21:30:30 +02:00
Anilforextra 90908cd67d Add Get Center Method for Rect2/Rect2i and AABB. 2021-09-21 21:14:17 +05:45
Rémi Verschelde 61ce8b206e
Merge pull request #52877 from Calinou/add-print-verbose
Add `print_verbose()` built-in function to print in verbose mode only
2021-09-21 17:00:58 +02:00
Hugo Locurcio 650b1db4b8
Add `print_verbose()` built-in function to print in verbose mode only
This can be used as a shorthand for:

    if OS.is_stdout_verbose():
        print("...")

Unlike `print_debug()`, this works in release builds too and can
be toggled off in debug builds.
2021-09-21 15:59:49 +02:00
Eric M 28b7c1be80 Improve implementation of builtin action overrides 2021-09-21 22:25:31 +10:00
Hugo Locurcio 2560070c0a
Remove `Engine.editor_hint` in favor of `Engine.is_editor_hint()`
The `Engine.set_editor_hint()` setter method is no longer exposed
to scripting, which makes the property effectively read-only from
an user perspective.
2021-09-20 14:24:39 +02:00
Rémi Verschelde 0068247ab6
Merge pull request #52513 from Ev1lbl0w/fix_path_double_slash
Fix path with multiple slashes not being corrected on templates
2021-09-20 13:00:29 +02:00
Rémi Verschelde 89417ba75b
Merge pull request #52398 from deakcor/dev-transform 2021-09-20 08:46:51 +02:00
Vincent D aa82cb6f35 Expose get_skew for transform2d and add new constructor
Expose set_scale and set_skew for transform2d

Replacing float by real_t

Adding const parameters

Updated transform2d doc
2021-09-19 17:10:05 +02:00
George Marques 262d9397fb
Allow indexing of String values in scripting languages 2021-09-17 16:24:56 -03:00
Rémi Verschelde 220b69ab56
Merge pull request #52450 from aaronfranke/they-came-from-scale
Replace Vector3.to_diagonal_matrix with Basis.from_scale
2021-09-17 19:38:36 +02:00
George Marques 455e142d37
Allow comparing equality between builtin types and null 2021-09-17 12:33:52 -03:00
Aaron Franke bf0213470c
Replace Vector3.to_diagonal_matrix with Basis.from_scale 2021-09-17 10:30:30 -05:00
Rémi Verschelde 191c34eb0d
Merge pull request #52734 from lucypero/thread_override_master 2021-09-16 21:45:04 +02:00
Lucy e9723efd34 Allow for platform Thread implementation override 2021-09-16 11:23:29 -03:00
Rémi Verschelde 104a6191fd
Merge pull request #52739 from BastiaanOlij/gdextension_array_index 2021-09-16 15:15:02 +02:00
Rémi Verschelde 46e37545b8
Merge pull request #52740 from akien-mga/os-get_locale-language
Implement `OS::get_locale_language()` helper method
2021-09-16 14:23:06 +02:00
Bastiaan Olij 25d0e4bb5b Add GD extensions operator functions for arrays 2021-09-16 22:00:51 +10:00
Rémi Verschelde ca5c28fed4
Merge pull request #52358 from kleonc/astar_error_messages
`AStar` Add error messages
2021-09-16 13:36:13 +02:00
Rémi Verschelde 910c7dbdb7
Merge pull request #52735 from BastiaanOlij/gdextension_property_group
Add property group and subgroup registration to extensions
2021-09-16 11:02:59 +02:00
Rémi Verschelde def99c7baf
Implement `OS::get_locale_language()` helper method
This method extracts the 2 or 3-letter language code from `OS::get_locale()`,
making it easier for users to identify the "main" language code for users
that might have different OS locales due to different OS or region, but
should be matched to the same translation (e.g. "generic" Spanish).

Fixes #40703.
2021-09-16 09:34:58 +02:00
Juan Linietsky e2bd0a0a73
Merge pull request #52571 from timothyqiu/expose-enum
Expose enum related methods in ClassDB
2021-09-15 23:43:35 -03:00
Bastiaan Olij 12868791f2 Add property group and subgroup registration to extensions 2021-09-16 12:37:43 +10:00
ne0fhyk 69f890ff11 Provide a getter for the project data directory. 2021-09-15 12:52:03 -07:00
Aaron Franke 5d03c0e0b6
Fix String::num_real and String test cases when compiling with doubles 2021-09-15 13:41:12 -05:00
Rémi Verschelde fbef32ab46
Merge pull request #52693 from akien-mga/fixup-inputmap-macos-override
InputMap: Fixup `macos` feature tag overrides after #52291
2021-09-15 13:20:40 +02:00
Rémi Verschelde 07a58230ea
InputMap: Fixup `macos` feature tag overrides after #52291
Fixes #52691.
2021-09-15 11:48:54 +02:00
Jacob Edie 2b292a1a2a
--single-window is passed through project manager.
This means you can start godot with --single-window
2021-09-15 10:20:50 +02:00
Rémi Verschelde 3705ad7d8f
Merge pull request #52123 from lightspot21/fix-placement-new-warning
Silence false-positive warning for malformed placement new on GCC 11.1
2021-09-15 09:31:42 +02:00
Rémi Verschelde 0e7beb183a
Merge pull request #52562 from BastiaanOlij/gd_extensions_register_drivers
Add driver types to GD extension initialisation levels
2021-09-15 08:46:43 +02:00
Rémi Verschelde 1201ba6649
Merge pull request #52291 from Calinou/inputmap-rename-osx-macos
Rename `osx` to `macos` in input map feature tag handling
2021-09-15 08:45:46 +02:00
Hugo Locurcio 9b1986fb9c
Rename `osx` to `macos` in input map feature tag handling
This follows the general feature tag rename for 4.0.
2021-09-15 03:12:18 +02:00
PouleyKetchoupp 2ca94e51e4 Clean convex hull decomposition code
Remove unnecessary conversion between triangle data and vertex data
whenever possible.
2021-09-14 17:14:06 -07:00
Grigoris Pavlakis abef2b7194 Fix placement new on zero-sized region warning on GCC 11.1
On latest (11.1 as of this commit) GCC, the following warning is
continuously issued during build:
warning: placement new constructing an object of type
'SafeNumeric<unsigned int>' and size '4' in a region of type
'uint32_t*' {aka 'unsigned int*'} and size '0' [-Wplacement-new=]

This happens because on 98ceb60eb4 the new operator override used
was dropped and replaced with standard placement new. GCC sees the
subtraction from the pointer and complains as it thinks that the
SafeNumeric is placed outside an allocation, not knowing that the
address requested is already inside one.

After suggestions, the false positive is silenced, with no other
changes.
2021-09-15 00:07:21 +03:00
Fabio Alessandrelli c5a979eba5
Merge pull request #52613 from V-Sekai/fix_custom_sync_commands
Fix custom multiplayer sync commands
2021-09-14 21:27:12 +02:00
Rémi Verschelde 1cec7057bf
Merge pull request #52535 from e8newallm/52490-type_conversion
Added explicit type conversion to uint32_t
2021-09-14 15:36:52 +02:00
Aaron Franke 3a902c66c4
Revert some URLs from the "Replace HTTP URLs with HTTPS" PR 2021-09-13 15:18:35 -05:00
Rémi Verschelde 70ba366743
Merge pull request #50375 from Paulb23/code_edit_unit_tests 2021-09-13 21:51:20 +02:00
Rémi Verschelde 41562b9198
Merge pull request #52049 from theraot/master 2021-09-13 16:49:24 +02:00
Matthew Newall f048a9ad4e Added explicit type conversions 2021-09-13 14:26:47 +00:00
Bastiaan Olij f9849a2717 Add driver types to GD extension initialisation levels 2021-09-13 18:50:00 +10:00
SaracenOne dace12082b Fix custom multiplayer sync commands 2021-09-12 21:20:10 +01:00
Haoyu Qiu d2aef4c439 Expose enum related methods in ClassDB 2021-09-11 20:33:05 +08:00
Juan Linietsky 6679790fac
Merge pull request #52406 from ellenhp/libvorbis
Replace stb_vorbis with libvorbis
2021-09-10 16:24:59 -03:00
Max Hilbrunner 744d5829b7
Merge pull request #52229 from lawnjelly/basis_quat_warning
Improve Basis::get_quaternion error message
2021-09-10 13:21:00 +02:00
Ricardo Subtil eef0327d1e Fix path with multiple slashes not being corrected on templates 2021-09-10 11:14:40 +01:00
Ellen Poe f5d9c7b487 Replace stb_vorbis with libogg+libvorbis 2021-09-09 19:39:04 -07:00
Fabio Alessandrelli e6106edd16
Merge pull request #52408 from GiantBlargg/fix-string-cast
Fix invalid string cast
2021-09-08 15:31:25 +02:00
Max Hilbrunner 5b25457794 Multiplayer networking renames/simplification
Removes _networking_ prefix from some methods and members, now that multiplayer has been largely moved out of Node and SceneTree and is seperated into its own set of classes.
2021-09-08 12:05:54 +02:00
Max Hilbrunner f8fb2bc0b4
Merge pull request #52097 from mortarroad/master-fix-convex-hull-double-edges
Fix emitting duplicate edges for convex hulls
2021-09-07 21:50:16 +02:00
Juan Linietsky 58388f8cec
Merge pull request #47391 from Calinou/platform-feature-tags-lowercase
Make platform feature tag names lowercase
2021-09-07 16:30:50 -03:00
Max Hilbrunner 9ada29e918
Merge pull request #52289 from Calinou/remove-old-msvc-support-ifdef
Remove `#ifdefs` for handling compilation with Visual Studio < 2015
2021-09-07 21:01:44 +02:00
Max Hilbrunner acc776f7b6
Merge pull request #52442 from Faless/mp/4.x_rpc_manager
[Net] Move multiplayer classes to own subfolder. Split RPC from MultiplayerAPI.
2021-09-07 18:44:39 +02:00
Fabio Alessandrelli bf9aae09ba [Net] Move multiplayer to core subdir, split RPCManager.
Move multiplayer classes to "core/multiplayer" subdir.

Move the RPCConfig and enums (TransferMode, RPCMode) to a separate
file (multiplayer.h), and bind them to the global namespace.

Move the RPC handling code to its own class (RPCManager).

Renames "get_rpc_sender_id" to "get_remote_sender_id".
2021-09-07 11:14:30 +02:00
Gilles Roudière 4bd7700e89 Implement properties arrays in the Inspector. 2021-09-07 09:51:28 +02:00
Anilforextra a1f616dcfc Use builtin Vector2 functions for calculation of angles.
.
2021-09-07 08:30:26 +05:45
Gilles Roudière c6f6c05a52
Merge pull request #51722 from TokageItLab/implement-set-read-only-in-extended-class
Apply `set_read_only()` to child classes of `EditorProperty` elements
2021-09-05 18:58:02 +02:00
Silc 'Tokage' Renew facf8f1883 Apply set_read_only() to child classes of EditorProperty elements 2021-09-05 18:22:17 +09:00
Daniel Doran 3264ba296e fix invalid string cast 2021-09-04 21:38:07 -06:00
Bastiaan Olij f3ab094133
Merge pull request #52309 from BastiaanOlij/add_extension_index_functions
Add functions for access members by index on packed array objects
2021-09-05 11:52:43 +10:00
kleonc 71255bc2a9 AStar Add error messages 2021-09-03 00:06:23 +02:00
SaracenOne f09f12ce55 Fix _send_default_spawn_default function sending zero length
PackedByteArray when deriving from a single PackedByteArray
state variant.
2021-09-02 21:36:54 +01:00
Bastiaan Olij 23f27fbffc Add functions for access members by index on packed array objects 2021-09-02 09:41:35 +10:00
Paulb23 d186862338 Fix InputMap and display server not nulling singleton on free 2021-09-01 16:46:04 +01:00
George Marques 25ae279317
Merge pull request #52270 from KoBeWi/goodbye_polar
Remove cartesian2polar and polar2cartesian
2021-09-01 09:33:13 -03:00
George Marques cf59028972
Merge pull request #48237 from KoBeWi/they_came_from_angle
Add Vector2.from_angle() method
2021-09-01 09:32:42 -03:00
Hugo Locurcio ac7541c1b1
Merge pull request #52026 from Calinou/constiterator-fix-const
Fix ConstIterator to allow `for` range loops on Packed*Array
2021-09-01 14:25:01 +02:00
Ignacio Roldán Etcheverry cca26cc83f Fix ClassDB API type mismatch bug between --editor and player
There are two ways a class can be added to ClassDB:

- `A`: When an instance of the class is created for the first time. When
  this happends the class is not registered/exposed to scripts.
- `B`: When calling `GDREGISTER_CLASS(ClassName)` or similar. When this
  happens the class is registered/exposed to scripts.

ClassDB has an API type property to differentiate between the core
and editor APIs. Up until now the API type was determined whenever
the class is added to ClassDB (either `A` or `B`).

The problem comes when a class is instantiated (`A`) before
being registered (`B`).
If at this point the current defined API is not the same as when the
class is later registered, this will result in a mismatch between
`--editor` and non-editor apps.
This is specially bad for C# as it makes the editor player abort.

This was happening with `EditorPaths` which, while being registered
during the editor API classes registrations, it was also being
instantiated earlier when running the editor or the project manager,
via a call to `EditorPaths::create()`. This regression was introduced
in 1074017f04.

This commit fixes this simply by re-assigning the class API type when
the class is registered (`B`).
This is correct because API type describes registered/exposed classes.
It shouldn't cause any regressions as the API type should not be
accessed of classes that are not (or not yet) registered/exposed.

Code locations for reference:
- Method to add a class to ClassDB: `ClassDB::_add_class2`
- Code that adds classes to ClassDB post first initialization (`A`):
  `memnew` macros -> `Object::_postinitialize` ->
  `Object::initialize_class` -> `ClassDB::_add_class2`.
- Code adds class to ClassDB and registers/exposes it to scripts:
  `GDREGISTER_CLASS` macros -> `ClassDB::register_class<T>` ->
  `Object::initialize_class` -> `ClassDB::_add_class2`.
2021-08-31 22:35:32 +02:00
Hugo Locurcio 2daaf0fdc3
Make platform feature tag names lowercase
Feature tag names are still case-sensitive, but this makes built-in
feature tags more consistent.

- `Windows` -> `windows`
- `OSX` -> `osx`
- `LinuxBSD` -> `linuxbsd`
- `Android` -> `android`
- `iOS` -> `ios`
- `HTML5` -> `html5`
- `JavaScript` -> `javascript`
- `UWP` -> `uwp`
2021-08-31 20:34:44 +02:00
Hugo Locurcio fc0bfbb33b
Remove `#ifdefs` for handling compilation with Visual Studio < 2015
Godot 3.3 and later require Visual Studio 2017 to be compiled.
2021-08-31 20:04:17 +02:00
kobewi 3f3739ccb5 Add Vector2.from_angle() method 2021-08-31 01:53:58 +02:00
Juan Linietsky bcd73fc00a
Merge pull request #52240 from Rubonnek/rename-rel-path
Rename `String::is_rel_path` to `String::is_relative_path`
2021-08-30 20:45:45 -03:00
kobewi 017c94222e Remove cartesian2polar and polar2cartesian 2021-08-31 01:41:41 +02:00
Juan Linietsky 6dab6e4136
Revert " Improve collision generation usability in the new 3D scene import workflow." 2021-08-30 11:30:36 -03:00
Camille Mohr-Daurat b60a51f023
Merge pull request #51985 from AndreaCatania/coll
Improve collision generation usability in the new 3D scene import workflow.
2021-08-30 07:25:51 -07:00
lawnjelly d3a3b3aff3 Improve Basis::get_quaternion error message
The previous error message incorrectly suggested that any Basis could be fixed by calling get_rotation_quation() or orthonormalize(). This PR points out that only a valid rotation Basis can be fixed in this way.
2021-08-30 07:26:25 +01:00
Haoyu Qiu fd52e18d19 Try other resolved IPs if one fails to connect 2021-08-30 13:00:48 +08:00
Wilson E. Alvarez d11c1afc04
Rename String::is_rel_path to String::is_relative_path 2021-08-29 20:41:29 -04:00
Fabio Alessandrelli 64b9f30b92 [Net] Rename RPC "puppet" to "auth" (authority). Drop "master".
This commit completely removes the RPC_MODE_MASTER ("master" keyword),
and renames the RPC_MODE_PUPPET to RPC_MODE_AUTHORITY ("auth" keyword).

This commit also renames the "Node.[get|set]_network_master" methods to
"Node.[get|set]_network_authority".

This commit also renames the RPC_MODE_REMOTE constant to RPC_MODE_ANY.

RPC_MODE_MASTER in Godot 3.x meant that a given RPC would be callable by
any puppet peer on the master, while RPC_MODE_PUPPET meant that it would
be callable by the master on any puppet.

Beside proving to be very confusing to the user (referring to where it
could be called instead of who can call it) the RPC_MODE_MASTER is quite
useless. It is almost the same as RPC_MODE_REMOTE (anyone can call) with
the exception that the network master cannot. While this could be useful
to check in some case, in such a function you would anyway need to check
in code who is the caller via get_rpc_sender_id(), so adding the check
there for those rare cases does not warrants a dedicated mode.
2021-08-30 00:54:38 +02:00
Fabio Alessandrelli 838a449d64
Merge pull request #51788 from Faless/mp/4.x_replicator_sync
[Net] MultiplayerReplicator state sync.
2021-08-30 00:48:10 +02:00
Hugo Locurcio 4d08a737fb
Merge pull request #52180 from timothyqiu/config-file-prop
Quote and escape ConfigFile keys when necessary
2021-08-28 23:49:00 +02:00
Max Hilbrunner 04c64b59a1
Merge pull request #47406 from mashumafi/master-Array-insert-rc
Array::insert consistent with Pool*Array::insert
2021-08-28 21:18:39 +02:00
Max Hilbrunner 99c2329b73
Merge pull request #43522 from qarmin/divide_by_zero_in_vectori
Fix crash when dividing by 0 in Vector2/3i
2021-08-28 19:53:28 +02:00
Haoyu Qiu 597d489a20 Quote and escape ConfigFile keys when necessary 2021-08-28 18:48:45 +08:00
K. S. Ernest (iFire) Lee d04aa9a114
Merge pull request #52122 from V-Sekai/autoload_list
Use sorted map for autoloads in ProjectSettings to preserve order.
2021-08-27 14:41:40 -07:00
Max Hilbrunner 4e67e9bca6
Merge pull request #52090 from balloonpopper/bug52060
Correct null and boolean values being capitalised by the str command
2021-08-27 21:05:47 +02:00
Ellen Poe 460e0ce314 Add a SafeList data structure for future audio server usage. 2021-08-27 10:26:18 -07:00
Camille Mohr-Daurat 9206f561f5
Merge pull request #52110 from nekomatata/fix-segment-intersection
Fix segment intersection consistency in Geometry2D
2021-08-27 08:48:29 -07:00
Lyuma 31f790299c Use OrderedHashMap for autoloads to preserve order 2021-08-26 21:55:26 -07:00
Hugo Locurcio 60116b17b5
Add an `Array.pop_at()` method to pop an element at an arbitrary index
Negative indices are supported to pop an element relative from the end.
2021-08-27 00:51:17 +02:00
Juan Linietsky 22cae39c1e
Merge pull request #52121 from groud/fix_localvector_insert
Fix LocalVector crash on insert.
2021-08-26 13:31:35 -03:00
Juan Linietsky d19b12dbd2
Merge pull request #52107 from timothyqiu/overriden
Fix misspelled "overriden"
2021-08-26 13:07:52 -03:00
Juan Linietsky eb940ca2a0
Merge pull request #51928 from reduz/extension-loader
Implement Extension Loader
2021-08-26 10:24:25 -03:00
Fabio Alessandrelli 2d2855cd53 Data structure optimizations as per review. 2021-08-26 13:35:33 +01:00
Juan Linietsky 34e286d6a3
Merge pull request #52077 from reduz/error-ret-doc
Implement error return documentation
2021-08-26 08:42:06 -03:00
Gilles Roudière de0765b94a Fix LocalVector crash on insert. 2021-08-26 11:54:56 +02:00
Balloonpopper 4fae7ae9dc Correct null and boolean values being capitalised by the str command 2021-08-26 17:11:34 +10:00
PouleyKetchoupp 511c80b2ec Fix segment intersection consistency in Geometry2D
Segment collision results could be different depending on the direction
when they exactly touch (order of the points in segments). This was due
to the way parallelism was checked, using different logic based on
positive or negative sign of cross products.

Now the results are the same whatever the direction, without changing
the current design, which is that parallel or colinear segments are
not considered colinear.

Fixes inconsistencies with raycasts exactly on edges of convex shapes
depending on the direction.
2021-08-25 18:17:52 -07:00
Haoyu Qiu eba7265a1c Fix misspelled "overriden"
In recent GDVIRTUAL PR and SkeletonModification3DJiggle doc.
2021-08-26 01:44:01 +08:00
Morris Tabor 75dd294732 Fix emitting duplicate edges for convex hulls
Identical to https://github.com/godotengine/godot/pull/52059
2021-08-25 14:18:45 +02:00
reduz e2f8df8c5b Add ability to register singletons from engine API
* Exposed functions in Engine to register and unregister singletons.
* Added the concept of user singletons, which can be removed (the system ones can't).
2021-08-25 08:32:25 -03:00
reduz 96f8254b24 Implement error return documetation
Adds ability to add error return documetation to the binder and class reference.
Usage example:

```C++
void MyClass::_bind_method() {
	[..]
	BIND_METHOD_ERR_RETURN_DOC("load", ERR_FILE_CANT_OPEN, ERR_FILE_UNRECOGNIZED);
}
```

One function of ConfigFile was changed as example.
2021-08-24 15:28:29 -03:00
Max Hilbrunner 7e0f1fa2ec
Merge pull request #52041 from Rubonnek/expose-simplify-path
Expose `String.simplify_path`
2021-08-24 17:06:16 +02:00
Theraot ef54d35395 Fix get_base_dir windows top level directory logic
This is a fix for https://github.com/godotengine/godot/issues/52048
2021-08-24 04:16:59 -05:00
Wilson E. Alvarez 17821603b4
Expose String.simplify_path 2021-08-24 00:48:45 -04:00
reduz 65ca132a80 Expose RID creation utilities.
* Exposed as utility functions.
* Not very useful for script, but vital for creating servers using native extensions.
2021-08-23 21:55:45 -03:00
Juan Linietsky aa3c3a9ebb
Merge pull request #52036 from reduz/native-extension-argument-pointers
Implement NativeExtension pointer arguments
2021-08-23 20:36:48 -03:00
reduz 44d62a9f4b Implement NativeExtension pointer arguments
* Allows calling into native extensions directly with a pointer
* Makes it easier to implement some APIs more efficiently
* Appears with a "*" in the documentation for the argument.
* Implementing the pointer handling is entirely up to the implementation, although the extension API provides some hint.
* AudioStream has been implemented as an example, allowing to create NativeExtension based AudioStreams.
2021-08-23 19:58:40 -03:00
Max Hilbrunner 0df9895eb7
Merge pull request #51791 from mhilbrunner/better-error-names
Improve error descriptions
2021-08-23 20:13:32 +02:00
Hugo Locurcio 87b985a6aa
Fix ConstIterator to allow `for` range loops on Packed*Array 2021-08-23 19:00:33 +02:00
Max Hilbrunner 6dae9f5c36 Improve error descriptions 2021-08-23 17:58:24 +02:00
Max Hilbrunner 583b6a594a
Merge pull request #51971 from aaronfranke/https
Replace HTTP URLs with HTTPS for sites with HTTPS versions
2021-08-23 15:58:54 +02:00
Max Hilbrunner ae306665d3
Merge pull request #51750 from jmb462/inputmap_action_suggestions
Adding InputMap action error suggestions for Input singleton (Fix #51634)
2021-08-23 15:19:20 +02:00
reduz 5cecdfa8af Entirely removes BIND_VMETHOD in favor of GDVIRTUAL
* `_gui_input`, `_input`, `_unhandled_input` and `_unhandled_key_input` are now regular C++ virutal functions.
* Everything else converted to GDVIRTUAL
* BIND_VMETHOD is gone, always use the new syntax from now on.

Creating `_gui_input` method and using the binder to register events will no longer work, simply override the virtual function now.
2021-08-23 08:10:13 -03:00
Aaron Franke ae1702bee5
Replace HTTP links with HTTPS for sites with HTTPS versions 2021-08-22 20:13:11 -05:00
AndreaCatania de0991d801 Fix Vector ConstIterator constructor.
The  constructor was expecting a mutable pointer, while the passed pointer was immutable ( returns a const pointer), so the compilation was failing when iterating a constant .
2021-08-22 18:19:04 +02:00
reduz 3682978aee Replace BIND_VMETHOD by new GDVIRTUAL syntax
* New syntax is type safe.
* New syntax allows for type safe virtuals in native extensions.
* New syntax permits extremely fast calling.

Note: Everything was replaced where possible except for `_gui_input` `_input` and `_unhandled_input`.
These will require API rework on a separate PR as they work different than the rest of the functions.

Added a new method flag METHOD_FLAG_OBJECT_CORE, used internally. Allows to not dump the core virtuals like `_notification` to the json API, since each language will implement those as it is best fits.
2021-08-22 08:23:58 -03:00
Rémi Verschelde 0a001afec5
Merge pull request #51836 from akien-mga/string-remove-NO_USE_STDLIB
String: Remove old NO_USE_STDLIB code path
2021-08-21 09:18:47 +02:00
reduz 542e6e8ca6 Implement Extension Loader
* Extensions are now scanned and loaded on demand.
* Extensions found are cached into a file that is used to load them (which is also exported).
* Editor will ask to restart when an extension requires core functionality.
* Editor will attempt to load extensions always before importing or loading scenes. This ensures extensions can register the relevant types.
2021-08-20 16:02:24 -03:00
Morris Tabor 054c7a125f Fix winding of new convex hull implementation. 2021-08-20 14:44:56 +02:00
Rémi Verschelde 603502c11c
Merge pull request #51902 from vnen/variant-internal-constructor
Fix initialization of objects in VariantInternal
2021-08-20 08:10:38 +02:00
George Marques a685535ad5
Fix initialization of objects in VariantInternal 2021-08-19 20:19:47 -03:00
PouleyKetchoupp 645bc94bfc Fix capsule height/radius setters with linked properties
Capsule height and radius setters can modify each other, rather than
using clamping, to avoid cases where values are not set correctly when
loading a scene (depending on the order of properties).

Inspector undo/redo:
Added the possibility to link properties together in the editor, so
they can be undone together, for cases where a property can modify
another one.

Gizmo undo/redo:
Capsule handles pass both radius and height values so they can be undone
together.
2021-08-19 10:31:19 -07:00
Rémi Verschelde de7b6d13eb
Merge pull request #51627 from mhilbrunner/todo-for-neikeq 2021-08-18 20:13:50 +02:00
Rémi Verschelde b033dff983
String: Remove old NO_USE_STDLIB code path
We're using the standard library in many core classes by now so
this code path no longer makes sense.
2021-08-18 14:38:04 +02:00
Fabio Alessandrelli b05cb0fd7d [Net] Add state sync to replicator.
Like the spawn/despawn feature, it can be completely overridden with 2
custom callables.
The callables will be called with the list of tracked objects.
In SERVER mode, objects are automatically tracked, while in CUSTOM mode
you can manually track them via `track`/`untrack` (but that's optional).
The default sync only happens from server to client, with batch updates,
over unreliable channel (but with custom ordering).
The default sync will warn you, if your state representation gets too
big.
2021-08-18 12:37:45 +01:00
Fabio Alessandrelli d4dd859991 [Net] MultiplayerReplicator with initial state.
Move the former "spawnables" functions to a dedicated
MultiplayerReplicator class.
Support custom overrides in replicator.
Spawn/despawn messages can now contain a state.
The state can be automatically encoded/decoded by passing the desired
object properties to `spawnable_config`.
You can use script properties to optimize the state representation.
2 Callables can be also specified to completely override the default
implementation for sending and receiving the spawn/despawn event.
(9 bytes overhead, and there's room for improvement here).
When using a custom implementation `spawn` and `despawn` can be called
with any Object, `send_spawn`/`send_despawn` can receive any Variant as
a state, and the path is not required.

Two new functions, `spawn` and `despawn`, convey the implementation
independent method for requesting a spawn/despawn of an Object, while
`send_spawn` and `send_despawn` represent the more low-level send event
for a Variant to be used by the custom implementations.
2021-08-18 10:21:29 +01:00
Rémi Verschelde d7b843a060
Merge pull request #51787 from akien-mga/string-num-fix-default-decimals
String: Fix default decimals truncation in num and num_real
2021-08-18 09:31:34 +02:00
Rémi Verschelde 17ce4846ff
Merge pull request #51807 from vnen/extension-fixes
Some fixes for the extension API
2021-08-18 08:05:02 +02:00
George Marques 3b593b596e
Properly set up virtual calls for extensions 2021-08-17 22:11:11 -03:00
Rémi Verschelde 066dbc2f0c
String: Fix default decimals truncation in num and num_real
Fixes undefined behavior, and fixes the logic for negative powers of ten.
Fixes #51764.

Adds tests to validate the changes and prevent regressions.
Adds docs for `String.num`.
2021-08-18 00:48:03 +02:00
Aaron Franke e5d85ac751
Fixes to tests for Variant and Geometry3D 2021-08-17 16:46:08 -05:00
George Marques fcfea84d5e
A few fixes in the extension C API
- Add MethodBind call (besides ptrcall), since vararg methods don't work
  with ptrcall.
- Fix argument name in register constant function to the way it
  actually is used in the engine.
- Change the integer constant type to GDNativeInt to keep it consistent.
2021-08-17 18:10:58 -03:00
George Marques ecc5921143
Initialize call error struct when calling extensions
This allows users to not need to set it when the call is correct.
2021-08-17 18:09:36 -03:00
Rémi Verschelde 273d1ca932
Merge pull request #51775 from timothyqiu/disable-undo-redo
Improve Undo/Redo menu items
2021-08-17 19:09:56 +02:00
Max Hilbrunner 81f7d1890b Namespaces instead of underscore prefix for binds
Thanks to neikeq for the initial work.

Co-authored-by: Ignacio Roldán Etcheverry <neikeq@users.noreply.github.com>
2021-08-17 16:10:09 +02:00
Rémi Verschelde 913a7a63d5
Merge pull request #51793 from KoBeWi/direnam
Fix renaming directories
2021-08-17 16:06:30 +02:00
Haoyu Qiu 16c2d4ef22 Improve Undo/Redo menu items
* Make Undo/Redo menu items disabled when clicking it does nothing.
    * Context menu of `TextEdit`
    * Context menu of `LineEdit`
    * Editor's Scene menu
    * Script editor's Edit menu and context menu (for Script and Text)
* Make editor undo/redo log messages translatable.
* Mark `UndoRedo`'s `has_{un,re}do()` methods as `const`.
* Expose `TextEdit`'s `has_{un,re}do()` to scripts since `{un,re}do()` are already available.
2021-08-17 21:11:10 +08:00
kobewi 0dde3e5b59 Fix renaming directories 2021-08-17 14:38:48 +02:00
ne0fhyk 3a00ff1cce Add partial support for Android scoped storage.
This is done by providing API access to app specific directories which don't have any limitations and allows us to bump the target sdk version to 30.
In addition, we're also bumping the min sdk version to 19 as version 18 is no longer supported by Google Play Services and only account of 0.3% of Android devices.
2021-08-16 23:11:56 -07:00
jmb462 a3b9842616 Adding InputMap action error suggestion for Input singleton 2021-08-16 20:54:37 +02:00
Rémi Verschelde 2735f829c9
Merge pull request #51739 from neikeq/fix-csharp-instance-bindings
Fix C# native instance bindings after recent re-write
2021-08-16 18:32:16 +02:00
Ignacio Roldán Etcheverry 5ea500e599 Fix C# native instance bindings after recent re-write
This was needed after: 4469144891
2021-08-16 17:16:36 +02:00
Rémi Verschelde fff9a451a1
Merge pull request #51368 from TwistedTwigleg/GSOC_2020_Working_Branch_IK_SQUASHED
New and improved IK system for Skeleton3D - Squashed!
2021-08-16 15:37:17 +02:00
Mai Lavelle ce43781cb3 Fix input methods returning zero strength when pressed status not requested
Fixes behavior of these methods:

`InputMap::event_get_action_status`
`InputEvent*::action_match`

Previously when `p_pressed` was `nullptr`, `p_strength` would be set to
`0.0f` regardless of event strength. This affected `InputEventAction` events
processed by `Input.parse_input_event` for example.

Regression found in afa89c9eea
2021-08-16 00:53:01 -04:00
Rafał Mikrut 221f5da857 Fix crash when dividing by 0 in Vector2/3i 2021-08-15 22:18:17 +02:00
Ricard Rovira Cubeles a8d12b5a61 Add constant to vector function parameters that don't actually modify their input.
Add more overloads of vector multiplication, required by templates to compile with float=64.
2021-08-15 16:45:37 +02:00
TwistedTwigleg 5ffed49907 New and improved IK system for Skeleton3D
This PR and commit adds a new IK system for 3D with the Skeleton3D node
that adds several new IK solvers, as well as additional changes and functionality
for making bone manipulation in Godot easier.

This work was sponsored by GSoC 2020 and TwistedTwigleg

Full list of changes:
* Adds a SkeletonModification3D resource
  * This resource is the base where all IK code is written and executed
* Adds a SkeletonModificationStack3D resource
  * This node oversees the execution of the modifications and acts as a bridge of sorts for the modifications to the Skeleton3D node
* Adds SkeletonModification3D resources for LookAt, CCDIK, FABRIK, Jiggle, and TwoBoneIK
  * Each modification is in it's own file
* Several changes to Skeletons, listed below:
  * Added local_pose_override, which acts just like global_pose_override but keeps bone-child relationships intract
    * So if you move a bone using local_pose_override, all of the bones that are children will also be moved. This is different than global_pose_override, which only affects the individual bone
  * Internally bones keep track of their children. This removes the need of a processing list, makes it possible to update just a few select bones at a time, and makes it easier to traverse down the bone chain
  * Additional functions added for converting from world transform to global poses, global poses to local poses, and all the same changes but backwards (local to global, global to world). This makes it much easier to work with bone transforms without needing to think too much about how to convert them.
  * New signal added, bone_pose_changed, that can be used to tell if a specific bone changed its transform. Needed for BoneAttachment3D
  * Added functions for getting the forward position of a bone
* BoneAttachment3D node refactored heavily
  * BoneAttachment3D node is now completely standalone in its functionality.
    * This makes the code easier and less interconnected, as well as allowing them to function properly without being direct children of Skeleton3D nodes
  * BoneAttachment3D now can be set either using the index or the bone name.
  * BoneAttachment3D nodes can now set the bone transform instead of just following it. This is disabled by default for compatibility
  * BoneAttachment3D now shows a warning when not configured correctly
* Added rotate_to_align function in Basis
* Added class reference documentation for all changes
2021-08-14 15:57:00 -04:00
AndreaCatania c81cb64416 Add the possibility to initialize the classes allocated with the PagedAllocator
It uses the (`const T &&... p_args`) forward reference, to avoid copying the
memory in case it's an rvalue, or pass a reference in case it's an lvalue.

This is an example:
```c++
PagedAllocator<btShapeBox> box_allocator;
btShapeBox* box = box_allocator.alloc( btVector3(1.0, 1.0, 1.0) );
```
2021-08-14 09:04:31 +02:00
Rémi Verschelde 81512a3732
Style: Cleanup code using `text_editor/completion/use_single_quotes` 2021-08-13 21:27:57 +02:00
Rémi Verschelde 9e37336124
Merge pull request #51508 from AndreaCatania/mem-placement
Refactors the memnew_placement.
2021-08-13 14:58:02 +02:00
Rémi Verschelde 87b80a84f0
Merge pull request #51582 from AnilBK/ustring-macro-replacements
ustring: Replace macros with inline functions.
2021-08-13 14:42:09 +02:00
Rémi Verschelde 85e315d6e8
Merge pull request #51607 from aaronfranke/includes
Fix some unnecessary includes
2021-08-13 14:38:56 +02:00
Pedro J. Estébanez dc187324be Add input buffering framework
Input buffering is implicitly used by event accumulation, but this commit makes it more generic so it can be enabled for other uses.

For desktop OSs it's currently not feasible given main and UI threads are the same).
2021-08-13 11:19:19 +02:00
Pedro J. Estébanez 7c864d41c9 Improve input event accumulation
- API has been simplified: all events now go through `parse_input_event()`. Whether they are accumulated or not depends on the `use_accumulated_input` flag.
- Event accumulation is now thread-safe (it was not needed so far, but it prepares the ground for the following changes).
- Touch drag events now support accumulation.
2021-08-13 11:19:19 +02:00
AndreaCatania 98ceb60eb4 Refactors the memnew_placement.
With this commit the macro `memnew_placement` uses the standard memory
placement syntax: `new (mem) TheClass()`, and removes the outdated and
not used syntax:
```
_ALWAYS_INLINE_ void *operator new(size_t p_size, void *p_pointer, size_t check, const char *p_description) {
```

Thanks to this change, the function `memnew_placement` call is compatible with
any class, and can also initialize classes with non-empty constructor:
```
// This is valid, like before.
memnew_placement(mem, Variant);

// This works too:
memnew_placement(mem, Variant(123));
```
2021-08-13 10:18:34 +02:00
Aaron Franke eb4902a455
Fix some unnecessary includes 2021-08-13 00:27:38 -05:00
Anilforextra c350a33898 Convert ustring macros to inline functions and use them wherever possible.
Add new inline functions to check if a character is lowercase or uppercase.

Remove unused upper case macro.
2021-08-13 10:32:29 +05:45
Rémi Verschelde 6e9439198c
Resource: Remove unused `_use_builtin_script()` virtual method
And another piece of dead code found while searching for "use_builtin".
2021-08-12 12:16:17 +02:00
Rémi Verschelde d7a39cc346
Merge pull request #38992 from Dragoncraft89/master
Error handling functions for GdScript
2021-08-11 18:43:27 +02:00
Rémi Verschelde c00303ff55
Merge pull request #47378 from aaronfranke/use-input-enums
Use key enum instead of plain integers for input code
2021-08-11 11:20:45 +02:00
Hugo Locurcio 937c1a716c
Rename `iterations_per_second` to `physics_ticks_per_second`
This makes it clearer that this property is only about physics FPS,
not rendering FPS.

The `physics_fps` project setting was also renamed to
`physics_ticks_per_second` for consistency.
2021-08-11 02:37:02 +02:00
Aaron Franke fa3a32a2d6
Use Key enum instead of plain integers 2021-08-10 16:26:55 -05:00
Rémi Verschelde dce488d8f7
Merge pull request #49417 from Bhu1-V/gsoc-cmd-plt
Command Palette For Godot
2021-08-10 18:55:22 +02:00
Rémi Verschelde 46beaacec3
Merge pull request #51017 from vnen/extension-fixes 2021-08-10 16:42:31 +02:00
Rémi Verschelde 16d73fefdb
Merge pull request #50682 from aaronfranke/basis-looking-at
Move code for looking_at to Basis
2021-08-10 11:28:12 +02:00
George Marques ee6e05ee68
Rename GDNative call error enum values to use GDNATIVE prefix
To make sure it does not clash with other libraries.
2021-08-09 19:21:37 -03:00
Aaron Franke 84f720966c
Use doubles for time in many other places 2021-08-09 14:05:42 -05:00
Fabio Alessandrelli 9fcf3b5a9c [Net] Basic extensible MultiplayerAPI spawn/despawn.
`PackedScene`s can be configured to be spawnable via a new
`MultiplayerAPI.spawnable_config` method.
They can be configured either to be spawned automatically when coming
from the server or to always require verification.
Another method, `MultiplayerAPI.send_spawn` lets you request a spawn on
the remote peers.
When a peer receive a spawn request:
- If it comes from the server and the scene is configured as
  `SPAWN_MODE_SERVER`:
  - Spawn the scene (instantiate it, add it to tree).
  - Emit signal `network_spawn`.
- Else:
  - Emit signal `network_spawn_request`.

In a similar way, `despawn`s are handled automatically in
`SPAWN_MODE_SERVER`.

In `SPAWN_MODE_SERVER`, when a new client connects it will also receive,
from the server all the spawned (and not yet despawned) instances.
2021-08-09 16:34:40 +02:00
Fabio Alessandrelli 9798d08ac2 [Core] Expose ResourceLoader.get_resource_uid. 2021-08-09 16:26:56 +02:00
Bhuvan Vemula a0a019a998 Added EditorCommandPalette 2021-08-09 17:41:50 +05:30
bruvzg 7c3c5603d0 [Text Server] Improve object (image/table) inline alignment. 2021-08-08 22:35:47 +03:00
Rémi Verschelde 73cd3f0b38
Merge pull request #51395 from angad-k/pseudolocalization-squashed
Add pseudolocalization to Godot. (GSoC'21)
2021-08-08 17:55:30 +02:00
Angad Kambli e79dde1cbb add pseudolocalization to Godot 2021-08-08 20:37:57 +05:30
Pedro J. Estébanez a6303b70a5 Fix logic to allow default null thread argument 2021-08-08 12:53:30 +02:00
Julien Nguyen daee3c316f Fix action_get_events returning booleans instead of InputKey entries 2021-08-07 21:17:55 +02:00
lawnjelly dd0f54a368 Fix Transform::xform(Plane) functions
The Transform::xform and xform_inv are made safe for Planes when using non-uniform scaling.
Optimization of calling sites to prevent loss of performance from the changes to xform(Plane).
2021-08-07 11:10:50 +01:00
George Marques 08804922f2
Bind missing constants from PropertyHint and PropertyUsage 2021-08-06 11:19:44 -03:00
Rémi Verschelde 8c3a6b10a9
OS: Fix used resource debug prints
These methods were broken by 22419082d9
5 years ago and nobody complained, so maybe they're not so useful...
But at least this should restore them to a working state.
2021-08-06 11:03:26 +02:00
Rémi Verschelde faad8833fe
Merge pull request #51234 from akien-mga/tests-file-get_csv_line
Tests: Improve coverage for `File::get_csv_line()`
2021-08-06 10:17:12 +02:00
George Marques 3f362cec68
Improve extension system
- Fix library loading and initialization.
- Add extra methods/parameters in the interface needed by extenstions.
- Add Variant destructors and functions for extracting values and
  creating Variants from values.
2021-08-05 14:57:31 -03:00
George Marques 97947bc063
Fix a few default parameters in bindings
They have the wrong type and cause issues with extensions.
2021-08-05 14:57:29 -03:00
George Marques 626c0b6905
Add a instance callback for extensions
This sends the Godot object instance back to the extension so they can
keep a pointer for function calls.

Incidentally fix argument order on instance bindings callback for free()
2021-08-05 14:56:13 -03:00
George Marques 4205d907c9
Improve extension API dump
- Fix type size information.
- Validate sizes at compile time (for the current build configuration
  only).
- Normalize type names.
- Add extra information.
2021-08-05 14:56:13 -03:00
Rémi Verschelde a544e77822
Merge pull request #51247 from pycbouh/docs-extract-theme-items
Add theme item descriptions to the online documentation
2021-08-05 00:18:56 +02:00
Rémi Verschelde 73b1f5ac79
Merge pull request #48615 from Razoric480/lsp-rename
Implement LSP didSave notification and rename request
2021-08-05 00:18:31 +02:00
Yuri Sizov bf2839ea3e Add theme item descriptions to the online documentation 2021-08-04 22:27:10 +03:00
Rémi Verschelde b8c08ba5ad
Tests: Improve coverage for `File::get_csv_line()`
Adds a few more complex edge cases which are supported.

Also adds some documentation, simplifies the code a bit and forbids using
double quotes as a delimiter.
2021-08-04 11:53:21 +02:00
Rémi Verschelde 0cee8831b2
Merge pull request #51005 from Faless/mp/4.x_channels
[Net] Implement RPC channels in MultiplayerAPI.
2021-08-04 09:31:33 +02:00
Fabio Alessandrelli 09386ba9fd [Headless] Add --headless switch (no rendering, no audio).
Also remove now unused "--no-window" option, and relative OS getter and
setter.
2021-08-03 17:45:50 +02:00
Fabio Alessandrelli 80fc90e82a
Merge pull request #50454 from Ev1lbl0w/gsoc21-dap
Implemented initial DAP support
2021-08-03 17:12:37 +02:00
Rémi Verschelde 3c21fc5db6
Merge pull request #51199 from Faless/net/4.x_ip_lock 2021-08-03 13:29:15 +02:00
Rémi Verschelde 8e4848ad34
Merge pull request #51093 from RandomShaper/fix_thread_null_ud
Fix thread start with no user data when target has no default argument
2021-08-03 08:43:39 +02:00
K. S. Ernest (iFire) Lee 04703c6f66
Merge pull request #51042 from nikitalita/fix_binary_res_load_save
Fix binary resource loading and saving
2021-08-02 18:41:05 -07:00
Fabio Alessandrelli aca5540e13 [Net] Fix IP address resolution incorrectly locking the main thread.
This seems to be a pretty old bug, older then originally reported (at
least under certain circumstances).

The IP singleton uses a resolve queue so developers can queue hostnames
for resolution in a separate while keeping the main thread unlocked
(address-resolution OS functions are blocking, and could block for a long
time in case of network disruption).

In most places though, the address resolution function was called with
the mutex locked, causing other functions (querying status, queueing
another hostname, ecc) to block until that resolution ended.

This commit ensures that all calls to OS address resolution are done
with the mutex unlocked.
2021-08-03 00:24:22 +02:00
Fabio Alessandrelli fed0bf013a [Marshalls] Fix Float64Array and Int64Array serialization.
One was incorrectly reading the size (potentially causing out-of-buffer
read), the other also potentially causing out-of-buffer write during
encoding.
2021-08-02 13:35:33 +02:00
Ev1lbl0w 7bccd5487e
Implemented initial DAP support
Implemented "output" event

Refactored "seq" field generation

Prevent debugging when editor and client are in different projects

Removed unneeded references to peer on the parser

Refactored way to detect project path

Implemented "setBreakpoints" request

Fix double events when terminating from client

Refactored "stopped" event

Implemented "stopped" with breakpoint event

Implemented "stackTrace", "scopes" and "variables" request

Report incoming number of stack dump variables

Implemented proper reporting of scopes and variables from stack frames

Prevent editor from grabbing focus when a DAP session is active

Implemented "next" and "stepIn" requests

Implemented "Source" checksum computing

Switched expected errors from macros to silent guards

Refactored message_id

Respect client settings regarding lines/columns behavior

Refactored nested DAP fields

Implement reporting of "Members" and "Globals" scopes as well

Fix error messages not being shown, and improved wrong path message
2021-08-02 10:43:35 +01:00
Aaron Franke 9f3ae0adcd
Move code for looking_at to Basis 2021-08-01 12:49:02 -05:00
Rémi Verschelde e5411a815c
Merge pull request #48958 from kleonc/astar-get_available_point_id-start-from-zero
Astar::get_available_point_id Return 0 instead of 1 when empty
2021-08-01 11:12:33 +02:00
Rémi Verschelde d7b61838b1
Merge pull request #51084 from aaronfranke/no-dectime
Remove obsolete `dectime` method
2021-07-31 10:20:29 +02:00
Pedro J. Estébanez 7ca8051645 Fix thread start with no user data when target has no default argument 2021-07-31 10:04:48 +02:00
Aaron Franke 2733b9abd8
Remove obsolete "dectime" method
Replaced by "move_toward"
2021-07-30 16:41:28 -05:00
Rémi Verschelde f3aaa713d9
VariantParser: Fix uninitialized ResourceParser funcs
They could cause a segfault when parsing values with ID "Resource"
as apparently we never set a valid `func` for it.

Fixes crash part of #42115.
2021-07-30 23:23:31 +02:00
Fabio Alessandrelli 2cf39b97ae [Net] Implement RPC channels in MultiplayerAPI. 2021-07-30 17:29:50 +02:00
Fabio Alessandrelli 324636473a [Net] Fix Marshalls infinite recursion crash.
Variants like dictionaries and arrays can have cyclic references, which
caused `encode_variant` to run an infinite recursion.
Instead of keeping a stack and looking for cyclic references which would
make serialization slower, this commit adds a `MAX_RECURSION_DEPTH`
constant to Variant, and have `encode_variant` keep track of the current
recursion depth, bailing when it's too high since this likely means a
cyclic reference has been encountered.
2021-07-30 16:13:43 +02:00
nikitalita 6640ab406b skip uid field length in binary resource if not used 2021-07-29 22:25:18 -07:00
nikitalita bc58bf5477 Use constant for reserved field count 2021-07-29 22:24:29 -07:00
nikitalita 160601cc78 Fix binary resource loading and saving 2021-07-29 18:17:49 -07:00
Fabio Alessandrelli 1e8bf86379 [Net] Add generate_unique_id to MultiplayerPeer.
Used by ENetMultiplayerPeer and WebSocketServer to generate network IDs,
and exposed to the user for p2p networks (e.g. WebRTCMultiplayerPeer)
and custom MultiplayerPeer implementations.
2021-07-29 10:40:03 +02:00