mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-03-06 14:00:39 +00:00
Merge pull request #2236 from Azaezel/memberMess
cleans up all 'hides' warnings (at time of writing)
This commit is contained in:
commit
5a1af9ccd7
233 changed files with 4370 additions and 4418 deletions
|
|
@ -52,7 +52,7 @@ enum TypeReq
|
|||
/// each representing a different language construct.
|
||||
struct StmtNode
|
||||
{
|
||||
StmtNode *next; ///< Next entry in parse tree.
|
||||
StmtNode *mNext; ///< Next entry in parse tree.
|
||||
|
||||
StmtNode();
|
||||
virtual ~StmtNode() {}
|
||||
|
|
@ -62,7 +62,7 @@ struct StmtNode
|
|||
|
||||
///
|
||||
void append(StmtNode *next);
|
||||
StmtNode *getNext() const { return next; }
|
||||
StmtNode *getNext() const { return mNext; }
|
||||
|
||||
/// @}
|
||||
|
||||
|
|
|
|||
|
|
@ -140,7 +140,7 @@ void StmtNode::addBreakLine(CodeStream &code)
|
|||
|
||||
StmtNode::StmtNode()
|
||||
{
|
||||
next = NULL;
|
||||
mNext = NULL;
|
||||
dbgFileName = CodeBlock::smCurrentParser->getCurrentFile();
|
||||
}
|
||||
|
||||
|
|
@ -151,9 +151,9 @@ void StmtNode::setPackage(StringTableEntry)
|
|||
void StmtNode::append(StmtNode *next)
|
||||
{
|
||||
StmtNode *walk = this;
|
||||
while (walk->next)
|
||||
walk = walk->next;
|
||||
walk->next = next;
|
||||
while (walk->mNext)
|
||||
walk = walk->mNext;
|
||||
walk->mNext = next;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -392,14 +392,14 @@ bool CodeBlock::read(StringTableEntry fileName, Stream &st)
|
|||
if (size)
|
||||
{
|
||||
globalFloats = new F64[size];
|
||||
for (U32 i = 0; i < size; i++)
|
||||
for (i = 0; i < size; i++)
|
||||
st.read(&globalFloats[i]);
|
||||
}
|
||||
st.read(&size);
|
||||
if (size)
|
||||
{
|
||||
functionFloats = new F64[size];
|
||||
for (U32 i = 0; i < size; i++)
|
||||
for (i = 0; i < size; i++)
|
||||
st.read(&functionFloats[i]);
|
||||
}
|
||||
U32 codeLength;
|
||||
|
|
|
|||
|
|
@ -49,7 +49,7 @@ ExprEvalState gEvalState;
|
|||
StmtNode *gStatementList;
|
||||
StmtNode *gAnonFunctionList;
|
||||
U32 gAnonFunctionID = 0;
|
||||
ConsoleConstructor *ConsoleConstructor::first = NULL;
|
||||
ConsoleConstructor *ConsoleConstructor::mFirst = NULL;
|
||||
bool gWarnUndefinedScriptVariables;
|
||||
|
||||
static char scratchBuffer[4096];
|
||||
|
|
@ -85,47 +85,47 @@ static const char * prependPercent ( const char * name )
|
|||
//--------------------------------------
|
||||
void ConsoleConstructor::init( const char *cName, const char *fName, const char *usg, S32 minArgs, S32 maxArgs, bool isToolOnly, ConsoleFunctionHeader* header )
|
||||
{
|
||||
mina = minArgs;
|
||||
maxa = maxArgs;
|
||||
funcName = fName;
|
||||
usage = usg;
|
||||
className = cName;
|
||||
sc = 0; fc = 0; vc = 0; bc = 0; ic = 0;
|
||||
callback = group = false;
|
||||
next = first;
|
||||
ns = false;
|
||||
first = this;
|
||||
toolOnly = isToolOnly;
|
||||
this->header = header;
|
||||
mMina = minArgs;
|
||||
mMaxa = maxArgs;
|
||||
mFuncName = fName;
|
||||
mUsage = usg;
|
||||
mClassName = cName;
|
||||
mSC = 0; mFC = 0; mVC = 0; mBC = 0; mIC = 0;
|
||||
mCallback = mGroup = false;
|
||||
mNext = mFirst;
|
||||
mNS = false;
|
||||
mFirst = this;
|
||||
mToolOnly = isToolOnly;
|
||||
mHeader = header;
|
||||
}
|
||||
|
||||
void ConsoleConstructor::setup()
|
||||
{
|
||||
for(ConsoleConstructor *walk = first; walk; walk = walk->next)
|
||||
for(ConsoleConstructor *walk = mFirst; walk; walk = walk->mNext)
|
||||
{
|
||||
#ifdef TORQUE_DEBUG
|
||||
walk->validate();
|
||||
#endif
|
||||
|
||||
if( walk->sc )
|
||||
Con::addCommand( walk->className, walk->funcName, walk->sc, walk->usage, walk->mina, walk->maxa, walk->toolOnly, walk->header );
|
||||
else if( walk->ic )
|
||||
Con::addCommand( walk->className, walk->funcName, walk->ic, walk->usage, walk->mina, walk->maxa, walk->toolOnly, walk->header );
|
||||
else if( walk->fc )
|
||||
Con::addCommand( walk->className, walk->funcName, walk->fc, walk->usage, walk->mina, walk->maxa, walk->toolOnly, walk->header );
|
||||
else if( walk->vc )
|
||||
Con::addCommand( walk->className, walk->funcName, walk->vc, walk->usage, walk->mina, walk->maxa, walk->toolOnly, walk->header );
|
||||
else if( walk->bc )
|
||||
Con::addCommand( walk->className, walk->funcName, walk->bc, walk->usage, walk->mina, walk->maxa, walk->toolOnly, walk->header );
|
||||
else if( walk->group )
|
||||
Con::markCommandGroup( walk->className, walk->funcName, walk->usage );
|
||||
else if( walk->callback )
|
||||
Con::noteScriptCallback( walk->className, walk->funcName, walk->usage, walk->header );
|
||||
else if( walk->ns )
|
||||
if( walk->mSC )
|
||||
Con::addCommand( walk->mClassName, walk->mFuncName, walk->mSC, walk->mUsage, walk->mMina, walk->mMaxa, walk->mToolOnly, walk->mHeader);
|
||||
else if( walk->mIC )
|
||||
Con::addCommand( walk->mClassName, walk->mFuncName, walk->mIC, walk->mUsage, walk->mMina, walk->mMaxa, walk->mToolOnly, walk->mHeader);
|
||||
else if( walk->mFC )
|
||||
Con::addCommand( walk->mClassName, walk->mFuncName, walk->mFC, walk->mUsage, walk->mMina, walk->mMaxa, walk->mToolOnly, walk->mHeader);
|
||||
else if( walk->mVC )
|
||||
Con::addCommand( walk->mClassName, walk->mFuncName, walk->mVC, walk->mUsage, walk->mMina, walk->mMaxa, walk->mToolOnly, walk->mHeader);
|
||||
else if( walk->mBC )
|
||||
Con::addCommand( walk->mClassName, walk->mFuncName, walk->mBC, walk->mUsage, walk->mMina, walk->mMaxa, walk->mToolOnly, walk->mHeader);
|
||||
else if( walk->mGroup )
|
||||
Con::markCommandGroup( walk->mClassName, walk->mFuncName, walk->mUsage);
|
||||
else if( walk->mClassName)
|
||||
Con::noteScriptCallback( walk->mClassName, walk->mFuncName, walk->mUsage, walk->mHeader);
|
||||
else if( walk->mNS )
|
||||
{
|
||||
Namespace* ns = Namespace::find( StringTable->insert( walk->className ) );
|
||||
Namespace* ns = Namespace::find( StringTable->insert( walk->mClassName) );
|
||||
if( ns )
|
||||
ns->mUsage = walk->usage;
|
||||
ns->mUsage = walk->mUsage;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
@ -137,38 +137,38 @@ void ConsoleConstructor::setup()
|
|||
ConsoleConstructor::ConsoleConstructor(const char *className, const char *funcName, StringCallback sfunc, const char *usage, S32 minArgs, S32 maxArgs, bool isToolOnly, ConsoleFunctionHeader* header )
|
||||
{
|
||||
init( className, funcName, usage, minArgs, maxArgs, isToolOnly, header );
|
||||
sc = sfunc;
|
||||
mSC = sfunc;
|
||||
}
|
||||
|
||||
ConsoleConstructor::ConsoleConstructor(const char *className, const char *funcName, IntCallback ifunc, const char *usage, S32 minArgs, S32 maxArgs, bool isToolOnly, ConsoleFunctionHeader* header )
|
||||
{
|
||||
init( className, funcName, usage, minArgs, maxArgs, isToolOnly, header );
|
||||
ic = ifunc;
|
||||
mIC = ifunc;
|
||||
}
|
||||
|
||||
ConsoleConstructor::ConsoleConstructor(const char *className, const char *funcName, FloatCallback ffunc, const char *usage, S32 minArgs, S32 maxArgs, bool isToolOnly, ConsoleFunctionHeader* header )
|
||||
{
|
||||
init( className, funcName, usage, minArgs, maxArgs, isToolOnly, header );
|
||||
fc = ffunc;
|
||||
mFC = ffunc;
|
||||
}
|
||||
|
||||
ConsoleConstructor::ConsoleConstructor(const char *className, const char *funcName, VoidCallback vfunc, const char *usage, S32 minArgs, S32 maxArgs, bool isToolOnly, ConsoleFunctionHeader* header )
|
||||
{
|
||||
init( className, funcName, usage, minArgs, maxArgs, isToolOnly, header );
|
||||
vc = vfunc;
|
||||
mVC = vfunc;
|
||||
}
|
||||
|
||||
ConsoleConstructor::ConsoleConstructor(const char *className, const char *funcName, BoolCallback bfunc, const char *usage, S32 minArgs, S32 maxArgs, bool isToolOnly, ConsoleFunctionHeader* header )
|
||||
{
|
||||
init( className, funcName, usage, minArgs, maxArgs, isToolOnly, header );
|
||||
bc = bfunc;
|
||||
mBC = bfunc;
|
||||
}
|
||||
|
||||
ConsoleConstructor::ConsoleConstructor(const char* className, const char* groupName, const char* aUsage)
|
||||
{
|
||||
init(className, groupName, usage, -1, -2);
|
||||
init(className, groupName, mUsage, -1, -2);
|
||||
|
||||
group = true;
|
||||
mGroup = true;
|
||||
|
||||
// Somewhere, the entry list is getting flipped, partially.
|
||||
// so we have to do tricks to deal with making sure usage
|
||||
|
|
@ -179,36 +179,36 @@ ConsoleConstructor::ConsoleConstructor(const char* className, const char* groupN
|
|||
if(aUsage)
|
||||
lastUsage = (char *)aUsage;
|
||||
|
||||
usage = lastUsage;
|
||||
mUsage = lastUsage;
|
||||
}
|
||||
|
||||
ConsoleConstructor::ConsoleConstructor(const char *className, const char *callbackName, const char *usage, ConsoleFunctionHeader* header )
|
||||
{
|
||||
init( className, callbackName, usage, -2, -3, false, header );
|
||||
callback = true;
|
||||
ns = true;
|
||||
mCallback = true;
|
||||
mNS = true;
|
||||
}
|
||||
|
||||
void ConsoleConstructor::validate()
|
||||
{
|
||||
#ifdef TORQUE_DEBUG
|
||||
// Don't do the following check if we're not a method/func.
|
||||
if(this->group)
|
||||
if(mGroup)
|
||||
return;
|
||||
|
||||
// In debug, walk the list and make sure this isn't a duplicate.
|
||||
for(ConsoleConstructor *walk = first; walk; walk = walk->next)
|
||||
for(ConsoleConstructor *walk = mFirst; walk; walk = walk->mNext)
|
||||
{
|
||||
// Skip mismatching func/method names.
|
||||
if(dStricmp(walk->funcName, this->funcName))
|
||||
if(dStricmp(walk->mFuncName, mFuncName))
|
||||
continue;
|
||||
|
||||
// Don't compare functions with methods or vice versa.
|
||||
if(bool(this->className) != bool(walk->className))
|
||||
if(bool(mClassName) != bool(walk->mClassName))
|
||||
continue;
|
||||
|
||||
// Skip mismatching classnames, if they're present.
|
||||
if(this->className && walk->className && dStricmp(walk->className, this->className))
|
||||
if(mClassName && walk->mClassName && dStricmp(walk->mClassName, mClassName))
|
||||
continue;
|
||||
|
||||
// If we encounter ourselves, stop searching; this prevents duplicate
|
||||
|
|
@ -218,13 +218,13 @@ void ConsoleConstructor::validate()
|
|||
break;
|
||||
|
||||
// Match!
|
||||
if(this->className)
|
||||
if(mClassName)
|
||||
{
|
||||
AssertISV(false, avar("ConsoleConstructor::setup - ConsoleMethod '%s::%s' collides with another of the same name.", this->className, this->funcName));
|
||||
AssertISV(false, avar("ConsoleConstructor::setup - ConsoleMethod '%s::%s' collides with another of the same name.", mClassName, mFuncName));
|
||||
}
|
||||
else
|
||||
{
|
||||
AssertISV(false, avar("ConsoleConstructor::setup - ConsoleFunction '%s' collides with another of the same name.", this->funcName));
|
||||
AssertISV(false, avar("ConsoleConstructor::setup - ConsoleFunction '%s' collides with another of the same name.", mFuncName));
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
|
@ -842,9 +842,9 @@ void setIntVariable(const char *varName, S32 value)
|
|||
|
||||
if (getVariableObjectField(varName, &obj, &objField))
|
||||
{
|
||||
char scratchBuffer[32];
|
||||
dSprintf(scratchBuffer, sizeof(scratchBuffer), "%d", value);
|
||||
obj->setDataField(StringTable->insert(objField), 0, scratchBuffer);
|
||||
char varBuffer[32];
|
||||
dSprintf(varBuffer, sizeof(varBuffer), "%d", value);
|
||||
obj->setDataField(StringTable->insert(objField), 0, varBuffer);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
@ -861,9 +861,9 @@ void setFloatVariable(const char *varName, F32 value)
|
|||
|
||||
if (getVariableObjectField(varName, &obj, &objField))
|
||||
{
|
||||
char scratchBuffer[32];
|
||||
dSprintf(scratchBuffer, sizeof(scratchBuffer), "%g", value);
|
||||
obj->setDataField(StringTable->insert(objField), 0, scratchBuffer);
|
||||
char varBuffer[32];
|
||||
dSprintf(varBuffer, sizeof(varBuffer), "%g", value);
|
||||
obj->setDataField(StringTable->insert(objField), 0, varBuffer);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
|||
|
|
@ -972,38 +972,38 @@ public:
|
|||
/// @ref console_autodoc
|
||||
/// @{
|
||||
|
||||
StringCallback sc; ///< A function/method that returns a string.
|
||||
IntCallback ic; ///< A function/method that returns an int.
|
||||
FloatCallback fc; ///< A function/method that returns a float.
|
||||
VoidCallback vc; ///< A function/method that returns nothing.
|
||||
BoolCallback bc; ///< A function/method that returns a bool.
|
||||
bool group; ///< Indicates that this is a group marker.
|
||||
bool ns; ///< Indicates that this is a namespace marker.
|
||||
StringCallback mSC; ///< A function/method that returns a string.
|
||||
IntCallback mIC; ///< A function/method that returns an int.
|
||||
FloatCallback mFC; ///< A function/method that returns a float.
|
||||
VoidCallback mVC; ///< A function/method that returns nothing.
|
||||
BoolCallback mBC; ///< A function/method that returns a bool.
|
||||
bool mGroup; ///< Indicates that this is a group marker.
|
||||
bool mNS; ///< Indicates that this is a namespace marker.
|
||||
/// @deprecated Unused.
|
||||
bool callback; ///< Is this a callback into script?
|
||||
bool mCallback; ///< Is this a callback into script?
|
||||
|
||||
/// @}
|
||||
|
||||
/// Minimum number of arguments expected by the function.
|
||||
S32 mina;
|
||||
S32 mMina;
|
||||
|
||||
/// Maximum number of arguments accepted by the funtion. Zero for varargs.
|
||||
S32 maxa;
|
||||
S32 mMaxa;
|
||||
|
||||
/// Name of the function/method.
|
||||
const char* funcName;
|
||||
const char* mFuncName;
|
||||
|
||||
/// Name of the class namespace to which to add the method.
|
||||
const char* className;
|
||||
const char* mClassName;
|
||||
|
||||
/// Usage string for documentation.
|
||||
const char* usage;
|
||||
const char* mUsage;
|
||||
|
||||
/// Whether this is a TORQUE_TOOLS only function.
|
||||
bool toolOnly;
|
||||
bool mToolOnly;
|
||||
|
||||
/// The extended function header.
|
||||
ConsoleFunctionHeader* header;
|
||||
ConsoleFunctionHeader* mHeader;
|
||||
|
||||
/// @name ConsoleConstructor Innards
|
||||
///
|
||||
|
|
@ -1066,8 +1066,8 @@ public:
|
|||
/// @{
|
||||
|
||||
///
|
||||
ConsoleConstructor *next;
|
||||
static ConsoleConstructor *first;
|
||||
ConsoleConstructor *mNext;
|
||||
static ConsoleConstructor *mFirst;
|
||||
|
||||
void init(const char* cName, const char* fName, const char *usg, S32 minArgs, S32 maxArgs, bool toolOnly = false, ConsoleFunctionHeader* header = NULL);
|
||||
|
||||
|
|
|
|||
|
|
@ -672,13 +672,13 @@ DefineConsoleFunction( strreplace, const char*, ( const char* source, const char
|
|||
U32 dstp = 0;
|
||||
for(;;)
|
||||
{
|
||||
const char *scan = dStrstr(source + scanp, from);
|
||||
if(!scan)
|
||||
const char *subScan = dStrstr(source + scanp, from);
|
||||
if(!subScan)
|
||||
{
|
||||
dStrcpy(ret + dstp, source + scanp, retLen - dstp);
|
||||
return ret;
|
||||
}
|
||||
U32 len = scan - (source + scanp);
|
||||
U32 len = subScan - (source + scanp);
|
||||
dStrncpy(ret + dstp, source + scanp, getMin(len, retLen - dstp));
|
||||
dstp += len;
|
||||
dStrcpy(ret + dstp, to, retLen - dstp);
|
||||
|
|
|
|||
|
|
@ -248,13 +248,13 @@ static void dumpFunction( Stream &stream,
|
|||
const char* brief = dStrstr( doc, "@brief" );
|
||||
if( !brief )
|
||||
{
|
||||
String brief = entry->getBriefDescription( &doc );
|
||||
String briefStr = entry->getBriefDescription( &doc );
|
||||
|
||||
brief.trim();
|
||||
if( !brief.isEmpty() )
|
||||
briefStr.trim();
|
||||
if( !briefStr.isEmpty() )
|
||||
{
|
||||
stream.writeText( "@brief " );
|
||||
stream.writeText( brief );
|
||||
stream.writeText(briefStr);
|
||||
stream.writeText( "\r\n\r\n" );
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -449,10 +449,10 @@ void FieldBrushObject::copyFields( SimObject* pSimObject, const char* fieldList
|
|||
// Yes, so is this field name selected?
|
||||
|
||||
// Iterate fields...
|
||||
for ( U32 fieldIndex = 0; fieldIndex < fields.size(); ++fieldIndex )
|
||||
for ( U32 findFieldIDx = 0; findFieldIDx < fields.size(); ++findFieldIDx)
|
||||
{
|
||||
// Field selected?
|
||||
if ( staticField.pFieldname == fields[fieldIndex] )
|
||||
if ( staticField.pFieldname == fields[findFieldIDx] )
|
||||
{
|
||||
// Yes, so flag as such.
|
||||
fieldSpecified = true;
|
||||
|
|
|
|||
|
|
@ -62,20 +62,20 @@ SimDataBlock::SimDataBlock()
|
|||
|
||||
SimDataBlock::SubstitutionStatement::SubstitutionStatement(StringTableEntry slot, S32 idx, const char* value)
|
||||
{
|
||||
this->slot = slot;
|
||||
this->idx = idx;
|
||||
this->value = dStrdup(value);
|
||||
this->mSlot = slot;
|
||||
this->mIdx = idx;
|
||||
this->mValue = dStrdup(value);
|
||||
}
|
||||
|
||||
SimDataBlock::SubstitutionStatement::~SubstitutionStatement()
|
||||
{
|
||||
dFree(value);
|
||||
dFree(mValue);
|
||||
}
|
||||
|
||||
void SimDataBlock::SubstitutionStatement::replaceValue(const char* value)
|
||||
{
|
||||
dFree(this->value);
|
||||
this->value = dStrdup(value);
|
||||
dFree(this->mValue);
|
||||
this->mValue = dStrdup(value);
|
||||
}
|
||||
|
||||
// this is the copy-constructor for creating temp-clones.
|
||||
|
|
@ -109,7 +109,7 @@ void SimDataBlock::addSubstitution(StringTableEntry slot, S32 idx, const char* s
|
|||
|
||||
for (S32 i = 0; i < substitutions.size(); i++)
|
||||
{
|
||||
if (substitutions[i] && substitutions[i]->slot == slot && substitutions[i]->idx == idx)
|
||||
if (substitutions[i] && substitutions[i]->mSlot == slot && substitutions[i]->mIdx == idx)
|
||||
{
|
||||
if (empty_subs)
|
||||
{
|
||||
|
|
@ -137,8 +137,8 @@ const char* SimDataBlock::getSubstitution(StringTableEntry slot, S32 idx)
|
|||
{
|
||||
for (S32 i = 0; i < substitutions.size(); i++)
|
||||
{
|
||||
if (substitutions[i] && substitutions[i]->slot == slot && substitutions[i]->idx == idx)
|
||||
return substitutions[i]->value;
|
||||
if (substitutions[i] && substitutions[i]->mSlot == slot && substitutions[i]->mIdx == idx)
|
||||
return substitutions[i]->mValue;
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
|
@ -147,7 +147,7 @@ const char* SimDataBlock::getSubstitution(StringTableEntry slot, S32 idx)
|
|||
bool SimDataBlock::fieldHasSubstitution(StringTableEntry slot)
|
||||
{
|
||||
for (S32 i = 0; i < substitutions.size(); i++)
|
||||
if (substitutions[i] && substitutions[i]->slot == slot)
|
||||
if (substitutions[i] && substitutions[i]->mSlot == slot)
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
|
@ -156,7 +156,7 @@ void SimDataBlock::printSubstitutions()
|
|||
{
|
||||
for (S32 i = 0; i < substitutions.size(); i++)
|
||||
if (substitutions[i])
|
||||
Con::errorf("SubstitutionStatement[%s] = \"%s\" -- %d", substitutions[i]->slot, substitutions[i]->value, i);
|
||||
Con::errorf("SubstitutionStatement[%s] = \"%s\" -- %d", substitutions[i]->mSlot, substitutions[i]->mValue, i);
|
||||
}
|
||||
|
||||
void SimDataBlock::copySubstitutionsFrom(SimDataBlock* other)
|
||||
|
|
@ -170,7 +170,7 @@ void SimDataBlock::copySubstitutionsFrom(SimDataBlock* other)
|
|||
if (other->substitutions[i])
|
||||
{
|
||||
SubstitutionStatement* subs = other->substitutions[i];
|
||||
substitutions.push_back(new SubstitutionStatement(subs->slot, subs->idx, subs->value));
|
||||
substitutions.push_back(new SubstitutionStatement(subs->mSlot, subs->mIdx, subs->mValue));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -212,7 +212,7 @@ void SimDataBlock::performSubstitutions(SimDataBlock* dblock, const SimObject* o
|
|||
char* b = buffer;
|
||||
|
||||
// perform special token expansion (%% and ##)
|
||||
const char* v = substitutions[i]->value;
|
||||
const char* v = substitutions[i]->mValue;
|
||||
while (*v != '\0')
|
||||
{
|
||||
// identify "%%" tokens and replace with <obj> id
|
||||
|
|
@ -258,7 +258,7 @@ void SimDataBlock::performSubstitutions(SimDataBlock* dblock, const SimObject* o
|
|||
if (Compiler::gSyntaxError)
|
||||
{
|
||||
Con::errorf("Field Substitution Failed: field=\"%s\" substitution=\"%s\" -- syntax error",
|
||||
substitutions[i]->slot, substitutions[i]->value);
|
||||
substitutions[i]->mSlot, substitutions[i]->mValue);
|
||||
Compiler::gSyntaxError = false;
|
||||
return;
|
||||
}
|
||||
|
|
@ -267,7 +267,7 @@ void SimDataBlock::performSubstitutions(SimDataBlock* dblock, const SimObject* o
|
|||
if (result == 0 || result[0] == '\0')
|
||||
{
|
||||
Con::errorf("Field Substitution Failed: field=\"%s\" substitution=\"%s\" -- empty result",
|
||||
substitutions[i]->slot, substitutions[i]->value);
|
||||
substitutions[i]->mSlot, substitutions[i]->mValue);
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -282,29 +282,29 @@ void SimDataBlock::performSubstitutions(SimDataBlock* dblock, const SimObject* o
|
|||
result = "";
|
||||
}
|
||||
|
||||
const AbstractClassRep::Field* field = dblock->getClassRep()->findField(substitutions[i]->slot);
|
||||
const AbstractClassRep::Field* field = dblock->getClassRep()->findField(substitutions[i]->mSlot);
|
||||
if (!field)
|
||||
{
|
||||
// this should be very unlikely...
|
||||
Con::errorf("Field Substitution Failed: unknown field, \"%s\".", substitutions[i]->slot);
|
||||
Con::errorf("Field Substitution Failed: unknown field, \"%s\".", substitutions[i]->mSlot);
|
||||
continue;
|
||||
}
|
||||
|
||||
if (field->keepClearSubsOnly && result[0] != '\0')
|
||||
{
|
||||
Con::errorf("Field Substitution Failed: field \"%s\" of datablock %s only allows \"$$ ~~\" (keep) and \"$$ ~0\" (clear) field substitutions. [%s]",
|
||||
substitutions[i]->slot, this->getClassName(), this->getName());
|
||||
substitutions[i]->mSlot, this->getClassName(), this->getName());
|
||||
continue;
|
||||
}
|
||||
|
||||
// substitute the field value with its replacement
|
||||
Con::setData(field->type, (void*)(((const char*)(dblock)) + field->offset), substitutions[i]->idx, 1, &result, field->table, field->flag);
|
||||
Con::setData(field->type, (void*)(((const char*)(dblock)) + field->offset), substitutions[i]->mIdx, 1, &result, field->table, field->flag);
|
||||
|
||||
//dStrncpy(buffer, result, 255);
|
||||
//Con::errorf("SUBSTITUTION %s.%s[%d] = %s idx=%s", Con::getIntArg(getId()), substitutions[i]->slot, substitutions[i]->idx, buffer, index_str);
|
||||
|
||||
// notify subclasses of a field modification
|
||||
dblock->onStaticModified(substitutions[i]->slot);
|
||||
dblock->onStaticModified(substitutions[i]->mSlot);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -366,9 +366,9 @@ void SimDataBlock::packData(BitStream* stream)
|
|||
if (substitutions[i])
|
||||
{
|
||||
stream->writeFlag(true);
|
||||
stream->writeString(substitutions[i]->slot);
|
||||
stream->write(substitutions[i]->idx);
|
||||
stream->writeString(substitutions[i]->value);
|
||||
stream->writeString(substitutions[i]->mSlot);
|
||||
stream->write(substitutions[i]->mIdx);
|
||||
stream->writeString(substitutions[i]->mValue);
|
||||
}
|
||||
}
|
||||
stream->writeFlag(false);
|
||||
|
|
|
|||
|
|
@ -179,9 +179,9 @@ public:
|
|||
protected:
|
||||
struct SubstitutionStatement
|
||||
{
|
||||
StringTableEntry slot;
|
||||
S32 idx;
|
||||
char* value;
|
||||
StringTableEntry mSlot;
|
||||
S32 mIdx;
|
||||
char* mValue;
|
||||
SubstitutionStatement(StringTableEntry slot, S32 idx, const char* value);
|
||||
~SubstitutionStatement();
|
||||
void replaceValue(const char* value);
|
||||
|
|
|
|||
|
|
@ -45,13 +45,13 @@ SimNameDictionary::~SimNameDictionary()
|
|||
|
||||
void SimNameDictionary::insert(SimObject* obj)
|
||||
{
|
||||
if (!obj || !obj->objectName)
|
||||
if (!obj || !obj->getName())
|
||||
return;
|
||||
|
||||
SimObject* checkForDup = find(obj->objectName);
|
||||
SimObject* checkForDup = find(obj->getName());
|
||||
|
||||
if (checkForDup)
|
||||
Con::warnf("Warning! You have a duplicate datablock name of %s. This can cause problems. You should rename one of them.", obj->objectName);
|
||||
Con::warnf("Warning! You have a duplicate datablock name of %s. This can cause problems. You should rename one of them.", obj->getName());
|
||||
|
||||
Mutex::lockMutex(mutex);
|
||||
#ifndef USE_NEW_SIMDICTIONARY
|
||||
|
|
@ -64,7 +64,7 @@ void SimNameDictionary::insert(SimObject* obj)
|
|||
dMemset(hashTable, 0, sizeof(*hashTable) * DefaultTableSize);
|
||||
}
|
||||
|
||||
S32 idx = HashPointer(obj->objectName) % hashTableSize;
|
||||
S32 idx = HashPointer(obj->getName()) % hashTableSize;
|
||||
obj->nextNameObject = hashTable[idx];
|
||||
hashTable[idx] = obj;
|
||||
hashEntryCount++;
|
||||
|
|
@ -86,7 +86,7 @@ void SimNameDictionary::insert(SimObject* obj)
|
|||
{
|
||||
SimObject* next = object->nextNameObject;
|
||||
|
||||
idx = HashPointer(object->objectName) % newHashTableSize;
|
||||
idx = HashPointer(object->getName()) % newHashTableSize;
|
||||
object->nextNameObject = newHashTable[idx];
|
||||
newHashTable[idx] = object;
|
||||
|
||||
|
|
@ -118,7 +118,7 @@ SimObject* SimNameDictionary::find(StringTableEntry name)
|
|||
SimObject *walk = hashTable[idx];
|
||||
while (walk)
|
||||
{
|
||||
if (walk->objectName == name)
|
||||
if (walk->getName() == name)
|
||||
{
|
||||
Mutex::unlockMutex(mutex);
|
||||
return walk;
|
||||
|
|
@ -139,12 +139,12 @@ SimObject* SimNameDictionary::find(StringTableEntry name)
|
|||
|
||||
void SimNameDictionary::remove(SimObject* obj)
|
||||
{
|
||||
if (!obj || !obj->objectName)
|
||||
if (!obj || !obj->getName())
|
||||
return;
|
||||
|
||||
Mutex::lockMutex(mutex);
|
||||
#ifndef USE_NEW_SIMDICTIONARY
|
||||
SimObject **walk = &hashTable[HashPointer(obj->objectName) % hashTableSize];
|
||||
SimObject **walk = &hashTable[HashPointer(obj->getName()) % hashTableSize];
|
||||
while (*walk)
|
||||
{
|
||||
if (*walk == obj)
|
||||
|
|
@ -190,12 +190,12 @@ SimManagerNameDictionary::~SimManagerNameDictionary()
|
|||
|
||||
void SimManagerNameDictionary::insert(SimObject* obj)
|
||||
{
|
||||
if (!obj || !obj->objectName)
|
||||
if (!obj || !obj->getName())
|
||||
return;
|
||||
|
||||
Mutex::lockMutex(mutex);
|
||||
#ifndef USE_NEW_SIMDICTIONARY
|
||||
S32 idx = HashPointer(obj->objectName) % hashTableSize;
|
||||
S32 idx = HashPointer(obj->getName()) % hashTableSize;
|
||||
obj->nextManagerNameObject = hashTable[idx];
|
||||
hashTable[idx] = obj;
|
||||
hashEntryCount++;
|
||||
|
|
@ -217,7 +217,7 @@ void SimManagerNameDictionary::insert(SimObject* obj)
|
|||
{
|
||||
SimObject* next = object->nextManagerNameObject;
|
||||
|
||||
idx = HashPointer(object->objectName) % newHashTableSize;
|
||||
idx = HashPointer(object->getName()) % newHashTableSize;
|
||||
object->nextManagerNameObject = newHashTable[idx];
|
||||
newHashTable[idx] = object;
|
||||
|
||||
|
|
@ -247,7 +247,7 @@ SimObject* SimManagerNameDictionary::find(StringTableEntry name)
|
|||
SimObject *walk = hashTable[idx];
|
||||
while (walk)
|
||||
{
|
||||
if (walk->objectName == name)
|
||||
if (walk->getName() == name)
|
||||
{
|
||||
Mutex::unlockMutex(mutex);
|
||||
return walk;
|
||||
|
|
@ -267,13 +267,13 @@ SimObject* SimManagerNameDictionary::find(StringTableEntry name)
|
|||
|
||||
void SimManagerNameDictionary::remove(SimObject* obj)
|
||||
{
|
||||
if (!obj || !obj->objectName)
|
||||
if (!obj || !obj->getName())
|
||||
return;
|
||||
|
||||
#ifndef USE_NEW_SIMDICTIONARY
|
||||
Mutex::lockMutex(mutex);
|
||||
|
||||
SimObject **walk = &hashTable[HashPointer(obj->objectName) % hashTableSize];
|
||||
SimObject **walk = &hashTable[HashPointer(obj->getName()) % hashTableSize];
|
||||
while (*walk)
|
||||
{
|
||||
if (*walk == obj)
|
||||
|
|
|
|||
|
|
@ -245,17 +245,17 @@ void SimFieldDictionary::writeFields(SimObject *obj, Stream &stream, U32 tabStop
|
|||
const AbstractClassRep::FieldList &list = obj->getFieldList();
|
||||
Vector<Entry *> flist(__FILE__, __LINE__);
|
||||
|
||||
for (U32 i = 0; i < HashTableSize; i++)
|
||||
for (U32 curEntry = 0; curEntry < HashTableSize; curEntry++)
|
||||
{
|
||||
for (Entry *walk = mHashTable[i]; walk; walk = walk->next)
|
||||
for (Entry *walk = mHashTable[curEntry]; walk; walk = walk->next)
|
||||
{
|
||||
// make sure we haven't written this out yet:
|
||||
U32 i;
|
||||
for (i = 0; i < list.size(); i++)
|
||||
if (list[i].pFieldname == walk->slotName)
|
||||
U32 curField;
|
||||
for (curField = 0; curField < list.size(); curField++)
|
||||
if (list[curField].pFieldname == walk->slotName)
|
||||
break;
|
||||
|
||||
if (i != list.size())
|
||||
if (curField != list.size())
|
||||
continue;
|
||||
|
||||
|
||||
|
|
@ -293,17 +293,17 @@ void SimFieldDictionary::printFields(SimObject *obj)
|
|||
char expandedBuffer[4096];
|
||||
Vector<Entry *> flist(__FILE__, __LINE__);
|
||||
|
||||
for (U32 i = 0; i < HashTableSize; i++)
|
||||
for (U32 curEntry = 0; curEntry < HashTableSize; curEntry++)
|
||||
{
|
||||
for (Entry *walk = mHashTable[i]; walk; walk = walk->next)
|
||||
for (Entry *walk = mHashTable[curEntry]; walk; walk = walk->next)
|
||||
{
|
||||
// make sure we haven't written this out yet:
|
||||
U32 i;
|
||||
for (i = 0; i < list.size(); i++)
|
||||
if (list[i].pFieldname == walk->slotName)
|
||||
U32 curField;
|
||||
for (curField = 0; curField < list.size(); curField++)
|
||||
if (list[curField].pFieldname == walk->slotName)
|
||||
break;
|
||||
|
||||
if (i != list.size())
|
||||
if (curField != list.size())
|
||||
continue;
|
||||
|
||||
flist.push_back(walk);
|
||||
|
|
|
|||
|
|
@ -612,6 +612,6 @@ void SimDataBlockGroup::sort()
|
|||
if(mLastModifiedKey != SimDataBlock::getNextModifiedKey())
|
||||
{
|
||||
mLastModifiedKey = SimDataBlock::getNextModifiedKey();
|
||||
dQsort(objectList.address(),objectList.size(),sizeof(SimObject *),compareModifiedKey);
|
||||
dQsort(mObjectList.address(), mObjectList.size(),sizeof(SimObject *),compareModifiedKey);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -71,7 +71,7 @@ namespace Sim
|
|||
|
||||
SimObject::SimObject()
|
||||
{
|
||||
objectName = NULL;
|
||||
mObjectName = NULL;
|
||||
mOriginalName = NULL;
|
||||
mInternalName = NULL;
|
||||
nextNameObject = nullptr;
|
||||
|
|
@ -128,10 +128,10 @@ SimObject::~SimObject()
|
|||
|
||||
AssertFatal(nextNameObject == nullptr,avar(
|
||||
"SimObject::~SimObject: Not removed from dictionary: name %s, id %i",
|
||||
objectName, mId));
|
||||
mObjectName, mId));
|
||||
AssertFatal(nextManagerNameObject == nullptr,avar(
|
||||
"SimObject::~SimObject: Not removed from manager dictionary: name %s, id %i",
|
||||
objectName,mId));
|
||||
mObjectName,mId));
|
||||
AssertFatal(mFlags.test(Added) == 0, "SimObject::object "
|
||||
"missing call to SimObject::onRemove");
|
||||
}
|
||||
|
|
@ -149,7 +149,7 @@ void SimObject::initPersistFields()
|
|||
{
|
||||
addGroup( "Ungrouped" );
|
||||
|
||||
addProtectedField( "name", TypeName, Offset(objectName, SimObject), &setProtectedName, &defaultProtectedGetFn,
|
||||
addProtectedField( "name", TypeName, Offset(mObjectName, SimObject), &setProtectedName, &defaultProtectedGetFn,
|
||||
"Optional global name of this object." );
|
||||
|
||||
endGroup( "Ungrouped" );
|
||||
|
|
@ -211,8 +211,8 @@ String SimObject::describeSelf() const
|
|||
|
||||
if( mId != 0 )
|
||||
desc = avar( "%s|id: %i", desc.c_str(), mId );
|
||||
if( objectName )
|
||||
desc = avar( "%s|name: %s", desc.c_str(), objectName );
|
||||
if(mObjectName)
|
||||
desc = avar( "%s|name: %s", desc.c_str(), mObjectName);
|
||||
if( mInternalName )
|
||||
desc = avar( "%s|internal: %s", desc.c_str(), mInternalName );
|
||||
if( mNameSpace )
|
||||
|
|
@ -529,17 +529,17 @@ void SimObject::onTamlCustomRead(TamlCustomNodes const& customNodes)
|
|||
for (TamlCustomFieldVector::const_iterator fieldItr = fields.begin(); fieldItr != fields.end(); ++fieldItr)
|
||||
{
|
||||
// Fetch field.
|
||||
const TamlCustomField* pField = *fieldItr;
|
||||
const TamlCustomField* cField = *fieldItr;
|
||||
|
||||
// Fetch field name.
|
||||
StringTableEntry fieldName = pField->getFieldName();
|
||||
StringTableEntry fieldName = cField->getFieldName();
|
||||
|
||||
const AbstractClassRep::Field* field = findField(fieldName);
|
||||
|
||||
// Check common fields.
|
||||
if (field)
|
||||
{
|
||||
setDataField(fieldName, buf, pField->getFieldValue());
|
||||
setDataField(fieldName, buf, cField->getFieldValue());
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
@ -754,9 +754,9 @@ void SimObject::setId(SimObjectId newId)
|
|||
|
||||
void SimObject::assignName(const char *name)
|
||||
{
|
||||
if( objectName && !isNameChangeAllowed() )
|
||||
if(mObjectName && !isNameChangeAllowed() )
|
||||
{
|
||||
Con::errorf( "SimObject::assignName - not allowed to change name of object '%s'", objectName );
|
||||
Con::errorf( "SimObject::assignName - not allowed to change name of object '%s'", mObjectName);
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -781,7 +781,7 @@ void SimObject::assignName(const char *name)
|
|||
Sim::gNameDictionary->remove( this );
|
||||
}
|
||||
|
||||
objectName = newName;
|
||||
mObjectName = newName;
|
||||
|
||||
if( mGroup )
|
||||
mGroup->mNameDictionary.insert( this );
|
||||
|
|
@ -1373,7 +1373,7 @@ SimObject::SimObject(const SimObject& other, bool temp_clone)
|
|||
{
|
||||
is_temp_clone = temp_clone;
|
||||
|
||||
objectName = other.objectName;
|
||||
mObjectName = other.mObjectName;
|
||||
mOriginalName = other.mOriginalName;
|
||||
nextNameObject = other.nextNameObject;
|
||||
nextManagerNameObject = other.nextManagerNameObject;
|
||||
|
|
|
|||
|
|
@ -293,7 +293,7 @@ class SimObject: public ConsoleObject, public TamlCallbacks
|
|||
};
|
||||
|
||||
// dictionary information stored on the object
|
||||
StringTableEntry objectName;
|
||||
StringTableEntry mObjectName;
|
||||
StringTableEntry mOriginalName;
|
||||
SimObject* nextNameObject;
|
||||
SimObject* nextManagerNameObject;
|
||||
|
|
@ -358,7 +358,7 @@ class SimObject: public ConsoleObject, public TamlCallbacks
|
|||
{ static_cast<SimObject*>(object)->setSuperClassNamespace(data); return false; };
|
||||
|
||||
static bool writeObjectName(void* obj, StringTableEntry pFieldName)
|
||||
{ SimObject* simObject = static_cast<SimObject*>(obj); return simObject->objectName != NULL && simObject->objectName != StringTable->EmptyString(); }
|
||||
{ SimObject* simObject = static_cast<SimObject*>(obj); return simObject->mObjectName != NULL && simObject->mObjectName != StringTable->EmptyString(); }
|
||||
static bool writeCanSaveDynamicFields(void* obj, StringTableEntry pFieldName)
|
||||
{ return static_cast<SimObject*>(obj)->mCanSaveFieldDictionary == false; }
|
||||
static bool writeInternalName(void* obj, StringTableEntry pFieldName)
|
||||
|
|
@ -761,7 +761,7 @@ class SimObject: public ConsoleObject, public TamlCallbacks
|
|||
const char* getIdString() const { return mIdString; }
|
||||
|
||||
/// Return the name of this object.
|
||||
StringTableEntry getName() const { return objectName; }
|
||||
StringTableEntry getName() const { return mObjectName; }
|
||||
|
||||
/// Return the SimGroup that this object is contained in. Never NULL except for
|
||||
/// RootGroup and unregistered objects.
|
||||
|
|
|
|||
|
|
@ -118,7 +118,7 @@ IMPLEMENT_CALLBACK( SimSet, onObjectRemoved, void, ( SimObject* object ), ( obje
|
|||
|
||||
SimSet::SimSet()
|
||||
{
|
||||
VECTOR_SET_ASSOCIATION( objectList );
|
||||
VECTOR_SET_ASSOCIATION(mObjectList);
|
||||
mMutex = Mutex::createMutex();
|
||||
}
|
||||
|
||||
|
|
@ -139,7 +139,7 @@ void SimSet::addObject( SimObject* obj )
|
|||
|
||||
lock();
|
||||
|
||||
const bool added = objectList.pushBack( obj );
|
||||
const bool added = mObjectList.pushBack( obj );
|
||||
if( added )
|
||||
deleteNotify( obj );
|
||||
|
||||
|
|
@ -159,7 +159,7 @@ void SimSet::removeObject( SimObject* obj )
|
|||
{
|
||||
lock();
|
||||
|
||||
const bool removed = objectList.remove( obj );
|
||||
const bool removed = mObjectList.remove( obj );
|
||||
if( removed )
|
||||
clearNotify( obj );
|
||||
|
||||
|
|
@ -182,7 +182,7 @@ void SimSet::pushObject( SimObject* obj )
|
|||
|
||||
lock();
|
||||
|
||||
bool added = objectList.pushBackForce( obj );
|
||||
bool added = mObjectList.pushBackForce( obj );
|
||||
if( added )
|
||||
deleteNotify( obj );
|
||||
|
||||
|
|
@ -200,15 +200,15 @@ void SimSet::pushObject( SimObject* obj )
|
|||
|
||||
void SimSet::popObject()
|
||||
{
|
||||
if( objectList.empty() )
|
||||
if(mObjectList.empty() )
|
||||
{
|
||||
AssertWarn(false, "Stack underflow in SimSet::popObject");
|
||||
return;
|
||||
}
|
||||
|
||||
lock();
|
||||
SimObject* object = objectList.last();
|
||||
objectList.pop_back();
|
||||
SimObject* object = mObjectList.last();
|
||||
mObjectList.pop_back();
|
||||
|
||||
clearNotify( object );
|
||||
unlock();
|
||||
|
|
@ -223,7 +223,7 @@ void SimSet::popObject()
|
|||
void SimSet::scriptSort( const String &scriptCallbackFn )
|
||||
{
|
||||
lock();
|
||||
objectList.scriptSort( scriptCallbackFn );
|
||||
mObjectList.scriptSort( scriptCallbackFn );
|
||||
unlock();
|
||||
}
|
||||
|
||||
|
|
@ -303,8 +303,8 @@ bool SimSet::reOrder( SimObject *obj, SimObject *target )
|
|||
if ( itrS != (end()-1) )
|
||||
{
|
||||
// remove object from its current location and push to back of list
|
||||
objectList.erase(itrS);
|
||||
objectList.push_back(obj);
|
||||
mObjectList.erase(itrS);
|
||||
mObjectList.push_back(obj);
|
||||
}
|
||||
}
|
||||
else
|
||||
|
|
@ -314,12 +314,12 @@ bool SimSet::reOrder( SimObject *obj, SimObject *target )
|
|||
// target must be in list
|
||||
return false;
|
||||
|
||||
objectList.erase(itrS);
|
||||
mObjectList.erase(itrS);
|
||||
|
||||
// once itrS has been erased, itrD won't be pointing at the
|
||||
// same place anymore - re-find...
|
||||
itrD = find(begin(),end(),target);
|
||||
objectList.insert(itrD, obj);
|
||||
mObjectList.insert(itrD, obj);
|
||||
}
|
||||
|
||||
return true;
|
||||
|
|
@ -340,15 +340,15 @@ void SimSet::onRemove()
|
|||
MutexHandle handle;
|
||||
handle.lock( mMutex );
|
||||
|
||||
if( !objectList.empty() )
|
||||
if( !mObjectList.empty() )
|
||||
{
|
||||
objectList.sortId();
|
||||
mObjectList.sortId();
|
||||
|
||||
// This backwards iterator loop doesn't work if the
|
||||
// list is empty, check the size first.
|
||||
|
||||
for( SimObjectList::iterator ptr = objectList.end() - 1;
|
||||
ptr >= objectList.begin(); ptr -- )
|
||||
for( SimObjectList::iterator ptr = mObjectList.end() - 1;
|
||||
ptr >= mObjectList.begin(); ptr -- )
|
||||
clearNotify( *ptr );
|
||||
}
|
||||
|
||||
|
|
@ -417,8 +417,8 @@ void SimSet::deleteAllObjects()
|
|||
lock();
|
||||
while( !empty() )
|
||||
{
|
||||
SimObject* object = objectList.last();
|
||||
objectList.pop_back();
|
||||
SimObject* object = mObjectList.last();
|
||||
mObjectList.pop_back();
|
||||
|
||||
object->deleteObject();
|
||||
}
|
||||
|
|
@ -536,7 +536,7 @@ SimObject* SimSet::findObjectByLineNumber(const char* fileName, S32 declarationL
|
|||
SimObject* SimSet::getRandom()
|
||||
{
|
||||
if (size() > 0)
|
||||
return objectList[mRandI(0, size() - 1)];
|
||||
return mObjectList[mRandI(0, size() - 1)];
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
|
@ -640,7 +640,7 @@ void SimGroup::_addObject( SimObject* obj, bool forcePushBack )
|
|||
if( obj->getGroup() )
|
||||
obj->getGroup()->removeObject( obj );
|
||||
|
||||
if( forcePushBack ? objectList.pushBack( obj ) : objectList.pushBackForce( obj ) )
|
||||
if( forcePushBack ? mObjectList.pushBack( obj ) : mObjectList.pushBackForce( obj ) )
|
||||
{
|
||||
mNameDictionary.insert( obj );
|
||||
obj->mGroup = this;
|
||||
|
|
@ -685,7 +685,7 @@ void SimGroup::_removeObjectNoLock( SimObject* obj )
|
|||
obj->onGroupRemove();
|
||||
|
||||
mNameDictionary.remove( obj );
|
||||
objectList.remove( obj );
|
||||
mObjectList.remove( obj );
|
||||
obj->mGroup = 0;
|
||||
|
||||
getSetModificationSignal().trigger( SetObjectRemoved, this, obj );
|
||||
|
|
@ -709,14 +709,14 @@ void SimGroup::popObject()
|
|||
MutexHandle handle;
|
||||
handle.lock( mMutex );
|
||||
|
||||
if( objectList.empty() )
|
||||
if(mObjectList.empty() )
|
||||
{
|
||||
AssertWarn( false, "SimGroup::popObject - Stack underflow" );
|
||||
return;
|
||||
}
|
||||
|
||||
SimObject* object = objectList.last();
|
||||
objectList.pop_back();
|
||||
SimObject* object = mObjectList.last();
|
||||
mObjectList.pop_back();
|
||||
|
||||
object->onGroupRemove();
|
||||
object->mGroup = NULL;
|
||||
|
|
@ -736,9 +736,9 @@ void SimGroup::popObject()
|
|||
void SimGroup::onRemove()
|
||||
{
|
||||
lock();
|
||||
if( !objectList.empty() )
|
||||
if( !mObjectList.empty() )
|
||||
{
|
||||
objectList.sortId();
|
||||
mObjectList.sortId();
|
||||
clear();
|
||||
}
|
||||
SimObject::onRemove();
|
||||
|
|
@ -752,10 +752,10 @@ void SimGroup::clear()
|
|||
lock();
|
||||
while( size() > 0 )
|
||||
{
|
||||
SimObject* object = objectList.last();
|
||||
SimObject* object = mObjectList.last();
|
||||
object->onGroupRemove();
|
||||
|
||||
objectList.pop_back();
|
||||
mObjectList.pop_back();
|
||||
mNameDictionary.remove( object );
|
||||
object->mGroup = 0;
|
||||
|
||||
|
|
|
|||
|
|
@ -114,7 +114,7 @@ class SimSet : public SimObject, public TamlChildren
|
|||
|
||||
protected:
|
||||
|
||||
SimObjectList objectList;
|
||||
SimObjectList mObjectList;
|
||||
void *mMutex;
|
||||
|
||||
/// Signal that is triggered when objects are added or removed from the set.
|
||||
|
|
@ -144,14 +144,14 @@ class SimSet : public SimObject, public TamlChildren
|
|||
///
|
||||
typedef SimObjectList::iterator iterator;
|
||||
typedef SimObjectList::value_type value;
|
||||
SimObject* front() { return objectList.front(); }
|
||||
SimObject* first() { return objectList.first(); }
|
||||
SimObject* last() { return objectList.last(); }
|
||||
bool empty() const { return objectList.empty(); }
|
||||
S32 size() const { return objectList.size(); }
|
||||
iterator begin() { return objectList.begin(); }
|
||||
iterator end() { return objectList.end(); }
|
||||
value operator[] (S32 index) { return objectList[U32(index)]; }
|
||||
SimObject* front() { return mObjectList.front(); }
|
||||
SimObject* first() { return mObjectList.first(); }
|
||||
SimObject* last() { return mObjectList.last(); }
|
||||
bool empty() const { return mObjectList.empty(); }
|
||||
S32 size() const { return mObjectList.size(); }
|
||||
iterator begin() { return mObjectList.begin(); }
|
||||
iterator end() { return mObjectList.end(); }
|
||||
value operator[] (S32 index) { return mObjectList[U32(index)]; }
|
||||
|
||||
inline iterator find( iterator first, iterator last, SimObject *obj)
|
||||
{ return T3D::find(first, last, obj); }
|
||||
|
|
@ -163,7 +163,7 @@ class SimSet : public SimObject, public TamlChildren
|
|||
virtual bool reOrder( SimObject *obj, SimObject *target=0 );
|
||||
|
||||
/// Return the object at the given index.
|
||||
SimObject* at(S32 index) const { return objectList.at(index); }
|
||||
SimObject* at(S32 index) const { return mObjectList.at(index); }
|
||||
|
||||
/// Remove all objects from this set.
|
||||
virtual void clear();
|
||||
|
|
@ -263,7 +263,7 @@ class SimSet : public SimObject, public TamlChildren
|
|||
#ifdef TORQUE_DEBUG_GUARD
|
||||
inline void _setVectorAssoc( const char *file, const U32 line )
|
||||
{
|
||||
objectList.setFileAssociation( file, line );
|
||||
mObjectList.setFileAssociation( file, line );
|
||||
}
|
||||
#endif
|
||||
|
||||
|
|
@ -324,9 +324,9 @@ void SimSet::findObjectByType( Vector<T*> &foundObjects )
|
|||
|
||||
// Loop through our child objects.
|
||||
|
||||
SimObjectList::iterator itr = objectList.begin();
|
||||
SimObjectList::iterator itr = mObjectList.begin();
|
||||
|
||||
for ( ; itr != objectList.end(); itr++ )
|
||||
for ( ; itr != mObjectList.end(); itr++ )
|
||||
{
|
||||
curObj = dynamic_cast<T*>( *itr );
|
||||
curSet = dynamic_cast<SimSet*>( *itr );
|
||||
|
|
@ -358,9 +358,9 @@ void SimSet::findObjectByCallback( bool ( *fn )( T* ), Vector<T*> &foundObjects
|
|||
|
||||
// Loop through our child objects.
|
||||
|
||||
SimObjectList::iterator itr = objectList.begin();
|
||||
SimObjectList::iterator itr = mObjectList.begin();
|
||||
|
||||
for ( ; itr != objectList.end(); itr++ )
|
||||
for ( ; itr != mObjectList.end(); itr++ )
|
||||
{
|
||||
curObj = dynamic_cast<T*>( *itr );
|
||||
curSet = dynamic_cast<SimSet*>( *itr );
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue