summaryrefslogtreecommitdiffstats
path: root/modules/gdnative/nativescript/nativescript.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Removed interactive loader, added proper thread loading.Juan Linietsky2020-02-281-1/+1
|
* Reimplement Mutex with C++'s <mutex>Pedro J. Estébanez2020-02-261-50/+11
| | | | | | | | | | | | | | | | Main: - It's now implemented thanks to `<mutex>`. No more platform-specific implementations. - `BinaryMutex` (non-recursive) is added, as an alternative for special cases. - Doesn't need allocation/deallocation anymore. It can live in the stack and be part of other classes. - Because of that, it's methods are now `const` and the inner mutex is `mutable` so it can be easily used in `const` contexts. - A no-op implementation is provided if `NO_THREADS` is defined. No more need to add `#ifdef NO_THREADS` just for this. - `MutexLock` now takes a reference. At this point the cases of null `Mutex`es are rare. If you ever need that, just don't use `MutexLock`. - Thread-safe utilities are therefore simpler now. Misc.: - `ScopedMutexLock` is dropped and replaced by `MutexLock`, because they were pretty much the same. - Every case of lock, do-something, unlock is replaced by `MutexLock` (complex cases where it's not straightfoward are kept as as explicit lock and unlock). - `ShaderRD` contained an `std::mutex`, which has been replaced by `Mutex`.
* Reworked signal connection system, added support for Callable and Signal ↵Juan Linietsky2020-02-201-15/+15
| | | | objects and made them default.
* PoolVector is gone, replaced by VectorJuan Linietsky2020-02-181-1/+1
| | | | | Typed `PoolTypeArray` types are now renamed `PackedTypeArray` and are sugar for `Vector<Type>`.
* Optmized data sent during RPC and RSet calls.Andrea Catania2020-02-121-56/+286
| | | | | | | | | | - Now is sent the method ID rather the full function name. - The passed IDs (Node and Method) are compressed so to use less possible space. - The variant (INT and BOOL) is now encoded and compressed so to use much less data. - Optimized RPCMode retrieval for GDScript functions. - Added checksum to assert the methods are the same across peers. This work has been kindly sponsored by IMVU.
* Remove duplicate ERR_PRINT macro.Marcel Admiraal2020-02-051-1/+1
|
* Update copyright statements to 2020Rémi Verschelde2020-01-011-2/+2
| | | | | | | | | | | Happy new year to the wonderful Godot community! We're starting a new decade with a well-established, non-profit, free and open source game engine, and tons of further improvements in the pipeline from hundreds of contributors. Godot will keep getting better, and we're looking forward to all the games that the community will keep developing and releasing with it.
* Don't try to initialize empty NativeLibraryTomasz Chabora2019-11-291-1/+4
|
* Make VarArg methods return types show up as Variant in API jsontoasteater2019-08-261-1/+1
| | | | | | | | | | | | VarArg methods have the return type Object in the API json for GDNative. This can cause undefined behavior in some language bindings due to lack of documentation on VarArg methods' behavior. This changes the MethodInfo of: - CSharpScript::_new - GDScript::_new - PluginScript::_new
* Replace 'ERR_EXPLAIN' with 'ERR_FAIL_*_MSG' in "platform", ↵Robin Hübner2019-08-091-34/+11
| | | | "modules/gdnative", "modules/gdscript" directories.
* Merge pull request #27886 from LeonardMeagher2/obj_to_stringRémi Verschelde2019-05-201-0/+22
|\ | | | | Allow overriding how scripted objects are converted to strings
| * Allow overriding how scripted objects are converted to stringsLeonard Meagher2019-05-031-0/+22
| | | | | | | | | | | | | | | | | | | | solves #26796 - ADD `String to_string()` method to Object which can be overriden by `String _to_string()` in scripts - ADD `String to_string(r_valid)` method to ScriptInstance to allow langauges to control how scripted objects are converted to strings - IMPLEMENT to_string for GDScriptInstance, VisualScriptInstance, and NativeScriptInstance - ADD Documentation about `Object.to_string` and `Object._to_string` - Changed `Variant::operator String` to use `obj->to_string()`
* | NULL global_tag for non exposed classesRameshRavone2019-05-181-1/+4
| |
* | Fix indexing failure in NativeScriptLanguage::unregister_binding_functions.Frank Secilia2019-05-151-1/+1
|/ | | | | | | | binding_functions.size() and an instance's binding_data.size() can get out of sync. They sync up when an instance's bindings are requested. When binding functions are registered after creating an instance's bindings, the instance's bindings are out of sync until requested again. If they're never requested, they're never synced. unregister_binding_functions indexes into binding_data, but only checks that its safe to index into binding_functions. When they're out of sync, indexing fails. This revision checks that it's safe to index into binding_data.
* [GDNative] fix NativeScript leak in editorthomas.herzog2019-03-221-21/+17
|
* [GDNative] remove spam at editor unfocus when using NativeScriptthomas.herzog2019-03-221-1/+1
|
* [GDNative] fix crash at shutdown when using singleton libraries and NativeScriptkarroffel2019-03-091-2/+25
| | | | | | | | | | When a singleton library was exposing NativeScript functionality, the NativeScriptLanguage would attempt to terminate the library at shutdown. Since the GDNative module itself handles singleton libraries, it closes all singleton libraries at shutdown as well. This double free could cause a crash, since the library referenced would no longer be alive.
* Fix "No loader found for resource: res://" spam when NativeScript ↵Eric Rybicki2019-02-261-9/+11
| | | | | | script_class_name is not empty. fixes #26275
* Scene: Ensure classes match their header filenameRémi Verschelde2019-02-121-1/+1
| | | | | | | | | | | | | | | | | | Also drop some unused files. Renamed: - `scene/2d/navigation2d.h` -> `navigation_2d.h` - `scene/2d/screen_button.h` -> `touch_screen_button.h` - `scene/3d/scenario_fx.h` -> `world_environment.h` - `scene/audio/audio_player.h` -> `audio_stream_player.h` - `scene/resources/bit_mask.h` -> `bit_map.h` - `scene/resources/color_ramp.h` -> `gradient.h` - `scene/resources/shape_line_2d.h` -> `line_shape_2d.h` - `scene/resources/scene_format_text.h` -> `resource_format_text.h` - `scene/resources/sky_box.h` -> `sky.h` Dropped: - `scene/resources/bounds.h`
* Update copyright statements to 2019Rémi Verschelde2019-01-011-2/+2
| | | | Happy new year to the wonderful Godot community!
* Allow signal connecting even if script is invalid (only when compiled with ↵Juan Linietsky2018-11-271-0/+4
| | | | tools), fixes #17070
* -Moved EditorDefaultValue to ClassDB, made it coreJuan Linietsky2018-11-081-4/+4
| | | | -Removed one and zero hints for properties, replaced by default value
* Fixes crash when loading *.escn resources with gdnative #20141Maarten Heremans2018-10-221-2/+1
| | | | | | | | | The issue is that ResourceFormatLoaderText is a singleton. It was created in a faulty way in ResourceFormatLoaderNativeScript::load It was created on the stack, which caused the static singleton pointer to be overwritten. This causes then segmentation faults if the singleton is used later on. IMO singleton creation needs to made safer to avoid other similar issues in the future.
* Fix warnings about non-static data member initializers in nativescriptRémi Verschelde2018-10-041-0/+10
| | | | | | | | | | | | | Fixes the following GCC/Clang warnings: ``` modules/gdnative/nativescript/nativescript.h:280:37: warning: non-static data member initializers only available with -std=c++11 or -std=gnu++11 modules/gdnative/nativescript/nativescript.h:281:37: warning: non-static data member initializers only available with -std=c++11 or -std=gnu++11 modules/gdnative/nativescript/nativescript.h:283:42: warning: non-static data member initializers only available with -std=c++11 or -std=gnu++11 modules/gdnative/nativescript/nativescript.h:285:38: warning: non-static data member initializers only available with -std=c++11 or -std=gnu++11 modules/gdnative/nativescript/nativescript.h:287:38: warning: non-static data member initializers only available with -std=c++11 or -std=gnu++11 modules/gdnative/nativescript/nativescript.h:290:45: warning: non-static data member initializers only available with -std=c++11 or -std=gnu++11 modules/gdnative/nativescript/nativescript.h:291:44: warning: non-static data member initializers only available with -std=c++11 or -std=gnu++11 ```
* Clearly deprecate sync too in favor of remotesync.Fabio Alessandrelli2018-09-151-4/+6
| | | | | NOTE: This changes the RPC_MODE_* enum values. Games should be re-exported. GDNative rebuilt.
* Rename slave keyword to puppetFabio Alessandrelli2018-09-151-6/+6
| | | | | The slave keyword will still be available as deprecated in 3.1 but will be dropped from future releases.
* Make core/ includes absolute, remove subfolders from include pathRémi Verschelde2018-09-121-4/+4
| | | | | | This allows more consistency in the manner we include core headers, where previously there would be a mix of absolute, relative and include path-dependent includes.
* Fix invalid deref in NativeScript script classesWill Nations2018-09-041-4/+8
|
* [NativeScript] implement refcount instance binding funcsThomas Herzog2018-08-301-0/+48
|
* Implemented profiling functions for NativeScriptMarcelo Fernandez2018-08-221-0/+110
|
* Add NativeScript support for script classes.willnationsdev2018-08-151-0/+40
|
* Added system for GDScript warningsGeorge Marques2018-08-101-1/+1
| | | | | | | - 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.
* Fixed nativescript getter and setter logicBastiaan Olij2018-07-271-5/+9
|
* Reduce unnecessary COW on Vector by make writing explicitHein-Pieter van Braam2018-07-261-6/+6
| | | | | | | | | | | | | | | | | | | | | | | 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.
* Fix possible crash at NativeScript::get_base_scriptMarcelo Fernandez2018-07-251-1/+4
|
* Add editor highlight for type-safe linesGeorge Marques2018-07-201-1/+1
| | | | | The line number is hightlighted to indicate that the line contains only type-safe code.
* Add a new notification to detect crashes on native scriptsMarcelo Fernandez2018-07-021-0/+19
|
* New sync keywords in GDScript, NativeScript, MonoFabio Alessandrelli2018-05-291-0/+6
|
* Refactor RPCMode enum and checksFabio Alessandrelli2018-05-291-16/+16
|
* Revert "RPCMode refactor, more sync modes"Max Hilbrunner2018-05-291-22/+16
|
* New sync keywords in GDScript, NativeScript, MonoFabio Alessandrelli2018-05-261-0/+6
|
* Refactor RPCMode enum and checksFabio Alessandrelli2018-05-261-16/+16
|
* Fix NativeScript property listsheepandshepherd2018-04-111-4/+3
|
* [NativeScript] added global type tag systemkarroffel2018-04-051-19/+25
|
* [GDNative] fixed issue with library unloading orderkarroffel2018-03-311-13/+25
|
* NativeScript: Fix initialization in wrong scopeRémi Verschelde2018-03-021-1/+1
| | | | Regression from d702d7b335c0c9305e75131770c0ea739b70d813 which broke javascript build.
* Fix various valgrind reported uninitialized variable usesHein-Pieter van Braam2018-02-281-0/+1
|
* add initial NativeScript 1.1 extensionkarroffel2018-02-091-1/+215
| | | | | | | | | | | | | | | This commit adds new functionality to NativeScript, namely: - ability to set and get documentation for classes, methods, signals and properties - ability to set names and type information to method arguments - ability to set and get type tags for nativescripts - ability to register instance binding data management functions - ability to use instance binding data
* [GDNative] fix NativeScript false negative errorkarroffel2018-01-181-1/+1
|
* [GDNative] fix #15723karroffel2018-01-181-3/+38
|