Skip to content

Commit

Permalink
Merge pull request #959 from DmitriySalnikov/bitfield_int64
Browse files Browse the repository at this point in the history
Use `int64_t` for `BitField` as in Godot itself
  • Loading branch information
akien-mga committed Dec 13, 2022
2 parents 49a478a + b7eeddc commit 0d926a7
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions include/godot_cpp/core/type_info.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -240,14 +240,14 @@ inline StringName __constant_get_enum_name(T param, StringName p_constant) {

template <class T>
class BitField {
uint32_t value = 0;
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) { return value &= ~p_flag; }
_FORCE_INLINE_ BitField(uint32_t p_value) { value = p_value; }
_FORCE_INLINE_ operator uint32_t() const { return value; }
_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; }
};

Expand Down

0 comments on commit 0d926a7

Please sign in to comment.