Commit Graph

93 Commits (7adc5360d79d06f296347e2247a115f60bc7ece4)

Author SHA1 Message Date
sheepandshepherd 33f9de16e4 Use godot_object_cast_to instead of TagDB to cast engine types 2020-08-17 00:05:57 +02:00
Duncan Sparks 2b14529de6
Merge branch 'master' into template_get_node 2020-08-16 14:50:32 -07:00
Marc Gilleron 251062c9a5 Don't use Ref<T> in Object.hpp 2020-07-28 20:28:13 +01:00
Duncan Sparks 3b16f34d89
Add option for template get_node 2020-06-17 15:34:49 -07:00
Daniel Rakos 01606fa212 Optimizations to the generated bindings
This change gets rid of the call-time method binding query, instead it queries
all method bindings up-front at initialization time so that no extra cost is
added at function call time.

In addition, also converted the "icall" code to a header-only library so one
level of unnecessary call-stack is eliminated.

Also changed binding generator to use real_t instead of double everywhere
(except at the GDNative interface where unfortunately using doubles is hard-coded
on the engine side).

All this comes at a minimal increase in binary size (for the library, as actual
native modules might not even increase in size in practice).
2019-04-10 16:51:51 +02:00
Hugo Locurcio 976a188837
Fix and improve the build system
- Fix automatic architecture detection
- Fix compiling with MinGW on Linux
  - MinGW on Windows is still not working though
- Default to Clang on macOS
- Remove redundant `use_custom_api_file` option
- Format SConstruct using Flake8

This closes #245.
2019-04-07 15:40:49 +02:00
David Castro 30500632b1 escape 'typename' keyword, which is causing errors when generating bindings 2019-02-03 17:55:16 -08:00
bruvzg be5a012ff7
Fix NULL dereferencing in get_from_variant and cast_to 2018-11-26 08:11:31 +02:00
bruvzg 715d1dc82b
Fix passing NULL pointers as arguments via ptrcall 2018-11-19 22:40:31 +02:00
bruvzg ec5d718191
Fix TagDB registration for classes with underscore in the name. 2018-11-17 18:25:12 +02:00
bruvzg 700310c8c3
Fix ptrcall passing invalid size int. 2018-11-17 18:23:52 +02:00
karroffel 200bf226bf Nativescript 1.1
implemented instance binding data usage

This commit changes the way C++ wrapper classes work.
Previously, wrapper classes were merely wrapper *interfaces*.
They used the `this` pointer to store the actual foreign Godot
Object.

With the NativeScript 1.1 extension it is now possible to have
low-overhead language binding data attached to Objects.

The C++ bindings use that feature to implement *proper* wrappers
and enable regular C++ inheritance usage that way.

Some things might still be buggy and untested, but the C++
SimpleDemo works with those changes.

new and free change, custom free will crash engine, be wary

fix exporting of non-object types

fix free() crash with custom resources

added type tags and safe object casting

fix global type registration order

fix cast_to

changed build system to be more self contained

updated .gitignore

use typeid() for type tags now

fix indentation in bindings generator

remove accidentally added files

fix gitignore

Fixed up registering tool and updated godot_headers

Fix crash when calling String::split/split_floats

Was casting to the wrong object type.
Also adds parse_ints function to String with the same logic

Better warning/error macros

Change gitignore so we get our gen folders

New documentation based on nativescript 1.1

Fixed GODOT_SUBCLASS macro

Preventing crash when function returned null ptr

Adds needed include <typeinfo>

 Solves this issue #168 due to not having the include of typeinfo

Fix compile error of 'WARN_PRINT' and 'ERR_PRINT'.

cannot pass non-trivial object of type 'godot::String' to variadic function; expected type from format string was 'char *' [-Wnon-pod-varargs]

update vector3::distance_to

