mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-02-13 11:43:49 +00:00
final rev
add safeties to getters getTextureBitmap/ functions to return member variable that is collected when the image is set
This commit is contained in:
parent
6eac6d767b
commit
b707b2e2b7
2 changed files with 16 additions and 6 deletions
|
|
@ -153,6 +153,7 @@ ImageAsset::ImageAsset() :
|
|||
mIsNamedTarget(false),
|
||||
mImageWidth(-1),
|
||||
mImageHeight(-1),
|
||||
mImageDepth(-1),
|
||||
mImageChannels(-1)
|
||||
{
|
||||
mLoadedState = AssetErrCode::NotLoaded;
|
||||
|
|
@ -423,6 +424,9 @@ void ImageAsset::setImageFile(StringTableEntry pImageFile)
|
|||
Con::errorf("ImageAsset::setImageFile STB Get file info failed: %s", stbErr);
|
||||
}
|
||||
}
|
||||
|
||||
// we only support 2d textures..... for no ;)
|
||||
mImageDepth = 1;
|
||||
}
|
||||
|
||||
refreshAsset();
|
||||
|
|
@ -643,6 +647,7 @@ void ImageAsset::onTamlCustomWrite(TamlCustomNodes& customNodes)
|
|||
|
||||
pImageInfoNode->addField(StringTable->insert("ImageWidth"), mImageWidth);
|
||||
pImageInfoNode->addField(StringTable->insert("ImageHeight"), mImageHeight);
|
||||
pImageInfoNode->addField(StringTable->insert("ImageDepth"), mImageDepth);
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -676,6 +681,10 @@ void ImageAsset::onTamlCustomRead(const TamlCustomNodes& customNodes)
|
|||
{
|
||||
pField->getFieldValue(mImageHeight);
|
||||
}
|
||||
else if (fieldName == StringTable->insert("ImageDepth"))
|
||||
{
|
||||
pField->getFieldValue(mImageDepth);
|
||||
}
|
||||
else
|
||||
{
|
||||
// Unknown name so warn.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue