Update assetManager.cpp

load compiled binary if it exists and is newer than the asset file
This commit is contained in:
marauder2k7 2025-10-12 17:51:05 +01:00
parent 48680700ab
commit e1bcced905

View file

@ -2697,6 +2697,21 @@ bool AssetManager::scanDeclaredAssets( const char* pPath, const char* pExtension
{ {
Torque::Path assetPath = files[i]; Torque::Path assetPath = files[i];
Torque::Path compiledPath = assetPath;
compiledPath.setExtension(mTaml.getAutoFormatBinaryExtension());
if (Torque::FS::IsFile(compiledPath))
{
Torque::FS::FileNodeRef assetFile = Torque::FS::GetFileNode(assetPath);
Torque::FS::FileNodeRef compiledFile = Torque::FS::GetFileNode(compiledPath);
if (assetFile != NULL && compiledFile != NULL)
{
if (compiledFile->getModifiedTime() >= assetFile->getModifiedTime())
assetPath = compiledPath;
}
}
// Clear declared assets. // Clear declared assets.
assetDeclaredVisitor.clear(); assetDeclaredVisitor.clear();