mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-07-16 00:54:54 +00:00
Update assetManager.cpp
load compiled binary if it exists and is newer than the asset file
This commit is contained in:
parent
48680700ab
commit
e1bcced905
1 changed files with 118 additions and 103 deletions
|
|
@ -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();
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue