mirror of
https://github.com/HarbourMasters/Shipwright.git
synced 2024-11-21 08:55:04 -05:00
Use path xml parser & fix empty dl references (#4217)
This commit is contained in:
parent
6d8480c16a
commit
6d71eb3867
@ -369,6 +369,7 @@ OTRGlobals::OTRGlobals() {
|
||||
loader->RegisterResourceFactory(std::make_shared<SOH::ResourceFactoryBinarySkeletonLimbV0>(), RESOURCE_FORMAT_BINARY, "SkeletonLimb", static_cast<uint32_t>(SOH::ResourceType::SOH_SkeletonLimb), 0);
|
||||
loader->RegisterResourceFactory(std::make_shared<SOH::ResourceFactoryXMLSkeletonLimbV0>(), RESOURCE_FORMAT_XML, "SkeletonLimb", static_cast<uint32_t>(SOH::ResourceType::SOH_SkeletonLimb), 0);
|
||||
loader->RegisterResourceFactory(std::make_shared<SOH::ResourceFactoryBinaryPathV0>(), RESOURCE_FORMAT_BINARY, "Path", static_cast<uint32_t>(SOH::ResourceType::SOH_Path), 0);
|
||||
loader->RegisterResourceFactory(std::make_shared<SOH::ResourceFactoryXMLPathV0>(), RESOURCE_FORMAT_XML, "Path", static_cast<uint32_t>(SOH::ResourceType::SOH_Path), 0);
|
||||
loader->RegisterResourceFactory(std::make_shared<SOH::ResourceFactoryBinaryCutsceneV0>(), RESOURCE_FORMAT_BINARY, "Cutscene", static_cast<uint32_t>(SOH::ResourceType::SOH_Cutscene), 0);
|
||||
loader->RegisterResourceFactory(std::make_shared<SOH::ResourceFactoryBinaryTextV0>(), RESOURCE_FORMAT_BINARY, "Text", static_cast<uint32_t>(SOH::ResourceType::SOH_Text), 0);
|
||||
loader->RegisterResourceFactory(std::make_shared<SOH::ResourceFactoryXMLTextV0>(), RESOURCE_FORMAT_XML, "Text", static_cast<uint32_t>(SOH::ResourceType::SOH_Text), 0);
|
||||
|
@ -198,11 +198,19 @@ std::shared_ptr<Ship::IResource> SetMeshFactoryXML::ReadResource(std::shared_ptr
|
||||
int32_t polyType = child->IntAttribute("PolyType"); // Unused
|
||||
std::string meshOpa = child->Attribute("MeshOpa");
|
||||
std::string meshXlu = child->Attribute("MeshXlu");
|
||||
|
||||
if (meshOpa != "") {
|
||||
auto opaRes = Ship::Context::GetInstance()->GetResourceManager()->LoadResourceProcess(meshOpa.c_str());
|
||||
dlist.opa = (Gfx*)(opaRes ? opaRes->GetRawPointer() : nullptr);
|
||||
} else {
|
||||
dlist.opa = 0;
|
||||
}
|
||||
|
||||
if (meshXlu != "") {
|
||||
auto xluRes = Ship::Context::GetInstance()->GetResourceManager()->LoadResourceProcess(meshXlu.c_str());
|
||||
dlist.opa = meshOpa != "" ? (Gfx*)(opaRes ? opaRes->GetRawPointer() : nullptr) : 0;
|
||||
dlist.xlu = meshXlu != "" ? (Gfx*)(xluRes ? xluRes->GetRawPointer() : nullptr) : 0;
|
||||
dlist.xlu = (Gfx*)(xluRes ? xluRes->GetRawPointer() : nullptr);
|
||||
} else {
|
||||
dlist.xlu = 0;
|
||||
}
|
||||
|
||||
setMesh->opaPaths.push_back(meshOpa);
|
||||
setMesh->xluPaths.push_back(meshXlu);
|
||||
|
Loading…
Reference in New Issue
Block a user