summaryrefslogtreecommitdiff
path: root/modules/gdscript
AgeCommit message (Collapse)Author
2017-11-09Make sure we don't leak when an opcode is followed by itselfHein-Pieter van Braam
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-08Fix crash when guessing type of variable declared to itselfBojidar Marinov
Fixes #10972
2017-10-31Merge pull request #12035 from Chaosus/wrapfuncRémi Verschelde
Added new Wrap functions for numbers
2017-10-30Fix get_node() and $ autocompletion when using single quotesUnknown
2017-10-25Removes Script::get_node_type()Jerome67000
used before GDScript, with squirrel apparently
2017-10-24Merge pull request #12365 from neikeq/pRémi Verschelde
Add ScriptLanguage::supports_builtin_mode and improve ScriptCreateDialog
2017-10-24Add ScriptLanguage::supports_builtin_mode and improve ScriptCreateDialogIgnacio Etcheverry
- 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-24fix editor crash when missing variable in pattern match dispatchjagt
2017-10-22Add _process(delta) to new script templates. Closes #11994.mhilbrunner
2017-10-13Added new wrap functionsChaosus
2017-10-05Add NIL_IS_VARIANT usage to few definitionsRuslan Mustakov
The missing usage flag led to GDNative API descriptions containting arguments with "void" type.
2017-10-01Replace a OPCODE_BREAK with break in opcode 31Hein-Pieter van Braam
This was a mistake made in 520d84e. There are no more other looping structures left in this function.
2017-09-29Properly allow completion on variable initializer arguments, closes #9359Juan Linietsky
2017-09-27Fixed wrong break statement in GDFunction::callScayze
2017-09-25Remove several checks on DEBUG_RELEASEHein-Pieter van Braam
These errors shouldn't be possible on a tested game. Remove the checks on release. Shaves about 10% off of tight loops.
2017-09-25Use computed goto to dispatch next opcodeHein-Pieter van Braam
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-21Implement Linux-style likely()/unlikely() macrosHein-Pieter van Braam
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-19Allow booleanization of all typesHein-Pieter van Braam
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-19Remove more GDScript runtime checks on releaseHein-Pieter van Braam
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-17Move Variant::evaluate() switch to computed gotoHein-Pieter van Braam
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-12Changed/Added descriptions in @GDScript. Added examples. Fixed return types ↵William Taylor
of two … (#11146) Doc: Improved descriptions in GDScript docs Added examples and fixed return types of two methods.
2017-09-12Merge pull request #11057 from hpvb/fix-various-warningsRémi Verschelde
Fix various assorted warnings
2017-09-11Implement String len()Poommetee Ketson
2017-09-08Fix various assorted warningsHein-Pieter van Braam
Fix various warnings that don't have enough instances to merit individual commits. Also fixes a potential bug in audio_server.cpp.
2017-09-03Fixes language overridden external editorsIgnacio Etcheverry
2017-09-02Fix typos 'a' and 'an'Poommetee Ketson
2017-09-02Fix use of unitialized variablesHein-Pieter van Braam
The second in my quest to make Godot 3.x compile with -Werror on GCC7
2017-08-29Merge pull request #10745 from neikeq/fix-docdata-and-stuffJuan Linietsky
DocData and virtual method type hints fixes
2017-08-29Makes built-in vararg methods actual vararg methodsIgnacio Etcheverry
- Removes hardcoded parameters from built-in vararg methods and adds METHOD_FLAG_VARARG to them. - Makes EditorHelp display built-in vararg methods correctly.
2017-08-29DocData and type hints fixesIgnacio Etcheverry
- Makes vararg methods automatically use PROPERTY_USAGE_NIL_IS_VARIANT on return types - Completely removes the ":type" suffix for method names. Virtual methods must use the MethodInfo constructors that takes Variant::Type or PropertyHint as the first parameter for the return type (with CLASS_INFO as a helper to get the PropertyInfo). Parameters must use PROPERTY_HINT_RESOURCE_TYPE and hint string. - PROPERTY_USAGE_NIL_IS_VARIANT is no longer needed for parameters, because parameters cannot be void. - Adds missing PROPERTY_USAGE_NIL_IS_VARIANT to virtual and built-in methods that return Variant.
2017-08-28-Some fixes to code completion.Juan Linietsky
-Fix getter in code completion being displayed when it shouldn't -Clean up preview generation for editors and exposed it as editor plugin
2017-08-27-Moved script run to editor, removed from projectJuan Linietsky
-fixed to code completion -fix shader crash bug reported by tagcup
2017-08-27Fix a crash in gdscript callbacksHein-Pieter van Braam
This fixes a crash running the 'goltorus' project.
2017-08-27Dead code tells no talesRémi Verschelde
2017-08-27Use HTTPS URL for Godot's website in the headersRémi Verschelde
2017-08-26Add two missing Null checksHein-Pieter van Braam
These Null checks were removed in #10581 but actually changed the logic of the functions in this case. This fixes #10654
2017-08-25Merge pull request #10581 from hpvb/fix-gcc6+Rémi Verschelde
Make cast_to a static member of Object.
2017-08-25Implemented, The Amazing Zylann Hack (tm), fixes #10603Juan Linietsky
2017-08-24Convert Object::cast_to() to the static versionHein-Pieter van Braam
Currently we rely on some undefined behavior when Object->cast_to() gets called with a Null pointer. This used to work fine with GCC < 6 but newer versions of GCC remove all codepaths in which the this pointer is Null. However, the non-static cast_to() was supposed to be null safe. This patch makes cast_to() Null safe and removes the now redundant Null checks where they existed. It is explained in this article: https://www.viva64.com/en/b/0226/
2017-08-24GDScript: More reliable check if loading a template.Andreas Haas
Prevents showing some useless parse errors in the console.
2017-08-24Fix mismatched signatures for GDScriptLanguage::complete_codeRémi Verschelde
2017-08-24-Code completion for enumerationsJuan Linietsky
-Disabled GDNative and GDNativeScript so build compiles again
2017-08-23Changed MethodBind API to request information from methods. It's much claner ↵Juan Linietsky
now. Also changed PropertyInfo to include informatino about class names.
2017-08-23Merge pull request #10542 from karroffel/gdscript-match-indexRémi Verschelde
support enums and nested constants in match statement
2017-08-22Removed unnecessary returns and break statementsWilson E. Alvarez
2017-08-22support enums and nested constants in match statementKarroffel
The initial version of the pattern matcher in GDScript does not allow matching on nested identifiers, only one identifiers available in the current scope. With the introduction of enums to GDScript that's a huge missing feature. This commit makes the parser accept indexed constants and variables to properly support enums.
2017-08-22Merge pull request #10340 from Rubonnek/remove-unnecessary-assignmentsRémi Verschelde
Removed unnecessary assignments
2017-08-22Merge pull request #10225 from Noshyaar/mapRémi Verschelde
GDScript Built-in: add inverse_lerp & range_lerp
2017-08-21Removed unnecessary assignmentsWilson E. Alvarez
2017-08-20Merge pull request #10319 from neikeq/pr-engine-editor-hintJuan Linietsky
Adds Engine::is_editor_hint() method