mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-07-13 07:34:45 +00:00
Adds test shapes of Kork and SpaceOrc
Sidestep of memleak from CSF at the moment Minor fixes and corrections with asset importing and loose files WIP of updated options menu
This commit is contained in:
parent
6eb997c449
commit
6073bc5551
41 changed files with 804 additions and 193 deletions
|
|
@ -149,12 +149,12 @@ void ImageAsset::loadImage()
|
|||
|
||||
void ImageAsset::initializeAsset()
|
||||
{
|
||||
loadImage();
|
||||
setImageFileName(mImageFileName);
|
||||
}
|
||||
|
||||
void ImageAsset::onAssetRefresh()
|
||||
{
|
||||
loadImage();
|
||||
setImageFileName(mImageFileName);
|
||||
}
|
||||
|
||||
void ImageAsset::setImageFileName(const char* pScriptFile)
|
||||
|
|
@ -162,16 +162,16 @@ void ImageAsset::setImageFileName(const char* pScriptFile)
|
|||
// Sanity!
|
||||
AssertFatal(pScriptFile != NULL, "Cannot use a NULL image file.");
|
||||
|
||||
// Fetch image file.
|
||||
pScriptFile = StringTable->insert(pScriptFile);
|
||||
|
||||
// Ignore no change,
|
||||
if (pScriptFile == mImageFileName)
|
||||
return;
|
||||
|
||||
// Update.
|
||||
mImageFileName = getOwned() ? expandAssetFilePath(pScriptFile) : StringTable->insert(pScriptFile);
|
||||
|
||||
// Refresh the asset.
|
||||
refreshAsset();
|
||||
loadImage();
|
||||
}
|
||||
|
||||
DefineEngineMethod(ImageAsset, getImageFilename, const char*, (), ,
|
||||
"Creates an instance of the given GameObject given the asset definition.\n"
|
||||
"@return The GameObject entity created from the asset.")
|
||||
{
|
||||
return object->getImageFileName();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -71,7 +71,7 @@ public:
|
|||
|
||||
bool isValid() { return mIsValidImage; }
|
||||
|
||||
GFXTexHandle* getImage() { return &mImage; }
|
||||
GFXTexHandle getImage() { return mImage; }
|
||||
|
||||
protected:
|
||||
virtual void initializeAsset(void);
|
||||
|
|
|
|||
|
|
@ -121,12 +121,17 @@ void MaterialAsset::initializeAsset()
|
|||
|
||||
compileShader();
|
||||
|
||||
if (!Platform::isFullPath(mScriptFile))
|
||||
mScriptFile = getOwned() ? expandAssetFilePath(mScriptFile) : mScriptFile;
|
||||
|
||||
if (Platform::isFile(mScriptFile))
|
||||
Con::executeFile(mScriptFile, false, false);
|
||||
}
|
||||
|
||||
void MaterialAsset::onAssetRefresh()
|
||||
{
|
||||
mScriptFile = expandAssetFilePath(mScriptFile);
|
||||
|
||||
if (Platform::isFile(mScriptFile))
|
||||
Con::executeFile(mScriptFile, false, false);
|
||||
|
||||
|
|
@ -151,12 +156,8 @@ void MaterialAsset::setScriptFile(const char* pScriptFile)
|
|||
// Fetch image file.
|
||||
pScriptFile = StringTable->insert(pScriptFile);
|
||||
|
||||
// Ignore no change,
|
||||
if (pScriptFile == mScriptFile)
|
||||
return;
|
||||
|
||||
// Update.
|
||||
mScriptFile = getOwned() ? expandAssetFilePath(pScriptFile) : StringTable->insert(pScriptFile);
|
||||
mScriptFile = getOwned() ? expandAssetFilePath(pScriptFile) : pScriptFile;
|
||||
|
||||
// Refresh the asset.
|
||||
refreshAsset();
|
||||
|
|
|
|||
|
|
@ -944,7 +944,12 @@ void GroundCover::_initialize( U32 cellCount, U32 cellPlacementCount )
|
|||
Material* mat = dynamic_cast<Material*>(mMatInst->getMaterial());
|
||||
if(mat)
|
||||
{
|
||||
GFXTexHandle tex(mat->mDiffuseMapFilename[0], &GFXStaticTextureSRGBProfile, "GroundCover texture aspect ratio check" );
|
||||
GFXTexHandle tex;
|
||||
if (!mat->mDiffuseMapFilename[0].isEmpty())
|
||||
tex = GFXTexHandle(mat->mDiffuseMapFilename[0], &GFXStaticTextureSRGBProfile, "GroundCover texture aspect ratio check");
|
||||
else if (!mat->mDiffuseMapAsset[0].isNull())
|
||||
tex = mat->mDiffuseMapAsset[0]->getImage();
|
||||
|
||||
if(tex.isValid())
|
||||
{
|
||||
U32 w = tex.getWidth();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue