|
|
|
|
@ -96,15 +96,15 @@ namespace lunarium { namespace editor
|
|
|
|
|
|
|
|
|
|
mNextID = ID.attribute("ID").as_ullong();
|
|
|
|
|
|
|
|
|
|
pugi::xml_node content = proj_node.child("Content");
|
|
|
|
|
pugi::xml_node contents = proj_node.child("Contents");
|
|
|
|
|
|
|
|
|
|
if (!content)
|
|
|
|
|
if (!contents)
|
|
|
|
|
{
|
|
|
|
|
return OpRes::Fail("content_meta.xml missing Content node");
|
|
|
|
|
return OpRes::Fail("content_meta.xml missing Contents node");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Iterate through content
|
|
|
|
|
for (pugi::xml_node asset = content.child("Asset"); asset; asset = asset.next_sibling("Asset"))
|
|
|
|
|
for (pugi::xml_node asset = contents.child("Asset"); asset; asset = asset.next_sibling("Asset"))
|
|
|
|
|
{
|
|
|
|
|
if (!IsValidAsset(asset))
|
|
|
|
|
{
|
|
|
|
|
@ -134,7 +134,7 @@ namespace lunarium { namespace editor
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Store asset
|
|
|
|
|
if (mAssets.find(pAsset->mID) == mAssets.end())
|
|
|
|
|
if (mAssets.find(pAsset->mID) != mAssets.end())
|
|
|
|
|
{
|
|
|
|
|
return OpRes::Fail("Asset ID collision, ID: %llu, File: %s",
|
|
|
|
|
pAsset->GetID(), pAsset->GetFileLocation().filename().string().c_str());
|
|
|
|
|
@ -283,9 +283,9 @@ namespace lunarium { namespace editor
|
|
|
|
|
|
|
|
|
|
bool ContentManager::IsValidAsset(pugi::xml_node& node)
|
|
|
|
|
{
|
|
|
|
|
if (!node.child("ID")) { return false; }
|
|
|
|
|
if (!node.child("Type")) { return false; }
|
|
|
|
|
if (!node.child("Location")) { return false; }
|
|
|
|
|
if (!node.attribute("ID")) { return false; }
|
|
|
|
|
if (!node.attribute("Type")) { return false; }
|
|
|
|
|
if (!node.attribute("Location")) { return false; }
|
|
|
|
|
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|