mirror of
https://github.com/HarbourMasters/Shipwright.git
synced 2024-11-25 02:42:18 -05:00
Stop hardcoding skeleton type to flex (#3397)
This commit is contained in:
parent
4e9040d761
commit
bf31f2b330
@ -103,38 +103,42 @@ void SkeletonFactoryV0::ParseFileXML(tinyxml2::XMLElement* reader, std::shared_p
|
||||
{
|
||||
std::shared_ptr<Skeleton> skel = std::static_pointer_cast<Skeleton>(resource);
|
||||
|
||||
std::string skeletonType = reader->Attribute("Type");
|
||||
// std::string skeletonLimbType = reader->Attribute("LimbType");
|
||||
int numLimbs = reader->IntAttribute("LimbCount");
|
||||
int numDLs = reader->IntAttribute("DisplayListCount");
|
||||
skel->type = SkeletonType::Flex; // Default to Flex for legacy reasons
|
||||
if (reader->FindAttribute("Type")) {
|
||||
std::string skeletonType = reader->Attribute("Type");
|
||||
|
||||
if (skeletonType == "Flex") {
|
||||
skel->type = SkeletonType::Flex;
|
||||
} else if (skeletonType == "Curve") {
|
||||
skel->type = SkeletonType::Curve;
|
||||
} else if (skeletonType == "Normal") {
|
||||
skel->type = SkeletonType::Normal;
|
||||
if (skeletonType == "Flex") {
|
||||
skel->type = SkeletonType::Flex;
|
||||
} else if (skeletonType == "Curve") {
|
||||
skel->type = SkeletonType::Curve;
|
||||
} else if (skeletonType == "Normal") {
|
||||
skel->type = SkeletonType::Normal;
|
||||
}
|
||||
}
|
||||
|
||||
skel->type = SkeletonType::Flex;
|
||||
skel->limbType = LimbType::LOD;
|
||||
skel->limbType = LimbType::LOD; // Default to LOD for legacy reasons
|
||||
if (reader->FindAttribute("LimbType")) {
|
||||
std::string skeletonLimbType = reader->Attribute("LimbType");
|
||||
|
||||
// if (skeletonLimbType == "Standard")
|
||||
// skel->limbType = LimbType::Standard;
|
||||
// else if (skeletonLimbType == "LOD")
|
||||
// skel->limbType = LimbType::LOD;
|
||||
// else if (skeletonLimbType == "Curve")
|
||||
// skel->limbType = LimbType::Curve;
|
||||
// else if (skeletonLimbType == "Skin")
|
||||
// skel->limbType = LimbType::Skin;
|
||||
// else if (skeletonLimbType == "Legacy")
|
||||
// Sskel->limbType = LimbType::Legacy;
|
||||
if (skeletonLimbType == "Standard") {
|
||||
skel->limbType = LimbType::Standard;
|
||||
} else if (skeletonLimbType == "LOD") {
|
||||
skel->limbType = LimbType::LOD;
|
||||
} else if (skeletonLimbType == "Curve") {
|
||||
skel->limbType = LimbType::Curve;
|
||||
} else if (skeletonLimbType == "Skin") {
|
||||
skel->limbType = LimbType::Skin;
|
||||
} else if (skeletonLimbType == "Legacy") {
|
||||
skel->limbType = LimbType::Legacy;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
skel->limbCount = reader->IntAttribute("LimbCount");
|
||||
skel->dListCount = reader->IntAttribute("DisplayListCount");
|
||||
|
||||
auto child = reader->FirstChildElement();
|
||||
|
||||
skel->limbCount = numLimbs;
|
||||
skel->dListCount = numDLs;
|
||||
|
||||
while (child != nullptr) {
|
||||
std::string childName = child->Name();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user