Skip to content

Commit

Permalink
🧹 'slidenodes' flags
Browse files Browse the repository at this point in the history
See "CODING GUIDELINES (CLEANUP IN PROGRESS)" on top of RigDef_File.h
  • Loading branch information
ohlidalp authored and Petr Ohlídal committed May 28, 2022
1 parent 1449ef1 commit 73a7c7a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
10 changes: 5 additions & 5 deletions source/main/resources/rig_def_fileformat/RigDef_File.h
Original file line number Diff line number Diff line change
Expand Up @@ -1826,14 +1826,14 @@ struct Screwprop

struct SlideNode
{
BITMASK_PROPERTY( constraint_flags, 1, CONSTRAINT_ATTACH_ALL , HasConstraint_a_AttachAll , SetConstraint_a_AttachAll )
BITMASK_PROPERTY( constraint_flags, 2, CONSTRAINT_ATTACH_FOREIGN , HasConstraint_f_AttachForeign , SetConstraint_f_AttachForeign )
BITMASK_PROPERTY( constraint_flags, 3, CONSTRAINT_ATTACH_SELF , HasConstraint_s_AttachSelf , SetConstraint_s_AttachSelf )
BITMASK_PROPERTY( constraint_flags, 4, CONSTRAINT_ATTACH_NONE , HasConstraint_n_AttachNone , SetConstraint_n_AttachNone )
static const BitMask_t CONSTRAINT_ATTACH_ALL = BITMASK(1);
static const BitMask_t CONSTRAINT_ATTACH_FOREIGN = BITMASK(2);
static const BitMask_t CONSTRAINT_ATTACH_SELF = BITMASK(3);
static const BitMask_t CONSTRAINT_ATTACH_NONE = BITMASK(4);

Node::Ref slide_node;
std::vector<Node::Range> rail_node_ranges;
unsigned int constraint_flags;
BitMask_t constraint_flags = 0;

// Optional args
float spring_rate=0.f; bool _spring_rate_set=false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1123,10 +1123,10 @@ void Serializer::ProcessSlideNodes(File::Module* module)
if (def._max_attach_dist_set) { m_stream << ", d" << def.max_attach_dist; }

// Constraint flags (cX)
if (def.HasConstraint_a_AttachAll()) { m_stream << ", ca"; }
else if (def.HasConstraint_f_AttachForeign()) { m_stream << ", cf"; }
else if (def.HasConstraint_s_AttachSelf()) { m_stream << ", cs"; }
else if (def.HasConstraint_n_AttachNone()) { m_stream << ", cn"; }
if (BITMASK_IS_1(def.constraint_flags, SlideNode::CONSTRAINT_ATTACH_ALL )) { m_stream << ", ca"; }
else if (BITMASK_IS_1(def.constraint_flags, SlideNode::CONSTRAINT_ATTACH_FOREIGN)) { m_stream << ", cf"; }
else if (BITMASK_IS_1(def.constraint_flags, SlideNode::CONSTRAINT_ATTACH_SELF )) { m_stream << ", cs"; }
else if (BITMASK_IS_1(def.constraint_flags, SlideNode::CONSTRAINT_ATTACH_NONE )) { m_stream << ", cn"; }
}
m_stream << endl << endl; // Empty line
}
Expand Down

0 comments on commit 73a7c7a

Please # to comment.