Merge pull request #959 from DmitriySalnikov/bitfield_int64

Use `int64_t` for `BitField` as in Godot itself
pull/892/head
Rémi Verschelde 2022-12-13 12:13:46 +01:00
commit 0d926a76a7
No known key found for this signature in database
GPG Key ID: C3336907360768E1
1 changed files with 3 additions and 3 deletions

View File

@ -240,14 +240,14 @@ inline StringName __constant_get_enum_name(T param, StringName p_constant) {
template <class T> template <class T>
class BitField { class BitField {
uint32_t value = 0; int64_t value = 0;
public: public:
_FORCE_INLINE_ void set_flag(T p_flag) { value |= p_flag; } _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_ bool has_flag(T p_flag) const { return value & p_flag; }
_FORCE_INLINE_ void clear_flag(T p_flag) { return value &= ~p_flag; } _FORCE_INLINE_ void clear_flag(T p_flag) { return value &= ~p_flag; }
_FORCE_INLINE_ BitField(uint32_t p_value) { value = p_value; } _FORCE_INLINE_ BitField(int64_t p_value) { value = p_value; }
_FORCE_INLINE_ operator uint32_t() const { return value; } _FORCE_INLINE_ operator int64_t() const { return value; }
_FORCE_INLINE_ operator Variant() const { return value; } _FORCE_INLINE_ operator Variant() const { return value; }
}; };