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::string Name;
|
||||||
std::unordered_map<std::string, Field_t> Fields;
|
std::unordered_map<std::string, Field_t> Fields;
|
||||||
|
std::vector<const Field_t*> FieldsInOrder;
|
||||||
Meta_t Meta;
|
Meta_t Meta;
|
||||||
std::shared_ptr<char> Defaults = nullptr;
|
std::shared_ptr<char> Defaults = nullptr;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -143,9 +143,11 @@ void EntityFilePreprocessor::parseComponentInfo()
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
compInfo.Fields[name].Type = type;
|
auto& field = compInfo.Fields[name];
|
||||||
compInfo.Fields[name].Offset = fieldOffset;
|
field.Type = type;
|
||||||
compInfo.Fields[name].Stride = stride;
|
field.Offset = fieldOffset;
|
||||||
|
field.Stride = stride;
|
||||||
|
compInfo.FieldsInOrder.push_back(&field);
|
||||||
|
|
||||||
fieldOffset += stride;
|
fieldOffset += stride;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user