Merge pull request #1557 from Azaezel/alpha41/firmerFilter

reinforce dsq or dts filter
This commit is contained in:
Brian Roberts 2025-09-23 08:51:45 -05:00 committed by GitHub
commit e3e5fc3d0f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 24 additions and 20 deletions

View file

@ -985,14 +985,6 @@ TSShape* assimpLoadShape(const Torque::Path &path)
TSShapeLoader::updateProgress(TSShapeLoader::Load_Complete, "Import complete");
Con::printf("[ASSIMP] Shape created successfully.");
// Cache the model to a DTS file for faster loading next time.
FileStream dtsStream;
if (dtsStream.open(cachedPath.getFullPath(), Torque::FS::File::Write))
{
Con::printf("Writing cached shape to %s", cachedPath.getFullPath().c_str());
tss->write(&dtsStream);
}
if (tss->meshes.empty())
{
Torque::Path dsqPath(cachedPath);
@ -1012,6 +1004,16 @@ TSShape* assimpLoadShape(const Torque::Path &path)
}
}
else
{
// Cache the model to a DTS file for faster loading next time.
FileStream dtsStream;
if (dtsStream.open(cachedPath.getFullPath(), Torque::FS::File::Write))
{
Con::printf("Writing cached shape to %s", cachedPath.getFullPath().c_str());
tss->write(&dtsStream);
}
}
loader.updateMaterialsScript(path);
}

View file

@ -724,18 +724,6 @@ TSShape* loadColladaShape(const Torque::Path &path)
if (tss)
{
#ifndef DAE2DTS_TOOL
// Cache the Collada model to a DTS file for faster loading next time.
FileStream dtsStream;
if (dtsStream.open(cachedPath.getFullPath(), Torque::FS::File::Write))
{
Torque::FS::FileSystemRef ref = Torque::FS::GetFileSystem(daePath);
if (ref && !String::compare("Zip", ref->getTypeStr().c_str()))
Con::errorf("No cached dts file found in archive for %s. Forcing cache to disk.", daePath.getFullFileName().c_str());
Con::printf("Writing cached COLLADA shape to %s", cachedPath.getFullPath().c_str());
tss->write(&dtsStream);
}
if (tss->meshes.empty())
{
@ -756,6 +744,20 @@ TSShape* loadColladaShape(const Torque::Path &path)
}
}
else
{
// Cache the Collada model to a DTS file for faster loading next time.
FileStream dtsStream;
if (dtsStream.open(cachedPath.getFullPath(), Torque::FS::File::Write))
{
Torque::FS::FileSystemRef ref = Torque::FS::GetFileSystem(daePath);
if (ref && !String::compare("Zip", ref->getTypeStr().c_str()))
Con::errorf("No cached dts file found in archive for %s. Forcing cache to disk.", daePath.getFullFileName().c_str());
Con::printf("Writing cached COLLADA shape to %s", cachedPath.getFullPath().c_str());
tss->write(&dtsStream);
}
}
#endif // DAE2DTS_TOOL
// Add collada materials to materials.tscript