feat: compatibility with godot 4.7.dev

This commit is contained in:
Sara Gerretsen 2026-03-13 13:16:29 +01:00
parent 52a5cd02a5
commit 062fdc276b
7 changed files with 63 additions and 21 deletions

View file

@ -1,4 +1,5 @@
#include "behaviour_action.h"
#include "core/object/class_db.h"
#include "core/object/object.h"
void BehaviourAction::_bind_methods() {

View file

@ -1,4 +1,5 @@
#include "behaviour_composite.h"
#include "core/variant/typed_array.h"
void BehaviourComposite::_bind_methods() {}

View file

@ -1,6 +1,7 @@
#include "behaviour_node.h"
#include "behaviour_nodes/behaviour_tree.h"
#include "core/config/engine.h"
#include "core/object/class_db.h"
void BehaviourNode::_bind_methods() {
BIND_ENUM_CONSTANT(Fail);

View file

@ -1,7 +1,8 @@
#include "behaviour_tree.h"
#include "behaviour_nodes/behaviour_composite.h"
#include "behaviour_nodes/behaviour_node.h"
#include "behaviour_nodes/control_nodes.h"
#include "core/config/engine.h"
#include "core/variant/typed_array.h"
void BehaviourTree::_bind_methods() {}

View file

@ -1,20 +0,0 @@
#ifndef GODOT_EXTRA_MACROS_H
#define GODOT_EXTRA_MACROS_H
#define BIND_GET_SET(m_property) \
ClassDB::bind_method(D_METHOD("set_" #m_property, #m_property), \
&self_type::set_##m_property); \
ClassDB::bind_method(D_METHOD("get_" #m_property), \
&self_type::get_##m_property)
#define BIND_HPROPERTY(m_type, m_property, ...) \
BIND_GET_SET(m_property); \
ADD_PROPERTY(PropertyInfo(m_type, #m_property, __VA_ARGS__), \
"set_" #m_property, "get_" #m_property)
#define BIND_PROPERTY(m_type, m_property) \
BIND_GET_SET(m_property); \
ADD_PROPERTY(PropertyInfo(m_type, #m_property), "set_" #m_property, \
"get_" #m_property)
#endif // !GODOT_EXTRA_MACROS_H

52
modules/macros.h Normal file
View file

@ -0,0 +1,52 @@
#ifndef GODOT_EXTRA_MACROS_H
#define GODOT_EXTRA_MACROS_H
#define BIND_GET_SET(m_property) \
ClassDB::bind_method(D_METHOD("set_" #m_property, #m_property), \
&self_type::set_##m_property); \
ClassDB::bind_method(D_METHOD("get_" #m_property), \
&self_type::get_##m_property)
#define BIND_HPROPERTY(m_type, m_property, ...) \
BIND_GET_SET(m_property); \
ADD_PROPERTY(PropertyInfo(m_type, #m_property, __VA_ARGS__), \
"set_" #m_property, "get_" #m_property)
#define BIND_PROPERTY(m_type, m_property) \
BIND_GET_SET(m_property); \
ADD_PROPERTY(PropertyInfo(m_type, #m_property), "set_" #m_property, \
"get_" #m_property)
#define GET_SET_FNS(m_type, m_property) \
m_type get_##m_property() const { \
return this->m_property; \
} \
void set_##m_property(m_type value) { \
this->m_property = value; \
}
#define GET_SET_REF_FNS(m_type, m_property) \
m_type &get_##m_property() { \
return this->m_property; \
} \
void set_##m_property(m_type &value) { \
this->m_property = value; \
}
#define GET_SET_FNS_EX(m_type, m_property, m_ex) \
m_type get_##m_property() const { \
return this->m_property; \
} \
void set_##m_property(m_type value) { \
m_ex; \
this->m_property = value; \
}
#define __VA_ARGS__STRING(...) String(#__VA_ARGS__)
#define GDENUM(M_Name, ...) \
enum M_Name { __VA_ARGS__ }; \
static String M_Name##_hint() { \
return __VA_ARGS__STRING(__VA_ARGS__); \
}
#endif // !GODOT_EXTRA_MACROS_H

View file

@ -18,6 +18,8 @@ dest_files=["res://.godot/imported/icon.svg-218a8f2b3041327d8a5756f3a245f83b.cte
compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/uastc_level=0
compress/rdo_quality_loss=0.0
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
@ -25,6 +27,10 @@ mipmaps/generate=false
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/channel_remap/red=0
process/channel_remap/green=1
process/channel_remap/blue=2
process/channel_remap/alpha=3
process/fix_alpha_border=true
process/premult_alpha=false
process/normal_map_invert_y=false