Commit graph

2957 commits

Author SHA1 Message Date
Eric Rybicki 439e0027ec Fix AtlasPacker ignoring semi-transparent pixels
Fixes #33106
2020-01-20 22:43:38 +01:00
Rémi Verschelde 11260fb87f
Merge pull request #35345 from timothyqiu/pck-packer-leak
Fixes leak when calling PCKPacker::pck_start multiple times
2020-01-20 07:00:11 +01:00
Haoyu Qiu 07941178f0 Fixes leak when pck_start multiple times 2020-01-20 12:16:37 +08:00
Haoyu Qiu aca0b2a459 Fixes XMLParser leak when open multiple times 2020-01-20 11:29:14 +08:00
Fabio Alessandrelli 534bf89976 PacketPeer use heap buffer for var encoding.
Used to allocate in stack (via alloca) which causes crashes when trying
to encode big variables.
The buffer grows as needed up to `encode_buffer_max_size` (which is
8MiB by default) and always in power of 2.
2020-01-19 11:49:10 +01:00
Rémi Verschelde 870ec61417
Merge pull request #35092 from AndreaCatania/frames_exp
Exposed physics frame count and idle frame count
2020-01-14 08:25:46 +01:00
Rémi Verschelde 0aeb5bbf62 Object: Avoid error on emit_signal with freed target
As advised by @reduz.
2020-01-13 22:20:18 +01:00
Andrea Catania 9c60502357 Exposed physics frame count and idle frame count 2020-01-13 17:53:10 +01:00
Rémi Verschelde f38bfccf42 Object: Remove error on disconnect of locked signals
According to 22637beb2e (commitcomment-36651823)
and as confirmed by @reduz, this seems not to be necessary now that we
copy-on-write.

This triggered freeze scenarios in cases where a node would be deleted
while being used as a target in a signal emission.

Fixes #34650.
Fixes #34769.

Now those two errors go back to reporting:
```
ERROR: emit_signal: Condition ' !target ' is true. Continuing..:
   At: core/object.cpp:1191.
```
2020-01-13 17:03:02 +01:00
Rémi Verschelde ab97f78fa5 Revert "Enable Vsync via Compositor by default"
This reverts commit 9600fd5dde.

Add comment warning about possible implications of using this option.

Fixes #35038.
2020-01-13 09:33:27 +01:00
bruvzg d07cdc594f
[macOS] Load PCK from the .app bundle resources, instead of changing working directory. 2020-01-10 18:02:29 +02:00
Rémi Verschelde 83d950b58e
Merge pull request #34968 from Calinou/enable-vsync-via-compositor
Enable Vsync via Compositor by default
2020-01-10 10:04:55 +01:00
Hugo Locurcio 9600fd5dde
Enable Vsync via Compositor by default
This feature was added in #33414 but it was disabled by default.
Now that it got some testing, it's probably safe to enable it
by default.
2020-01-09 22:22:11 +01:00
George Marques 3718f8f592
GDScript: Validate object instance on is operation
Avoids crashes on debug mode. Instead it now breaks the execution and
show the error in-editor. Will still crash on release.

Also add a similar check to Marshalls to ensure the debugger doesn't
crash when trying to serialize the invalid instance.
2020-01-09 13:59:33 -03:00
Tomasz Chabora 97273ce378 Check if resource exists before loading 2020-01-08 15:24:43 +01:00
Rémi Verschelde 14b24b6a71
Merge pull request #34875 from neikeq/api-hash-no-underscore-methodbinds
ClassDB: Exclude method binds starting with '_' from API hash
2020-01-08 08:32:25 +01:00
Ignacio Etcheverry 4be87c6016 ClassDB: Exclude method binds starting with '_' from API hash
These methods are not meant to be part of the scripting API.
These are not the same as virtual methods starting with '_', e.g.: '_process'.
2020-01-07 00:08:49 +01:00
Rémi Verschelde 8aea5decc6
Merge pull request #34020 from gytsen/unify-pack-version
PCK: Set VERSION_PATCH in header, factor out header magic
2020-01-06 14:04:55 +01:00
Rémi Verschelde e62941fb53
Merge pull request #34296 from timothyqiu/lock-33072
Fixes crash when using Resource::_take_over_path
2020-01-06 14:04:23 +01:00
Joost Heitbrink dc61323b2c PCK: Set VERSION_PATCH in header, factor out header magic
Unify pack file version and magic to avoid hardcoded literals.

`version.py` now always includes `patch` even for the first release in
a new stable branch (e.g. 3.2). The public name stays without the patch
number, but `Engine.get_version_info()` already included `patch == 0`,
and we can remove some extra handling of undefined `VERSION_PATCH` this
way.

