Compare commits
No commits in common. "17680c2288f78114e467fd2da88bfa023cbb9817" and "3066bdacc96db89bcb7d7e4d56e99858ef9df432" have entirely different histories.
17680c2288
...
3066bdacc9
7 changed files with 323529 additions and 53 deletions
7
.gitignore
vendored
7
.gitignore
vendored
|
|
@ -1,13 +1,6 @@
|
||||||
# Compiled Object files from SCons
|
# Compiled Object files from SCons
|
||||||
*.os
|
*.os
|
||||||
|
|
||||||
# Generated by tooling
|
|
||||||
extension_api.json
|
|
||||||
compile_commands.json
|
|
||||||
|
|
||||||
# clangd cache
|
|
||||||
.cache/
|
|
||||||
|
|
||||||
# Created by https://www.toptal.com/developers/gitignore/api/c++,godot,scons
|
# Created by https://www.toptal.com/developers/gitignore/api/c++,godot,scons
|
||||||
# Edit at https://www.toptal.com/developers/gitignore?templates=c++,godot,scons
|
# Edit at https://www.toptal.com/developers/gitignore?templates=c++,godot,scons
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -7,15 +7,6 @@ Named in this order so not everything starts with the same word
|
||||||
Using Godot v4.4.beta1.official [d33da79d3].
|
Using Godot v4.4.beta1.official [d33da79d3].
|
||||||
Install SCons with `pipx install scons`.
|
Install SCons with `pipx install scons`.
|
||||||
|
|
||||||
To generate files for build tooling, run the following:
|
|
||||||
|
|
||||||
```sh
|
|
||||||
godot --dump-extension-api
|
|
||||||
scons compile_commands
|
|
||||||
```
|
|
||||||
|
|
||||||
### Build
|
|
||||||
|
|
||||||
To build the extension run SCons in the repository root, the default arguments have been added to the file.
|
To build the extension run SCons in the repository root, the default arguments have been added to the file.
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
|
|
|
||||||
|
|
@ -19,12 +19,6 @@ sources = Glob("src/*.cpp")
|
||||||
# Generated with local Godot installation
|
# Generated with local Godot installation
|
||||||
env["custom_api_file"] = "extension_api.json"
|
env["custom_api_file"] = "extension_api.json"
|
||||||
|
|
||||||
# Information for Clang tooling, including clangd language server
|
|
||||||
# To create the compile_database
|
|
||||||
env.Tool('compilation_db')
|
|
||||||
cdb = env.CompilationDatabase('compile_commands.json')
|
|
||||||
Alias('compile_commands', cdb)
|
|
||||||
|
|
||||||
if env["platform"] == "macos":
|
if env["platform"] == "macos":
|
||||||
library = env.SharedLibrary(
|
library = env.SharedLibrary(
|
||||||
"project/bin/libmarshconnector.{}.{}.framework/libmarshconnector.{}.{}".format(
|
"project/bin/libmarshconnector.{}.{}.framework/libmarshconnector.{}.{}".format(
|
||||||
|
|
|
||||||
323500
extension_api.json
Normal file
323500
extension_api.json
Normal file
File diff suppressed because it is too large
Load diff
|
|
@ -3,15 +3,18 @@
|
||||||
|
|
||||||
using namespace godot;
|
using namespace godot;
|
||||||
|
|
||||||
void MarshConnector::_bind_methods() {}
|
void MarshConnector::_bind_methods() {
|
||||||
|
}
|
||||||
|
|
||||||
MarshConnector::MarshConnector() {
|
MarshConnector::MarshConnector() {
|
||||||
// Initialize any variables here.
|
// Initialize any variables here.
|
||||||
time_passed = 0.0;
|
time_passed = 0.0;
|
||||||
}
|
}
|
||||||
|
|
||||||
MarshConnector::~MarshConnector() {
|
MarshConnector::~MarshConnector() {
|
||||||
// Add your cleanup here.
|
// Add your cleanup here.
|
||||||
}
|
}
|
||||||
|
|
||||||
void MarshConnector::_process(double delta) { time_passed += delta; }
|
void MarshConnector::_process(double delta) {
|
||||||
|
time_passed += delta;
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -5,22 +5,22 @@
|
||||||
|
|
||||||
namespace godot {
|
namespace godot {
|
||||||
|
|
||||||
class MarshConnector : public Node {
|
class MarshConnector : public Node{
|
||||||
GDCLASS(MarshConnector, Node)
|
GDCLASS(MarshConnector, Node)
|
||||||
|
|
||||||
private:
|
private:
|
||||||
double time_passed;
|
double time_passed;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
static void _bind_methods();
|
static void _bind_methods();
|
||||||
|
|
||||||
public:
|
public:
|
||||||
MarshConnector();
|
MarshConnector();
|
||||||
~MarshConnector();
|
~MarshConnector();
|
||||||
|
|
||||||
void _process(double delta) override;
|
void _process(double delta) override;
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace godot
|
}
|
||||||
|
|
||||||
#endif // MARSHCONNECTOR_H
|
#endif // MARSHCONNECTOR_H
|
||||||
|
|
|
||||||
|
|
@ -9,33 +9,28 @@
|
||||||
using namespace godot;
|
using namespace godot;
|
||||||
|
|
||||||
void initialize_marsh_module(ModuleInitializationLevel p_level) {
|
void initialize_marsh_module(ModuleInitializationLevel p_level) {
|
||||||
if (p_level != MODULE_INITIALIZATION_LEVEL_SCENE) {
|
if (p_level != MODULE_INITIALIZATION_LEVEL_SCENE) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
GDREGISTER_CLASS(MarshConnector);
|
GDREGISTER_CLASS(MarshConnector);
|
||||||
}
|
}
|
||||||
|
|
||||||
void uninitialize_marsh_module(ModuleInitializationLevel p_level) {
|
void uninitialize_marsh_module(ModuleInitializationLevel p_level) {
|
||||||
if (p_level != MODULE_INITIALIZATION_LEVEL_SCENE) {
|
if (p_level != MODULE_INITIALIZATION_LEVEL_SCENE) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
extern "C" {
|
extern "C" {
|
||||||
// Initialization.
|
// Initialization.
|
||||||
GDExtensionBool GDE_EXPORT
|
GDExtensionBool GDE_EXPORT marsh_library_init(GDExtensionInterfaceGetProcAddress p_get_proc_address, const GDExtensionClassLibraryPtr p_library, GDExtensionInitialization *r_initialization) {
|
||||||
marsh_library_init(GDExtensionInterfaceGetProcAddress p_get_proc_address,
|
godot::GDExtensionBinding::InitObject init_obj(p_get_proc_address, p_library, r_initialization);
|
||||||
const GDExtensionClassLibraryPtr p_library,
|
|
||||||
GDExtensionInitialization *r_initialization) {
|
|
||||||
godot::GDExtensionBinding::InitObject init_obj(p_get_proc_address, p_library,
|
|
||||||
r_initialization);
|
|
||||||
|
|
||||||
init_obj.register_initializer(initialize_marsh_module);
|
init_obj.register_initializer(initialize_marsh_module);
|
||||||
init_obj.register_terminator(uninitialize_marsh_module);
|
init_obj.register_terminator(uninitialize_marsh_module);
|
||||||
init_obj.set_minimum_library_initialization_level(
|
init_obj.set_minimum_library_initialization_level(MODULE_INITIALIZATION_LEVEL_SCENE);
|
||||||
MODULE_INITIALIZATION_LEVEL_SCENE);
|
|
||||||
|
|
||||||
return init_obj.init();
|
return init_obj.init();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue