Commit graph

2315 commits

Author SHA1 Message Date
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
Chaosus
d376be2bf4 Added integer number generation function to RNG class 2018-12-06 14:49:52 +03:00
Rémi Verschelde
ceb46e194c
Merge pull request #24090 from RandomShaper/fix-blit-from-negative
Fix blitting from negative position
2018-12-06 12:30:42 +01:00
Ibrahn Sahir
a758653199 const char* operator on CharString now const. 2018-12-03 20:25:23 +00:00
Paulb23
69fe17639e Fix text files constantly asking for reload as no last modified time 2018-12-02 16:24:23 +00:00
Pedro J. Estébanez
6dc9a1b475 Fix blitting from negative position 2018-11-30 18:01:00 +01:00
Rémi Verschelde
43f28452e1
Merge pull request #24039 from clayjohn/transform_bug
Construct Transform from Transform2D bug
2018-11-28 18:57:53 +01:00
clayjohn
928ca2e1f2 construct transform from transform2d bug 2018-11-28 07:54:22 -08:00
Juan Linietsky
db595980bf
Revert "Construct Transform from Transform2D " 2018-11-28 11:16:06 -03:00
Rémi Verschelde
348708cad3
Merge pull request #23976 from clayjohn/transform_bug
Construct Transform from Transform2D
2018-11-28 15:14:02 +01:00
Aaron Franke
cb01268562 Fix many errors found by PVS-Studio
Fix errors 2, 3, 4, 6, 8, 9, 11, 12, 13, 14, and 15.
2018-11-28 05:03:24 -05:00
Juan Linietsky
3a93499f89 Allow signal connecting even if script is invalid (only when compiled with tools), fixes #17070 2018-11-27 19:55:37 -03:00
clayjohn
d22bc7413c construct transform from transform2d bug 2018-11-25 21:14:45 -08:00
bruvzg
4554c682e6
Changes IME input to use notification instead of callback, exposes IME methods to gdscript/gdnative. 2018-11-23 14:07:48 +02:00
Fabian
a01608c389 Improved support for custom image loaders 2018-11-23 08:16:54 +10:30
allkhor
eacb8600f4 FileAccess::store_csv_line() don't added unnecessary double quotes. 2018-11-22 19:31:34 +06:00
Juan Linietsky
a2a606794c Ensure array and dict editors show edited object IDs, fixes #20225 2018-11-21 22:10:58 -03:00
Rémi Verschelde
173b342ca7 Remove trailing whitespace
With `sed -i $(rg -l '[[:blank:]]*$' -g'!thirdparty') -e 's/[[:blank:]]*$//g'`
(+ manual revert of some thirdparty code under `platform/android`).
2018-11-20 11:15:02 +01:00
Rémi Verschelde
16a2c31e53
Merge pull request #23812 from YeldhamDev/clear_history_version_optional
Add argument to UndoRedo's "clear_history()" to not increase the version
2018-11-20 08:49:17 +01:00
Rémi Verschelde
99a4274f51 Make add_property error more explicit on duplicates
Would have helped solve #23800 faster.
2018-11-20 08:47:21 +01:00
Rémi Verschelde
35fbbeb99b
Merge pull request #20627 from malcolmhoward/core-dictionary-get-key
#20488 core dictionary get key
2018-11-19 21:11:55 +01:00
m
bf1867aaab Added Python-like .get() method to Dictionary in GDScript #20488
Added .get() method to Dictionary class in GDScript to return the value if the key exists, or return Null if the key does not exist.
2018-11-19 14:03:13 -05:00
Juan Linietsky
60cbb69c7c Increase number of image loaders (why was it this low..), fixes #19037 2018-11-18 22:07:00 -03:00
Michael Alexsander Silva Dias
6ba94d5ca0 Add argument to UndoRedo's "clear_history()" to not increase the version 2018-11-18 19:46:35 -02:00
Juan Linietsky
2d6b994e47 Massive speed up on deleting nodes, fixes #18673
Also makes the editor exit faster
2018-11-18 11:48:21 -03:00
Fabio Alessandrelli
1ef9e9ef6a Properly accept wildcard when binding IPv4 socket.
Also never return null for is_ipv4 to avoid crashes due to engine bug.
(better to get an error and a broken socket then seeing your game crash)
2018-11-18 14:54:40 +01:00
Rémi Verschelde
adc0752da7
Merge pull request #23771 from Faless/fix_release_export
Always initialize VariantCall return_type.
2018-11-18 10:46:43 +01:00
Davide Baldo
b98263013a Fixed the default value for Input.action_press() from commit 8c45282 2018-11-17 20:45:24 +00:00
Fabio Alessandrelli
c449512318 Always initialize VariantCall return_type.
The return_type is used by the GDScript parser (and possibly other
scripting languages), so it MUST be initialized at least.
It could be initialized to Variant::NIL in release, but I see no reason
for not setting the actual value.
See similar issue in 95dfa5b .
2018-11-17 19:06:18 +01:00
Juan Linietsky
f141f747de Fix Squish decompression, closes #18109 2018-11-16 19:12:00 -03:00
Juan Linietsky
9e85d17241 Clearing history increments version, else it does not generate an asterisk on modification if the scene was just saved. Fixes #18027.
Still I feel this line was commented for a reason. If you bisect a bug and find
this commit, let me know.
2018-11-16 16:20:10 -03:00
Rémi Verschelde
5d00407388
Merge pull request #23685 from Kanabenki/add-store-csv-line
Add store_csv_line method for File
2018-11-16 15:21:57 +01:00
Juan Linietsky
0b1e93ccd4 -Make sure monitorable cant be flipped while flushing queries, fixes #17330
-Also added set_deferred, this was missing.
2018-11-16 08:49:26 -03:00
Kanabenki
48166a9f3c Add store_csv_line method for File 2018-11-16 11:09:05 +01:00
Juan Linietsky
16022da187 Ensure that array passed to physics is always counter clockwise, fixes #15361. 2018-11-14 15:55:50 -03:00
Rémi Verschelde
b2f96b2892
Merge pull request #22940 from Faless/lws_buffers_bis
Better buffering for WebSocket
2018-11-13 09:54:06 +01:00
Chaosus
f8151a9e50 Implement random number generator
Co-authored-by: Zirak <zirakertan@gmail.com>
2018-11-13 10:50:07 +03:00
Fabio Alessandrelli
c0435959da RingBuffer::decrease_write 2018-11-12 21:49:50 +01:00
Rémi Verschelde
8c45282d21
Merge pull request #23621 from workless/allow_strength_in_action_press
Allow to specify a custom strength when calling Input.action_press(),…
2018-11-10 21:35:07 +01:00
Rémi Verschelde
87d27e1250
Merge pull request #23639 from neikeq/gg
Fix GDScript placeholder fallback
2018-11-10 21:33:19 +01:00
Ignacio Etcheverry
7c4c646749 Fix GDScript placeholder fallback 2018-11-10 20:06:17 +01:00
Davide Baldo
1b0c7515ff Allow to specify a custom strength when calling Input.action_press(), this allows virtual axis, mainly for mobile. 2018-11-10 10:25:59 +00:00
Poommetee Ketson
aa311320d9 Fix formatting -0.0 by %+f displays +-0.0 2018-11-09 15:27:06 +07:00
Juan Linietsky
da1f53c8d9 User more correct plus file on get_current_dir. 2018-11-08 19:05:12 -03:00
Juan Linietsky
f2e54057ae -Moved EditorDefaultValue to ClassDB, made it core
-Removed one and zero hints for properties, replaced by default value
2018-11-08 11:30:59 -03:00
Marcelo Fernandez
4de0cbba15 Expose OS::move_window_to_foreground 2018-11-07 11:51:15 -03:00
Aaron Franke
81be9542eb Remove unused "dtoll" methods
These methods aren't used anywhere in Godot's code, and all they do is cast floating types to int64_t. There's no reason to have these lines, they literally do nothing, and they aren't useful functions to begin with.
2018-11-02 05:02:27 -04:00
Juan Linietsky
34426be9a0
Merge pull request #23346 from santouits/you-shall-not-execute
Error running Expression.execute after parse error
2018-11-01 14:02:18 -03:00
Juan Linietsky
c8765b459a
Merge pull request #23159 from DavidSichma/string-escape
Fix: String::format Variant to String conversion
2018-11-01 12:54:51 -03:00
Juan Linietsky
e647342140 Moved folding outside the resource files, now saved outside the project. 2018-10-29 16:37:09 -03:00
Juan Linietsky
6cc116d415 Ability to revert any property, not just from inherited scenes or scripts. 2018-10-29 12:25:56 -03:00
santouits
b0df0b46ac Error running Expression.execute after parse error
There happens a segmentation fault when you use Expression.parse() and you don't check for errors and then run Expression.execute(). So we check if there was a parse error in the execute method now.
2018-10-28 12:13:39 +02:00
lupoDharkael
2380f320e0 Update GDNantive API
Add missing Rect2 methods to GDNative API
Add missing Quat methods to GDNative API
Add missing NodePath methods to GDNative API
Add missing String methods to GDNative API
Add missing Array methods to GDNative API
Add missing Basis methods to GDNative API
Add missing Color methods to GDNative API
Update gdnative_api.json
2018-10-26 17:25:57 +02:00
David Sichma
62848f94ee Fix: String::format Variant to String conversion
Previosly String::format used variant.get_construct_string() to convert
the passed Variants to Strings. This however did not match the expected
printing behavior of some datatypes: Strings for example turned out
escaped.

