Changeset View
Changeset View
Standalone View
Standalone View
ps/trunk/source/graphics/ObjectBase.cpp
Show First 20 Lines • Show All 189 Lines • ▼ Show 20 Lines | bool CObjectBase::LoadVariant(const CXeromyces& XeroFile, const XMBElement& variant, Variant& currentVariant) | ||||
AT(sound); | AT(sound); | ||||
AT(speed); | AT(speed); | ||||
AT(width); | AT(width); | ||||
#undef AT | #undef AT | ||||
#undef EL | #undef EL | ||||
if (variant.GetNodeName() != el_variant) | if (variant.GetNodeName() != el_variant) | ||||
{ | { | ||||
LOGERROR("Invalid variant format (unrecognised root element '%s')", XeroFile.GetElementString(variant.GetNodeName()).c_str()); | LOGERROR("Invalid variant format (unrecognised root element '%s')", XeroFile.GetElementString(variant.GetNodeName())); | ||||
return false; | return false; | ||||
} | } | ||||
// Load variants first, so that they can be overriden if necessary. | // Load variants first, so that they can be overriden if necessary. | ||||
XERO_ITER_ATTR(variant, attr) | XERO_ITER_ATTR(variant, attr) | ||||
{ | { | ||||
if (attr.Name == at_file) | if (attr.Name == at_file) | ||||
{ | { | ||||
▲ Show 20 Lines • Show All 609 Lines • ▼ Show 20 Lines | |||||
#undef AT | #undef AT | ||||
#undef EL | #undef EL | ||||
XMBElement root = XeroFile.GetRoot(); | XMBElement root = XeroFile.GetRoot(); | ||||
if (root.GetNodeName() != el_actor && root.GetNodeName() != el_qualitylevels) | if (root.GetNodeName() != el_actor && root.GetNodeName() != el_qualitylevels) | ||||
{ | { | ||||
LOGERROR("Invalid actor format (actor '%s', unrecognised root element '%s')", | LOGERROR("Invalid actor format (actor '%s', unrecognised root element '%s')", | ||||
pathname.string8().c_str(), XeroFile.GetElementString(root.GetNodeName()).c_str()); | pathname.string8().c_str(), XeroFile.GetElementString(root.GetNodeName())); | ||||
return false; | return false; | ||||
} | } | ||||
m_Pathname = pathname; | m_Pathname = pathname; | ||||
if (root.GetNodeName() == el_actor) | if (root.GetNodeName() == el_actor) | ||||
{ | { | ||||
std::unique_ptr<CObjectBase> base = std::make_unique<CObjectBase>(m_ObjectManager, *this, MAX_QUALITY); | std::unique_ptr<CObjectBase> base = std::make_unique<CObjectBase>(m_ObjectManager, *this, MAX_QUALITY); | ||||
▲ Show 20 Lines • Show All 165 Lines • Show Last 20 Lines |
Wildfire Games · Phabricator