mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-04-28 15:55:39 +00:00
Merge pull request #342 from lukaspj/fix/replace-dstrcmp
Replace uses of dStrCmp with new String::compare
This commit is contained in:
commit
d50f1f0b81
85 changed files with 213 additions and 189 deletions
|
|
@ -403,7 +403,7 @@ void AIClient::onAdd( const char *nameSpace ) {
|
|||
|
||||
// This doesn't work...
|
||||
//
|
||||
if( dStrcmp( nameSpace, mNameSpace->mName ) ) {
|
||||
if( String::compare( nameSpace, mNameSpace->mName ) ) {
|
||||
Con::linkNamespaces( mNameSpace->mName, nameSpace );
|
||||
mNameSpace = Con::lookupNamespace( nameSpace );
|
||||
}
|
||||
|
|
@ -547,7 +547,7 @@ DefineEngineFunction( aiAddPlayer, S32, (const char * name, const char * ns), ("
|
|||
aiPlayer->onConnect_callback( name );
|
||||
|
||||
// Now execute the onAdd command and feed it the namespace
|
||||
if(dStrcmp( ns,"" ) != 0 )
|
||||
if(String::compare( ns,"" ) != 0 )
|
||||
aiPlayer->onAdd( ns );
|
||||
else
|
||||
aiPlayer->onAdd( "AIClient" );
|
||||
|
|
|
|||
|
|
@ -1108,11 +1108,11 @@ DefineEngineMethod(AIPlayer, getNavMesh, S32, (),,
|
|||
DefineEngineMethod(AIPlayer, setNavSize, void, (const char *size),,
|
||||
"@brief Set the size of NavMesh this character uses. One of \"Small\", \"Regular\" or \"Large\".")
|
||||
{
|
||||
if(!dStrcmp(size, "Small"))
|
||||
if(!String::compare(size, "Small"))
|
||||
object->setNavSize(AIPlayer::Small);
|
||||
else if(!dStrcmp(size, "Regular"))
|
||||
else if(!String::compare(size, "Regular"))
|
||||
object->setNavSize(AIPlayer::Regular);
|
||||
else if(!dStrcmp(size, "Large"))
|
||||
else if(!String::compare(size, "Large"))
|
||||
object->setNavSize(AIPlayer::Large);
|
||||
else
|
||||
Con::errorf("AIPlayer::setNavSize: no such size '%s'.", size);
|
||||
|
|
|
|||
|
|
@ -2558,7 +2558,7 @@ Torque::Path AssetImporter::importImageAsset(AssetImportObject* assetItem)
|
|||
|
||||
//If it's not a re-import, check that the file isn't being in-place imported. If it isn't, store off the original
|
||||
//file path for reimporting support later
|
||||
if (!isReimport && dStrcmp(qualifiedFromFile, qualifiedToFile))
|
||||
if (!isReimport && String::compare(qualifiedFromFile, qualifiedToFile))
|
||||
{
|
||||
newAsset->setDataField(StringTable->insert("originalFilePath"), nullptr, qualifiedFromFile);
|
||||
}
|
||||
|
|
@ -2578,7 +2578,7 @@ Torque::Path AssetImporter::importImageAsset(AssetImportObject* assetItem)
|
|||
|
||||
if (!isReimport)
|
||||
{
|
||||
bool isInPlace = !dStrcmp(qualifiedFromFile, qualifiedToFile);
|
||||
bool isInPlace = !String::compare(qualifiedFromFile, qualifiedToFile);
|
||||
|
||||
if (!isInPlace && !dPathCopy(qualifiedFromFile, qualifiedToFile, !isReimport))
|
||||
{
|
||||
|
|
@ -2877,7 +2877,7 @@ Torque::Path AssetImporter::importShapeAsset(AssetImportObject* assetItem)
|
|||
|
||||
//If it's not a re-import, check that the file isn't being in-place imported. If it isn't, store off the original
|
||||
//file path for reimporting support later
|
||||
if (!isReimport && dStrcmp(qualifiedFromFile, qualifiedToFile))
|
||||
if (!isReimport && String::compare(qualifiedFromFile, qualifiedToFile))
|
||||
{
|
||||
newAsset->setDataField(StringTable->insert("originalFilePath"), nullptr, qualifiedFromFile);
|
||||
}
|
||||
|
|
@ -2930,7 +2930,7 @@ Torque::Path AssetImporter::importShapeAsset(AssetImportObject* assetItem)
|
|||
bool makeNewConstructor = true;
|
||||
if (!isReimport)
|
||||
{
|
||||
bool isInPlace = !dStrcmp(qualifiedFromFile, qualifiedToFile);
|
||||
bool isInPlace = !String::compare(qualifiedFromFile, qualifiedToFile);
|
||||
|
||||
if (!isInPlace && !dPathCopy(qualifiedFromFile, qualifiedToFile, !isReimport))
|
||||
{
|
||||
|
|
@ -3109,7 +3109,7 @@ Torque::Path AssetImporter::importSoundAsset(AssetImportObject* assetItem)
|
|||
|
||||
//If it's not a re-import, check that the file isn't being in-place imported. If it isn't, store off the original
|
||||
//file path for reimporting support later
|
||||
if (!isReimport && dStrcmp(qualifiedFromFile, qualifiedToFile))
|
||||
if (!isReimport && String::compare(qualifiedFromFile, qualifiedToFile))
|
||||
{
|
||||
newAsset->setDataField(StringTable->insert("originalFilePath"), nullptr, qualifiedFromFile);
|
||||
}
|
||||
|
|
@ -3126,7 +3126,7 @@ Torque::Path AssetImporter::importSoundAsset(AssetImportObject* assetItem)
|
|||
|
||||
if (!isReimport)
|
||||
{
|
||||
bool isInPlace = !dStrcmp(qualifiedFromFile, qualifiedToFile);
|
||||
bool isInPlace = !String::compare(qualifiedFromFile, qualifiedToFile);
|
||||
|
||||
if (!isInPlace && !dPathCopy(qualifiedFromFile, qualifiedToFile, !isReimport))
|
||||
{
|
||||
|
|
@ -3165,7 +3165,7 @@ Torque::Path AssetImporter::importShapeAnimationAsset(AssetImportObject* assetIt
|
|||
|
||||
//If it's not a re-import, check that the file isn't being in-place imported. If it isn't, store off the original
|
||||
//file path for reimporting support later
|
||||
if (!isReimport && dStrcmp(qualifiedFromFile, qualifiedToFile))
|
||||
if (!isReimport && String::compare(qualifiedFromFile, qualifiedToFile))
|
||||
{
|
||||
newAsset->setDataField(StringTable->insert("originalFilePath"), nullptr, qualifiedFromFile);
|
||||
}
|
||||
|
|
@ -3182,7 +3182,7 @@ Torque::Path AssetImporter::importShapeAnimationAsset(AssetImportObject* assetIt
|
|||
|
||||
if (!isReimport)
|
||||
{
|
||||
bool isInPlace = !dStrcmp(qualifiedFromFile, qualifiedToFile);
|
||||
bool isInPlace = !String::compare(qualifiedFromFile, qualifiedToFile);
|
||||
|
||||
if (!isInPlace && !dPathCopy(qualifiedFromFile, qualifiedToFile, !isReimport))
|
||||
{
|
||||
|
|
|
|||
|
|
@ -209,7 +209,7 @@ void fxShapeReplicator::CreateShapes(void)
|
|||
if (mFieldData.mHideReplications) return;
|
||||
|
||||
// Cannot continue without shapes!
|
||||
if (dStrcmp(mFieldData.mShapeFile, "") == 0) return;
|
||||
if (String::compare(mFieldData.mShapeFile, "") == 0) return;
|
||||
|
||||
// Check that we can position somewhere!
|
||||
if (!( mFieldData.mAllowOnTerrain ||
|
||||
|
|
|
|||
|
|
@ -454,7 +454,7 @@ bool GameConnection::readConnectRequest(BitStream *stream, const char **errorStr
|
|||
U32 currentProtocol, minProtocol;
|
||||
char gameString[256];
|
||||
stream->readString(gameString);
|
||||
if(dStrcmp(gameString, TORQUE_APP_NAME))
|
||||
if(String::compare(gameString, TORQUE_APP_NAME))
|
||||
{
|
||||
*errorString = "CHR_GAME";
|
||||
return false;
|
||||
|
|
@ -481,7 +481,7 @@ bool GameConnection::readConnectRequest(BitStream *stream, const char **errorStr
|
|||
const char *serverPassword = Con::getVariable("pref::Server::Password");
|
||||
if(serverPassword[0])
|
||||
{
|
||||
if(dStrcmp(joinPassword, serverPassword))
|
||||
if(String::compare(joinPassword, serverPassword))
|
||||
{
|
||||
*errorString = "CHR_PASSWORD";
|
||||
return false;
|
||||
|
|
|
|||
|
|
@ -191,7 +191,7 @@ void SimDataBlockEvent::unpack(NetConnection *cptr, BitStream *bstream)
|
|||
// An object with the given ID already exists. Make sure it has the right class.
|
||||
|
||||
AbstractClassRep* classRep = AbstractClassRep::findClassRep( cptr->getNetClassGroup(), NetClassTypeDataBlock, classId );
|
||||
if( classRep && dStrcmp( classRep->getClassName(), ptr->getClassName() ) != 0 )
|
||||
if( classRep && String::compare( classRep->getClassName(), ptr->getClassName() ) != 0 )
|
||||
{
|
||||
Con::warnf( "A '%s' datablock with id: %d already existed. "
|
||||
"Clobbering it with new '%s' datablock from server.",
|
||||
|
|
|
|||
|
|
@ -259,11 +259,11 @@ bool ReflectionProbe::_setReflectionMode(void *object, const char *index, const
|
|||
{
|
||||
ReflectionProbe* probe = reinterpret_cast<ReflectionProbe*>(object);
|
||||
|
||||
if (!dStrcmp(data,"Static Cubemap"))
|
||||
if (!String::compare(data,"Static Cubemap"))
|
||||
{
|
||||
probe->mReflectionModeType = StaticCubemap;
|
||||
}
|
||||
else if (!dStrcmp(data, "Baked Cubemap"))
|
||||
else if (!String::compare(data, "Baked Cubemap"))
|
||||
{
|
||||
//Clear our cubemap if we changed it to be baked, just for cleanliness
|
||||
probe->mReflectionModeType = BakedCubemap;
|
||||
|
|
|
|||
|
|
@ -2414,7 +2414,7 @@ void Player::getDamageLocation(const Point3F& in_rPos, const char *&out_rpVert,
|
|||
else
|
||||
out_rpVert = "head";
|
||||
|
||||
if(dStrcmp(out_rpVert, "head") != 0)
|
||||
if(String::compare(out_rpVert, "head") != 0)
|
||||
{
|
||||
if (newPoint.y >= 0.0f)
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue