Replaced StringTable->insert("") with StringTable->EmptyString()

This commit is contained in:
Thomas "elfprince13" Dickerson 2017-01-11 23:21:29 -05:00
parent 7cf20413c3
commit 332c06ae82
33 changed files with 1178 additions and 1178 deletions

View file

@ -64,16 +64,16 @@
class fxFoliageItem
{
public:
MatrixF Transform;
F32 Width;
F32 Height;
Box3F FoliageBox;
bool Flipped;
MatrixF Transform;
F32 Width;
F32 Height;
Box3F FoliageBox;
bool Flipped;
F32 SwayPhase;
F32 SwayTimeRatio;
F32 LightPhase;
F32 LightPhase;
F32 LightTimeRatio;
U32 LastFrameSerialID;
U32 LastFrameSerialID;
};
//------------------------------------------------------------------------------
@ -104,9 +104,9 @@ public:
Box3F QuadrantBox;
fxFoliageQuadrantNode* QuadrantChildNode[4];
Vector<fxFoliageItem*> RenderList;
// Used in DrawIndexPrimitive call.
U32 startIndex;
U32 primitiveCount;
// Used in DrawIndexPrimitive call.
U32 startIndex;
U32 primitiveCount;
};
@ -152,7 +152,7 @@ protected:
void CreateFoliage(void);
void DestroyFoliage(void);
void DestroyFoliageItems();
void DestroyFoliageItems();
void SyncFoliageReplicators(void);
@ -172,11 +172,11 @@ protected:
Vector<fxFoliageItem*> mReplicatedFoliage;
fxFoliageRenderList mFrustumRenderSet;
GFXVertexBufferHandle<GFXVertexFoliage> mVertexBuffer;
GFXPrimitiveBufferHandle mPrimBuffer;
GFXVertexBufferHandle<GFXVertexFoliage> mVertexBuffer;
GFXPrimitiveBufferHandle mPrimBuffer;
GFXShaderRef mShader;
ShaderData* mShaderData;
GBitmap* mAlphaLookup;
GBitmap* mAlphaLookup;
MRandomLCG RandomGen;
F32 mFadeInGradient;
@ -193,8 +193,8 @@ protected:
U32 mNextAllocatedNodeIdx; // Next Allocated Node Index.
U32 mBillboardsAcquired; // Billboards Acquired.
// Used for alpha lookup in the pixel shader
GFXTexHandle mAlphaTexture;
// Used for alpha lookup in the pixel shader
GFXTexHandle mAlphaTexture;
GFXStateBlockRef mPlacementSB;
GFXStateBlockRef mRenderSB;
@ -223,15 +223,15 @@ protected:
bool mDirty;
void SetupShader();
void SetupBuffers();
void SetupBuffers();
void renderObject(ObjectRenderInst *ri, SceneRenderState *state, BaseMatInstance*);
void renderBuffers(SceneRenderState* state);
void renderArc(const F32 fRadiusX, const F32 fRadiusY);
void renderPlacementArea(const F32 ElapsedTime);
void renderQuad(fxFoliageQuadrantNode* quadNode, const MatrixF& RenderTransform, const bool UseDebug);
void computeAlphaTex();
void renderBuffers(SceneRenderState* state);
void renderArc(const F32 fRadiusX, const F32 fRadiusY);
void renderPlacementArea(const F32 ElapsedTime);
void renderQuad(fxFoliageQuadrantNode* quadNode, const MatrixF& RenderTransform, const bool UseDebug);
void computeAlphaTex();
public:
fxFoliageReplicator();
~fxFoliageReplicator();
@ -325,7 +325,7 @@ public:
mUseDebugInfo = false;
mDebugBoxHeight = 1.0f;
mSeed = 1376312589;
mFoliageFile = StringTable->insert("");
mFoliageFile = StringTable->EmptyString();
mFoliageTexture = GFXTexHandle();
mFoliageCount = 10;
mFoliageRetries = 100;

View file

@ -153,7 +153,7 @@ public:
{
// Set Defaults.
mSeed = 1376312589;
mShapeFile = StringTable->insert("");
mShapeFile = StringTable->EmptyString();
mShapeCount = 10;
mShapeRetries = 100;
mInnerRadiusX = 0;

View file

@ -129,10 +129,10 @@ PrecipitationData::PrecipitationData()
{
soundProfile = NULL;
mDropName = StringTable->insert("");
mDropShaderName = StringTable->insert("");
mSplashName = StringTable->insert("");
mSplashShaderName = StringTable->insert("");
mDropName = StringTable->EmptyString();
mDropShaderName = StringTable->EmptyString();
mSplashName = StringTable->EmptyString();
mSplashShaderName = StringTable->EmptyString();
mDropsPerSide = 4;
mSplashesPerSide = 2;

View file

@ -57,7 +57,7 @@ RibbonData::RibbonData()
mUseFadeOut = false;
mFadeAwayStep = 0.032f;
segmentsPerUpdate = 1;
mMatName = StringTable->insert("");
mMatName = StringTable->EmptyString();
mTileScale = 1.0f;
mFixedTexcoords = false;
mSegmentSkipAmount = 0;
@ -318,7 +318,7 @@ void Ribbon::processTick(const Move* move)
safeDeleteObject();
return;
//}
//mSegmentPoints.pop_back();
//mSegmentPoints.pop_back();
}
@ -456,7 +456,7 @@ void Ribbon::setShaderParams() {
F32 length = (F32)mDataBlock->mRibbonLength;
Point3F radius(numSegments / length, numSegments, length);
MaterialParameters* matParams = mRibbonMat->getMaterialParameters();
matParams->setSafe( mRadiusSC, radius );
matParams->setSafe( mRadiusSC, radius );
}
//--------------------------------------------------------------------------

View file

@ -225,7 +225,7 @@ ConsoleDocClass( WayPoint,
WayPoint::WayPoint()
{
mName = StringTable->insert("");
mName = StringTable->EmptyString();
}
void WayPoint::setHidden(bool hidden)
@ -256,7 +256,7 @@ void WayPoint::inspectPostApply()
{
Parent::inspectPostApply();
if(!mName || !mName[0])
mName = StringTable->insert("");
mName = StringTable->EmptyString();
setMaskBits(UpdateNameMask|UpdateTeamMask);
}
@ -281,7 +281,7 @@ void WayPoint::unpackUpdate(NetConnection * con, BitStream * stream)
void WayPoint::initPersistFields()
{
addGroup("Misc");
addGroup("Misc");
addField("markerName", TypeCaseString, Offset(mName, WayPoint), "Unique name representing this waypoint");
endGroup("Misc");
Parent::initPersistFields();
@ -363,7 +363,7 @@ bool SpawnSphere::onAdd()
if (!isGhost())
{
onAdd_callback( getId());
onAdd_callback( getId());
if (mAutoSpawn)
spawnObject();
@ -527,7 +527,7 @@ ConsoleDocClass( CameraBookmark,
CameraBookmark::CameraBookmark()
{
mName = StringTable->insert("");
mName = StringTable->EmptyString();
}
bool CameraBookmark::onAdd()
@ -571,7 +571,7 @@ void CameraBookmark::inspectPostApply()
{
Parent::inspectPostApply();
if(!mName || !mName[0])
mName = StringTable->insert("");
mName = StringTable->EmptyString();
setMaskBits(UpdateNameMask);
if( isMethod("onInspectPostApply") )
@ -595,7 +595,7 @@ void CameraBookmark::unpackUpdate(NetConnection * con, BitStream * stream)
void CameraBookmark::initPersistFields()
{
//addGroup("Misc");
//addGroup("Misc");
//addField("name", TypeCaseString, Offset(mName, CameraBookmark));
//endGroup("Misc");

View file

@ -257,15 +257,15 @@ PlayerData::PlayerData()
firstPersonShadows = false;
// Used for third person image rendering
imageAnimPrefix = StringTable->insert("");
imageAnimPrefix = StringTable->EmptyString();
allowImageStateAnimation = false;
// Used for first person image rendering
imageAnimPrefixFP = StringTable->insert("");
imageAnimPrefixFP = StringTable->EmptyString();
for (U32 i=0; i<ShapeBase::MaxMountedImages; ++i)
{
shapeNameFP[i] = StringTable->insert("");
shapeNameFP[i] = StringTable->EmptyString();
mCRCFP[i] = 0;
mValidShapeFP[i] = false;
}
@ -418,7 +418,7 @@ PlayerData::PlayerData()
jumpTowardsNormal = true;
physicsPlayerType = StringTable->insert("");
physicsPlayerType = StringTable->EmptyString();
dMemset( actionList, 0, sizeof(actionList) );
}

View file

@ -152,13 +152,13 @@ ShapeBaseData::ShapeBaseData()
shadowMaxVisibleDistance( 80.0f ),
shadowProjectionDistance( 10.0f ),
shadowSphereAdjust( 1.0f ),
shapeName( StringTable->insert("") ),
cloakTexName( StringTable->insert("") ),
shapeName( StringTable->EmptyString() ),
cloakTexName( StringTable->EmptyString() ),
cubeDescId( 0 ),
reflectorDesc( NULL ),
debris( NULL ),
debrisID( 0 ),
debrisShapeName( StringTable->insert("") ),
debrisShapeName( StringTable->EmptyString() ),
explosion( NULL ),
explosionID( 0 ),
underwaterExplosion( NULL ),
@ -447,12 +447,12 @@ bool ShapeBaseData::_setMass( void* object, const char* index, const char* data
{
ShapeBaseData* shape = reinterpret_cast< ShapeBaseData* >( object );
F32 mass = dAtof(data);
F32 mass = dAtof(data);
if (mass <= 0)
mass = 0.01f;
if (mass <= 0)
mass = 0.01f;
shape->mass = mass;
shape->mass = mass;
return false;
}
@ -935,8 +935,8 @@ ShapeBase::ShapeBase()
mScriptThread[i].thread = 0;
mScriptThread[i].state = Thread::Stop;
mScriptThread[i].atEnd = false;
mScriptThread[i].timescale = 1.f;
mScriptThread[i].position = -1.f;
mScriptThread[i].timescale = 1.f;
mScriptThread[i].position = -1.f;
}
for (i = 0; i < MaxTriggerKeys; i++)
@ -1042,7 +1042,7 @@ bool ShapeBase::onAdd()
}
/*
if(mDataBlock->cloakTexName != StringTable->insert(""))
if(mDataBlock->cloakTexName != StringTable->EmptyString())
mCloakTexture = TextureHandle(mDataBlock->cloakTexName, MeshTexture, false);
*/
// Accumulation and environment mapping
@ -1512,8 +1512,8 @@ void ShapeBase::onCameraScopeQuery(NetConnection *cr, CameraScopeQuery * query)
eyeTransform.getColumn(1, &query->orientation);
// Get the visible distance.
if (getSceneManager() != NULL)
query->visibleDistance = getSceneManager()->getVisibleDistance();
if (getSceneManager() != NULL)
query->visibleDistance = getSceneManager()->getVisibleDistance();
Parent::onCameraScopeQuery( cr, query );
}
@ -2154,18 +2154,18 @@ void ShapeBase::updateAudioPos()
const char *ShapeBase::getThreadSequenceName( U32 slot )
{
Thread& st = mScriptThread[slot];
if ( st.sequence == -1 )
{
// Invalid Animation.
return "";
}
Thread& st = mScriptThread[slot];
if ( st.sequence == -1 )
{
// Invalid Animation.
return "";
}
// Name Index
const U32 nameIndex = getShape()->sequences[st.sequence].nameIndex;
// Name Index
const U32 nameIndex = getShape()->sequences[st.sequence].nameIndex;
// Return Name.
return getShape()->getName( nameIndex );
// Return Name.
return getShape()->getName( nameIndex );
}
bool ShapeBase::setThreadSequence(U32 slot, S32 seq, bool reset)
@ -2200,39 +2200,39 @@ bool ShapeBase::setThreadSequence(U32 slot, S32 seq, bool reset)
void ShapeBase::updateThread(Thread& st)
{
switch (st.state)
{
case Thread::Stop:
{
mShapeInstance->setTimeScale( st.thread, 1.f );
mShapeInstance->setPos( st.thread, ( st.timescale > 0.f ) ? 1.0f : 0.0f );
} // Drop through to pause state
switch (st.state)
{
case Thread::Stop:
{
mShapeInstance->setTimeScale( st.thread, 1.f );
mShapeInstance->setPos( st.thread, ( st.timescale > 0.f ) ? 1.0f : 0.0f );
} // Drop through to pause state
case Thread::Pause:
{
mShapeInstance->setTimeScale( st.thread, 0.f );
} break;
case Thread::Pause:
{
mShapeInstance->setTimeScale( st.thread, 0.f );
} break;
case Thread::Play:
{
if (st.atEnd)
{
mShapeInstance->setTimeScale(st.thread,1);
mShapeInstance->setPos( st.thread, ( st.timescale > 0.f ) ? 1.0f : 0.0f );
mShapeInstance->setTimeScale(st.thread,0);
case Thread::Play:
{
if (st.atEnd)
{
mShapeInstance->setTimeScale(st.thread,1);
mShapeInstance->setPos( st.thread, ( st.timescale > 0.f ) ? 1.0f : 0.0f );
mShapeInstance->setTimeScale(st.thread,0);
st.state = Thread::Stop;
}
else
{
if ( st.position != -1.f )
{
mShapeInstance->setTimeScale( st.thread, 1.f );
mShapeInstance->setPos( st.thread, st.position );
}
}
else
{
if ( st.position != -1.f )
{
mShapeInstance->setTimeScale( st.thread, 1.f );
mShapeInstance->setPos( st.thread, st.position );
}
mShapeInstance->setTimeScale(st.thread, st.timescale );
}
} break;
mShapeInstance->setTimeScale(st.thread, st.timescale );
}
} break;
case Thread::Destroy:
{
@ -2244,7 +2244,7 @@ void ShapeBase::updateThread(Thread& st)
st.thread = 0;
}
} break;
}
}
}
bool ShapeBase::stopThread(U32 slot)
@ -2297,50 +2297,50 @@ bool ShapeBase::playThread(U32 slot)
bool ShapeBase::setThreadPosition( U32 slot, F32 pos )
{
Thread& st = mScriptThread[slot];
if (st.sequence != -1)
{
setMaskBits(ThreadMaskN << slot);
st.position = pos;
st.atEnd = false;
updateThread(st);
Thread& st = mScriptThread[slot];
if (st.sequence != -1)
{
setMaskBits(ThreadMaskN << slot);
st.position = pos;
st.atEnd = false;
updateThread(st);
return true;
}
return false;
return true;
}
return false;
}
bool ShapeBase::setThreadDir(U32 slot,bool forward)
{
Thread& st = mScriptThread[slot];
if (st.sequence != -1)
{
if ( ( st.timescale >= 0.f ) != forward )
{
setMaskBits(ThreadMaskN << slot);
st.timescale *= -1.f ;
st.atEnd = false;
updateThread(st);
}
return true;
}
return false;
Thread& st = mScriptThread[slot];
if (st.sequence != -1)
{
if ( ( st.timescale >= 0.f ) != forward )
{
setMaskBits(ThreadMaskN << slot);
st.timescale *= -1.f ;
st.atEnd = false;
updateThread(st);
}
return true;
}
return false;
}
bool ShapeBase::setThreadTimeScale( U32 slot, F32 timeScale )
{
Thread& st = mScriptThread[slot];
if (st.sequence != -1)
{
if (st.timescale != timeScale)
{
setMaskBits(ThreadMaskN << slot);
st.timescale = timeScale;
updateThread(st);
}
return true;
}
return false;
Thread& st = mScriptThread[slot];
if (st.sequence != -1)
{
if (st.timescale != timeScale)
{
setMaskBits(ThreadMaskN << slot);
st.timescale = timeScale;
updateThread(st);
}
return true;
}
return false;
}
void ShapeBase::advanceThreads(F32 dt)
@ -2349,7 +2349,7 @@ void ShapeBase::advanceThreads(F32 dt)
Thread& st = mScriptThread[i];
if (st.thread) {
if (!mShapeInstance->getShape()->sequences[st.sequence].isCyclic() && !st.atEnd &&
( ( st.timescale > 0.f )? mShapeInstance->getPos(st.thread) >= 1.0:
( ( st.timescale > 0.f )? mShapeInstance->getPos(st.thread) >= 1.0:
mShapeInstance->getPos(st.thread) <= 0)) {
st.atEnd = true;
updateThread(st);
@ -4392,7 +4392,7 @@ DefineEngineMethod( ShapeBase, isEnabled, bool, (),,
DefineEngineMethod(ShapeBase, blowUp, void, (),, "@brief Explodes an object into pieces.")
{
object->blowUp();
object->blowUp();
}
DefineEngineMethod( ShapeBase, applyDamage, void, ( F32 amount ),,
@ -4696,22 +4696,22 @@ void ShapeBase::consoleInit()
"@see ShapeBase::setDamageFlash()\n"
"@see ShapeBase::getDamageFlash()\n"
"@note Relies on the flash postFx.\n"
"@ingroup gameObjects\n");
"@ingroup gameObjects\n");
Con::addVariable("SB::WODec", TypeF32, &sWhiteoutDec, "Speed to reduce the whiteout effect per tick.\n\n"
"@see ShapeBase::setWhiteOut()\n"
"@see ShapeBase::getWhiteOut"
"@note Relies on the flash postFx.\n"
"@ingroup gameObjects\n");
"@ingroup gameObjects\n");
Con::addVariable("SB::FullCorrectionDistance", TypeF32, &sFullCorrectionDistance,
"@brief Distance at which a weapon's muzzle vector is fully corrected to match where the player is looking.\n\n"
"When a weapon image has correctMuzzleVector set and the Player is in 1st person, the muzzle vector from the "
"weapon is modified to match where the player is looking. Beyond the FullCorrectionDistance the muzzle vector "
"is always corrected. Between FullCorrectionDistance and the player, the weapon's muzzle vector is adjusted so that "
"the closer the aim point is to the player, the closer the muzzle vector is to the true (non-corrected) one.\n"
"@ingroup gameObjects\n");
"@ingroup gameObjects\n");
Con::addVariable("SB::CloakSpeed", TypeF32, &sCloakSpeed,
"@brief Time to cloak, in seconds.\n\n"
"@ingroup gameObjects\n");
"@ingroup gameObjects\n");
}
void ShapeBase::_updateHiddenMeshes()
@ -4832,17 +4832,17 @@ DefineEngineMethod( ShapeBase, getTargetName, const char*, ( S32 index ),,
"@see getTargetCount()\n")
{
ShapeBase *obj = dynamic_cast< ShapeBase* > ( object );
if(obj)
{
// Try to use the client object (so we get the reskinned targets in the Material Editor)
if ((ShapeBase*)obj->getClientObject())
obj = (ShapeBase*)obj->getClientObject();
ShapeBase *obj = dynamic_cast< ShapeBase* > ( object );
if(obj)
{
// Try to use the client object (so we get the reskinned targets in the Material Editor)
if ((ShapeBase*)obj->getClientObject())
obj = (ShapeBase*)obj->getClientObject();
return obj->getShapeInstance()->getTargetName(index);
}
return obj->getShapeInstance()->getTargetName(index);
}
return "";
return "";
}
DefineEngineMethod( ShapeBase, getTargetCount, S32, (),,
@ -4861,7 +4861,7 @@ DefineEngineMethod( ShapeBase, getTargetCount, S32, (),,
if (obj->getShapeInstance() != NULL)
return obj->getShapeInstance()->getTargetCount();
}
}
return -1;
}
@ -4938,10 +4938,10 @@ DefineEngineMethod( ShapeBase, getModelFile, const char *, (),,
"@return the shape filename\n\n" )
{
GameBaseData * datablock = object->getDataBlock();
if( !datablock )
return String::EmptyString;
GameBaseData * datablock = object->getDataBlock();
if( !datablock )
return String::EmptyString;
const char *fieldName = StringTable->insert( String("shapeFile") );
const char *fieldName = StringTable->insert( String("shapeFile") );
return datablock->getDataField( fieldName, NULL );
}