Commit graph

3526 commits

Author SHA1 Message Date
Rémi Verschelde 408effa688
Merge pull request #43612 from akien-mga/variant-utils-doc
doc: Sync classref with Variant utility methods
2020-11-17 13:50:08 +01:00
Rémi Verschelde c6dcf3310d
doc: Sync classref with Variant utility methods
Copied relevant documentation from the original `@GDScript` built-ins,
which will likely be removed in a future commit.

Various fixups to `variant_utility.cpp` while working on this.
2020-11-17 11:26:24 +01:00
Rémi Verschelde 386ee52978
Merge pull request #43610 from RandomShaper/fix_res_duplicate
Fix crash in resoure duplicate
2020-11-17 11:21:53 +01:00
Pedro J. Estébanez 9450717571 Fix crash in resoure duplicate 2020-11-17 10:13:41 +01:00
Aaron Franke 02161aad5a
Remove empty lines around braces with the formatting script 2020-11-16 23:38:11 -05:00
Rémi Verschelde fbe0386c65
Merge pull request #43233 from madmiraal/fix-42876
Remove unneeded filter on joy_axis()
2020-11-16 22:41:14 +01:00
Fabio Alessandrelli efe3eaf6a4
Merge pull request #43493 from timothyqiu/request-absolute-authority
Allow HTTPClient to talk to a proxy server
2020-11-16 16:00:26 +01:00
Rémi Verschelde 6c2db73937
Merge pull request #43566 from Calinou/remove-pause-mode-script-property-groups
Remove property groups for Pause Mode and Script
2020-11-16 12:53:31 +01:00
Rémi Verschelde 19f27ab486
Merge pull request #42976 from aaronfranke/input-get-axis
Allow getting Input "axis" and "vector" values by specifying multiple actions
2020-11-16 09:30:34 +01:00
Rémi Verschelde a6150eb267
Merge pull request #43289 from KoBeWi/removelease_action
Release pressed action if event is removed
2020-11-16 09:29:04 +01:00
Hugo Locurcio 5770e08c2a
Remove property groups for Pause Mode and Script
Each of those only grouped 1 property, making them useless.

This closes https://github.com/godotengine/godot-proposals/issues/1840.
2020-11-15 16:01:10 +01:00
Zae fa3e0bdd73 fix custom loader/saver broken 2020-11-15 22:14:06 +08:00
Haoyu Qiu d92ca6fbb1 Allows HTTPClient to talk to proxy server
* Makes request uri accept absolute URL and authority
* Adds Host header only when missing
2020-11-14 21:25:15 +08:00
Tomasz Chabora b7c612bd54 Release pressed action if event is removed 2020-11-12 16:54:16 +01:00
reduz 635d33dc6c Refactor variant built-in methods yet again.
* Using C-style function pointers now, InternalMethod is gone.
* This ensures much better performance in typed code.
* Renamed builtin_funcs to utility_funcs, to avoid naming confusion
2020-11-11 16:36:36 -03:00
Rémi Verschelde fb2151089c
Merge pull request #43372 from aaronfranke/clamp-fixes
Minor clamp and float fixes
2020-11-11 13:20:19 +01:00
Aaron Franke 4abf189e36
Allow getting Input axis/vector values by specifying multiple actions
For get_vector, use raw values and handle deadzones appropriately
2020-11-11 06:02:44 -05:00
Aaron Franke 195d58be0f
Add raw strength value for internal use 2020-11-11 05:58:21 -05:00
reduz 5288ff538d Create Variant built-in functions.
-Moved Expression to use this, removed its own.
-Eventually GDScript/VisualScript/GDNative need to be moved to this.
-Given the JSON functions were hacked-in, removed them and created a new JSONParser class
-Made sure these functions appear properly in documentation, since they will be removed from GDScript
2020-11-10 19:31:10 -03:00
Aaron Franke ee79fc627c
Minor clamp and float fixes 2020-11-10 14:30:07 -05:00
Rémi Verschelde 03ae26bb74
Merge pull request #43398 from KoBeWi/add_an_array_to_another_array_but_with_a_method
Add append_array() method to Array class
2020-11-10 13:53:58 +01:00
Rémi Verschelde 32464e569f
Merge pull request #40748 from RandomShaper/improve_packed_fs_api
Improve/fix packed data API
2020-11-10 10:59:34 +01:00
Rémi Verschelde 0f249f5c0a
Variant: Sync docs with new constructors, fixups after #43403
Change DocData comparators for MethodDoc and ArgumentDoc to get a better
ordering of constructors.
2020-11-09 23:39:53 +01:00
reduz 9979abce74 Change how no-arg constructor is handled internally in Variant. 2020-11-09 16:28:15 -03:00
Rémi Verschelde b4a0661885
Merge pull request #43419 from reduz/document-operators
Make sure operators appear in the docs too
2020-11-09 19:54:34 +01:00
Rémi Verschelde aa6a1094a5
Merge pull request #43415 from bruvzg/var_ctr_af32
Fix duplicate variant constructor typo.
2020-11-09 19:21:20 +01:00
reduz 11bf2ec6d1 Make sure operators appear in the docs too
Add "operator" and "constructor" qualifiers to make it easier to
see in the docs.
2020-11-09 14:12:01 -03:00
bruvzg a4a21654b1
Fix duplicate variant constructor typo. 2020-11-09 18:34:17 +02:00
Rémi Verschelde 9d2e8f2f27
Variant: Rename Type::_RID to Type::RID
The underscore prefix was used to avoid the conflict between the `RID` class
name and the matching enum value in `Variant::Type`.

