diff --git a/Sources/Plasma/CoreLib/plString.cpp b/Sources/Plasma/CoreLib/plString.cpp index da9e7c30..e58e204f 100644 --- a/Sources/Plasma/CoreLib/plString.cpp +++ b/Sources/Plasma/CoreLib/plString.cpp @@ -543,6 +543,8 @@ int plString::Find(const char *str, CaseSensitivity sense) const return cp - c_str(); ++cp; } + + return -1; } } diff --git a/Sources/Plasma/CoreLib/plString.h b/Sources/Plasma/CoreLib/plString.h index 081e1d60..212a0d5a 100644 --- a/Sources/Plasma/CoreLib/plString.h +++ b/Sources/Plasma/CoreLib/plString.h @@ -307,6 +307,13 @@ public: return *this; } + iterator operator++(int) + { + iterator iter_save = *this; + (void) operator++(); + return iter_save; + } + iterator &operator+=(size_t delta) { while (delta) { diff --git a/Sources/Plasma/FeatureLib/pfGameGUIMgr/pfGUIDialogMod.cpp b/Sources/Plasma/FeatureLib/pfGameGUIMgr/pfGUIDialogMod.cpp index 0171f9a1..fb12c0da 100644 --- a/Sources/Plasma/FeatureLib/pfGameGUIMgr/pfGUIDialogMod.cpp +++ b/Sources/Plasma/FeatureLib/pfGameGUIMgr/pfGUIDialogMod.cpp @@ -498,7 +498,7 @@ static bool showBounds = false; if( showBounds ) { const hsBounds3 &bnds = fMousedCtrl->GetBounds(); - plDebugText::Instance().DrawString( (uint16_t)(bnds.GetMins().fX), (uint16_t)(bnds.GetMins().fY), fMousedCtrl->GetKeyName(), (uint32_t)0xffffff00 ); + plDebugText::Instance().DrawString( (uint16_t)(bnds.GetMins().fX), (uint16_t)(bnds.GetMins().fY), _TEMP_CONVERT_TO_CONST_CHAR( fMousedCtrl->GetKeyName() ), (uint32_t)0xffffff00 ); } #endif diff --git a/Sources/Plasma/NucleusLib/pnDispatch/plDispatch.cpp b/Sources/Plasma/NucleusLib/pnDispatch/plDispatch.cpp index 4b3a2b3d..59b3cd81 100644 --- a/Sources/Plasma/NucleusLib/pnDispatch/plDispatch.cpp +++ b/Sources/Plasma/NucleusLib/pnDispatch/plDispatch.cpp @@ -332,7 +332,7 @@ void plDispatch::IMsgDispatch() { hsLogEntry(plNetObjectDebuggerBase::GetInstance()->LogMsg( xtl::format(" object:%s, GameMessage %s st=%.3f rt=%.3f", - ko->GetKeyName(), msg->ClassName(), hsTimer::GetSysSeconds(), hsTimer::GetSeconds()).c_str())); + ko->GetKeyName().c_str(), msg->ClassName(), hsTimer::GetSysSeconds(), hsTimer::GetSeconds()).c_str())); } } } diff --git a/Sources/Plasma/NucleusLib/pnKeyedObject/hsKeyedObject.cpp b/Sources/Plasma/NucleusLib/pnKeyedObject/hsKeyedObject.cpp index 3c7b10d3..2562d456 100644 --- a/Sources/Plasma/NucleusLib/pnKeyedObject/hsKeyedObject.cpp +++ b/Sources/Plasma/NucleusLib/pnKeyedObject/hsKeyedObject.cpp @@ -145,7 +145,7 @@ void hsKeyedObject::UnRegisterAsManual(plUoid& inUoid) #if !HS_BUILD_FOR_UNIX // disable for unix servers hsAssert(false, plString::Format("Request to Unregister wrong FixedKey, keyName=%s, inUoid=%s, myUoid=%s", - fpKey->GetName() ? fpKey->GetName() : "?", inUoid.StringIze().c_str(), myUoid.StringIze().c_str()).c_str()); + fpKey->GetName().s_str("?"), inUoid.StringIze().c_str(), myUoid.StringIze().c_str()).c_str()); #endif } ((plKeyImp*)fpKey)->UnRegister(); diff --git a/Sources/Plasma/NucleusLib/pnKeyedObject/plKey.h b/Sources/Plasma/NucleusLib/pnKeyedObject/plKey.h index 23360925..5e8c1ebc 100644 --- a/Sources/Plasma/NucleusLib/pnKeyedObject/plKey.h +++ b/Sources/Plasma/NucleusLib/pnKeyedObject/plKey.h @@ -44,6 +44,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include "HeadSpin.h" #include "plRefFlags.h" +#include "plString.h" class hsKeyedObject; class plRefMsg; @@ -55,7 +56,6 @@ class hsBitVector; class plKeyData; class plKeyImp; -class plString; class plKey { @@ -131,7 +131,7 @@ protected: #ifdef HS_DEBUGGING // Debugging info fields - const char* fIDName; + plString fIDName; const char* fClassType; #endif diff --git a/Sources/Plasma/NucleusLib/pnKeyedObject/plKeyImp.cpp b/Sources/Plasma/NucleusLib/pnKeyedObject/plKeyImp.cpp index b0fb1193..7400f8a3 100644 --- a/Sources/Plasma/NucleusLib/pnKeyedObject/plKeyImp.cpp +++ b/Sources/Plasma/NucleusLib/pnKeyedObject/plKeyImp.cpp @@ -81,7 +81,6 @@ plKeyImp::plKeyImp() : fCloneOwner(nil) { #ifdef HS_DEBUGGING - fIDName = nil; fClassType = nil; #endif } diff --git a/Sources/Plasma/NucleusLib/pnKeyedObject/plUoid.cpp b/Sources/Plasma/NucleusLib/pnKeyedObject/plUoid.cpp index 9d15390d..c1ebce7e 100644 --- a/Sources/Plasma/NucleusLib/pnKeyedObject/plUoid.cpp +++ b/Sources/Plasma/NucleusLib/pnKeyedObject/plUoid.cpp @@ -159,7 +159,7 @@ plUoid::~plUoid() void plUoid::Read(hsStream* s) { - hsAssert(fObjectName == nil, "Reading over an old uoid? You're just asking for trouble, aren't you?"); + hsAssert(fObjectName.IsNull(), "Reading over an old uoid? You're just asking for trouble, aren't you?"); // first read contents flags uint8_t contents = s->ReadByte(); diff --git a/Sources/Plasma/NucleusLib/pnNetCommon/plSynchedObject.cpp b/Sources/Plasma/NucleusLib/pnNetCommon/plSynchedObject.cpp index 5e650637..7c9750d3 100644 --- a/Sources/Plasma/NucleusLib/pnNetCommon/plSynchedObject.cpp +++ b/Sources/Plasma/NucleusLib/pnNetCommon/plSynchedObject.cpp @@ -236,7 +236,7 @@ hsBool plSynchedObject::DirtySynchState(const char* SDLStateName, uint32_t synch { if (plNetClientApp::GetInstance()) plNetClientApp::GetInstance()->DebugMsg("Queueing SDL state with 'maybe' ownership, obj %s, sdl %s", - GetKeyName(), SDLStateName); + GetKeyName().c_str(), SDLStateName); } } diff --git a/Sources/Plasma/NucleusLib/pnUUID/pnUUID.h b/Sources/Plasma/NucleusLib/pnUUID/pnUUID.h index 48afd3be..dd2aed4a 100644 --- a/Sources/Plasma/NucleusLib/pnUUID/pnUUID.h +++ b/Sources/Plasma/NucleusLib/pnUUID/pnUUID.h @@ -49,6 +49,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #endif class hsStream; +class plString; class plUUID { diff --git a/Sources/Plasma/PubUtilLib/plGImage/plMipmap.cpp b/Sources/Plasma/PubUtilLib/plGImage/plMipmap.cpp index 0db6ed19..9da2f81b 100644 --- a/Sources/Plasma/PubUtilLib/plGImage/plMipmap.cpp +++ b/Sources/Plasma/PubUtilLib/plGImage/plMipmap.cpp @@ -2121,7 +2121,7 @@ hsBool plMipmap::ResizeNicely( uint16_t newWidth, uint16_t newHeight, plMipmap: //// Debug Mipmap Memory Leak Tracker ///////////////////////////////////////// plMipmap::plRecord *plMipmap::fRecords = nil; -uint32_t plMipmap::fNumMipmaps = 0; +uint32_t plMipmap::fNumMipmaps = 0; void plMipmap::IAddToMemRecord( plMipmap *mip, plRecord::Method method ) { @@ -2136,9 +2136,9 @@ void plMipmap::IAddToMemRecord( plMipmap *mip, plRecord::Method method ) newRecord->fNumLevels = mip->fNumLevels; newRecord->fRowBytes = mip->fRowBytes; if( mip->GetKey() ) - strcpy( newRecord->fKeyName, mip->GetKeyName() ); + newRecord->fKeyName = mip->GetKeyName(); else - strcpy( newRecord->fKeyName, "" ); + newRecord->fKeyName = _TEMP_CONVERT_FROM_LITERAL( "" ); if( mip->fCompressionType != kDirectXCompression ) newRecord->fUncompressedInfo.fType = mip->fUncompressedInfo.fType; else diff --git a/Sources/Plasma/PubUtilLib/plGImage/plMipmap.h b/Sources/Plasma/PubUtilLib/plGImage/plMipmap.h index 64fd1b91..b2e5fab1 100644 --- a/Sources/Plasma/PubUtilLib/plGImage/plMipmap.h +++ b/Sources/Plasma/PubUtilLib/plGImage/plMipmap.h @@ -55,6 +55,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #define _plMipmap_h #include "plBitmap.h" +#include "plString.h" #ifdef HS_DEBUGGING #define ASSERT_PIXELSIZE(bitmap, pixelsize) hsAssert((bitmap)->fPixelSize == (pixelsize), "pixelSize mismatch") @@ -291,13 +292,13 @@ class plMipmap : public plBitmap //// Protected Members //// void *fImage; - uint32_t fWidth, fHeight, fRowBytes, fTotalSize; - uint8_t fNumLevels; - uint32_t *fLevelSizes; + uint32_t fWidth, fHeight, fRowBytes, fTotalSize; + uint8_t fNumLevels; + uint32_t *fLevelSizes; void *fCurrLevelPtr; - uint8_t fCurrLevel; - uint32_t fCurrLevelWidth, fCurrLevelHeight, fCurrLevelRowBytes; + uint8_t fCurrLevel; + uint32_t fCurrLevelWidth, fCurrLevelHeight, fCurrLevelRowBytes; void IReadRawImage( hsStream *stream ); void IWriteRawImage( hsStream *stream ); @@ -335,11 +336,11 @@ class plMipmap : public plBitmap plRecord *fNext; plRecord **fBackPtr; - char fKeyName[ 256 ]; + plString fKeyName; void *fImage; - uint32_t fWidth, fHeight, fRowBytes; - uint8_t fNumLevels; - uint8_t fCompressionType; + uint32_t fWidth, fHeight, fRowBytes; + uint8_t fNumLevels; + uint8_t fCompressionType; union { DirectXInfo fDirectXInfo; diff --git a/Sources/Plasma/PubUtilLib/plNetClient/plNetClientMgr.cpp b/Sources/Plasma/PubUtilLib/plNetClient/plNetClientMgr.cpp index 1a0fb70a..4550df92 100644 --- a/Sources/Plasma/PubUtilLib/plNetClient/plNetClientMgr.cpp +++ b/Sources/Plasma/PubUtilLib/plNetClient/plNetClientMgr.cpp @@ -1390,7 +1390,7 @@ bool plNetClientMgr::IHandlePlayerPageMsg(plPlayerPageMsg *playerMsg) if( idx != -1 ) { hsAssert(playerKey, "NIL KEY?"); - hsAssert(playerKey->GetName(), "UNNAMED KEY"); + hsAssert(!playerKey->GetName().IsNull(), "UNNAMED KEY"); fTransport.GetMember(idx)->SetAvatarKey(playerKey); } else diff --git a/Sources/Plasma/PubUtilLib/plNetClient/plNetClientMgrVoice.cpp b/Sources/Plasma/PubUtilLib/plNetClient/plNetClientMgrVoice.cpp index c4f1fffc..e02efb53 100644 --- a/Sources/Plasma/PubUtilLib/plNetClient/plNetClientMgrVoice.cpp +++ b/Sources/Plasma/PubUtilLib/plNetClient/plNetClientMgrVoice.cpp @@ -194,7 +194,7 @@ hsBool plNetClientMgr::IApplyNewListenList(std::vector& newListenLis GetListenList()->AddMember(newListenList[i].fMbr); #ifdef HS_DEBUGGING DebugMsg("\tLL Member %d, name=%s, cNum=%d, dist=%f\n", - i, newListenList[i].fMbr->AsStdString().c_str(), + i, newListenList[i].fMbr->AsString().c_str(), newListenList[i].fMbr->GetPlayerID(), newListenList[i].fDistSq); #endif } diff --git a/Sources/Plasma/PubUtilLib/plResMgr/plResManager.cpp b/Sources/Plasma/PubUtilLib/plResMgr/plResManager.cpp index b522ee12..f2be393e 100644 --- a/Sources/Plasma/PubUtilLib/plResMgr/plResManager.cpp +++ b/Sources/Plasma/PubUtilLib/plResMgr/plResManager.cpp @@ -370,7 +370,7 @@ hsBool plResManager::IReadObject(plKeyImp* pKey, hsStream *stream) if (pKey->GetStartPos() == uint32_t(-1) || pKey->GetDataLen() == uint32_t(-1)) return false; // Try to recover from this by just not reading an object - kResMgrLog(3, ILog(3, " Reading object %s::%s", plFactory::GetNameOfClass(pKey->GetUoid().GetClassType()), pKey->GetUoid().GetObjectName())); + kResMgrLog(3, ILog(3, " Reading object %s::%s", plFactory::GetNameOfClass(pKey->GetUoid().GetClassType()), pKey->GetUoid().GetObjectName().c_str())); const plUoid& uoid = pKey->GetUoid(); @@ -440,7 +440,7 @@ hsBool plResManager::IReadObject(plKeyImp* pKey, hsStream *stream) fCurCloneID = 0; } - kResMgrLog(4, ILog(4, " ...Read complete for object %s::%s", plFactory::GetNameOfClass(pKey->GetUoid().GetClassType()), pKey->GetUoid().GetObjectName())); + kResMgrLog(4, ILog(4, " ...Read complete for object %s::%s", plFactory::GetNameOfClass(pKey->GetUoid().GetClassType()), pKey->GetUoid().GetObjectName().c_str())); if (fLogReadTimes) { @@ -449,7 +449,7 @@ hsBool plResManager::IReadObject(plKeyImp* pKey, hsStream *stream) ourTime -= childTime; plStatusLog::AddLineS("readtimings.log", plStatusLog::kWhite, "%s, %s, %u, %.1f", - pKey->GetUoid().GetObjectName(), + pKey->GetUoid().GetObjectName().c_str(), plFactory::GetNameOfClass(pKey->GetUoid().GetClassType()), pKey->GetDataLen(), hsTimer::FullTicksToMs(ourTime)); @@ -722,7 +722,7 @@ plKey plResManager::ReadKeyNotifyMe(hsStream* stream, plRefMsg* msg, plRefFlags: } if(key->GetUoid().GetLoadMask().DontLoad()) { - hsStatusMessageF("%s being skipped because of load mask", key->GetName()); + hsStatusMessageF("%s being skipped because of load mask", key->GetName().c_str()); hsRefCnt_SafeUnRef(msg); return nil; }