Commit Graph

4281 Commits

Author SHA1 Message Date
8747f25653 Merge pull request #50381 from reduz/implement-disable-classes
Implement the ability to disable classes
2021-07-13 15:31:38 +02:00
b44b277f6f Merge pull request #50169 from pycbouh/theme-type-variations 2021-07-13 15:13:00 +02:00
5ad4f26659 Implement the ability to disable classes
* This PR adds the ability to disable classes when building.
* For now it's only possible to do this via command like:
  `scons disable_classes=RayCast2D,Area3D`
* Eventually, a proper UI will be implemented to create a build config file to do this at large scale, as well as detect what is used in the project.
2021-07-13 09:25:14 -03:00
dd27413907 Merge pull request #50412 from timothyqiu/fastlz-decompress 2021-07-13 12:12:46 +02:00
78ead60372 Let thread func have optional parameter
Fixes #38042.
2021-07-13 10:44:53 +02:00
ccf292df38 Fix decompression with FastLZ when buffer size is less than 16 bytes 2021-07-13 16:34:45 +08:00
e2b79e9591 Merge pull request #49291 from NoFr1ends/fix-49262
String::format leave passed values untouched
2021-07-13 09:33:46 +02:00
a766661f6a Merge pull request #50304 from timothyqiu/memfree-param
Fix memfree parameter name
2021-07-13 08:29:47 +02:00
4ee0e6ddf5 Add type variations to Theme 2021-07-13 02:26:28 +03:00
88d68346ee [Net] Rename NetworkedMultiplayerPeer to MultiplayerPeer. 2021-07-12 16:36:34 +02:00
74ab336fe3 Change VSync mode project setting enum type from string to integer 2021-07-12 03:35:51 +02:00
d3ba0aa3e0 [Net] Fix crash when receiving RPC on node without a script. 2021-07-11 10:18:32 +02:00
a0d800e967 Merge pull request #50362 from timothyqiu/http-eof
Fix unicode invalid skip error in AssetLib
2021-07-11 09:33:51 +02:00
0caaaf4018 Fix unicode invalid skip error in AssetLib 2021-07-11 12:14:08 +08:00
293050a919 Handle Z_BUF_ERROR in decompress_dynamic 2021-07-11 11:05:12 +08:00
a2d5f191d8 Merge pull request #48622 from Geometror/reimplement-disableable-vsync 2021-07-10 01:02:23 +02:00
ca2fda629f Merge pull request #50290 from reduz/redo-instance-bindings
Redo how instance bindings work
2021-07-09 23:25:33 +02:00
ff40c3f3c8 Optimize NodePath update when renaming or deleting nodes in the editor
Now the process uses a Map to lookup node pointers instead of iterating
over all modified node paths in a list and comparing them for each
property to check.

The process also avoids checking properties with empty node paths and
does an early exit on deleted nodes to avoid checking the node and its
descendants.

Also made a minor change in NodePath::rel_path_to() to avoid resizing a
Vector many times for long paths (with copy-on-write each time). Now
it's down to 2 resize calls in any case.
2021-07-09 11:42:39 -07:00
542d7d6460 Fix memfree parameter name 2021-07-09 14:41:00 +08:00
a9c943bef9 Implement Range Iterators
This PR implements range iterators in the base containers (Vector, Map, List, Pair Set).
Given several of these data structures will be replaced by more efficient versions, having a common iterator API will make this simpler.
Iterating can be done as follows (examples):

```C++
//Vector<String>
for(const String& I: vector) {

}
//List<String>
for(const String& I: list) {

}
//Map<String,int>
for(const KeyValue<String,int>&I : map) {
	print_line("key: "+I.key+" value: "+itos(I.value));

}

//if intending to write the elements, reference can be used

//Map<String,int>
for(KeyValue<String,int>& I: map) {
	I.value = 25;
	//this will fail because key is always const
	//I.key = "hello"
}

```

The containers are (for now) not STL compatible, since this would mean changing how they work internally (STL uses a special head/tail allocation for end(), while Godot Map/Set/List do not).
The idea is to change the Godot versions to be more compatible with STL, but this will happen after conversion to new iterators have taken place.
2021-07-08 23:27:27 -03:00
4469144891 Redo how instance bindings work
* The harcoded 8 slots are no more and impose limits in the new extension system.
* New system is limitless, although it will impose small performance hit with a mutex.
* Use a token to request the instance binding.

**Warning**: Mono will most likely break as a result of this, will need to be modified to use the new system.
2021-07-08 17:08:12 -03:00
c43f624d44 Unify material parameter update
* Unifies how material parameters are updated.
* Single function, easier to maintain.
* Updates materials properly when textures change.
2021-07-06 18:57:38 -03:00
2f9a0268dd Increase the number of arguments accepted by UndoRedo methods 2021-07-06 18:52:28 +02:00
043ae91560 Restructure and reimplement vsync options
-Add a v-sync mode setting which allows to choose between DISABLED, ON, ADAPTIVE and MAILBOX
-Removed the V-Sync via Compositor option
2021-07-06 16:34:26 +02:00
c2ba7464b6 Added EditorInspectorPlugin to aid in editing InputEvents in resources and shortcuts 2021-07-06 23:50:33 +10:00
eca4d2fccc Fix Variant tags parsing. 2021-07-05 15:46:41 +03:00
a28d25c441 [Crypto] Delete mbedtls ctx in deconstructor.
Would cause memory leak when the context was `start`ed but not
`finish`ed.
2021-07-03 16:12:55 +02:00
6f3e7f7cb0 Add mouse_shape_entered and mouse_shape_exited signals to CollisionObject2D.
Co-authored-by: Hugo Locurcio <hugo.locurcio@hugo.pro>
2021-07-02 20:50:27 +01:00
c6f28ed62b Add get_dead_zone() method to InputMap
This commit adds a new method to the `InputMap`, allowing the user to get the value of an action's dead zone as a float.
2021-07-02 03:07:37 -04:00
97e041e285 Merge pull request #50057 from reduz/force-string-in-dictionary
Force String as Dictionary key instead of StringName
2021-07-01 22:22:47 +02:00
379b90fd33 Force String as Dictionary key instead of StringName
* Lua table syntax uses named indexing: `{ mykey = myvalue }`
* Python style syntax uses string indexing: `{ "mykey" : myvalue }`
* Both are incompatible since a StringName key wont fetch a String key, hence confusing.
* This PR proposes always using String for indexing at a very minimal performance cost. Always indexing with StringNames will be faster, but they are considerably more expensive to create.
2021-07-01 16:03:37 -03:00
0a823e85d2 Fix 'in' operator to check if an object member exists 2021-07-01 20:59:26 +02:00
2508fd0533 Use PROPERTY_USAGE_NONE instead of 0 for no property usage
Also use const more often.
2021-07-01 14:13:27 -04:00
9f30638d4b Merge pull request #50044 from akien-mga/localvector-find-noerror
LocalVector: Don't error if `from` >= `count`
2021-07-01 13:13:27 +02:00
230a24a49d Merge pull request #50026 from lyuma/callable_is_valid
Add Callable.is_valid() analogous to FuncRef.is_valid() from 3.x
2021-07-01 12:57:14 +02:00
7b7ccf25b6 LocalVector: Don't error if from >= count
Vector handles this silently by returning -1, and we should do the same here.
Otherwise we get errors when calling `find()` on e.g. a LocalVector of size 0,
while `find()` is expected to always work (if the parameters are invalid then
it doesn't find anything, so -1).

Fixup to #49925.
2021-07-01 12:16:33 +02:00
8f1efa656b Add Callable.is_valid() analogous to FuncRef.is_valid() from 3.x 2021-07-01 02:54:01 -07:00
3f12d0a883 Merge pull request #50018 from fire/port-false
Network port comparison is always false
2021-07-01 09:42:34 +02:00
75688772b3 Fix editor suffixes and degrees conversion
* Functions to convert to/from degrees are all gone. Conversion is done by the editor.
* Use PROPERTY_HINT_ANGLE instead of PROPERTY_HINT_RANGE to edit radian angles in degrees.
* Added possibility to add suffixes to range properties, use "min,max[,step][,suffix:<something>]" example "0,100,1,suffix:m"
* In general, can add suffixes for EditorSpinSlider
Not covered by this PR, will have to be addressed by future ones:

* Ability to switch radians/degrees in the inspector for angle properties (if actually wanted).
* Animations previously made will most likely break, need to add a way to make old ones compatible.
* Only added a "px" suffix to 2D position and a "m" one to 3D position, someone needs to go through the rest of the engine and add all remaining suffixes.
* Likely also need to track down usage of EditorSpinSlider outside properties to add suffixes to it too.
2021-06-30 12:38:25 -03:00
c1d9170194 Network port comparison is always false
error: comparison is always false due to limited range of data type [-Werror=type-limits]
  ERR_FAIL_COND_V_MSG(p_port < 0 || p_port > 65535, ERR_INVALID_PARAMETER, "The local port number must be between 0 and 65535 (inclusive).");
2021-06-30 02:39:17 -07:00
64c925cca6 Improve RID_Owner memory usage
* Ability to allocate empty objects in RID_Owner, so RID_PtrOwner is not needed in most cases.
* Improves cache usage, as objects are now allocated together
* Should improve performance in 2D rendering
2021-06-29 12:28:08 -03:00
7f9346b81b Merge pull request #49925 from RicardRC/FindFromNop
Make use of variable "from" in local_vector find() function.
2021-06-29 14:36:19 +02:00
14d5908057 Use unused from in local vector find function. 2021-06-29 13:37:02 +02:00
05336adb86 Merge pull request #49905 from pfertyk/issue-46480-image-compress-crashes-godot
Validate image formats, check if resize_to_po2 failed
2021-06-29 12:44:20 +02:00
30a615dd94 Implement painting properties over TileSets 2021-06-29 11:07:46 +02:00
3dae9993ac Validate image formats, check if resize_to_po2 failed 2021-06-28 21:17:06 +02:00
0b7ffd4f68 Fix Image.adjust_bcs crash when image format is invalid 2021-06-27 20:52:42 +08:00
b1d15c51bc Implement native extension system
* Deprecates GDNative in favor of a simpler, lower level interface.
* New extension system allows registering core engine classes.
* Simple header interface in gdnative_interace.h
2021-06-25 17:32:45 -03:00
f1bcc641dd Merge pull request #49583 from timothyqiu/texture-crash
Fix crash when freeing GradientTexture and NoiseTexture
2021-06-24 09:40:42 +02:00
b00c4a4360 [Net] Makes HTTPClient a custom instance class. 2021-06-23 14:10:45 +02:00