Remove godot_api.json as its now in the godot_headers submodule (api.json)
2018-11-07 21:23:08 +11:00
Thomas Herzog d8becfbe90
Merge pull request #130 from marcelofg55/int_real_arrays
Fix bindings for PoolIntArray and PoolRealArray
2018-05-09 10:22:59 +02:00
Marcelo Fernandez ae38ebc80c fix method calls that take floats/doubles 2018-05-08 21:58:48 -03:00
Marcelo Fernandez 709446da94 Fix bindings for PoolIntArray and PoolRealArray 2018-05-08 21:47:34 -03:00
Nickolai Korshunov ef37d8d76e Merge branch 'master' of https://github.com/GodotNativeTools/godot-cpp 2018-04-25 11:40:49 +03:00
Nickolai Korshunov 876715b610 disable strict enums 2018-04-25 11:39:18 +03:00
danielytics 01db553c49 adds Array::make and Dictionary::make static methods and has variadic template functions use those 2018-03-07 10:27:34 +00:00
danielytics c7b03c4132 make register_signal and auto-generated variadic funcitons use variadic templates to streamline their use 2018-03-06 21:36:20 +00:00
Nickolai Korshunov f1c35f24f6 NULL -> nullptr 2018-02-23 16:08:36 +03:00
Nickolai Korshunov 3f8456135f local deps included with quotes 2018-02-23 15:57:37 +03:00
Nickolai Korshunov e123650d76 Strict enums 2018-02-23 15:50:41 +03:00
Marc Gilleron ac0679eb1a Fix Ref leak when using Godot getters 2018-01-25 20:55:56 +01:00
RameshRavone 4aec7cbf42
Do not include Ref.hpp file in Reference.hpp 2018-01-24 15:18:30 +05:30
Marc Gilleron 3197c3dce3 Rewrite Ref<T> to behave like Godot again 2018-01-22 22:27:10 +01:00
karroffel 2e4de7b67d Don't leak memory from Ref<>() 2018-01-19 11:40:50 +01:00
karroffel 7dde412e26 custom types can now be used as method parameters 2018-01-14 23:03:57 +01:00
Grosskopf 575b2f4d14 Fixed building
without this, the clang command fails
2017-12-11 16:36:03 +01:00
BastiaanOlij 0f773c2d72 Update bindings to use new Api extensions and rename Rect3->AABB 2017-11-23 22:50:05 +11:00
Bastiaan Olij 6452ba6e88 Implemented using api struct 2017-10-23 21:20:14 +11:00
Ramesh Ravone 10bb24cfbc
updated bindings 2017-10-03 16:07:34 +05:30
Maxim Sheronov 8939c663d9 Fix bindings generation for enums 2017-09-13 21:30:30 +03:00
Karroffel c27af379b8 updated to use the new NativeScript and GDNative interface 2017-07-24 17:08:52 +02:00
Karroffel 4769f49cb4 Use static linking instead of dynamic linking 2017-07-23 17:53:50 +02:00
Karroffel 606d2624af new ptrcall number sizes (int64_t and double) 2017-07-23 17:14:50 +02:00
Karroffel e1f3865467 Wohoo, Ref<>s are now working 2017-06-21 02:14:54 +02:00
Karroffel 38f1ee741d some Ref WIP, memory leaks and invalid returns 2017-06-21 00:42:29 +02:00
Karroffel 82165394ca fixed singleton naming thingy 2017-06-20 23:26:22 +02:00
Karroffel ac630353cf [experimental] constructors and Ref<T> 2017-06-19 02:03:59 +02:00
Karroffel ad3720440e removed InputEvent and Image 2017-05-23 23:03:57 +02:00
Karroffel 9caeb8d296 made msvc happier 2017-05-16 09:00:17 +02:00
Karroffel fad8f7c9eb made script "inheritance" less OOP 2017-05-13 13:55:04 +02:00
Karroffel cf30b0f39d rewrote binding generator in python 2017-05-12 21:53:07 +02:00