This fix replaces the call to get_construct_string() with a simple
conversion. This makes String::format consistent with "%s" % "sth" and
formated Variants turn out like printed as expected.
2018-10-25 20:36:49 +02:00
Rémi Verschelde
1169196f04
Merge pull request #22779 from Superwaitsum/LimitSettings
Limit several project settings
2018-10-25 11:38:06 +02:00
Superwaitsum
e5041ad0f5 Add some limits on the Editor Settings 2018-10-24 19:46:33 -05:00
Rémi Verschelde
9d926b72e1 Fix .pck lookup for extensionless binary names with a dot
This was not a problem on Windows as binary names are guaranteed to end
with '.exe', but on Unix systems binary extensions are purely cosmetic
and thus optional, which is a problem when using `get_basename()` to
lookup a potential '.pck' file, as it can fail on e.g. "My Game 2.0" (#15188).

To fix this, ProjectSettings::setup now checks for both basename + '.pck'
and filename + '.pck'.

Fixes #15188, supersedes and closes #22755.

Also took the opportunity to improve documentation on this core method.
2018-10-24 20:11:39 +02:00
Dualtagh Murray
b902a2f2a7 Fixing warnings generated by MSVC
Fixes #22684.
2018-10-19 11:45:24 +02:00
Andrii Doroshenko (Xrayez)
31f6fad90e Bind missing subresource flag in ResourceSaver 2018-10-18 17:58:44 +03:00
Rémi Verschelde
32afd19541
Merge pull request #22548 from fire/visualscript_whitespace
Visualscript search fixes
2018-10-16 12:54:43 +02:00
K. S. Ernest (iFire) Lee
47b42787e3 Make visualscript search better.
* There were spaces unequally inside the function definitions.
* camelcase_to_underscore() should also work for numbers inside of the camel case.
* Removed the builtin concept
* Capitalize descriptions from methods too.
* Match the visual script functions by removing the empty arguments "( )"
* Add some test cases
2018-10-11 14:22:40 -07:00
Florian Jung
0353182e7b Fix bug with OAHashMap corruption on insertion
When an item has been inserted into an already-occupied slot, and
the original inhabitant of that slot was moved on, it was wrongly
moved with the inserted-item's key/value instead of its own.

This closes #22928.
2018-10-11 12:53:32 +02:00
Rémi Verschelde
c730957c42 Revert "Added a check in sort_custom thats test wether the given method exists."
This reverts commit 6415454581.

That patch was correct but Object::has_method is not a reliable way to check
if we can use the given method, as it doesn't support inner classes (#22838).
2018-10-09 09:53:17 +02:00
Rémi Verschelde
b17e71b6e5
Merge pull request #22808 from KellyThomas/vector-one
Add ONE constants to Vector2 and Vector3
2018-10-07 18:57:27 +02:00
Rémi Verschelde
cebbb2a325
Merge pull request #22827 from qonnop/optimize-interpolation
Optimize interpolation algorithms
2018-10-07 18:56:26 +02:00
exts
18b6f5a6c9 fixes #22828 - res://user had incorrect substr value 2018-10-07 09:49:48 -05:00
qonnop
50fae2b1a7 Optimize interpolation algorithms
Interpolation in the form of va + (vb - va) * c is faster and prevents floating point issues for int/string
Followup to https://github.com/godotengine/godot/pull/22786
2018-10-07 15:43:51 +02:00
Kelly Thomas
215db9ff71 add ONE constants to Vector2 and Vector3 2018-10-07 21:33:18 +08:00
Fabio Alessandrelli
67177586d3 Fix potentially unininitialized pointer write. 2018-10-07 14:50:14 +02:00
Fabio Alessandrelli
83acd5f17e One less local variable in marshalls 2018-10-07 12:56:07 +02:00
Rémi Verschelde
d4108573bf
Merge pull request #22705 from DualMatrix/debugging_the_debugger_grand_finale
Cleaned up/Fixed some bugs in the remote inspector code.
2018-10-07 11:42:37 +02:00
Rémi Verschelde
bf6dcb9105
Merge pull request #22722 from akien-mga/fix-warnings
Fix more "may be used initialized" warnings from GCC 7
2018-10-07 11:07:13 +02:00
Rémi Verschelde
44d82b3a07
Merge pull request #22752 from aaronfranke/equals-redundant
Remove redundant "== true" and "== false" code
2018-10-07 10:58:45 +02:00
Rémi Verschelde
c27b2adb10
Merge pull request #22786 from qonnop/fix-int-interpolation
Fixed int interpolation issue, closes #22763
2018-10-07 10:31:07 +02:00
Aaron Franke
4f7b33cdcf Remove redundant "== false" code
Some of this code has been re-organized.
f
2018-10-06 16:20:41 -04:00
Aaron Franke
37386f112b Remove redundant "== true" code
If it can be compared to a boolean, it can be evaluated as one in-place.
2018-10-06 16:12:36 -04:00
Rémi Verschelde
6a37f15e5a Readd mipmaps 'bug' in Image::expand_x2_hq2x, fixing it caused a regression
Fixes #22747.
2018-10-06 17:34:59 +02:00
qonnop
bbfc6f6985 Fixed int interpolation issue, closes #22763
When interpolating between two equal int values a and b, floating point
calculation imprecisions can result in different values depending on
the interpolation factor.
2018-10-06 15:52:42 +02:00
Rémi Verschelde
86d384e953
Merge pull request #22783 from eska014/html5-warnings
Fix warnings in HTML5 build outside platform files
2018-10-06 12:51:58 +02:00
Leon Krause
5f45476dc1 Fix warnings in HTML5 build outside platform files 2018-10-06 00:08:17 +02:00
Juan Linietsky
f12cb82e0f Fixes to baker, restored xatlas and fixed bake options. 2018-10-05 19:00:32 -03:00
Guilherme Felipe
f402253939 [x11] Use "application/config/name" for WM_CLASS 2018-10-05 17:18:10 -03:00
Marc Gilleron
c1bba054e6 Don't delete FileAccess when it is null 2018-10-05 20:24:28 +01:00
Rémi Verschelde
fc6cf69a90
Merge pull request #22737 from DualMatrix/warn_sort_custom
Added a check in sort_custom that test whether the given method exists.
2018-10-05 09:15:05 +02:00
DualMatrix
6415454581 Added a check in sort_custom thats test wether the given method exists.
Added a check in sort_custom thats test wether the given method exists.
2018-10-04 23:38:31 +02:00
Rémi Verschelde
3e9740ac93 Fix more "may be used initialized" warnings from GCC 7
Fixes the following GCC 7 warnings:
```
core/cowdata.h:269:47: warning: 'alloc_size' may be used uninitialized in this function [-Wmaybe-uninitialized]
core/error_macros.h:163:26: warning: 'nearest_point' may be used uninitialized in this function [-Wmaybe-uninitialized]
core/image.cpp:1579:5: warning: 'colormap_size' may be used uninitialized in this function [-Wmaybe-uninitialized]
core/image.cpp:1582:12: warning: 'size_height' may be used uninitialized in this function [-Wmaybe-uninitialized]
core/image.cpp:1590:23: warning: 'size_width' may be used uninitialized in this function [-Wmaybe-uninitialized]
core/image.cpp:1599:29: warning: 'pixel_size' may be used uninitialized in this function [-Wmaybe-uninitialized]
core/math/face3.cpp:207:15: warning: 'tri_max' may be used uninitialized in this function [-Wmaybe-uninitialized]
core/math/face3.cpp:209:15: warning: 'tri_min' may be used uninitialized in this function [-Wmaybe-uninitialized]
drivers/gles3/rasterizer_scene_gles3.cpp:665:22: warning: 'best_used_frame' may be used uninitialized in this function [-Wmaybe-uninitialized]
drivers/gles3/rasterizer_storage_gles3.cpp:865:27: warning: 'blit_target' may be used uninitialized in this function [-Wmaybe-uninitialized]
drivers/gles3/rasterizer_storage_gles3.cpp:980:29: warning: 'blit_target' may be used uninitialized in this function [-Wmaybe-uninitialized]
drivers/gles3/shader_gles3.h:122:9: warning: '<anonymous>.ShaderGLES3::Version::frag_id' may be used uninitialized in this function [-Wmaybe-uninitialized]
drivers/gles3/shader_gles3.h:122:9: warning: '<anonymous>.ShaderGLES3::Version::id' may be used uninitialized in this function [-Wmaybe-uninitialized]
drivers/gles3/shader_gles3.h:122:9: warning: '<anonymous>.ShaderGLES3::Version::vert_id' may be used uninitialized in this function [-Wmaybe-uninitialized]
editor/plugins/script_editor_plugin.cpp:1980:31: warning: 'se' may be used uninitialized in this function [-Wmaybe-uninitialized]
editor/scene_tree_dock.cpp:840:30: warning: 'new_node' may be used uninitialized in this function [-Wmaybe-uninitialized]
editor/spatial_editor_gizmos.cpp:4259:9: warning: 'a1' may be used uninitialized in this function [-Wmaybe-uninitialized]
editor/spatial_editor_gizmos.cpp:4259:9: warning: 'lll' may be used uninitialized in this function [-Wmaybe-uninitialized]
editor/spatial_editor_gizmos.cpp:4259:9: warning: 'lul' may be used uninitialized in this function [-Wmaybe-uninitialized]
editor/spatial_editor_gizmos.cpp:4260:9: warning: 'a2' may be used uninitialized in this function [-Wmaybe-uninitialized]
editor/spatial_editor_gizmos.cpp:4261:9: warning: 'a3' may be used uninitialized in this function [-Wmaybe-uninitialized]
editor/spatial_editor_gizmos.cpp:4265:3: warning: 'enable_lin' may be used uninitialized in this function [-Wmaybe-uninitialized]
editor/spatial_editor_gizmos.cpp:4294:3: warning: 'enable_ang' may be used uninitialized in this function [-Wmaybe-uninitialized]
editor/spatial_editor_gizmos.cpp:4311:34: warning: 'll' may be used uninitialized in this function [-Wmaybe-uninitialized]
editor/spatial_editor_gizmos.cpp:4311:34: warning: 'ul' may be used uninitialized in this function [-Wmaybe-uninitialized]
scene/3d/voxel_light_baker.cpp:1655:47: warning: 'cone_dirs' may be used uninitialized in this function [-Wmaybe-uninitialized]
scene/3d/voxel_light_baker.cpp:1656:73: warning: 'cone_weights' may be used uninitialized in this function [-Wmaybe-uninitialized]
scene/gui/texture_progress.cpp:181:6: warning: 'cp' may be used uninitialized in this function [-Wmaybe-uninitialized]
scene/gui/texture_progress.cpp:181:6: warning: 'cq' may be used uninitialized in this function [-Wmaybe-uninitialized]
servers/physics/shape_sw.cpp:1056:19: warning: 'support_max' may be used uninitialized in this function [-Wmaybe-uninitialized]
```
2018-10-04 18:54:20 +02:00
Simon Wenner
10718b0961 Fix some cppcheck errors
cppcheck: fix broken pre-processor statement
cppcheck: fix Uninitialized struct members in canvas editor plugin
cppcheck: fix uninitialized struct member: method_api.is_virtual
2018-10-04 18:16:04 +02:00
Rémi Verschelde
f5532bb650 Fix unused variable and wrong warning workaround
I had been looking at the wrong line all along when attempting to fix:
```
core/os/memory.cpp:184:13: warning: unused variable 's' [-Wunused-variable]
                uint64_t *s = (uint64_t *)mem;
                          ^
```
2018-10-04 15:38:03 +02:00