Commit graph

3699 commits

Author SHA1 Message Date
Rémi Verschelde 058f3fe069
Merge pull request #44149 from madmiraal/rename-tangent-orthogonal
Rename Vector2.tangent() to Vector2.orthogonal()
2020-12-28 16:00:12 +01:00
Rémi Verschelde 9addcb7603
Merge pull request #44751 from madmiraal/rename-rect-grow_margin
Rename Rect2 and Rect2i grow_margin() to grow_side()
2020-12-28 15:56:14 +01:00
Rémi Verschelde e4c0572385
Merge pull request #44593 from madmiraal/rename-mainloop-methods
Rename MainLoop methods to match Node methods
2020-12-28 14:44:28 +01:00
Marcel Admiraal b743a2ef3c Rename Math::stepify to snapped 2020-12-28 13:01:30 +00:00
Marcel Admiraal b628912af0 Rename Rect2 and Rect2i grow_margin() to grow_side() 2020-12-28 12:47:33 +00:00
Marcel Admiraal 5b937d493f Rename empty() to is_empty() 2020-12-28 10:39:56 +00:00
Hugo Locurcio 35b046ddf7
Add an OS.get_thread_caller_id() method
This can be used to print thread IDs in logs. This can make it easier
to debug multi-threaded applications.

Co-authored-by: Khaos <khaos@khaos-coders.org>
2020-12-27 16:54:18 +01:00
George Marques d66a58a4d4
Add helper count function to Variant
To get counts of items before getting the list, which is useful for
GDNative so users can pre-allocate the buffer with the correct size
without having to get the list twice.
2020-12-27 11:14:29 -03:00
reduz 548524152e Rewrite culling to be more cache/thread friendly.
-Uses a single array with all data
-Massive performance improvement
-Does not support threads yet, but code is now thread friendly
2020-12-26 19:11:33 -03:00
reduz 2e66e5d599 Use page allocator for BVH 2020-12-24 14:08:03 -03:00
Andrea Catania 7c6506e028
Fixes: GDscript min and max are inverted 2020-12-24 18:03:50 +01:00
reduz 1bebb2ba05 Cull fixes and optimizations 2020-12-24 12:18:28 -03:00
lawnjelly 6d687de9b8 Fix BVH to world_aabb, and call update
The calls to the BVH need to use the world space AABB, rather than local space for it to work. Also, update was not being called which is required to update the AABB as objects move.
2020-12-24 11:19:50 +00:00
Juan Linietsky 3fdf4bfe71
Merge pull request #44623 from reduz/rewrite-renderer-indexer
Replace Octree by DynamicBVH in cull code
2020-12-24 00:20:45 -03:00
Rémi Verschelde 210ebb04d3
Merge pull request #44609 from m4gr3d/fix_top_level_android_export
Fix the `String::get_base_dir()` logic to properly check for top level directories on Windows
2020-12-23 23:56:45 +01:00
reduz 83058597cf Replace Octree by DynamicBVH in cull code
-Much greater pairing/unpairing performance
-For now, using it for culling too, but this will change in a couple of days.
-Added a paged allocator, to efficiently alloc/free some types of objects.
2020-12-23 19:31:30 -03:00
Fredia Huya-Kouadio 8edacea04a Fix the String::get_base_dir() logic to properly check for top level directories on Windows. 2020-12-23 00:48:18 -08:00
Marcel Admiraal 4b8b803931 Rename Control margin to offset 2020-12-23 06:25:56 +00:00
Marcel Admiraal d9e9eb8d04 Rename MainLoop methods to match Node methods 2020-12-22 12:34:57 +00:00
Marco Cognetta 900e55eb70 simplify randi_range 2020-12-21 20:25:58 -05:00
reduz 37c6434e16 Add a paged array template
Used for reusable stacks, or filling arrays from multiple threads efficiently.
2020-12-21 15:06:50 -03:00
Rémi Verschelde 6532596d97
Merge pull request #44472 from winterpixelgames/PR-duplicate-packedarrays
Add support for duplicate() for Packed*Array, and they are pass by ref in godot 4.0
2020-12-21 17:30:01 +01:00
Rémi Verschelde fa9332a0e7
Merge pull request #43414 from Xrayez/pi-type-string
Expose `PROPERTY_HINT_TYPE_STRING` to scripting
2020-12-20 21:18:11 +01:00
Rémi Verschelde bf088da339
Merge pull request #43196 from Xrayez/property-list-changed-notify-protected
Make `property_list_changed_notify()` protected in `Object`
2020-12-20 21:16:14 +01:00
Juan Linietsky fc4d90e70d
Merge pull request #44531 from reduz/add-dynamic-bvh
Add a Dynamic BVH implementation.
2020-12-20 13:22:05 -03:00
Pedro J. Estébanez b7367ac426 Add animation reset track feature
As a bonus, to have consistency between use Beziers and create insert tracks, use Beziers also gets a default via editor settings that is used when the confirmation dialog is disabled, instead of just falling back to creating non-Bezier tracks.
2020-12-20 12:45:08 +01:00
Pedro J. Estébanez 1f52782bbb Extend UndoRedo handling of Resource to every Reference 2020-12-20 10:59:23 +01:00
reduz 5ff89931c7 Add a Dynamic BVH implementation.
-Based on Bullet Dbvh, has style and functional changes.
-Provides efficient pairing
-Needed to optimize rendering
-Needed to optimize physics

