mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-07-15 16:44:36 +00:00
Update assetImporter.cpp
asset importing for images shouldnt execute a file copy, original file path is enough as it is relative to exe
This commit is contained in:
parent
fc9f221ac0
commit
67f217ada1
1 changed files with 2 additions and 25 deletions
|
|
@ -2829,25 +2829,14 @@ Torque::Path AssetImporter::importImageAsset(AssetImportObject* assetItem)
|
||||||
String tamlPath = targetPath + "/" + assetName + ".asset.taml";
|
String tamlPath = targetPath + "/" + assetName + ".asset.taml";
|
||||||
String originalPath = assetItem->filePath.getFullPath().c_str();
|
String originalPath = assetItem->filePath.getFullPath().c_str();
|
||||||
|
|
||||||
char qualifiedFromFile[2048];
|
|
||||||
char qualifiedToFile[2048];
|
|
||||||
|
|
||||||
#ifndef TORQUE_SECURE_VFS
|
|
||||||
Platform::makeFullPathName(originalPath.c_str(), qualifiedFromFile, sizeof(qualifiedFromFile));
|
|
||||||
Platform::makeFullPathName(assetPath.c_str(), qualifiedToFile, sizeof(qualifiedToFile));
|
|
||||||
#else
|
|
||||||
dStrcpy(qualifiedFromFile, originalPath.c_str(), sizeof(qualifiedFromFile));
|
|
||||||
dStrcpy(qualifiedToFile, assetPath.c_str(), sizeof(qualifiedToFile));
|
|
||||||
#endif
|
|
||||||
|
|
||||||
newAsset->setAssetName(assetName);
|
newAsset->setAssetName(assetName);
|
||||||
newAsset->setImageFile(assetPath.c_str());
|
newAsset->setImageFile(assetPath.c_str());
|
||||||
|
|
||||||
//If it's not a re-import, check that the file isn't being in-place imported. If it isn't, store off the original
|
//If it's not a re-import, check that the file isn't being in-place imported. If it isn't, store off the original
|
||||||
//file path for reimporting support later
|
//file path for reimporting support later
|
||||||
if (!isReimport && String::compare(qualifiedFromFile, qualifiedToFile) && Torque::FS::IsFile(qualifiedFromFile))
|
if (!isReimport)
|
||||||
{
|
{
|
||||||
newAsset->setDataField(StringTable->insert("originalFilePath"), nullptr, qualifiedFromFile);
|
newAsset->setDataField(StringTable->insert("originalFilePath"), nullptr, originalPath.c_str());
|
||||||
}
|
}
|
||||||
|
|
||||||
if (assetItem->typeHint != String::EmptyString)
|
if (assetItem->typeHint != String::EmptyString)
|
||||||
|
|
@ -2870,18 +2859,6 @@ Torque::Path AssetImporter::importImageAsset(AssetImportObject* assetItem)
|
||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!isReimport)
|
|
||||||
{
|
|
||||||
bool isInPlace = !String::compare(qualifiedFromFile, qualifiedToFile);
|
|
||||||
|
|
||||||
if (!isInPlace && !Torque::FS::CopyFile(qualifiedFromFile, qualifiedToFile, !isReimport))
|
|
||||||
{
|
|
||||||
dSprintf(importLogBuffer, sizeof(importLogBuffer), "Error! Unable to copy file %s", assetItem->filePath.getFullPath().c_str());
|
|
||||||
activityLog.push_back(importLogBuffer);
|
|
||||||
return "";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return tamlPath;
|
return tamlPath;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue