mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-07-14 16:14:38 +00:00
leverage isScriptFile
(also initialize scattersky. mNightCubemapName = StringTable->EmptyString();)
This commit is contained in:
parent
c41b8e00ff
commit
f185bef8a3
9 changed files with 18 additions and 17 deletions
|
|
@ -136,7 +136,7 @@ void CubemapAsset::initializeAsset()
|
||||||
{
|
{
|
||||||
mScriptFile = expandAssetFilePath(mScriptFile);
|
mScriptFile = expandAssetFilePath(mScriptFile);
|
||||||
|
|
||||||
if(Platform::isFile(mScriptFile))
|
if(Platform::isScriptFile(mScriptFile))
|
||||||
Con::executeFile(mScriptFile, false, false);
|
Con::executeFile(mScriptFile, false, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -144,7 +144,7 @@ void CubemapAsset::onAssetRefresh()
|
||||||
{
|
{
|
||||||
mScriptFile = expandAssetFilePath(mScriptFile);
|
mScriptFile = expandAssetFilePath(mScriptFile);
|
||||||
|
|
||||||
if (Platform::isFile(mScriptFile))
|
if (Platform::isScriptFile(mScriptFile))
|
||||||
Con::executeFile(mScriptFile, false, false);
|
Con::executeFile(mScriptFile, false, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -119,12 +119,12 @@ void GUIAsset::initializeAsset()
|
||||||
{
|
{
|
||||||
mGUIPath = expandAssetFilePath(mGUIFile);
|
mGUIPath = expandAssetFilePath(mGUIFile);
|
||||||
|
|
||||||
if (Platform::isFile(mGUIPath))
|
if (Platform::isScriptFile(mGUIPath))
|
||||||
Con::executeFile(mGUIPath, false, false);
|
Con::executeFile(mGUIPath, false, false);
|
||||||
|
|
||||||
mScriptPath = expandAssetFilePath(mScriptFile);
|
mScriptPath = expandAssetFilePath(mScriptFile);
|
||||||
|
|
||||||
if (Platform::isFile(mScriptPath))
|
if (Platform::isScriptFile(mScriptPath))
|
||||||
Con::executeFile(mScriptPath, false, false);
|
Con::executeFile(mScriptPath, false, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -132,12 +132,12 @@ void GUIAsset::onAssetRefresh()
|
||||||
{
|
{
|
||||||
mGUIPath = expandAssetFilePath(mGUIFile);
|
mGUIPath = expandAssetFilePath(mGUIFile);
|
||||||
|
|
||||||
if (Platform::isFile(mGUIPath))
|
if (Platform::isScriptFile(mGUIPath))
|
||||||
Con::executeFile(mGUIPath, false, false);
|
Con::executeFile(mGUIPath, false, false);
|
||||||
|
|
||||||
mScriptPath = expandAssetFilePath(mScriptFile);
|
mScriptPath = expandAssetFilePath(mScriptFile);
|
||||||
|
|
||||||
if (Platform::isFile(mScriptPath))
|
if (Platform::isScriptFile(mScriptPath))
|
||||||
Con::executeFile(mScriptPath, false, false);
|
Con::executeFile(mScriptPath, false, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -133,7 +133,7 @@ void GameObjectAsset::initializeAsset()
|
||||||
//Ensure we have an expanded filepath
|
//Ensure we have an expanded filepath
|
||||||
mScriptPath = getOwned() ? expandAssetFilePath(mScriptFile) : mScriptPath;
|
mScriptPath = getOwned() ? expandAssetFilePath(mScriptFile) : mScriptPath;
|
||||||
|
|
||||||
if (Platform::isFile(mScriptPath))
|
if (Platform::isScriptFile(mScriptPath))
|
||||||
Con::executeFile(mScriptPath, false, false);
|
Con::executeFile(mScriptPath, false, false);
|
||||||
|
|
||||||
mTAMLPath = getOwned() ? expandAssetFilePath(mTAMLFile) : mTAMLPath;
|
mTAMLPath = getOwned() ? expandAssetFilePath(mTAMLFile) : mTAMLPath;
|
||||||
|
|
@ -144,7 +144,7 @@ void GameObjectAsset::onAssetRefresh()
|
||||||
//Ensure we have an expanded filepath
|
//Ensure we have an expanded filepath
|
||||||
mScriptPath = getOwned() ? expandAssetFilePath(mScriptFile) : mScriptPath;
|
mScriptPath = getOwned() ? expandAssetFilePath(mScriptFile) : mScriptPath;
|
||||||
|
|
||||||
if (Platform::isFile(mScriptPath))
|
if (Platform::isScriptFile(mScriptPath))
|
||||||
Con::executeFile(mScriptPath, false, false);
|
Con::executeFile(mScriptPath, false, false);
|
||||||
|
|
||||||
mTAMLPath = getOwned() ? expandAssetFilePath(mTAMLFile) : mTAMLPath;
|
mTAMLPath = getOwned() ? expandAssetFilePath(mTAMLFile) : mTAMLPath;
|
||||||
|
|
|
||||||
|
|
@ -166,7 +166,7 @@ void MaterialAsset::initializeAsset()
|
||||||
|
|
||||||
mScriptPath = getOwned() ? expandAssetFilePath(mScriptFile) : mScriptPath;
|
mScriptPath = getOwned() ? expandAssetFilePath(mScriptFile) : mScriptPath;
|
||||||
|
|
||||||
if (Platform::isFile(mScriptPath))
|
if (Platform::isScriptFile(mScriptPath))
|
||||||
Con::executeFile(mScriptPath, false, false);
|
Con::executeFile(mScriptPath, false, false);
|
||||||
|
|
||||||
loadMaterial();
|
loadMaterial();
|
||||||
|
|
@ -176,7 +176,7 @@ void MaterialAsset::onAssetRefresh()
|
||||||
{
|
{
|
||||||
mScriptPath = getOwned() ? expandAssetFilePath(mScriptFile) : mScriptPath;
|
mScriptPath = getOwned() ? expandAssetFilePath(mScriptFile) : mScriptPath;
|
||||||
|
|
||||||
if (Platform::isFile(mScriptPath))
|
if (Platform::isScriptFile(mScriptPath))
|
||||||
Con::executeFile(mScriptPath, false, false);
|
Con::executeFile(mScriptPath, false, false);
|
||||||
|
|
||||||
loadMaterial();
|
loadMaterial();
|
||||||
|
|
|
||||||
|
|
@ -211,7 +211,7 @@ public: \
|
||||||
Material* tempMat = nullptr;\
|
Material* tempMat = nullptr;\
|
||||||
\
|
\
|
||||||
if (!Sim::findObject(m##name##Asset->getMaterialDefinitionName(), tempMat))\
|
if (!Sim::findObject(m##name##Asset->getMaterialDefinitionName(), tempMat))\
|
||||||
Con::errorf("classname::_set##name() - Material %s was not found.", m##name##Asset->getMaterialDefinitionName());\
|
Con::errorf("%s::_set%s() - Material %s was not found.", macroText(className), macroText(name), m##name##Asset->getMaterialDefinitionName());\
|
||||||
m##name = tempMat;\
|
m##name = tempMat;\
|
||||||
}\
|
}\
|
||||||
else\
|
else\
|
||||||
|
|
|
||||||
|
|
@ -136,7 +136,7 @@ void PostEffectAsset::initializeAsset()
|
||||||
mHLSLShaderPath = expandAssetFilePath(mHLSLShaderFile);
|
mHLSLShaderPath = expandAssetFilePath(mHLSLShaderFile);
|
||||||
mGLSLShaderPath = expandAssetFilePath(mGLSLShaderFile);
|
mGLSLShaderPath = expandAssetFilePath(mGLSLShaderFile);
|
||||||
|
|
||||||
if (Platform::isFile(mScriptPath))
|
if (Platform::isScriptFile(mScriptPath))
|
||||||
Con::executeFile(mScriptPath, false, false);
|
Con::executeFile(mScriptPath, false, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -146,7 +146,7 @@ void PostEffectAsset::onAssetRefresh()
|
||||||
mHLSLShaderPath = expandAssetFilePath(mHLSLShaderFile);
|
mHLSLShaderPath = expandAssetFilePath(mHLSLShaderFile);
|
||||||
mGLSLShaderPath = expandAssetFilePath(mGLSLShaderFile);
|
mGLSLShaderPath = expandAssetFilePath(mGLSLShaderFile);
|
||||||
|
|
||||||
if (Platform::isFile(mScriptPath))
|
if (Platform::isScriptFile(mScriptPath))
|
||||||
Con::executeFile(mScriptPath, false, false);
|
Con::executeFile(mScriptPath, false, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -124,7 +124,7 @@ void ScriptAsset::initializeAsset()
|
||||||
{
|
{
|
||||||
mScriptPath = expandAssetFilePath(mScriptFile);
|
mScriptPath = expandAssetFilePath(mScriptFile);
|
||||||
|
|
||||||
if (Platform::isFile(mScriptPath))
|
if (Platform::isScriptFile(mScriptPath))
|
||||||
{
|
{
|
||||||
//We're initialized properly, so we'll go ahead and kick along any dependencies we may have as well
|
//We're initialized properly, so we'll go ahead and kick along any dependencies we may have as well
|
||||||
AssetManager::typeAssetDependsOnHash::Iterator assetDependenciesItr = mpOwningAssetManager->getDependedOnAssets()->find(mpAssetDefinition->mAssetId);
|
AssetManager::typeAssetDependsOnHash::Iterator assetDependenciesItr = mpOwningAssetManager->getDependedOnAssets()->find(mpAssetDefinition->mAssetId);
|
||||||
|
|
@ -152,7 +152,7 @@ void ScriptAsset::onAssetRefresh()
|
||||||
{
|
{
|
||||||
mScriptPath = expandAssetFilePath(mScriptFile);
|
mScriptPath = expandAssetFilePath(mScriptFile);
|
||||||
|
|
||||||
if (Platform::isFile(mScriptPath))
|
if (Platform::isScriptFile(mScriptPath))
|
||||||
{
|
{
|
||||||
//Refresh any dependencies we may have
|
//Refresh any dependencies we may have
|
||||||
for (U32 i = 0; i < mScriptAssets.size(); i++)
|
for (U32 i = 0; i < mScriptAssets.size(); i++)
|
||||||
|
|
@ -192,7 +192,7 @@ bool ScriptAsset::execScript()
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if (Platform::isFile(mScriptPath))
|
if (Platform::isScriptFile(mScriptPath))
|
||||||
{
|
{
|
||||||
return Con::executeFile(mScriptPath, false, false);
|
return Con::executeFile(mScriptPath, false, false);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -337,7 +337,7 @@ void Prefab::_loadFile( bool addFileNotify )
|
||||||
if ( mFilename == StringTable->EmptyString())
|
if ( mFilename == StringTable->EmptyString())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if ( !Platform::isFile( mFilename ) )
|
if ( !Platform::isScriptFile( mFilename ) )
|
||||||
{
|
{
|
||||||
Con::errorf( "Prefab::_loadFile() - file %s was not found.", mFilename );
|
Con::errorf( "Prefab::_loadFile() - file %s was not found.", mFilename );
|
||||||
return;
|
return;
|
||||||
|
|
|
||||||
|
|
@ -165,6 +165,7 @@ ScatterSky::ScatterSky()
|
||||||
mNightColor.set( 0.0196078f, 0.0117647f, 0.109804f, 1.0f );
|
mNightColor.set( 0.0196078f, 0.0117647f, 0.109804f, 1.0f );
|
||||||
mNightFogColor = mNightColor;
|
mNightFogColor = mNightColor;
|
||||||
mUseNightCubemap = false;
|
mUseNightCubemap = false;
|
||||||
|
mNightCubemapName = StringTable->EmptyString();
|
||||||
mSunSize = 1.0f;
|
mSunSize = 1.0f;
|
||||||
|
|
||||||
INIT_MATERIALASSET(MoonMat);
|
INIT_MATERIALASSET(MoonMat);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue