Core: Add dedicated BitField template

This commit is contained in:
Thaddeus Crews 2024-08-20 09:50:44 -05:00
parent 7b9c5122fa
commit 0d267e7b1e
No known key found for this signature in database
GPG key ID: 8C6E5FEB5FC03CCC
46 changed files with 188 additions and 155 deletions

View file

@ -1803,7 +1803,7 @@ void GDScriptAnalyzer::resolve_function_signature(GDScriptParser::FunctionNode *
GDScriptParser::DataType parent_return_type;
List<GDScriptParser::DataType> parameters_types;
int default_par_count = 0;
BitField<MethodFlags> method_flags;
BitField<MethodFlags> method_flags = {};
StringName native_base;
if (!p_is_lambda && get_function_signature(p_function, false, base_type, function_name, parent_return_type, parameters_types, default_par_count, method_flags, &native_base)) {
bool valid = p_function->is_static == method_flags.has_flag(METHOD_FLAG_STATIC);
@ -2276,7 +2276,7 @@ void GDScriptAnalyzer::resolve_for(GDScriptParser::ForNode *p_for) {
GDScriptParser::DataType return_type;
List<GDScriptParser::DataType> par_types;
int default_arg_count = 0;
BitField<MethodFlags> method_flags;
BitField<MethodFlags> method_flags = {};
if (get_function_signature(p_for->list, false, list_type, CoreStringName(_iter_get), return_type, par_types, default_arg_count, method_flags)) {
variable_type = return_type;
variable_type.type_source = list_type.type_source;
@ -3567,7 +3567,7 @@ void GDScriptAnalyzer::reduce_call(GDScriptParser::CallNode *p_call, bool p_is_a
}
int default_arg_count = 0;
BitField<MethodFlags> method_flags;
BitField<MethodFlags> method_flags = {};
GDScriptParser::DataType return_type;
List<GDScriptParser::DataType> par_types;

View file

@ -263,7 +263,7 @@ void OpenXRHandTrackingExtension::on_process() {
Transform3D transform;
Vector3 linear_velocity;
Vector3 angular_velocity;
BitField<XRHandTracker::HandJointFlags> flags;
BitField<XRHandTracker::HandJointFlags> flags = {};
if (location.locationFlags & XR_SPACE_LOCATION_ORIENTATION_VALID_BIT) {
if (pose.orientation.x != 0 || pose.orientation.y != 0 || pose.orientation.z != 0 || pose.orientation.w != 0) {

View file

@ -1466,7 +1466,7 @@ OpenXRInterface::HandTrackedSource OpenXRInterface::get_hand_tracking_source(con
}
BitField<OpenXRInterface::HandJointFlags> OpenXRInterface::get_hand_joint_flags(Hand p_hand, HandJoints p_joint) const {
BitField<OpenXRInterface::HandJointFlags> bits;
BitField<OpenXRInterface::HandJointFlags> bits = HAND_JOINT_NONE;
OpenXRHandTrackingExtension *hand_tracking_ext = OpenXRHandTrackingExtension::get_singleton();
if (hand_tracking_ext && hand_tracking_ext->get_active()) {