aboutsummaryrefslogtreecommitdiff
path: root/modules/gdscript
Commit message (Collapse)AuthorAgeFilesLines
* Properly allow completion on variable initializer arguments, closes #9359Juan Linietsky2017-09-291-2/+1
|
* Fixed wrong break statement in GDFunction::callScayze2017-09-271-1/+1
|
* Remove several checks on DEBUG_RELEASEHein-Pieter van Braam2017-09-251-4/+13
| | | | | These errors shouldn't be possible on a tested game. Remove the checks on release. Shaves about 10% off of tight loops.
* Use computed goto to dispatch next opcodeHein-Pieter van Braam2017-09-251-109/+183
| | | | | | | | 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.
* Implement Linux-style likely()/unlikely() macrosHein-Pieter van Braam2017-09-211-3/+3
| | | | | | | | | | | | | | 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.
* Allow booleanization of all typesHein-Pieter van Braam2017-09-191-24/+3
| | | | | | | | | | | | | 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.
* Remove more GDScript runtime checks on releaseHein-Pieter van Braam2017-09-191-33/+54
| | | | | | | | 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.
* Move Variant::evaluate() switch to computed gotoHein-Pieter van Braam2017-09-173-4/+4
| | | | | | | | | | | | | 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
* Changed/Added descriptions in @GDScript. Added examples. Fixed return types ↵William Taylor2017-09-121-2/+2
| | | | | | | of two … (#11146) Doc: Improved descriptions in GDScript docs Added examples and fixed return types of two methods.
* Merge pull request #11057 from hpvb/fix-various-warningsRémi Verschelde2017-09-121-3/+3
|\ | | | | Fix various assorted warnings
| * Fix various assorted warningsHein-Pieter van Braam2017-09-081-3/+3
| | | | | | | | | | Fix various warnings that don't have enough instances to merit individual commits. Also fixes a potential bug in audio_server.cpp.
* | Implement String len()Poommetee Ketson2017-09-111-3/+11
|/
* Fixes language overridden external editorsIgnacio Etcheverry2017-09-031-1/+0
|
* Fix typos 'a' and 'an'Poommetee Ketson2017-09-022-5/+5
|
* Fix use of unitialized variablesHein-Pieter van Braam2017-09-021-3/+3
| | | | The second in my quest to make Godot 3.x compile with -Werror on GCC7
* Merge pull request #10745 from neikeq/fix-docdata-and-stuffJuan Linietsky2017-08-292-15/+27
|\ | | | | DocData and virtual method type hints fixes
| * Makes built-in vararg methods actual vararg methodsIgnacio Etcheverry2017-08-292-9/+16
| | | | | | | | | | - Removes hardcoded parameters from built-in vararg methods and adds METHOD_FLAG_VARARG to them. - Makes EditorHelp display built-in vararg methods correctly.
| * DocData and type hints fixesIgnacio Etcheverry2017-08-292-6/+11
| | | | | | | | | | | | | | - 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.
* | -Some fixes to code completion.Juan Linietsky2017-08-281-3/+28
| | | | | | | | | | -Fix getter in code completion being displayed when it shouldn't -Clean up preview generation for editors and exposed it as editor plugin
* | -Moved script run to editor, removed from projectJuan Linietsky2017-08-271-19/+34
|/ | | | | -fixed to code completion -fix shader crash bug reported by tagcup
* Fix a crash in gdscript callbacksHein-Pieter van Braam2017-08-271-2/+2
| | | | This fixes a crash running the 'goltorus' project.
* Dead code tells no talesRémi Verschelde2017-08-276-404/+6
|
* Use HTTPS URL for Godot's website in the headersRémi Verschelde2017-08-2715-15/+15
|
* Add two missing Null checksHein-Pieter van Braam2017-08-261-2/+6
| | | | | | | These Null checks were removed in #10581 but actually changed the logic of the functions in this case. This fixes #10654
* Merge pull request #10581 from hpvb/fix-gcc6+Rémi Verschelde2017-08-255-75/+66
|\ | | | | Make cast_to a static member of Object.
| * Convert Object::cast_to() to the static versionHein-Pieter van Braam2017-08-245-75/+66
| | | | | | | | | | | | | | | | | | | | | | | | 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/
* | Implemented, The Amazing Zylann Hack (tm), fixes #10603Juan Linietsky2017-08-253-0/+19
|/
* GDScript: More reliable check if loading a template.Andreas Haas2017-08-241-1/+1
| | | | Prevents showing some useless parse errors in the console.
* Fix mismatched signatures for GDScriptLanguage::complete_codeRémi Verschelde2017-08-241-1/+1
|
* -Code completion for enumerationsJuan Linietsky2017-08-244-12/+150
| | | | -Disabled GDNative and GDNativeScript so build compiles again
* Changed MethodBind API to request information from methods. It's much claner ↵Juan Linietsky2017-08-231-6/+6
| | | | | | now. Also changed PropertyInfo to include informatino about class names.
* Merge pull request #10542 from karroffel/gdscript-match-indexRémi Verschelde2017-08-231-1/+20
|\ | | | | support enums and nested constants in match statement
| * support enums and nested constants in match statementKarroffel2017-08-221-1/+20
| | | | | | | | | | | | | | | | | | | | 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.
* | Removed unnecessary returns and break statementsWilson E. Alvarez2017-08-222-2/+4
|/
* Merge pull request #10340 from Rubonnek/remove-unnecessary-assignmentsRémi Verschelde2017-08-223-21/+7
|\ | | | | Removed unnecessary assignments
| * Removed unnecessary assignmentsWilson E. Alvarez2017-08-213-21/+7
| |
* | Merge pull request #10225 from Noshyaar/mapRémi Verschelde2017-08-222-0/+32
|\ \ | |/ |/| GDScript Built-in: add inverse_lerp & range_lerp
| * GDScript Built-in: add inverse_lerp & range_lerpPoommetee Ketson2017-08-182-0/+32
| |
* | Merge pull request #10319 from neikeq/pr-engine-editor-hintJuan Linietsky2017-08-201-1/+2
|\ \ | | | | | | Adds Engine::is_editor_hint() method
| * | Removes editor_hint from SceneTreeIgnacio Etcheverry2017-08-191-1/+2
| | |
* | | Add closest_power_of_2 func and implement mix_rate/latency on OS XMarcelo Fernandez2017-08-171-1/+1
| | |
* | | Merge pull request #10307 from Rubonnek/update-argument-namesRémi Verschelde2017-08-161-3/+3
|\ \ \ | | | | | | | | Updated function argument names
| * | | Updated function argument namesWilson E. Alvarez2017-08-121-3/+3
| |/ /
* / / Revive inspector property evaluationPedro J. Estébanez2017-08-161-1/+1
|/ / | | | | | | | | | | | | | | | | | | GDScript was restricted to parse only scripts beginning with __res://__ or __user://__ to avoid templates from being parsed. I've made that a bit less inclusive by allowing scripts with an empty path to be parsed too, which doesn't conflict and is needed for this to work. Also I've removed the `this` variable of the generated script and made the relevant object to be the one the script instance refers to, so you can use `self` instead. Now, with the shorter 3.0-style syntax, you can write things like: `self.position.x + 10` Closes #9500.
* / Removes type information from method bindsIgnacio Etcheverry2017-08-101-1/+1
|/
* push variable later when created, to avoid self-referencing as a valid case, ↵Juan Linietsky2017-08-081-2/+5
| | | | closes #6111
* Implement len() gdscript built-in function for python users, closes #1960Juan Linietsky2017-08-072-0/+64
|
* Makes all Godot API's methods Lower CaseIndah Sylvia2017-08-074-14/+14
|
* Fix $a/b being parsed as divisionBojidar Marinov2017-07-261-1/+2
|
* Merge pull request #9731 from Xrayez/gdscript-completionRémi Verschelde2017-07-252-3/+3
|\ | | | | Update GDScript completion names for Pool*Arrays