diff --git a/Sources/Plasma/Apps/plClient/plClient.cpp b/Sources/Plasma/Apps/plClient/plClient.cpp index 2c49a608..539ca629 100644 --- a/Sources/Plasma/Apps/plClient/plClient.cpp +++ b/Sources/Plasma/Apps/plClient/plClient.cpp @@ -1286,7 +1286,7 @@ void plClient::IRoomUnloaded(plSceneNode* node) void plClient::IReadKeyedObjCallback(plKey key) { - fInstance->IIncProgress(1, _TEMP_CONVERT_TO_CONST_CHAR(key->GetName())); + fInstance->IIncProgress(1, key->GetName().c_str()); } //============================================================================ diff --git a/Sources/Plasma/Apps/plClient/winmain.cpp b/Sources/Plasma/Apps/plClient/winmain.cpp index 32318fa8..4d0780d3 100644 --- a/Sources/Plasma/Apps/plClient/winmain.cpp +++ b/Sources/Plasma/Apps/plClient/winmain.cpp @@ -998,15 +998,15 @@ static void SaveUserPass (LoginDialogParam *pLoginParam, char *password) memset(cryptKey, 0, sizeof(cryptKey)); GetCryptKey(cryptKey, arrsize(cryptKey)); - plString theUser = _TEMP_CONVERT_FROM_LITERAL(pLoginParam->username); - plString thePass = (_TEMP_CONVERT_FROM_LITERAL(password)).Left(kMaxPasswordLength); + plString theUser = pLoginParam->username; + plString thePass = plString(password).Left(kMaxPasswordLength); // if the password field is the fake string then we've already // loaded the namePassHash from the file if (thePass.Compare(FAKE_PASS_STRING) != 0) { wchar_t domain[15]; - PathSplitEmail(_TEMP_CONVERT_TO_WCHAR_T(theUser), nil, 0, domain, arrsize(domain), nil, 0, nil, 0, 0); + PathSplitEmail(theUser.ToWchar(), nil, 0, domain, arrsize(domain), nil, 0, nil, 0, 0); if (StrLen(domain) == 0 || StrCmpI(domain, L"gametap") == 0) { plSHA1Checksum shasum(StrLen(password) * sizeof(password[0]), (uint8_t*)password); @@ -1026,7 +1026,7 @@ static void SaveUserPass (LoginDialogParam *pLoginParam, char *password) } } - NetCommSetAccountUsernamePassword(_TEMP_CONVERT_TO_WCHAR_T(theUser), pLoginParam->namePassHash); + NetCommSetAccountUsernamePassword(theUser.ToWchar(), pLoginParam->namePassHash); if (TGIsCider) NetCommSetAuthTokenAndOS(nil, L"mac"); else @@ -1436,7 +1436,7 @@ int WINAPI WinMain(HINSTANCE hInst, HINSTANCE hPrevInst, LPSTR lpCmdLine, int nC if (!eventExists) // if it is missing, assume patcher wasn't launched { - cmdLine << _TEMP_CONVERT_FROM_WCHAR_T(s_patcherExeName); + cmdLine << plString::FromWchar(s_patcherExeName); GetAuthSrvHostnames(&addrs); if(strlen(addrs[0])) diff --git a/Sources/Plasma/CoreLib/hsStream.cpp b/Sources/Plasma/CoreLib/hsStream.cpp index ee0c9e34..5cff5899 100644 --- a/Sources/Plasma/CoreLib/hsStream.cpp +++ b/Sources/Plasma/CoreLib/hsStream.cpp @@ -139,40 +139,36 @@ uint32_t hsStream::WriteFmtV(const char * fmt, va_list av) return Write( buf.length(), buf.data() ); } -uint32_t hsStream::WriteSafeStringLong(const char *string) +uint32_t hsStream::WriteSafeStringLong(const plString &string) { - uint32_t len = 0; - if (string) - len = strlen(string); + uint32_t len = string.GetSize(); WriteLE32(len); if (len > 0) { - char *buff = new char[len+1]; + const char *buffp = string.c_str(); int i; for (i = 0; i < len; i++) { - buff[i] = ~string[i]; + WriteByte(~buffp[i]); } - buff[len] = '\0'; - uint32_t result = Write(len, buff); - delete [] buff; - return result; + return static_cast(i); } else return 0; } -uint32_t hsStream::WriteSafeWStringLong(const wchar_t *string) +uint32_t hsStream::WriteSafeWStringLong(const plString &string) { - uint32_t len = wcslen(string); + plStringBuffer wbuff = string.ToWchar(); + uint32_t len = wbuff.GetSize(); WriteLE32(len); if (len > 0) { int i; + const wchar_t *buffp = wbuff.GetData(); for (i=0; i 0) { - char *buff = new char[len+1]; int i; + const char *buffp = string.c_str(); for (i = 0; i < len; i++) { - buff[i] = ~string[i]; + WriteByte(~buffp[i]); } - buff[len] = '\0'; - uint32_t result = Write(len, buff); - delete [] buff; - return result; + return static_cast(i); } else return 0; } -uint32_t hsStream::WriteSafeWString(const wchar_t *string) +uint32_t hsStream::WriteSafeWString(const plString &string) { - int len = wcslen(string); + plStringBuffer wbuff = string.ToWchar(); + int len = wbuff.GetSize(); hsAssert(len<0xf000, xtl::format("string len of %d is too long for WriteSafeWString, use WriteSafeWStringLong", len).c_str() ); @@ -260,10 +252,10 @@ uint32_t hsStream::WriteSafeWString(const wchar_t *string) if (len > 0) { int i; + const wchar_t *buffp = wbuff.GetData(); for (i=0; iWriteSafeWString(fStringVal.c_str()); + stream->WriteSafeWString(fStringVal); break; } return stream->GetPosition(); @@ -189,14 +144,7 @@ int plGeneric::Read(hsStream* stream) break; case kString: - { - wchar_t* temp = stream->ReadSafeWString(); - if (temp) - { - fStringVal = temp; - delete [] temp; - } - } + fStringVal = stream->ReadSafeWString_TEMP(); break; } return stream->GetPosition(); diff --git a/Sources/Plasma/CoreLib/plGeneric.h b/Sources/Plasma/CoreLib/plGeneric.h index eb57d807..c73897a8 100644 --- a/Sources/Plasma/CoreLib/plGeneric.h +++ b/Sources/Plasma/CoreLib/plGeneric.h @@ -62,7 +62,7 @@ private: bool fBoolVal; int fIntVal; double fFloatVal; - std::wstring fStringVal; + plString fStringVal; void IReset(); @@ -71,19 +71,13 @@ public: plGeneric(const bool& val); plGeneric(const int& val); plGeneric(const double& val); - plGeneric(const char* val); - plGeneric(const std::string& val); - plGeneric(const wchar_t* val); - plGeneric(const std::wstring& val); + plGeneric(const plString& val); void SetToNull() {IReset();} plGeneric& operator=(const bool& val); plGeneric& operator=(const int& val); plGeneric& operator=(const double& val); - plGeneric& operator=(const char* val); - plGeneric& operator=(const std::string& val); - plGeneric& operator=(const wchar_t* val); - plGeneric& operator=(const std::wstring& val); + plGeneric& operator=(const plString& val); // the cast functions will NOT cast from one type to another, use // GetType() to determine the type of parameter, then cast it to that type @@ -91,8 +85,7 @@ public: operator bool() const {return fBoolVal;} operator int() const {return fIntVal;} operator double() const {return fFloatVal;} - operator const wchar_t*() const {return fStringVal.c_str();} - operator std::wstring() const {return fStringVal;} + operator plString() const {return fStringVal;} int Write(hsStream* stream); int Read(hsStream* stream); diff --git a/Sources/Plasma/CoreLib/plString.h b/Sources/Plasma/CoreLib/plString.h index c29a4a12..6def1177 100644 --- a/Sources/Plasma/CoreLib/plString.h +++ b/Sources/Plasma/CoreLib/plString.h @@ -46,16 +46,6 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include "HeadSpin.h" #include -/* NOTE & TODO: - * These macros are intentionally annoyingly named, to mark what code - * needs to be cleaned up after a larger portion of Plasma is converted - * to plString. - */ -#define _TEMP_CONVERT_FROM_LITERAL(x) plString::FromUtf8((x)) -#define _TEMP_CONVERT_FROM_WCHAR_T(x) plString::FromWchar((x)) -#define _TEMP_CONVERT_TO_CONST_CHAR(x) ((x).c_str()) -#define _TEMP_CONVERT_TO_WCHAR_T(x) ((x).ToWchar().GetData()) - typedef unsigned int UniChar; #define SSO_CHARS (16) @@ -173,13 +163,15 @@ private: public: plString() { } - //plString(const char *utf8) { IConvertFromUtf8(utf8, kSizeAuto, false); } - //plString(const wchar_t *wstr) { IConvertFromWchar(wstr, kSizeAuto); } +#ifndef PLSTRING_POLLUTE_ASCII_CAST + plString(const char *ascii) { IConvertFromUtf8(ascii, kSizeAuto); } +#endif plString(const plString ©) : fUtf8Buffer(copy.fUtf8Buffer) { } plString(const plStringBuffer &init) { operator=(init); } - //plString &operator=(const char *utf8) { IConvertFromUtf8(utf8, kSizeAuto, false); return *this; } - //plString &operator=(const wchar_t *wstr) { IConvertFromWchar(wstr, kSizeAuto); return *this; } +#ifndef PLSTRING_POLLUTE_ASCII_CAST + plString &operator=(const char *ascii) { IConvertFromUtf8(ascii, kSizeAuto); return *this; } +#endif plString &operator=(const plString ©) { fUtf8Buffer = copy.fUtf8Buffer; return *this; } plString &operator=(const plStringBuffer &init); @@ -213,8 +205,10 @@ public: return str; } +#ifndef PLSTRING_POLLUTE_C_STR const char *c_str(const char *substitute = "") const { return IsEmpty() ? substitute : fUtf8Buffer.GetData(); } +#endif char CharAt(size_t position) const { return c_str()[position]; } diff --git a/Sources/Plasma/FeatureLib/pfAnimation/plAnimDebugList.cpp b/Sources/Plasma/FeatureLib/pfAnimation/plAnimDebugList.cpp index 7f3f0ed3..3df1e750 100644 --- a/Sources/Plasma/FeatureLib/pfAnimation/plAnimDebugList.cpp +++ b/Sources/Plasma/FeatureLib/pfAnimation/plAnimDebugList.cpp @@ -127,7 +127,7 @@ void plAnimDebugList::ShowReport() str = plString::Format("%s: %s %.3f (%.3f)", mat->GetKeyName().c_str(), layerAnim->GetKeyName().c_str(), layerAnim->GetTimeConvert().CurrentAnimTime(), layerAnim->GetTimeConvert().WorldToAnimTimeNoUpdate(hsTimer::GetSysSeconds())); - txt.DrawString(x, y, _TEMP_CONVERT_TO_CONST_CHAR(str)); + txt.DrawString(x, y, str.c_str()); y += yOff; } layer = layer->GetOverLay(); @@ -149,7 +149,7 @@ void plAnimDebugList::ShowReport() continue; str = plString::Format(" %s", so->GetKeyName().c_str()); - txt.DrawString(x, y, _TEMP_CONVERT_TO_CONST_CHAR(str)); + txt.DrawString(x, y, str.c_str()); y += yOff; for (j = 0; j < mod->GetNumATCAnimations(); j++) @@ -158,7 +158,7 @@ void plAnimDebugList::ShowReport() str = plString::Format(" %s: %.3f (%.3f)", anim->GetAnimation()->GetName().c_str(), anim->GetTimeConvert()->CurrentAnimTime(), anim->GetTimeConvert()->WorldToAnimTimeNoUpdate(hsTimer::GetSysSeconds())); - txt.DrawString(x, y, _TEMP_CONVERT_TO_CONST_CHAR(str)); + txt.DrawString(x, y, str.c_str()); y += yOff; } } diff --git a/Sources/Plasma/FeatureLib/pfCharacter/pfMarkerInfo.cpp b/Sources/Plasma/FeatureLib/pfCharacter/pfMarkerInfo.cpp index 2b8175d3..6acd87bb 100644 --- a/Sources/Plasma/FeatureLib/pfCharacter/pfMarkerInfo.cpp +++ b/Sources/Plasma/FeatureLib/pfCharacter/pfMarkerInfo.cpp @@ -77,7 +77,7 @@ void pfMarkerInfo::Init() plLocation markerLoc = plKeyFinder::Instance().FindLocation("GlobalMarkers", "Markers"); if (markerLoc.IsValid()) - fMarkerUoid = plUoid(markerLoc, plSceneObject::Index(), _TEMP_CONVERT_FROM_LITERAL("MarkerRoot")); + fMarkerUoid = plUoid(markerLoc, plSceneObject::Index(), "MarkerRoot"); else fMarkerUoid.Invalidate(); } @@ -101,7 +101,7 @@ void pfMarkerInfo::Spawn(MarkerType type) plLocation markerLoc = plKeyFinder::Instance().FindLocation("GlobalMarkers", "Markers"); if (markerLoc.IsValid()) - fMarkerUoid = plUoid(markerLoc, plSceneObject::Index(), _TEMP_CONVERT_FROM_LITERAL("MarkerRoot")); + fMarkerUoid = plUoid(markerLoc, plSceneObject::Index(), "MarkerRoot"); else { hsAssert(false, "Unable to spawn markers because the marker age was not loaded or found"); diff --git a/Sources/Plasma/FeatureLib/pfConsole/pfAvatarConsoleCommands.cpp b/Sources/Plasma/FeatureLib/pfConsole/pfAvatarConsoleCommands.cpp index 00a6c920..35623df8 100644 --- a/Sources/Plasma/FeatureLib/pfConsole/pfAvatarConsoleCommands.cpp +++ b/Sources/Plasma/FeatureLib/pfConsole/pfAvatarConsoleCommands.cpp @@ -173,7 +173,7 @@ PF_CONSOLE_CMD( Avatar_Spawn, Show, "", "Print a list of spawn points.") const plSpawnModifier * spawn = mgr->GetSpawnPoint(i); if(spawn) { - plString soName = _TEMP_CONVERT_FROM_LITERAL("(none)"); + plString soName = "(none)"; if (spawn->GetNumTargets() > 0) { diff --git a/Sources/Plasma/FeatureLib/pfConsole/pfConsoleCommands.cpp b/Sources/Plasma/FeatureLib/pfConsole/pfConsoleCommands.cpp index 45b7c192..f3df05e9 100644 --- a/Sources/Plasma/FeatureLib/pfConsole/pfConsoleCommands.cpp +++ b/Sources/Plasma/FeatureLib/pfConsole/pfConsoleCommands.cpp @@ -6980,7 +6980,7 @@ PF_CONSOLE_CMD( Python, args = plString::Format("(%s,)", tmp); } else - args = _TEMP_CONVERT_FROM_LITERAL("()"); + args = "()"; PythonInterface::RunFunctionSafe("xCheat", params[0], args.c_str()); diff --git a/Sources/Plasma/FeatureLib/pfConsole/pfConsoleCommandsNet.cpp b/Sources/Plasma/FeatureLib/pfConsole/pfConsoleCommandsNet.cpp index 992c809e..124aa516 100644 --- a/Sources/Plasma/FeatureLib/pfConsole/pfConsoleCommandsNet.cpp +++ b/Sources/Plasma/FeatureLib/pfConsole/pfConsoleCommandsNet.cpp @@ -231,12 +231,12 @@ PF_CONSOLE_CMD( Net, // groupName { // send chat text plString text=plNetClientMgr::GetInstance()->GetPlayerName(); - text += _TEMP_CONVERT_FROM_LITERAL(":"); + text += ":"; int i; for(i=0;iSetBCastFlag(plMessage::kNetPropagate | plMessage::kNetForce); diff --git a/Sources/Plasma/FeatureLib/pfGameGUIMgr/pfGUIDialogMod.cpp b/Sources/Plasma/FeatureLib/pfGameGUIMgr/pfGUIDialogMod.cpp index 67e277bb..a463bc44 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), _TEMP_CONVERT_TO_CONST_CHAR( fMousedCtrl->GetKeyName() ), (uint32_t)0xffffff00 ); + plDebugText::Instance().DrawString( (uint16_t)(bnds.GetMins().fX), (uint16_t)(bnds.GetMins().fY), fMousedCtrl->GetKeyName().c_str(), (uint32_t)0xffffff00 ); } #endif diff --git a/Sources/Plasma/FeatureLib/pfGameGUIMgr/pfGUIEditBoxMod.cpp b/Sources/Plasma/FeatureLib/pfGameGUIMgr/pfGUIEditBoxMod.cpp index bc5c84c6..6728b07a 100644 --- a/Sources/Plasma/FeatureLib/pfGameGUIMgr/pfGUIEditBoxMod.cpp +++ b/Sources/Plasma/FeatureLib/pfGameGUIMgr/pfGUIEditBoxMod.cpp @@ -388,7 +388,7 @@ bool pfGUIEditBoxMod::HandleKeyEvent( pfGameGUIMgr::EventType event, plKeyDef { if (key == KEY_C) { - plClipboard::GetInstance().SetClipboardText(_TEMP_CONVERT_FROM_WCHAR_T(fBuffer)); + plClipboard::GetInstance().SetClipboardText(plString::FromWchar(fBuffer)); } else if (key == KEY_V) { diff --git a/Sources/Plasma/FeatureLib/pfGameGUIMgr/pfGUIMultiLineEditCtrl.cpp b/Sources/Plasma/FeatureLib/pfGameGUIMgr/pfGUIMultiLineEditCtrl.cpp index aea1fd26..eccf512c 100644 --- a/Sources/Plasma/FeatureLib/pfGameGUIMgr/pfGUIMultiLineEditCtrl.cpp +++ b/Sources/Plasma/FeatureLib/pfGameGUIMgr/pfGUIMultiLineEditCtrl.cpp @@ -1113,7 +1113,7 @@ bool pfGUIMultiLineEditCtrl::HandleKeyEvent( pfGameGUIMgr::EventType event, p // Too lazy to worry about that... if (key == KEY_C) { - plClipboard::GetInstance().SetClipboardText(_TEMP_CONVERT_FROM_WCHAR_T(fBuffer.AcquireArray())); + plClipboard::GetInstance().SetClipboardText(plString::FromWchar(fBuffer.AcquireArray())); } else if (key == KEY_V) { diff --git a/Sources/Plasma/FeatureLib/pfGameGUIMgr/pfGUITextBoxMod.cpp b/Sources/Plasma/FeatureLib/pfGameGUIMgr/pfGUITextBoxMod.cpp index 9df6032a..b090c37d 100644 --- a/Sources/Plasma/FeatureLib/pfGameGUIMgr/pfGUITextBoxMod.cpp +++ b/Sources/Plasma/FeatureLib/pfGameGUIMgr/pfGUITextBoxMod.cpp @@ -121,8 +121,8 @@ void pfGUITextBoxMod::IUpdate( void ) fDynTextMap->ClearToColor( GetColorScheme()->fBackColor ); std::wstring drawStr; - if (fUseLocalizationPath && !fLocalizationPath.empty() && pfLocalizationMgr::InstanceValid()) - drawStr = pfLocalizationMgr::Instance().GetString(fLocalizationPath.c_str()); + if (fUseLocalizationPath && !fLocalizationPath.IsEmpty() && pfLocalizationMgr::InstanceValid()) + drawStr = pfLocalizationMgr::Instance().GetString(fLocalizationPath.ToWchar().GetData()); else { if( fText != nil ) @@ -170,9 +170,7 @@ void pfGUITextBoxMod::Read( hsStream *s, hsResMgr *mgr ) fUseLocalizationPath = s->ReadBool(); if (fUseLocalizationPath) { - wchar_t* temp = s->ReadSafeWString(); - fLocalizationPath = temp; - delete [] temp; + fLocalizationPath = s->ReadSafeWString_TEMP(); } } @@ -192,11 +190,11 @@ void pfGUITextBoxMod::Write( hsStream *s, hsResMgr *mgr ) // Make sure we only write out to use localization path if the box is checked // and the path isn't empty - bool useLoc = fUseLocalizationPath && !fLocalizationPath.empty(); + bool useLoc = fUseLocalizationPath && !fLocalizationPath.IsEmpty(); s->WriteBool(useLoc); if (useLoc) - s->WriteSafeWString(fLocalizationPath.c_str()); + s->WriteSafeWString(fLocalizationPath); } //// HandleMouseDown/Up ////////////////////////////////////////////////////// @@ -240,22 +238,12 @@ void pfGUITextBoxMod::SetText( const wchar_t *text ) IUpdate(); } -void pfGUITextBoxMod::SetLocalizationPath(const wchar_t* path) +void pfGUITextBoxMod::SetLocalizationPath(const plString& path) { - if (path) + if (!path.IsNull()) fLocalizationPath = path; } -void pfGUITextBoxMod::SetLocalizationPath(const char* path) -{ - if (path) - { - wchar_t* wPath = hsStringToWString(path); - fLocalizationPath = wPath; - delete [] wPath; - } -} - void pfGUITextBoxMod::SetUseLocalizationPath(bool use) { fUseLocalizationPath = use; diff --git a/Sources/Plasma/FeatureLib/pfGameGUIMgr/pfGUITextBoxMod.h b/Sources/Plasma/FeatureLib/pfGameGUIMgr/pfGUITextBoxMod.h index 621c360c..bde8a374 100644 --- a/Sources/Plasma/FeatureLib/pfGameGUIMgr/pfGUITextBoxMod.h +++ b/Sources/Plasma/FeatureLib/pfGameGUIMgr/pfGUITextBoxMod.h @@ -59,7 +59,7 @@ class pfGUITextBoxMod : public pfGUIControlMod protected: wchar_t *fText; - std::wstring fLocalizationPath; + plString fLocalizationPath; bool fUseLocalizationPath; @@ -99,8 +99,7 @@ class pfGUITextBoxMod : public pfGUIControlMod void SetText( const char *text ); void SetText( const wchar_t *text ); - void SetLocalizationPath(const wchar_t* path); - void SetLocalizationPath(const char* path); + void SetLocalizationPath(const plString& path); void SetUseLocalizationPath(bool use); virtual void UpdateColorScheme() { IPostSetUpDynTextMap(); IUpdate(); } diff --git a/Sources/Plasma/FeatureLib/pfGameScoreMgr/pfGameScoreMgr.cpp b/Sources/Plasma/FeatureLib/pfGameScoreMgr/pfGameScoreMgr.cpp index 8650a3b6..7abcd867 100644 --- a/Sources/Plasma/FeatureLib/pfGameScoreMgr/pfGameScoreMgr.cpp +++ b/Sources/Plasma/FeatureLib/pfGameScoreMgr/pfGameScoreMgr.cpp @@ -143,7 +143,7 @@ static void OnScoreCreate( int32_t value ) { ScoreUpdateParam* p = (ScoreUpdateParam*)param; - pfGameScore* score = new pfGameScore(scoreId, ownerId, _TEMP_CONVERT_FROM_LITERAL(gameName), gameType, value); + pfGameScore* score = new pfGameScore(scoreId, ownerId, gameName, gameType, value); pfGameScoreUpdateMsg* msg = new pfGameScoreUpdateMsg(result, score, value); msg->Send(p->fReceiver); delete p; @@ -165,7 +165,7 @@ static void OnScoreFound( for (uint32_t i = 0; i < scoreCount; ++i) { const NetGameScore ngs = scores[i]; - vec[i] = new pfGameScore(ngs.scoreId, ngs.ownerId, _TEMP_CONVERT_FROM_WCHAR_T(ngs.gameName), ngs.gameType, ngs.value); + vec[i] = new pfGameScore(ngs.scoreId, ngs.ownerId, plString::FromWchar(ngs.gameName), ngs.gameType, ngs.value); } ScoreFindParam* p = (ScoreFindParam*)param; diff --git a/Sources/Plasma/FeatureLib/pfJournalBook/pfJournalBook.cpp b/Sources/Plasma/FeatureLib/pfJournalBook/pfJournalBook.cpp index e1641973..0ff2c533 100644 --- a/Sources/Plasma/FeatureLib/pfJournalBook/pfJournalBook.cpp +++ b/Sources/Plasma/FeatureLib/pfJournalBook/pfJournalBook.cpp @@ -472,7 +472,7 @@ pfBookData::pfBookData(const plString &guiName /* = nil */) if (!guiName.IsEmpty()) fGUIName = guiName; else - fGUIName = _TEMP_CONVERT_FROM_LITERAL("BkBook"); + fGUIName = "BkBook"; } pfBookData::~pfBookData() @@ -1140,9 +1140,9 @@ std::map pfJournalBook::fBookGUIs; void pfJournalBook::SingletonInit( void ) { - fBookGUIs[_TEMP_CONVERT_FROM_LITERAL("BkBook")] = new pfBookData(); // load the default book data object - hsgResMgr::ResMgr()->NewKey(_TEMP_CONVERT_FROM_LITERAL("BkBook"),fBookGUIs[_TEMP_CONVERT_FROM_LITERAL("BkBook")],pfGameGUIMgr::GetInstance()->GetKey()->GetUoid().GetLocation()); - fBookGUIs[_TEMP_CONVERT_FROM_LITERAL("BkBook")]->LoadGUI(); + fBookGUIs["BkBook"] = new pfBookData(); // load the default book data object + hsgResMgr::ResMgr()->NewKey("BkBook",fBookGUIs["BkBook"],pfGameGUIMgr::GetInstance()->GetKey()->GetUoid().GetLocation()); + fBookGUIs["BkBook"]->LoadGUI(); } void pfJournalBook::SingletonShutdown( void ) @@ -1207,7 +1207,7 @@ pfJournalBook::pfJournalBook( const char *esHTMLSource, plKey coverImageKey, plK if (!guiName.IsEmpty()) fCurBookGUI = guiName; else - fCurBookGUI = _TEMP_CONVERT_FROM_LITERAL("BkBook"); + fCurBookGUI = "BkBook"; if (fBookGUIs.find(fCurBookGUI) == fBookGUIs.end()) { fBookGUIs[fCurBookGUI] = new pfBookData(fCurBookGUI); @@ -1243,7 +1243,7 @@ pfJournalBook::pfJournalBook( const wchar_t *esHTMLSource, plKey coverImageKey, if (!guiName.IsEmpty()) fCurBookGUI = guiName; else - fCurBookGUI = _TEMP_CONVERT_FROM_LITERAL("BkBook"); + fCurBookGUI = "BkBook"; if (fBookGUIs.find(fCurBookGUI) == fBookGUIs.end()) { fBookGUIs[fCurBookGUI] = new pfBookData(fCurBookGUI); @@ -1292,7 +1292,7 @@ void pfJournalBook::SetGUI( const plString &guiName ) if (!guiName.IsEmpty()) fCurBookGUI = guiName; if (fBookGUIs.find(fCurBookGUI) == fBookGUIs.end()) - fCurBookGUI = _TEMP_CONVERT_FROM_LITERAL("BkBook"); // requested GUI isn't loaded, so use default GUI + fCurBookGUI = "BkBook"; // requested GUI isn't loaded, so use default GUI SetEditable(fWantEditing); // make sure that if we want editing, to set it ICompileSource(fUncompiledSource.c_str(), fDefLoc); // recompile the source to be safe } @@ -2506,9 +2506,9 @@ plKey pfJournalBook::IGetMipmapKey( const wchar_t *name, const plLocation &loc // facilitate fast prototyping plMipmap *mip; if( cName.Find( ".png" ) >= 0 ) - mip = plPNG::Instance().ReadFromFile( _TEMP_CONVERT_TO_CONST_CHAR( cName ) ); + mip = plPNG::Instance().ReadFromFile( cName.c_str() ); else - mip = plJPEG::Instance().ReadFromFile( _TEMP_CONVERT_TO_CONST_CHAR( cName ) ); + mip = plJPEG::Instance().ReadFromFile( cName.c_str() ); hsgResMgr::ResMgr()->NewKey( cName, mip, loc ); return mip->GetKey(); diff --git a/Sources/Plasma/FeatureLib/pfMessage/pfKIMsg.cpp b/Sources/Plasma/FeatureLib/pfMessage/pfKIMsg.cpp index bf8bb474..12ddcc60 100644 --- a/Sources/Plasma/FeatureLib/pfMessage/pfKIMsg.cpp +++ b/Sources/Plasma/FeatureLib/pfMessage/pfKIMsg.cpp @@ -49,18 +49,3 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com const char* pfKIMsg::kChronicleKILevel = "PlayerKILevel"; - -void pfKIMsg::SetString( const char *str ) -{ - wchar_t *temp = hsStringToWString( str ); - fString = temp; - delete [] temp; -} - -std::string pfKIMsg::GetString( void ) -{ - char *temp = hsWStringToString( fString.c_str() ); - std::string retVal = temp; - delete [] temp; - return retVal; -} diff --git a/Sources/Plasma/FeatureLib/pfMessage/pfKIMsg.h b/Sources/Plasma/FeatureLib/pfMessage/pfKIMsg.h index 190dcdd4..62890774 100644 --- a/Sources/Plasma/FeatureLib/pfMessage/pfKIMsg.h +++ b/Sources/Plasma/FeatureLib/pfMessage/pfKIMsg.h @@ -67,7 +67,7 @@ class pfKIMsg : public plMessage // for the hack chat message thingy char *fUser; uint32_t fPlayerID; - std::wstring fString; + plString fString; // for the SetChatFadeDelay float fDelay; @@ -78,7 +78,7 @@ class pfKIMsg : public plMessage void IInit() { fCommand = kNoCommand; - fString = L""; + fString = plString(); fUser = nil; fPlayerID = 0; fFlags = 0; @@ -192,14 +192,7 @@ class pfKIMsg : public plMessage s->ReadLE( &fCommand ); fUser = s->ReadSafeString(); fPlayerID = s->ReadLE32(); - - wchar_t *temp = s->ReadSafeWString(); - if (temp) // apparently ReadSafeWString can return null, which std::wstring doesn't like being assigned - fString = temp; - else - fString = L""; - delete [] temp; - + fString = s->ReadSafeWString_TEMP(); fFlags = s->ReadLE32(); fDelay = s->ReadLEScalar(); fValue = s->ReadLE32(); @@ -211,31 +204,29 @@ class pfKIMsg : public plMessage s->WriteLE( fCommand ); s->WriteSafeString( fUser ); s->WriteLE32( fPlayerID ); - s->WriteSafeWString( fString.c_str() ); + s->WriteSafeWString( fString ); s->WriteLE32( fFlags ); s->WriteLEScalar(fDelay); s->WriteLE32( fValue ); } - uint8_t GetCommand( void ) const { return fCommand; } + uint8_t GetCommand( void ) const { return fCommand; } - void SetString( const char *str ); - void SetString( const wchar_t *str ) { fString = str; } - std::string GetString( void ); - std::wstring GetStringU( void ) { return fString; } + void SetString( const plString &str ) { fString = str; } + plString GetString( void ) { return fString; } void SetUser( const char *str, uint32_t pid=0 ) { fUser = hsStrcpy( str ); fPlayerID = pid; } const char *GetUser( void ) { return fUser; } - uint32_t GetPlayerID( void ) { return fPlayerID; } + uint32_t GetPlayerID( void ) { return fPlayerID; } void SetFlags( uint32_t flags ) { fFlags = flags; } - uint32_t GetFlags( void ) const { return fFlags; } + uint32_t GetFlags( void ) const { return fFlags; } void SetDelay( float delay ) { fDelay = delay; } - float GetDelay( void ) { return fDelay; } + float GetDelay( void ) { return fDelay; } void SetIntValue( int32_t value ) { fValue = value; } - int32_t GetIntValue( void ) { return fValue; } + int32_t GetIntValue( void ) { return fValue; } #endif // def KI_CONSTANTS_ONLY }; diff --git a/Sources/Plasma/FeatureLib/pfPython/cyMisc.cpp b/Sources/Plasma/FeatureLib/pfPython/cyMisc.cpp index 2c3a599a..1efb9e2e 100644 --- a/Sources/Plasma/FeatureLib/pfPython/cyMisc.cpp +++ b/Sources/Plasma/FeatureLib/pfPython/cyMisc.cpp @@ -1127,7 +1127,7 @@ uint32_t cyMisc::SendRTChat(pyPlayer& from, const std::vector & tolis { // create the messge that will contain the chat message pfKIMsg *msg = new pfKIMsg( pfKIMsg::kHACKChatMsg ); - msg->SetString( message ); + msg->SetString( plString::FromWchar(message) ); msg->SetUser( from.GetPlayerName(), from.GetPlayerID() ); msg->SetFlags( flags ); msg->SetBCastFlag(plMessage::kNetPropagate | plMessage::kNetForce); @@ -1199,7 +1199,7 @@ void cyMisc::SendKIMessageS(uint32_t command, const wchar_t* value) // create the mesage to send pfKIMsg *msg = new pfKIMsg( (uint8_t)command ); - msg->SetString( value ); + msg->SetString( plString::FromWchar( value ) ); // send it off plgDispatch::MsgSend( msg ); diff --git a/Sources/Plasma/FeatureLib/pfPython/plPythonFileMod.cpp b/Sources/Plasma/FeatureLib/pfPython/plPythonFileMod.cpp index fb3ee21d..63d97889 100644 --- a/Sources/Plasma/FeatureLib/pfPython/plPythonFileMod.cpp +++ b/Sources/Plasma/FeatureLib/pfPython/plPythonFileMod.cpp @@ -1862,7 +1862,7 @@ bool plPythonFileMod::MsgReceive(plMessage* msg) // yes... // find the value that would go with a command PyObject* value; - std::wstring str; + plStringBuffer str; switch (pkimsg->GetCommand()) { case pfKIMsg::kSetChatFadeDelay: @@ -1873,8 +1873,8 @@ bool plPythonFileMod::MsgReceive(plMessage* msg) break; case pfKIMsg::kYesNoDialog: value = PyTuple_New(2); - str = pkimsg->GetStringU(); - PyTuple_SetItem(value, 0, PyUnicode_FromWideChar(str.c_str(), str.length())); + str = pkimsg->GetString().ToWchar(); + PyTuple_SetItem(value, 0, PyUnicode_FromWideChar(str, str.GetSize())); PyTuple_SetItem(value, 1, pyKey::New(pkimsg->GetSender())); break; case pfKIMsg::kGZInRange: @@ -1884,23 +1884,23 @@ bool plPythonFileMod::MsgReceive(plMessage* msg) break; case pfKIMsg::kRateIt: value = PyTuple_New(3); - str = pkimsg->GetStringU(); + str = pkimsg->GetString().ToWchar(); PyTuple_SetItem(value,0,PyString_FromString(pkimsg->GetUser())); - PyTuple_SetItem(value,1,PyUnicode_FromWideChar(str.c_str(), str.length())); + PyTuple_SetItem(value,1,PyUnicode_FromWideChar(str, str.GetSize())); PyTuple_SetItem(value,2,PyLong_FromLong(pkimsg->GetIntValue())); break; case pfKIMsg::kRegisterImager: value = PyTuple_New(2); - str = pkimsg->GetStringU(); - PyTuple_SetItem(value, 0, PyUnicode_FromWideChar(str.c_str(), str.length())); + str = pkimsg->GetString().ToWchar(); + PyTuple_SetItem(value, 0, PyUnicode_FromWideChar(str, str.GetSize())); PyTuple_SetItem(value, 1, pyKey::New(pkimsg->GetSender())); break; case pfKIMsg::kAddPlayerDevice: case pfKIMsg::kRemovePlayerDevice: { - str = pkimsg->GetStringU(); - if ( str.length() > 0 ) - value = PyUnicode_FromWideChar(str.c_str(), str.length()); + str = pkimsg->GetString().ToWchar(); + if ( str.GetSize() > 0 ) + value = PyUnicode_FromWideChar(str, str.GetSize()); else { Py_INCREF(Py_None); @@ -1915,8 +1915,8 @@ bool plPythonFileMod::MsgReceive(plMessage* msg) case pfKIMsg::kKIOKDialogNoQuit: case pfKIMsg::kGZFlashUpdate: case pfKIMsg::kKICreateMarkerNode: - str = pkimsg->GetStringU(); - value = PyUnicode_FromWideChar(str.c_str(), str.length()); + str = pkimsg->GetString().ToWchar(); + value = PyUnicode_FromWideChar(str, str.GetSize()); break; case pfKIMsg::kMGStartCGZGame: case pfKIMsg::kMGStopCGZGame: @@ -2905,7 +2905,7 @@ bool plPythonFileMod::MsgReceive(plMessage* msg) void plPythonFileMod::ReportError() { plString objectName = this->GetKeyName(); - objectName += _TEMP_CONVERT_FROM_LITERAL(" - "); + objectName += " - "; PythonInterface::WriteToStdErr(objectName.c_str()); @@ -3050,4 +3050,4 @@ void plPythonFileMod::Write(hsStream* stream, hsResMgr* mgr) //// kGlobalNameKonstant ///////////////////////////////////////////////// // My continued attempt to spread the CORRECT way to spell konstant. -mcn -plString plPythonFileMod::kGlobalNameKonstant = _TEMP_CONVERT_FROM_LITERAL("VeryVerySpecialPythonFileMod"); +plString plPythonFileMod::kGlobalNameKonstant("VeryVerySpecialPythonFileMod"); diff --git a/Sources/Plasma/FeatureLib/pfPython/pyGameScoreMsg.cpp b/Sources/Plasma/FeatureLib/pfPython/pyGameScoreMsg.cpp index c1c1289a..61cefafd 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyGameScoreMsg.cpp +++ b/Sources/Plasma/FeatureLib/pfPython/pyGameScoreMsg.cpp @@ -61,8 +61,8 @@ PyObject* pyGameScoreMsg::CreateFinal(pfGameScoreMsg* msg) plString pyGameScoreMsg::GetError() const { if (fMsg) - return _TEMP_CONVERT_FROM_WCHAR_T(NetErrorToString(fMsg->GetResult())); - return _TEMP_CONVERT_FROM_LITERAL("pfGameScoreMsg is NULL"); + return plString::FromWchar(NetErrorToString(fMsg->GetResult())); + return "pfGameScoreMsg is NULL"; } bool pyGameScoreMsg::IsValid() const diff --git a/Sources/Plasma/FeatureLib/pfPython/pyImageGlue.cpp b/Sources/Plasma/FeatureLib/pfPython/pyImageGlue.cpp index b4ef50d9..b5567e1d 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyImageGlue.cpp +++ b/Sources/Plasma/FeatureLib/pfPython/pyImageGlue.cpp @@ -291,7 +291,7 @@ PYTHON_GLOBAL_METHOD_DEFINITION(PtLoadJPEGFromDisk, args, "Params: filename,widt if (PyString_CheckEx(filenameObj)) { plString text = PyString_AsStringEx(filenameObj); - PyObject* ret = pyImage::LoadJPEGFromDisk(_TEMP_CONVERT_TO_WCHAR_T(text), width, height); + PyObject* ret = pyImage::LoadJPEGFromDisk(text.ToWchar(), width, height); return ret; } else @@ -313,7 +313,7 @@ PYTHON_GLOBAL_METHOD_DEFINITION(PtLoadPNGFromDisk, args, "Params: filename,width if (PyString_CheckEx(filenameObj)) { plString text = PyString_AsStringEx(filenameObj); - PyObject* ret = pyImage::LoadPNGFromDisk(_TEMP_CONVERT_TO_WCHAR_T(text), width, height); + PyObject* ret = pyImage::LoadPNGFromDisk(text.ToWchar(), width, height); return ret; } else diff --git a/Sources/Plasma/FeatureLib/pfPython/pyJournalBook.h b/Sources/Plasma/FeatureLib/pfPython/pyJournalBook.h index df5aa774..cf87d1ad 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyJournalBook.h +++ b/Sources/Plasma/FeatureLib/pfPython/pyJournalBook.h @@ -84,8 +84,8 @@ public: // required functions for PyObject interoperability PYTHON_CLASS_NEW_FRIEND(ptBook); - static PyObject *New(std::string htmlSource, plKey coverImageKey = nil, plKey callbackKey = nil, plString guiName = _TEMP_CONVERT_FROM_LITERAL("")); - static PyObject *New(std::wstring htmlSource, plKey coverImageKey = nil, plKey callbackKey = nil, plString guiName = _TEMP_CONVERT_FROM_LITERAL("")); + static PyObject *New(std::string htmlSource, plKey coverImageKey = nil, plKey callbackKey = nil, plString guiName = plString()); + static PyObject *New(std::wstring htmlSource, plKey coverImageKey = nil, plKey callbackKey = nil, plString guiName = plString()); PYTHON_CLASS_CHECK_DEFINITION; // returns true if the PyObject is a pyJournalBook object PYTHON_CLASS_CONVERT_FROM_DEFINITION(pyJournalBook); // converts a PyObject to a pyJournalBook (throws error if not correct type) @@ -94,8 +94,8 @@ public: static void AddPlasmaConstantsClasses(PyObject *m); // Deletes the existing book and re-creates it, for use by the python glue - void MakeBook(std::string esHTMLSource, plKey coverImageKey = nil, plKey callbackKey = nil, plString guiName = _TEMP_CONVERT_FROM_LITERAL("")); - void MakeBook(std::wstring esHTMLSource, plKey coverImageKey = nil, plKey callbackKey = nil, plString guiName = _TEMP_CONVERT_FROM_LITERAL("")); + void MakeBook(std::string esHTMLSource, plKey coverImageKey = nil, plKey callbackKey = nil, plString guiName = plString()); + void MakeBook(std::wstring esHTMLSource, plKey coverImageKey = nil, plKey callbackKey = nil, plString guiName = plString()); // Interface functions per book virtual void Show( bool startOpened ); diff --git a/Sources/Plasma/FeatureLib/pfPython/pyPlayerGlue.cpp b/Sources/Plasma/FeatureLib/pfPython/pyPlayerGlue.cpp index 2ba45171..190ceadc 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyPlayerGlue.cpp +++ b/Sources/Plasma/FeatureLib/pfPython/pyPlayerGlue.cpp @@ -103,7 +103,7 @@ PYTHON_INIT_DEFINITION(ptPlayer, args, keywords) PYTHON_RETURN_INIT_ERROR; } - self->fThis->Init(key, _TEMP_CONVERT_TO_CONST_CHAR(name), pid, distSeq); + self->fThis->Init(key, name.c_str(), pid, distSeq); PYTHON_RETURN_INIT_OK; } diff --git a/Sources/Plasma/FeatureLib/pfPython/pySceneObject.cpp b/Sources/Plasma/FeatureLib/pfPython/pySceneObject.cpp index a2cff79c..ae317514 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pySceneObject.cpp +++ b/Sources/Plasma/FeatureLib/pfPython/pySceneObject.cpp @@ -223,7 +223,7 @@ plString pySceneObject::GetName() { if ( fSceneObjects.Count() > 0 ) return fSceneObjects[0]->GetName(); - return _TEMP_CONVERT_FROM_LITERAL(""); + return plString(); } PyObject* pySceneObject::findObj(const plString& name) diff --git a/Sources/Plasma/FeatureLib/pfPython/pyStatusLog.cpp b/Sources/Plasma/FeatureLib/pfPython/pyStatusLog.cpp index c9e947b3..c459b2fa 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyStatusLog.cpp +++ b/Sources/Plasma/FeatureLib/pfPython/pyStatusLog.cpp @@ -72,7 +72,7 @@ bool pyStatusLog::Open(plString logName, uint32_t numLines, uint32_t flags) // create a status log guy for this fICreatedLog = true; - fLog = plStatusLogMgr::GetInstance().CreateStatusLog( (uint8_t)numLines, _TEMP_CONVERT_TO_CONST_CHAR(logName), flags ); + fLog = plStatusLogMgr::GetInstance().CreateStatusLog( (uint8_t)numLines, logName.c_str(), flags ); if (fLog) { fLog->SetForceLog(true); @@ -85,7 +85,7 @@ bool pyStatusLog::Write(plString text) { if (fLog) { - fLog->AddLine(_TEMP_CONVERT_TO_CONST_CHAR(text)); + fLog->AddLine(text.c_str()); return true; } @@ -100,7 +100,7 @@ bool pyStatusLog::WriteColor(plString text, pyColor& color) ((uint32_t)(color.getRed()*255)<<16) + ((uint32_t)(color.getGreen()*255)<<8) + ((uint32_t)(color.getBlue()*255)); - fLog->AddLine( _TEMP_CONVERT_TO_CONST_CHAR(text), st_color ); + fLog->AddLine( text.c_str(), st_color ); return true; } diff --git a/Sources/Plasma/FeatureLib/pfPython/pyVault.cpp b/Sources/Plasma/FeatureLib/pfPython/pyVault.cpp index d8c219ac..82284a3c 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyVault.cpp +++ b/Sources/Plasma/FeatureLib/pfPython/pyVault.cpp @@ -673,8 +673,8 @@ void pyVault::CreateNeighborhood() plUUID guid(GuidGenerate()); link.GetAgeInfo()->SetAgeInstanceGuid(&guid); - link.GetAgeInfo()->SetAgeUserDefinedName( _TEMP_CONVERT_TO_CONST_CHAR(title) ); - link.GetAgeInfo()->SetAgeDescription( _TEMP_CONVERT_TO_CONST_CHAR(desc) ); + link.GetAgeInfo()->SetAgeUserDefinedName( title.c_str() ); + link.GetAgeInfo()->SetAgeDescription( desc.c_str() ); VaultRegisterOwnedAge(&link); } diff --git a/Sources/Plasma/NucleusLib/pnDispatch/plDispatch.cpp b/Sources/Plasma/NucleusLib/pnDispatch/plDispatch.cpp index ff124551..966cd91a 100644 --- a/Sources/Plasma/NucleusLib/pnDispatch/plDispatch.cpp +++ b/Sources/Plasma/NucleusLib/pnDispatch/plDispatch.cpp @@ -341,7 +341,7 @@ void plDispatch::IMsgDispatch() uint32_t rcvTicks = hsTimer::GetPrecTickCount(); // Object could be deleted by this message, so we need to log this stuff now - plString keyname = _TEMP_CONVERT_FROM_LITERAL("(unknown)"); + plString keyname = "(unknown)"; const char* className = "(unknown)"; uint32_t clonePlayerID = 0; if (plDispatchLogBase::IsLoggingLong()) diff --git a/Sources/Plasma/NucleusLib/pnKeyedObject/hsKeyedObject.cpp b/Sources/Plasma/NucleusLib/pnKeyedObject/hsKeyedObject.cpp index 469eef12..4ad13c11 100644 --- a/Sources/Plasma/NucleusLib/pnKeyedObject/hsKeyedObject.cpp +++ b/Sources/Plasma/NucleusLib/pnKeyedObject/hsKeyedObject.cpp @@ -70,7 +70,7 @@ plString hsKeyedObject::GetKeyName() const if (fpKey) return fpKey->GetName(); else - return _TEMP_CONVERT_FROM_LITERAL("(unknown)"); + return "(unknown)"; } hsKeyedObject::~hsKeyedObject() diff --git a/Sources/Plasma/NucleusLib/pnKeyedObject/plFixedKey.cpp b/Sources/Plasma/NucleusLib/pnKeyedObject/plFixedKey.cpp index fa39c127..491dac96 100644 --- a/Sources/Plasma/NucleusLib/pnKeyedObject/plFixedKey.cpp +++ b/Sources/Plasma/NucleusLib/pnKeyedObject/plFixedKey.cpp @@ -82,48 +82,47 @@ struct plKeySeed // 2) Be sure your ClassIndex CLASS_INDEX(plSceneObject) matches the type of object you want to have the fixedKey // 3) Make sure the Obj is unique for this location/Type Combo... (validated at runtime) -#define _TCFL _TEMP_CONVERT_FROM_LITERAL plKeySeed SeedList[] = { // Key Enum Type Obj - { kFirst_Fixed_KEY, CLASS_INDEX_SCOPED( plSceneObject ), _TCFL("kFirst_Fixed_KEY") }, - - { kLOSObject_KEY, CLASS_INDEX_SCOPED( plLOSDispatch ), _TCFL("kLOSObject_KEY"), }, - { kTimerCallbackManager_KEY, CLASS_INDEX_SCOPED( plTimerCallbackManager ), _TCFL("kTimerCallbackManager_KEY"), }, - { kConsoleObject_KEY, CLASS_INDEX_SCOPED( pfConsole ), _TCFL("kConsoleObject_KEY"), }, - { kAudioSystem_KEY, CLASS_INDEX_SCOPED( plAudioSystem ), _TCFL("kAudioSystem_KEY"), }, - { kInput_KEY, CLASS_INDEX_SCOPED( plInputManager ), _TCFL("kInput_KEY"), }, - { kClient_KEY, CLASS_INDEX_SCOPED( plClient ), _TCFL("kClient_KEY"), }, - { kNetClientMgr_KEY, CLASS_INDEX_SCOPED( plNetClientMgr ), _TCFL("kNetClientMgr_KEY"), }, - { kListenerMod_KEY, CLASS_INDEX_SCOPED( plListener ), _TCFL("kListenerMod_KEY"), }, - { kTransitionMgr_KEY, CLASS_INDEX_SCOPED( plTransitionMgr ), _TCFL("kTransitionMgr_KEY"), }, - { kLinkEffectsMgr_KEY, CLASS_INDEX_SCOPED( plLinkEffectsMgr ), _TCFL("kLinkEffectsMgr_KEY"), }, - { kGameGUIMgr_KEY, CLASS_INDEX_SCOPED( pfGameGUIMgr ), _TCFL("kGameGUIMgr_KEY"), }, - { kGameGUIDynamicDlg_KEY, CLASS_INDEX_SCOPED( plSceneNode ), _TCFL("kGameGUIDynamicDlg_KEY"), }, - { kVirtualCamera1_KEY, CLASS_INDEX_SCOPED( plVirtualCam1 ), _TCFL("kVirtualCamera_KEY"), }, - { kDefaultCameraMod1_KEY, CLASS_INDEX_SCOPED( plCameraModifier1 ), _TCFL("kDefaultCameraMod1_KEY"), }, - { kKIGUIGlue_KEY, CLASS_INDEX_SCOPED( pfKI ), _TCFL("kKIGUIGlue_KEY"), }, - { kClothingMgr_KEY, CLASS_INDEX_SCOPED( plClothingMgr ), _TCFL("kClothingMgr_KEY"), }, - { kInputInterfaceMgr_KEY, CLASS_INDEX_SCOPED( plInputInterfaceMgr ), _TCFL("kInputInterfaceMgr_KEY"), }, - { kAVIWriter_KEY, CLASS_INDEX_SCOPED( plAVIWriter ), _TCFL("kAVIWriter_KEY"), }, - { kResManagerHelper_KEY, CLASS_INDEX_SCOPED( plResManagerHelper ), _TCFL("kResManagerHelper_KEY"), }, - { kAvatarMgr_KEY, CLASS_INDEX_SCOPED( plAvatarMgr ), _TCFL("kAvatarMgr_KEY"), }, - { kSimulationMgr_KEY, CLASS_INDEX_SCOPED( plSimulationMgr ), _TCFL("kSimulationMgr_KEY"), }, - { kTransitionCamera_KEY, CLASS_INDEX_SCOPED( plCameraModifier1 ), _TCFL("kTransitionCamera_KEY"), }, - { kCCRMgr_KEY, CLASS_INDEX_SCOPED( plCCRMgr ), _TCFL("kCCRMgr_KEY"), }, - { kNetClientCloneRoom_KEY, CLASS_INDEX_SCOPED( plSceneNode ), _TCFL("kNetClientCloneRoom_KEY"), }, - { kMarkerMgr_KEY, CLASS_INDEX_SCOPED( pfMarkerMgr ), _TCFL("kMarkerMgr_KEY"), }, - { kAutoProfile_KEY, CLASS_INDEX_SCOPED( plAutoProfile ), _TCFL("kAutoProfile_KEY"), }, - { kGlobalVisMgr_KEY, CLASS_INDEX_SCOPED( plVisMgr ), _TCFL("kGlobalVisMgr_KEY"), }, - { kFontCache_KEY, CLASS_INDEX_SCOPED( plFontCache ), _TCFL("kFontCache_KEY"), }, - { kRelevanceMgr_KEY, CLASS_INDEX_SCOPED( plRelevanceMgr ), _TCFL("kRelevanceMgr_KEY"), }, - { kJournalBookMgr_KEY, CLASS_INDEX_SCOPED( pfJournalBook ), _TCFL("kJournalBookMgr_KEY") }, - { kAgeLoader_KEY, CLASS_INDEX_SCOPED( plAgeLoader), _TCFL("kAgeLoader_KEY") }, - { kBuiltIn3rdPersonCamera_KEY, CLASS_INDEX_SCOPED( plCameraModifier1 ), _TCFL("kBuiltIn3rdPersonCamera_KEY"), }, - { kSecurePreloader_KEY, CLASS_INDEX_SCOPED( pfSecurePreloader ), _TCFL("kSecurePreloader_KEY"), }, + { kFirst_Fixed_KEY, CLASS_INDEX_SCOPED( plSceneObject ), "kFirst_Fixed_KEY", }, + + { kLOSObject_KEY, CLASS_INDEX_SCOPED( plLOSDispatch ), "kLOSObject_KEY", }, + { kTimerCallbackManager_KEY, CLASS_INDEX_SCOPED( plTimerCallbackManager ), "kTimerCallbackManager_KEY", }, + { kConsoleObject_KEY, CLASS_INDEX_SCOPED( pfConsole ), "kConsoleObject_KEY", }, + { kAudioSystem_KEY, CLASS_INDEX_SCOPED( plAudioSystem ), "kAudioSystem_KEY", }, + { kInput_KEY, CLASS_INDEX_SCOPED( plInputManager ), "kInput_KEY", }, + { kClient_KEY, CLASS_INDEX_SCOPED( plClient ), "kClient_KEY", }, + { kNetClientMgr_KEY, CLASS_INDEX_SCOPED( plNetClientMgr ), "kNetClientMgr_KEY", }, + { kListenerMod_KEY, CLASS_INDEX_SCOPED( plListener ), "kListenerMod_KEY", }, + { kTransitionMgr_KEY, CLASS_INDEX_SCOPED( plTransitionMgr ), "kTransitionMgr_KEY", }, + { kLinkEffectsMgr_KEY, CLASS_INDEX_SCOPED( plLinkEffectsMgr ), "kLinkEffectsMgr_KEY", }, + { kGameGUIMgr_KEY, CLASS_INDEX_SCOPED( pfGameGUIMgr ), "kGameGUIMgr_KEY", }, + { kGameGUIDynamicDlg_KEY, CLASS_INDEX_SCOPED( plSceneNode ), "kGameGUIDynamicDlg_KEY", }, + { kVirtualCamera1_KEY, CLASS_INDEX_SCOPED( plVirtualCam1 ), "kVirtualCamera_KEY", }, + { kDefaultCameraMod1_KEY, CLASS_INDEX_SCOPED( plCameraModifier1 ), "kDefaultCameraMod1_KEY", }, + { kKIGUIGlue_KEY, CLASS_INDEX_SCOPED( pfKI ), "kKIGUIGlue_KEY", }, + { kClothingMgr_KEY, CLASS_INDEX_SCOPED( plClothingMgr ), "kClothingMgr_KEY", }, + { kInputInterfaceMgr_KEY, CLASS_INDEX_SCOPED( plInputInterfaceMgr ), "kInputInterfaceMgr_KEY", }, + { kAVIWriter_KEY, CLASS_INDEX_SCOPED( plAVIWriter ), "kAVIWriter_KEY", }, + { kResManagerHelper_KEY, CLASS_INDEX_SCOPED( plResManagerHelper ), "kResManagerHelper_KEY", }, + { kAvatarMgr_KEY, CLASS_INDEX_SCOPED( plAvatarMgr ), "kAvatarMgr_KEY", }, + { kSimulationMgr_KEY, CLASS_INDEX_SCOPED( plSimulationMgr ), "kSimulationMgr_KEY", }, + { kTransitionCamera_KEY, CLASS_INDEX_SCOPED( plCameraModifier1 ), "kTransitionCamera_KEY", }, + { kCCRMgr_KEY, CLASS_INDEX_SCOPED( plCCRMgr ), "kCCRMgr_KEY", }, + { kNetClientCloneRoom_KEY, CLASS_INDEX_SCOPED( plSceneNode ), "kNetClientCloneRoom_KEY", }, + { kMarkerMgr_KEY, CLASS_INDEX_SCOPED( pfMarkerMgr ), "kMarkerMgr_KEY", }, + { kAutoProfile_KEY, CLASS_INDEX_SCOPED( plAutoProfile ), "kAutoProfile_KEY", }, + { kGlobalVisMgr_KEY, CLASS_INDEX_SCOPED( plVisMgr ), "kGlobalVisMgr_KEY", }, + { kFontCache_KEY, CLASS_INDEX_SCOPED( plFontCache ), "kFontCache_KEY", }, + { kRelevanceMgr_KEY, CLASS_INDEX_SCOPED( plRelevanceMgr ), "kRelevanceMgr_KEY", }, + { kJournalBookMgr_KEY, CLASS_INDEX_SCOPED( pfJournalBook ), "kJournalBookMgr_KEY", }, + { kAgeLoader_KEY, CLASS_INDEX_SCOPED( plAgeLoader), "kAgeLoader_KEY", }, + { kBuiltIn3rdPersonCamera_KEY, CLASS_INDEX_SCOPED( plCameraModifier1 ), "kBuiltIn3rdPersonCamera_KEY", }, + { kSecurePreloader_KEY, CLASS_INDEX_SCOPED( pfSecurePreloader ), "kSecurePreloader_KEY", }, - { kLast_Fixed_KEY, CLASS_INDEX_SCOPED( plSceneObject ), _TCFL("kLast_Fixed_KEY"), } + { kLast_Fixed_KEY, CLASS_INDEX_SCOPED( plSceneObject ), "kLast_Fixed_KEY", } }; #undef _TCFL diff --git a/Sources/Plasma/NucleusLib/pnUUID/pnUUID_Unix.cpp b/Sources/Plasma/NucleusLib/pnUUID/pnUUID_Unix.cpp index 40753af6..867ca85c 100644 --- a/Sources/Plasma/NucleusLib/pnUUID/pnUUID_Unix.cpp +++ b/Sources/Plasma/NucleusLib/pnUUID/pnUUID_Unix.cpp @@ -112,7 +112,7 @@ bool plUUID::ToString( plString & out ) const plUUIDHelper::CopyToNative( g, this ); char buf[40]; uuid_unparse( g, buf ); - out = _TEMP_CONVERT_FROM_LITERAL( buf ); + out = buf; return true; } diff --git a/Sources/Plasma/NucleusLib/pnUUID/pnUUID_Win32.cpp b/Sources/Plasma/NucleusLib/pnUUID/pnUUID_Win32.cpp index 98f58772..c5248dcd 100644 --- a/Sources/Plasma/NucleusLib/pnUUID/pnUUID_Win32.cpp +++ b/Sources/Plasma/NucleusLib/pnUUID/pnUUID_Win32.cpp @@ -90,7 +90,7 @@ bool plUUID::FromString( const char * str ) bool plUUID::ToString( plString & out ) const { - out = _TEMP_CONVERT_FROM_LITERAL(""); + out = plString(); unsigned char * ubuf; RPC_STATUS s; s = UuidToString( (GUID *) this, &ubuf ); diff --git a/Sources/Plasma/PubUtilLib/plAudio/plSound.cpp b/Sources/Plasma/PubUtilLib/plAudio/plSound.cpp index 4834ac40..e835d1db 100644 --- a/Sources/Plasma/PubUtilLib/plAudio/plSound.cpp +++ b/Sources/Plasma/PubUtilLib/plAudio/plSound.cpp @@ -163,7 +163,7 @@ void plSound::IUpdateDebugPlate( void ) fDebugPlate->SetPosition( -0.5, 0 ); fDebugPlate->SetDataRange( 0, 100, 100 ); fDebugPlate->SetColors( 0x80202000 ); - fDebugPlate->SetTitle( _TEMP_CONVERT_TO_CONST_CHAR( GetKeyName() ) ); // Bleah + fDebugPlate->SetTitle( GetKeyName().c_str() ); // Bleah fDebugPlate->SetLabelText( "Desired", "Curr", "Soft", "Dist" ); } @@ -190,7 +190,7 @@ void plSound::SetCurrDebugPlate( const plKey soundKey ) { fDebugPlate->ClearData(); fDebugPlate->SetVisible( true ); - fDebugPlate->SetTitle( _TEMP_CONVERT_TO_CONST_CHAR( fCurrDebugPlateSound->GetKeyName() ) ); // Bleah + fDebugPlate->SetTitle( fCurrDebugPlateSound->GetKeyName().c_str() ); // Bleah } } } diff --git a/Sources/Plasma/PubUtilLib/plAvatar/plAGApplicator.h b/Sources/Plasma/PubUtilLib/plAvatar/plAGApplicator.h index 2d6ea5ca..4c67ca45 100644 --- a/Sources/Plasma/PubUtilLib/plAvatar/plAGApplicator.h +++ b/Sources/Plasma/PubUtilLib/plAvatar/plAGApplicator.h @@ -104,10 +104,6 @@ public: void SetChannelName(const plString &name); plString GetChannelName(); - // TEMP plString REVISIT - // Because I'm TOO LAZY to keep converting all these calls to SetChannelName - void SetChannelName(const char *name) { SetChannelName(_TEMP_CONVERT_FROM_LITERAL(name)); } - /** Optionally suppress the action of this applicator. The applicator can still be forced to apply using the force paramater of the Apply function. */ diff --git a/Sources/Plasma/PubUtilLib/plAvatar/plAGMasterMod.cpp b/Sources/Plasma/PubUtilLib/plAvatar/plAGMasterMod.cpp index afacbd3b..42ff1d66 100644 --- a/Sources/Plasma/PubUtilLib/plAvatar/plAGMasterMod.cpp +++ b/Sources/Plasma/PubUtilLib/plAvatar/plAGMasterMod.cpp @@ -631,7 +631,7 @@ bool plAGMasterMod::MsgReceive(plMessage* msg) plString targetName = cmdMsg->GetAnimName(); if (targetName.IsNull()) - targetName = _TEMP_CONVERT_FROM_LITERAL(ENTIRE_ANIMATION_NAME); + targetName = ENTIRE_ANIMATION_NAME; plAGAnimInstance *inst = FindAnimInstance(targetName); if (inst != nil) diff --git a/Sources/Plasma/PubUtilLib/plAvatar/plAnimStage.cpp b/Sources/Plasma/PubUtilLib/plAvatar/plAnimStage.cpp index c4986bfa..3b158848 100644 --- a/Sources/Plasma/PubUtilLib/plAvatar/plAnimStage.cpp +++ b/Sources/Plasma/PubUtilLib/plAvatar/plAnimStage.cpp @@ -277,7 +277,7 @@ plAGAnimInstance * plAnimStage::Attach(plArmatureMod *armature, plArmatureBrain if(fAnimInstance) { fAnimInstance->Stop(); // we'll be setting the time directly. - fAnimatedHandle = (fAnimInstance->GetAnimation()->GetChannel(_TEMP_CONVERT_FROM_LITERAL("Handle")) != nil); + fAnimatedHandle = (fAnimInstance->GetAnimation()->GetChannel("Handle") != nil); fAttached = true; // this is too early to send the enter notify. we're attached, but we may not // have faded in yet. diff --git a/Sources/Plasma/PubUtilLib/plAvatar/plArmatureMod.cpp b/Sources/Plasma/PubUtilLib/plAvatar/plArmatureMod.cpp index 5dd9c555..018ccb09 100644 --- a/Sources/Plasma/PubUtilLib/plAvatar/plArmatureMod.cpp +++ b/Sources/Plasma/PubUtilLib/plAvatar/plArmatureMod.cpp @@ -663,7 +663,7 @@ void plArmatureMod::IInitDefaults() fDontPanicLink = false; fBodyAgeName = "GlobalAvatars"; fBodyFootstepSoundPage = "Audio"; - fAnimationPrefix = _TEMP_CONVERT_FROM_LITERAL("Male"); + fAnimationPrefix = "Male"; fUserStr = ""; } @@ -1034,7 +1034,7 @@ void plArmatureMod::PanicLink(bool playLinkOutAnim /* = true */) plString animName = MakeAnimationName("FallingLinkOut"); task->SetAnimName(animName); - task->SetMarkerName(_TEMP_CONVERT_FROM_LITERAL("touch")); + task->SetMarkerName("touch"); plAvTaskMsg *taskMsg = new plAvTaskMsg(GetKey(), GetKey(), task); taskMsg->Send(); @@ -1057,7 +1057,7 @@ void plArmatureMod::PersonalLink() plAvOneShotLinkTask *task = new plAvOneShotLinkTask; plString animName = MakeAnimationName("PersonalLink"); task->SetAnimName(animName); - task->SetMarkerName(_TEMP_CONVERT_FROM_LITERAL("touch")); + task->SetMarkerName("touch"); plAvTaskMsg *taskMsg = new plAvTaskMsg(GetKey(), GetKey(), task); taskMsg->SetBCastFlag(plMessage::kNetPropagate); @@ -1781,7 +1781,7 @@ void plArmatureMod::Read(hsStream * stream, hsResMgr *mgr) if (gLoc.IsValid()) { const plUoid &myUoid = GetKey()->GetUoid(); - plUoid SOUoid(gLoc, plSceneObject::Index(), _TEMP_CONVERT_FROM_LITERAL("FootstepSoundObject")); + plUoid SOUoid(gLoc, plSceneObject::Index(), "FootstepSoundObject"); fFootSoundSOKey = mgr->FindKey(SOUoid); if (fFootSoundSOKey) { @@ -1791,7 +1791,7 @@ void plArmatureMod::Read(hsStream * stream, hsResMgr *mgr) } // Add the effect to our effects manager - plUoid effectUoid(gLoc, plArmatureEffectFootSound::Index(), _TEMP_CONVERT_FROM_LITERAL("FootstepSounds") ); + plUoid effectUoid(gLoc, plArmatureEffectFootSound::Index(), "FootstepSounds"); plKey effectKey = mgr->FindKey(effectUoid); if (effectKey) { @@ -1802,7 +1802,7 @@ void plArmatureMod::Read(hsStream * stream, hsResMgr *mgr) mgr->AddViaNotify(effectKey, new plGenRefMsg(effectMgrKey, plRefMsg::kOnCreate, -1, -1), plRefFlags::kActiveRef); // Get the linking sound - plUoid LinkUoid(gLoc, plSceneObject::Index(), _TEMP_CONVERT_FROM_LITERAL("LinkSoundSource")); + plUoid LinkUoid(gLoc, plSceneObject::Index(), "LinkSoundSource"); fLinkSoundSOKey = mgr->FindKey(LinkUoid); if (fLinkSoundSOKey) { @@ -1896,7 +1896,7 @@ void plArmatureMod::ICustomizeApplicator() { plArmatureModBase::ICustomizeApplicator(); - const plAGModifier *agMod = GetChannelMod(_TEMP_CONVERT_FROM_LITERAL("Bone_Root"), true); + const plAGModifier *agMod = GetChannelMod("Bone_Root", true); if (agMod) { // are there any applicators that manipulate the transform? @@ -2379,7 +2379,7 @@ bool plArmatureMod::FindMatchingGenericBrain(const char *names[], int count) plString plArmatureMod::MakeAnimationName(const char *baseName) const { - return fAnimationPrefix + _TEMP_CONVERT_FROM_LITERAL(baseName); + return fAnimationPrefix + baseName; } plString plArmatureMod::GetRootName() diff --git a/Sources/Plasma/PubUtilLib/plAvatar/plAvBrainClimb.cpp b/Sources/Plasma/PubUtilLib/plAvatar/plAvBrainClimb.cpp index c9bf3a8f..5bf9747c 100644 --- a/Sources/Plasma/PubUtilLib/plAvatar/plAvBrainClimb.cpp +++ b/Sources/Plasma/PubUtilLib/plAvatar/plAvBrainClimb.cpp @@ -714,7 +714,7 @@ void plAvBrainClimb::ICalcProbeLengths() hsAssert(up, "Couldn't find ClimbUp animation."); if(up) { - GetStartToEndTransform(up, &upMove, nil, _TEMP_CONVERT_FROM_LITERAL("Handle")); + GetStartToEndTransform(up, &upMove, nil, "Handle"); fVerticalProbeLength = upMove.GetTranslate().fZ; } else fVerticalProbeLength = 4.0f; // guess @@ -722,7 +722,7 @@ void plAvBrainClimb::ICalcProbeLengths() hsAssert(left, "Couldn't find ClimbLeft animation."); if(left) { - GetStartToEndTransform(left, &leftMove, nil, _TEMP_CONVERT_FROM_LITERAL("Handle")); + GetStartToEndTransform(left, &leftMove, nil, "Handle"); fHorizontalProbeLength = leftMove.GetTranslate().fX; } else fHorizontalProbeLength = 3.0f; // guess diff --git a/Sources/Plasma/PubUtilLib/plAvatar/plAvBrainCritter.cpp b/Sources/Plasma/PubUtilLib/plAvatar/plAvBrainCritter.cpp index a3d721a6..9fa16b65 100644 --- a/Sources/Plasma/PubUtilLib/plAvatar/plAvBrainCritter.cpp +++ b/Sources/Plasma/PubUtilLib/plAvatar/plAvBrainCritter.cpp @@ -300,7 +300,7 @@ std::string plAvBrainCritter::BehaviorName(int behavior) const plString plAvBrainCritter::AnimationName(int behavior) const { if ((behavior >= fBehaviors.Count()) || (behavior < 0)) - return _TEMP_CONVERT_FROM_LITERAL(""); + return plString(); return ((CritterBehavior*)fBehaviors[behavior])->AnimName(); } diff --git a/Sources/Plasma/PubUtilLib/plAvatar/plAvBrainHuman.cpp b/Sources/Plasma/PubUtilLib/plAvatar/plAvBrainHuman.cpp index cb2e4da9..fe7f4923 100644 --- a/Sources/Plasma/PubUtilLib/plAvatar/plAvBrainHuman.cpp +++ b/Sources/Plasma/PubUtilLib/plAvatar/plAvBrainHuman.cpp @@ -309,7 +309,7 @@ void plAvBrainHuman::IInitBoneMap() for(int i = 0; i < numTuples; i++) { HumanBoneID id = tupleMap[i].fID; - plString name = _TEMP_CONVERT_FROM_LITERAL(tupleMap[i].fName); + plString name = tupleMap[i].fName; const plSceneObject * bone = this->fAvMod->FindBone(name); if( bone ) diff --git a/Sources/Plasma/PubUtilLib/plAvatar/plAvTaskSeek.cpp b/Sources/Plasma/PubUtilLib/plAvatar/plAvTaskSeek.cpp index a6ef5409..1207a180 100644 --- a/Sources/Plasma/PubUtilLib/plAvatar/plAvTaskSeek.cpp +++ b/Sources/Plasma/PubUtilLib/plAvatar/plAvTaskSeek.cpp @@ -535,7 +535,7 @@ bool plAvTaskSeek::IUpdateObjective(plArmatureMod *avatar) plAGAnim *anim = avatar->FindCustomAnim(fAnimName); // don't need to do this every frame; the animation doesn't change. // *** cache the adjustment; - GetStartToEndTransform(anim, nil, &adjustment, _TEMP_CONVERT_FROM_LITERAL("Handle")); // actually getting end-to-start + GetStartToEndTransform(anim, nil, &adjustment, "Handle"); // actually getting end-to-start // ... but we do still need to multiply by the (potentially changed) target targL2W = targL2W * adjustment; } diff --git a/Sources/Plasma/PubUtilLib/plAvatar/plAvatarMgr.cpp b/Sources/Plasma/PubUtilLib/plAvatar/plAvatarMgr.cpp index 7f6ca61c..a1b14e73 100644 --- a/Sources/Plasma/PubUtilLib/plAvatar/plAvatarMgr.cpp +++ b/Sources/Plasma/PubUtilLib/plAvatar/plAvatarMgr.cpp @@ -199,9 +199,9 @@ plKey plAvatarMgr::LoadAvatar(const char *name, const char *accountName, bool is const plLocation& loc = (globalLoc.IsValid() ? globalLoc : custLoc.IsValid() ? custLoc : maleLoc); #endif - plString theName = _TEMP_CONVERT_FROM_LITERAL(name); + plString theName = name; if ( loc == maleLoc ) - theName = _TEMP_CONVERT_FROM_LITERAL("Male"); + theName = "Male"; if (loc.IsValid()) { @@ -1012,7 +1012,7 @@ void plAvatarMgr::OfferLinkingBook(plKey hostKey, plKey guestKey, plMessage *lin brainG->AddStage(guestAccept); brainG->AddStage(guestAcceptIdle); - plCoopCoordinator *coord = new plCoopCoordinator(hostKey, guestKey, brainH, brainG, _TEMP_CONVERT_FROM_LITERAL("Convergence"), 1, 1, linkMsg, true); + plCoopCoordinator *coord = new plCoopCoordinator(hostKey, guestKey, brainH, brainG, "Convergence", 1, 1, linkMsg, true); plAvCoopMsg *coMg = new plAvCoopMsg(hostKey, coord); diff --git a/Sources/Plasma/PubUtilLib/plAvatar/plAvatarTasks.cpp b/Sources/Plasma/PubUtilLib/plAvatar/plAvatarTasks.cpp index 258ba5e4..b05d666c 100644 --- a/Sources/Plasma/PubUtilLib/plAvatar/plAvatarTasks.cpp +++ b/Sources/Plasma/PubUtilLib/plAvatar/plAvatarTasks.cpp @@ -249,7 +249,7 @@ bool plAvSeekTask::Start(plArmatureMod *avatar, plArmatureBrain *brain, double t { hsMatrix44 adjustment; plAGAnim *anim = avatar->FindCustomAnim(fAnimName); - GetStartToEndTransform(anim, nil, &adjustment, _TEMP_CONVERT_FROM_LITERAL("Handle")); // actually getting end-to-start + GetStartToEndTransform(anim, nil, &adjustment, "Handle"); // actually getting end-to-start targetL2W = targetL2W * adjustment; } break; @@ -624,7 +624,7 @@ bool plAvOneShotTask::Start(plArmatureMod *avatar, plArmatureBrain *brain, doubl plgDispatch::MsgSend( pMsg ); // whoosh... off it goes } - fMoveHandle = (fAnimInstance->GetAnimation()->GetChannel(_TEMP_CONVERT_FROM_LITERAL("Handle")) != nil); + fMoveHandle = (fAnimInstance->GetAnimation()->GetChannel("Handle") != nil); if(fMoveHandle) { plMatrixDifferenceApp *differ = avatar->GetRootAnimator(); diff --git a/Sources/Plasma/PubUtilLib/plAvatar/plSittingModifier.cpp b/Sources/Plasma/PubUtilLib/plAvatar/plSittingModifier.cpp index 1c66ad56..8fd488f9 100644 --- a/Sources/Plasma/PubUtilLib/plAvatar/plSittingModifier.cpp +++ b/Sources/Plasma/PubUtilLib/plAvatar/plSittingModifier.cpp @@ -279,7 +279,7 @@ bool IIsClosestAnim(const char *animName, hsMatrix44 &sitGoal, float &closestDis // The first step is to get the transform from the end to the beginning of the // animation. That's what this next line is doing. It's a bit unintuitive // until you look at the parameter definitions. - GetStartToEndTransform(anim, nil, &animEndToStart, _TEMP_CONVERT_FROM_LITERAL("Handle")); + GetStartToEndTransform(anim, nil, &animEndToStart, "Handle"); hsMatrix44 candidateGoal = sitGoal * animEndToStart; hsPoint3 distP = candidateGoal.GetTranslate() - curPosition; hsVector3 distV(distP.fX, distP.fY, distP.fZ); diff --git a/Sources/Plasma/PubUtilLib/plDrawable/plProxyGen.cpp b/Sources/Plasma/PubUtilLib/plDrawable/plProxyGen.cpp index 8d0409a1..b8e67cf3 100644 --- a/Sources/Plasma/PubUtilLib/plDrawable/plProxyGen.cpp +++ b/Sources/Plasma/PubUtilLib/plDrawable/plProxyGen.cpp @@ -161,7 +161,7 @@ hsGMaterial* plProxyGen::IMakeProxyMaterial() const if( !GetKey()->GetName().IsNull() ) buff = plString::Format("%s_Material", GetKey()->GetName().c_str()); else - buff = _TEMP_CONVERT_FROM_LITERAL("ProxyMaterial"); + buff = "ProxyMaterial"; hsgResMgr::ResMgr()->NewKey( buff, retVal, GetKey() ? GetKey()->GetUoid().GetLocation() : plLocation::kGlobalFixedLoc ); plLayer *lay = retVal->MakeBaseLayer(); @@ -236,7 +236,7 @@ void plProxyGen::IGenerateProxy() if( !GetKey()->GetName().IsNull() ) buff = plString::Format("%s_ProxyDrawable", GetKey()->GetName().c_str()); else - buff = _TEMP_CONVERT_FROM_LITERAL("ProxyDrawable"); + buff = "ProxyDrawable"; hsgResMgr::ResMgr()->NewKey( buff, fProxyDrawables[ idx ], GetKey() ? GetKey()->GetUoid().GetLocation() : plLocation::kGlobalFixedLoc ); } diff --git a/Sources/Plasma/PubUtilLib/plGImage/plMipmap.cpp b/Sources/Plasma/PubUtilLib/plGImage/plMipmap.cpp index 3f17f5ee..edcd4d4d 100644 --- a/Sources/Plasma/PubUtilLib/plGImage/plMipmap.cpp +++ b/Sources/Plasma/PubUtilLib/plGImage/plMipmap.cpp @@ -2138,7 +2138,7 @@ void plMipmap::IAddToMemRecord( plMipmap *mip, plRecord::Method method ) if( mip->GetKey() ) newRecord->fKeyName = mip->GetKeyName(); else - newRecord->fKeyName = _TEMP_CONVERT_FROM_LITERAL( "" ); + newRecord->fKeyName = ""; if( mip->fCompressionType != kDirectXCompression ) newRecord->fUncompressedInfo.fType = mip->fUncompressedInfo.fType; else diff --git a/Sources/Plasma/PubUtilLib/plInputCore/plInputDevice.h b/Sources/Plasma/PubUtilLib/plInputCore/plInputDevice.h index 0a3b2df6..42c7c120 100644 --- a/Sources/Plasma/PubUtilLib/plInputCore/plInputDevice.h +++ b/Sources/Plasma/PubUtilLib/plInputCore/plInputDevice.h @@ -189,7 +189,7 @@ public: static bool GetInverted() { return plMouseDevice::bInverted; } static void SetInverted(bool inverted) { plMouseDevice::bInverted = inverted; } static void AddNameToCursor(const char* name); - static void AddNameToCursor(const plString& name) { AddNameToCursor(_TEMP_CONVERT_TO_CONST_CHAR(name)); } + static void AddNameToCursor(const plString& name) { AddNameToCursor(name); } static void AddIDNumToCursor(uint32_t idNum); static void AddCCRToCursor(); diff --git a/Sources/Plasma/PubUtilLib/plMessage/plAnimCmdMsg.cpp b/Sources/Plasma/PubUtilLib/plMessage/plAnimCmdMsg.cpp index 880be1d0..00f26a4c 100644 --- a/Sources/Plasma/PubUtilLib/plMessage/plAnimCmdMsg.cpp +++ b/Sources/Plasma/PubUtilLib/plMessage/plAnimCmdMsg.cpp @@ -56,26 +56,6 @@ void plAnimCmdMsg::ClearCmd() fCmd.Clear(); } -void plAnimCmdMsg::SetAnimName(const plString &name) -{ - fAnimName = name; -} - -plString plAnimCmdMsg::GetAnimName() -{ - return fAnimName; -} - -void plAnimCmdMsg::SetLoopName(const plString &name) -{ - fLoopName = name; -} - -plString plAnimCmdMsg::GetLoopName() -{ - return fLoopName; -} - bool plAnimCmdMsg::CmdChangesAnimTime() { return (Cmd(kContinue) || diff --git a/Sources/Plasma/PubUtilLib/plMessage/plAnimCmdMsg.h b/Sources/Plasma/PubUtilLib/plMessage/plAnimCmdMsg.h index 87b12e70..0cffb8c3 100644 --- a/Sources/Plasma/PubUtilLib/plMessage/plAnimCmdMsg.h +++ b/Sources/Plasma/PubUtilLib/plMessage/plAnimCmdMsg.h @@ -111,16 +111,12 @@ public: bool Cmd(int n) const { return fCmd.IsBitSet(n); } void SetCmd(int n) { fCmd.SetBit(n); } void ClearCmd(); - void SetAnimName(const plString &name); - plString GetAnimName(); + void SetAnimName(const plString &name) { fAnimName = name; } + plString GetAnimName() { return fAnimName; } bool CmdChangesAnimTime(); // Will this command cause an update to the current anim time? - // TEMP plString REVISIT - // Because I'm TOO LAZY to keep converting all these calls to SetAnimName - void SetAnimName(const char *name) { SetAnimName(_TEMP_CONVERT_FROM_LITERAL(name)); } - - void SetLoopName(const plString &name); - plString GetLoopName(); + void SetLoopName(const plString &name) { fLoopName = name; } + plString GetLoopName() { return fLoopName; } float fBegin; float fEnd; diff --git a/Sources/Plasma/PubUtilLib/plMessage/plDynamicTextMsg.cpp b/Sources/Plasma/PubUtilLib/plMessage/plDynamicTextMsg.cpp index d11bdf9a..3b4861fc 100644 --- a/Sources/Plasma/PubUtilLib/plMessage/plDynamicTextMsg.cpp +++ b/Sources/Plasma/PubUtilLib/plMessage/plDynamicTextMsg.cpp @@ -253,7 +253,7 @@ void plDynamicTextMsg::Write( hsStream *s, hsResMgr *mgr ) fClearColor.Write( s ); fColor.Write( s ); - s->WriteSafeWString( fString ); + s->WriteSafeWString( plString::FromWchar(fString) ); mgr->WriteKey( s, fImageKey ); s->WriteLE( fFlags ); @@ -360,7 +360,7 @@ void plDynamicTextMsg::WriteVersion(hsStream* s, hsResMgr* mgr) fColor.Write( s ); // kDynTextMsgString - s->WriteSafeWString( fString ); + s->WriteSafeWString( plString::FromWchar(fString) ); // kDynTextMsgImageKey mgr->WriteKey( s, fImageKey ); diff --git a/Sources/Plasma/PubUtilLib/plMessage/plDynamicTextMsg.h b/Sources/Plasma/PubUtilLib/plMessage/plDynamicTextMsg.h index 21061100..9de28e8b 100644 --- a/Sources/Plasma/PubUtilLib/plMessage/plDynamicTextMsg.h +++ b/Sources/Plasma/PubUtilLib/plMessage/plDynamicTextMsg.h @@ -59,13 +59,13 @@ class plDynamicTextMsg : public plMessage friend class plDynamicTextMap; protected: - uint16_t fCmd; + uint16_t fCmd; // Position (fX is also used for font size) - int16_t fX, fY; + int16_t fX, fY; // A rectangle - uint16_t fLeft, fTop, fRight, fBottom; + uint16_t fLeft, fTop, fRight, fBottom; // Colors hsColorRGBA fClearColor; @@ -78,10 +78,10 @@ protected: plKey fImageKey; // Misc flags field - uint32_t fFlags; + uint32_t fFlags; bool fBlockRGB; - int16_t fLineSpacing; + int16_t fLineSpacing; public: plDynamicTextMsg() : plMessage( nil, nil, nil ) { fCmd = 0; fString = nil; fImageKey = nil; fFlags = 0; fBlockRGB = false; } diff --git a/Sources/Plasma/PubUtilLib/plModifier/plCloneSpawnModifier.cpp b/Sources/Plasma/PubUtilLib/plModifier/plCloneSpawnModifier.cpp index 072d254c..47102826 100644 --- a/Sources/Plasma/PubUtilLib/plModifier/plCloneSpawnModifier.cpp +++ b/Sources/Plasma/PubUtilLib/plModifier/plCloneSpawnModifier.cpp @@ -106,7 +106,7 @@ plKey plCloneSpawnModifier::SpawnClone(const char* cloneName, const char* cloneA const plLocation& loc = plKeyFinder::Instance().FindLocation(cloneAge, "BuiltIn"); // Find the clone template key - plUoid objUoid(loc, plSceneObject::Index(), _TEMP_CONVERT_FROM_LITERAL(cloneName)); + plUoid objUoid(loc, plSceneObject::Index(), cloneName); plKey key = resMgr->FindKey(objUoid); if (key) diff --git a/Sources/Plasma/PubUtilLib/plModifier/plResponderModifier.cpp b/Sources/Plasma/PubUtilLib/plModifier/plResponderModifier.cpp index 63109bd8..7def6966 100644 --- a/Sources/Plasma/PubUtilLib/plModifier/plResponderModifier.cpp +++ b/Sources/Plasma/PubUtilLib/plModifier/plResponderModifier.cpp @@ -775,7 +775,7 @@ void plResponderModifier::ILog(uint32_t color, const char* format, ...) if (!format || *format == '\0') return; - const char* keyName = _TEMP_CONVERT_TO_CONST_CHAR(GetKeyName()); + const char* keyName = GetKeyName().c_str(); // Make sure this key isn't in our list of keys to deny for (int i = 0; i < gNoLogStrings.size(); i++) diff --git a/Sources/Plasma/PubUtilLib/plNetClient/plNetCliAgeJoiner.cpp b/Sources/Plasma/PubUtilLib/plNetClient/plNetCliAgeJoiner.cpp index 60eeb30e..97fd9608 100644 --- a/Sources/Plasma/PubUtilLib/plNetClient/plNetCliAgeJoiner.cpp +++ b/Sources/Plasma/PubUtilLib/plNetClient/plNetCliAgeJoiner.cpp @@ -181,7 +181,7 @@ void plNCAgeJoiner::IDispatchMsgReceiveCallback () { void plNCAgeJoiner::IResMgrProgressBarCallback (plKey key) { #ifndef PLASMA_EXTERNAL_RELEASE if (s_instance) - s_instance->progressBar->SetStatusText(_TEMP_CONVERT_TO_CONST_CHAR(key->GetName())); + s_instance->progressBar->SetStatusText(key->GetName().c_str()); #endif } diff --git a/Sources/Plasma/PubUtilLib/plNetClient/plNetClientMgrSend.cpp b/Sources/Plasma/PubUtilLib/plNetClient/plNetClientMgrSend.cpp index a3409946..40149d69 100644 --- a/Sources/Plasma/PubUtilLib/plNetClient/plNetClientMgrSend.cpp +++ b/Sources/Plasma/PubUtilLib/plNetClient/plNetClientMgrSend.cpp @@ -159,7 +159,7 @@ void plNetClientMgr::ISendCCRPetition(plCCRPetitionMsg* petMsg) char buffy[20]; sprintf( buffy, "%lu", GetPlayerID() ); info.AddValue( "Petition", "PlayerID", buffy ); - info.AddValue( "Petition", "PlayerName", _TEMP_CONVERT_TO_CONST_CHAR(GetPlayerName()) ); + info.AddValue( "Petition", "PlayerName", GetPlayerName().c_str() ); // write config info formatted like an ini file to a buffer hsRAMStream ram; diff --git a/Sources/Plasma/PubUtilLib/plNetClient/plNetClientMgrShow.cpp b/Sources/Plasma/PubUtilLib/plNetClient/plNetClientMgrShow.cpp index 98da3ac4..8c4bd094 100644 --- a/Sources/Plasma/PubUtilLib/plNetClient/plNetClientMgrShow.cpp +++ b/Sources/Plasma/PubUtilLib/plNetClient/plNetClientMgrShow.cpp @@ -231,8 +231,8 @@ void plNetClientMgr::IShowRelevanceRegions() // uint32_t maxPlayerName = 0; - txt.DrawString(x, y, _TEMP_CONVERT_TO_CONST_CHAR(GetPlayerName())); - maxPlayerName = hsMaximum(maxPlayerName, txt.CalcStringWidth(_TEMP_CONVERT_TO_CONST_CHAR(GetPlayerName()))); + txt.DrawString(x, y, GetPlayerName().c_str()); + maxPlayerName = hsMaximum(maxPlayerName, txt.CalcStringWidth(GetPlayerName().c_str())); y += yOff; int i; @@ -244,8 +244,8 @@ void plNetClientMgr::IShowRelevanceRegions() continue; const plString& name = mbr->GetPlayerName(); - txt.DrawString(x, y, _TEMP_CONVERT_TO_CONST_CHAR(name)); - maxPlayerName = hsMaximum(maxPlayerName, txt.CalcStringWidth(_TEMP_CONVERT_TO_CONST_CHAR(name))); + txt.DrawString(x, y, name.c_str()); + maxPlayerName = hsMaximum(maxPlayerName, txt.CalcStringWidth(name.c_str())); y += yOff; } diff --git a/Sources/Plasma/PubUtilLib/plNetClient/plNetLinkingMgr.cpp b/Sources/Plasma/PubUtilLib/plNetClient/plNetLinkingMgr.cpp index d6bf5a97..2d24ffca 100644 --- a/Sources/Plasma/PubUtilLib/plNetClient/plNetLinkingMgr.cpp +++ b/Sources/Plasma/PubUtilLib/plNetClient/plNetLinkingMgr.cpp @@ -947,7 +947,7 @@ uint8_t plNetLinkingMgr::IPreProcessLink(void) title = plString::Format("%s'", nc->GetPlayerName().c_str()); else title = plString::Format("%s's", nc->GetPlayerName().c_str()); - info->SetAgeUserDefinedName(_TEMP_CONVERT_TO_CONST_CHAR(title)); + info->SetAgeUserDefinedName(title.c_str()); } if (!info->HasAgeDescription()) { @@ -986,7 +986,7 @@ uint8_t plNetLinkingMgr::IPreProcessLink(void) title = plString::Format("%s'", nc->GetPlayerName().c_str()); else title = plString::Format("%s's", nc->GetPlayerName().c_str()); - info->SetAgeUserDefinedName(_TEMP_CONVERT_TO_CONST_CHAR(title)); + info->SetAgeUserDefinedName(title.c_str()); } if (!info->HasAgeDescription()) @@ -998,7 +998,7 @@ uint8_t plNetLinkingMgr::IPreProcessLink(void) desc = plString::Format("%s' %s", nc->GetPlayerName().c_str(), info->GetAgeInstanceName()); else desc = plString::Format("%s's %s", nc->GetPlayerName().c_str(), info->GetAgeInstanceName()); - info->SetAgeDescription( _TEMP_CONVERT_TO_CONST_CHAR(desc) ); + info->SetAgeDescription( desc.c_str() ); } if (!info->HasAgeInstanceGuid()) { diff --git a/Sources/Plasma/PubUtilLib/plNetClient/plNetObjectDebugger.cpp b/Sources/Plasma/PubUtilLib/plNetClient/plNetObjectDebugger.cpp index 27561b63..d5fbdbb2 100644 --- a/Sources/Plasma/PubUtilLib/plNetClient/plNetObjectDebugger.cpp +++ b/Sources/Plasma/PubUtilLib/plNetClient/plNetObjectDebugger.cpp @@ -130,7 +130,7 @@ bool plNetObjectDebugger::DebugObject::ObjectMatches(const hsKeyedObject* obj) if ((fFlags & kPageMatch)==0) { // match based on object name only - return StringMatches(_TEMP_CONVERT_TO_CONST_CHAR(obj->GetKeyName())); + return StringMatches(obj->GetKeyName().c_str()); } return (obj->GetKey()->GetUoid().GetLocation()==fLoc); diff --git a/Sources/Plasma/PubUtilLib/plNetCommon/plNetServerSessionInfo.cpp b/Sources/Plasma/PubUtilLib/plNetCommon/plNetServerSessionInfo.cpp index fe37d8cc..e1801a97 100644 --- a/Sources/Plasma/PubUtilLib/plNetCommon/plNetServerSessionInfo.cpp +++ b/Sources/Plasma/PubUtilLib/plNetCommon/plNetServerSessionInfo.cpp @@ -663,11 +663,11 @@ plString plNetServerSessionInfo::AsLogString() const const char* spacer = kSemicolon; plStringStream ss; - plString typeName = _TEMP_CONVERT_FROM_LITERAL(""); + plString typeName; if (HasServerType()) { - typeName = _TEMP_CONVERT_FROM_LITERAL(plNetServerConstants::GetServerTypeStr(fServerType)); + typeName = plNetServerConstants::GetServerTypeStr(fServerType); } if (HasServerName()) diff --git a/Sources/Plasma/PubUtilLib/plNetGameLib/Private/plNglAuth.cpp b/Sources/Plasma/PubUtilLib/plNetGameLib/Private/plNglAuth.cpp index ff42652a..0806a0cc 100644 --- a/Sources/Plasma/PubUtilLib/plNetGameLib/Private/plNglAuth.cpp +++ b/Sources/Plasma/PubUtilLib/plNetGameLib/Private/plNglAuth.cpp @@ -2196,7 +2196,7 @@ static bool Recv_ServerAddr ( s_active->token = msg.token; s_active->addr.SetHost(msg.srvAddr); - plString logmsg = _TEMP_CONVERT_FROM_LITERAL("SrvAuth addr: "); + plString logmsg = "SrvAuth addr: "; logmsg += s_active->addr.GetHostString(); LogMsg(kLogPerf, L"SrvAuth addr: %s", logmsg.c_str()); } @@ -2789,8 +2789,8 @@ bool AgeRequestTrans::Recv ( //============================================================================ AccountCreateRequestTrans::AccountCreateRequestTrans ( - const wchar_t accountName[], - const wchar_t password[], + const wchar_t accountName[], + const wchar_t password[], unsigned accountFlags, unsigned billingType, FNetCliAuthAccountCreateRequestCallback callback, @@ -2804,8 +2804,8 @@ AccountCreateRequestTrans::AccountCreateRequestTrans ( StrCopy(m_accountName, accountName, arrsize(m_accountName)); CryptHashPassword( - _TEMP_CONVERT_FROM_WCHAR_T(m_accountName), - _TEMP_CONVERT_FROM_WCHAR_T(password), + plString::FromWchar(m_accountName), + plString::FromWchar(password), m_namePassHash ); } @@ -2859,8 +2859,8 @@ bool AccountCreateRequestTrans::Recv ( //============================================================================ AccountCreateFromKeyRequestTrans::AccountCreateFromKeyRequestTrans ( - const wchar_t accountName[], - const wchar_t password[], + const wchar_t accountName[], + const wchar_t password[], const Uuid & key, unsigned billingType, FNetCliAuthAccountCreateFromKeyRequestCallback callback, @@ -2874,8 +2874,8 @@ AccountCreateFromKeyRequestTrans::AccountCreateFromKeyRequestTrans ( StrCopy(m_accountName, accountName, arrsize(m_accountName)); CryptHashPassword( - _TEMP_CONVERT_FROM_WCHAR_T(m_accountName), - _TEMP_CONVERT_FROM_WCHAR_T(password), + plString::FromWchar(m_accountName), + plString::FromWchar(password), m_namePassHash ); } @@ -3161,8 +3161,8 @@ bool SetPlayerRequestTrans::Recv ( //============================================================================ AccountChangePasswordRequestTrans::AccountChangePasswordRequestTrans ( - const wchar_t accountName[], - const wchar_t password[], + const wchar_t accountName[], + const wchar_t password[], FNetCliAuthAccountChangePasswordRequestCallback callback, void * param ) : NetAuthTrans(kAccountChangePasswordRequestTrans) @@ -3172,8 +3172,8 @@ AccountChangePasswordRequestTrans::AccountChangePasswordRequestTrans ( StrCopy(m_accountName, accountName, arrsize(m_accountName)); CryptHashPassword( - _TEMP_CONVERT_FROM_WCHAR_T(m_accountName), - _TEMP_CONVERT_FROM_WCHAR_T(password), + plString::FromWchar(m_accountName), + plString::FromWchar(password), m_namePassHash ); } diff --git a/Sources/Plasma/PubUtilLib/plNetMessage/plNetMessage.cpp b/Sources/Plasma/PubUtilLib/plNetMessage/plNetMessage.cpp index 94f16859..bd4f88b6 100644 --- a/Sources/Plasma/PubUtilLib/plNetMessage/plNetMessage.cpp +++ b/Sources/Plasma/PubUtilLib/plNetMessage/plNetMessage.cpp @@ -1104,7 +1104,7 @@ int plNetMsgMemberUpdate::IPokeBuffer(hsStream* stream, uint32_t peekOptions) if (bytes) { // FIX ME to something nice - fMemberInfo.GetClientGuid()->SetClientKey(_TEMP_CONVERT_FROM_LITERAL("")); + fMemberInfo.GetClientGuid()->SetClientKey(plString()); fMemberInfo.GetClientGuid()->SetAccountUUID(plUUID()); fMemberInfo.Poke(stream, peekOptions); stream->WriteByte(fAddMember); diff --git a/Sources/Plasma/PubUtilLib/plNetMessage/plNetMsgHelpers.cpp b/Sources/Plasma/PubUtilLib/plNetMessage/plNetMsgHelpers.cpp index 4a23e469..db6787f0 100644 --- a/Sources/Plasma/PubUtilLib/plNetMessage/plNetMsgHelpers.cpp +++ b/Sources/Plasma/PubUtilLib/plNetMessage/plNetMsgHelpers.cpp @@ -505,7 +505,7 @@ int plNetMsgMemberListHelper::Poke(hsStream* stream, const uint32_t peekOptions) int i; for(i=0;iGetClientGuid()->SetClientKey(_TEMP_CONVERT_FROM_LITERAL("")); + fMembers[i]->GetClientGuid()->SetClientKey(plString()); fMembers[i]->GetClientGuid()->SetAccountUUID(plUUID()); fMembers[i]->Poke(stream, peekOptions); } diff --git a/Sources/Plasma/PubUtilLib/plNetTransport/plNetTransportMember.cpp b/Sources/Plasma/PubUtilLib/plNetTransport/plNetTransportMember.cpp index 0c7b7271..fda83771 100644 --- a/Sources/Plasma/PubUtilLib/plNetTransport/plNetTransportMember.cpp +++ b/Sources/Plasma/PubUtilLib/plNetTransport/plNetTransportMember.cpp @@ -77,7 +77,7 @@ plString plNetTransportMember::AsString() const { if (IsServer()) { - return _TEMP_CONVERT_FROM_LITERAL("(server)"); + return "(server)"; } else { diff --git a/Sources/Plasma/PubUtilLib/plPhysX/plPXPhysical.cpp b/Sources/Plasma/PubUtilLib/plPhysX/plPXPhysical.cpp index 361a77c0..32d6ba18 100644 --- a/Sources/Plasma/PubUtilLib/plPhysX/plPXPhysical.cpp +++ b/Sources/Plasma/PubUtilLib/plPhysX/plPXPhysical.cpp @@ -616,7 +616,7 @@ bool plPXPhysical::HandleRefMsg(plGenRefMsg* refMsg) plKey ourKey = GetKey(); PhysRefType refType = PhysRefType(refMsg->fType); - plString refKeyName = refKey ? refKey->GetName() : _TEMP_CONVERT_FROM_LITERAL("MISSING"); + plString refKeyName = refKey ? refKey->GetName() : "MISSING"; if (refType == kPhysRefWorld) { @@ -694,7 +694,7 @@ plPhysical& plPXPhysical::SetProperty(int prop, bool status) case plSimulationInterface::kNoSynchronize: propName = "kNoSynchronize"; break; } - plString name = _TEMP_CONVERT_FROM_LITERAL("(unknown)"); + plString name = "(unknown)"; if (GetKey()) name = GetKeyName(); if (plSimulationMgr::fExtraProfile) diff --git a/Sources/Plasma/PubUtilLib/plPhysical/plPhysicalSDLModifier.cpp b/Sources/Plasma/PubUtilLib/plPhysical/plPhysicalSDLModifier.cpp index 8ff03da7..41d32caa 100644 --- a/Sources/Plasma/PubUtilLib/plPhysical/plPhysicalSDLModifier.cpp +++ b/Sources/Plasma/PubUtilLib/plPhysical/plPhysicalSDLModifier.cpp @@ -220,22 +220,22 @@ void plPhysicalSDLModifier::ILogState(const plStateDataRecord* state, bool useDi if (isPosSet) log += plString::Format(" Pos=%.1f %.1f %.1f", pos.fX, pos.fY, pos.fZ); else - log += _TEMP_CONVERT_FROM_LITERAL(" Pos=None"); + log += " Pos=None"; if (isLinVSet) log += plString::Format(" LinV=%.1f %.1f %.1f", linV.fX, linV.fY, linV.fZ); else - log += _TEMP_CONVERT_FROM_LITERAL(" LinV=None"); + log += " LinV=None"; if (isAngVSet) log += plString::Format(" AngV=%.1f %.1f %.1f", angV.fX, angV.fY, angV.fZ); else - log += _TEMP_CONVERT_FROM_LITERAL(" AngV=None"); + log += " AngV=None"; if (isRotSet) log += plString::Format(" Rot=%.1f %.1f %.1f %.1f", rot.fX, rot.fY, rot.fZ, rot.fW); else - log += _TEMP_CONVERT_FROM_LITERAL(" Rot=None"); + log += " Rot=None"; IGetLog()->AddLine(log.c_str(), color); } diff --git a/Sources/Plasma/PubUtilLib/plPipeline/plDXPipeline.cpp b/Sources/Plasma/PubUtilLib/plPipeline/plDXPipeline.cpp index d0c14736..6e0f8779 100644 --- a/Sources/Plasma/PubUtilLib/plPipeline/plDXPipeline.cpp +++ b/Sources/Plasma/PubUtilLib/plPipeline/plDXPipeline.cpp @@ -1341,10 +1341,10 @@ bool plDXPipeline::ICreateDeviceObjects() /// Ok, we're done now #if MCN_BOUNDS_SPANS fBoundsSpans = new plDrawableSpans(); - hsgResMgr::ResMgr()->NewKey( _TEMP_CONVERT_FROM_LITERAL("BoundsSpans"), fBoundsSpans, plLocation::kGlobalFixedLoc ); + hsgResMgr::ResMgr()->NewKey( "BoundsSpans", fBoundsSpans, plLocation::kGlobalFixedLoc ); fBoundsSpans->SetNativeProperty( plDrawable::kPropVolatile, true ); fBoundsMat = new hsGMaterial(); - hsgResMgr::ResMgr()->NewKey( _TEMP_CONVERT_FROM_LITERAL("BoundsMaterial"), fBoundsMat, plLocation::kGlobalFixedLoc ); + hsgResMgr::ResMgr()->NewKey( "BoundsMaterial", fBoundsMat, plLocation::kGlobalFixedLoc ); plLayer *lay = fBoundsMat->MakeBaseLayer(); lay->SetMiscFlags( hsGMatState::kMiscWireFrame | hsGMatState::kMiscTwoSided ); lay->SetShadeFlags( lay->GetShadeFlags() | hsGMatState::kShadeWhite ); @@ -9375,7 +9375,7 @@ void plDXPipeline::IMakeOcclusionSnap() ident.Reset(); hsGMaterial* mat = new hsGMaterial; - hsgResMgr::ResMgr()->NewKey( _TEMP_CONVERT_FROM_LITERAL("OcclusionSnapMat"), mat, plLocation::kGlobalFixedLoc ); + hsgResMgr::ResMgr()->NewKey( "OcclusionSnapMat", mat, plLocation::kGlobalFixedLoc ); plLayer *lay = mat->MakeBaseLayer(); lay->SetZFlags(hsGMatState::kZNoZWrite); lay->SetPreshadeColor(hsColorRGBA().Set(1.f, 0.5f, 0.5f, 1.f)); diff --git a/Sources/Plasma/PubUtilLib/plResMgr/plKeyFinder.cpp b/Sources/Plasma/PubUtilLib/plResMgr/plKeyFinder.cpp index 998f9e94..e7b7eb8d 100644 --- a/Sources/Plasma/PubUtilLib/plResMgr/plKeyFinder.cpp +++ b/Sources/Plasma/PubUtilLib/plResMgr/plKeyFinder.cpp @@ -109,7 +109,7 @@ bool NameMatches(const char* obName, const char* pKName, bool subString) } else { - if (_TEMP_CONVERT_FROM_LITERAL(p).Find(o, plString::kCaseInsensitive) >= 0) + if (plString(p).Find(o, plString::kCaseInsensitive) >= 0) return true; } @@ -264,12 +264,12 @@ void plKeyFinder::IGetNames(std::vector& names, const plString& search void plKeyFinder::GetResponderNames(std::vector& names) { - IGetNames(names, _TEMP_CONVERT_FROM_LITERAL(""), CLASS_INDEX_SCOPED(plResponderModifier)); + IGetNames(names, plString(), CLASS_INDEX_SCOPED(plResponderModifier)); } void plKeyFinder::GetActivatorNames(std::vector& names) { - IGetNames(names, _TEMP_CONVERT_FROM_LITERAL(""), CLASS_INDEX_SCOPED(plLogicModifier)); + IGetNames(names, plString(), CLASS_INDEX_SCOPED(plLogicModifier)); } class plKeyFinderIterator : public plRegistryKeyIterator, public plRegistryPageIterator diff --git a/Sources/Plasma/PubUtilLib/plResMgr/plResManager.cpp b/Sources/Plasma/PubUtilLib/plResMgr/plResManager.cpp index 6ccc25bc..3c0f17ab 100644 --- a/Sources/Plasma/PubUtilLib/plResMgr/plResManager.cpp +++ b/Sources/Plasma/PubUtilLib/plResMgr/plResManager.cpp @@ -536,9 +536,9 @@ inline plKeyImp* IFindKeyLocalized(const plUoid& uoid, plRegistryPageNode* page) if ((!objectName.IsNull()) && plLocalization::IsLocalized()) { char localName[256]; - if (plLocalization::GetLocalized(_TEMP_CONVERT_TO_CONST_CHAR(objectName), localName)) + if (plLocalization::GetLocalized(objectName.c_str(), localName)) { - plKeyImp* localKey = page->FindKey(uoid.GetClassType(), _TEMP_CONVERT_FROM_LITERAL(localName)); + plKeyImp* localKey = page->FindKey(uoid.GetClassType(), localName); if (localKey != nil) return localKey; } @@ -921,7 +921,7 @@ plKey plResManager::ICloneKey(const plUoid& objUoid, uint32_t playerID, uint32_t fCurCloneID = cloneID; fCurClonePlayerID = playerID; - plKey cloneKey = ReRegister(_TEMP_CONVERT_FROM_LITERAL(""), objUoid); + plKey cloneKey = ReRegister(plString(), objUoid); fCurClonePlayerID = 0; fCurCloneID = 0; @@ -1272,7 +1272,7 @@ public: { if (stricmp(page->GetPageInfo().GetAge(), fAgeName) == 0) { - plUoid uoid(page->GetPageInfo().GetLocation(), 0, _TEMP_CONVERT_FROM_LITERAL("")); + plUoid uoid(page->GetPageInfo().GetLocation(), 0, plString()); fLocations.push_back(uoid.GetLocation()); } return true; diff --git a/Sources/Plasma/PubUtilLib/plSDL/plStateDataRecord.cpp b/Sources/Plasma/PubUtilLib/plSDL/plStateDataRecord.cpp index 2da31107..4dc5936a 100644 --- a/Sources/Plasma/PubUtilLib/plSDL/plStateDataRecord.cpp +++ b/Sources/Plasma/PubUtilLib/plSDL/plStateDataRecord.cpp @@ -49,7 +49,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include "plNetMessage/plNetMessage.h" #include "pnNetCommon/plNetApp.h" -const plString plSDL::kAgeSDLObjectName = _TEMP_CONVERT_FROM_LITERAL("AgeSDLHook"); +const plString plSDL::kAgeSDLObjectName = "AgeSDLHook"; // static const uint8_t plStateDataRecord::kIOVersion=6; @@ -737,7 +737,7 @@ void plStateDataRecord::DumpToObjectDebugger(const char* msg, bool dirtyOnly, in plString pad; int i; for(i=0;iWrite(logStr.GetSize(), logStr.c_str()); } diff --git a/Sources/Plasma/PubUtilLib/plSDL/plStateVariable.cpp b/Sources/Plasma/PubUtilLib/plSDL/plStateVariable.cpp index 55e7a34f..ea51353c 100644 --- a/Sources/Plasma/PubUtilLib/plSDL/plStateVariable.cpp +++ b/Sources/Plasma/PubUtilLib/plSDL/plStateVariable.cpp @@ -1790,7 +1790,7 @@ plString plSimpleStateVariable::GetKeyName(int idx) const } } hsAssert(false, "passing wrong value type to SDL variable"); - return _TEMP_CONVERT_FROM_LITERAL("(nil)"); + return "(nil)"; } #pragma optimize( "g", off ) // disable float optimizations diff --git a/Sources/Plasma/PubUtilLib/plScene/plRelevanceMgr.cpp b/Sources/Plasma/PubUtilLib/plScene/plRelevanceMgr.cpp index 8f2c55c1..a604d83f 100644 --- a/Sources/Plasma/PubUtilLib/plScene/plRelevanceMgr.cpp +++ b/Sources/Plasma/PubUtilLib/plScene/plRelevanceMgr.cpp @@ -222,7 +222,7 @@ void plRelevanceMgr::ParseCsvInput(hsStream *s) plRegionInfo *info = new plRegionInfo; regions.Append(info); info->fName = hsStrcpy(buff); - info->fIndex = GetIndex(_TEMP_CONVERT_FROM_LITERAL(buff)); + info->fIndex = GetIndex(buff); } } else // parsing actual settings. @@ -231,7 +231,7 @@ void plRelevanceMgr::ParseCsvInput(hsStream *s) if (!toke.Next(buff, kBufSize)) continue; - int rowIndex = GetIndex(_TEMP_CONVERT_FROM_LITERAL(buff)); + int rowIndex = GetIndex(buff); int column = 0; while (toke.Next(buff, kBufSize) && column < regions.GetCount()) { @@ -252,20 +252,20 @@ plString plRelevanceMgr::GetRegionNames(hsBitVector regions) { plString retVal; if (regions.IsBitSet(0)) - retVal = _TEMP_CONVERT_FROM_LITERAL("-Nowhere (0)-"); + retVal = "-Nowhere (0)-"; for (int i = 0; i < fRegions.GetCount(); ++i) { if (regions.IsBitSet(i + 1)) { if (!retVal.IsEmpty()) - retVal += _TEMP_CONVERT_FROM_LITERAL(", "); + retVal += ", "; if (fRegions[i]) retVal += fRegions[i]->GetKeyName(); } } if (retVal.IsEmpty()) - retVal = _TEMP_CONVERT_FROM_LITERAL(""); + retVal = ""; return retVal; } diff --git a/Sources/Plasma/PubUtilLib/plStatGather/plAutoProfile.cpp b/Sources/Plasma/PubUtilLib/plStatGather/plAutoProfile.cpp index 8942ba25..27866480 100644 --- a/Sources/Plasma/PubUtilLib/plStatGather/plAutoProfile.cpp +++ b/Sources/Plasma/PubUtilLib/plStatGather/plAutoProfile.cpp @@ -219,7 +219,7 @@ void plAutoProfileImp::INextProfile() if (!fLastSpawnPointName.IsNull()) { const char * ageName = NetCommGetAge()->ageDatasetName; - plProfileManagerFull::Instance().LogStats(ageName, _TEMP_CONVERT_TO_CONST_CHAR(fLastSpawnPointName)); + plProfileManagerFull::Instance().LogStats(ageName, fLastSpawnPointName.c_str()); plMipmap mipmap; if (plClient::GetInstance()->GetPipeline()->CaptureScreen(&mipmap)) @@ -276,8 +276,8 @@ bool plAutoProfileImp::INextAge() link.SetLinkingRules(plNetCommon::LinkingRules::kBasicLink); plNetLinkingMgr::GetInstance()->LinkToAge(&link); - fStatusMessage = _TEMP_CONVERT_FROM_LITERAL("Linking to age "); - fStatusMessage += _TEMP_CONVERT_FROM_LITERAL(ageName); + fStatusMessage = "Linking to age "; + fStatusMessage += ageName; return true; } @@ -299,7 +299,7 @@ bool plAutoProfileImp::INextSpawnPoint() if (fLastSpawnPointName.CompareN(kPerfSpawnPrefix, kPerfSpawnLen) == 0) { - fStatusMessage = _TEMP_CONVERT_FROM_LITERAL("Profiling spawn point "); + fStatusMessage = "Profiling spawn point "; fStatusMessage += fLastSpawnPointName; foundGood = true; @@ -312,7 +312,7 @@ bool plAutoProfileImp::INextSpawnPoint() if (!foundGood) { fLastSpawnPointName = plString::Null; - fStatusMessage = _TEMP_CONVERT_FROM_LITERAL("No profile spawn point found"); + fStatusMessage = "No profile spawn point found"; return false; } @@ -368,7 +368,7 @@ bool plAutoProfileImp::MsgReceive(plMessage* msg) ms); } - fStatusMessage = _TEMP_CONVERT_FROM_LITERAL("Age loaded. Preparing to profile."); + fStatusMessage = "Age loaded. Preparing to profile."; // Age is loaded, start profiling in 5 seconds (to make sure the avatar is linked in all the way) plTimerCallbackMsg* timerMsg = new plTimerCallbackMsg(GetKey()); diff --git a/Sources/Plasma/PubUtilLib/plStatusLog/plLoggable.cpp b/Sources/Plasma/PubUtilLib/plStatusLog/plLoggable.cpp index 0a940a80..92944f90 100644 --- a/Sources/Plasma/PubUtilLib/plStatusLog/plLoggable.cpp +++ b/Sources/Plasma/PubUtilLib/plStatusLog/plLoggable.cpp @@ -121,22 +121,22 @@ bool plLoggable::LogV( const char * fmt, va_list args ) const bool plLoggable::DebugMsgV(const char* fmt, va_list args) const { - return Log(_TEMP_CONVERT_FROM_LITERAL("DBG: ") + plString::IFormat(fmt, args)); + return Log(plString("DBG: ") + plString::IFormat(fmt, args)); } bool plLoggable::ErrorMsgV(const char* fmt, va_list args) const { - return Log(_TEMP_CONVERT_FROM_LITERAL("ERR: ") + plString::IFormat(fmt, args)); + return Log(plString("ERR: ") + plString::IFormat(fmt, args)); } bool plLoggable::WarningMsgV(const char* fmt, va_list args) const { - return Log(_TEMP_CONVERT_FROM_LITERAL("WRN: ") + plString::IFormat(fmt, args)); + return Log(plString("WRN: ") + plString::IFormat(fmt, args)); } bool plLoggable::AppMsgV(const char* fmt, va_list args) const { - return Log(_TEMP_CONVERT_FROM_LITERAL("APP: ") + plString::IFormat(fmt, args)); + return Log(plString("APP: ") + plString::IFormat(fmt, args)); } /////////////////////////////////////////////////////////////// diff --git a/Sources/Plasma/PubUtilLib/plSurface/hsGMaterial.cpp b/Sources/Plasma/PubUtilLib/plSurface/hsGMaterial.cpp index cd2c6003..0134d0ca 100644 --- a/Sources/Plasma/PubUtilLib/plSurface/hsGMaterial.cpp +++ b/Sources/Plasma/PubUtilLib/plSurface/hsGMaterial.cpp @@ -136,7 +136,7 @@ plLayer* hsGMaterial::MakeBaseLayer() if( !GetKey()->GetName().IsNull() ) buff = plString::Format("%s_Layer", GetKey()->GetName().c_str()); else - buff = _TEMP_CONVERT_FROM_LITERAL("Layer"); + buff = "Layer"; hsgResMgr::ResMgr()->NewKey( buff, newLay, GetKey() != nil ? GetKey()->GetUoid().GetLocation() : plLocation::kGlobalFixedLoc ); // Add layer so we have it now. diff --git a/Sources/Tools/MaxComponent/plAnimComponent.cpp b/Sources/Tools/MaxComponent/plAnimComponent.cpp index b74bfff5..7dc065c0 100644 --- a/Sources/Tools/MaxComponent/plAnimComponent.cpp +++ b/Sources/Tools/MaxComponent/plAnimComponent.cpp @@ -719,7 +719,7 @@ bool plAnimComponentBase::PreConvert(plMaxNode *node, plErrorMsg *pErrMsg) plString animName = plString::FromUtf8(fCompPB->GetStr(kAnimName)); if (animName.IsEmpty()) - animName = _TEMP_CONVERT_FROM_LITERAL(ENTIRE_ANIMATION_NAME); + animName = ENTIRE_ANIMATION_NAME; if (fCompPB->GetInt(ParamID(kAnimUseGlobal))) { @@ -995,7 +995,7 @@ plString plAnimComponentBase::GetIfaceSegmentName( bool allowNil ) plString name = GetAnimName(); if( allowNil || !name.IsNull() ) return name; - return _TEMP_CONVERT_FROM_LITERAL( ENTIRE_ANIMATION_NAME ); + return ENTIRE_ANIMATION_NAME; } //// Hit Callback for Animations ///////////////////////////////////////////// diff --git a/Sources/Tools/MaxComponent/plAudioComponents.cpp b/Sources/Tools/MaxComponent/plAudioComponents.cpp index f57821fa..4ef8b904 100644 --- a/Sources/Tools/MaxComponent/plAudioComponents.cpp +++ b/Sources/Tools/MaxComponent/plAudioComponents.cpp @@ -622,7 +622,7 @@ plSoundBuffer *plBaseSoundEmitterComponent::IGetSourceBuffer( const char *file char tempPath[ MAX_PATH ]; strncpy(tempPath, fileName, MAX_PATH); ::PathStripPath( tempPath ); - keyName = _TEMP_CONVERT_FROM_LITERAL( tempPath ); + keyName = tempPath; // TEMP HACK until we get packed sounds: // Given the source filename, we check to see if it's in our plasma game directory. If not, or if @@ -638,7 +638,7 @@ plSoundBuffer *plBaseSoundEmitterComponent::IGetSourceBuffer( const char *file plFileUtils::CreateDir( fullPath ); // Now finish the path... - strcat( fullPath, _TEMP_CONVERT_TO_CONST_CHAR( keyName ) ); + strcat( fullPath, keyName.c_str() ); // Check filestamp WIN32_FILE_ATTRIBUTE_DATA oldFileAttrib, newFileAttrib; @@ -667,9 +667,9 @@ plSoundBuffer *plBaseSoundEmitterComponent::IGetSourceBuffer( const char *file // Additional info for the keyName--need some flag mangling, specifically for the left/right channel mangling if( srcBufferFlags & plSoundBuffer::kOnlyLeftChannel ) - keyName += _TEMP_CONVERT_FROM_LITERAL( ":L" ); + keyName += ":L"; else if( srcBufferFlags & plSoundBuffer::kOnlyRightChannel ) - keyName += _TEMP_CONVERT_FROM_LITERAL( ":R" ); + keyName += ":R"; key = srcNode->FindPageKey( plSoundBuffer::Index(), keyName ); if( key != nil ) diff --git a/Sources/Tools/MaxComponent/plAvatarComponent.cpp b/Sources/Tools/MaxComponent/plAvatarComponent.cpp index 6ee021c5..7f90aaaf 100644 --- a/Sources/Tools/MaxComponent/plAvatarComponent.cpp +++ b/Sources/Tools/MaxComponent/plAvatarComponent.cpp @@ -264,11 +264,11 @@ bool plArmatureComponent::Convert(plMaxNode* node, plErrorMsg *pErrMsg) { // MakeCharacterHierarchy will attach agmodifiers to all the bones in the hierarchy; // have to manually add any for non-bone objects... - agMod = new plAGModifier(_TEMP_CONVERT_FROM_LITERAL("Handle")); // the player root is known as the handle + agMod = new plAGModifier("Handle"); // the player root is known as the handle node->AddModifier(agMod, IGetUniqueName(node)); } - agMod->SetChannelName(_TEMP_CONVERT_FROM_LITERAL("Handle")); + agMod->SetChannelName("Handle"); // Get the position and radius of the head and torso physicals if (ClassID() == AVATAR_CLASS_ID || ClassID() == LOD_AVATAR_CLASS_ID) @@ -685,7 +685,7 @@ bool plCompoundCtrlComponent::Convert(plMaxNode* node, plErrorMsg *pErrMsg) plString name = node->GetKey()->GetName(); node->MakeCharacterHierarchy(pErrMsg); - node->SetupBonesAliasesRecur(_TEMP_CONVERT_TO_CONST_CHAR(name)); + node->SetupBonesAliasesRecur(name.c_str()); // create and register the player modifier diff --git a/Sources/Tools/MaxComponent/plClickDragComponent.cpp b/Sources/Tools/MaxComponent/plClickDragComponent.cpp index aa82551b..aeeea573 100644 --- a/Sources/Tools/MaxComponent/plClickDragComponent.cpp +++ b/Sources/Tools/MaxComponent/plClickDragComponent.cpp @@ -453,7 +453,7 @@ bool plClickDragComponent::Convert(plMaxNode *node, plErrorMsg *pErrMsg) { //pMsg->SetAnimName(ENTIRE_ANIMATION_NAME); pMsg->SetAnimName(pAnim->GetModKey(node)->GetName()); - pAxis->SetAnimLabel(_TEMP_CONVERT_FROM_LITERAL(ENTIRE_ANIMATION_NAME)); + pAxis->SetAnimLabel(ENTIRE_ANIMATION_NAME); } else { diff --git a/Sources/Tools/MaxComponent/plFootstepComponent.cpp b/Sources/Tools/MaxComponent/plFootstepComponent.cpp index 92c357e9..745a0d71 100644 --- a/Sources/Tools/MaxComponent/plFootstepComponent.cpp +++ b/Sources/Tools/MaxComponent/plFootstepComponent.cpp @@ -115,7 +115,7 @@ bool plFootstepSoundComponent::Convert(plMaxNode *node, plErrorMsg *pErrMsg) plArmatureEffectFootSound *effect = new plArmatureEffectFootSound(); // Note: MUST be a hard-coded keyname, since we search for same name in plArmatureMod.cpp - hsgResMgr::ResMgr()->NewKey( _TEMP_CONVERT_FROM_LITERAL("FootstepSounds"), effect, node->GetLocation()); + hsgResMgr::ResMgr()->NewKey( "FootstepSounds", effect, node->GetLocation()); int i; for (i = 0; i < plArmatureEffectsMgr::kMaxSurface; i++) diff --git a/Sources/Tools/MaxComponent/plGUIComponents.cpp b/Sources/Tools/MaxComponent/plGUIComponents.cpp index 69b88ea1..196694d6 100644 --- a/Sources/Tools/MaxComponent/plGUIComponents.cpp +++ b/Sources/Tools/MaxComponent/plGUIComponents.cpp @@ -2728,7 +2728,7 @@ bool plGUIKnobCtrlComponent::Convert(plMaxNode *node, plErrorMsg *pErrMsg) plAGMasterMod *master = node->GetAGMasterMod(); hsTArray keys; keys.Append( master->GetKey() ); - ctrl->SetAnimationKeys( keys, _TEMP_CONVERT_FROM_LITERAL( ENTIRE_ANIMATION_NAME ) ); + ctrl->SetAnimationKeys( keys, ENTIRE_ANIMATION_NAME ); } if( fCompPB->GetInt( kRefOrientation ) == 1 ) @@ -4450,7 +4450,7 @@ bool plGUIProgressCtrlComponent::Convert(plMaxNode *node, plErrorMsg *pErrMsg) plAGMasterMod *master = node->GetAGMasterMod(); hsTArray keys; keys.Append( master->GetKey() ); - ctrl->SetAnimationKeys( keys, _TEMP_CONVERT_FROM_LITERAL( ENTIRE_ANIMATION_NAME ) ); + ctrl->SetAnimationKeys( keys, ENTIRE_ANIMATION_NAME ); } const char *errMsg = ISetSoundIndex( kRefAnimateSound, kRefAnimateSoundComp, pfGUIProgressCtrl::kAnimateSound, node ); diff --git a/Sources/Tools/MaxComponent/plMaxAnimUtils.cpp b/Sources/Tools/MaxComponent/plMaxAnimUtils.cpp index 450863e4..64f9a450 100644 --- a/Sources/Tools/MaxComponent/plMaxAnimUtils.cpp +++ b/Sources/Tools/MaxComponent/plMaxAnimUtils.cpp @@ -210,8 +210,8 @@ void GetSegment(const char *note, float time, SegmentMap *segMap, plErrorMsg *pE int matchedFields = sscanf(note, " %[^@] @ %s ", segName, segSuffix); - plString name = _TEMP_CONVERT_FROM_LITERAL(segName); - plString suffix = _TEMP_CONVERT_FROM_LITERAL(segSuffix); + plString name = segName; + plString suffix = segSuffix; if (matchedFields == 2) { diff --git a/Sources/Tools/MaxComponent/plPythonFileComponent.cpp b/Sources/Tools/MaxComponent/plPythonFileComponent.cpp index 6e9cb6f7..f66d5f98 100644 --- a/Sources/Tools/MaxComponent/plPythonFileComponent.cpp +++ b/Sources/Tools/MaxComponent/plPythonFileComponent.cpp @@ -457,7 +457,7 @@ bool plPythonFileComponent::Convert(plMaxNode *node, plErrorMsg *pErrMsg) break; case plAutoUIParam::kTypeString: - pyParam.SetToString(_TEMP_CONVERT_FROM_LITERAL(param->GetString(pb))); + pyParam.SetToString(param->GetString(pb)); mod->AddParameter(pyParam); break; @@ -807,7 +807,7 @@ bool plPythonFileComponent::Convert(plMaxNode *node, plErrorMsg *pErrMsg) // save out the animation name first plString tempAnimName = animcomp->GetAnimName(); if (tempAnimName.IsNull()) - pyParam.SetToAnimationName(_TEMP_CONVERT_FROM_LITERAL(ENTIRE_ANIMATION_NAME)); + pyParam.SetToAnimationName(ENTIRE_ANIMATION_NAME); else pyParam.SetToAnimationName(tempAnimName); mod->AddParameter(pyParam); @@ -929,7 +929,7 @@ bool plPythonFileComponent::Convert(plMaxNode *node, plErrorMsg *pErrMsg) break; case plAutoUIParam::kTypeDropDownList: - pyParam.SetToString(_TEMP_CONVERT_FROM_LITERAL(param->GetString(pb))); + pyParam.SetToString(param->GetString(pb)); mod->AddParameter(pyParam); break; diff --git a/Sources/Tools/MaxComponent/plResponderMtl.cpp b/Sources/Tools/MaxComponent/plResponderMtl.cpp index 5c1e323b..80162c53 100644 --- a/Sources/Tools/MaxComponent/plResponderMtl.cpp +++ b/Sources/Tools/MaxComponent/plResponderMtl.cpp @@ -276,10 +276,9 @@ void ISearchLayerRecur(plLayerInterface *layer, const plString &segName, hsTArra int ISearchLayerRecur(hsGMaterial* mat, const plString &segName, hsTArray& keys) { - plString name = segName.IsNull() ? _TEMP_CONVERT_FROM_LITERAL("") : segName; int i; for( i = 0; i < mat->GetNumLayers(); i++ ) - ISearchLayerRecur(mat->GetLayer(i), name, keys); + ISearchLayerRecur(mat->GetLayer(i), segName, keys); return keys.GetCount(); } diff --git a/Sources/Tools/MaxConvert/hsControlConverter.cpp b/Sources/Tools/MaxConvert/hsControlConverter.cpp index fc2723d2..89f89486 100644 --- a/Sources/Tools/MaxConvert/hsControlConverter.cpp +++ b/Sources/Tools/MaxConvert/hsControlConverter.cpp @@ -2158,7 +2158,7 @@ void hsControlConverter::IExportAnimatedCameraFOV(plMaxNode* node, hsTArray AddReceiver(pCamMod->GetKey()); pMsg->SetSender(pAnim->GetModKey(node)); pMsg->SetCmd(plAnimCmdMsg::kAddCallbacks); - pMsg->SetAnimName(_TEMP_CONVERT_FROM_LITERAL(ENTIRE_ANIMATION_NAME)); + pMsg->SetAnimName(ENTIRE_ANIMATION_NAME); pMsg->fTime = kfArray[0][i].fFrame / MAX_FRAMES_PER_SEC; pMsg->AddCallback(pCall); hsRefCnt_SafeUnRef(pCall); diff --git a/Sources/Tools/MaxConvert/hsConverterUtils.cpp b/Sources/Tools/MaxConvert/hsConverterUtils.cpp index fba44a87..6b31e269 100644 --- a/Sources/Tools/MaxConvert/hsConverterUtils.cpp +++ b/Sources/Tools/MaxConvert/hsConverterUtils.cpp @@ -346,7 +346,7 @@ INode* hsConverterUtils::FindINodeFromKeyedObject(hsKeyedObject* obj) { hsGuardBegin("hsConverterUtils::FindINodeFromKeyedObject"); - INode* retVal = FindINodeFromMangledName(_TEMP_CONVERT_TO_CONST_CHAR(obj->GetKey()->GetName())); + INode* retVal = FindINodeFromMangledName(obj->GetKey()->GetName().c_str()); if( retVal ) return (retVal); diff --git a/Sources/Tools/MaxConvert/hsMaterialConverter.cpp b/Sources/Tools/MaxConvert/hsMaterialConverter.cpp index 55d7c54f..69b54c29 100644 --- a/Sources/Tools/MaxConvert/hsMaterialConverter.cpp +++ b/Sources/Tools/MaxConvert/hsMaterialConverter.cpp @@ -762,7 +762,7 @@ hsMaterialConverter::CreateMaterialArray(Mtl *maxMaterial, plMaxNode *node, uint if (maxMaterial) name = plString::FromUtf8(maxMaterial->GetName()); else - name = _TEMP_CONVERT_FROM_LITERAL("nil"); + name = "nil"; /// Get the material bool isMultiMat = IsMultiMat( maxMaterial ); @@ -1183,7 +1183,7 @@ hsGMaterial *hsMaterialConverter::IProcessMaterial(Mtl *mtl, plMaxNode *node, co plLayer* hLay = new plLayer; hLay->InitToDefault(); - hsgResMgr::ResMgr()->NewKey(name + _TEMP_CONVERT_FROM_LITERAL("_DefLay"), hLay, nodeLoc); + hsgResMgr::ResMgr()->NewKey(name + "_DefLay", hLay, nodeLoc); IAddLayerToMaterial(hMat, hLay); } @@ -1337,7 +1337,7 @@ hsGMaterial *hsMaterialConverter::IAddDefaultMaterial(plMaxNode *node) plLayer *layer = new plLayer; layer->InitToDefault(); - hsgResMgr::ResMgr()->NewKey(hMat->GetKeyName() + _TEMP_CONVERT_FROM_LITERAL("_DefLay"), layer, loc); + hsgResMgr::ResMgr()->NewKey(hMat->GetKeyName() + "_DefLay", layer, loc); DWORD color = node->GetWireColor(); float r = float(GetRValue(color)) / 255.f; @@ -1353,8 +1353,8 @@ hsGMaterial *hsMaterialConverter::IAddDefaultMaterial(plMaxNode *node) plMipmap *hsMaterialConverter::IGetUVTransTexture(plMaxNode *node, bool useU /* = true */) { - plString texName = (useU ? _TEMP_CONVERT_FROM_LITERAL("ALPHA_BLEND_FILTER_U2ALPHA_TRANS_64x4") - : _TEMP_CONVERT_FROM_LITERAL("ALPHA_BLEND_FILTER_V2ALPHA_TRANS_4x64") ); + plString texName = (useU ? "ALPHA_BLEND_FILTER_U2ALPHA_TRANS_64x4" + : "ALPHA_BLEND_FILTER_V2ALPHA_TRANS_4x64" ); int w = (useU ? 64 : 4); int h = (useU ? 4 : 64); @@ -1412,7 +1412,7 @@ void hsMaterialConverter::IInsertSingleBlendLayer(plMipmap *texture, hsGMaterial plLayer* layer = new plLayer; layer->InitToDefault(); - hsgResMgr::ResMgr()->NewKey(underLay->GetKeyName() + _TEMP_CONVERT_FROM_LITERAL("_AlphaBlend"), layer, node->GetLocation()); + hsgResMgr::ResMgr()->NewKey(underLay->GetKeyName() + "_AlphaBlend", layer, node->GetLocation()); hsgResMgr::ResMgr()->AddViaNotify(texture->GetKey(), new plLayRefMsg(layer->GetKey(), plRefMsg::kOnCreate, 0, plLayRefMsg::kTexture), plRefFlags::kActiveRef); layer->SetAmbientColor(hsColorRGBA().Set(1.f, 1.f, 1.f, 1.f)); // layer->SetZFlags(hsGMatState::kZNoZWrite | hsGMatState::kZIncLayer); @@ -1848,7 +1848,7 @@ plLayerAnimation *IConvertNoteTrackAnims(plLayerAnimation *animLayer, SegmentMap void ISetDefaultAnim(plPassMtlBase* mtl, plAnimTimeConvert& tc, SegmentMap* segMap) { - plString animName = _TEMP_CONVERT_FROM_LITERAL( mtl->GetAnimName() ); + plString animName = mtl->GetAnimName(); if( segMap && !animName.IsNull() && (segMap->find(animName) != segMap->end()) ) { SegmentSpec *spec = (*segMap)[animName]; @@ -1997,12 +1997,12 @@ static plLayerInterface* IProcessLayerMovie(plPassMtlBase* mtl, plLayerTex* layT if (isBink) { movieLayer = new plLayerBink; - moviePostfix = _TEMP_CONVERT_FROM_LITERAL("_bink"); + moviePostfix = "_bink"; } else if (isAvi) { movieLayer = new plLayerAVI; - moviePostfix = _TEMP_CONVERT_FROM_LITERAL("_avi"); + moviePostfix = "_avi"; } plString movieKeyName = layerIFace->GetKeyName() + moviePostfix; @@ -2075,8 +2075,8 @@ plLayerInterface* IProcessLayerAnimation(plPassMtlBase* mtl, plLayerTex* layTex, plString segName = stealth->GetSegmentName(); bool isDefault = ( segName.IsNull() || segName.Compare( ENTIRE_ANIMATION_NAME ) == 0 ) ? true : false; - plString animName = name + ( ( isDefault ) ? _TEMP_CONVERT_FROM_LITERAL( "_LayerAnim_" ) - : ( _TEMP_CONVERT_FROM_LITERAL("_LayerAnim") + segName ) ); + plString animName = name + ( ( isDefault ) ? "_LayerAnim_" + : ( plString("_LayerAnim") + segName ) ); hsgResMgr::ResMgr()->NewKey( animName, noteAnim, node->GetLocation() ); StdUVGen *uvGen = (StdUVGen *)layTex->GetTheUVGen(); @@ -2191,8 +2191,8 @@ plLayerInterface* IProcessAnimation(plPassMtlBase *mtl, plMaxNode *node, const p plString segName = stealth->GetSegmentName(); bool isDefault = ( segName.IsNull() || segName.Compare( ENTIRE_ANIMATION_NAME ) == 0 ) ? true : false; - plString animName = name + ( ( isDefault ) ? _TEMP_CONVERT_FROM_LITERAL( "_anim" ) - : ( _TEMP_CONVERT_FROM_LITERAL("_anim_") + segName ) ); + plString animName = name + ( ( isDefault ) ? "_anim" + : ( plString("_anim_") + segName ) ); hsgResMgr::ResMgr()->NewKey( animName, noteAnim, node->GetLocation() ); plController *noteColCtl = cc.MakeColorController( maxColCtl, node ); @@ -3128,7 +3128,7 @@ void hsMaterialConverter::IAppendFunkyLayer(plMaxNode* node, Texmap* texMap, hsG plBitmap* hsMaterialConverter::IGetFunkyRamp(plMaxNode* node, uint32_t funkyType) { - plString funkName = funkyType & kFunkyAdd ? _TEMP_CONVERT_FROM_LITERAL("FunkyRampAdd") : _TEMP_CONVERT_FROM_LITERAL("FunkyRampMult"); + plString funkName = funkyType & kFunkyAdd ? "FunkyRampAdd" : "FunkyRampMult"; const int kLUTWidth = 16; const int kLUTHeight = 16; @@ -3510,7 +3510,7 @@ BitmapTex* hsMaterialConverter::GetBumpLayer(plMaxNode* node, Mtl* mtl) plMipmap *hsMaterialConverter::IGetBumpLutTexture(plMaxNode *node) { - const plString texName = _TEMP_CONVERT_FROM_LITERAL("BumpLutTexture"); + const plString texName = "BumpLutTexture"; //#define FUNKYBUMP #ifndef FUNKYBUMP diff --git a/Sources/Tools/MaxConvert/plBitmapCreator.cpp b/Sources/Tools/MaxConvert/plBitmapCreator.cpp index 63373c81..5e9f964e 100644 --- a/Sources/Tools/MaxConvert/plBitmapCreator.cpp +++ b/Sources/Tools/MaxConvert/plBitmapCreator.cpp @@ -548,8 +548,8 @@ plBitmap *plBitmapCreator::ICreateTexture( plBitmapData *bd, const plLocation &l else name = plString::Format( "%s*%x", temp, bd->texFlags ); if( bd->invertAlpha ) - name += _TEMP_CONVERT_FROM_LITERAL( "_inva" ); - name += _TEMP_CONVERT_FROM_LITERAL( ".hsm" ); + name += "_inva"; + name += ".hsm"; // Has this texture been used before? diff --git a/Sources/Tools/MaxMain/plTextureExportLog.cpp b/Sources/Tools/MaxMain/plTextureExportLog.cpp index de5578d7..f217c944 100644 --- a/Sources/Tools/MaxMain/plTextureExportLog.cpp +++ b/Sources/Tools/MaxMain/plTextureExportLog.cpp @@ -146,7 +146,7 @@ void plTextureExportLog::Write( void ) plRenderTarget* rend = plRenderTarget::ConvertNoRef( node->fBitmap ); // Name - IWriteTabbedString( stream, _TEMP_CONVERT_TO_CONST_CHAR( node->fBitmap->GetKeyName() ), dynText != nil ? 8 : 4 ); + IWriteTabbedString( stream, node->fBitmap->GetKeyName().c_str(), dynText != nil ? 8 : 4 ); // Size, formatted size = node->fBitmap->GetTotalSize(); diff --git a/Sources/Tools/MaxPlasmaMtls/Materials/plAnimStealthConvert.cpp b/Sources/Tools/MaxPlasmaMtls/Materials/plAnimStealthConvert.cpp index ef3c2ef8..2cae1609 100644 --- a/Sources/Tools/MaxPlasmaMtls/Materials/plAnimStealthConvert.cpp +++ b/Sources/Tools/MaxPlasmaMtls/Materials/plAnimStealthConvert.cpp @@ -83,7 +83,7 @@ static void ISearchLayerRecur( plLayerInterface *layer, const plString &segName, static int ISearchLayerRecur(hsGMaterial* mat, const plString &segName, hsTArray& keys) { - plString name = (segName.IsNull() || segName.Compare( ENTIRE_ANIMATION_NAME ) == 0 ) ? _TEMP_CONVERT_FROM_LITERAL( "" ) : segName; + plString name = ( segName.Compare( ENTIRE_ANIMATION_NAME ) == 0 ) ? "" : segName; int i; for( i = 0; i < mat->GetNumLayers(); i++ ) ISearchLayerRecur(mat->GetLayer(i), name, keys); diff --git a/Sources/Tools/MaxPlasmaMtls/Materials/plAnimStealthNode.cpp b/Sources/Tools/MaxPlasmaMtls/Materials/plAnimStealthNode.cpp index 34f9089c..1a1feebf 100644 --- a/Sources/Tools/MaxPlasmaMtls/Materials/plAnimStealthNode.cpp +++ b/Sources/Tools/MaxPlasmaMtls/Materials/plAnimStealthNode.cpp @@ -254,7 +254,7 @@ plString plAnimStealthNode::GetSegmentName( void ) const { const char *str = fParamBlock->GetStr( (ParamID)kPBName ); if( str == nil || str[ 0 ] == 0 ) - return _TEMP_CONVERT_FROM_LITERAL( ENTIRE_ANIMATION_NAME ); + return ENTIRE_ANIMATION_NAME; return plString::FromUtf8(str); } diff --git a/Sources/Tools/MaxPlasmaMtls/Materials/plBumpMtl.cpp b/Sources/Tools/MaxPlasmaMtls/Materials/plBumpMtl.cpp index 30777b73..3b2b7ebb 100644 --- a/Sources/Tools/MaxPlasmaMtls/Materials/plBumpMtl.cpp +++ b/Sources/Tools/MaxPlasmaMtls/Materials/plBumpMtl.cpp @@ -86,7 +86,7 @@ plBumpMtl::plBumpMtl(BOOL loading) : plPassMtlBase( loading ) // If we do this later (like, when the dialog loads) something blows up, // somewhere in Max. It didn't in 4, it does in 7. This seems to fix it. if (!loading) - IVerifyStealthPresent(_TEMP_CONVERT_FROM_LITERAL(ENTIRE_ANIMATION_NAME)); + IVerifyStealthPresent(ENTIRE_ANIMATION_NAME); } ParamDlg* plBumpMtl::CreateParamDlg(HWND hwMtlEdit, IMtlParams *imp) diff --git a/Sources/Tools/MaxPlasmaMtls/Materials/plDecalMtl.cpp b/Sources/Tools/MaxPlasmaMtls/Materials/plDecalMtl.cpp index add1dc60..49488fa7 100644 --- a/Sources/Tools/MaxPlasmaMtls/Materials/plDecalMtl.cpp +++ b/Sources/Tools/MaxPlasmaMtls/Materials/plDecalMtl.cpp @@ -93,7 +93,7 @@ plDecalMtl::plDecalMtl(BOOL loading) : plPassMtlBase( loading ) // If we do this later (like, when the dialog loads) something blows up, // somewhere in Max. It didn't in 4, it does in 7. This seems to fix it. if (!loading) - IVerifyStealthPresent(_TEMP_CONVERT_FROM_LITERAL(ENTIRE_ANIMATION_NAME)); + IVerifyStealthPresent(ENTIRE_ANIMATION_NAME); } ParamDlg* plDecalMtl::CreateParamDlg(HWND hwMtlEdit, IMtlParams *imp) diff --git a/Sources/Tools/MaxPlasmaMtls/Materials/plPassMtl.cpp b/Sources/Tools/MaxPlasmaMtls/Materials/plPassMtl.cpp index 2124c830..306b5eb6 100644 --- a/Sources/Tools/MaxPlasmaMtls/Materials/plPassMtl.cpp +++ b/Sources/Tools/MaxPlasmaMtls/Materials/plPassMtl.cpp @@ -96,7 +96,7 @@ plPassMtl::plPassMtl(BOOL loading) : plPassMtlBase( loading ) // If we do this later (like, when the dialog loads) something blows up, // somewhere in Max. It didn't in 4, it does in 7. This seems to fix it. if (!loading) - IVerifyStealthPresent(_TEMP_CONVERT_FROM_LITERAL(ENTIRE_ANIMATION_NAME)); + IVerifyStealthPresent(ENTIRE_ANIMATION_NAME); } plPassMtl::~plPassMtl() diff --git a/Sources/Tools/MaxPlasmaMtls/Materials/plPassMtlBase.cpp b/Sources/Tools/MaxPlasmaMtls/Materials/plPassMtlBase.cpp index 06c0b3c0..eaca018c 100644 --- a/Sources/Tools/MaxPlasmaMtls/Materials/plPassMtlBase.cpp +++ b/Sources/Tools/MaxPlasmaMtls/Materials/plPassMtlBase.cpp @@ -215,7 +215,7 @@ plAnimStealthNode *plPassMtlBase::IVerifyStealthPresent( const plString &animN // New segment, add a new stealth node stealth = (plAnimStealthNode *)GetCOREInterface()->CreateInstance( HELPER_CLASS_ID, ANIMSTEALTH_CLASSID ); INode *node = GetCOREInterface()->CreateObjectNode( stealth ); - stealth->SetSegment( ( animName.Compare(ENTIRE_ANIMATION_NAME) != 0 ) ? _TEMP_CONVERT_TO_CONST_CHAR(animName) : nil ); + stealth->SetSegment( ( animName.Compare(ENTIRE_ANIMATION_NAME) != 0 ) ? animName.c_str() : nil ); stealth->SetNodeName( GetName() ); node->Freeze( true ); @@ -277,7 +277,7 @@ void plPassMtlBase::IUpdateAnimNodes( void ) fStealthsChanged = false; // Verify one for "entire animation" - plAnimStealthNode *stealth = IVerifyStealthPresent( _TEMP_CONVERT_FROM_LITERAL(ENTIRE_ANIMATION_NAME) ); + plAnimStealthNode *stealth = IVerifyStealthPresent( ENTIRE_ANIMATION_NAME ); goodNodes.Append( stealth ); // Verify segment nodes @@ -519,7 +519,7 @@ void plPassMtlBase::PostLoadAnimPBFixup( void ) plAnimStealthNode *node = (plAnimStealthNode *)fAnimPB->GetReferenceTarget( (ParamID)kPBAnimStealthNodes, 0, i ); plString name = node->GetSegmentName(); node->SetAutoStart( false ); - node->SetLoop( true, _TEMP_CONVERT_FROM_LITERAL( ENTIRE_ANIMATION_NAME ) ); + node->SetLoop( true, ENTIRE_ANIMATION_NAME ); node->SetEaseIn( plAnimEaseTypes::kNoEase, 1.f, 1.f, 1.f ); node->SetEaseOut( plAnimEaseTypes::kNoEase, 1.f, 1.f, 1.f ); }