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
{
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) );
}
@ -6652,7 +6652,7 @@ DefineEngineMethod( Player, setActionThread, bool, ( const char* name, bool hold
"@tsexample\n"
"// Place the player in a sitting position after being mounted\n"
"%player.setActionThread( \"sitting\", true, true );\n"
"@endtsexample\n")
"@endtsexample\n")
{
return object->setActionThread( name, hold, true, fsp);
}
@ -6700,11 +6700,11 @@ DefineEngineMethod( Player, clearControlObject, void, (),,
"Returns control to the player. This internally calls "
"Player::setControlObject(0).\n"
"@tsexample\n"
"%player.clearControlObject();\n"
"%player.clearControlObject();\n"
"echo(%player.getControlObject()); //<-- Returns 0, player assumes control\n"
"%player.setControlObject(%vehicle);\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 "
"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 "
@ -6762,63 +6762,63 @@ void Player::consoleInit()
"@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 "
"mainly for the tools or debugging.\n"
"@ingroup GameObjects\n");
"@ingroup GameObjects\n");
Con::addVariable("$player::renderMyItems",TypeBool, &sRenderMyItems,
"@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 "
"mainly used for the tools or debugging.\n"
"@ingroup GameObjects\n");
"@ingroup GameObjects\n");
Con::addVariable("$player::renderCollision", TypeBool, &sRenderPlayerCollision,
"@brief Determines if the player's collision mesh should be rendered.\n\n"
"This is mainly used for the tools and debugging.\n"
"@ingroup GameObjects\n");
"@ingroup GameObjects\n");
Con::addVariable("$player::minWarpTicks",TypeF32,&sMinWarpTicks,
"@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,
"@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"
"@ingroup GameObjects\n");
"@ingroup GameObjects\n");
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"
"@ingroup GameObjects\n");
"@ingroup GameObjects\n");
Con::addVariable("$player::maxImpulseVelocity", TypeF32, &sMaxImpulseVelocity,
"@brief The maximum velocity allowed due to a single impulse.\n\n"
"@ingroup GameObjects\n");
"@ingroup GameObjects\n");
// Move triggers
Con::addVariable("$player::jumpTrigger", TypeS32, &sJumpTrigger,
"@brief The move trigger index used for player jumping.\n\n"
"@ingroup GameObjects\n");
"@ingroup GameObjects\n");
Con::addVariable("$player::crouchTrigger", TypeS32, &sCrouchTrigger,
"@brief The move trigger index used for player crouching.\n\n"
"@ingroup GameObjects\n");
"@ingroup GameObjects\n");
Con::addVariable("$player::proneTrigger", TypeS32, &sProneTrigger,
"@brief The move trigger index used for player prone pose.\n\n"
"@ingroup GameObjects\n");
"@ingroup GameObjects\n");
Con::addVariable("$player::sprintTrigger", TypeS32, &sSprintTrigger,
"@brief The move trigger index used for player sprinting.\n\n"
"@ingroup GameObjects\n");
"@ingroup GameObjects\n");
Con::addVariable("$player::imageTrigger0", TypeS32, &sImageTrigger0,
"@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,
"@brief The move trigger index used to trigger mounted image 1 or alternate fire "
"on mounted image 0.\n\n"
"@ingroup GameObjects\n");
"@ingroup GameObjects\n");
Con::addVariable("$player::jumpJetTrigger", TypeS32, &sJumpJetTrigger,
"@brief The move trigger index used for player jump jetting.\n\n"
"@ingroup GameObjects\n");
"@ingroup GameObjects\n");
Con::addVariable("$player::vehicleDismountTrigger", TypeS32, &sVehicleDismountTrigger,
"@brief The move trigger index used to dismount player.\n\n"
"@ingroup GameObjects\n");
"@ingroup GameObjects\n");
// ExtendedMove support
Con::addVariable("$player::extendedMoveHeadPosRotIndex", TypeS32, &smExtendedMoveHeadPosRotIndex,
"@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 ),
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 );
}

View file

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

View file

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

View file

@ -435,7 +435,7 @@ bool CodeBlock::read(StringTableEntry fileName, Stream &st)
if(offset < globalSize)
ste = StringTable->insert(globalStrings + offset);
else
ste = StringTable->insert("");
ste = StringTable->EmptyString();
U32 count;
st.read(&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)
{
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
char *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)
{
AssertFatal(Con::isMainThread(), "Compiling code on a secondary thread");
AssertFatal(Con::isMainThread(), "Compiling code on a secondary thread");
// Check for a UTF8 script file
char *string;
chompUTF8BOM( inString, &string );

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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