|
@@ -332,6 +332,9 @@ void ImageAsset::initializeAsset(void)
|
|
Parent::initializeAsset();
|
|
Parent::initializeAsset();
|
|
|
|
|
|
// Ensure the image-file is expanded.
|
|
// Ensure the image-file is expanded.
|
|
|
|
+ if (isNamedTarget())
|
|
|
|
+ return;
|
|
|
|
+
|
|
mImageFile = expandAssetFilePath(mImageFile);
|
|
mImageFile = expandAssetFilePath(mImageFile);
|
|
}
|
|
}
|
|
|
|
|
|
@@ -378,6 +381,13 @@ void ImageAsset::setImageFile(StringTableEntry pImageFile)
|
|
if (mLoadedState == Ok)
|
|
if (mLoadedState == Ok)
|
|
Torque::FS::RemoveChangeNotification(mImageFile, this, &ImageAsset::_onFileChanged);
|
|
Torque::FS::RemoveChangeNotification(mImageFile, this, &ImageAsset::_onFileChanged);
|
|
|
|
|
|
|
|
+ if (String(pImageFile).startsWith("#"))
|
|
|
|
+ {
|
|
|
|
+ mImageFile = StringTable->insert(pImageFile);
|
|
|
|
+ refreshAsset();
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+
|
|
mImageFile = getOwned() ? expandAssetFilePath(pImageFile) : StringTable->insert(pImageFile);
|
|
mImageFile = getOwned() ? expandAssetFilePath(pImageFile) : StringTable->insert(pImageFile);
|
|
|
|
|
|
refreshAsset();
|
|
refreshAsset();
|
|
@@ -411,6 +421,12 @@ U32 ImageAsset::load()
|
|
|
|
|
|
if (!Torque::FS::IsFile(mImageFile))
|
|
if (!Torque::FS::IsFile(mImageFile))
|
|
{
|
|
{
|
|
|
|
+ if (isNamedTarget())
|
|
|
|
+ {
|
|
|
|
+ mLoadedState = Ok;
|
|
|
|
+ return mLoadedState;
|
|
|
|
+ }
|
|
|
|
+
|
|
Con::errorf("ImageAsset::initializeAsset: Attempted to load file %s but it was not valid!", mImageFile);
|
|
Con::errorf("ImageAsset::initializeAsset: Attempted to load file %s but it was not valid!", mImageFile);
|
|
mLoadedState = BadFileReference;
|
|
mLoadedState = BadFileReference;
|
|
return mLoadedState;
|
|
return mLoadedState;
|
|
@@ -428,6 +444,9 @@ GFXTexHandle ImageAsset::getTexture(GFXTextureProfile* requestedProfile)
|
|
{
|
|
{
|
|
load();
|
|
load();
|
|
|
|
|
|
|
|
+ if (isNamedTarget())
|
|
|
|
+ return getNamedTarget()->getTexture();
|
|
|
|
+
|
|
if (mLoadedState == Ok)
|
|
if (mLoadedState == Ok)
|
|
{
|
|
{
|
|
if (mResourceMap.contains(requestedProfile))
|
|
if (mResourceMap.contains(requestedProfile))
|
|
@@ -554,6 +573,9 @@ void ImageAsset::onTamlPreWrite(void)
|
|
// Call parent.
|
|
// Call parent.
|
|
Parent::onTamlPreWrite();
|
|
Parent::onTamlPreWrite();
|
|
|
|
|
|
|
|
+ if (isNamedTarget())
|
|
|
|
+ return;
|
|
|
|
+
|
|
// Ensure the image-file is collapsed.
|
|
// Ensure the image-file is collapsed.
|
|
mImageFile = getOwned() ? collapseAssetFilePath(mImageFile) : mImageFile;
|
|
mImageFile = getOwned() ? collapseAssetFilePath(mImageFile) : mImageFile;
|
|
}
|
|
}
|
|
@@ -563,6 +585,9 @@ void ImageAsset::onTamlPostWrite(void)
|
|
// Call parent.
|
|
// Call parent.
|
|
Parent::onTamlPostWrite();
|
|
Parent::onTamlPostWrite();
|
|
|
|
|
|
|
|
+ if (isNamedTarget())
|
|
|
|
+ return;
|
|
|
|
+
|
|
// Ensure the image-file is expanded.
|
|
// Ensure the image-file is expanded.
|
|
mImageFile = getOwned() ? expandAssetFilePath(mImageFile) : mImageFile;
|
|
mImageFile = getOwned() ? expandAssetFilePath(mImageFile) : mImageFile;
|
|
}
|
|
}
|