Commit graph

2097 commits

Author SHA1 Message Date
Juan Linietsky
4e55835e48
Merge pull request #18096 from aaronfranke/master
[Core] Split up math_2d.h
2018-08-14 18:58:32 -03:00
Juan Linietsky
ef5095720b -Deprecate ImageTexture::load
-Add warning to Image::load when loading resources
-Add script binding for get_configuration_warning
2018-08-14 16:53:20 -03:00
Will Nations
6d9cc032e7 Add custom icons to script classes. 2018-08-14 14:18:05 -05:00
Rémi Verschelde
b4f579b5ba
Merge pull request #20583 from neikeq/issue-15371
Fix case where exported properties value is lost
2018-08-14 21:08:56 +02:00
Rémi Verschelde
66da2ca320
Merge pull request #20856 from KoBeWi/pretty-dictionary-print
Add some curly braces to make dictionary printing less ambiguous
2018-08-14 20:51:42 +02:00
Ignacio Etcheverry
21d285e30f Dictionary: remove erase_checked(key), make erase(key) return bool 2018-08-14 19:19:05 +02:00
groud
6ccf3d887c Fixes initialization of action list 2018-08-14 18:44:22 +02:00
Rémi Verschelde
7718b90d92
Merge pull request #20443 from AlexHolly/add-string-format-no-index
Added String.format "no index" support
2018-08-14 16:13:34 +02:00
Rémi Verschelde
9a6e4d10b4
Merge pull request #20772 from dragmz/string_copy_oob_read_fix
Fix out of buffer read when copying from a non-null-terminated string
2018-08-14 15:47:34 +02:00
Rémi Verschelde
240462e998
Merge pull request #20992 from Chaosus/conversion_fix
Fix int(String) != int(int) conversion
2018-08-14 15:31:10 +02:00
Rémi Verschelde
f33a9db279
Merge pull request #20826 from raphael10241024/mybranch
fix #20390: handle time before year 1970
2018-08-14 09:59:05 +02:00
Chaosus
3b10bd1fa2 Fix int(String) != int(int) conversion 2018-08-14 10:56:10 +03:00
Rémi Verschelde
623529ce2f
Merge pull request #20778 from ibrahn/remove-zero-append-typos
removed some surplus null appends that got typoed in 0e29f7974b59e444…
2018-08-13 12:31:46 +02:00
RaphaelHunter
43825dce47 fix #20390 :get_unix_time_from_datetime and get_date_time_from_unix_time can handle time before year 1970 now 2018-08-13 15:37:27 +08:00
Rémi Verschelde
d29ea4337f Fix ResourceLoader::exists() false negative and readd deprecated has() 2018-08-12 12:44:38 +02:00
Aaron Franke
cf136a91d6 [Core] Completely kill math_2d.h, change includes 2018-08-11 03:08:34 -05:00
Aaron Franke
14fe7230f4 [Core] Move Vector2i and Rect2i out of math_2d.h 2018-08-11 00:33:01 -05:00
Aaron Franke
2eb8a9749e [Core] Move Rect2 and Transform2D to their own files
Math2D includes Transform2D, which includes Rect2, which includes Vector2.
2018-08-10 23:40:50 -05:00
Aaron Franke
9170d932e3 [Core] Grammar, move defs to defs
Math constant definitions belong in `math_defs.h`. Also, the grammer in these files really needed some updating.
2018-08-10 22:42:02 -05:00
Aaron Franke
28fc195339 [Core] Change math_2d includes to vector2 includes where relevant 2018-08-10 14:59:29 -05:00
Aaron Franke
9d1b5f4e3b [Core] Move Vector2 to its own file
Makes 2D math code easier to read and makes Vector2 consistent with Vector3. In the future, we may move other things out of math_2d as well.
2018-08-10 14:59:29 -05:00
Juan Linietsky
783fd23dea
Merge pull request #19993 from vnen/gdscript-warnings
System for GDScript warnings
2018-08-10 16:22:41 -03:00
George Marques
eb48119821
Added system for GDScript warnings
- Count and panel per script.
- Ability to disable warnings per script using special comments.
- Ability to disable warnings globally using Project Settings.
- Option to treat enabled warnings as errors.
2018-08-10 16:00:47 -03:00
Juan Linietsky
852378109f Added function ResourceLoader.exists(), to check if a resource exists. Closes #19140 2018-08-10 15:57:43 -03:00
Juan Linietsky
ea3d997f9d
Revert "added get_creation_time function for gdscript" 2018-08-10 13:29:49 -03:00
Juan Linietsky
275e0d5ee4
Merge pull request #18914 from notwarp/master
added get_creation_time function for gdscript
2018-08-10 13:28:47 -03:00
Juan Linietsky
c76f444c4e
Merge pull request #14704 from poke1024/colorconstants
Allow some non-integer built-in constants in gdscript
2018-08-10 12:57:20 -03:00
Juan Linietsky
b4006f68b3
Merge pull request #15536 from poke1024/fix3327
Fix SortArray crashing with bad comparison functions
2018-08-10 12:51:11 -03:00
Tomasz Chabora
929b416fdb Add some curly braces to make dictionary printing less ambiguous 2018-08-09 21:44:41 +02:00
Marcelo Fernandez
da1f1619fe Fix clang compile error 2018-08-09 08:50:06 -03:00
Juan Linietsky
a71a5fc0c3 Ability to pass custom variables to expression. 2018-08-08 17:47:51 -03:00
Juan Linietsky
934c641a15 -Add Expression class, used to evaluate expressions
-Added expression evaluation to EditorSpinSlider, fixes #20813, fixes #18932
2018-08-08 17:35:23 -03:00
Juan Linietsky
e0456f7976 Make sure warn deprecated uses a volatile bool (for multithreading) 2018-08-07 12:25:48 -03:00
Thomas Herzog
6ffd2d3529
Merge pull request #20636 from goodyttoor/hdr_import
Fix #20564 HDR import fail
2018-08-07 16:37:38 +02:00
Ibrahn Sahir
62f0dd9d57 removed some surplus null appends that got typoed in 0e29f7974b
A couple of null appends got typoed to append a '0' character instead.
Removed them here since String already takes care of the null terminator for us.
2018-08-07 03:30:14 +01:00
Marcin Zawiejski
f3b2689aa6 fix out of buffer read when copying non-null terminated strings 2018-08-06 23:51:07 +02:00
Juan Linietsky
edde52c8de Added proper import support for 3D and Array textures 2018-08-06 14:56:06 -03:00
Hein-Pieter van Braam
b5a20d21f2
Merge pull request #20573 from hpvb/fix-nested-vector-cow
Fix nested Vectors
2018-08-05 22:31:51 +02:00
willnationsdev
417e5457b8 ResourceFormatLoaderImage::get_resource_type now uses file path 2018-08-04 15:14:28 -05:00
Marcelo Fernandez
05fc12ddb6 Add OS::open_midi_inputs and OS::close_midi_inputs 2018-08-04 10:07:46 -03:00
poke1024
9d27bd3c3b Fix SortArray crashing with bad comparison functions 2018-08-04 14:08:34 +02:00
Bernhard Liebl
ba974b8d1e Allow some non-integer built-in constants in gdscript 2018-07-31 17:56:48 +02:00
Unknown
7fbb826422 Fix #20564 HDR import fail
Token has extra "0" at the end so it fail condition checking.
2018-07-31 21:34:44 +07:00
Juan Linietsky
ac52eb444f Ensure one shot signals are not disconnected while edited, closes #7776 2018-07-29 21:05:31 -03:00
Ignacio Etcheverry
f3c7527225 Fix case where exported properties value is lost
Fixes exported property modified values lost when creating a placeholder script instance with a failed script compilation

