aboutsummaryrefslogtreecommitdiff
path: root/extension/src/openvic-extension/MapMesh.cpp
diff options
context:
space:
mode:
author Spartan322 <Megacake1234@gmail.com>2023-11-10 05:14:58 +0100
committer Spartan322 <Megacake1234@gmail.com>2023-11-10 23:15:32 +0100
commitcf591eddfa59839c2620ebf119727f069b965dfe (patch)
tree65ca78284e4ed1a2b07716018a721aaaf68d3830 /extension/src/openvic-extension/MapMesh.cpp
parentf8da0860795d273452501fa4d7fbfcc40073a884 (diff)
Add ClassBinding helpers
OV_BIND_METHOD OV_BIND_SMETHOD OV_BIND_SMETHOD_L Change _bind_methods to use ClassBinding helpers Add utility/StringLiteral Make `GameSingleton::singleton` inline Move `OpenVic::Checksum` implementation to source file Update scripts to ce1aef8d7d9d5ba9851a1abdd981d3b796024079
Diffstat (limited to 'extension/src/openvic-extension/MapMesh.cpp')
-rw-r--r--extension/src/openvic-extension/MapMesh.cpp22
1 files changed, 12 insertions, 10 deletions
diff --git a/extension/src/openvic-extension/MapMesh.cpp b/extension/src/openvic-extension/MapMesh.cpp
index e407391..a557105 100644
--- a/extension/src/openvic-extension/MapMesh.cpp
+++ b/extension/src/openvic-extension/MapMesh.cpp
@@ -2,24 +2,26 @@
#include <godot_cpp/templates/vector.hpp>
+#include "openvic-extension/utility/ClassBindings.hpp"
+
using namespace godot;
using namespace OpenVic;
void MapMesh::_bind_methods() {
- ClassDB::bind_method(D_METHOD("set_aspect_ratio", "ratio"), &MapMesh::set_aspect_ratio);
- ClassDB::bind_method(D_METHOD("get_aspect_ratio"), &MapMesh::get_aspect_ratio);
+ OV_BIND_METHOD(MapMesh::set_aspect_ratio, { "ratio" });
+ OV_BIND_METHOD(MapMesh::get_aspect_ratio);
- ClassDB::bind_method(D_METHOD("set_repeat_proportion", "proportion"), &MapMesh::set_repeat_proportion);
- ClassDB::bind_method(D_METHOD("get_repeat_proportion"), &MapMesh::get_repeat_proportion);
+ OV_BIND_METHOD(MapMesh::set_repeat_proportion, { "proportion" });
+ OV_BIND_METHOD(MapMesh::get_repeat_proportion);
- ClassDB::bind_method(D_METHOD("set_subdivide_width", "divisions"), &MapMesh::set_subdivide_width);
- ClassDB::bind_method(D_METHOD("get_subdivide_width"), &MapMesh::get_subdivide_width);
+ OV_BIND_METHOD(MapMesh::set_subdivide_width, { "divisions" });
+ OV_BIND_METHOD(MapMesh::get_subdivide_width);
- ClassDB::bind_method(D_METHOD("set_subdivide_depth", "divisions"), &MapMesh::set_subdivide_depth);
- ClassDB::bind_method(D_METHOD("get_subdivide_depth"), &MapMesh::get_subdivide_depth);
+ OV_BIND_METHOD(MapMesh::set_subdivide_depth, { "divisions" });
+ OV_BIND_METHOD(MapMesh::get_subdivide_depth);
- ClassDB::bind_method(D_METHOD("get_core_aabb"), &MapMesh::get_core_aabb);
- ClassDB::bind_method(D_METHOD("is_valid_uv_coord"), &MapMesh::is_valid_uv_coord);
+ OV_BIND_METHOD(MapMesh::get_core_aabb);
+ OV_BIND_METHOD(MapMesh::is_valid_uv_coord);
ADD_PROPERTY(
PropertyInfo(Variant::FLOAT, "aspect_ratio", PROPERTY_HINT_NONE, "suffix:m"), "set_aspect_ratio", "get_aspect_ratio"