Commit graph

2302 commits

Author SHA1 Message Date
Fabio Alessandrelli 60d235622d Don't reset MultiplayerAPI when setting same peer.
A GDScript call to:
`multiplayer.network_peer.some_prop = true`
seems to transalte to:
```
var temp = multiplayer.network_peer
temp.some_prop = true
multiplayer.network_peer = temp
```
Which caused the MultiplayerAPI to be resetted.
The call to set_network_peer is now ignored if the peer that's beeing
set is the same as the currently set one.
2019-01-15 11:14:51 +01:00
Fabio Alessandrelli 1f7846abf8 Fix MultiplayerAPI initialization, clear.
rpc_sender_id is now correctly initialized to 0 so get_rpc_sender_id()
work reliably even if called before receiving any RPC.
root_node is initialized to NULL (fix crashes when incorrectly using the
MultiplayerAPI).
clear function now resets the packet cache size to free more memory when
not running.
2019-01-15 10:35:26 +01:00
Rémi Verschelde 7346afb0ee
Merge pull request #24987 from akien-mga/gles2-nvidia-rect-hack-opt-in
GLES2: Make Nvidia flicker workaround opt-in
2019-01-14 20:20:56 +01:00
Juan Linietsky 91290f0ded Added a flag to specify an exported node path must be supplied from scene root, fixes #24412 2019-01-14 15:46:56 -03:00
Rémi Verschelde 02ffc59270 GLES2: Make Nvidia flicker workaround opt-in
It has a big impact on 2D and text rendering performance (cf. #24466)
so the solution seems worse than the bug it aims to work around.

It's now opt-in via "rendering/quality/2d/gles2_use_nvidia_rect_flicker_workaround"
for those who need it and have a simple enough game for the performance
drop not to be an issue.

Fixes #24466.
2019-01-14 19:02:07 +01:00
Juan Linietsky 6d8083ea65 Do not use the workaround for desktop nvidia on mobile and html5. 2019-01-14 11:24:00 -03:00
Juan Linietsky ae99530a8d Do not allow flushing while already flushing the message queue. Added to help track bugs in ProgressDialog in editor. 2019-01-14 11:04:25 -03:00
Juan Linietsky 4bb0080b3d Do not allow adding tasks while in the middle of flushing a message queue 2019-01-14 11:00:05 -03:00
Rémi Verschelde 9ddf1115bc
Revert "fixed invalid implementation of Plane::intersects_segment and Plane::intersects_ray" 2019-01-13 11:06:34 +01:00
Rémi Verschelde 3652442a92
Merge pull request #24897 from GlaDos28/master
fixed invalid implementation of Plane::intersects_segment and Plane::intersects_ray
2019-01-11 22:56:03 +01:00
Evgeny Savelyev 2c36078be4 fixed invalid implementations of Plane::intersects_segment and Plane::intersects_ray 2019-01-12 00:38:16 +03:00
Poommetee Ketson 2caaa7c97d
Fix error explanation in core_bind Thread::_start_func 2019-01-11 10:12:13 +07:00
Rémi Verschelde 658296856c
Merge pull request #24877 from neikeq/issue-24280
Fix properties being lost when reloading placeholder GDScript instance
2019-01-10 18:02:57 +01:00
Rémi Verschelde e5f1d19352 Consistency in resource format saver/loader de-registration
Some used 'is_valid()' checks, others not. Validity is already checked in 'unref()',
and 'remove_resource_format_*()' has an ERR_FAIL condition on 'is_null()' already
(which shouldn't happen since we're only unregistering things that we previously
registered.

Also add missing GDCLASS statement in ResourceFormatLoaderVideoStreamGDNative,
missed in #20552 which was last amended before #19501 was merged.
2019-01-10 12:45:57 +01:00
Ignacio Etcheverry ea85ff0dc2 Fix properties being lost when reloading placeholder GDScript instance
During reloading in `GDScriptLanguage::reload_all_scripts` a placeholder instance that must remain so is replaced with a new placeholder instance. The state is then restored by calling `ScriptInstance::set` for each property. This does not work if the script is missing the properties due to build/parse failing.
The fix for such cases is to call `placeholder_set_fallback` instead of `set` on the script instance.

I took this chance to move the `build_failed` flag from `PlaceHolderScriptInstance` to `Script`. That improves the code a lot. I also renamed it to `placeholder_fallback_enabled` which is a much better name (`build_failed` could lead to misunderstandings).
2019-01-10 01:58:50 +01:00
Juan Linietsky e46f28e02d Removed splits in Polygon editor, replace by internal vertices and polygon support. 2019-01-08 19:11:08 -03:00
Calamander 64e584a97e
Update random_pcg.h
little fix to function types
2019-01-07 23:13:16 +01:00
Ibrahn Sahir cbb396c006 Repair String lstrip and rstrip.
Background: lstrip and rstrip were broken by changes to String in:
0e29f7974b
which removed it's access to Vector::find(CharType).

Moved Vector's find up into CowData so it can be shared by Vector and String.
Added String::find_char using CowData::find.
Implemented rstrip and lstrip using find_char.
Added a few tests for String rstrip and lstrip.
2019-01-07 17:34:44 +00:00
Hein-Pieter van Braam 5e6c6f3bb7
Merge pull request #21708 from hpvb/fix-21242v2
String[size()] should return a default constructed CharType
2019-01-04 20:57:22 +01:00
Hein-Pieter van Braam ac99ed3cda String[size()] should return a default constructed CharType
As per the C++ standard 21.3.4.1 for std::string:
Returns: If pos < size(), returns data()[pos]. Otherwise, if pos ==
size(), the const version returns charT(). Otherwise, the behavior is
undefined.

Since the behavior is undefined Godot now does the same thing for const
and non-const versions of operator[].

This fixes #21242 and fixes #22221.
2019-01-04 17:48:03 +00:00
Rémi Verschelde 70de8ca9a9
Merge pull request #24585 from Xrayez/fix-crash-hex-number
Fix crash when checking empty string for valid hex number
2019-01-04 16:19:29 +01:00
Rémi Verschelde 578c6316c8
Merge pull request #24732 from hpvb/vector-pod-optimization
Optimizations for trivial types
2019-01-04 15:09:05 +01:00
Guilherme Felipe e64391f47b Update zstd to 1.3.8 2019-01-03 22:35:20 -02:00
Hein-Pieter van Braam 4240e3d668 Optimizations for trivial types
Relying on various compiler primitives we can reduce the work done
in our memory allocators and CowData. For types with trivial ctors or
dtors we can skip looping over all elements when creating, resizing,
and destroying lists of objects.

These primitives are supported by clang, msvc, and GCC. However, once
we've moved to C++11 we can rely on several std:: primitives that do
the same thing and are standardized.

In my testing the extra conditionals introduced here get removed from
the generated program entirely as the results for these primitives is
known at compile time.
2019-01-03 08:47:34 +01:00
Rémi Verschelde b16c309f82 Update copyright statements to 2019
Happy new year to the wonderful Godot community!
2019-01-01 12:58:10 +01:00
Rémi Verschelde 2e39e38c10 doc: Sync classref with current source
Fix various code formatting issues and argument names.
2018-12-27 11:10:18 +01:00
Andrii Doroshenko (Xrayez) b8f1fe9ed8 Bind is_valid_hex_number string method to GDScript 2018-12-24 20:54:36 +02:00
Andrii Doroshenko (Xrayez) c891cf32ca Fix crash when checking empty string for valid hex number 2018-12-24 20:06:35 +02:00
Rémi Verschelde 616beb1041 ProjectManager: Warn when projects have different config_version
When opening projects for edition through the project manager, the
following checks are now done:

1. If the config_version is lower than the one used by the current
   engine version, users are asked if they want to convert to the new
   format or abort editing. Fixes #20626.
2. If the config_version is higher than the expected one (project
   from a more recent and incompatible engine version), projects are
   grayed out and can't be edited. Fixes #18758.

When editing from the command line, the behaviour is unchanged:
projects in situation (1) are automatically converted, while projects
in situation (2) show an error message (made more explicit).

The "Run" option from the project manager was not changed, so it will
still run (1) projects without converting them, and fail running (2)
projects.

Co-authored-by: groud <gilles.roudiere@gmail.com>
2018-12-21 12:45:27 +01:00
Rémi Verschelde d8067e905c
Merge pull request #24500 from akien-mga/drop-global_defaults
Core: Drop unused global_defaults logic
2018-12-20 11:49:32 +01:00
Rémi Verschelde 9cb18232c2 Core: Drop unused global_defaults logic
It used to be used for Android and iOS to specify platform-specific
project settings overrides, but we now have feature tags for that.
2018-12-20 11:02:49 +01:00
volzhs 84d060c768 Added OS.get_system_time_msecs() 2018-12-20 18:50:50 +09:00
Rémi Verschelde 7fdb324647
Merge pull request #24388 from Chaosus/fix_csv_spam
Removed error message arriving whenever csv file changed
2018-12-17 08:04:57 +01:00
Rémi Verschelde 9c7bc127b9
Merge pull request #24385 from hpvb/reduce-string-coew
Reduce String CoW
2018-12-16 19:13:35 +01:00
Hein-Pieter van Braam 4e25e5066b Reduce String CoW
By introducing an intermediate proxy class for the array subscript
operator for String and CharString we can control better when CowData
will actually CoW.

This should improve performance of String usage for most cases.
2018-12-16 16:51:38 +01:00
Rémi Verschelde 9df7ed59fb
Merge pull request #19501 from Zylann/custom_loaders
Added basic support for custom resource savers and loaders
2018-12-16 14:26:56 +01:00
Chaosus 70c3270dfa Removed error message arriving whenever csv file changed 2018-12-16 07:09:33 +03:00
Marc Gilleron 065e2670af Added basic support for custom resource savers and loaders 2018-12-15 05:34:53 +00:00
Hein-Pieter van Braam 3ef7ecf546 Don't allocate in Vector's ctor
By relying on the fact that a struct or class's first member has the
same address as the struct itself we can cast VectorWriteProxy<T> to
Vector<T> and access the CowData field.

This allows a Vector to be moved in memory without invalidating the
pointer to the cowdata field.
2018-12-14 20:07:35 +00:00
Rémi Verschelde f11047aa81
Merge pull request #21856 from AlexHolly/fix-undo-not-showing-error
Fix undo redo not showing errors
2018-12-14 17:13:16 +01:00
Rémi Verschelde 29a527fb90
Merge pull request #23799 from marcelofg55/custom_ps
Add application/config/project_settings_override option to override project settings
2018-12-14 08:58:29 +01:00
Marcelo Fernandez 8dad3811c5 Add application/config/project_settings_override option to override project settings 2018-12-13 18:23:51 -03:00
Rémi Verschelde a1954e51e8
Merge pull request #24135 from Chaosus/rng
Added ranged integer generation function to RNG class
2018-12-12 14:07:47 +01:00
Rémi Verschelde c8a5400654
Merge pull request #24241 from Rubonnek/move-to-initializer-list
Moved member variables to initializer list
2018-12-12 09:25:34 +01:00
Wilson E. Alvarez 08f22f1cf0
Moved member variables to initializer list 2018-12-11 18:33:01 -05:00
Rémi Verschelde 4c41e29c8e
Merge pull request #23923 from bruvzg/ime_gdscript
Changes IME to make it possible to use it from gdscript/gdnative
2018-12-11 18:00:48 +01:00
Rémi Verschelde fa91944c06
Merge pull request #22630 from dualtagh/22478
22478: Can't duplicate folder with another folder inside
2018-12-07 23:12:06 +01:00
Rémi Verschelde dc2fadc14d
Merge pull request #22733 from guilhermefelipecgs/fix_wm_class
[x11] Use "application/config/name" for WM_CLASS
2018-12-07 22:35:17 +01:00
Rémi Verschelde ce3f3a9f82
Merge pull request #24194 from bojidar-bg/23567-fix-message-queue-overflow
Make thumbnail cache less tasking on the message queue
2018-12-06 20:31:08 +01:00
Bojidar Marinov 68e69fd45b
Make thumbnail cache less tasking on the message queue
Fixes #23567
2018-12-06 17:25:57 +02:00