This PR is up for others to review the implementation.
2020-12-19 20:23:37 -03:00
Marcel Admiraal 2df9a8ccad Rename Rect2 and Rect2i clip() to intersection() 2020-12-19 12:59:08 +00:00
Rémi Verschelde 16524d4ae1
Merge pull request #44445 from theogen-ratkin/master
Add interpolation parameter to resize_to_po2()
2020-12-19 09:34:41 +01:00
Theogen Ratkin 46ea6750b4 Add interpolation parameter to resize_to_po2()
Image::resize_to_po2() now takes an optional p_interpolation parameter
that it passes directly to resize() with default value INTERPOLATE_BILINEAR.
2020-12-18 14:05:07 -04:00
reduz d2302f53d6 Implement automatic LOD (Level of Detail)
-Happens on import by default for all models
-Just works (tm)
-Biasing can be later adjusted per node or per viewport (as well as globally)
-Disabled AABB.get_support test because its broken
2020-12-18 15:48:03 +01:00
Rémi Verschelde c7b53c03ae
SCons: Add explicit dependencies on thirdparty code in cloned env
Since we clone the environments to build thirdparty code, we don't get an
explicit dependency on the build objects produced by that environment.

So when we update thirdparty code, Godot code using it is not necessarily
rebuilt (I think it is for changed headers, but not for changed .c/.cpp files),
which can lead to an invalid compilation output (linking old Godot .o files
with a newer, potentially ABI breaking version of thirdparty code).

This was only seen as really problematic with bullet updates (leading to
crashes when rebuilding Godot after a bullet update without cleaning .o files),
but it's safer to fix it everywhere, even if it's a LOT of hacky boilerplate.
2020-12-18 10:29:34 +01:00
Jordan Schidlowsky 2d56e09276 packed*arrays are pass by ref now. support duplicate and update documentation 2020-12-17 16:09:32 -06:00
Pedro J. Estébanez 1b745c7bae Fix crash parsing a serialized Reference 2020-12-17 12:24:57 +01:00
Rémi Verschelde f3dccf5891
Merge pull request #44393 from Calinou/add-stdout-flush-project-setting
Add a project setting to enable stdout flushing in release builds
2020-12-17 10:06:50 +01:00
Brian Semrau bb4d44102d Fix bitwise-and eval not updating return type 2020-12-16 08:59:06 -05:00
Rémi Verschelde cb42bf113c
Merge pull request #44406 from vnen/variant-ptr-construct
Add PtrConstruct template to use in Variant constructors
2020-12-15 22:59:32 +01:00
George Marques b3f452b1d2
Change template order in method_ptrcall.h
To be consistent with the enum in Variant so missing types can be more
easily spotted.
2020-12-15 17:02:50 -03:00
George Marques 35e7490c95
Add PtrConstruct template to use in Variant constructors
Since the PtrToArg::encode requires the value to be constructed
previously. With PtrConstruct this is not required.
2020-12-15 16:57:44 -03:00
Rémi Verschelde 94b15bfb89
Merge pull request #44275 from vnen/variant-function-arg-pointers
Use pointer parameters in Variant function pointers
2020-12-15 20:52:03 +01:00
Andy Savage c65f097ebd Quick fix to incorrect error messages when writing to compressed or encrypted files. 2020-12-15 17:00:39 +00:00
Hugo Locurcio 341b9cf15a
Add a project setting to enable stdout flushing in release builds
This can be used in server builds for journalctl compatibility.
2020-12-15 16:40:52 +01:00
EricEzaM 5c15461df2 Fixed mistakes in InputEvent as_text and to_string implementations. 2020-12-14 12:42:42 +10:00
Rémi Verschelde 2760f5d0b4
Merge pull request #44315 from madmiraal/fix-handles-baseexception
Don't handle BaseException in build scripts
2020-12-12 12:23:07 +01:00
Marcel Admiraal 8ef5e3201c Don't handle BaseException in build scripts 2020-12-12 10:05:42 +00:00
Alf Kraus 68fdd753a7 wrong double quote output with .csv fixed 2020-12-11 11:42:43 +01:00
Rémi Verschelde 9263f8eb4b
Image: Rename PVRTC{2,4} to PVRTC1_{2,4}, drop COMPRESS_PVRTC2
We haven't had a proper implementation for COMPRESS_PVRTC2 (which is PVRTC1 2-bpp) in years,
so let's drop it instead of keeping a compress type which doesn't work.

