[IMaterial] Check if replacement was found

This commit is contained in:
momo5502 2017-04-15 22:50:20 +02:00
parent 360729120c
commit 0218c76a26

View File

@ -120,6 +120,9 @@ namespace Assets
header->material = asset; header->material = asset;
static thread_local bool replacementFound;
replacementFound = false;
// Find correct sortkey by comparing techsets // Find correct sortkey by comparing techsets
Game::DB_EnumXAssets_Internal(Game::XAssetType::ASSET_TYPE_MATERIAL, [](Game::XAssetHeader header, void* data) Game::DB_EnumXAssets_Internal(Game::XAssetType::ASSET_TYPE_MATERIAL, [](Game::XAssetHeader header, void* data)
{ {
@ -137,9 +140,16 @@ namespace Assets
std::memcpy(material->stateBitsEntry, header.material->stateBitsEntry, 48); std::memcpy(material->stateBitsEntry, header.material->stateBitsEntry, 48);
material->constantCount = header.material->constantCount; material->constantCount = header.material->constantCount;
material->constantTable = header.material->constantTable; material->constantTable = header.material->constantTable;
replacementFound = true;
} }
}, asset, false); }, asset, false);
if(!replacementFound)
{
Components::Logger::Print("No replacment found for material %s with technset %s\n", asset->name, asset->techniqueSet->name);
}
if (!reader.end()) if (!reader.end())
{ {
Components::Logger::Error("Material data left!"); Components::Logger::Error("Material data left!");