- Object set/get will call PlaceHolderScriptInstance's new fallback set/get methods as a last resort. This way, placeholder script instances can keep the values for storage or until the script is compiled successfuly.
- Script::can_instance() will only return true if a real script instance can be created. Otherwise, in the case of placeholder script instances, it will return false.
- Object::set_script(script) is now in charge of requesting the creation of placeholder script instances. It's no longer Script::instance_create(owner)'s duty.
- PlaceHolderScriptInstance has a new method set_build_failed(bool) to determine whether it should call into its script methods or not.
- Fixed a few problems during reloading of C# scripts.
2018-07-29 22:40:12 +02:00
Juan Linietsky
317dee95de It is now possible to import images as a separate resource, closes #5738 and likely many others 2018-07-29 16:45:23 -03:00
Hein-Pieter van Braam
2d98b40d47 Fix nested Vectors
When a Vector of Vectors gets resized the 'this' pointer of the Vectors
change. This means that the VectorWriteProxy _parent references get
invalidated. Thanks a lot to @ibrahn for finding the root cause of this.

To fix this we now create a pointer to CowData in Vector (which won't
change when the vectors move) and pass that to the write proxy also.

This fixes #20475
2018-07-29 17:03:35 +02:00
Fabio Alessandrelli
feaf03421d Fix marshalls size checks.
Yesterday, when playing around with my network code, I realized there is
a security issue in decode_variant, at least when decoding PoolArrays.
Basically, the size of the PoolArray is encoded in a uint32_t, when
decoding it, that value is cast to int when comparing if the packet is
actually that size causing numbers with MSB=1 to be interpreted as
negative thus always passing the check. That same value though, is used
as uint32_t again to resize the output vector.  For this reason, sending
a malformed packet with declared type PoolByteArray and size of 2^31(+x)
causes the engine to try to allocate 2+GB of pool memory, causing the
engine to crash.

(cherry picked from commit 5262d1bbcc)
2018-07-29 03:00:34 +02:00
dragmz
8fd337e2df fix windows build using python 3.7
fixes NameError (missing "subprocess_main" and "basestring")
2018-07-28 18:13:48 +02:00
Rémi Verschelde
4e4702e386
Merge pull request #20464 from Calinou/add-editor-standalone-feature-tags
Add "editor" and "standalone" feature tags
2018-07-28 10:49:27 +02:00
Rémi Verschelde
e6aec27428
Merge pull request #20511 from maksloboda/InputEventActionFix
Fixed shortcuts not working with InputEventActions
2018-07-28 09:48:44 +02:00
Viktor Ferenczi
c5bd0c37ce Running builder (content generator) functions in subprocesses on Windows
- Refactored all builder (make_*) functions into separate Python modules along to the build tree
- Introduced utility function to wrap all invocations on Windows, but does not change it elsewhere
- Introduced stub to use the builders module as a stand alone script and invoke a selected function

There is a problem with file handles related to writing generated content (*.gen.h and *.gen.cpp)
on Windows, which randomly causes a SHARING VIOLATION error to the compiler resulting in flaky
builds. Running all such content generators in a new subprocess instead of directly inside the
build script works around the issue.

Yes, I tried the multiprocessing module. It did not work due to conflict with SCons on cPickle.
Suggested workaround did not fully work either.

Using the run_in_subprocess wrapper on osx and x11 platforms as well for consistency. In case of
running a cross-compilation on Windows they would still be used, but likely it will not happen
in practice. What counts is that the build itself is running on which platform, not the target
platform.

Some generated files are written directly in an SConstruct or SCsub file, before the parallel build starts. They don't need to be written in a subprocess, apparently, so I left them as is.
2018-07-27 21:37:55 +02:00
Max
c2be1a75a0 Fixed shortcuts not working with InputEventActions 2018-07-27 15:09:41 +03:00
Rémi Verschelde
0494bbc5ca
Merge pull request #20478 from mattiascibien/main_Scene_filter
Fix main scene file filter
2018-07-26 13:45:18 +02:00
Rémi Verschelde
391e46830f doc: Sync classref with current source
Fix various missing arguments in bindings.
2018-07-26 11:56:21 +02:00
Mattias Cibien
4462819e63 Fix main scene file filter 2018-07-26 11:48:12 +02:00
Rémi Verschelde
47a7dc7b3c
Merge pull request #18282 from aaronfranke/better-mathf
[Core] [Mono] Fix Color missing int export methods, added 64-bit
2018-07-26 10:48:47 +02:00
Rémi Verschelde
5c8919aac6
Merge pull request #18955 from tagcup/fix_set_scale
Removed incorrect Basis::set_scale().
2018-07-26 10:37:03 +02:00
Hein-Pieter van Braam
0e29f7974b Reduce unnecessary COW on Vector by make writing explicit
This commit makes operator[] on Vector const and adds a write proxy to it.  From
now on writes to Vectors need to happen through the .write proxy. So for
instance:

Vector<int> vec;
vec.push_back(10);
std::cout << vec[0] << std::endl;
vec.write[0] = 20;

Failing to use the .write proxy will cause a compilation error.

In addition COWable datatypes can now embed a CowData pointer to their data.
This means that String, CharString, and VMap no longer use or derive from
Vector.

_ALWAYS_INLINE_ and _FORCE_INLINE_ are now equivalent for debug and non-debug
builds. This is a lot faster for Vector in the editor and while running tests.
The reason why this difference used to exist is because force-inlined methods
used to give a bad debugging experience. After extensive testing with modern
compilers this is no longer the case.
2018-07-26 00:54:16 +02:00
Hugo Locurcio
0254a40817
Add "editor" and "standalone" feature tags
These feature tags can be used to check whether the project was
started from an editor binary or from an export template binary.
2018-07-25 23:27:50 +02:00
Aaron Franke
55d976467d Expose 64-bit Color methods to GDScript and fix/update Color XML doc 2018-07-25 15:35:29 -05:00
Aaron Franke
de4b096898 [Core] 64-bit int Color methods 2018-07-25 15:34:24 -05:00
Alexander Holland
2290cc6227 Added String.format "no index" support 2018-07-25 13:23:44 +02:00
Alexander Holland
84db7056b7 Fix format ignores case in placeholder 2018-07-25 12:14:48 +02:00
Rémi Verschelde
a501678ba1
Merge pull request #20154 from marcelofg55/midi_driver
Added a new MIDIDriver class
2018-07-25 01:17:57 +02:00
Rémi Verschelde
540da3683f
Merge pull request #20411 from ibrahn/remove-substr-strlen
removed redundant strlen calculation from String::substr
2018-07-24 23:53:37 +02:00
Max Hilbrunner
9377f8db55
Merge pull request #20407 from akien-mga/po-newline-eof
Fix loading PO files with missing newline after last msgstr
2018-07-24 18:12:51 +02:00
Ibrahn Sahir
e0df1221bf removed redundant strlen calculation from String::substr 2018-07-24 16:08:45 +01:00
Rémi Verschelde
12d69ef53e Fix loading PO files with missing newline after last msgstr
Fixes #20375.
2018-07-24 13:32:37 +02:00
karroffel
7211fd604c reduce clang warning spam 2018-07-24 12:13:05 +02:00
Wilson E. Alvarez
a22e746bc3 Removed unnecessary assignments 2018-07-24 09:51:03 +02:00
Ignacio Etcheverry
779c9d638e
Merge pull request #15880 from neikeq/better-collections
Mono: Add Dictionary and Array classes
2018-07-23 23:59:04 +02:00
Juan Linietsky
b66580927e
Merge pull request #19313 from RandomShaper/improve-image
Image trilinear scaling + Optimization
2018-07-23 16:21:45 -03:00
Pedro J. Estébanez
c09734b401 Optimize image scaling routines 2018-07-23 21:08:10 +02:00
Pedro J. Estébanez
8c05c2830c Add trilinear filtering to image scaling 2018-07-23 21:08:10 +02:00
Juan Linietsky
dc976cac57
Merge pull request #12678 from AndreaCatania/soft
Soft body
2018-07-23 16:04:32 -03:00
AndreaCatania
b204389762 Added function append_array to vector 2018-07-23 12:48:00 +02:00
Marcelo Fernandez
ecb071b221 Fix upper/lower case convertion for characters >= 0x80 2018-07-22 14:10:28 -03:00
Marcelo Fernandez
7a5f9fc08e Added a new MIDIDriver class 2018-07-21 09:09:42 -03:00
George Marques
03746da73f
Add editor highlight for type-safe lines
The line number is hightlighted to indicate that the line contains only
type-safe code.
2018-07-20 21:55:18 -03:00
Juan Linietsky
6c09cdd136
Merge pull request #20157 from GodotExplorer/image-load-webp
Add webp buffer loader for Image
2018-07-20 12:00:21 -03:00
Rémi Verschelde
8c9e10553c Fix build issues and typos after c69de2ba4 2018-07-20 08:37:10 +02:00
volzhs
515c848ba8 Fix unwanted restarting 2018-07-20 10:41:32 +09:00
Juan Linietsky
c69de2ba46 -Project/Editor settings now use new inspector
-Project/Editor settings now show tooltips properly
-Settings thar require restart now will show a restart warning
-Video driver is now visible all the time, can be changed easily
-Added function to request current video driver
2018-07-19 19:02:04 -03:00
Juan Linietsky
43dc050947 Several improvements to editor inspector usability and style 2018-07-18 19:37:41 -03:00
Ignacio Etcheverry
2f69e36cef Add Dictionary::erase_checked(key) method
Same as erase, but it returns a boolean value indicating whether the pair was erased or not.
This method should be removed during the next compatibility breakage, and 'Dictionary::erase(key)' should be changed to return a boolean.
2018-07-18 23:07:31 +02:00
karroffel
43ae1c712f fix nameclash with MSVC 2018-07-18 19:28:26 +02:00
Rémi Verschelde
7c9f7452f4 Style: Format code with clang-format 6.0.1 2018-07-18 16:27:03 +02:00
matthew1006
25e64ffa20 Fixed OS.has_feature not using custom feature tags. 2018-07-18 09:22:59 +01:00
Ibrahn Sahir
8ff52c5923 reworked ustring.rsplit to fix behaviour.
Previous problems include failure to remove the splitter from the last
element found and a possible infinite loop dealing with multi-character
splitter strings.
2018-07-17 20:44:17 +01:00
Max Hilbrunner
2ba1f76870
Merge pull request #20195 from Faless/ssl_handshake
Non-blocking SSL handshake
2018-07-17 12:09:31 +02:00
geequlim
c5efe5d625 Add webp buffer loader for Image
Cleanup the code memory load related code for Image
Fix jpeg buff load function always returns OK event failed
2018-07-17 12:03:45 +08:00
Fabio Alessandrelli
9ba8f0d2d8 HTTP client now uses non blocking handshake 2018-07-16 13:08:17 +02:00
Fabio Alessandrelli
99d0b7ba14 Implement non blocking-handshake for StreamPeerSSL 2018-07-16 13:08:17 +02:00
Juan Linietsky
a3f1ee5c57 Global class names (and GDScript support for it) 2018-07-15 19:29:00 -03:00
unknown
9cc41a59ac Added support for extra mouse buttons. 2018-07-09 14:34:19 +03:00
Fabio Alessandrelli
e82f0fefbc MultiplayerAPI::send_bytes transfer mode support.
Added as extra parameter, allow you to specify which transfer mode to
use for those specific bytes
2018-07-08 09:47:22 +02:00
Max Hilbrunner
c41d322e11
Merge pull request #19183 from Nallebeorn/rename-main-scene
Update resource file project settings after renaming/moving the files
2018-07-05 00:44:23 +02:00
Max Hilbrunner
c538f2ff80
Merge pull request #19279 from aaronfranke/core-fposmod-fix
[Core] [Math] Fix fposmod() function
2018-07-05 00:35:46 +02:00
Max Hilbrunner
dc2d8d4dee
Merge pull request #19229 from RandomShaper/fix-focus-steal
Fix debugger focus stealing
2018-07-05 00:27:08 +02:00