This can be fixed differently by prefixing uses of the `RID` class in `Variant`
with the scope resolution operator, as done already for `AABB`.
2020-11-09 16:29:04 +01:00
Rémi Verschelde 8a318fe1dd
Merge pull request #43404 from akien-mga/color-fix-clamp-uint32_t-warning
Color: Fix -Wtype-limits GCC warning after refactoring
2020-11-09 14:59:11 +01:00
Rémi Verschelde 771b3c583d
Color: Fix -Wtype-limits GCC warning after refactoring
Warning from GCC 10.2.0 with `warnings=extra`:
```
./core/math/color.h: In member function 'int32_t Color::get_r8() const':
./core/typedefs.h:107:42: error: comparison of unsigned expression in '< 0' is always false [-Werror=type-limits]
  107 | #define CLAMP(m_a, m_min, m_max) (((m_a) < (m_min)) ? (m_min) : (((m_a) > (m_max)) ? m_max : m_a))
      |                                    ~~~~~~^~~~~~~~~
./core/math/color.h:201:49: note: in expansion of macro 'CLAMP'
  201 |  _FORCE_INLINE_ int32_t get_r8() const { return CLAMP(uint32_t(r * 255.0), 0, 255); }
      |                                                 ^~~~~
```

Also some code consistency changes while at it.
2020-11-09 14:11:21 +01:00
reduz 221a2a1742 Refactored variant constructor logic 2020-11-09 08:54:43 -03:00
Tomasz Chabora 9f23a94b8a Add append_array() method to Array class 2020-11-08 21:09:45 +01:00
reduz 127458ed17 Reorganized core/ directory, it was too fatty already
-Removed FuncRef, since Callable makes it obsolete
-Removed int_types.h as its obsolete in c++11+
-Changed color names code
2020-11-07 20:17:12 -03:00
reduz 05de7ce6ca Refactored variant setters/getters
-Discern between named, indexed and keyed
-Get direct access to functions for typed GDScript and GDNative bindings
-Small changes to some classes in order to work with the new setget binder
2020-11-07 15:16:15 -03:00
Rémi Verschelde 709964849f
Merge pull request #42896 from Calinou/httprequest-increase-chunk-size
Increase the default HTTPClient download chunk size to 64 KiB
2020-11-07 16:38:28 +01:00
Rémi Verschelde 329d2c1ced
Merge pull request #42947 from Calinou/image-load-bmp-from-buffer
Add `Image.load_bmp_from_buffer()` for run-time BMP image loading
2020-11-07 16:38:09 +01:00
Hugo Locurcio 13357095ee
Increase the default HTTPClient download chunk size to 64 KiB
This improves download speeds at the cost of increased memory usage.

This change also effects HTTPRequest automatically.

See #32807 and #33862.
2020-11-07 16:11:04 +01:00
reduz f2397809a8 Refactored Variant Operators.
-Using classes to call and a table
-For typed code (GDS or GDNative), can obtain functions to call prevalidated or ptr.
2020-11-06 12:45:50 -03:00
Yuri Roubinsky 38fb26794b Exposed randi_range to global funcs + renamed rand_range to randf_range 2020-11-06 17:06:26 +03:00
Rémi Verschelde 52c1b5fc41
Merge pull request #43283 from Calinou/color-remove-contrasted
Remove `Color.contrasted()` as its behavior is barely useful
2020-11-06 10:17:12 +01:00
Andrii Doroshenko (Xrayez) 34ca426851 Remove unused PHI define in math funcs 2020-11-05 18:05:58 +02:00
Rémi Verschelde 35e6070a35
doc: Override default value for RandomNumberGenerator.seed
It's non-deterministic so it's better to show a fixed value like 0 instead of
having it potentially change whenever `randomize()` is called.

Fixes #43317.
2020-11-05 00:41:24 +01:00
Rémi Verschelde 424cd00f8b
doc: Sync classref with current source + fixup some bindings
Includes various changes triggered by the refactoring of method bindings.
2020-11-04 15:38:26 +01:00
reduz f123981a96 Implement DirectionalLight2D
Also separated Light2D in PointLight2D and DirectionalLight2D.
Used PointLight2D because its more of a point, and it does not work
the same as OmniLight (as shape depends on texture).
Added a few utility methods to Rect2D I needed.
2020-11-04 10:03:01 -03:00
Hugo Locurcio 7adb6b91b3
Remove Color.contrasted() as its behavior is barely useful
Returning the most contrasting color isn't a trivial task, as there
are often many possible choices. It's usually best left for the user
to implement using a script.
2020-11-03 04:46:08 -05:00
Rémi Verschelde 873d461785
Merge pull request #40364 from marstaik/alpha2coverage_up
Alpha Hash and Alpha2Coverage Implementation
2020-11-03 07:50:49 +01:00
Marios Staikopoulos e5d7c7d5fc Alpha Hash and Alpha2Coverage Implementation 2020-11-02 20:11:20 -08:00
Rémi Verschelde e8794b24bd
Merge pull request #43260 from HaSa1002/mainloop-remove-deprecated-methods
MainLoop: Remove deprecated methods
2020-11-02 14:26:49 +01:00
Lyuma 37b6a36cc4 Avoid reentrant OBJTYPE_RLOCK in ClassDB
Fixes #43020 when a thread uses ClassDB while main thread calls is_parent_class().
2020-11-01 03:40:06 -08:00