Added ComponentInfo::FieldsInOrder to be able to loop through component fields in a consistent order based on the component XSD definition
This commit is contained in:
@@ -21,6 +21,7 @@ struct ComponentInfo
|
||||
|
||||
std::string Name;
|
||||
std::unordered_map<std::string, Field_t> Fields;
|
||||
std::vector<const Field_t*> FieldsInOrder;
|
||||
Meta_t Meta;
|
||||
std::shared_ptr<char> Defaults = nullptr;
|
||||
};
|
||||
|
||||
@@ -143,9 +143,11 @@ void EntityFilePreprocessor::parseComponentInfo()
|
||||
continue;
|
||||
}
|
||||
|
||||
compInfo.Fields[name].Type = type;
|
||||
compInfo.Fields[name].Offset = fieldOffset;
|
||||
compInfo.Fields[name].Stride = stride;
|
||||
auto& field = compInfo.Fields[name];
|
||||
field.Type = type;
|
||||
field.Offset = fieldOffset;
|
||||
field.Stride = stride;
|
||||
compInfo.FieldsInOrder.push_back(&field);
|
||||
|
||||
fieldOffset += stride;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user