Merge branch 'development' of github.com:GarageGames/Torque3D

This commit is contained in:
Thomas "elfprince13" Dickerson 2017-03-07 20:08:17 -05:00
commit f7ce30f42c
2347 changed files with 296562 additions and 91 deletions

View file

@ -60,7 +60,7 @@ MODULE_END;
WindDeformationGLSL::WindDeformationGLSL()
: mDep( "shaders/common/gl/wind.glsl" )
: mDep(String(Con::getVariable("$Core::CommonShaderPath")) + String("/gl/wind.glsl" ))
{
addDependency( &mDep );
}

View file

@ -60,7 +60,7 @@ MODULE_END;
WindDeformationHLSL::WindDeformationHLSL()
: mDep( "shaders/common/wind.hlsl" )
: mDep(String(Con::getVariable("$Core::CommonShaderPath")) + String("/wind.hlsl" ))
{
addDependency( &mDep );
}

View file

@ -670,8 +670,8 @@ void GFXD3D11Device::setupGenericShaders(GenericShaderType type)
//shader model 4.0 is enough for the generic shaders
const char* shaderModel = "4.0";
shaderData = new ShaderData();
shaderData->setField("DXVertexShaderFile", "shaders/common/fixedFunction/colorV.hlsl");
shaderData->setField("DXPixelShaderFile", "shaders/common/fixedFunction/colorP.hlsl");
shaderData->setField("DXVertexShaderFile", String(Con::getVariable("$Core::CommonShaderPath")) + String("/fixedFunction/colorV.hlsl"));
shaderData->setField("DXPixelShaderFile", String(Con::getVariable("$Core::CommonShaderPath")) + String("/fixedFunction/colorP.hlsl"));
shaderData->setField("pixVersion", shaderModel);
shaderData->registerObject();
mGenericShader[GSColor] = shaderData->getShader();
@ -680,8 +680,8 @@ void GFXD3D11Device::setupGenericShaders(GenericShaderType type)
Sim::getRootGroup()->addObject(shaderData);
shaderData = new ShaderData();
shaderData->setField("DXVertexShaderFile", "shaders/common/fixedFunction/modColorTextureV.hlsl");
shaderData->setField("DXPixelShaderFile", "shaders/common/fixedFunction/modColorTextureP.hlsl");
shaderData->setField("DXVertexShaderFile", String(Con::getVariable("$Core::CommonShaderPath")) + String("/fixedFunction/modColorTextureV.hlsl"));
shaderData->setField("DXPixelShaderFile", String(Con::getVariable("$Core::CommonShaderPath")) + String("/fixedFunction/modColorTextureP.hlsl"));
shaderData->setField("pixVersion", shaderModel);
shaderData->registerObject();
mGenericShader[GSModColorTexture] = shaderData->getShader();
@ -690,8 +690,8 @@ void GFXD3D11Device::setupGenericShaders(GenericShaderType type)
Sim::getRootGroup()->addObject(shaderData);
shaderData = new ShaderData();
shaderData->setField("DXVertexShaderFile", "shaders/common/fixedFunction/addColorTextureV.hlsl");
shaderData->setField("DXPixelShaderFile", "shaders/common/fixedFunction/addColorTextureP.hlsl");
shaderData->setField("DXVertexShaderFile", String(Con::getVariable("$Core::CommonShaderPath")) + String("/fixedFunction/addColorTextureV.hlsl"));
shaderData->setField("DXPixelShaderFile", String(Con::getVariable("$Core::CommonShaderPath")) + String("/fixedFunction/addColorTextureP.hlsl"));
shaderData->setField("pixVersion", shaderModel);
shaderData->registerObject();
mGenericShader[GSAddColorTexture] = shaderData->getShader();
@ -700,8 +700,8 @@ void GFXD3D11Device::setupGenericShaders(GenericShaderType type)
Sim::getRootGroup()->addObject(shaderData);
shaderData = new ShaderData();
shaderData->setField("DXVertexShaderFile", "shaders/common/fixedFunction/textureV.hlsl");
shaderData->setField("DXPixelShaderFile", "shaders/common/fixedFunction/textureP.hlsl");
shaderData->setField("DXVertexShaderFile", String(Con::getVariable("$Core::CommonShaderPath")) + String("/fixedFunction/textureV.hlsl"));
shaderData->setField("DXPixelShaderFile", String(Con::getVariable("$Core::CommonShaderPath")) + String("/fixedFunction/textureP.hlsl"));
shaderData->setField("pixVersion", shaderModel);
shaderData->registerObject();
mGenericShader[GSTexture] = shaderData->getShader();

View file

@ -154,8 +154,8 @@ inline void GFXD3D9Device::setupGenericShaders( GenericShaderType type /* = GSCo
ShaderData *shaderData;
shaderData = new ShaderData();
shaderData->setField("DXVertexShaderFile", "shaders/common/fixedFunction/colorV.hlsl");
shaderData->setField("DXPixelShaderFile", "shaders/common/fixedFunction/colorP.hlsl");
shaderData->setField("DXVertexShaderFile", String(Con::getVariable("$Core::CommonShaderPath")) + String("/fixedFunction/colorV.hlsl"));
shaderData->setField("DXPixelShaderFile", String(Con::getVariable("$Core::CommonShaderPath")) + String("/fixedFunction/colorP.hlsl"));
shaderData->setField("pixVersion", "3.0");
shaderData->registerObject();
mGenericShader[GSColor] = shaderData->getShader();
@ -164,8 +164,8 @@ inline void GFXD3D9Device::setupGenericShaders( GenericShaderType type /* = GSCo
Sim::getRootGroup()->addObject(shaderData);
shaderData = new ShaderData();
shaderData->setField("DXVertexShaderFile", "shaders/common/fixedFunction/modColorTextureV.hlsl");
shaderData->setField("DXPixelShaderFile", "shaders/common/fixedFunction/modColorTextureP.hlsl");
shaderData->setField("DXVertexShaderFile", String(Con::getVariable("$Core::CommonShaderPath")) + String("/fixedFunction/modColorTextureV.hlsl"));
shaderData->setField("DXPixelShaderFile", String(Con::getVariable("$Core::CommonShaderPath")) + String("/fixedFunction/modColorTextureP.hlsl"));
shaderData->setSamplerName("$diffuseMap", 0);
shaderData->setField("pixVersion", "3.0");
shaderData->registerObject();
@ -175,8 +175,8 @@ inline void GFXD3D9Device::setupGenericShaders( GenericShaderType type /* = GSCo
Sim::getRootGroup()->addObject(shaderData);
shaderData = new ShaderData();
shaderData->setField("DXVertexShaderFile", "shaders/common/fixedFunction/addColorTextureV.hlsl");
shaderData->setField("DXPixelShaderFile", "shaders/common/fixedFunction/addColorTextureP.hlsl");
shaderData->setField("DXVertexShaderFile", String(Con::getVariable("$Core::CommonShaderPath")) + String("/fixedFunction/addColorTextureV.hlsl"));
shaderData->setField("DXPixelShaderFile", String(Con::getVariable("$Core::CommonShaderPath")) + String("/fixedFunction/addColorTextureP.hlsl"));
shaderData->setSamplerName("$diffuseMap", 0);
shaderData->setField("pixVersion", "3.0");
shaderData->registerObject();
@ -186,8 +186,8 @@ inline void GFXD3D9Device::setupGenericShaders( GenericShaderType type /* = GSCo
Sim::getRootGroup()->addObject(shaderData);
shaderData = new ShaderData();
shaderData->setField("DXVertexShaderFile", "shaders/common/fixedFunction/textureV.hlsl");
shaderData->setField("DXPixelShaderFile", "shaders/common/fixedFunction/textureP.hlsl");
shaderData->setField("DXVertexShaderFile", String(Con::getVariable("$Core::CommonShaderPath")) + String("/fixedFunction/textureV.hlsl"));
shaderData->setField("DXPixelShaderFile", String(Con::getVariable("$Core::CommonShaderPath")) + String("/fixedFunction/textureP.hlsl"));
shaderData->setSamplerName("$diffuseMap", 0);
shaderData->setField("pixVersion", "3.0");
shaderData->registerObject();

View file

@ -42,9 +42,9 @@ using namespace Torque;
S32 GFXTextureManager::smTextureReductionLevel = 0;
String GFXTextureManager::smMissingTexturePath("core/art/missingTexture");
String GFXTextureManager::smUnavailableTexturePath("core/art/unavailable");
String GFXTextureManager::smWarningTexturePath("core/art/warnmat");
String GFXTextureManager::smMissingTexturePath(Con::getVariable("$Core::MissingTexturePath"));
String GFXTextureManager::smUnavailableTexturePath(Con::getVariable("$Core::UnAvailableTexturePath"));
String GFXTextureManager::smWarningTexturePath(Con::getVariable("$Core::WarningTexturePath"));
GFXTextureManager::EventSignal GFXTextureManager::smEventSignal;

View file

@ -780,8 +780,8 @@ void GFXGLDevice::setupGenericShaders( GenericShaderType type )
ShaderData *shaderData;
shaderData = new ShaderData();
shaderData->setField("OGLVertexShaderFile", "shaders/common/fixedFunction/gl/colorV.glsl");
shaderData->setField("OGLPixelShaderFile", "shaders/common/fixedFunction/gl/colorP.glsl");
shaderData->setField("OGLVertexShaderFile", String(Con::getVariable("$Core::CommonShaderPath")) + String("/fixedFunction/gl/colorV.glsl"));
shaderData->setField("OGLPixelShaderFile", String(Con::getVariable("$Core::CommonShaderPath")) + String("/fixedFunction/gl/colorP.glsl"));
shaderData->setField("pixVersion", "2.0");
shaderData->registerObject();
mGenericShader[GSColor] = shaderData->getShader();
@ -790,8 +790,8 @@ void GFXGLDevice::setupGenericShaders( GenericShaderType type )
Sim::getRootGroup()->addObject(shaderData);
shaderData = new ShaderData();
shaderData->setField("OGLVertexShaderFile", "shaders/common/fixedFunction/gl/modColorTextureV.glsl");
shaderData->setField("OGLPixelShaderFile", "shaders/common/fixedFunction/gl/modColorTextureP.glsl");
shaderData->setField("OGLVertexShaderFile", String(Con::getVariable("$Core::CommonShaderPath")) + String("/fixedFunction/gl/modColorTextureV.glsl"));
shaderData->setField("OGLPixelShaderFile", String(Con::getVariable("$Core::CommonShaderPath")) + String("/fixedFunction/gl/modColorTextureP.glsl"));
shaderData->setSamplerName("$diffuseMap", 0);
shaderData->setField("pixVersion", "2.0");
shaderData->registerObject();
@ -801,8 +801,8 @@ void GFXGLDevice::setupGenericShaders( GenericShaderType type )
Sim::getRootGroup()->addObject(shaderData);
shaderData = new ShaderData();
shaderData->setField("OGLVertexShaderFile", "shaders/common/fixedFunction/gl/addColorTextureV.glsl");
shaderData->setField("OGLPixelShaderFile", "shaders/common/fixedFunction/gl/addColorTextureP.glsl");
shaderData->setField("OGLVertexShaderFile", String(Con::getVariable("$Core::CommonShaderPath")) + String("/fixedFunction/gl/addColorTextureV.glsl"));
shaderData->setField("OGLPixelShaderFile", String(Con::getVariable("$Core::CommonShaderPath")) + String("/fixedFunction/gl/addColorTextureP.glsl"));
shaderData->setSamplerName("$diffuseMap", 0);
shaderData->setField("pixVersion", "2.0");
shaderData->registerObject();
@ -812,8 +812,8 @@ void GFXGLDevice::setupGenericShaders( GenericShaderType type )
Sim::getRootGroup()->addObject(shaderData);
shaderData = new ShaderData();
shaderData->setField("OGLVertexShaderFile", "shaders/common/fixedFunction/gl/textureV.glsl");
shaderData->setField("OGLPixelShaderFile", "shaders/common/fixedFunction/gl/textureP.glsl");
shaderData->setField("OGLVertexShaderFile", String(Con::getVariable("$Core::CommonShaderPath")) + String("/fixedFunction/gl/textureV.glsl"));
shaderData->setField("OGLPixelShaderFile", String(Con::getVariable("$Core::CommonShaderPath")) + String("/fixedFunction/gl/textureP.glsl"));
shaderData->setSamplerName("$diffuseMap", 0);
shaderData->setField("pixVersion", "2.0");
shaderData->registerObject();

View file

@ -48,10 +48,10 @@ ConsoleDocClass( ShaderData,
"// Used for the procedural clould system\n"
"singleton ShaderData( CloudLayerShader )\n"
"{\n"
" DXVertexShaderFile = \"shaders/common/cloudLayerV.hlsl\";\n"
" DXPixelShaderFile = \"shaders/common/cloudLayerP.hlsl\";\n"
" OGLVertexShaderFile = \"shaders/common/gl/cloudLayerV.glsl\";\n"
" OGLPixelShaderFile = \"shaders/common/gl/cloudLayerP.glsl\";\n"
" DXVertexShaderFile = $Core::CommonShaderPath @ \"/cloudLayerV.hlsl\";\n"
" DXPixelShaderFile = $Core::CommonShaderPath @ \"/cloudLayerP.hlsl\";\n"
" OGLVertexShaderFile = $Core::CommonShaderPath @ \"/gl/cloudLayerV.glsl\";\n"
" OGLPixelShaderFile = $Core::CommonShaderPath @ \"/gl/cloudLayerP.glsl\";\n"
" pixVersion = 2.0;\n"
"};\n"
"@endtsexample\n\n"
@ -109,8 +109,8 @@ void ShaderData::initPersistFields()
"@tsexample\n"
"singleton ShaderData( FlashShader )\n"
"{\n"
"DXVertexShaderFile = \"shaders/common/postFx/flashV.hlsl\";\n"
"DXPixelShaderFile = \"shaders/common/postFx/flashP.hlsl\";\n\n"
"DXVertexShaderFile = $shaderGen::cachePath @ \"/postFx/flashV.hlsl\";\n"
"DXPixelShaderFile = $shaderGen::cachePath @ \"/postFx/flashP.hlsl\";\n\n"
" //Define setting the color of WHITE_COLOR.\n"
"defines = \"WHITE_COLOR=float4(1.0,1.0,1.0,0.0)\";\n\n"
"pixVersion = 2.0\n"

View file

@ -373,3 +373,20 @@ DefineConsoleFunction( mGetAngleBetweenVectors, F32, (VectorF vecA, VectorF vecB
{
return MathUtils::getAngleBetweenVectors(vecA, vecB);
}
DefineConsoleFunction(mGetSignedAngleBetweenVectors, F32, (VectorF vecA, VectorF vecB, VectorF norm), (VectorF::Zero, VectorF::Zero, VectorF::Zero),
"Returns signed angle between two vectors, using a normal for orientation.\n"
"@param vecA First input vector."
"@param vecB Second input vector."
"@param norm Normal/Cross Product vector."
"@returns Angle between both vectors in radians."
"@ingroup Math")
{
if (vecA.isZero() || vecB.isZero() || norm.isZero())
{
Con::errorf("mGetSignedAngleBetweenVectors - Error! Requires all 3 vectors used to be non-zero!");
return 0;
}
return MathUtils::getSignedAngleBetweenVectors(vecA, vecB, norm);
}

View file

@ -371,6 +371,18 @@ F32 getAngleBetweenVectors(VectorF vecA, VectorF vecB)
return angle;
}
F32 getSignedAngleBetweenVectors(VectorF vecA, VectorF vecB, VectorF norm)
{
// angle in 0-180
F32 angle = getAngleBetweenVectors(vecA, vecB);
F32 sign = mSign(mDot(norm, mCross(vecA, vecB)));
// angle in -179-180
F32 signed_angle = angle * sign;
return signed_angle;
}
//-----------------------------------------------------------------------------
void transformBoundingBox(const Box3F &sbox, const MatrixF &mat, const Point3F scale, Box3F &dbox)

View file

@ -161,6 +161,11 @@ namespace MathUtils
///
F32 getAngleBetweenVectors(VectorF vecA, VectorF vecB);
/// Returns the angle between two given vectors, utilizing a normal vector to discertain the angle's sign
///
/// Angles is in RADIANS
///
F32 getSignedAngleBetweenVectors(VectorF vecA, VectorF vecB, VectorF norm);
/// Simple reflection equation - pass in a vector and a normal to reflect off of
inline Point3F reflect( Point3F &inVec, Point3F &norm )

View file

@ -51,6 +51,7 @@ mModuleId(StringTable->EmptyString()),
mSynchronized( false ),
mDeprecated( false ),
mCriticalMerge( false ),
mOverrideExitingObjects(false),
mModuleDescription( StringTable->EmptyString() ),
mAuthor(StringTable->EmptyString()),
mModuleGroup(StringTable->EmptyString()),
@ -91,6 +92,7 @@ void ModuleDefinition::initPersistFields()
addProtectedField( "Synchronized", TypeBool, Offset(mSynchronized, ModuleDefinition), &setSynchronized, &defaultProtectedGetFn, &writeSynchronized, "Whether the module should be synchronized or not. Optional: If not specified then the module is not synchronized." );
addProtectedField( "Deprecated", TypeBool, Offset(mDeprecated, ModuleDefinition), &setDeprecated, &defaultProtectedGetFn, &writeDeprecated, "Whether the module is deprecated or not. Optional: If not specified then the module is not deprecated." );
addProtectedField( "CriticalMerge", TypeBool, Offset(mCriticalMerge, ModuleDefinition), &setDeprecated, &defaultProtectedGetFn, &writeCriticalMerge, "Whether the merging of a module prior to a restart is critical or not. Optional: If not specified then the module is not merge critical." );
addProtectedField( "OverrideExistingObjects", TypeBool, Offset(mOverrideExitingObjects, ModuleDefinition), &setOverrideExistingObjects, &defaultProtectedGetFn, &writeOverrideExistingObjects, "Controls if when this module is loaded and the create function is executed, it will replace existing objects that share names or not.");
addProtectedField( "Description", TypeString, Offset(mModuleDescription, ModuleDefinition), &setModuleDescription, &defaultProtectedGetFn, &writeModuleDescription, "The description typically used for debugging purposes but can be used for anything." );
addProtectedField( "Author", TypeString, Offset(mAuthor, ModuleDefinition), &setAuthor, &defaultProtectedGetFn, &writeAuthor, "The author of the module." );
addProtectedField( "Group", TypeString, Offset(mModuleGroup, ModuleDefinition), &setModuleGroup, &defaultProtectedGetFn, "The module group used typically when loading modules as a group." );

View file

@ -89,6 +89,7 @@ private:
bool mSynchronized;
bool mDeprecated;
bool mCriticalMerge;
bool mOverrideExitingObjects;
StringTableEntry mModuleDescription;
StringTableEntry mAuthor;;
StringTableEntry mModuleGroup;
@ -141,6 +142,8 @@ public:
inline bool getDeprecated( void ) const { return mDeprecated; }
inline void setCriticalMerge( const bool mergeCritical ) { if ( checkUnlocked() ) { mCriticalMerge = mergeCritical; } }
inline bool getCriticalMerge( void ) const { return mCriticalMerge; }
inline void setOverrideExistingObjects(const bool overrideExistingObj) { if (checkUnlocked()) { mOverrideExitingObjects = overrideExistingObj; } }
inline bool getOverrideExistingObjects(void) const { return mOverrideExitingObjects; }
inline void setModuleDescription( const char* pModuleDescription ) { if ( checkUnlocked() ) { mModuleDescription = StringTable->insert(pModuleDescription); } }
inline StringTableEntry getModuleDescription( void ) const { return mModuleDescription; }
inline void setAuthor( const char* pAuthor ) { if ( checkUnlocked() ) { mAuthor = StringTable->insert(pAuthor); } }
@ -206,6 +209,8 @@ protected:
static bool setDeprecated(void* obj, const char* index, const char* data) { static_cast<ModuleDefinition*>(obj)->setDeprecated(dAtob(data)); return false; }
static bool writeDeprecated( void* obj, StringTableEntry pFieldName ) { return static_cast<ModuleDefinition*>(obj)->getDeprecated() == true; }
static bool writeCriticalMerge( void* obj, StringTableEntry pFieldName ){ return static_cast<ModuleDefinition*>(obj)->getCriticalMerge() == true; }
static bool setOverrideExistingObjects(void* obj, const char* index, const char* data) { static_cast<ModuleDefinition*>(obj)->setOverrideExistingObjects(dAtob(data)); return false; }
static bool writeOverrideExistingObjects(void* obj, StringTableEntry pFieldName) { return static_cast<ModuleDefinition*>(obj)->getOverrideExistingObjects() == true; }
static bool setModuleDescription(void* obj, const char* index, const char* data) { static_cast<ModuleDefinition*>(obj)->setModuleDescription(data); return false; }
static bool writeModuleDescription( void* obj, StringTableEntry pFieldName ) { return static_cast<ModuleDefinition*>(obj)->getModuleDescription() != StringTable->EmptyString(); }
static bool setAuthor(void* obj, const char* index, const char* data) { static_cast<ModuleDefinition*>(obj)->setAuthor(data); return false; }

View file

@ -429,7 +429,22 @@ bool ModuleManager::loadModuleGroup( const char* pModuleGroup )
if ( pScopeSet->isMethod( pLoadReadyModuleDefinition->getCreateFunction() ) )
{
// Yes, so call the create method.
Con::executef( pScopeSet, pLoadReadyModuleDefinition->getCreateFunction() );
//But first, check if we're overriding objects, and if so, set our console var to make that happen while we exec our create function
if (pLoadReadyModuleDefinition->getOverrideExistingObjects())
{
String redefineBehaviorPrev = Con::getVariable("$Con::redefineBehavior");
Con::setVariable("$Con::redefineBehavior", "replaceExisting");
Con::executef(pScopeSet, pLoadReadyModuleDefinition->getCreateFunction());
//And now that we've executed, switch back to the prior behavior
Con::setVariable("$Con::redefineBehavior", redefineBehaviorPrev.c_str());
}
else
{
//Nothing to do, just run the create function
Con::executef(pScopeSet, pLoadReadyModuleDefinition->getCreateFunction());
}
}
}
else

View file

@ -411,10 +411,6 @@ bool PostEffect::onAdd()
texFilename[0] == '#' )
continue;
// If '/', then path is specified, open normally
if ( texFilename[0] != '/' )
texFilename = scriptPath.getFullPath() + '/' + texFilename;
// Try to load the texture.
bool success = mTextures[i].set( texFilename, &PostFxTextureProfile, avar( "%s() - (line %d)", __FUNCTION__, __LINE__ ) );
if (!success)

View file

@ -236,7 +236,7 @@ void BumpFeatGLSL::setTexData( Material::StageData &stageDat,
ParallaxFeatGLSL::ParallaxFeatGLSL()
: mIncludeDep( "shaders/common/gl/torque.glsl" )
: mIncludeDep(String(Con::getVariable("$Core::CommonShaderPath")) + String("/gl/torque.glsl" ))
{
addDependency( &mIncludeDep );
}

View file

@ -30,7 +30,7 @@
PixelSpecularGLSL::PixelSpecularGLSL()
: mDep( "shaders/common/gl/lighting.glsl" )
: mDep(String(Con::getVariable("$Core::CommonShaderPath")) + String("/gl/lighting.glsl" ))
{
addDependency( &mDep );
}

View file

@ -830,7 +830,7 @@ Var* ShaderFeatureGLSL::addOutDetailTexCoord( Vector<ShaderComponent*> &compon
//****************************************************************************
DiffuseMapFeatGLSL::DiffuseMapFeatGLSL()
: mTorqueDep("shaders/common/gl/torque.glsl")
: mTorqueDep(String(Con::getVariable("$Core::CommonShaderPath")) + String("/gl/torque.glsl"))
{
addDependency(&mTorqueDep);
}
@ -1975,7 +1975,7 @@ void ReflectCubeFeatGLSL::setTexData( Material::StageData &stageDat,
//****************************************************************************
RTLightingFeatGLSL::RTLightingFeatGLSL()
: mDep( "shaders/common/gl/lighting.glsl" )
: mDep(String(Con::getVariable("$Core::CommonShaderPath")) + String("/gl/lighting.glsl" ))
{
addDependency( &mDep );
}
@ -2190,7 +2190,7 @@ ShaderFeature::Resources RTLightingFeatGLSL::getResources( const MaterialFeature
//****************************************************************************
FogFeatGLSL::FogFeatGLSL()
: mFogDep( "shaders/common/gl/torque.glsl" )
: mFogDep(String(Con::getVariable("$Core::CommonShaderPath")) + String("/gl/torque.glsl" ))
{
addDependency( &mFogDep );
}
@ -2321,7 +2321,7 @@ ShaderFeature::Resources FogFeatGLSL::getResources( const MaterialFeatureData &f
//****************************************************************************
VisibilityFeatGLSL::VisibilityFeatGLSL()
: mTorqueDep( "shaders/common/gl/torque.glsl" )
: mTorqueDep(String(Con::getVariable("$Core::CommonShaderPath")) + String("/gl/torque.glsl" ))
{
addDependency( &mTorqueDep );
}
@ -2487,7 +2487,7 @@ void RenderTargetZeroGLSL::processPix( Vector<ShaderComponent*> &componentList,
//****************************************************************************
HDROutGLSL::HDROutGLSL()
: mTorqueDep( "shaders/common/gl/torque.glsl" )
: mTorqueDep(String(Con::getVariable("$Core::CommonShaderPath")) + String("/gl/torque.glsl" ))
{
addDependency( &mTorqueDep );
}
@ -2508,7 +2508,7 @@ void HDROutGLSL::processPix( Vector<ShaderComponent*> &componentList,
#include "T3D/fx/groundCover.h"
FoliageFeatureGLSL::FoliageFeatureGLSL()
: mDep( "shaders/common/gl/foliage.glsl" )
: mDep(String(Con::getVariable("$Core::CommonShaderPath")) + String("/gl/foliage.glsl" ))
{
addDependency( &mDep );
}
@ -2654,7 +2654,7 @@ void ParticleNormalFeatureGLSL::processVert(Vector<ShaderComponent*> &componentL
//****************************************************************************
ImposterVertFeatureGLSL::ImposterVertFeatureGLSL()
: mDep( "shaders/common/gl/imposter.glsl" )
: mDep(String(Con::getVariable("$Core::CommonShaderPath")) + String("/gl/imposter.glsl" ))
{
addDependency( &mDep );
}

View file

@ -37,8 +37,8 @@ void ShaderGenPrinterGLSL::printShaderHeader( Stream& stream )
stream.write( dStrlen(header1), header1 );
// Cheap HLSL compatibility.
const char* header3 = "#include \"shaders/common/gl/hlslCompat.glsl\"\r\n";
stream.write( dStrlen(header3), header3 );
String header3 = String("#include \"") + String(Con::getVariable("$Core::CommonShaderPath")) + String("/gl/hlslCompat.glsl\"\r\n");
stream.write(dStrlen(header3), header3.c_str());
const char* header4 = "\r\n";
stream.write( dStrlen(header4), header4 );

View file

@ -268,7 +268,7 @@ void BumpFeatHLSL::setTexData( Material::StageData &stageDat,
ParallaxFeatHLSL::ParallaxFeatHLSL()
: mIncludeDep( "shaders/common/torque.hlsl" )
: mIncludeDep(String(Con::getVariable("$Core::CommonShaderPath")) + String("/torque.hlsl" ))
{
addDependency( &mIncludeDep );
}

View file

@ -30,7 +30,7 @@
PixelSpecularHLSL::PixelSpecularHLSL()
: mDep( "shaders/common/lighting.hlsl" )
: mDep(String(Con::getVariable("$Core::CommonShaderPath")) + String("/lighting.hlsl" ))
{
addDependency( &mDep );
}

View file

@ -853,7 +853,7 @@ Var* ShaderFeatureHLSL::addOutDetailTexCoord( Vector<ShaderComponent*> &compon
//****************************************************************************
DiffuseMapFeatHLSL::DiffuseMapFeatHLSL()
: mTorqueDep("shaders/common/torque.hlsl")
: mTorqueDep(String(Con::getVariable("$Core::CommonShaderPath")) + String("/torque.hlsl"))
{
addDependency(&mTorqueDep);
}
@ -2168,7 +2168,7 @@ void ReflectCubeFeatHLSL::setTexData( Material::StageData &stageDat,
//****************************************************************************
RTLightingFeatHLSL::RTLightingFeatHLSL()
: mDep( "shaders/common/lighting.hlsl" )
: mDep(String(Con::getVariable("$Core::CommonShaderPath")) + String("/lighting.hlsl" ))
{
addDependency( &mDep );
}
@ -2383,7 +2383,7 @@ ShaderFeature::Resources RTLightingFeatHLSL::getResources( const MaterialFeature
//****************************************************************************
FogFeatHLSL::FogFeatHLSL()
: mFogDep( "shaders/common/torque.hlsl" )
: mFogDep(String(Con::getVariable("$Core::CommonShaderPath")) + String("/torque.hlsl" ))
{
addDependency( &mFogDep );
}
@ -2514,7 +2514,7 @@ ShaderFeature::Resources FogFeatHLSL::getResources( const MaterialFeatureData &f
//****************************************************************************
VisibilityFeatHLSL::VisibilityFeatHLSL()
: mTorqueDep( "shaders/common/torque.hlsl" )
: mTorqueDep(String(Con::getVariable("$Core::CommonShaderPath")) + String("/torque.hlsl" ))
{
addDependency( &mTorqueDep );
}
@ -2681,7 +2681,7 @@ void RenderTargetZeroHLSL::processPix( Vector<ShaderComponent*> &componentList,
//****************************************************************************
HDROutHLSL::HDROutHLSL()
: mTorqueDep( "shaders/common/torque.hlsl" )
: mTorqueDep(String(Con::getVariable("$Core::CommonShaderPath")) + String("/torque.hlsl" ))
{
addDependency( &mTorqueDep );
}
@ -2702,7 +2702,7 @@ void HDROutHLSL::processPix( Vector<ShaderComponent*> &componentList,
#include "T3D/fx/groundCover.h"
FoliageFeatureHLSL::FoliageFeatureHLSL()
: mDep( "shaders/common/foliage.hlsl" )
: mDep(String(Con::getVariable("$Core::CommonShaderPath")) + String("/foliage.hlsl" ))
{
addDependency( &mDep );
}
@ -2848,7 +2848,7 @@ void ParticleNormalFeatureHLSL::processVert(Vector<ShaderComponent*> &componentL
//****************************************************************************
ImposterVertFeatureHLSL::ImposterVertFeatureHLSL()
: mDep( "shaders/common/imposter.hlsl" )
: mDep(String(Con::getVariable("$Core::CommonShaderPath")) + String("/imposter.hlsl" ))
{
addDependency( &mDep );
}

View file

@ -70,7 +70,7 @@ MODULE_END;
TerrainFeatGLSL::TerrainFeatGLSL()
: mTorqueDep( "shaders/common/gl/torque.glsl" )
: mTorqueDep(String(Con::getVariable("$Core::CommonShaderPath")) + String("/gl/torque.glsl" ))
{
addDependency( &mTorqueDep );
}
@ -297,8 +297,8 @@ U32 TerrainBaseMapFeatGLSL::getOutputTargets( const MaterialFeatureData &fd ) co
}
TerrainDetailMapFeatGLSL::TerrainDetailMapFeatGLSL()
: mTorqueDep( "shaders/common/gl/torque.glsl" ),
mTerrainDep( "shaders/common/terrain/terrain.glsl" )
: mTorqueDep(String(Con::getVariable("$Core::CommonShaderPath")) + String("/gl/torque.glsl" )),
mTerrainDep(String(Con::getVariable("$Core::CommonShaderPath")) + String("/terrain/terrain.glsl" ))
{
addDependency( &mTorqueDep );
@ -667,8 +667,8 @@ U32 TerrainDetailMapFeatGLSL::getOutputTargets( const MaterialFeatureData &fd )
TerrainMacroMapFeatGLSL::TerrainMacroMapFeatGLSL()
: mTorqueDep( "shaders/common/gl/torque.glsl" ),
mTerrainDep( "shaders/common/terrain/terrain.glsl" )
: mTorqueDep(String(Con::getVariable("$Core::CommonShaderPath")) + String("/gl/torque.glsl" )),
mTerrainDep(String(Con::getVariable("$Core::CommonShaderPath")) + String("/terrain/terrain.glsl" ))
{
addDependency( &mTorqueDep );

View file

@ -69,7 +69,7 @@ MODULE_END;
TerrainFeatHLSL::TerrainFeatHLSL()
: mTorqueDep( "shaders/common/torque.hlsl" )
: mTorqueDep(String(Con::getVariable("$Core::CommonShaderPath")) + String("/torque.hlsl" ))
{
addDependency( &mTorqueDep );
}
@ -315,8 +315,8 @@ U32 TerrainBaseMapFeatHLSL::getOutputTargets( const MaterialFeatureData &fd ) co
}
TerrainDetailMapFeatHLSL::TerrainDetailMapFeatHLSL()
: mTorqueDep( "shaders/common/torque.hlsl" ),
mTerrainDep( "shaders/common/terrain/terrain.hlsl" )
: mTorqueDep(String(Con::getVariable("$Core::CommonShaderPath")) + String("/torque.hlsl" )),
mTerrainDep(String(Con::getVariable("$Core::CommonShaderPath")) + String("/terrain/terrain.hlsl" ))
{
addDependency( &mTorqueDep );
@ -692,8 +692,8 @@ U32 TerrainDetailMapFeatHLSL::getOutputTargets( const MaterialFeatureData &fd )
TerrainMacroMapFeatHLSL::TerrainMacroMapFeatHLSL()
: mTorqueDep( "shaders/common/torque.hlsl" ),
mTerrainDep( "shaders/common/terrain/terrain.hlsl" )
: mTorqueDep(String(Con::getVariable("$Core::CommonShaderPath")) + String("/torque.hlsl" )),
mTerrainDep(String(Con::getVariable("$Core::CommonShaderPath")) + String("/terrain/terrain.hlsl" ))
{
addDependency( &mTorqueDep );

View file

@ -103,10 +103,26 @@ bool Platform::displaySplashWindow( String path )
bool Platform::closeSplashWindow()
{
SDL_DestroyTexture(gSplashTexture);
SDL_FreeSurface(gSplashImage);
SDL_DestroyRenderer(gSplashRenderer);
SDL_DestroyWindow(gSplashWindow);
if (gSplashTexture != nullptr)
{
SDL_DestroyTexture(gSplashTexture);
gSplashTexture = nullptr;
}
if (gSplashImage != nullptr)
{
SDL_FreeSurface(gSplashImage);
gSplashImage = nullptr;
}
if (gSplashRenderer != nullptr)
{
SDL_DestroyRenderer(gSplashRenderer);
gSplashRenderer = nullptr;
}
if (gSplashWindow != nullptr)
{
SDL_DestroyWindow(gSplashWindow);
gSplashWindow = nullptr;
}
return true;
}