|
|
@ -1024,8 +1024,10 @@ bool GameConnection::readDemoStartBlock(BitStream *stream)
|
||||||
|
|
||||||
void GameConnection::demoPlaybackComplete()
|
void GameConnection::demoPlaybackComplete()
|
||||||
{
|
{
|
||||||
static ConsoleValueRef demoPlaybackArgv[1] = { "demoPlaybackComplete" };
|
static const char* demoPlaybackArgv[1] = { "demoPlaybackComplete" };
|
||||||
Sim::postCurrentEvent(Sim::getRootGroup(), new SimConsoleEvent(1, demoPlaybackArgv, false));
|
static StringStackConsoleWrapper demoPlaybackCmd(1, demoPlaybackArgv);
|
||||||
|
|
||||||
|
Sim::postCurrentEvent(Sim::getRootGroup(), new SimConsoleEvent(demoPlaybackCmd.argc, demoPlaybackCmd.argv, false));
|
||||||
Parent::demoPlaybackComplete();
|
Parent::demoPlaybackComplete();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -76,9 +76,10 @@ extern "C" {
|
||||||
if (!entry)
|
if (!entry)
|
||||||
return "";
|
return "";
|
||||||
|
|
||||||
ConsoleValueRef argv[] = {"consoleExportXML"};
|
static const char* exportArgv[1] = { "consoleExportXML" };
|
||||||
|
static StringStackConsoleWrapper exportCmd(1, exportArgv);
|
||||||
|
|
||||||
return entry->cb.mStringCallbackFunc(NULL, 1, argv);
|
return entry->cb.mStringCallbackFunc(NULL, exportCmd.argc, exportCmd.argv);
|
||||||
}
|
}
|
||||||
|
|
||||||
MarshalNativeEntry* script_get_namespace_entry(const char* nameSpace, const char* name)
|
MarshalNativeEntry* script_get_namespace_entry(const char* nameSpace, const char* name)
|
||||||
|
|
|
||||||
|
|
@ -1534,9 +1534,16 @@ StringTableEntry getModNameFromPath(const char *path)
|
||||||
void postConsoleInput( RawData data )
|
void postConsoleInput( RawData data )
|
||||||
{
|
{
|
||||||
// Schedule this to happen at the next time event.
|
// Schedule this to happen at the next time event.
|
||||||
|
ConsoleValue values[2];
|
||||||
ConsoleValueRef argv[2];
|
ConsoleValueRef argv[2];
|
||||||
argv[0] = "eval";
|
|
||||||
argv[1] = ( const char* ) data.data;
|
values[0].init();
|
||||||
|
values[0].setStringValue("eval");
|
||||||
|
values[1].init();
|
||||||
|
values[1].setStringValue((const char*)data.data);
|
||||||
|
argv[0].value = &values[0];
|
||||||
|
argv[1].value = &values[1];
|
||||||
|
|
||||||
Sim::postCurrentEvent(Sim::getRootGroup(), new SimConsoleEvent(2, argv, false));
|
Sim::postCurrentEvent(Sim::getRootGroup(), new SimConsoleEvent(2, argv, false));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -1610,36 +1617,6 @@ ConsoleValueRef::ConsoleValueRef(const ConsoleValueRef &ref)
|
||||||
value = ref.value;
|
value = ref.value;
|
||||||
}
|
}
|
||||||
|
|
||||||
ConsoleValueRef::ConsoleValueRef(const char *newValue) : value(NULL)
|
|
||||||
{
|
|
||||||
*this = newValue;
|
|
||||||
}
|
|
||||||
|
|
||||||
ConsoleValueRef::ConsoleValueRef(const String &newValue) : value(NULL)
|
|
||||||
{
|
|
||||||
*this = (const char*)(newValue.utf8());
|
|
||||||
}
|
|
||||||
|
|
||||||
ConsoleValueRef::ConsoleValueRef(U32 newValue) : value(NULL)
|
|
||||||
{
|
|
||||||
*this = newValue;
|
|
||||||
}
|
|
||||||
|
|
||||||
ConsoleValueRef::ConsoleValueRef(S32 newValue) : value(NULL)
|
|
||||||
{
|
|
||||||
*this = newValue;
|
|
||||||
}
|
|
||||||
|
|
||||||
ConsoleValueRef::ConsoleValueRef(F32 newValue) : value(NULL)
|
|
||||||
{
|
|
||||||
*this = newValue;
|
|
||||||
}
|
|
||||||
|
|
||||||
ConsoleValueRef::ConsoleValueRef(F64 newValue) : value(NULL)
|
|
||||||
{
|
|
||||||
*this = newValue;
|
|
||||||
}
|
|
||||||
|
|
||||||
ConsoleValueRef& ConsoleValueRef::operator=(const ConsoleValueRef &newValue)
|
ConsoleValueRef& ConsoleValueRef::operator=(const ConsoleValueRef &newValue)
|
||||||
{
|
{
|
||||||
value = newValue.value;
|
value = newValue.value;
|
||||||
|
|
|
||||||
|
|
@ -215,12 +215,6 @@ public:
|
||||||
~ConsoleValueRef() { ; }
|
~ConsoleValueRef() { ; }
|
||||||
|
|
||||||
ConsoleValueRef(const ConsoleValueRef &ref);
|
ConsoleValueRef(const ConsoleValueRef &ref);
|
||||||
ConsoleValueRef(const char *value);
|
|
||||||
ConsoleValueRef(const String &ref);
|
|
||||||
ConsoleValueRef(U32 value);
|
|
||||||
ConsoleValueRef(S32 value);
|
|
||||||
ConsoleValueRef(F32 value);
|
|
||||||
ConsoleValueRef(F64 value);
|
|
||||||
|
|
||||||
static ConsoleValueRef fromValue(ConsoleValue *value) { ConsoleValueRef ref; ref.value = value; return ref; }
|
static ConsoleValueRef fromValue(ConsoleValue *value) { ConsoleValueRef ref; ref.value = value; return ref; }
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -129,7 +129,7 @@ ConsoleValueRef SimConsoleThreadExecCallback::waitForResult()
|
||||||
return retVal;
|
return retVal;
|
||||||
}
|
}
|
||||||
|
|
||||||
return (const char*)NULL;
|
return ConsoleValueRef();
|
||||||
}
|
}
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
|
|
|
||||||
|
|
@ -97,7 +97,6 @@ void ForestEditorCtrl::onSleep()
|
||||||
|
|
||||||
bool ForestEditorCtrl::updateActiveForest( bool createNew )
|
bool ForestEditorCtrl::updateActiveForest( bool createNew )
|
||||||
{
|
{
|
||||||
mForest = dynamic_cast<Forest*>( Sim::findObject( "theForest" ) );
|
|
||||||
Con::executef( this, "onActiveForestUpdated", mForest ? mForest->getIdString() : "", createNew ? "1" : "0" );
|
Con::executef( this, "onActiveForestUpdated", mForest ? mForest->getIdString() : "", createNew ? "1" : "0" );
|
||||||
|
|
||||||
if ( mTool )
|
if ( mTool )
|
||||||
|
|
@ -400,4 +399,13 @@ DefineConsoleMethod( ForestEditorCtrl, deleteMeshSafe, void, ( const char * obj
|
||||||
DefineConsoleMethod( ForestEditorCtrl, isDirty, bool, (), , "" )
|
DefineConsoleMethod( ForestEditorCtrl, isDirty, bool, (), , "" )
|
||||||
{
|
{
|
||||||
return object->isDirty();
|
return object->isDirty();
|
||||||
|
}
|
||||||
|
|
||||||
|
DefineConsoleMethod(ForestEditorCtrl, setActiveForest, void, (const char * obj), , "( Forest obj )")
|
||||||
|
{
|
||||||
|
Forest *forestObject;
|
||||||
|
if (!Sim::findObject(obj, forestObject))
|
||||||
|
return;
|
||||||
|
|
||||||
|
object->setActiveForest(forestObject);
|
||||||
}
|
}
|
||||||
|
|
@ -86,6 +86,9 @@ class ForestEditorCtrl : public EditTSCtrl
|
||||||
/// Causes the editor to reselect the active forest.
|
/// Causes the editor to reselect the active forest.
|
||||||
bool updateActiveForest( bool createNew );
|
bool updateActiveForest( bool createNew );
|
||||||
|
|
||||||
|
/// Sets the active Forest
|
||||||
|
void setActiveForest(Forest* forestObject) { mForest = forestObject; }
|
||||||
|
|
||||||
/// Returns the active Forest.
|
/// Returns the active Forest.
|
||||||
Forest *getActiveForest() const { return mForest; }
|
Forest *getActiveForest() const { return mForest; }
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -88,7 +88,7 @@ public:
|
||||||
const Vector<S32>& getLOSDetails() const { return mLOSDetails; }
|
const Vector<S32>& getLOSDetails() const { return mLOSDetails; }
|
||||||
|
|
||||||
// ForestItemData
|
// ForestItemData
|
||||||
const Box3F& getObjBox() const { return mShape ? mShape->bounds : Box3F::Invalid; }
|
const Box3F& getObjBox() const { return mShape ? mShape->bounds : Box3F::Zero; }
|
||||||
bool render( TSRenderState *rdata, const ForestItem& item ) const;
|
bool render( TSRenderState *rdata, const ForestItem& item ) const;
|
||||||
ForestCellBatch* allocateBatch() const;
|
ForestCellBatch* allocateBatch() const;
|
||||||
bool canBillboard( const SceneRenderState *state, const ForestItem &item, F32 distToCamera ) const;
|
bool canBillboard( const SceneRenderState *state, const ForestItem &item, F32 distToCamera ) const;
|
||||||
|
|
|
||||||
|
|
@ -811,9 +811,9 @@ GFXShader* GFXGLDevice::createShader()
|
||||||
return shader;
|
return shader;
|
||||||
}
|
}
|
||||||
|
|
||||||
void GFXGLDevice::setShader( GFXShader *shader )
|
void GFXGLDevice::setShader(GFXShader *shader, bool force)
|
||||||
{
|
{
|
||||||
if(mCurrentShader == shader)
|
if(mCurrentShader == shader && !force)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if ( shader )
|
if ( shader )
|
||||||
|
|
|
||||||
|
|
@ -90,7 +90,7 @@ public:
|
||||||
virtual F32 getPixelShaderVersion() const { return mPixelShaderVersion; }
|
virtual F32 getPixelShaderVersion() const { return mPixelShaderVersion; }
|
||||||
virtual void setPixelShaderVersion( F32 version ) { mPixelShaderVersion = version; }
|
virtual void setPixelShaderVersion( F32 version ) { mPixelShaderVersion = version; }
|
||||||
|
|
||||||
virtual void setShader(GFXShader* shd);
|
virtual void setShader(GFXShader *shader, bool force = false);
|
||||||
|
|
||||||
/// @attention GL cannot check if the given format supports blending or filtering!
|
/// @attention GL cannot check if the given format supports blending or filtering!
|
||||||
virtual GFXFormat selectSupportedFormat(GFXTextureProfile *profile,
|
virtual GFXFormat selectSupportedFormat(GFXTextureProfile *profile,
|
||||||
|
|
|
||||||
|
|
@ -1019,7 +1019,7 @@ F32 mRandF()
|
||||||
return gRandGen.randF();
|
return gRandGen.randF();
|
||||||
}
|
}
|
||||||
|
|
||||||
DefineConsoleFunction( getRandom, F32, (S32 a, S32 b), (1, 0),
|
DefineConsoleFunction(getRandom, F32, (S32 a, S32 b), (S32_MAX, S32_MAX),
|
||||||
"( int a, int b ) "
|
"( int a, int b ) "
|
||||||
"@brief Returns a random number based on parameters passed in..\n\n"
|
"@brief Returns a random number based on parameters passed in..\n\n"
|
||||||
"If no parameters are passed in, getRandom() will return a float between 0.0 and 1.0. If one "
|
"If no parameters are passed in, getRandom() will return a float between 0.0 and 1.0. If one "
|
||||||
|
|
@ -1033,21 +1033,21 @@ DefineConsoleFunction( getRandom, F32, (S32 a, S32 b), (1, 0),
|
||||||
"@see setRandomSeed\n"
|
"@see setRandomSeed\n"
|
||||||
"@ingroup Random" )
|
"@ingroup Random" )
|
||||||
{
|
{
|
||||||
if (b == 0)
|
if (a != S32_MAX)
|
||||||
return F32(gRandGen.randI(0,getMax( a, 0 )));
|
|
||||||
else
|
|
||||||
{
|
{
|
||||||
if (b != 0)
|
if (b == S32_MAX)
|
||||||
|
return F32(gRandGen.randI(0, getMax(a, 0)));
|
||||||
|
else
|
||||||
{
|
{
|
||||||
S32 min = a;
|
S32 min = a;
|
||||||
S32 max = b;
|
S32 max = b;
|
||||||
if (min > max)
|
if (min > max)
|
||||||
{
|
{
|
||||||
S32 t = min;
|
S32 t = min;
|
||||||
min = max;
|
min = max;
|
||||||
max = t;
|
max = t;
|
||||||
}
|
}
|
||||||
return F32(gRandGen.randI(min,max));
|
return F32(gRandGen.randI(min, max));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return gRandGen.randF();
|
return gRandGen.randF();
|
||||||
|
|
|
||||||
|
|
@ -42,7 +42,7 @@ inline void dFetchAndAdd( volatile U32& ref, U32 val )
|
||||||
#if defined(TORQUE_OS_PS3)
|
#if defined(TORQUE_OS_PS3)
|
||||||
cellAtomicAdd32( (std::uint32_t *)&ref, val );
|
cellAtomicAdd32( (std::uint32_t *)&ref, val );
|
||||||
#elif !defined(TORQUE_OS_MAC)
|
#elif !defined(TORQUE_OS_MAC)
|
||||||
__sync_fetch_and_add( ( volatile long* ) &ref, val );
|
__sync_fetch_and_add(&ref, val );
|
||||||
#else
|
#else
|
||||||
OSAtomicAdd32( val, (int32_t* ) &ref);
|
OSAtomicAdd32( val, (int32_t* ) &ref);
|
||||||
#endif
|
#endif
|
||||||
|
|
@ -53,7 +53,7 @@ inline void dFetchAndAdd( volatile S32& ref, S32 val )
|
||||||
#if defined(TORQUE_OS_PS3)
|
#if defined(TORQUE_OS_PS3)
|
||||||
cellAtomicAdd32( (std::uint32_t *)&ref, val );
|
cellAtomicAdd32( (std::uint32_t *)&ref, val );
|
||||||
#elif !defined(TORQUE_OS_MAC)
|
#elif !defined(TORQUE_OS_MAC)
|
||||||
__sync_fetch_and_add( ( volatile long* ) &ref, val );
|
__sync_fetch_and_add( &ref, val );
|
||||||
#else
|
#else
|
||||||
OSAtomicAdd32( val, (int32_t* ) &ref);
|
OSAtomicAdd32( val, (int32_t* ) &ref);
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
|
|
@ -412,15 +412,7 @@ void ThreadPool::queueWorkItem( WorkItem* item )
|
||||||
|
|
||||||
mWorkItemQueue.insert( item->getPriority(), item );
|
mWorkItemQueue.insert( item->getPriority(), item );
|
||||||
|
|
||||||
// Wake up some thread, if we need to.
|
mSemaphore.release();
|
||||||
// Use the ready count here as the wake count does
|
|
||||||
// not correctly protect the critical section in the
|
|
||||||
// thread's run function. This may lead us to release
|
|
||||||
// the semaphore more often than necessary, but it avoids
|
|
||||||
// a race condition.
|
|
||||||
|
|
||||||
if( !dCompareAndSwap( mNumThreadsReady, mNumThreads, mNumThreads ) )
|
|
||||||
mSemaphore.release();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -202,6 +202,10 @@ void RenderGlowMgr::render( SceneRenderState *state )
|
||||||
}
|
}
|
||||||
|
|
||||||
ParticleRenderInst *ri = static_cast<ParticleRenderInst*>(_ri);
|
ParticleRenderInst *ri = static_cast<ParticleRenderInst*>(_ri);
|
||||||
|
|
||||||
|
GFX->setStateBlock(mParticleRenderMgr->_getHighResStateBlock(ri));
|
||||||
|
mParticleRenderMgr->_getShaderConsts().mShaderConsts->setSafe(mParticleRenderMgr->_getShaderConsts().mModelViewProjSC, *ri->modelViewProj);
|
||||||
|
|
||||||
mParticleRenderMgr->renderParticle(ri, state);
|
mParticleRenderMgr->renderParticle(ri, state);
|
||||||
j++;
|
j++;
|
||||||
continue;
|
continue;
|
||||||
|
|
|
||||||
|
|
@ -137,11 +137,13 @@ protected:
|
||||||
GFXStateBlockRef mOffscreenBlocks[ParticleRenderInst::BlendStyle_COUNT];
|
GFXStateBlockRef mOffscreenBlocks[ParticleRenderInst::BlendStyle_COUNT];
|
||||||
GFXStateBlockRef mBackbufferBlocks[ParticleRenderInst::BlendStyle_COUNT];
|
GFXStateBlockRef mBackbufferBlocks[ParticleRenderInst::BlendStyle_COUNT];
|
||||||
GFXStateBlockRef mMixedResBlocks[ParticleRenderInst::BlendStyle_COUNT];
|
GFXStateBlockRef mMixedResBlocks[ParticleRenderInst::BlendStyle_COUNT];
|
||||||
|
|
||||||
|
public:
|
||||||
GFXStateBlockRef _getHighResStateBlock(ParticleRenderInst *ri);
|
GFXStateBlockRef _getHighResStateBlock(ParticleRenderInst *ri);
|
||||||
GFXStateBlockRef _getMixedResStateBlock(ParticleRenderInst *ri);
|
GFXStateBlockRef _getMixedResStateBlock(ParticleRenderInst *ri);
|
||||||
GFXStateBlockRef _getOffscreenStateBlock(ParticleRenderInst *ri);
|
GFXStateBlockRef _getOffscreenStateBlock(ParticleRenderInst *ri);
|
||||||
GFXStateBlockRef _getCompositeStateBlock(ParticleRenderInst *ri);
|
GFXStateBlockRef _getCompositeStateBlock(ParticleRenderInst *ri);
|
||||||
|
ShaderConsts &_getShaderConsts() { return mParticleShaderConsts; };
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1374,7 +1374,7 @@ F32 SceneContainer::containerSearchCurrRadiusDist()
|
||||||
|
|
||||||
void SceneContainer::getBinRange( const F32 min, const F32 max, U32& minBin, U32& maxBin )
|
void SceneContainer::getBinRange( const F32 min, const F32 max, U32& minBin, U32& maxBin )
|
||||||
{
|
{
|
||||||
AssertFatal(max >= min, "Error, bad range! in getBinRange");
|
AssertFatal(max >= min, avar("Error, bad range in getBinRange. min: %f, max: %f", min, max));
|
||||||
|
|
||||||
if ((max - min) >= (SceneContainer::csmTotalBinSize - SceneContainer::csmBinSize))
|
if ((max - min) >= (SceneContainer::csmTotalBinSize - SceneContainer::csmBinSize))
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -545,8 +545,8 @@ void TerrainDetailMapFeatHLSL::processPix( Vector<ShaderComponent*> &component
|
||||||
Var *baseColor = (Var*)LangElement::find( "baseColor" );
|
Var *baseColor = (Var*)LangElement::find( "baseColor" );
|
||||||
Var *outColor = (Var*)LangElement::find( "col" );
|
Var *outColor = (Var*)LangElement::find( "col" );
|
||||||
|
|
||||||
meta->addStatement( new GenOp( " @ = lerp( @, @ + @, @ );\r\n",
|
meta->addStatement( new GenOp( " @ += @ * @;\r\n",
|
||||||
outColor, outColor, baseColor, detailColor, detailBlend ) );
|
outColor, detailColor, detailBlend));
|
||||||
|
|
||||||
meta->addStatement( new GenOp( " }\r\n" ) );
|
meta->addStatement( new GenOp( " }\r\n" ) );
|
||||||
|
|
||||||
|
|
@ -742,7 +742,7 @@ void TerrainMacroMapFeatHLSL::processPix( Vector<ShaderComponent*> &componentL
|
||||||
}
|
}
|
||||||
|
|
||||||
// Add to the blend total.
|
// Add to the blend total.
|
||||||
meta->addStatement( new GenOp( " @ = max( @, @ );\r\n", blendTotal, blendTotal, detailBlend ) );
|
meta->addStatement( new GenOp( " @ += @;\r\n", blendTotal, detailBlend ) );
|
||||||
|
|
||||||
// If this is a prepass then we skip color.
|
// If this is a prepass then we skip color.
|
||||||
if ( fd.features.hasFeature( MFT_PrePassConditioner ) )
|
if ( fd.features.hasFeature( MFT_PrePassConditioner ) )
|
||||||
|
|
@ -815,9 +815,8 @@ void TerrainMacroMapFeatHLSL::processPix( Vector<ShaderComponent*> &componentL
|
||||||
//Var *baseColor = (Var*)LangElement::find( "baseColor" );
|
//Var *baseColor = (Var*)LangElement::find( "baseColor" );
|
||||||
Var *outColor = (Var*)LangElement::find( "col" );
|
Var *outColor = (Var*)LangElement::find( "col" );
|
||||||
|
|
||||||
meta->addStatement( new GenOp( " @ = lerp( @, @ + @, @ );\r\n",
|
meta->addStatement(new GenOp(" @ += @ * @;\r\n",
|
||||||
outColor, outColor, outColor, detailColor, detailBlend ) );
|
outColor, detailColor, detailBlend));
|
||||||
//outColor, outColor, baseColor, detailColor, detailBlend ) );
|
|
||||||
|
|
||||||
meta->addStatement( new GenOp( " }\r\n" ) );
|
meta->addStatement( new GenOp( " }\r\n" ) );
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -287,8 +287,14 @@ bool TerrainBlock::_setBaseTexFormat(void *obj, const char *index, const char *d
|
||||||
{
|
{
|
||||||
terrain->mBaseTexFormat = (BaseTexFormat)eTable[i].mInt;
|
terrain->mBaseTexFormat = (BaseTexFormat)eTable[i].mInt;
|
||||||
terrain->_updateMaterials();
|
terrain->_updateMaterials();
|
||||||
|
|
||||||
|
if (terrain->isServerObject()) return false;
|
||||||
terrain->_updateLayerTexture();
|
terrain->_updateLayerTexture();
|
||||||
terrain->_updateBaseTexture(true);
|
// If the cached base texture is older that the terrain file or
|
||||||
|
// it doesn't exist then generate and cache it.
|
||||||
|
String baseCachePath = terrain->_getBaseTexCacheFileName();
|
||||||
|
if (Platform::compareModifiedTimes(baseCachePath, terrain->mTerrFileName) < 0)
|
||||||
|
terrain->_updateBaseTexture(true);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -170,7 +170,7 @@ bool TerrainBlock::_initBaseShader()
|
||||||
desc.zDefined = true;
|
desc.zDefined = true;
|
||||||
desc.zWriteEnable = false;
|
desc.zWriteEnable = false;
|
||||||
desc.zEnable = false;
|
desc.zEnable = false;
|
||||||
desc.setBlend( true, GFXBlendSrcAlpha, GFXBlendOne );
|
desc.setBlend( true, GFXBlendSrcAlpha, GFXBlendOne );
|
||||||
desc.cullDefined = true;
|
desc.cullDefined = true;
|
||||||
desc.cullMode = GFXCullNone;
|
desc.cullMode = GFXCullNone;
|
||||||
desc.colorWriteAlpha = false;
|
desc.colorWriteAlpha = false;
|
||||||
|
|
|
||||||
|
|
@ -4,6 +4,7 @@ MIT Licensed Open Source version of [Torque 3D](http://torque3d.org) from [Garag
|
||||||
|
|
||||||
## More Information
|
## More Information
|
||||||
|
|
||||||
|
* [Homepage](http://torque3d.org)
|
||||||
* [Torque 3D wiki](http://wiki.torque3d.org)
|
* [Torque 3D wiki](http://wiki.torque3d.org)
|
||||||
* [Community forum](http://forums.torque3d.org)
|
* [Community forum](http://forums.torque3d.org)
|
||||||
* [GarageGames forum](http://www.garagegames.com/community/forums)
|
* [GarageGames forum](http://www.garagegames.com/community/forums)
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,85 @@
|
||||||
|
//Microsoft Developer Studio generated resource script.
|
||||||
|
//
|
||||||
|
#define IDI_ICON1 103
|
||||||
|
#define IDI_ICON2 107
|
||||||
|
|
||||||
|
// Next default values for new objects
|
||||||
|
//
|
||||||
|
#ifdef APSTUDIO_INVOKED
|
||||||
|
#ifndef APSTUDIO_READONLY_SYMBOLS
|
||||||
|
#define _APS_NEXT_RESOURCE_VALUE 108
|
||||||
|
#define _APS_NEXT_COMMAND_VALUE 40001
|
||||||
|
#define _APS_NEXT_CONTROL_VALUE 1000
|
||||||
|
#define _APS_NEXT_SYMED_VALUE 101
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#define APSTUDIO_READONLY_SYMBOLS
|
||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
//
|
||||||
|
// Generated from the TEXTINCLUDE 2 resource.
|
||||||
|
//
|
||||||
|
#include "windows.h"
|
||||||
|
|
||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
#undef APSTUDIO_READONLY_SYMBOLS
|
||||||
|
|
||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
// English (U.S.) resources
|
||||||
|
|
||||||
|
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
|
||||||
|
#ifdef _WIN32
|
||||||
|
LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
|
||||||
|
#pragma code_page(1252)
|
||||||
|
#endif //_WIN32
|
||||||
|
|
||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
//
|
||||||
|
// Icon
|
||||||
|
//
|
||||||
|
|
||||||
|
// Icon with lowest ID value placed first to ensure application icon
|
||||||
|
// remains consistent on all systems.
|
||||||
|
IDI_ICON1 ICON DISCARDABLE "torque.ico"
|
||||||
|
IDI_ICON2 ICON DISCARDABLE "torque.ico"
|
||||||
|
|
||||||
|
#ifdef APSTUDIO_INVOKED
|
||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
//
|
||||||
|
// TEXTINCLUDE
|
||||||
|
//
|
||||||
|
|
||||||
|
1 TEXTINCLUDE DISCARDABLE
|
||||||
|
BEGIN
|
||||||
|
"resource.h\0"
|
||||||
|
END
|
||||||
|
|
||||||
|
2 TEXTINCLUDE DISCARDABLE
|
||||||
|
BEGIN
|
||||||
|
"#include ""windows.h""\r\n"
|
||||||
|
"\0"
|
||||||
|
END
|
||||||
|
|
||||||
|
3 TEXTINCLUDE DISCARDABLE
|
||||||
|
BEGIN
|
||||||
|
"\r\n"
|
||||||
|
"\0"
|
||||||
|
END
|
||||||
|
|
||||||
|
#endif // APSTUDIO_INVOKED
|
||||||
|
|
||||||
|
#endif // English (U.S.) resources
|
||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#ifndef APSTUDIO_INVOKED
|
||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
//
|
||||||
|
// Generated from the TEXTINCLUDE 3 resource.
|
||||||
|
//
|
||||||
|
|
||||||
|
|
||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
#endif // not APSTUDIO_INVOKED
|
||||||
|
|
||||||
BIN
Templates/Empty/buildFiles/VisualStudio 2012/projects/torque.ico
Normal file
|
After Width: | Height: | Size: 25 KiB |
|
|
@ -252,7 +252,7 @@ function parseMissionGroupForIds( %className, %childGroup )
|
||||||
if( (%currentGroup).getObject(%i).getClassName() $= "SimGroup" )
|
if( (%currentGroup).getObject(%i).getClassName() $= "SimGroup" )
|
||||||
%classIds = %classIds @ parseMissionGroupForIds( %className, (%currentGroup).getObject(%i).getId());
|
%classIds = %classIds @ parseMissionGroupForIds( %className, (%currentGroup).getObject(%i).getId());
|
||||||
}
|
}
|
||||||
return %classIds;
|
return trim( %classIds );
|
||||||
}
|
}
|
||||||
|
|
||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
|
|
|
||||||
|
|
@ -20,11 +20,13 @@
|
||||||
// IN THE SOFTWARE.
|
// IN THE SOFTWARE.
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
$PostFXManager::Settings::EnableVignette = "0";
|
||||||
$PostFXManager::Settings::EnableDOF = "0";
|
$PostFXManager::Settings::EnableDOF = "0";
|
||||||
$PostFXManager::Settings::EnabledSSAO = "0";
|
$PostFXManager::Settings::EnabledSSAO = "0";
|
||||||
$PostFXManager::Settings::EnableHDR = "0";
|
$PostFXManager::Settings::EnableHDR = "0";
|
||||||
$PostFXManager::Settings::EnableLightRays = "0";
|
$PostFXManager::Settings::EnableLightRays = "0";
|
||||||
$PostFXManager::Settings::EnablePostFX = "0";
|
$PostFXManager::Settings::EnablePostFX = "0";
|
||||||
|
$PostFXManager::Settings::Vignette::VMax = "0.6";
|
||||||
$PostFXManager::Settings::DOF::BlurCurveFar = "";
|
$PostFXManager::Settings::DOF::BlurCurveFar = "";
|
||||||
$PostFXManager::Settings::DOF::BlurCurveNear = "";
|
$PostFXManager::Settings::DOF::BlurCurveNear = "";
|
||||||
$PostFXManager::Settings::DOF::BlurMax = "";
|
$PostFXManager::Settings::DOF::BlurMax = "";
|
||||||
|
|
|
||||||
|
|
@ -298,6 +298,9 @@ function PostFXManager::settingsApplyFromPreset(%this)
|
||||||
$DOFPostFx::FocusRangeMax = $PostFXManager::Settings::DOF::FocusRangeMax;
|
$DOFPostFx::FocusRangeMax = $PostFXManager::Settings::DOF::FocusRangeMax;
|
||||||
$DOFPostFx::BlurCurveNear = $PostFXManager::Settings::DOF::BlurCurveNear;
|
$DOFPostFx::BlurCurveNear = $PostFXManager::Settings::DOF::BlurCurveNear;
|
||||||
$DOFPostFx::BlurCurveFar = $PostFXManager::Settings::DOF::BlurCurveFar;
|
$DOFPostFx::BlurCurveFar = $PostFXManager::Settings::DOF::BlurCurveFar;
|
||||||
|
|
||||||
|
//Vignette settings
|
||||||
|
$VignettePostEffect::VMax = $PostFXManager::Settings::Vignette::VMax;
|
||||||
|
|
||||||
if ( $PostFXManager::forceEnableFromPresets )
|
if ( $PostFXManager::forceEnableFromPresets )
|
||||||
{
|
{
|
||||||
|
|
@ -392,6 +395,8 @@ function PostFXManager::settingsApplyDOF(%this)
|
||||||
|
|
||||||
function PostFXManager::settingsApplyVignette(%this)
|
function PostFXManager::settingsApplyVignette(%this)
|
||||||
{
|
{
|
||||||
|
$PostFXManager::Settings::Vignette::VMax = $VignettePostEffect::VMax;
|
||||||
|
|
||||||
postVerbose("% - PostFX Manager - Settings Saved - Vignette");
|
postVerbose("% - PostFX Manager - Settings Saved - Vignette");
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -50,7 +50,9 @@ function ForestEditorGui::onActiveForestUpdated( %this, %forest, %createNew )
|
||||||
/// Called from a message box when a forest is not found.
|
/// Called from a message box when a forest is not found.
|
||||||
function ForestEditorGui::createForest( %this )
|
function ForestEditorGui::createForest( %this )
|
||||||
{
|
{
|
||||||
if ( isObject( theForest ) )
|
%forestObject = parseMissionGroupForIds("Forest", "");
|
||||||
|
|
||||||
|
if ( isObject( %forestObject ) )
|
||||||
{
|
{
|
||||||
error( "Cannot create a second 'theForest' Forest!" );
|
error( "Cannot create a second 'theForest' Forest!" );
|
||||||
return;
|
return;
|
||||||
|
|
@ -64,8 +66,42 @@ function ForestEditorGui::createForest( %this )
|
||||||
};
|
};
|
||||||
|
|
||||||
MECreateUndoAction::submit( theForest );
|
MECreateUndoAction::submit( theForest );
|
||||||
|
|
||||||
ForestEditorInspector.inspect( theForest );
|
ForestEditorGui.setActiveForest( theForest );
|
||||||
|
|
||||||
|
//Re-initialize the editor settings so we can start using it immediately.
|
||||||
|
%tool = ForestEditorGui.getActiveTool();
|
||||||
|
if ( isObject( %tool ) )
|
||||||
|
%tool.onActivated();
|
||||||
|
|
||||||
|
if ( %tool == ForestTools->SelectionTool )
|
||||||
|
{
|
||||||
|
%mode = GlobalGizmoProfile.mode;
|
||||||
|
switch$ (%mode)
|
||||||
|
{
|
||||||
|
case "None":
|
||||||
|
ForestEditorSelectModeBtn.performClick();
|
||||||
|
case "Move":
|
||||||
|
ForestEditorMoveModeBtn.performClick();
|
||||||
|
case "Rotate":
|
||||||
|
ForestEditorRotateModeBtn.performClick();
|
||||||
|
case "Scale":
|
||||||
|
ForestEditorScaleModeBtn.performClick();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if ( %tool == ForestTools->BrushTool )
|
||||||
|
{
|
||||||
|
%mode = ForestTools->BrushTool.mode;
|
||||||
|
switch$ (%mode)
|
||||||
|
{
|
||||||
|
case "Paint":
|
||||||
|
ForestEditorPaintModeBtn.performClick();
|
||||||
|
case "Erase":
|
||||||
|
ForestEditorEraseModeBtn.performClick();
|
||||||
|
case "EraseSelected":
|
||||||
|
ForestEditorEraseSelectedModeBtn.performClick();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
EWorldEditor.isDirty = true;
|
EWorldEditor.isDirty = true;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -141,6 +141,13 @@ function ForestEditorPlugin::onActivated( %this )
|
||||||
ForestEditorPropertiesWindow.setVisible( true );
|
ForestEditorPropertiesWindow.setVisible( true );
|
||||||
ForestEditorGui.makeFirstResponder( true );
|
ForestEditorGui.makeFirstResponder( true );
|
||||||
//ForestEditToolbar.setVisible( true );
|
//ForestEditToolbar.setVisible( true );
|
||||||
|
|
||||||
|
//Get our existing forest object in our current mission if we have one
|
||||||
|
%forestObject = parseMissionGroupForIds("Forest", "");
|
||||||
|
if(isObject(%forestObject))
|
||||||
|
{
|
||||||
|
ForestEditorGui.setActiveForest(%forestObject.getName());
|
||||||
|
}
|
||||||
|
|
||||||
%this.map.push();
|
%this.map.push();
|
||||||
Parent::onActivated(%this);
|
Parent::onActivated(%this);
|
||||||
|
|
@ -232,9 +239,27 @@ function ForestEditorPlugin::clearDirty( %this )
|
||||||
function ForestEditorPlugin::onSaveMission( %this, %missionFile )
|
function ForestEditorPlugin::onSaveMission( %this, %missionFile )
|
||||||
{
|
{
|
||||||
ForestDataManager.saveDirty();
|
ForestDataManager.saveDirty();
|
||||||
|
|
||||||
if ( isObject( theForest ) )
|
//First, find out if we have an existing forest object
|
||||||
theForest.saveDataFile();
|
%forestObject = parseMissionGroupForIds("Forest", "");
|
||||||
|
|
||||||
|
if ( isObject( %forestObject ) )
|
||||||
|
{
|
||||||
|
//We do. Next, see if we have a file already by polling the datafield.
|
||||||
|
if(%forestObject.dataFile !$= "")
|
||||||
|
{
|
||||||
|
//If we do, just save to the provided file.
|
||||||
|
%forestObject.saveDataFile(%forestObject.dataFile);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
//We don't, so we'll save in the same place as the mission file and give it the missionpath\missionName.forest
|
||||||
|
//naming convention.
|
||||||
|
%path = filePath(%missionFile);
|
||||||
|
%missionName = fileBase(%missionFile);
|
||||||
|
%forestObject.saveDataFile(%path @ "/" @ %missionName @ ".forest");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
ForestBrushGroup.save( "art/forest/brushes.cs" );
|
ForestBrushGroup.save( "art/forest/brushes.cs" );
|
||||||
}
|
}
|
||||||
|
|
|
||||||
BIN
Templates/Empty/game/tools/gui/images/expand-toolbar_d.png
Normal file
|
After Width: | Height: | Size: 309 B |
BIN
Templates/Empty/game/tools/gui/images/expand-toolbar_h.png
Normal file
|
After Width: | Height: | Size: 477 B |
BIN
Templates/Empty/game/tools/gui/images/expand-toolbar_n.png
Normal file
|
After Width: | Height: | Size: 452 B |
|
|
@ -25,7 +25,7 @@
|
||||||
|
|
||||||
datablock TSForestItemData(ExampleForestMesh)
|
datablock TSForestItemData(ExampleForestMesh)
|
||||||
{
|
{
|
||||||
shapeFile = "art/shapes/trees/defaulttree/defaulttree.dae";
|
shapeFile = "art/shapes/trees/defaulttree/defaulttree.DAE";
|
||||||
internalName = "ExampleForestMesh";
|
internalName = "ExampleForestMesh";
|
||||||
windScale = "1";
|
windScale = "1";
|
||||||
trunkBendScale = "0.02";
|
trunkBendScale = "0.02";
|
||||||
|
|
|
||||||
|
|
@ -252,7 +252,7 @@ function parseMissionGroupForIds( %className, %childGroup )
|
||||||
if( (%currentGroup).getObject(%i).getClassName() $= "SimGroup" )
|
if( (%currentGroup).getObject(%i).getClassName() $= "SimGroup" )
|
||||||
%classIds = %classIds @ parseMissionGroupForIds( %className, (%currentGroup).getObject(%i).getId());
|
%classIds = %classIds @ parseMissionGroupForIds( %className, (%currentGroup).getObject(%i).getId());
|
||||||
}
|
}
|
||||||
return %classIds;
|
return trim( %classIds );
|
||||||
}
|
}
|
||||||
|
|
||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
|
|
|
||||||
|
|
@ -20,11 +20,13 @@
|
||||||
// IN THE SOFTWARE.
|
// IN THE SOFTWARE.
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
$PostFXManager::Settings::EnableVignette = "0";
|
||||||
$PostFXManager::Settings::EnableDOF = "0";
|
$PostFXManager::Settings::EnableDOF = "0";
|
||||||
$PostFXManager::Settings::EnabledSSAO = "0";
|
$PostFXManager::Settings::EnabledSSAO = "0";
|
||||||
$PostFXManager::Settings::EnableHDR = "0";
|
$PostFXManager::Settings::EnableHDR = "0";
|
||||||
$PostFXManager::Settings::EnableLightRays = "0";
|
$PostFXManager::Settings::EnableLightRays = "0";
|
||||||
$PostFXManager::Settings::EnablePostFX = "0";
|
$PostFXManager::Settings::EnablePostFX = "0";
|
||||||
|
$PostFXManager::Settings::Vignette::VMax = "0.6";
|
||||||
$PostFXManager::Settings::DOF::BlurCurveFar = "";
|
$PostFXManager::Settings::DOF::BlurCurveFar = "";
|
||||||
$PostFXManager::Settings::DOF::BlurCurveNear = "";
|
$PostFXManager::Settings::DOF::BlurCurveNear = "";
|
||||||
$PostFXManager::Settings::DOF::BlurMax = "";
|
$PostFXManager::Settings::DOF::BlurMax = "";
|
||||||
|
|
|
||||||
|
|
@ -298,6 +298,9 @@ function PostFXManager::settingsApplyFromPreset(%this)
|
||||||
$DOFPostFx::FocusRangeMax = $PostFXManager::Settings::DOF::FocusRangeMax;
|
$DOFPostFx::FocusRangeMax = $PostFXManager::Settings::DOF::FocusRangeMax;
|
||||||
$DOFPostFx::BlurCurveNear = $PostFXManager::Settings::DOF::BlurCurveNear;
|
$DOFPostFx::BlurCurveNear = $PostFXManager::Settings::DOF::BlurCurveNear;
|
||||||
$DOFPostFx::BlurCurveFar = $PostFXManager::Settings::DOF::BlurCurveFar;
|
$DOFPostFx::BlurCurveFar = $PostFXManager::Settings::DOF::BlurCurveFar;
|
||||||
|
|
||||||
|
//Vignette settings
|
||||||
|
$VignettePostEffect::VMax = $PostFXManager::Settings::Vignette::VMax;
|
||||||
|
|
||||||
if ( $PostFXManager::forceEnableFromPresets )
|
if ( $PostFXManager::forceEnableFromPresets )
|
||||||
{
|
{
|
||||||
|
|
@ -392,6 +395,8 @@ function PostFXManager::settingsApplyDOF(%this)
|
||||||
|
|
||||||
function PostFXManager::settingsApplyVignette(%this)
|
function PostFXManager::settingsApplyVignette(%this)
|
||||||
{
|
{
|
||||||
|
$PostFXManager::Settings::Vignette::VMax = $VignettePostEffect::VMax;
|
||||||
|
|
||||||
postVerbose("% - PostFX Manager - Settings Saved - Vignette");
|
postVerbose("% - PostFX Manager - Settings Saved - Vignette");
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1040,7 +1040,7 @@ new SimGroup(MissionGroup) {
|
||||||
scale = "1 1 1";
|
scale = "1 1 1";
|
||||||
canSave = "1";
|
canSave = "1";
|
||||||
canSaveDynamicFields = "1";
|
canSaveDynamicFields = "1";
|
||||||
dataFile = "levels/outpost.forest";
|
dataFile = "levels/Outpost.forest";
|
||||||
lodReflectScalar = "2";
|
lodReflectScalar = "2";
|
||||||
};
|
};
|
||||||
new WheeledVehicle() {
|
new WheeledVehicle() {
|
||||||
|
|
@ -1277,7 +1277,7 @@ new SimGroup(MissionGroup) {
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
new TSStatic() {
|
new TSStatic() {
|
||||||
shapeName = "art/shapes/trees/defaulttree/defaulttree.dae";
|
shapeName = "art/shapes/trees/defaulttree/defaulttree.DAE";
|
||||||
playAmbient = "1";
|
playAmbient = "1";
|
||||||
meshCulling = "0";
|
meshCulling = "0";
|
||||||
originSort = "0";
|
originSort = "0";
|
||||||
|
|
|
||||||
|
|
@ -7,6 +7,7 @@ $PostFXManager::Settings::DOF::EnableAutoFocus = "";
|
||||||
$PostFXManager::Settings::DOF::EnableDOF = "";
|
$PostFXManager::Settings::DOF::EnableDOF = "";
|
||||||
$PostFXManager::Settings::DOF::FocusRangeMax = "";
|
$PostFXManager::Settings::DOF::FocusRangeMax = "";
|
||||||
$PostFXManager::Settings::DOF::FocusRangeMin = "";
|
$PostFXManager::Settings::DOF::FocusRangeMin = "";
|
||||||
|
$PostFXManager::Settings::EnableVignette = "0";
|
||||||
$PostFXManager::Settings::EnableDOF = "1";
|
$PostFXManager::Settings::EnableDOF = "1";
|
||||||
$PostFXManager::Settings::EnabledSSAO = "1";
|
$PostFXManager::Settings::EnabledSSAO = "1";
|
||||||
$PostFXManager::Settings::EnableHDR = "1";
|
$PostFXManager::Settings::EnableHDR = "1";
|
||||||
|
|
|
||||||
|
|
@ -187,13 +187,14 @@ void main()
|
||||||
|
|
||||||
#endif // !NO_SHADOW
|
#endif // !NO_SHADOW
|
||||||
|
|
||||||
|
vec3 lightcol = lightColor.rgb;
|
||||||
#ifdef USE_COOKIE_TEX
|
#ifdef USE_COOKIE_TEX
|
||||||
|
|
||||||
// Lookup the cookie sample.
|
// Lookup the cookie sample.
|
||||||
vec4 cookie = texture( cookieMap, tMul( viewToLightProj, -lightVec ) );
|
vec4 cookie = texture( cookieMap, tMul( viewToLightProj, -lightVec ) );
|
||||||
|
|
||||||
// Multiply the light with the cookie tex.
|
// Multiply the light with the cookie tex.
|
||||||
lightColor.rgb *= cookie.rgb;
|
lightcol *= cookie.rgb;
|
||||||
|
|
||||||
// Use a maximum channel luminance to attenuate
|
// Use a maximum channel luminance to attenuate
|
||||||
// the lighting else we get specular in the dark
|
// the lighting else we get specular in the dark
|
||||||
|
|
@ -211,7 +212,7 @@ void main()
|
||||||
normalize( -eyeRay ) ) * lightBrightness * atten * shadowed;
|
normalize( -eyeRay ) ) * lightBrightness * atten * shadowed;
|
||||||
|
|
||||||
float Sat_NL_Att = saturate( nDotL * atten * shadowed ) * lightBrightness;
|
float Sat_NL_Att = saturate( nDotL * atten * shadowed ) * lightBrightness;
|
||||||
vec3 lightColorOut = lightMapParams.rgb * lightColor.rgb;
|
vec3 lightColorOut = lightMapParams.rgb * lightcol;
|
||||||
vec4 addToResult = vec4(0.0);
|
vec4 addToResult = vec4(0.0);
|
||||||
|
|
||||||
// TODO: This needs to be removed when lightmapping is disabled
|
// TODO: This needs to be removed when lightmapping is disabled
|
||||||
|
|
|
||||||
|
|
@ -121,13 +121,14 @@ void main()
|
||||||
|
|
||||||
#endif // !NO_SHADOW
|
#endif // !NO_SHADOW
|
||||||
|
|
||||||
|
vec3 lightcol = lightColor.rgb;
|
||||||
#ifdef USE_COOKIE_TEX
|
#ifdef USE_COOKIE_TEX
|
||||||
|
|
||||||
// Lookup the cookie sample.
|
// Lookup the cookie sample.
|
||||||
vec4 cookie = texture( cookieMap, shadowCoord );
|
vec4 cookie = texture( cookieMap, shadowCoord );
|
||||||
|
|
||||||
// Multiply the light with the cookie tex.
|
// Multiply the light with the cookie tex.
|
||||||
lightColor.rgb *= cookie.rgb;
|
lightcol *= cookie.rgb;
|
||||||
|
|
||||||
// Use a maximum channel luminance to attenuate
|
// Use a maximum channel luminance to attenuate
|
||||||
// the lighting else we get specular in the dark
|
// the lighting else we get specular in the dark
|
||||||
|
|
@ -145,7 +146,7 @@ void main()
|
||||||
normalize( -eyeRay ) ) * lightBrightness * atten * shadowed;
|
normalize( -eyeRay ) ) * lightBrightness * atten * shadowed;
|
||||||
|
|
||||||
float Sat_NL_Att = saturate( nDotL * atten * shadowed ) * lightBrightness;
|
float Sat_NL_Att = saturate( nDotL * atten * shadowed ) * lightBrightness;
|
||||||
vec3 lightColorOut = lightMapParams.rgb * lightColor.rgb;
|
vec3 lightColorOut = lightMapParams.rgb * lightcol;
|
||||||
vec4 addToResult = vec4(0.0);
|
vec4 addToResult = vec4(0.0);
|
||||||
|
|
||||||
// TODO: This needs to be removed when lightmapping is disabled
|
// TODO: This needs to be removed when lightmapping is disabled
|
||||||
|
|
|
||||||
|
|
@ -192,13 +192,14 @@ float4 main( ConvexConnectP IN,
|
||||||
|
|
||||||
#endif // !NO_SHADOW
|
#endif // !NO_SHADOW
|
||||||
|
|
||||||
|
float3 lightcol = lightColor.rgb;
|
||||||
#ifdef USE_COOKIE_TEX
|
#ifdef USE_COOKIE_TEX
|
||||||
|
|
||||||
// Lookup the cookie sample.
|
// Lookup the cookie sample.
|
||||||
float4 cookie = texCUBE( cookieMap, mul( viewToLightProj, -lightVec ) );
|
float4 cookie = texCUBE( cookieMap, mul( viewToLightProj, -lightVec ) );
|
||||||
|
|
||||||
// Multiply the light with the cookie tex.
|
// Multiply the light with the cookie tex.
|
||||||
lightColor.rgb *= cookie.rgb;
|
lightcol *= cookie.rgb;
|
||||||
|
|
||||||
// Use a maximum channel luminance to attenuate
|
// Use a maximum channel luminance to attenuate
|
||||||
// the lighting else we get specular in the dark
|
// the lighting else we get specular in the dark
|
||||||
|
|
@ -216,7 +217,7 @@ float4 main( ConvexConnectP IN,
|
||||||
normalize( -eyeRay ) ) * lightBrightness * atten * shadowed;
|
normalize( -eyeRay ) ) * lightBrightness * atten * shadowed;
|
||||||
|
|
||||||
float Sat_NL_Att = saturate( nDotL * atten * shadowed ) * lightBrightness;
|
float Sat_NL_Att = saturate( nDotL * atten * shadowed ) * lightBrightness;
|
||||||
float3 lightColorOut = lightMapParams.rgb * lightColor.rgb;
|
float3 lightColorOut = lightMapParams.rgb * lightcol;
|
||||||
float4 addToResult = 0.0;
|
float4 addToResult = 0.0;
|
||||||
|
|
||||||
// TODO: This needs to be removed when lightmapping is disabled
|
// TODO: This needs to be removed when lightmapping is disabled
|
||||||
|
|
|
||||||
|
|
@ -120,13 +120,14 @@ float4 main( ConvexConnectP IN,
|
||||||
|
|
||||||
#endif // !NO_SHADOW
|
#endif // !NO_SHADOW
|
||||||
|
|
||||||
|
float3 lightcol = lightColor.rgb;
|
||||||
#ifdef USE_COOKIE_TEX
|
#ifdef USE_COOKIE_TEX
|
||||||
|
|
||||||
// Lookup the cookie sample.
|
// Lookup the cookie sample.
|
||||||
float4 cookie = tex2D( cookieMap, shadowCoord );
|
float4 cookie = tex2D( cookieMap, shadowCoord );
|
||||||
|
|
||||||
// Multiply the light with the cookie tex.
|
// Multiply the light with the cookie tex.
|
||||||
lightColor.rgb *= cookie.rgb;
|
lightcol *= cookie.rgb;
|
||||||
|
|
||||||
// Use a maximum channel luminance to attenuate
|
// Use a maximum channel luminance to attenuate
|
||||||
// the lighting else we get specular in the dark
|
// the lighting else we get specular in the dark
|
||||||
|
|
@ -144,7 +145,7 @@ float4 main( ConvexConnectP IN,
|
||||||
normalize( -eyeRay ) ) * lightBrightness * atten * shadowed;
|
normalize( -eyeRay ) ) * lightBrightness * atten * shadowed;
|
||||||
|
|
||||||
float Sat_NL_Att = saturate( nDotL * atten * shadowed ) * lightBrightness;
|
float Sat_NL_Att = saturate( nDotL * atten * shadowed ) * lightBrightness;
|
||||||
float3 lightColorOut = lightMapParams.rgb * lightColor.rgb;
|
float3 lightColorOut = lightMapParams.rgb * lightcol;
|
||||||
float4 addToResult = 0.0;
|
float4 addToResult = 0.0;
|
||||||
|
|
||||||
// TODO: This needs to be removed when lightmapping is disabled
|
// TODO: This needs to be removed when lightmapping is disabled
|
||||||
|
|
|
||||||
|
|
@ -50,7 +50,9 @@ function ForestEditorGui::onActiveForestUpdated( %this, %forest, %createNew )
|
||||||
/// Called from a message box when a forest is not found.
|
/// Called from a message box when a forest is not found.
|
||||||
function ForestEditorGui::createForest( %this )
|
function ForestEditorGui::createForest( %this )
|
||||||
{
|
{
|
||||||
if ( isObject( theForest ) )
|
%forestObject = parseMissionGroupForIds("Forest", "");
|
||||||
|
|
||||||
|
if ( isObject( %forestObject ) )
|
||||||
{
|
{
|
||||||
error( "Cannot create a second 'theForest' Forest!" );
|
error( "Cannot create a second 'theForest' Forest!" );
|
||||||
return;
|
return;
|
||||||
|
|
@ -64,8 +66,42 @@ function ForestEditorGui::createForest( %this )
|
||||||
};
|
};
|
||||||
|
|
||||||
MECreateUndoAction::submit( theForest );
|
MECreateUndoAction::submit( theForest );
|
||||||
|
|
||||||
ForestEditorInspector.inspect( theForest );
|
ForestEditorGui.setActiveForest( theForest );
|
||||||
|
|
||||||
|
//Re-initialize the editor settings so we can start using it immediately.
|
||||||
|
%tool = ForestEditorGui.getActiveTool();
|
||||||
|
if ( isObject( %tool ) )
|
||||||
|
%tool.onActivated();
|
||||||
|
|
||||||
|
if ( %tool == ForestTools->SelectionTool )
|
||||||
|
{
|
||||||
|
%mode = GlobalGizmoProfile.mode;
|
||||||
|
switch$ (%mode)
|
||||||
|
{
|
||||||
|
case "None":
|
||||||
|
ForestEditorSelectModeBtn.performClick();
|
||||||
|
case "Move":
|
||||||
|
ForestEditorMoveModeBtn.performClick();
|
||||||
|
case "Rotate":
|
||||||
|
ForestEditorRotateModeBtn.performClick();
|
||||||
|
case "Scale":
|
||||||
|
ForestEditorScaleModeBtn.performClick();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if ( %tool == ForestTools->BrushTool )
|
||||||
|
{
|
||||||
|
%mode = ForestTools->BrushTool.mode;
|
||||||
|
switch$ (%mode)
|
||||||
|
{
|
||||||
|
case "Paint":
|
||||||
|
ForestEditorPaintModeBtn.performClick();
|
||||||
|
case "Erase":
|
||||||
|
ForestEditorEraseModeBtn.performClick();
|
||||||
|
case "EraseSelected":
|
||||||
|
ForestEditorEraseSelectedModeBtn.performClick();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
EWorldEditor.isDirty = true;
|
EWorldEditor.isDirty = true;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -141,6 +141,13 @@ function ForestEditorPlugin::onActivated( %this )
|
||||||
ForestEditorPropertiesWindow.setVisible( true );
|
ForestEditorPropertiesWindow.setVisible( true );
|
||||||
ForestEditorGui.makeFirstResponder( true );
|
ForestEditorGui.makeFirstResponder( true );
|
||||||
//ForestEditToolbar.setVisible( true );
|
//ForestEditToolbar.setVisible( true );
|
||||||
|
|
||||||
|
//Get our existing forest object in our current mission if we have one
|
||||||
|
%forestObject = parseMissionGroupForIds("Forest", "");
|
||||||
|
if(isObject(%forestObject))
|
||||||
|
{
|
||||||
|
ForestEditorGui.setActiveForest(%forestObject.getName());
|
||||||
|
}
|
||||||
|
|
||||||
%this.map.push();
|
%this.map.push();
|
||||||
Parent::onActivated(%this);
|
Parent::onActivated(%this);
|
||||||
|
|
@ -232,9 +239,27 @@ function ForestEditorPlugin::clearDirty( %this )
|
||||||
function ForestEditorPlugin::onSaveMission( %this, %missionFile )
|
function ForestEditorPlugin::onSaveMission( %this, %missionFile )
|
||||||
{
|
{
|
||||||
ForestDataManager.saveDirty();
|
ForestDataManager.saveDirty();
|
||||||
|
|
||||||
if ( isObject( theForest ) )
|
//First, find out if we have an existing forest object
|
||||||
theForest.saveDataFile();
|
%forestObject = parseMissionGroupForIds("Forest", "");
|
||||||
|
|
||||||
|
if ( isObject( %forestObject ) )
|
||||||
|
{
|
||||||
|
//We do. Next, see if we have a file already by polling the datafield.
|
||||||
|
if(%forestObject.dataFile !$= "")
|
||||||
|
{
|
||||||
|
//If we do, just save to the provided file.
|
||||||
|
%forestObject.saveDataFile(%forestObject.dataFile);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
//We don't, so we'll save in the same place as the mission file and give it the missionpath\missionName.forest
|
||||||
|
//naming convention.
|
||||||
|
%path = filePath(%missionFile);
|
||||||
|
%missionName = fileBase(%missionFile);
|
||||||
|
%forestObject.saveDataFile(%path @ "/" @ %missionName @ ".forest");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
ForestBrushGroup.save( "art/forest/brushes.cs" );
|
ForestBrushGroup.save( "art/forest/brushes.cs" );
|
||||||
}
|
}
|
||||||
|
|
|
||||||
BIN
Templates/Full/game/tools/gui/images/expand-toolbar_d.png
Normal file
|
After Width: | Height: | Size: 309 B |
BIN
Templates/Full/game/tools/gui/images/expand-toolbar_h.png
Normal file
|
After Width: | Height: | Size: 477 B |
BIN
Templates/Full/game/tools/gui/images/expand-toolbar_n.png
Normal file
|
After Width: | Height: | Size: 452 B |
|
|
@ -22,7 +22,7 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
config.vm.synced_folder '../../', '/torque'
|
config.vm.synced_folder '../../../', '/torque'
|
||||||
|
|
||||||
config.vm.provision :shell, path: 'provision.sh'
|
config.vm.provision :shell, path: 'provision.sh'
|
||||||
if gui?
|
if gui?
|
||||||