Commit graph

450 commits

Author SHA1 Message Date
pablotato 054a2ac579 Add cartesian to polar conversion functions 2017-11-20 23:34:40 +01:00
sanikoyes fb801d4964 Allow to extends constant variable 2017-11-20 23:24:52 +01:00
Rémi Verschelde 6065b2d177
Merge pull request #11940 from GodotExplorer/debugger
Enhanced debugger for godot 3.0
2017-11-20 22:55:49 +01:00
Rémi Verschelde 7b5c447301
Merge pull request #12952 from bojidar-bg/12392-export-enums
Allow exporting enums from GDScript
2017-11-20 09:11:46 +01:00
Juan Linietsky ebbe2bd572
Merge pull request #12930 from vnen/gdscrit-output-print
Make tool scripts print on the editor Output panel
2017-11-17 16:05:44 -03:00
Ferenc Arn d28763a4c1 Rename Rect3 to AABB.
Fixes #12973.
2017-11-17 11:01:41 -05:00
Bojidar Marinov e4a36d0eda
Allow exporting enums from GDScript
Use as `export(E) ...`
Closes #12392
2017-11-17 14:33:36 +02:00
Geequlim fab66af7e9 Move the remote scene tree to the scene tree dock.
Ignore all script constants in the global section of the breakpoint stack.
Check property size before send to avoid too large of data be sent.
Fix crash while clear the remote objects from the debugger.
2017-11-17 12:01:54 +08:00
geequlim 475cee9c0f Abstract some method for script system 2017-11-17 09:20:32 +08:00
George Marques 1d12470a78
Add print_error function, akin to print_line 2017-11-16 21:56:57 -02:00
Rémi Verschelde 4cfc29611e GDScript: Refactor "GD" class prefix to "GDScript" 2017-11-16 18:54:56 +01:00
Rémi Verschelde 3002130a6d
Merge pull request #12957 from bojidar-bg/12928-numeric-underscores
Allow underscores in GDScript numeric literals
2017-11-16 09:04:31 +01:00
Bojidar Marinov 443ce6fef2
Allow underscores in GDScript numeric literals
Closes #12928
2017-11-15 22:53:08 +02:00
Rémi Verschelde 677e95d8d1 doc: Make all module docs self-contained 2017-11-15 21:29:33 +01:00
Rémi Verschelde e7701bb2de doc: Rename "@Global Scope" to "@GlobalScope"
Spaces in filenames are evil.
2017-11-15 20:41:16 +01:00
Juan Linietsky a5c3e3084a When script changes, defer tree updating. Fixes #9704 2017-11-15 10:41:31 -03:00
Rémi Verschelde 61a693cf78
Merge pull request #12922 from eska014/engine-singletons
Singleton management changes
2017-11-14 20:44:55 +01:00
Leon Krause 9b7b46143d Move singleton management from ProjectSettings to Engine 2017-11-14 15:15:13 +01:00
Michael Alexsander Silva Dias 3fac4ef336 Fixed signal connection dialog ignoring indentation settings when creating a function. 2017-11-13 17:45:13 -02:00
Rémi Verschelde 51ffd45202
Merge pull request #12627 from Goutte/feat-support-tau
Add support for TAU constant.
2017-11-12 21:11:39 +01:00
Goutte 91ca725f9b Add support for the TAU constant. Fixes #12094. 2017-11-12 13:32:35 +01:00
Paulb23 b835aec87b Fixed help lookup not finding classes, issue 11867 2017-11-11 23:50:56 +00:00
Hein-Pieter van Braam 38ae49e574 Make sure we don't leak when an opcode is followed by itself
When compiling with GCC it is now possible for an opcode followed by
itself to never leave the scope it is currently in. This leads to a
situation where the dtor of a scope local variable isn't called which in
turn can lead to a memory leak.

By moving the goto outside of the scope of each opcode we guarantee that
all dtors have been called before the next opcode gets dispatched.

this fixes #12401
2017-11-09 17:57:43 +01:00
Bojidar Marinov b7fd065f5c
Fix crash when guessing type of variable declared to itself
Fixes #10972
2017-11-08 22:17:08 +02:00
Rémi Verschelde ea0e942617
Merge pull request #12035 from Chaosus/wrapfunc
Added new Wrap functions for numbers
2017-10-31 23:30:50 +01:00
Unknown 7683ff3e42 Fix get_node() and $ autocompletion when using single quotes 2017-10-30 21:58:32 +01:00
Jerome67000 2609cc9ef4 Removes Script::get_node_type()
used before GDScript, with squirrel apparently
2017-10-25 20:11:30 +02:00
Rémi Verschelde 847c55bcb1 Merge pull request #12365 from neikeq/p
Add ScriptLanguage::supports_builtin_mode and improve ScriptCreateDialog
2017-10-24 18:59:26 +02:00
Ignacio Etcheverry e218a13a64 Add ScriptLanguage::supports_builtin_mode and improve ScriptCreateDialog
- Make ScriptCreateDialog disable the built-in script checked button if the language does not support it.
- ScriptLanguage's get_template and make_template now receive the script path as class name if the the script language does not have named classes.
2017-10-24 15:48:58 +02:00
jagt 822af935e3 fix editor crash when missing variable in pattern match dispatch 2017-10-24 13:07:21 +08:00
mhilbrunner ba779c1c0c Add _process(delta) to new script templates. Closes #11994. 2017-10-22 21:07:34 +02:00
Chaosus 216a8aa643 Added new wrap functions 2017-10-13 11:10:45 +03:00
Ruslan Mustakov 61ddf52983 Add NIL_IS_VARIANT usage to few definitions
The missing usage flag led to GDNative API descriptions containting
arguments with "void" type.
2017-10-05 18:51:22 +07:00
Hein-Pieter van Braam 6c15c23889 Replace a OPCODE_BREAK with break in opcode 31
This was a mistake made in 520d84e. There are no more other looping
structures left in this function.
2017-10-01 16:51:05 +02:00
Juan Linietsky 0a5799fb43 Properly allow completion on variable initializer arguments, closes #9359 2017-09-29 19:43:31 -03:00
Scayze 0722df4829 Fixed wrong break statement in GDFunction::call 2017-09-27 03:23:39 +02:00
Hein-Pieter van Braam 0a338a28d9 Remove several checks on DEBUG_RELEASE
These errors shouldn't be possible on a tested game. Remove the checks
on release. Shaves about 10% off of tight loops.
2017-09-25 18:29:18 +02:00
Hein-Pieter van Braam 520d84e042 Use computed goto to dispatch next opcode
On compulers that define __GNUC__ use computed goto to directly dispatch
the next instruction rather than going through another switch statement.
This saves a jump and some comparisons.

In tight loops this is is roughly 10% faster than the switch() method.
2017-09-25 18:29:13 +02:00
Hein-Pieter van Braam 22358babda Implement Linux-style likely()/unlikely() macros
This implement branch prediction macros likely() and unlikely() like in
Linux. When using these macros please ensure that when you use them the
condition in the branch really is very, very likely or unlikely. Think
90+% of the time. Primarily useful for error checking. (And I implement
these macros for all our error checking macros now)

See this article for more information:
https://kernelnewbies.org/FAQ/LikelyUnlikely

There are more places where these macros may make sense in renderer and
physics engine. Placing them will come in another commit down the line.
2017-09-21 18:28:28 +02:00
Hein-Pieter van Braam 833c3917b2 Allow booleanization of all types
We now allow booleanization of all types. This means that empty versions
of all types now evaluate to false. So a Vector2(0,0), Dictionary(),
etc.

This allows you to write GDScript like:
if not Dictionary():
  print("Empty dict")

Booleanization can now also no longer fail. There is no more valid flag,
this changes Variant and GDNative API.
2017-09-19 18:55:31 +02:00
Hein-Pieter van Braam 60790c8c5a Remove more GDScript runtime checks on release
As a preparation for other performance enhancements to GDScript:call()
start by removing more of the GDScript runtime checks on release.

This code has been tested with 2d/platformer, 3d/platformer,
3d/materials_test, and goltorus. No regressions were found.
2017-09-19 02:06:47 +02:00
Hein-Pieter van Braam 137f8a58a8 Move Variant::evaluate() switch to computed goto
In an effort to make GDScript a little faster replace the double
switch() with a computed goto on compilers that set __GNUC__. For
compilers that don't support computed goto it will fall back to regular
switch/case statements.

In addition disable using boolean values in a mathematical context. Now
boolean values can only be compared with other booleans. Booleans will
also no longer be coerced to integers.

This PR replaces #11308 and fixes #11291
2017-09-17 22:49:23 +02:00
William Taylor 8632408dbd Changed/Added descriptions in @GDScript. Added examples. Fixed return types of two … (#11146)
Doc: Improved descriptions in GDScript docs

Added examples and fixed return types of two methods.
2017-09-12 15:00:29 +02:00
Rémi Verschelde 2b50dc5d4f Merge pull request #11057 from hpvb/fix-various-warnings
Fix various assorted warnings
2017-09-12 11:39:47 +02:00
Poommetee Ketson dccb37417c Implement String len() 2017-09-11 08:43:25 +07:00
Hein-Pieter van Braam 67a706fc1b Fix various assorted warnings
Fix various warnings that don't have enough instances to merit
individual commits. Also fixes a potential bug in audio_server.cpp.
2017-09-08 14:57:48 +02:00
Ignacio Etcheverry 52a7be4eef Fixes language overridden external editors 2017-09-03 21:23:36 +02:00
Poommetee Ketson 459f526119 Fix typos 'a' and 'an' 2017-09-02 21:19:06 +07:00
Hein-Pieter van Braam 9c63ab99f0 Fix use of unitialized variables
The second in my quest to make Godot 3.x compile with -Werror on GCC7
2017-09-02 01:59:26 +02:00
Juan Linietsky 9c3bddfac2 Merge pull request #10745 from neikeq/fix-docdata-and-stuff
DocData and virtual method type hints fixes
2017-08-29 20:11:07 -03:00