The other enum values were renamed to clarify that our PVRTC2 and PVRTC4 are respectively
PVRTC1 2-bpp and PVRTC1 4-bpp. PVRTC2 2-bpp and 4-bpp are not implemented yet.
2020-12-10 23:14:04 +01:00
George Marques 0abacae2d3
Fix object check on Variant key checker 2020-12-10 18:18:52 -03:00
George Marques e4e9231420
Use pointer parameters in Variant function pointers
Instead of references. This is needed because those function pointers
are used in GDNative which needs to work with plain C, which doesn't
support passing parameters by reference.
2020-12-10 18:18:47 -03:00
Andrii Doroshenko (Xrayez) 9aa06c3e65 Make property_list_changed_notify protected in Object
Alternative to `_change_notify()` to be called from within C++ classes.

Achieves low-level consistency with scripting, where this method is
exposed for updating the editor (inspector) with new values.
2020-12-10 14:27:41 +02:00
Rémi Verschelde 114f97ff11
Merge pull request #44128 from KoBeWi/🧹
Cleanup unused engine code
2020-12-09 13:01:50 +01:00
Tomasz Chabora 2c048ea164 Cleanup unused engine code 2020-12-09 12:12:36 +01:00
Rémi Verschelde 92c001ef09
Merge pull request #43931 from bruvzg/ctl_comp_font
[Complex Text Layouts] Add compatibility for legacy Font resources.
2020-12-09 11:28:11 +01:00
Rémi Verschelde 0c5d3b838c
Merge pull request #44199 from bruvzg/pvs_fixes_1
PVS-Studio static analyzer fixes
2020-12-09 10:23:21 +01:00
bruvzg 644f739660
Static analyzer fixes:
Removes unused code in OS.
Fixes return types.
Fixes few typos.
2020-12-09 10:17:53 +02:00
Rémi Verschelde e5e1277ecd
Merge pull request #44161 from Faless/fix/fa_buffered_remove
Remove unused FileAccessBuffered
2020-12-09 09:14:14 +01:00
Rémi Verschelde 2034a1cca0
Merge pull request #44089 from Xrayez/rng-state
Add ability to restore `RandomNumberGenerator` state
2020-12-08 21:40:38 +01:00
Rémi Verschelde 90bdba576a
Merge pull request #43742 from qarmin/editor_modules_default_values
Initialize class/struct variables with default values in platform/ and editor/
2020-12-08 15:53:42 +01:00
Emmanuel Leblond a211812932
Constify ScriptLanguage.can_inherit_from_file 2020-12-08 13:06:15 +01:00
Rémi Verschelde a834055c63
Merge pull request #44148 from Calinou/tweak-log-file-names
Tweak log file names for consistency between Mono and non-Mono logs
2020-12-08 09:42:54 +01:00
Andrii Doroshenko (Xrayez) b5107715f1 Add ability to restore RandomNumberGenerator state
- added `state` as a property to restore internal state of RNG;
- `get_seed()` returns last seed used to initialize the state rather than the current state.

