mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-04-21 12:25:30 +00:00
Better handling for finding modules by file path. Mainly used in asset importer
This commit is contained in:
parent
80eb4ab2ba
commit
e8564680e4
4 changed files with 60 additions and 10 deletions
|
|
@ -666,18 +666,13 @@ AssetImportObject* AssetImporter::findImportingAssetByName(String assetName, Ass
|
|||
|
||||
ModuleDefinition* AssetImporter::getModuleFromPath(Torque::Path filePath)
|
||||
{
|
||||
U32 folderCount = StringUnit::getUnitCount(filePath.getPath().c_str(), "/");
|
||||
//We want to ensure it's a full filepath, because the module system internally uses full paths for the module dirs
|
||||
char fullPath[2048];
|
||||
Platform::makeFullPathName(filePath.getFullPath().c_str(), fullPath, sizeof(fullPath));
|
||||
|
||||
for (U32 i = 0; i < folderCount; i++)
|
||||
{
|
||||
String folderName = StringUnit::getUnit(filePath.getPath().c_str(), i, "/");
|
||||
ModuleDefinition* moduleDef = ModuleDatabase.findModuleByFilePath(StringTable->insert(fullPath));
|
||||
|
||||
ModuleDefinition* moduleDef = ModuleDatabase.findModule(folderName.c_str(), 1);
|
||||
if (moduleDef != nullptr)
|
||||
return moduleDef;
|
||||
}
|
||||
|
||||
return nullptr;
|
||||
return moduleDef;
|
||||
}
|
||||
|
||||
String AssetImporter::parseImageSuffixes(String assetName, String* suffixType)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue