Changed error message macros to actually use Godot's error reporting
facilities instead of outputting straight to stderr. This enables
GDNative errors to actually show up inside the editor.
Messages and set of available macros now also better matches that of
the engine itself.
changes so this cmake file can be used as a subdirectory
```
add_subdirectory(godot-cpp)
project(project-name)
add_library(project-name SHARED src/init.cpp)
target_link_libraries(project-name godot-cpp)
```
The [] operator of Basis was returning a reference to a temporary, so fixed it.
There was no * operator in Transform equivalent to the xform function, which is
not in line with GDScript behavior.
Also fixed remaining cases where Transform relied on the old behavior of the
[] operator of Basis (i.e. that it returns the row, not the column).
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).
Per https://github.com/godotengine/godot/issues/14553:
Godot stores Basis in row-major layout for more change for efficiently
taking advantage of SIMD instructions, but in scripts Basis looks like and
is accessible in a column-major format.
This change modifies the C++ binding so that from the script's perspective
Basis does look like if it was column-major while retaining a row-major
in-memory representation. This is achieved using a set of helper template
classes which allow accessing individual columns whose components are
non-continues in memory as if it was a Vector3 type. This ensures script
interface compatibility without needing to transpose the Basis every time
it is passed over the script-engine boundary.
Also made most of the Vector2 and Vector3 class interfaces inlined in the
process for increased performance.
While unrelated (but didn't want to file a separate PR for it), this change
adds the necessary flags to have debug symbol information under MSVC.
Fixes#241.
- 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.