diff --git a/binding_generator.py b/binding_generator.py index e281ba440..af26d3e4b 100644 --- a/binding_generator.py +++ b/binding_generator.py @@ -1821,6 +1821,10 @@ def generate_engine_class_header(class_api, used_classes, fully_used_classes, us result.append("#include ") result.append("") + if class_name == "Object": + result.append("#include ") + result.append("") + if class_name == "ClassDBSingleton": result.append("#include ") result.append("") diff --git a/include/godot_cpp/core/bit_field.hpp b/include/godot_cpp/core/bit_field.hpp new file mode 100644 index 000000000..6fa835722 --- /dev/null +++ b/include/godot_cpp/core/bit_field.hpp @@ -0,0 +1,50 @@ +/**************************************************************************/ +/* bit_field.hpp */ +/**************************************************************************/ +/* This file is part of: */ +/* GODOT ENGINE */ +/* https://godotengine.org */ +/**************************************************************************/ +/* Copyright (c) 2014-present Godot Engine contributors (see AUTHORS.md). */ +/* Copyright (c) 2007-2014 Juan Linietsky, Ariel Manzur. */ +/* */ +/* Permission is hereby granted, free of charge, to any person obtaining */ +/* a copy of this software and associated documentation files (the */ +/* "Software"), to deal in the Software without restriction, including */ +/* without limitation the rights to use, copy, modify, merge, publish, */ +/* distribute, sublicense, and/or sell copies of the Software, and to */ +/* permit persons to whom the Software is furnished to do so, subject to */ +/* the following conditions: */ +/* */ +/* The above copyright notice and this permission notice shall be */ +/* included in all copies or substantial portions of the Software. */ +/* */ +/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */ +/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */ +/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. */ +/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */ +/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */ +/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */ +/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ +/**************************************************************************/ + +#pragma once + +#include + +namespace godot { + +template +class BitField { + int64_t value = 0; + +public: + _FORCE_INLINE_ void set_flag(T p_flag) { value |= p_flag; } + _FORCE_INLINE_ bool has_flag(T p_flag) const { return value & p_flag; } + _FORCE_INLINE_ void clear_flag(T p_flag) { value &= ~p_flag; } + _FORCE_INLINE_ BitField(int64_t p_value) { value = p_value; } + _FORCE_INLINE_ operator int64_t() const { return value; } + _FORCE_INLINE_ operator Variant() const { return value; } +}; + +} // namespace godot diff --git a/include/godot_cpp/core/type_info.hpp b/include/godot_cpp/core/type_info.hpp index efb6f5220..de8f7005d 100644 --- a/include/godot_cpp/core/type_info.hpp +++ b/include/godot_cpp/core/type_info.hpp @@ -30,6 +30,7 @@ #pragma once +#include #include #include #include @@ -259,19 +260,6 @@ inline StringName _gde_constant_get_enum_name(T param, StringName p_constant) { return GetTypeInfo::get_class_info().class_name; } -template -class BitField { - int64_t value = 0; - -public: - _FORCE_INLINE_ void set_flag(T p_flag) { value |= p_flag; } - _FORCE_INLINE_ bool has_flag(T p_flag) const { return value & p_flag; } - _FORCE_INLINE_ void clear_flag(T p_flag) { value &= ~p_flag; } - _FORCE_INLINE_ BitField(int64_t p_value) { value = p_value; } - _FORCE_INLINE_ operator int64_t() const { return value; } - _FORCE_INLINE_ operator Variant() const { return value; } -}; - #define TEMPL_MAKE_BITFIELD_TYPE_INFO(m_enum, m_impl) \ template <> \ struct GetTypeInfo { \