Co-authored-by: Rémi Verschelde <rverschelde@gmail.com>
2020-01-06 13:13:17 +01:00
Rémi Verschelde 8454804972
Merge pull request #33967 from Calinou/add-os-is-window-focused
Add an `OS.is_window_focused()` getter
2020-01-06 11:39:18 +01:00
Rémi Verschelde 0783874ff2
Merge pull request #34782 from akien-mga/multiplayerapi-set_network_peer-invalid
MultiplayerAPI: Fix disconnect errors when passing invalid peer
2020-01-03 14:33:25 +01:00
Rémi Verschelde 136846a6ec
Merge pull request #34772 from clayjohn/ETC-support-alpha
Fallback to RGBA4444 for textures with alpha set to ETC compression
2020-01-03 14:29:19 +01:00
Rémi Verschelde fa82664419
Merge pull request #34726 from nekomatata/polygon2d-antialiasing-fix
Fixed antialiasing option for Polygon2D with concave/hollow shapes
2020-01-03 14:17:05 +01:00
Rémi Verschelde 3cbfb11460 MultiplayerAPI: Fix disconnect errors when passing invalid peer
Fixes #34634.
2020-01-03 13:34:54 +01:00
Rémi Verschelde 9d3424f61d
Merge pull request #34688 from sheepandshepherd/gdnative_class_ptr
Expose is_class_ptr to GDNative for dynamic casts
2020-01-03 11:32:01 +01:00
clayjohn 7a9fc69a16 Fallback to RGBA4444 for textures with alpha set to ETC compression 2020-01-02 21:37:48 -08:00
sheepandshepherd 3056c4bd5a Expose cast_to to GDNative for dynamic casts 2020-01-03 04:27:13 +01:00
Rémi Verschelde eadf04e1dd
Merge pull request #34476 from volzhs/no-slash-localize_path
Make sure no additional slash being added with localize_path
2020-01-02 19:11:18 +01:00
Rémi Verschelde bde52cc688
Merge pull request #34618 from qarmin/vector_please_dont_crash
Don't use constant reference in Vector push_back, insert and append_array
2020-01-02 15:44:41 +01:00
Rémi Verschelde a97b08e7d2
Merge pull request #34745 from timothyqiu/vararg-return-nil-34743
Allows to doc vararg method return type as void
2020-01-02 15:20:58 +01:00
Rémi Verschelde e772a1241a Object::disconnect: Better errors when no signal or locked
It will now give information about the originating object instance
and when locked, the target callback.

This should help debugging editor and game issues that are now being
reported due to adding signal locking in
22637beb2e.
2020-01-02 14:51:50 +01:00
Haoyu Qiu 4d727f1ee6 Allows to doc vararg method return type as void 2020-01-02 21:37:26 +08:00
PouleyKetchoupp 1591677eb8 Fixed antialiasing option for Polygon2D
Some cases were not handled properly for Polygon2D after making changes in common code to fix Line2D antialiasing. Added an option for drawing polygons to differentiate the two use cases.

Fixes #34568
2020-01-01 11:40:14 +01:00
Rémi Verschelde a7f49ac9a1 Update copyright statements to 2020
Happy new year to the wonderful Godot community!

We're starting a new decade with a well-established, non-profit, free
and open source game engine, and tons of further improvements in the
pipeline from hundreds of contributors.

Godot will keep getting better, and we're looking forward to all the
games that the community will keep developing and releasing with it.
2020-01-01 11:16:22 +01:00
Rémi Verschelde ccedda9c71
Merge pull request #34682 from Calinou/os-exit-code-nonportable-warning
Print a warning message if `OS.exit_code` is set to a non-portable value
2019-12-30 18:09:32 +01:00
Hugo Locurcio d441a6aefa
Print a warning message if OS.exit_code is set to a non-portable value
This also improves the related documentation.
2019-12-29 16:56:22 +01:00
Danil Alexeev 134755ebcf Add ord() function to Expression class
The ord() function was recently added in GDScript and VisualScript,
but was missed in the Expression class.
2019-12-29 09:20:10 +03:00
Rafał Mikrut 1ac701cc37 Don't use constant reference in Vector push_back, insert and append_array 2019-12-26 17:38:08 +01:00
Fabio Alessandrelli cbc772d696 Fix buffers size calculation in PacketPeerStream.
The calculation used to be wrong when exactly at a power of 2.
`nearest_shift` always return the "next" power of 2
`nearest_shift(4) == 3 # 2^3 = 8`.

On the other hand `next_power_of_2` returns the exact value if that
value is a power of 2 (i.e. `next_power_of_2(4) == 4`).

I.e. :
```
WARN_PRINT(itos(next_power_of_2(4)) + " " + itos(1 << nearest_shift(4)));
// WARNING: ... : 4 8
```

Is this by design?
2019-12-22 15:35:44 +01:00
volzhs 02d5591d9d Make sure no additional slash being added with localize_path 2019-12-20 14:49:01 +09:00
Haoyu Qiu e7e095da3f Encodes property names properly in project.godot 2019-12-20 10:42:08 +08:00
Rémi Verschelde 791c84bbbb
Merge pull request #34421 from Chaosus/fix_strcpy_warning
Fix build warning in ustring.cpp on Windows/MSVC platform
2019-12-19 12:19:45 +01:00
Juan Linietsky 28599e6c20 Suggest use of deferred or oneshot on disconnect if the signal is locked. Closes #34443. 2019-12-18 19:32:00 -03:00
Yuri Roubinsky 8674655a45 Fix build warning in ustring.cpp on Windows/MSVC platform 2019-12-18 17:40:51 +03:00
Rémi Verschelde 7d34d1a85f
Merge pull request #34348 from Catchawink/master
Fixed issues with using a relative path in the export window.
2019-12-17 22:24:34 +01:00
Juan Linietsky 0dd6079e4e Improve error message and do not spam forever. 2019-12-17 11:18:47 -03:00
Juan Linietsky 22637beb2e Restore signal locking, for some reason missing. 2019-12-17 10:43:51 -03:00
Catchawink b2a14042d5 Fixed issues with using a relative path in the export window.
Before this fix, opening relative export paths inside of an EditorFileDialog was not possible. This was fixed by modifying String::path_to_file() to save relative paths in EditorExportPreset::set_export_path() more appropriately and changing EditorFileDialog::set_current_dir() to open relative paths.
2019-12-16 09:50:42 -05:00
Aaron Franke 1b8b380993
Document that translated does not behave like rotated or scaled 2019-12-15 12:31:08 -05:00