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

This commit is contained in:
Thomas "elfprince13" Dickerson 2017-01-11 23:21:29 -05:00
parent bcc5459818
commit 27e2871b01
33 changed files with 304 additions and 304 deletions

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -257,15 +257,15 @@ PlayerData::PlayerData()
firstPersonShadows = false; firstPersonShadows = false;
// Used for third person image rendering // Used for third person image rendering
imageAnimPrefix = StringTable->insert(""); imageAnimPrefix = StringTable->EmptyString();
allowImageStateAnimation = false; allowImageStateAnimation = false;
// Used for first person image rendering // Used for first person image rendering
imageAnimPrefixFP = StringTable->insert(""); imageAnimPrefixFP = StringTable->EmptyString();
for (U32 i=0; i<ShapeBase::MaxMountedImages; ++i) for (U32 i=0; i<ShapeBase::MaxMountedImages; ++i)
{ {
shapeNameFP[i] = StringTable->insert(""); shapeNameFP[i] = StringTable->EmptyString();
mCRCFP[i] = 0; mCRCFP[i] = 0;
mValidShapeFP[i] = false; mValidShapeFP[i] = false;
} }
@ -418,7 +418,7 @@ PlayerData::PlayerData()
jumpTowardsNormal = true; jumpTowardsNormal = true;
physicsPlayerType = StringTable->insert(""); physicsPlayerType = StringTable->EmptyString();
dMemset( actionList, 0, sizeof(actionList) ); dMemset( actionList, 0, sizeof(actionList) );
} }
@ -6652,7 +6652,7 @@ DefineEngineMethod( Player, setActionThread, bool, ( const char* name, bool hold
"@tsexample\n" "@tsexample\n"
"// Place the player in a sitting position after being mounted\n" "// Place the player in a sitting position after being mounted\n"
"%player.setActionThread( \"sitting\", true, true );\n" "%player.setActionThread( \"sitting\", true, true );\n"
"@endtsexample\n") "@endtsexample\n")
{ {
return object->setActionThread( name, hold, true, fsp); return object->setActionThread( name, hold, true, fsp);
} }
@ -6700,11 +6700,11 @@ DefineEngineMethod( Player, clearControlObject, void, (),,
"Returns control to the player. This internally calls " "Returns control to the player. This internally calls "
"Player::setControlObject(0).\n" "Player::setControlObject(0).\n"
"@tsexample\n" "@tsexample\n"
"%player.clearControlObject();\n" "%player.clearControlObject();\n"
"echo(%player.getControlObject()); //<-- Returns 0, player assumes control\n" "echo(%player.getControlObject()); //<-- Returns 0, player assumes control\n"
"%player.setControlObject(%vehicle);\n" "%player.setControlObject(%vehicle);\n"
"echo(%player.getControlObject()); //<-- Returns %vehicle, player controls the vehicle now.\n" "echo(%player.getControlObject()); //<-- Returns %vehicle, player controls the vehicle now.\n"
"@endtsexample\n" "@endtsexample\n"
"@note If the player does not have a control object, the player will receive all moves " "@note If the player does not have a control object, the player will receive all moves "
"from its GameConnection. If you're looking to remove control from the player itself " "from its GameConnection. If you're looking to remove control from the player itself "
"(i.e. stop sending moves to the player) use GameConnection::setControlObject() to transfer " "(i.e. stop sending moves to the player) use GameConnection::setControlObject() to transfer "
@ -6762,63 +6762,63 @@ void Player::consoleInit()
"@brief Determines if the player is rendered or not.\n\n" "@brief Determines if the player is rendered or not.\n\n"
"Used on the client side to disable the rendering of all Player objects. This is " "Used on the client side to disable the rendering of all Player objects. This is "
"mainly for the tools or debugging.\n" "mainly for the tools or debugging.\n"
"@ingroup GameObjects\n"); "@ingroup GameObjects\n");
Con::addVariable("$player::renderMyItems",TypeBool, &sRenderMyItems, Con::addVariable("$player::renderMyItems",TypeBool, &sRenderMyItems,
"@brief Determines if mounted shapes are rendered or not.\n\n" "@brief Determines if mounted shapes are rendered or not.\n\n"
"Used on the client side to disable the rendering of all Player mounted objects. This is " "Used on the client side to disable the rendering of all Player mounted objects. This is "
"mainly used for the tools or debugging.\n" "mainly used for the tools or debugging.\n"
"@ingroup GameObjects\n"); "@ingroup GameObjects\n");
Con::addVariable("$player::renderCollision", TypeBool, &sRenderPlayerCollision, Con::addVariable("$player::renderCollision", TypeBool, &sRenderPlayerCollision,
"@brief Determines if the player's collision mesh should be rendered.\n\n" "@brief Determines if the player's collision mesh should be rendered.\n\n"
"This is mainly used for the tools and debugging.\n" "This is mainly used for the tools and debugging.\n"
"@ingroup GameObjects\n"); "@ingroup GameObjects\n");
Con::addVariable("$player::minWarpTicks",TypeF32,&sMinWarpTicks, Con::addVariable("$player::minWarpTicks",TypeF32,&sMinWarpTicks,
"@brief Fraction of tick at which instant warp occures on the client.\n\n" "@brief Fraction of tick at which instant warp occures on the client.\n\n"
"@ingroup GameObjects\n"); "@ingroup GameObjects\n");
Con::addVariable("$player::maxWarpTicks",TypeS32,&sMaxWarpTicks, Con::addVariable("$player::maxWarpTicks",TypeS32,&sMaxWarpTicks,
"@brief When a warp needs to occur due to the client being too far off from the server, this is the " "@brief When a warp needs to occur due to the client being too far off from the server, this is the "
"maximum number of ticks we'll allow the client to warp to catch up.\n\n" "maximum number of ticks we'll allow the client to warp to catch up.\n\n"
"@ingroup GameObjects\n"); "@ingroup GameObjects\n");
Con::addVariable("$player::maxPredictionTicks",TypeS32,&sMaxPredictionTicks, Con::addVariable("$player::maxPredictionTicks",TypeS32,&sMaxPredictionTicks,
"@brief Maximum number of ticks to predict on the client from the last known move obtained from the server.\n\n" "@brief Maximum number of ticks to predict on the client from the last known move obtained from the server.\n\n"
"@ingroup GameObjects\n"); "@ingroup GameObjects\n");
Con::addVariable("$player::maxImpulseVelocity", TypeF32, &sMaxImpulseVelocity, Con::addVariable("$player::maxImpulseVelocity", TypeF32, &sMaxImpulseVelocity,
"@brief The maximum velocity allowed due to a single impulse.\n\n" "@brief The maximum velocity allowed due to a single impulse.\n\n"
"@ingroup GameObjects\n"); "@ingroup GameObjects\n");
// Move triggers // Move triggers
Con::addVariable("$player::jumpTrigger", TypeS32, &sJumpTrigger, Con::addVariable("$player::jumpTrigger", TypeS32, &sJumpTrigger,
"@brief The move trigger index used for player jumping.\n\n" "@brief The move trigger index used for player jumping.\n\n"
"@ingroup GameObjects\n"); "@ingroup GameObjects\n");
Con::addVariable("$player::crouchTrigger", TypeS32, &sCrouchTrigger, Con::addVariable("$player::crouchTrigger", TypeS32, &sCrouchTrigger,
"@brief The move trigger index used for player crouching.\n\n" "@brief The move trigger index used for player crouching.\n\n"
"@ingroup GameObjects\n"); "@ingroup GameObjects\n");
Con::addVariable("$player::proneTrigger", TypeS32, &sProneTrigger, Con::addVariable("$player::proneTrigger", TypeS32, &sProneTrigger,
"@brief The move trigger index used for player prone pose.\n\n" "@brief The move trigger index used for player prone pose.\n\n"
"@ingroup GameObjects\n"); "@ingroup GameObjects\n");
Con::addVariable("$player::sprintTrigger", TypeS32, &sSprintTrigger, Con::addVariable("$player::sprintTrigger", TypeS32, &sSprintTrigger,
"@brief The move trigger index used for player sprinting.\n\n" "@brief The move trigger index used for player sprinting.\n\n"
"@ingroup GameObjects\n"); "@ingroup GameObjects\n");
Con::addVariable("$player::imageTrigger0", TypeS32, &sImageTrigger0, Con::addVariable("$player::imageTrigger0", TypeS32, &sImageTrigger0,
"@brief The move trigger index used to trigger mounted image 0.\n\n" "@brief The move trigger index used to trigger mounted image 0.\n\n"
"@ingroup GameObjects\n"); "@ingroup GameObjects\n");
Con::addVariable("$player::imageTrigger1", TypeS32, &sImageTrigger1, Con::addVariable("$player::imageTrigger1", TypeS32, &sImageTrigger1,
"@brief The move trigger index used to trigger mounted image 1 or alternate fire " "@brief The move trigger index used to trigger mounted image 1 or alternate fire "
"on mounted image 0.\n\n" "on mounted image 0.\n\n"
"@ingroup GameObjects\n"); "@ingroup GameObjects\n");
Con::addVariable("$player::jumpJetTrigger", TypeS32, &sJumpJetTrigger, Con::addVariable("$player::jumpJetTrigger", TypeS32, &sJumpJetTrigger,
"@brief The move trigger index used for player jump jetting.\n\n" "@brief The move trigger index used for player jump jetting.\n\n"
"@ingroup GameObjects\n"); "@ingroup GameObjects\n");
Con::addVariable("$player::vehicleDismountTrigger", TypeS32, &sVehicleDismountTrigger, Con::addVariable("$player::vehicleDismountTrigger", TypeS32, &sVehicleDismountTrigger,
"@brief The move trigger index used to dismount player.\n\n" "@brief The move trigger index used to dismount player.\n\n"
"@ingroup GameObjects\n"); "@ingroup GameObjects\n");
// ExtendedMove support // ExtendedMove support
Con::addVariable("$player::extendedMoveHeadPosRotIndex", TypeS32, &smExtendedMoveHeadPosRotIndex, Con::addVariable("$player::extendedMoveHeadPosRotIndex", TypeS32, &smExtendedMoveHeadPosRotIndex,
"@brief The ExtendedMove position/rotation index used for head movements.\n\n" "@brief The ExtendedMove position/rotation index used for head movements.\n\n"
"@ingroup GameObjects\n"); "@ingroup GameObjects\n");
} }
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------

View file

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

View file

@ -49,40 +49,40 @@ ConsoleDocClass( SimXMLDocument,
"// Thanks to Rex Hiebert for this example\n" "// Thanks to Rex Hiebert for this example\n"
"// Given the following XML\n" "// Given the following XML\n"
"<?xml version=\"1.0\" encoding=\"utf-8\" standalone=\"yes\" ?>\n" "<?xml version=\"1.0\" encoding=\"utf-8\" standalone=\"yes\" ?>\n"
"<DataTables>\n" "<DataTables>\n"
" <table tableName=\"2DShapes\">\n" " <table tableName=\"2DShapes\">\n"
" <rec id=\"1\">Triangle</rec>\n" " <rec id=\"1\">Triangle</rec>\n"
" <rec id=\"2\">Square</rec>\n" " <rec id=\"2\">Square</rec>\n"
" <rec id=\"3\">Circle</rec>\n" " <rec id=\"3\">Circle</rec>\n"
" </table>\n" " </table>\n"
" <table tableName=\"3DShapes\">\n" " <table tableName=\"3DShapes\">\n"
" <rec id=\"1\">Pyramid</rec>\n" " <rec id=\"1\">Pyramid</rec>\n"
" <rec id=\"2\">Cube</rec>\n" " <rec id=\"2\">Cube</rec>\n"
" <rec id=\"3\">Sphere</rec>\n" " <rec id=\"3\">Sphere</rec>\n"
" </table>\n" " </table>\n"
"</DataTables>\n\n" "</DataTables>\n\n"
"// Using SimXMLDocument by itself\n" "// Using SimXMLDocument by itself\n"
"function readXmlExample(%filename)\n" "function readXmlExample(%filename)\n"
"{\n" "{\n"
" %xml = new SimXMLDocument() {};\n" " %xml = new SimXMLDocument() {};\n"
" %xml.loadFile(%filename);\n\n" " %xml.loadFile(%filename);\n\n"
" %xml.pushChildElement(\"DataTables\");\n" " %xml.pushChildElement(\"DataTables\");\n"
" %xml.pushFirstChildElement(\"table\");\n" " %xml.pushFirstChildElement(\"table\");\n"
" while(true)\n" " while(true)\n"
" {\n" " {\n"
" echo(\"TABLE:\" SPC %xml.attribute(\"tableName\"));\n" " echo(\"TABLE:\" SPC %xml.attribute(\"tableName\"));\n"
" %xml.pushFirstChildElement(\"rec\");\n" " %xml.pushFirstChildElement(\"rec\");\n"
" while (true)\n" " while (true)\n"
" {\n" " {\n"
" %id = %xml.attribute(\"id\");\n" " %id = %xml.attribute(\"id\");\n"
" %desc = %xml.getData();\n" " %desc = %xml.getData();\n"
" echo(\" Shape\" SPC %id SPC %desc);\n" " echo(\" Shape\" SPC %id SPC %desc);\n"
" if (!%xml.nextSiblingElement(\"rec\")) break;\n" " if (!%xml.nextSiblingElement(\"rec\")) break;\n"
" }\n" " }\n"
" %xml.popElement();\n" " %xml.popElement();\n"
" if (!%xml.nextSiblingElement(\"table\")) break;\n" " if (!%xml.nextSiblingElement(\"table\")) break;\n"
" }\n" " }\n"
"}\n\n" "}\n\n"
"// Thanks to Scott Peal for this example\n" "// Thanks to Scott Peal for this example\n"
"// Using FileObject in conjunction with SimXMLDocument\n" "// Using FileObject in conjunction with SimXMLDocument\n"
@ -90,45 +90,45 @@ ConsoleDocClass( SimXMLDocument,
"// <Models>\n" "// <Models>\n"
"// <Model category=\"\" name=\"\" path=\"\" />\n" "// <Model category=\"\" name=\"\" path=\"\" />\n"
"// </Models>\n" "// </Models>\n"
"function getModelsInCatagory()\n" "function getModelsInCatagory()\n"
"{\n" "{\n"
" %file = \"./Catalog.xml\";\n" " %file = \"./Catalog.xml\";\n"
" %fo = new FileObject();\n" " %fo = new FileObject();\n"
" %text = \"\";\n\n" " %text = \"\";\n\n"
" if(%fo.openForRead(%file))\n" " if(%fo.openForRead(%file))\n"
" {\n" " {\n"
" while(!%fo.isEOF())\n" " while(!%fo.isEOF())\n"
" {\n" " {\n"
" %text = %text @ %fo.readLine();\n" " %text = %text @ %fo.readLine();\n"
" if (!%fo.isEOF()) %text = %text @ \"\\n\";\n" " if (!%fo.isEOF()) %text = %text @ \"\\n\";\n"
" }\n" " }\n"
" }\n" " }\n"
" else\n" " else\n"
" {\n" " {\n"
" echo(\"Unable to locate the file: \" @ %file);\n" " echo(\"Unable to locate the file: \" @ %file);\n"
" }\n\n" " }\n\n"
" %fo.delete();\n\n" " %fo.delete();\n\n"
" %xml = new SimXMLDocument() {};\n" " %xml = new SimXMLDocument() {};\n"
" %xml.parse(%text);\n" " %xml.parse(%text);\n"
" // \"Get\" inside of the root element, \"Models\".\n" " // \"Get\" inside of the root element, \"Models\".\n"
" %xml.pushChildElement(0);\n\n" " %xml.pushChildElement(0);\n\n"
" // \"Get\" into the first child element\n" " // \"Get\" into the first child element\n"
" if (%xml.pushFirstChildElement(\"Model\"))\n" " if (%xml.pushFirstChildElement(\"Model\"))\n"
" {\n" " {\n"
" while (true)\n" " while (true)\n"
" {\n" " {\n"
" // \n" " // \n"
" // Here, i read the element's attributes.\n" " // Here, i read the element's attributes.\n"
" // You might want to save these values in an array or call the %xml.getElementValue()\n" " // You might want to save these values in an array or call the %xml.getElementValue()\n"
" // if you have a different XML structure.\n\n" " // if you have a different XML structure.\n\n"
" %catagory = %xml.attribute(\"catagory\");\n" " %catagory = %xml.attribute(\"catagory\");\n"
" %name = %xml.attribute(\"name\");\n" " %name = %xml.attribute(\"name\");\n"
" %path = %xml.attribute(\"path\");\n\n" " %path = %xml.attribute(\"path\");\n\n"
" // now, read the next \"Model\"\n" " // now, read the next \"Model\"\n"
" if (!%xml.nextSiblingElement(\"Model\")) break;\n" " if (!%xml.nextSiblingElement(\"Model\")) break;\n"
" }\n" " }\n"
" }\n" " }\n"
"}\n" "}\n"
"@endtsexample\n\n" "@endtsexample\n\n"
"@note SimXMLDocument is a wrapper around TinyXml, a standard XML library. If you're familiar " "@note SimXMLDocument is a wrapper around TinyXml, a standard XML library. If you're familiar "
@ -504,13 +504,13 @@ const char* SimXMLDocument::elementValue()
{ {
if(m_paNode.empty()) if(m_paNode.empty())
{ {
return StringTable->insert(""); return StringTable->EmptyString();
} }
const S32 iLastElement = m_paNode.size() - 1; const S32 iLastElement = m_paNode.size() - 1;
TiXmlElement* pNode = m_paNode[iLastElement]; TiXmlElement* pNode = m_paNode[iLastElement];
if(!pNode) if(!pNode)
{ {
return StringTable->insert(""); return StringTable->EmptyString();
} }
return pNode->Value(); return pNode->Value();
@ -545,18 +545,18 @@ const char* SimXMLDocument::attribute(const char* rAttribute)
{ {
if(m_paNode.empty()) if(m_paNode.empty())
{ {
return StringTable->insert(""); return StringTable->EmptyString();
} }
const S32 iLastElement = m_paNode.size() - 1; const S32 iLastElement = m_paNode.size() - 1;
TiXmlElement* pNode = m_paNode[iLastElement]; TiXmlElement* pNode = m_paNode[iLastElement];
if(!pNode) if(!pNode)
{ {
return StringTable->insert(""); return StringTable->EmptyString();
} }
if(!pNode->Attribute(rAttribute)) if(!pNode->Attribute(rAttribute))
{ {
return StringTable->insert(""); return StringTable->EmptyString();
} }
return pNode->Attribute(rAttribute); return pNode->Attribute(rAttribute);
@ -629,20 +629,20 @@ const char* SimXMLDocument::firstAttribute()
// Get the current element // Get the current element
if(m_paNode.empty()) if(m_paNode.empty())
{ {
return StringTable->insert(""); return StringTable->EmptyString();
} }
const S32 iLastElement = m_paNode.size() - 1; const S32 iLastElement = m_paNode.size() - 1;
TiXmlElement* pNode = m_paNode[iLastElement]; TiXmlElement* pNode = m_paNode[iLastElement];
if(!pNode) if(!pNode)
{ {
return StringTable->insert(""); return StringTable->EmptyString();
} }
// Gets its first attribute, if any // Gets its first attribute, if any
m_CurrentAttribute = pNode->FirstAttribute(); m_CurrentAttribute = pNode->FirstAttribute();
if(!m_CurrentAttribute) if(!m_CurrentAttribute)
{ {
return StringTable->insert(""); return StringTable->EmptyString();
} }
return m_CurrentAttribute->Name(); return m_CurrentAttribute->Name();
@ -666,20 +666,20 @@ const char* SimXMLDocument::lastAttribute()
// Get the current element // Get the current element
if(m_paNode.empty()) if(m_paNode.empty())
{ {
return StringTable->insert(""); return StringTable->EmptyString();
} }
const S32 iLastElement = m_paNode.size() - 1; const S32 iLastElement = m_paNode.size() - 1;
TiXmlElement* pNode = m_paNode[iLastElement]; TiXmlElement* pNode = m_paNode[iLastElement];
if(!pNode) if(!pNode)
{ {
return StringTable->insert(""); return StringTable->EmptyString();
} }
// Gets its last attribute, if any // Gets its last attribute, if any
m_CurrentAttribute = pNode->LastAttribute(); m_CurrentAttribute = pNode->LastAttribute();
if(!m_CurrentAttribute) if(!m_CurrentAttribute)
{ {
return StringTable->insert(""); return StringTable->EmptyString();
} }
return m_CurrentAttribute->Name(); return m_CurrentAttribute->Name();
@ -703,14 +703,14 @@ const char* SimXMLDocument::nextAttribute()
{ {
if(!m_CurrentAttribute) if(!m_CurrentAttribute)
{ {
return StringTable->insert(""); return StringTable->EmptyString();
} }
// Gets its next attribute, if any // Gets its next attribute, if any
m_CurrentAttribute = m_CurrentAttribute->Next(); m_CurrentAttribute = m_CurrentAttribute->Next();
if(!m_CurrentAttribute) if(!m_CurrentAttribute)
{ {
return StringTable->insert(""); return StringTable->EmptyString();
} }
return m_CurrentAttribute->Name(); return m_CurrentAttribute->Name();
@ -734,14 +734,14 @@ const char* SimXMLDocument::prevAttribute()
{ {
if(!m_CurrentAttribute) if(!m_CurrentAttribute)
{ {
return StringTable->insert(""); return StringTable->EmptyString();
} }
// Gets its next attribute, if any // Gets its next attribute, if any
m_CurrentAttribute = m_CurrentAttribute->Previous(); m_CurrentAttribute = m_CurrentAttribute->Previous();
if(!m_CurrentAttribute) if(!m_CurrentAttribute)
{ {
return StringTable->insert(""); return StringTable->EmptyString();
} }
return m_CurrentAttribute->Name(); return m_CurrentAttribute->Name();

View file

@ -411,7 +411,7 @@ ObjectDeclNode *ObjectDeclNode::alloc( S32 lineNumber, ExprNode *classNameExpr,
if(parentObject) if(parentObject)
ret->parentObject = parentObject; ret->parentObject = parentObject;
else else
ret->parentObject = StringTable->insert(""); ret->parentObject = StringTable->EmptyString();
return ret; return ret;
} }

View file

@ -435,7 +435,7 @@ bool CodeBlock::read(StringTableEntry fileName, Stream &st)
if(offset < globalSize) if(offset < globalSize)
ste = StringTable->insert(globalStrings + offset); ste = StringTable->insert(globalStrings + offset);
else else
ste = StringTable->insert(""); ste = StringTable->EmptyString();
U32 count; U32 count;
st.read(&count); st.read(&count);
while(count--) while(count--)
@ -455,8 +455,8 @@ bool CodeBlock::read(StringTableEntry fileName, Stream &st)
bool CodeBlock::compile(const char *codeFileName, StringTableEntry fileName, const char *inScript, bool overrideNoDso) bool CodeBlock::compile(const char *codeFileName, StringTableEntry fileName, const char *inScript, bool overrideNoDso)
{ {
AssertFatal(Con::isMainThread(), "Compiling code on a secondary thread"); AssertFatal(Con::isMainThread(), "Compiling code on a secondary thread");
// This will return true, but return value is ignored // This will return true, but return value is ignored
char *script; char *script;
chompUTF8BOM( inScript, &script ); chompUTF8BOM( inScript, &script );
@ -572,8 +572,8 @@ bool CodeBlock::compile(const char *codeFileName, StringTableEntry fileName, con
ConsoleValueRef CodeBlock::compileExec(StringTableEntry fileName, const char *inString, bool noCalls, S32 setFrame) ConsoleValueRef CodeBlock::compileExec(StringTableEntry fileName, const char *inString, bool noCalls, S32 setFrame)
{ {
AssertFatal(Con::isMainThread(), "Compiling code on a secondary thread"); AssertFatal(Con::isMainThread(), "Compiling code on a secondary thread");
// Check for a UTF8 script file // Check for a UTF8 script file
char *string; char *string;
chompUTF8BOM( inString, &string ); chompUTF8BOM( inString, &string );

View file

@ -41,8 +41,8 @@ ConsoleDocClass( FieldBrushObject,
FieldBrushObject::FieldBrushObject() FieldBrushObject::FieldBrushObject()
{ {
// Reset Description. // Reset Description.
mDescription = StringTable->insert(""); mDescription = StringTable->EmptyString();
mSortName = StringTable->insert(""); mSortName = StringTable->EmptyString();
} }

View file

@ -328,7 +328,7 @@ void PersistenceManager::parseObject()
if (mParser.tokenICmp(")")) if (mParser.tokenICmp(")"))
{ {
mCurrentObject->name = StringTable->insert(""); mCurrentObject->name = StringTable->EmptyString();
mCurrentObject->nameLine = mParser.getCurrentLine(); mCurrentObject->nameLine = mParser.getCurrentLine();
mCurrentObject->namePosition = mParser.getTokenLineOffset(); mCurrentObject->namePosition = mParser.getTokenLineOffset();

View file

@ -85,7 +85,7 @@ ConsoleDocClass( GuiIconButtonCtrl,
GuiIconButtonCtrl::GuiIconButtonCtrl() GuiIconButtonCtrl::GuiIconButtonCtrl()
{ {
mBitmapName = StringTable->insert(""); mBitmapName = StringTable->EmptyString();
mTextLocation = TextLocLeft; mTextLocation = TextLocLeft;
mIconLocation = IconLocLeft; mIconLocation = IconLocLeft;
mTextMargin = 4; mTextMargin = 4;
@ -94,7 +94,7 @@ GuiIconButtonCtrl::GuiIconButtonCtrl()
mFitBitmapToButton = false; mFitBitmapToButton = false;
mMakeIconSquare = false; mMakeIconSquare = false;
mErrorBitmapName = StringTable->insert(""); mErrorBitmapName = StringTable->EmptyString();
mErrorTextureHandle = NULL; mErrorTextureHandle = NULL;
mAutoSize = false; mAutoSize = false;

View file

@ -49,7 +49,7 @@ ConsoleDocClass( GuiToggleButtonCtrl,
GuiToggleButtonCtrl::GuiToggleButtonCtrl() GuiToggleButtonCtrl::GuiToggleButtonCtrl()
{ {
setExtent(140, 30); setExtent(140, 30);
mButtonText = StringTable->insert(""); mButtonText = StringTable->EmptyString();
mStateOn = false; mStateOn = false;
mButtonType = ButtonTypeCheck; mButtonType = ButtonTypeCheck;
} }

View file

@ -43,7 +43,7 @@ ConsoleDocClass( GuiToolboxButtonCtrl,
//------------------------------------- //-------------------------------------
GuiToolboxButtonCtrl::GuiToolboxButtonCtrl() GuiToolboxButtonCtrl::GuiToolboxButtonCtrl()
{ {
mNormalBitmapName = StringTable->insert(""); mNormalBitmapName = StringTable->EmptyString();
mLoweredBitmapName = StringTable->insert("sceneeditor/client/images/buttondown"); mLoweredBitmapName = StringTable->insert("sceneeditor/client/images/buttondown");
mHoverBitmapName = StringTable->insert("sceneeditor/client/images/buttonup"); mHoverBitmapName = StringTable->insert("sceneeditor/client/images/buttonup");
setMinExtent(Point2I(16,16)); setMinExtent(Point2I(16,16));
@ -225,4 +225,4 @@ void GuiToolboxButtonCtrl::renderButton(GFXTexHandle &texture, Point2I &offset,
GFX->getDrawUtil()->drawBitmap(texture, finalOffset); GFX->getDrawUtil()->drawBitmap(texture, finalOffset);
renderChildControls( offset, updateRect); renderChildControls( offset, updateRect);
} }
} }

View file

@ -50,8 +50,8 @@ GuiFormCtrl::GuiFormCtrl()
mCaption = "[none]"; mCaption = "[none]";
mUseSmallCaption = false; mUseSmallCaption = false;
mContentLibrary = StringTable->insert(""); mContentLibrary = StringTable->EmptyString();
mContent = StringTable->insert(""); mContent = StringTable->EmptyString();
mCanSaveFieldDictionary = true; mCanSaveFieldDictionary = true;
mIsContainer = true; mIsContainer = true;
@ -213,7 +213,7 @@ bool GuiFormCtrl::resize(const Point2I &newPosition, const Point2I &newExtent)
static char buf[256]; static char buf[256];
mUseSmallCaption = true; mUseSmallCaption = true;
mSmallCaption = StringTable->insert(""); mSmallCaption = StringTable->EmptyString();
S32 strlen = dStrlen((const char*)mCaption); S32 strlen = dStrlen((const char*)mCaption);
for(S32 i=strlen; i>=0; --i) for(S32 i=strlen; i>=0; --i)

View file

@ -68,7 +68,7 @@ GuiPaneControl::GuiPaneControl()
mMouseOver = false; mMouseOver = false;
mDepressed = false; mDepressed = false;
mCaption = "A Pane"; mCaption = "A Pane";
mCaptionID = StringTable->insert(""); mCaptionID = StringTable->EmptyString();
mIsContainer = true; mIsContainer = true;
mOriginalExtents.set(10,10); mOriginalExtents.set(10,10);

View file

@ -1512,7 +1512,7 @@ void GuiWindowCtrl::setCloseCommand(const char *newCmd)
if (newCmd) if (newCmd)
mCloseCommand = StringTable->insert(newCmd); mCloseCommand = StringTable->insert(newCmd);
else else
mCloseCommand = StringTable->insert(""); mCloseCommand = StringTable->EmptyString();
} }
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------

View file

@ -38,7 +38,7 @@ GuiGameListMenuCtrl::GuiGameListMenuCtrl()
VECTOR_SET_ASSOCIATION(mRows); VECTOR_SET_ASSOCIATION(mRows);
// initialize the control callbacks // initialize the control callbacks
mCallbackOnA = StringTable->insert(""); mCallbackOnA = StringTable->EmptyString();
mCallbackOnB = mCallbackOnA; mCallbackOnB = mCallbackOnA;
mCallbackOnX = mCallbackOnA; mCallbackOnX = mCallbackOnA;
mCallbackOnY = mCallbackOnA; mCallbackOnY = mCallbackOnA;
@ -572,7 +572,7 @@ StringTableEntry GuiGameListMenuCtrl::getRowLabel(S32 rowIndex) const
if (! isValidRowIndex(rowIndex)) if (! isValidRowIndex(rowIndex))
{ {
// not a valid row index, don't do anything // not a valid row index, don't do anything
return StringTable->insert(""); return StringTable->EmptyString();
} }
return mRows[rowIndex]->mLabel; return mRows[rowIndex]->mLabel;
} }

View file

@ -1530,7 +1530,7 @@ void GuiListBoxCtrl::_mirror()
StringTableEntry GuiListBoxCtrl::_makeMirrorItemName( SimObject *inObj ) StringTableEntry GuiListBoxCtrl::_makeMirrorItemName( SimObject *inObj )
{ {
StringTableEntry outName = StringTable->insert(""); StringTableEntry outName = StringTable->EmptyString();
if ( mMakeNameCallback.isNotEmpty() ) if ( mMakeNameCallback.isNotEmpty() )
{ {
@ -1634,4 +1634,4 @@ void GuiListBoxCtrl::removeFilteredItem( String item )
break; break;
} }
} }
} }

View file

@ -251,7 +251,7 @@ GuiMLTextCtrl::GuiMLTextCtrl()
mIsEditCtrl( false ), mIsEditCtrl( false ),
mCursorPosition( false ), mCursorPosition( false ),
mMaxBufferSize( -1 ), mMaxBufferSize( -1 ),
mInitialText( StringTable->insert("") ), mInitialText( StringTable->EmptyString() ),
mSelectionActive( false ), mSelectionActive( false ),
mSelectionStart( 0 ), mSelectionStart( 0 ),
mSelectionEnd( 0 ), mSelectionEnd( 0 ),
@ -267,7 +267,7 @@ GuiMLTextCtrl::GuiMLTextCtrl()
mFontList( NULL ) mFontList( NULL )
{ {
mActive = true; mActive = true;
//mInitialText = StringTable->insert(""); //mInitialText = StringTable->EmptyString();
Sim::findObject("InputDeniedSound", mDeniedSound); Sim::findObject("InputDeniedSound", mDeniedSound);
} }

View file

@ -277,7 +277,7 @@ GuiPopUpMenuCtrl::GuiPopUpMenuCtrl(void)
mRenderScrollInNA = false; // Added mRenderScrollInNA = false; // Added
mBackgroundCancel = false; // Added mBackgroundCancel = false; // Added
mReverseTextList = false; // Added - Don't reverse text list if displaying up mReverseTextList = false; // Added - Don't reverse text list if displaying up
mBitmapName = StringTable->insert(""); // Added mBitmapName = StringTable->EmptyString(); // Added
mBitmapBounds.set(16, 16); // Added mBitmapBounds.set(16, 16); // Added
mIdMax = -1; mIdMax = -1;
} }

View file

@ -328,7 +328,7 @@ GuiPopUpMenuCtrlEx::GuiPopUpMenuCtrlEx(void)
mRenderScrollInNA = false; // Added mRenderScrollInNA = false; // Added
mBackgroundCancel = false; // Added mBackgroundCancel = false; // Added
mReverseTextList = false; // Added - Don't reverse text list if displaying up mReverseTextList = false; // Added - Don't reverse text list if displaying up
mBitmapName = StringTable->insert(""); // Added mBitmapName = StringTable->EmptyString(); // Added
mBitmapBounds.set(16, 16); // Added mBitmapBounds.set(16, 16); // Added
mHotTrackItems = false; mHotTrackItems = false;
mIdMax = -1; mIdMax = -1;

View file

@ -54,8 +54,8 @@ ConsoleDocClass( GuiTextCtrl,
GuiTextCtrl::GuiTextCtrl() GuiTextCtrl::GuiTextCtrl()
{ {
//default fonts //default fonts
mInitialText = StringTable->insert(""); mInitialText = StringTable->EmptyString();
mInitialTextID = StringTable->insert(""); mInitialTextID = StringTable->EmptyString();
mText[0] = '\0'; mText[0] = '\0';
mMaxStrLen = GuiTextCtrl::MAX_STRING_LENGTH; mMaxStrLen = GuiTextCtrl::MAX_STRING_LENGTH;
} }

View file

@ -1684,7 +1684,7 @@ DefineEngineMethod( GuiTextEditCtrl, getText, const char*, (),,
"@see GuiControl") "@see GuiControl")
{ {
if( !object->hasText() ) if( !object->hasText() )
return StringTable->insert(""); return StringTable->EmptyString();
char *retBuffer = Con::getReturnBuffer( GuiTextEditCtrl::MAX_STRING_LENGTH ); char *retBuffer = Con::getReturnBuffer( GuiTextEditCtrl::MAX_STRING_LENGTH );
object->getText( retBuffer ); object->getText( retBuffer );

View file

@ -845,7 +845,7 @@ GuiTreeViewCtrl::GuiTreeViewCtrl()
mClearAllOnSingleSelection = true; mClearAllOnSingleSelection = true;
mBitmapBase = StringTable->insert(""); mBitmapBase = StringTable->EmptyString();
mTexRollover = NULL; mTexRollover = NULL;
mTexSelected = NULL; mTexSelected = NULL;
@ -4746,13 +4746,13 @@ StringTableEntry GuiTreeViewCtrl::getTextToRoot( S32 itemId, const char * delimi
if(!item) if(!item)
{ {
Con::errorf(ConsoleLogEntry::General, "GuiTreeViewCtrl::getTextToRoot: invalid start item id!"); Con::errorf(ConsoleLogEntry::General, "GuiTreeViewCtrl::getTextToRoot: invalid start item id!");
return StringTable->insert(""); return StringTable->EmptyString();
} }
if(item->isInspectorData()) if(item->isInspectorData())
{ {
Con::errorf(ConsoleLogEntry::General, "GuiTreeViewCtrl::getTextToRoot: cannot get text to root of inspector data items"); Con::errorf(ConsoleLogEntry::General, "GuiTreeViewCtrl::getTextToRoot: cannot get text to root of inspector data items");
return StringTable->insert(""); return StringTable->EmptyString();
} }
char bufferOne[1024]; char bufferOne[1024];

View file

@ -50,7 +50,7 @@ GuiParticleGraphCtrl::GuiParticleGraphCtrl()
mPlots[i].mGraphMin.x = 0; mPlots[i].mGraphMin.x = 0;
mPlots[i].mGraphMin.y = 0; mPlots[i].mGraphMin.y = 0;
mPlots[i].mGraphType = Polyline; mPlots[i].mGraphType = Polyline;
mPlots[i].mGraphName = StringTable->insert(""); mPlots[i].mGraphName = StringTable->EmptyString();
mPlots[i].mHidden = false; mPlots[i].mHidden = false;
mPlots[i].mGraphScale = 0.05f; mPlots[i].mGraphScale = 0.05f;
} }

View file

@ -86,7 +86,7 @@ DefineEngineMethod( GuiChunkedBitmapCtrl, setBitmap, void, (const char* filename
GuiChunkedBitmapCtrl::GuiChunkedBitmapCtrl() GuiChunkedBitmapCtrl::GuiChunkedBitmapCtrl()
{ {
mBitmapName = StringTable->insert(""); mBitmapName = StringTable->EmptyString();
mUseVariable = false; mUseVariable = false;
mTile = false; mTile = false;
} }

View file

@ -218,8 +218,8 @@ InspectorFieldUndoAction::InspectorFieldUndoAction()
{ {
mObjId = 0; mObjId = 0;
mField = NULL; mField = NULL;
mSlotName = StringTable->insert(""); mSlotName = StringTable->EmptyString();
mArrayIdx = StringTable->insert(""); mArrayIdx = StringTable->EmptyString();
} }
InspectorFieldUndoAction::InspectorFieldUndoAction( const UTF8 *actionName ) InspectorFieldUndoAction::InspectorFieldUndoAction( const UTF8 *actionName )
@ -228,8 +228,8 @@ InspectorFieldUndoAction::InspectorFieldUndoAction( const UTF8 *actionName )
mInspector = NULL; mInspector = NULL;
mObjId = 0; mObjId = 0;
mField = NULL; mField = NULL;
mSlotName = StringTable->insert(""); mSlotName = StringTable->EmptyString();
mArrayIdx = StringTable->insert(""); mArrayIdx = StringTable->EmptyString();
} }
void InspectorFieldUndoAction::initPersistFields() void InspectorFieldUndoAction::initPersistFields()
@ -272,4 +272,4 @@ void InspectorFieldUndoAction::undo()
// Now save the previous data in this UndoAction // Now save the previous data in this UndoAction
// since an undo action must become a redo action and vice-versa // since an undo action must become a redo action and vice-versa
mData = data; mData = data;
} }

View file

@ -181,7 +181,7 @@ DefineConsoleFunction(NavMeshUpdateOne, void, (S32 meshid, S32 objid, bool remov
NavMesh::NavMesh() NavMesh::NavMesh()
{ {
mTypeMask |= StaticShapeObjectType | MarkerObjectType; mTypeMask |= StaticShapeObjectType | MarkerObjectType;
mFileName = StringTable->insert(""); mFileName = StringTable->EmptyString();
mNetFlags.clear(Ghostable); mNetFlags.clear(Ghostable);
mSaveIntermediates = false; mSaveIntermediates = false;
@ -211,7 +211,7 @@ NavMesh::NavMesh()
mLargeCharacters = false; mLargeCharacters = false;
mVehicles = false; mVehicles = false;
mCoverSet = StringTable->insert(""); mCoverSet = StringTable->EmptyString();
mInnerCover = false; mInnerCover = false;
mCoverDist = 1.0f; mCoverDist = 1.0f;
mPeekDist = 0.7f; mPeekDist = 0.7f;

View file

@ -170,7 +170,7 @@ const char *NavPath::getProtectedFrom(void *obj, const char *data)
if(object->mFromSet) if(object->mFromSet)
return data; return data;
else else
return StringTable->insert(""); return StringTable->EmptyString();
} }
const char *NavPath::getProtectedTo(void *obj, const char *data) const char *NavPath::getProtectedTo(void *obj, const char *data)
@ -180,7 +180,7 @@ const char *NavPath::getProtectedTo(void *obj, const char *data)
if(object->mToSet) if(object->mToSet)
return data; return data;
else else
return StringTable->insert(""); return StringTable->EmptyString();
} }
IRangeValidator ValidIterations(1, S32_MAX); IRangeValidator ValidIterations(1, S32_MAX);

View file

@ -51,7 +51,7 @@ PopupMenu::PopupMenu() : mCanvas(NULL)
mSubmenus = new SimSet; mSubmenus = new SimSet;
mSubmenus->registerObject(); mSubmenus->registerObject();
mBarTitle = StringTable->insert(""); mBarTitle = StringTable->EmptyString();
mIsPopup = false; mIsPopup = false;
mPopupGUID = sMaxPopupGUID++; mPopupGUID = sMaxPopupGUID++;

View file

@ -48,10 +48,10 @@ FileDialogData::FileDialogData()
if (mDefaultPath == StringTable->lookup("") || !Platform::isDirectory(mDefaultPath)) if (mDefaultPath == StringTable->lookup("") || !Platform::isDirectory(mDefaultPath))
mDefaultPath = Platform::getCurrentDirectory(); mDefaultPath = Platform::getCurrentDirectory();
mDefaultFile = StringTable->insert(""); mDefaultFile = StringTable->EmptyString();
mFilters = StringTable->insert(""); mFilters = StringTable->EmptyString();
mFile = StringTable->insert(""); mFile = StringTable->EmptyString();
mTitle = StringTable->insert(""); mTitle = StringTable->EmptyString();
mStyle = 0; mStyle = 0;