Co-authored-by: MidZik <matt.idzik1@gmail.com>
2020-12-07 13:50:46 +02:00
Aaron Franke 5465e604bb
Improve argument names for core types 2020-12-07 05:01:33 -05:00
Hugo Locurcio 4d81776fc9
Tweak log file names for consistency between Mono and non-Mono logs
- Avoid spaces in Mono log file names.
- Use a `.log` extension for Mono logs, just like non-Mono logs.
- Use periods to separate hours/minutes/seconds for non-Mono logs.
2020-12-06 20:17:02 +01:00
Fabio Alessandrelli 781efc26e0 Remove now unused FileAccessBuffered. 2020-12-06 19:37:11 +01:00
Marcel Admiraal a24c38d1a8 Rename Vector2.tangent() to Vector2.orthogonal() 2020-12-06 18:16:06 +00:00
Aaron Franke 1b348b3c17
Remove connect *_compat methods 2020-12-05 17:56:47 -05:00
Rémi Verschelde 1287ea63c1
Merge pull request #44084 from vnen/float-is-real
Rename TYPE_REAL to TYPE_FLOAT
2020-12-04 14:26:22 +01:00
George Marques 02f60812ed
Rename TYPE_REAL to TYPE_FLOAT
To be consistent with the naming everywhere else.
2020-12-04 09:47:26 -03:00
reduz e93b2242c2 Reorganize rendering server.
-Made RenderingServerScene abstract, allowing reimplementation
-RenderingServerRaster -> RenderingServerDefault, but this class is going away soon.
2020-12-03 19:01:01 -03:00
Rémi Verschelde 9c30c83aee
Merge pull request #44011 from KoBeWi/red_roses_minus_blue_violets
Fix subtracting colors and quats
2020-12-03 14:44:52 +01:00
Tomasz Chabora 4c232e4222 Fix subtracting colors and quats 2020-12-03 14:22:12 +01:00
Rémi Verschelde df53bf6397
Merge pull request #43660 from EricEzaM/PR/INP1-inputevent_as_text_and_to_string
InputEvent as_text now returns readable string. Added to_string for debug strings
2020-12-03 13:28:29 +01:00
Rémi Verschelde 1b37c522dc
Merge pull request #44061 from madmiraal/fix-44056
Ignore hint entries in game controller mapping
2020-12-03 13:27:28 +01:00
Fabio Alessandrelli 502ff74fee
Merge pull request #43536 from jonbonazza/hmac
feat: HMAC support in Crypto APIs
2020-12-03 11:08:16 +01:00
Marcel Admiraal e887ebf817 Ignore hint entries in game controller mapping 2020-12-03 09:06:40 +00:00
bruvzg 3c3590522f
[Complex Text Layouts] Add compatibility for legacy Font resources. 2020-12-03 10:34:03 +02:00
reduz 70f5972905 Refactored Mesh internals and formats.
-Changed how mesh data is organized, hoping to make it more efficient on Vulkan and GLES.
-Removed compression, it now always uses the most efficient format.
-Added support for custom arrays (up to 8 custom formats)
-Added support for 8 weights in skeleton data.
-Added a simple optional versioning system for imported assets, to reimport if binary is newer
-Fixes #43979 (I needed to test)

WARNING:

-NOT backwards compatible with previous 4.x-devel, will most likely never be, but it will force reimport scenes due to version change.
-NOT backwards compatible with 3.x scenes, this will be eventually re-added.
-Skeletons not working any longer, will fix in next PR.
2020-12-02 13:07:59 -03:00
Rafał Mikrut e1811b689b Initialize class/struct variables with default values in platform/ and editor/ 2020-12-02 16:09:11 +01:00
Rémi Verschelde d1231be1c8
Merge pull request #41095 from ThakeeNathees/GDScript-Documentation
GDScript(2.0) Documentation generation system
2020-12-02 14:15:38 +01:00
bruvzg 7be8759991
Fix .pck lookup for extensionless binary in macOS resources. 2020-12-02 11:04:44 +02:00
Thakee Nathees 42bfa16996 Refactor DocData into core and editor (DocTools) parts 2020-12-02 00:48:39 +05:30
George Marques 029fd88adb
Fix VariantInternal initialization and setting of object
- Initialize Object pointer to nullptr so it's not used by mistake.
- When setting an Object check if it's a reference so refcounting works
  as intended.
2020-11-30 14:49:52 -03:00
Thakee Nathees d0e7d9b62f Documentation generation for GDScript
- ClassDoc added to GDScript and property reflection data were extracted
from parse tree

- GDScript comments are collected from tokenizer for documentation and
applied to the ClassDoc by the GDScript compiler

- private docs were excluded (name with underscore prefix and doesn't
have any doc comments)

- default values (of non exported vars), arguments are extraced from the
parser

- Integrated with GDScript 2.0 and new enums were added.

- merge conflicts fixed
2020-11-29 19:45:36 +05:30
Rémi Verschelde 3b4fad435c
Merge pull request #43061 from qarmin/crash_when_prining_nodes
Fix crash when printing leaked nodes
2020-11-28 10:37:12 +01:00
Rémi Verschelde a6751e6c58
Merge pull request #41100 from bruvzg/ctl_text_server_interface
[Complex Text Layouts] Implement TextServer interface.
2020-11-28 09:03:15 +01:00
Rémi Verschelde bd84600132
Merge pull request #43903 from cptchuckles/fix-sign
Fix SGN macro
2020-11-28 09:01:47 +01:00
Hugo Locurcio aa2344afe4
Mention lack of optional setter arguments in ClassDB::add.property() 2020-11-28 01:34:13 +01:00
jcgollnick 3347cc25b8 Fix SGN macro
This version behaves the way the documentation states: 0 values will resolve to 0 instead of +1
2020-11-27 13:02:12 -06:00
Fabio Alessandrelli 828d1ea59e
Merge pull request #40136 from Jummit/multiplayer-root-node-getters
Add root_node as property of MultiplayerAPI
2020-11-27 18:36:07 +01:00
Fabio Alessandrelli 4b6a35c74a Disable SO_REUSEADDR for UDP.
It allows binding multiple sockets to the same ADDR:PORT (unlike TCP,
which still requires different ADDR:PORT combinations).
2020-11-27 14:12:34 +01:00
Jon Bonazza d5925fd522 feat: HMAC support in Crypto APIs 2020-11-26 18:39:56 -08:00
Eric M dfe4c5f8e1 InputEvent as_text now returns readable string. Added to_string for debug strings
Made InputEvent as_text() return a readable and presentable string. Added to_string() overrides for each which returns a 'debug-friendly' version which is not as presentable but provides more information and in a more structured fashion. Use as_text() for UI display scenarions and to_string() for debug cases
2020-11-27 00:42:16 +10:00
bruvzg 99666de00f
[Complex Text Layouts] Refactor Font class, default themes and controls to use Text Server interface.
Implement interface mirroring.
Add TextLine and TextParagraph classes.
Handle UTF-16 input on macOS and Windows.
2020-11-26 14:25:48 +02:00
bruvzg 493da99269
[Complex Text Layouts] Implement TextServer interface. Implement Fallback TextServer. 2020-11-26 13:55:26 +02:00
Eric M 3528b29669 Removed references to 'registering_order', as it was unused. 2020-11-26 15:37:40 +10:00
Rémi Verschelde ff790796af
Merge pull request #43864 from vnen/fix-print-utilities
Fix prints and printt functions printing as errors
2020-11-25 23:07:52 +01:00
George Marques 40b683f8bb
Fix prints and printt functions printing as errors 2020-11-25 16:18:41 -03:00
Rémi Verschelde d76806d322
Core: Always enable ptrcall, remove PTRCALL_ENABLED define
ptrcall is now also used to optimize calls in GDScript, on top of the existing
use by the GDNative and Mono modules.

It no longer makes sense to make it optional.
2020-11-25 14:08:17 +01:00
Rémi Verschelde 32b31a5fa4
Merge pull request #43730 from qarmin/core_drivers_default_values
Initialize class/struct variables with default values in core/ and drivers/
2020-11-24 13:00:27 +01:00