Browse Source

Alright, this _TEMP_CONVERT_ stuff was a stupid idea

Michael Hansen 12 years ago
parent
commit
b219c3c3cc
  1. 2
      Sources/Plasma/Apps/plClient/plClient.cpp
  2. 10
      Sources/Plasma/Apps/plClient/winmain.cpp
  3. 62
      Sources/Plasma/CoreLib/hsStream.cpp
  4. 12
      Sources/Plasma/CoreLib/hsStream.h
  5. 62
      Sources/Plasma/CoreLib/plGeneric.cpp
  6. 15
      Sources/Plasma/CoreLib/plGeneric.h
  7. 22
      Sources/Plasma/CoreLib/plString.h
  8. 6
      Sources/Plasma/FeatureLib/pfAnimation/plAnimDebugList.cpp
  9. 4
      Sources/Plasma/FeatureLib/pfCharacter/pfMarkerInfo.cpp
  10. 2
      Sources/Plasma/FeatureLib/pfConsole/pfAvatarConsoleCommands.cpp
  11. 2
      Sources/Plasma/FeatureLib/pfConsole/pfConsoleCommands.cpp
  12. 4
      Sources/Plasma/FeatureLib/pfConsole/pfConsoleCommandsNet.cpp
  13. 2
      Sources/Plasma/FeatureLib/pfGameGUIMgr/pfGUIDialogMod.cpp
  14. 2
      Sources/Plasma/FeatureLib/pfGameGUIMgr/pfGUIEditBoxMod.cpp
  15. 2
      Sources/Plasma/FeatureLib/pfGameGUIMgr/pfGUIMultiLineEditCtrl.cpp
  16. 26
      Sources/Plasma/FeatureLib/pfGameGUIMgr/pfGUITextBoxMod.cpp
  17. 5
      Sources/Plasma/FeatureLib/pfGameGUIMgr/pfGUITextBoxMod.h
  18. 4
      Sources/Plasma/FeatureLib/pfGameScoreMgr/pfGameScoreMgr.cpp
  19. 18
      Sources/Plasma/FeatureLib/pfJournalBook/pfJournalBook.cpp
  20. 15
      Sources/Plasma/FeatureLib/pfMessage/pfKIMsg.cpp
  21. 21
      Sources/Plasma/FeatureLib/pfMessage/pfKIMsg.h
  22. 4
      Sources/Plasma/FeatureLib/pfPython/cyMisc.cpp
  23. 28
      Sources/Plasma/FeatureLib/pfPython/plPythonFileMod.cpp
  24. 4
      Sources/Plasma/FeatureLib/pfPython/pyGameScoreMsg.cpp
  25. 4
      Sources/Plasma/FeatureLib/pfPython/pyImageGlue.cpp
  26. 8
      Sources/Plasma/FeatureLib/pfPython/pyJournalBook.h
  27. 2
      Sources/Plasma/FeatureLib/pfPython/pyPlayerGlue.cpp
  28. 2
      Sources/Plasma/FeatureLib/pfPython/pySceneObject.cpp
  29. 6
      Sources/Plasma/FeatureLib/pfPython/pyStatusLog.cpp
  30. 4
      Sources/Plasma/FeatureLib/pfPython/pyVault.cpp
  31. 2
      Sources/Plasma/NucleusLib/pnDispatch/plDispatch.cpp
  32. 2
      Sources/Plasma/NucleusLib/pnKeyedObject/hsKeyedObject.cpp
  33. 77
      Sources/Plasma/NucleusLib/pnKeyedObject/plFixedKey.cpp
  34. 2
      Sources/Plasma/NucleusLib/pnUUID/pnUUID_Unix.cpp
  35. 2
      Sources/Plasma/NucleusLib/pnUUID/pnUUID_Win32.cpp
  36. 4
      Sources/Plasma/PubUtilLib/plAudio/plSound.cpp
  37. 4
      Sources/Plasma/PubUtilLib/plAvatar/plAGApplicator.h
  38. 2
      Sources/Plasma/PubUtilLib/plAvatar/plAGMasterMod.cpp
  39. 2
      Sources/Plasma/PubUtilLib/plAvatar/plAnimStage.cpp
  40. 16
      Sources/Plasma/PubUtilLib/plAvatar/plArmatureMod.cpp
  41. 4
      Sources/Plasma/PubUtilLib/plAvatar/plAvBrainClimb.cpp
  42. 2
      Sources/Plasma/PubUtilLib/plAvatar/plAvBrainCritter.cpp
  43. 2
      Sources/Plasma/PubUtilLib/plAvatar/plAvBrainHuman.cpp
  44. 2
      Sources/Plasma/PubUtilLib/plAvatar/plAvTaskSeek.cpp
  45. 6
      Sources/Plasma/PubUtilLib/plAvatar/plAvatarMgr.cpp
  46. 4
      Sources/Plasma/PubUtilLib/plAvatar/plAvatarTasks.cpp
  47. 2
      Sources/Plasma/PubUtilLib/plAvatar/plSittingModifier.cpp
  48. 4
      Sources/Plasma/PubUtilLib/plDrawable/plProxyGen.cpp
  49. 2
      Sources/Plasma/PubUtilLib/plGImage/plMipmap.cpp
  50. 2
      Sources/Plasma/PubUtilLib/plInputCore/plInputDevice.h
  51. 20
      Sources/Plasma/PubUtilLib/plMessage/plAnimCmdMsg.cpp
  52. 12
      Sources/Plasma/PubUtilLib/plMessage/plAnimCmdMsg.h
  53. 4
      Sources/Plasma/PubUtilLib/plMessage/plDynamicTextMsg.cpp
  54. 2
      Sources/Plasma/PubUtilLib/plModifier/plCloneSpawnModifier.cpp
  55. 2
      Sources/Plasma/PubUtilLib/plModifier/plResponderModifier.cpp
  56. 2
      Sources/Plasma/PubUtilLib/plNetClient/plNetCliAgeJoiner.cpp
  57. 2
      Sources/Plasma/PubUtilLib/plNetClient/plNetClientMgrSend.cpp
  58. 8
      Sources/Plasma/PubUtilLib/plNetClient/plNetClientMgrShow.cpp
  59. 6
      Sources/Plasma/PubUtilLib/plNetClient/plNetLinkingMgr.cpp
  60. 2
      Sources/Plasma/PubUtilLib/plNetClient/plNetObjectDebugger.cpp
  61. 4
      Sources/Plasma/PubUtilLib/plNetCommon/plNetServerSessionInfo.cpp
  62. 14
      Sources/Plasma/PubUtilLib/plNetGameLib/Private/plNglAuth.cpp
  63. 2
      Sources/Plasma/PubUtilLib/plNetMessage/plNetMessage.cpp
  64. 2
      Sources/Plasma/PubUtilLib/plNetMessage/plNetMsgHelpers.cpp
  65. 2
      Sources/Plasma/PubUtilLib/plNetTransport/plNetTransportMember.cpp
  66. 4
      Sources/Plasma/PubUtilLib/plPhysX/plPXPhysical.cpp
  67. 8
      Sources/Plasma/PubUtilLib/plPhysical/plPhysicalSDLModifier.cpp
  68. 6
      Sources/Plasma/PubUtilLib/plPipeline/plDXPipeline.cpp
  69. 6
      Sources/Plasma/PubUtilLib/plResMgr/plKeyFinder.cpp
  70. 8
      Sources/Plasma/PubUtilLib/plResMgr/plResManager.cpp
  71. 6
      Sources/Plasma/PubUtilLib/plSDL/plStateDataRecord.cpp
  72. 2
      Sources/Plasma/PubUtilLib/plSDL/plStateVariable.cpp
  73. 10
      Sources/Plasma/PubUtilLib/plScene/plRelevanceMgr.cpp
  74. 12
      Sources/Plasma/PubUtilLib/plStatGather/plAutoProfile.cpp
  75. 8
      Sources/Plasma/PubUtilLib/plStatusLog/plLoggable.cpp
  76. 2
      Sources/Plasma/PubUtilLib/plSurface/hsGMaterial.cpp
  77. 4
      Sources/Tools/MaxComponent/plAnimComponent.cpp
  78. 8
      Sources/Tools/MaxComponent/plAudioComponents.cpp
  79. 6
      Sources/Tools/MaxComponent/plAvatarComponent.cpp
  80. 2
      Sources/Tools/MaxComponent/plClickDragComponent.cpp
  81. 2
      Sources/Tools/MaxComponent/plFootstepComponent.cpp
  82. 4
      Sources/Tools/MaxComponent/plGUIComponents.cpp
  83. 4
      Sources/Tools/MaxComponent/plMaxAnimUtils.cpp
  84. 6
      Sources/Tools/MaxComponent/plPythonFileComponent.cpp
  85. 3
      Sources/Tools/MaxComponent/plResponderMtl.cpp
  86. 2
      Sources/Tools/MaxConvert/hsControlConverter.cpp
  87. 2
      Sources/Tools/MaxConvert/hsConverterUtils.cpp
  88. 30
      Sources/Tools/MaxConvert/hsMaterialConverter.cpp
  89. 4
      Sources/Tools/MaxConvert/plBitmapCreator.cpp
  90. 2
      Sources/Tools/MaxMain/plTextureExportLog.cpp
  91. 2
      Sources/Tools/MaxPlasmaMtls/Materials/plAnimStealthConvert.cpp
  92. 2
      Sources/Tools/MaxPlasmaMtls/Materials/plAnimStealthNode.cpp
  93. 2
      Sources/Tools/MaxPlasmaMtls/Materials/plBumpMtl.cpp
  94. 2
      Sources/Tools/MaxPlasmaMtls/Materials/plDecalMtl.cpp
  95. 2
      Sources/Tools/MaxPlasmaMtls/Materials/plPassMtl.cpp
  96. 6
      Sources/Tools/MaxPlasmaMtls/Materials/plPassMtlBase.cpp

2
Sources/Plasma/Apps/plClient/plClient.cpp

@ -1286,7 +1286,7 @@ void plClient::IRoomUnloaded(plSceneNode* node)
void plClient::IReadKeyedObjCallback(plKey key) void plClient::IReadKeyedObjCallback(plKey key)
{ {
fInstance->IIncProgress(1, _TEMP_CONVERT_TO_CONST_CHAR(key->GetName())); fInstance->IIncProgress(1, key->GetName().c_str());
} }
//============================================================================ //============================================================================

10
Sources/Plasma/Apps/plClient/winmain.cpp

@ -998,15 +998,15 @@ static void SaveUserPass (LoginDialogParam *pLoginParam, char *password)
memset(cryptKey, 0, sizeof(cryptKey)); memset(cryptKey, 0, sizeof(cryptKey));
GetCryptKey(cryptKey, arrsize(cryptKey)); GetCryptKey(cryptKey, arrsize(cryptKey));
plString theUser = _TEMP_CONVERT_FROM_LITERAL(pLoginParam->username); plString theUser = pLoginParam->username;
plString thePass = (_TEMP_CONVERT_FROM_LITERAL(password)).Left(kMaxPasswordLength); plString thePass = plString(password).Left(kMaxPasswordLength);
// if the password field is the fake string then we've already // if the password field is the fake string then we've already
// loaded the namePassHash from the file // loaded the namePassHash from the file
if (thePass.Compare(FAKE_PASS_STRING) != 0) if (thePass.Compare(FAKE_PASS_STRING) != 0)
{ {
wchar_t domain[15]; 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) { if (StrLen(domain) == 0 || StrCmpI(domain, L"gametap") == 0) {
plSHA1Checksum shasum(StrLen(password) * sizeof(password[0]), (uint8_t*)password); 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) if (TGIsCider)
NetCommSetAuthTokenAndOS(nil, L"mac"); NetCommSetAuthTokenAndOS(nil, L"mac");
else 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 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); GetAuthSrvHostnames(&addrs);
if(strlen(addrs[0])) if(strlen(addrs[0]))

62
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() ); return Write( buf.length(), buf.data() );
} }
uint32_t hsStream::WriteSafeStringLong(const char *string) uint32_t hsStream::WriteSafeStringLong(const plString &string)
{ {
uint32_t len = 0; uint32_t len = string.GetSize();
if (string)
len = strlen(string);
WriteLE32(len); WriteLE32(len);
if (len > 0) if (len > 0)
{ {
char *buff = new char[len+1]; const char *buffp = string.c_str();
int i; int i;
for (i = 0; i < len; i++) for (i = 0; i < len; i++)
{ {
buff[i] = ~string[i]; WriteByte(~buffp[i]);
} }
buff[len] = '\0'; return static_cast<uint32_t>(i);
uint32_t result = Write(len, buff);
delete [] buff;
return result;
} }
else else
return 0; return 0;
} }
uint32_t hsStream::WriteSafeWStringLong(const wchar_t *string) uint32_t hsStream::WriteSafeWStringLong(const plString &string)
{ {
uint32_t len = wcslen(string); plStringBuffer<wchar_t> wbuff = string.ToWchar();
uint32_t len = wbuff.GetSize();
WriteLE32(len); WriteLE32(len);
if (len > 0) if (len > 0)
{ {
int i; int i;
const wchar_t *buffp = wbuff.GetData();
for (i=0; i<len; i++) for (i=0; i<len; i++)
{ {
wchar_t buff = ~string[i]; WriteLE16((uint16_t)~buffp[i]);
WriteLE16((uint16_t)buff);
} }
WriteLE16((uint16_t)L'\0'); WriteLE16((uint16_t)L'\0');
} }
@ -224,35 +220,31 @@ wchar_t *hsStream::ReadSafeWStringLong()
return retVal; return retVal;
} }
uint32_t hsStream::WriteSafeString(const char *string) uint32_t hsStream::WriteSafeString(const plString &string)
{ {
int len = 0; int len = string.GetSize();
if (string) hsAssert(len<0xf000, plString::Format("string len of %d is too long for WriteSafeString %s, use WriteSafeStringLong",
len = strlen(string); len, string.c_str()).c_str() );
hsAssert(len<0xf000, xtl::format("string len of %d is too long for WriteSafeString %s, use WriteSafeStringLong",
string, len).c_str() );
WriteLE16(len | 0xf000); WriteLE16(len | 0xf000);
if (len > 0) if (len > 0)
{ {
char *buff = new char[len+1];
int i; int i;
const char *buffp = string.c_str();
for (i = 0; i < len; i++) for (i = 0; i < len; i++)
{ {
buff[i] = ~string[i]; WriteByte(~buffp[i]);
} }
buff[len] = '\0'; return static_cast<uint32_t>(i);
uint32_t result = Write(len, buff);
delete [] buff;
return result;
} }
else else
return 0; return 0;
} }
uint32_t hsStream::WriteSafeWString(const wchar_t *string) uint32_t hsStream::WriteSafeWString(const plString &string)
{ {
int len = wcslen(string); plStringBuffer<wchar_t> wbuff = string.ToWchar();
int len = wbuff.GetSize();
hsAssert(len<0xf000, xtl::format("string len of %d is too long for WriteSafeWString, use WriteSafeWStringLong", hsAssert(len<0xf000, xtl::format("string len of %d is too long for WriteSafeWString, use WriteSafeWStringLong",
len).c_str() ); len).c_str() );
@ -260,10 +252,10 @@ uint32_t hsStream::WriteSafeWString(const wchar_t *string)
if (len > 0) if (len > 0)
{ {
int i; int i;
const wchar_t *buffp = wbuff.GetData();
for (i=0; i<len; i++) for (i=0; i<len; i++)
{ {
wchar_t buff = ~string[i]; WriteLE16((uint16_t)~buffp[i]);
WriteLE16((uint16_t)buff);
} }
WriteLE16((uint16_t)L'\0'); WriteLE16((uint16_t)L'\0');
} }
@ -328,16 +320,6 @@ wchar_t *hsStream::ReadSafeWString()
return retVal; return retVal;
} }
uint32_t hsStream::WriteSafeString(const plString &string)
{
return WriteSafeString(_TEMP_CONVERT_TO_CONST_CHAR(string));
}
uint32_t hsStream::WriteSafeWString(const plString &string)
{
return WriteSafeWString(_TEMP_CONVERT_TO_WCHAR_T(string));
}
plString hsStream::ReadSafeString_TEMP() plString hsStream::ReadSafeString_TEMP()
{ {
char *buffer = ReadSafeString(); char *buffer = ReadSafeString();

12
Sources/Plasma/CoreLib/hsStream.h

@ -124,22 +124,20 @@ public:
virtual bool IsCompressed() { return false; } virtual bool IsCompressed() { return false; }
uint32_t WriteString(const char cstring[]); uint32_t WriteString(const char cstring[]);
uint32_t WriteString(const plString & string) { return WriteString(_TEMP_CONVERT_TO_CONST_CHAR(string)); } uint32_t WriteString(const plString & string) { return WriteString(string.c_str()); }
uint32_t WriteFmt(const char * fmt, ...); uint32_t WriteFmt(const char * fmt, ...);
uint32_t WriteFmtV(const char * fmt, va_list av); uint32_t WriteFmtV(const char * fmt, va_list av);
uint32_t WriteSafeStringLong(const char *string); // uses 4 bytes for length uint32_t WriteSafeStringLong(const plString &string); // uses 4 bytes for length
uint32_t WriteSafeWStringLong(const wchar_t *string); uint32_t WriteSafeWStringLong(const plString &string);
char * ReadSafeStringLong(); char * ReadSafeStringLong();
wchar_t * ReadSafeWStringLong(); wchar_t * ReadSafeWStringLong();
uint32_t WriteSafeString(const char *string); // uses 2 bytes for length uint32_t WriteSafeString(const plString &string); // uses 2 bytes for length
uint32_t WriteSafeWString(const wchar_t *string); uint32_t WriteSafeWString(const plString &string);
char * ReadSafeString(); char * ReadSafeString();
wchar_t * ReadSafeWString(); wchar_t * ReadSafeWString();
uint32_t WriteSafeString(const plString &string); // uses 2 bytes for length
uint32_t WriteSafeWString(const plString &string);
plString ReadSafeString_TEMP(); plString ReadSafeString_TEMP();
plString ReadSafeWString_TEMP(); plString ReadSafeWString_TEMP();

62
Sources/Plasma/CoreLib/plGeneric.cpp

@ -50,24 +50,7 @@ plGeneric::plGeneric(const int& val): fType(kInt), fBoolVal(false), fIntVal(val)
plGeneric::plGeneric(const double& val): fType(kFloat), fBoolVal(false), fIntVal(0), fFloatVal(val) {} plGeneric::plGeneric(const double& val): fType(kFloat), fBoolVal(false), fIntVal(0), fFloatVal(val) {}
plGeneric::plGeneric(const char* val): fType(kString), fBoolVal(false), fIntVal(0), fFloatVal(0.0) plGeneric::plGeneric(const plString& val): fType(kString), fBoolVal(false), fIntVal(0), fFloatVal(0.0),
{
wchar_t* temp = hsStringToWString(val);
fStringVal = temp;
delete [] temp;
}
plGeneric::plGeneric(const std::string& val): fType(kString), fBoolVal(false), fIntVal(0), fFloatVal(0.0)
{
wchar_t* temp = hsStringToWString(val.c_str());
fStringVal = temp;
delete [] temp;
}
plGeneric::plGeneric(const wchar_t* val): fType(kString), fBoolVal(false), fIntVal(0), fFloatVal(0.0),
fStringVal(val) {}
plGeneric::plGeneric(const std::wstring& val): fType(kString), fBoolVal(false), fIntVal(0), fFloatVal(0.0),
fStringVal(val) {} fStringVal(val) {}
void plGeneric::IReset() void plGeneric::IReset()
@ -76,7 +59,7 @@ void plGeneric::IReset()
fBoolVal = false; fBoolVal = false;
fIntVal = 0; fIntVal = 0;
fFloatVal = 0.0; fFloatVal = 0.0;
fStringVal = L""; fStringVal = plString();
} }
plGeneric& plGeneric::operator=(const bool& val) plGeneric& plGeneric::operator=(const bool& val)
@ -103,35 +86,7 @@ plGeneric& plGeneric::operator=(const double& val)
return *this; return *this;
} }
plGeneric& plGeneric::operator=(const char* val) plGeneric& plGeneric::operator=(const plString& val)
{
IReset();
fType = kString;
wchar_t* temp = hsStringToWString(val);
fStringVal = temp;
delete [] temp;
return *this;
}
plGeneric& plGeneric::operator=(const std::string& val)
{
IReset();
fType = kString;
wchar_t* temp = hsStringToWString(val.c_str());
fStringVal = temp;
delete [] temp;
return *this;
}
plGeneric& plGeneric::operator=(const wchar_t* val)
{
IReset();
fType = kString;
fStringVal = val;
return *this;
}
plGeneric& plGeneric::operator=(const std::wstring& val)
{ {
IReset(); IReset();
fType = kString; fType = kString;
@ -161,7 +116,7 @@ int plGeneric::Write(hsStream* stream)
break; break;
case kString: case kString:
stream->WriteSafeWString(fStringVal.c_str()); stream->WriteSafeWString(fStringVal);
break; break;
} }
return stream->GetPosition(); return stream->GetPosition();
@ -189,14 +144,7 @@ int plGeneric::Read(hsStream* stream)
break; break;
case kString: case kString:
{ fStringVal = stream->ReadSafeWString_TEMP();
wchar_t* temp = stream->ReadSafeWString();
if (temp)
{
fStringVal = temp;
delete [] temp;
}
}
break; break;
} }
return stream->GetPosition(); return stream->GetPosition();

15
Sources/Plasma/CoreLib/plGeneric.h

@ -62,7 +62,7 @@ private:
bool fBoolVal; bool fBoolVal;
int fIntVal; int fIntVal;
double fFloatVal; double fFloatVal;
std::wstring fStringVal; plString fStringVal;
void IReset(); void IReset();
@ -71,19 +71,13 @@ public:
plGeneric(const bool& val); plGeneric(const bool& val);
plGeneric(const int& val); plGeneric(const int& val);
plGeneric(const double& val); plGeneric(const double& val);
plGeneric(const char* val); plGeneric(const plString& val);
plGeneric(const std::string& val);
plGeneric(const wchar_t* val);
plGeneric(const std::wstring& val);
void SetToNull() {IReset();} void SetToNull() {IReset();}
plGeneric& operator=(const bool& val); plGeneric& operator=(const bool& val);
plGeneric& operator=(const int& val); plGeneric& operator=(const int& val);
plGeneric& operator=(const double& val); plGeneric& operator=(const double& val);
plGeneric& operator=(const char* val); plGeneric& operator=(const plString& val);
plGeneric& operator=(const std::string& val);
plGeneric& operator=(const wchar_t* val);
plGeneric& operator=(const std::wstring& val);
// the cast functions will NOT cast from one type to another, use // 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 // GetType() to determine the type of parameter, then cast it to that type
@ -91,8 +85,7 @@ public:
operator bool() const {return fBoolVal;} operator bool() const {return fBoolVal;}
operator int() const {return fIntVal;} operator int() const {return fIntVal;}
operator double() const {return fFloatVal;} operator double() const {return fFloatVal;}
operator const wchar_t*() const {return fStringVal.c_str();} operator plString() const {return fStringVal;}
operator std::wstring() const {return fStringVal;}
int Write(hsStream* stream); int Write(hsStream* stream);
int Read(hsStream* stream); int Read(hsStream* stream);

22
Sources/Plasma/CoreLib/plString.h

@ -46,16 +46,6 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
#include "HeadSpin.h" #include "HeadSpin.h"
#include <stddef.h> #include <stddef.h>
/* 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; typedef unsigned int UniChar;
#define SSO_CHARS (16) #define SSO_CHARS (16)
@ -173,13 +163,15 @@ private:
public: public:
plString() { } plString() { }
//plString(const char *utf8) { IConvertFromUtf8(utf8, kSizeAuto, false); } #ifndef PLSTRING_POLLUTE_ASCII_CAST
//plString(const wchar_t *wstr) { IConvertFromWchar(wstr, kSizeAuto); } plString(const char *ascii) { IConvertFromUtf8(ascii, kSizeAuto); }
#endif
plString(const plString &copy) : fUtf8Buffer(copy.fUtf8Buffer) { } plString(const plString &copy) : fUtf8Buffer(copy.fUtf8Buffer) { }
plString(const plStringBuffer<char> &init) { operator=(init); } plString(const plStringBuffer<char> &init) { operator=(init); }
//plString &operator=(const char *utf8) { IConvertFromUtf8(utf8, kSizeAuto, false); return *this; } #ifndef PLSTRING_POLLUTE_ASCII_CAST
//plString &operator=(const wchar_t *wstr) { IConvertFromWchar(wstr, kSizeAuto); return *this; } plString &operator=(const char *ascii) { IConvertFromUtf8(ascii, kSizeAuto); return *this; }
#endif
plString &operator=(const plString &copy) { fUtf8Buffer = copy.fUtf8Buffer; return *this; } plString &operator=(const plString &copy) { fUtf8Buffer = copy.fUtf8Buffer; return *this; }
plString &operator=(const plStringBuffer<char> &init); plString &operator=(const plStringBuffer<char> &init);
@ -213,8 +205,10 @@ public:
return str; return str;
} }
#ifndef PLSTRING_POLLUTE_C_STR
const char *c_str(const char *substitute = "") const const char *c_str(const char *substitute = "") const
{ return IsEmpty() ? substitute : fUtf8Buffer.GetData(); } { return IsEmpty() ? substitute : fUtf8Buffer.GetData(); }
#endif
char CharAt(size_t position) const { return c_str()[position]; } char CharAt(size_t position) const { return c_str()[position]; }

6
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(), str = plString::Format("%s: %s %.3f (%.3f)", mat->GetKeyName().c_str(), layerAnim->GetKeyName().c_str(),
layerAnim->GetTimeConvert().CurrentAnimTime(), layerAnim->GetTimeConvert().CurrentAnimTime(),
layerAnim->GetTimeConvert().WorldToAnimTimeNoUpdate(hsTimer::GetSysSeconds())); layerAnim->GetTimeConvert().WorldToAnimTimeNoUpdate(hsTimer::GetSysSeconds()));
txt.DrawString(x, y, _TEMP_CONVERT_TO_CONST_CHAR(str)); txt.DrawString(x, y, str.c_str());
y += yOff; y += yOff;
} }
layer = layer->GetOverLay(); layer = layer->GetOverLay();
@ -149,7 +149,7 @@ void plAnimDebugList::ShowReport()
continue; continue;
str = plString::Format(" %s", so->GetKeyName().c_str()); 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; y += yOff;
for (j = 0; j < mod->GetNumATCAnimations(); j++) 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(), str = plString::Format(" %s: %.3f (%.3f)", anim->GetAnimation()->GetName().c_str(),
anim->GetTimeConvert()->CurrentAnimTime(), anim->GetTimeConvert()->CurrentAnimTime(),
anim->GetTimeConvert()->WorldToAnimTimeNoUpdate(hsTimer::GetSysSeconds())); anim->GetTimeConvert()->WorldToAnimTimeNoUpdate(hsTimer::GetSysSeconds()));
txt.DrawString(x, y, _TEMP_CONVERT_TO_CONST_CHAR(str)); txt.DrawString(x, y, str.c_str());
y += yOff; y += yOff;
} }
} }

4
Sources/Plasma/FeatureLib/pfCharacter/pfMarkerInfo.cpp

@ -77,7 +77,7 @@ void pfMarkerInfo::Init()
plLocation markerLoc = plKeyFinder::Instance().FindLocation("GlobalMarkers", "Markers"); plLocation markerLoc = plKeyFinder::Instance().FindLocation("GlobalMarkers", "Markers");
if (markerLoc.IsValid()) if (markerLoc.IsValid())
fMarkerUoid = plUoid(markerLoc, plSceneObject::Index(), _TEMP_CONVERT_FROM_LITERAL("MarkerRoot")); fMarkerUoid = plUoid(markerLoc, plSceneObject::Index(), "MarkerRoot");
else else
fMarkerUoid.Invalidate(); fMarkerUoid.Invalidate();
} }
@ -101,7 +101,7 @@ void pfMarkerInfo::Spawn(MarkerType type)
plLocation markerLoc = plKeyFinder::Instance().FindLocation("GlobalMarkers", "Markers"); plLocation markerLoc = plKeyFinder::Instance().FindLocation("GlobalMarkers", "Markers");
if (markerLoc.IsValid()) if (markerLoc.IsValid())
fMarkerUoid = plUoid(markerLoc, plSceneObject::Index(), _TEMP_CONVERT_FROM_LITERAL("MarkerRoot")); fMarkerUoid = plUoid(markerLoc, plSceneObject::Index(), "MarkerRoot");
else else
{ {
hsAssert(false, "Unable to spawn markers because the marker age was not loaded or found"); hsAssert(false, "Unable to spawn markers because the marker age was not loaded or found");

2
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); const plSpawnModifier * spawn = mgr->GetSpawnPoint(i);
if(spawn) if(spawn)
{ {
plString soName = _TEMP_CONVERT_FROM_LITERAL("(none)"); plString soName = "(none)";
if (spawn->GetNumTargets() > 0) if (spawn->GetNumTargets() > 0)
{ {

2
Sources/Plasma/FeatureLib/pfConsole/pfConsoleCommands.cpp

@ -6980,7 +6980,7 @@ PF_CONSOLE_CMD( Python,
args = plString::Format("(%s,)", tmp); args = plString::Format("(%s,)", tmp);
} }
else else
args = _TEMP_CONVERT_FROM_LITERAL("()"); args = "()";
PythonInterface::RunFunctionSafe("xCheat", params[0], args.c_str()); PythonInterface::RunFunctionSafe("xCheat", params[0], args.c_str());

4
Sources/Plasma/FeatureLib/pfConsole/pfConsoleCommandsNet.cpp

@ -231,12 +231,12 @@ PF_CONSOLE_CMD( Net, // groupName
{ {
// send chat text // send chat text
plString text=plNetClientMgr::GetInstance()->GetPlayerName(); plString text=plNetClientMgr::GetInstance()->GetPlayerName();
text += _TEMP_CONVERT_FROM_LITERAL(":"); text += ":";
int i; int i;
for(i=0;i<numParams;i++) for(i=0;i<numParams;i++)
{ {
text += plString::FromUtf8( (char*)params[i] ); text += plString::FromUtf8( (char*)params[i] );
text += _TEMP_CONVERT_FROM_LITERAL(" "); text += " ";
} }
plConsoleMsg *cMsg = new plConsoleMsg( plConsoleMsg::kAddLine, text.c_str() ); plConsoleMsg *cMsg = new plConsoleMsg( plConsoleMsg::kAddLine, text.c_str() );
cMsg->SetBCastFlag(plMessage::kNetPropagate | plMessage::kNetForce); cMsg->SetBCastFlag(plMessage::kNetPropagate | plMessage::kNetForce);

2
Sources/Plasma/FeatureLib/pfGameGUIMgr/pfGUIDialogMod.cpp

@ -498,7 +498,7 @@ static bool showBounds = false;
if( showBounds ) if( showBounds )
{ {
const hsBounds3 &bnds = fMousedCtrl->GetBounds(); 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 #endif

2
Sources/Plasma/FeatureLib/pfGameGUIMgr/pfGUIEditBoxMod.cpp

@ -388,7 +388,7 @@ bool pfGUIEditBoxMod::HandleKeyEvent( pfGameGUIMgr::EventType event, plKeyDef
{ {
if (key == KEY_C) if (key == KEY_C)
{ {
plClipboard::GetInstance().SetClipboardText(_TEMP_CONVERT_FROM_WCHAR_T(fBuffer)); plClipboard::GetInstance().SetClipboardText(plString::FromWchar(fBuffer));
} }
else if (key == KEY_V) else if (key == KEY_V)
{ {

2
Sources/Plasma/FeatureLib/pfGameGUIMgr/pfGUIMultiLineEditCtrl.cpp

@ -1113,7 +1113,7 @@ bool pfGUIMultiLineEditCtrl::HandleKeyEvent( pfGameGUIMgr::EventType event, p
// Too lazy to worry about that... // Too lazy to worry about that...
if (key == KEY_C) 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) else if (key == KEY_V)
{ {

26
Sources/Plasma/FeatureLib/pfGameGUIMgr/pfGUITextBoxMod.cpp

@ -121,8 +121,8 @@ void pfGUITextBoxMod::IUpdate( void )
fDynTextMap->ClearToColor( GetColorScheme()->fBackColor ); fDynTextMap->ClearToColor( GetColorScheme()->fBackColor );
std::wstring drawStr; std::wstring drawStr;
if (fUseLocalizationPath && !fLocalizationPath.empty() && pfLocalizationMgr::InstanceValid()) if (fUseLocalizationPath && !fLocalizationPath.IsEmpty() && pfLocalizationMgr::InstanceValid())
drawStr = pfLocalizationMgr::Instance().GetString(fLocalizationPath.c_str()); drawStr = pfLocalizationMgr::Instance().GetString(fLocalizationPath.ToWchar().GetData());
else else
{ {
if( fText != nil ) if( fText != nil )
@ -170,9 +170,7 @@ void pfGUITextBoxMod::Read( hsStream *s, hsResMgr *mgr )
fUseLocalizationPath = s->ReadBool(); fUseLocalizationPath = s->ReadBool();
if (fUseLocalizationPath) if (fUseLocalizationPath)
{ {
wchar_t* temp = s->ReadSafeWString(); fLocalizationPath = s->ReadSafeWString_TEMP();
fLocalizationPath = temp;
delete [] 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 // Make sure we only write out to use localization path if the box is checked
// and the path isn't empty // and the path isn't empty
bool useLoc = fUseLocalizationPath && !fLocalizationPath.empty(); bool useLoc = fUseLocalizationPath && !fLocalizationPath.IsEmpty();
s->WriteBool(useLoc); s->WriteBool(useLoc);
if (useLoc) if (useLoc)
s->WriteSafeWString(fLocalizationPath.c_str()); s->WriteSafeWString(fLocalizationPath);
} }
//// HandleMouseDown/Up ////////////////////////////////////////////////////// //// HandleMouseDown/Up //////////////////////////////////////////////////////
@ -240,22 +238,12 @@ void pfGUITextBoxMod::SetText( const wchar_t *text )
IUpdate(); IUpdate();
} }
void pfGUITextBoxMod::SetLocalizationPath(const wchar_t* path) void pfGUITextBoxMod::SetLocalizationPath(const plString& path)
{ {
if (path) if (!path.IsNull())
fLocalizationPath = path; fLocalizationPath = path;
} }
void pfGUITextBoxMod::SetLocalizationPath(const char* path)
{
if (path)
{
wchar_t* wPath = hsStringToWString(path);
fLocalizationPath = wPath;
delete [] wPath;
}
}
void pfGUITextBoxMod::SetUseLocalizationPath(bool use) void pfGUITextBoxMod::SetUseLocalizationPath(bool use)
{ {
fUseLocalizationPath = use; fUseLocalizationPath = use;

5
Sources/Plasma/FeatureLib/pfGameGUIMgr/pfGUITextBoxMod.h

@ -59,7 +59,7 @@ class pfGUITextBoxMod : public pfGUIControlMod
protected: protected:
wchar_t *fText; wchar_t *fText;
std::wstring fLocalizationPath; plString fLocalizationPath;
bool fUseLocalizationPath; bool fUseLocalizationPath;
@ -99,8 +99,7 @@ class pfGUITextBoxMod : public pfGUIControlMod
void SetText( const char *text ); void SetText( const char *text );
void SetText( const wchar_t *text ); void SetText( const wchar_t *text );
void SetLocalizationPath(const wchar_t* path); void SetLocalizationPath(const plString& path);
void SetLocalizationPath(const char* path);
void SetUseLocalizationPath(bool use); void SetUseLocalizationPath(bool use);
virtual void UpdateColorScheme() { IPostSetUpDynTextMap(); IUpdate(); } virtual void UpdateColorScheme() { IPostSetUpDynTextMap(); IUpdate(); }

4
Sources/Plasma/FeatureLib/pfGameScoreMgr/pfGameScoreMgr.cpp

@ -143,7 +143,7 @@ static void OnScoreCreate(
int32_t value int32_t value
) { ) {
ScoreUpdateParam* p = (ScoreUpdateParam*)param; 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); pfGameScoreUpdateMsg* msg = new pfGameScoreUpdateMsg(result, score, value);
msg->Send(p->fReceiver); msg->Send(p->fReceiver);
delete p; delete p;
@ -165,7 +165,7 @@ static void OnScoreFound(
for (uint32_t i = 0; i < scoreCount; ++i) for (uint32_t i = 0; i < scoreCount; ++i)
{ {
const NetGameScore ngs = scores[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; ScoreFindParam* p = (ScoreFindParam*)param;

18
Sources/Plasma/FeatureLib/pfJournalBook/pfJournalBook.cpp

@ -472,7 +472,7 @@ pfBookData::pfBookData(const plString &guiName /* = nil */)
if (!guiName.IsEmpty()) if (!guiName.IsEmpty())
fGUIName = guiName; fGUIName = guiName;
else else
fGUIName = _TEMP_CONVERT_FROM_LITERAL("BkBook"); fGUIName = "BkBook";
} }
pfBookData::~pfBookData() pfBookData::~pfBookData()
@ -1140,9 +1140,9 @@ std::map<plString,pfBookData*> pfJournalBook::fBookGUIs;
void pfJournalBook::SingletonInit( void ) void pfJournalBook::SingletonInit( void )
{ {
fBookGUIs[_TEMP_CONVERT_FROM_LITERAL("BkBook")] = new pfBookData(); // load the default book data object fBookGUIs["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()); hsgResMgr::ResMgr()->NewKey("BkBook",fBookGUIs["BkBook"],pfGameGUIMgr::GetInstance()->GetKey()->GetUoid().GetLocation());
fBookGUIs[_TEMP_CONVERT_FROM_LITERAL("BkBook")]->LoadGUI(); fBookGUIs["BkBook"]->LoadGUI();
} }
void pfJournalBook::SingletonShutdown( void ) void pfJournalBook::SingletonShutdown( void )
@ -1207,7 +1207,7 @@ pfJournalBook::pfJournalBook( const char *esHTMLSource, plKey coverImageKey, plK
if (!guiName.IsEmpty()) if (!guiName.IsEmpty())
fCurBookGUI = guiName; fCurBookGUI = guiName;
else else
fCurBookGUI = _TEMP_CONVERT_FROM_LITERAL("BkBook"); fCurBookGUI = "BkBook";
if (fBookGUIs.find(fCurBookGUI) == fBookGUIs.end()) if (fBookGUIs.find(fCurBookGUI) == fBookGUIs.end())
{ {
fBookGUIs[fCurBookGUI] = new pfBookData(fCurBookGUI); fBookGUIs[fCurBookGUI] = new pfBookData(fCurBookGUI);
@ -1243,7 +1243,7 @@ pfJournalBook::pfJournalBook( const wchar_t *esHTMLSource, plKey coverImageKey,
if (!guiName.IsEmpty()) if (!guiName.IsEmpty())
fCurBookGUI = guiName; fCurBookGUI = guiName;
else else
fCurBookGUI = _TEMP_CONVERT_FROM_LITERAL("BkBook"); fCurBookGUI = "BkBook";
if (fBookGUIs.find(fCurBookGUI) == fBookGUIs.end()) if (fBookGUIs.find(fCurBookGUI) == fBookGUIs.end())
{ {
fBookGUIs[fCurBookGUI] = new pfBookData(fCurBookGUI); fBookGUIs[fCurBookGUI] = new pfBookData(fCurBookGUI);
@ -1292,7 +1292,7 @@ void pfJournalBook::SetGUI( const plString &guiName )
if (!guiName.IsEmpty()) if (!guiName.IsEmpty())
fCurBookGUI = guiName; fCurBookGUI = guiName;
if (fBookGUIs.find(fCurBookGUI) == fBookGUIs.end()) 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 SetEditable(fWantEditing); // make sure that if we want editing, to set it
ICompileSource(fUncompiledSource.c_str(), fDefLoc); // recompile the source to be safe 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 // facilitate fast prototyping
plMipmap *mip; plMipmap *mip;
if( cName.Find( ".png" ) >= 0 ) if( cName.Find( ".png" ) >= 0 )
mip = plPNG::Instance().ReadFromFile( _TEMP_CONVERT_TO_CONST_CHAR( cName ) ); mip = plPNG::Instance().ReadFromFile( cName.c_str() );
else else
mip = plJPEG::Instance().ReadFromFile( _TEMP_CONVERT_TO_CONST_CHAR( cName ) ); mip = plJPEG::Instance().ReadFromFile( cName.c_str() );
hsgResMgr::ResMgr()->NewKey( cName, mip, loc ); hsgResMgr::ResMgr()->NewKey( cName, mip, loc );
return mip->GetKey(); return mip->GetKey();

15
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"; 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;
}

21
Sources/Plasma/FeatureLib/pfMessage/pfKIMsg.h

@ -67,7 +67,7 @@ class pfKIMsg : public plMessage
// for the hack chat message thingy // for the hack chat message thingy
char *fUser; char *fUser;
uint32_t fPlayerID; uint32_t fPlayerID;
std::wstring fString; plString fString;
// for the SetChatFadeDelay // for the SetChatFadeDelay
float fDelay; float fDelay;
@ -78,7 +78,7 @@ class pfKIMsg : public plMessage
void IInit() void IInit()
{ {
fCommand = kNoCommand; fCommand = kNoCommand;
fString = L""; fString = plString();
fUser = nil; fUser = nil;
fPlayerID = 0; fPlayerID = 0;
fFlags = 0; fFlags = 0;
@ -192,14 +192,7 @@ class pfKIMsg : public plMessage
s->ReadLE( &fCommand ); s->ReadLE( &fCommand );
fUser = s->ReadSafeString(); fUser = s->ReadSafeString();
fPlayerID = s->ReadLE32(); fPlayerID = s->ReadLE32();
fString = s->ReadSafeWString_TEMP();
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;
fFlags = s->ReadLE32(); fFlags = s->ReadLE32();
fDelay = s->ReadLEScalar(); fDelay = s->ReadLEScalar();
fValue = s->ReadLE32(); fValue = s->ReadLE32();
@ -211,7 +204,7 @@ class pfKIMsg : public plMessage
s->WriteLE( fCommand ); s->WriteLE( fCommand );
s->WriteSafeString( fUser ); s->WriteSafeString( fUser );
s->WriteLE32( fPlayerID ); s->WriteLE32( fPlayerID );
s->WriteSafeWString( fString.c_str() ); s->WriteSafeWString( fString );
s->WriteLE32( fFlags ); s->WriteLE32( fFlags );
s->WriteLEScalar(fDelay); s->WriteLEScalar(fDelay);
s->WriteLE32( fValue ); s->WriteLE32( fValue );
@ -219,10 +212,8 @@ class pfKIMsg : public plMessage
uint8_t GetCommand( void ) const { return fCommand; } uint8_t GetCommand( void ) const { return fCommand; }
void SetString( const char *str ); void SetString( const plString &str ) { fString = str; }
void SetString( const wchar_t *str ) { fString = str; } plString GetString( void ) { return fString; }
std::string GetString( void );
std::wstring GetStringU( void ) { return fString; }
void SetUser( const char *str, uint32_t pid=0 ) { fUser = hsStrcpy( str ); fPlayerID = pid; } void SetUser( const char *str, uint32_t pid=0 ) { fUser = hsStrcpy( str ); fPlayerID = pid; }
const char *GetUser( void ) { return fUser; } const char *GetUser( void ) { return fUser; }

4
Sources/Plasma/FeatureLib/pfPython/cyMisc.cpp

@ -1127,7 +1127,7 @@ uint32_t cyMisc::SendRTChat(pyPlayer& from, const std::vector<pyPlayer*> & tolis
{ {
// create the messge that will contain the chat message // create the messge that will contain the chat message
pfKIMsg *msg = new pfKIMsg( pfKIMsg::kHACKChatMsg ); pfKIMsg *msg = new pfKIMsg( pfKIMsg::kHACKChatMsg );
msg->SetString( message ); msg->SetString( plString::FromWchar(message) );
msg->SetUser( from.GetPlayerName(), from.GetPlayerID() ); msg->SetUser( from.GetPlayerName(), from.GetPlayerID() );
msg->SetFlags( flags ); msg->SetFlags( flags );
msg->SetBCastFlag(plMessage::kNetPropagate | plMessage::kNetForce); 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 // create the mesage to send
pfKIMsg *msg = new pfKIMsg( (uint8_t)command ); pfKIMsg *msg = new pfKIMsg( (uint8_t)command );
msg->SetString( value ); msg->SetString( plString::FromWchar( value ) );
// send it off // send it off
plgDispatch::MsgSend( msg ); plgDispatch::MsgSend( msg );

28
Sources/Plasma/FeatureLib/pfPython/plPythonFileMod.cpp

@ -1862,7 +1862,7 @@ bool plPythonFileMod::MsgReceive(plMessage* msg)
// yes... // yes...
// find the value that would go with a command // find the value that would go with a command
PyObject* value; PyObject* value;
std::wstring str; plStringBuffer<wchar_t> str;
switch (pkimsg->GetCommand()) switch (pkimsg->GetCommand())
{ {
case pfKIMsg::kSetChatFadeDelay: case pfKIMsg::kSetChatFadeDelay:
@ -1873,8 +1873,8 @@ bool plPythonFileMod::MsgReceive(plMessage* msg)
break; break;
case pfKIMsg::kYesNoDialog: case pfKIMsg::kYesNoDialog:
value = PyTuple_New(2); value = PyTuple_New(2);
str = pkimsg->GetStringU(); str = pkimsg->GetString().ToWchar();
PyTuple_SetItem(value, 0, PyUnicode_FromWideChar(str.c_str(), str.length())); PyTuple_SetItem(value, 0, PyUnicode_FromWideChar(str, str.GetSize()));
PyTuple_SetItem(value, 1, pyKey::New(pkimsg->GetSender())); PyTuple_SetItem(value, 1, pyKey::New(pkimsg->GetSender()));
break; break;
case pfKIMsg::kGZInRange: case pfKIMsg::kGZInRange:
@ -1884,23 +1884,23 @@ bool plPythonFileMod::MsgReceive(plMessage* msg)
break; break;
case pfKIMsg::kRateIt: case pfKIMsg::kRateIt:
value = PyTuple_New(3); value = PyTuple_New(3);
str = pkimsg->GetStringU(); str = pkimsg->GetString().ToWchar();
PyTuple_SetItem(value,0,PyString_FromString(pkimsg->GetUser())); 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())); PyTuple_SetItem(value,2,PyLong_FromLong(pkimsg->GetIntValue()));
break; break;
case pfKIMsg::kRegisterImager: case pfKIMsg::kRegisterImager:
value = PyTuple_New(2); value = PyTuple_New(2);
str = pkimsg->GetStringU(); str = pkimsg->GetString().ToWchar();
PyTuple_SetItem(value, 0, PyUnicode_FromWideChar(str.c_str(), str.length())); PyTuple_SetItem(value, 0, PyUnicode_FromWideChar(str, str.GetSize()));
PyTuple_SetItem(value, 1, pyKey::New(pkimsg->GetSender())); PyTuple_SetItem(value, 1, pyKey::New(pkimsg->GetSender()));
break; break;
case pfKIMsg::kAddPlayerDevice: case pfKIMsg::kAddPlayerDevice:
case pfKIMsg::kRemovePlayerDevice: case pfKIMsg::kRemovePlayerDevice:
{ {
str = pkimsg->GetStringU(); str = pkimsg->GetString().ToWchar();
if ( str.length() > 0 ) if ( str.GetSize() > 0 )
value = PyUnicode_FromWideChar(str.c_str(), str.length()); value = PyUnicode_FromWideChar(str, str.GetSize());
else else
{ {
Py_INCREF(Py_None); Py_INCREF(Py_None);
@ -1915,8 +1915,8 @@ bool plPythonFileMod::MsgReceive(plMessage* msg)
case pfKIMsg::kKIOKDialogNoQuit: case pfKIMsg::kKIOKDialogNoQuit:
case pfKIMsg::kGZFlashUpdate: case pfKIMsg::kGZFlashUpdate:
case pfKIMsg::kKICreateMarkerNode: case pfKIMsg::kKICreateMarkerNode:
str = pkimsg->GetStringU(); str = pkimsg->GetString().ToWchar();
value = PyUnicode_FromWideChar(str.c_str(), str.length()); value = PyUnicode_FromWideChar(str, str.GetSize());
break; break;
case pfKIMsg::kMGStartCGZGame: case pfKIMsg::kMGStartCGZGame:
case pfKIMsg::kMGStopCGZGame: case pfKIMsg::kMGStopCGZGame:
@ -2905,7 +2905,7 @@ bool plPythonFileMod::MsgReceive(plMessage* msg)
void plPythonFileMod::ReportError() void plPythonFileMod::ReportError()
{ {
plString objectName = this->GetKeyName(); plString objectName = this->GetKeyName();
objectName += _TEMP_CONVERT_FROM_LITERAL(" - "); objectName += " - ";
PythonInterface::WriteToStdErr(objectName.c_str()); PythonInterface::WriteToStdErr(objectName.c_str());
@ -3050,4 +3050,4 @@ void plPythonFileMod::Write(hsStream* stream, hsResMgr* mgr)
//// kGlobalNameKonstant ///////////////////////////////////////////////// //// kGlobalNameKonstant /////////////////////////////////////////////////
// My continued attempt to spread the CORRECT way to spell konstant. -mcn // My continued attempt to spread the CORRECT way to spell konstant. -mcn
plString plPythonFileMod::kGlobalNameKonstant = _TEMP_CONVERT_FROM_LITERAL("VeryVerySpecialPythonFileMod"); plString plPythonFileMod::kGlobalNameKonstant("VeryVerySpecialPythonFileMod");

4
Sources/Plasma/FeatureLib/pfPython/pyGameScoreMsg.cpp

@ -61,8 +61,8 @@ PyObject* pyGameScoreMsg::CreateFinal(pfGameScoreMsg* msg)
plString pyGameScoreMsg::GetError() const plString pyGameScoreMsg::GetError() const
{ {
if (fMsg) if (fMsg)
return _TEMP_CONVERT_FROM_WCHAR_T(NetErrorToString(fMsg->GetResult())); return plString::FromWchar(NetErrorToString(fMsg->GetResult()));
return _TEMP_CONVERT_FROM_LITERAL("pfGameScoreMsg is NULL"); return "pfGameScoreMsg is NULL";
} }
bool pyGameScoreMsg::IsValid() const bool pyGameScoreMsg::IsValid() const

4
Sources/Plasma/FeatureLib/pfPython/pyImageGlue.cpp

@ -291,7 +291,7 @@ PYTHON_GLOBAL_METHOD_DEFINITION(PtLoadJPEGFromDisk, args, "Params: filename,widt
if (PyString_CheckEx(filenameObj)) if (PyString_CheckEx(filenameObj))
{ {
plString text = PyString_AsStringEx(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; return ret;
} }
else else
@ -313,7 +313,7 @@ PYTHON_GLOBAL_METHOD_DEFINITION(PtLoadPNGFromDisk, args, "Params: filename,width
if (PyString_CheckEx(filenameObj)) if (PyString_CheckEx(filenameObj))
{ {
plString text = PyString_AsStringEx(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; return ret;
} }
else else

8
Sources/Plasma/FeatureLib/pfPython/pyJournalBook.h

@ -84,8 +84,8 @@ public:
// required functions for PyObject interoperability // required functions for PyObject interoperability
PYTHON_CLASS_NEW_FRIEND(ptBook); 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::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 = _TEMP_CONVERT_FROM_LITERAL("")); 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_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) 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); static void AddPlasmaConstantsClasses(PyObject *m);
// Deletes the existing book and re-creates it, for use by the python glue // 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::string esHTMLSource, plKey coverImageKey = nil, plKey callbackKey = nil, plString guiName = plString());
void MakeBook(std::wstring 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 = plString());
// Interface functions per book // Interface functions per book
virtual void Show( bool startOpened ); virtual void Show( bool startOpened );

2
Sources/Plasma/FeatureLib/pfPython/pyPlayerGlue.cpp

@ -103,7 +103,7 @@ PYTHON_INIT_DEFINITION(ptPlayer, args, keywords)
PYTHON_RETURN_INIT_ERROR; 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; PYTHON_RETURN_INIT_OK;
} }

2
Sources/Plasma/FeatureLib/pfPython/pySceneObject.cpp

@ -223,7 +223,7 @@ plString pySceneObject::GetName()
{ {
if ( fSceneObjects.Count() > 0 ) if ( fSceneObjects.Count() > 0 )
return fSceneObjects[0]->GetName(); return fSceneObjects[0]->GetName();
return _TEMP_CONVERT_FROM_LITERAL(""); return plString();
} }
PyObject* pySceneObject::findObj(const plString& name) PyObject* pySceneObject::findObj(const plString& name)

6
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 // create a status log guy for this
fICreatedLog = true; 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) if (fLog)
{ {
fLog->SetForceLog(true); fLog->SetForceLog(true);
@ -85,7 +85,7 @@ bool pyStatusLog::Write(plString text)
{ {
if (fLog) if (fLog)
{ {
fLog->AddLine(_TEMP_CONVERT_TO_CONST_CHAR(text)); fLog->AddLine(text.c_str());
return true; return true;
} }
@ -100,7 +100,7 @@ bool pyStatusLog::WriteColor(plString text, pyColor& color)
((uint32_t)(color.getRed()*255)<<16) + ((uint32_t)(color.getRed()*255)<<16) +
((uint32_t)(color.getGreen()*255)<<8) + ((uint32_t)(color.getGreen()*255)<<8) +
((uint32_t)(color.getBlue()*255)); ((uint32_t)(color.getBlue()*255));
fLog->AddLine( _TEMP_CONVERT_TO_CONST_CHAR(text), st_color ); fLog->AddLine( text.c_str(), st_color );
return true; return true;
} }

4
Sources/Plasma/FeatureLib/pfPython/pyVault.cpp

@ -673,8 +673,8 @@ void pyVault::CreateNeighborhood()
plUUID guid(GuidGenerate()); plUUID guid(GuidGenerate());
link.GetAgeInfo()->SetAgeInstanceGuid(&guid); link.GetAgeInfo()->SetAgeInstanceGuid(&guid);
link.GetAgeInfo()->SetAgeUserDefinedName( _TEMP_CONVERT_TO_CONST_CHAR(title) ); link.GetAgeInfo()->SetAgeUserDefinedName( title.c_str() );
link.GetAgeInfo()->SetAgeDescription( _TEMP_CONVERT_TO_CONST_CHAR(desc) ); link.GetAgeInfo()->SetAgeDescription( desc.c_str() );
VaultRegisterOwnedAge(&link); VaultRegisterOwnedAge(&link);
} }

2
Sources/Plasma/NucleusLib/pnDispatch/plDispatch.cpp

@ -341,7 +341,7 @@ void plDispatch::IMsgDispatch()
uint32_t rcvTicks = hsTimer::GetPrecTickCount(); uint32_t rcvTicks = hsTimer::GetPrecTickCount();
// Object could be deleted by this message, so we need to log this stuff now // 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)"; const char* className = "(unknown)";
uint32_t clonePlayerID = 0; uint32_t clonePlayerID = 0;
if (plDispatchLogBase::IsLoggingLong()) if (plDispatchLogBase::IsLoggingLong())

2
Sources/Plasma/NucleusLib/pnKeyedObject/hsKeyedObject.cpp

@ -70,7 +70,7 @@ plString hsKeyedObject::GetKeyName() const
if (fpKey) if (fpKey)
return fpKey->GetName(); return fpKey->GetName();
else else
return _TEMP_CONVERT_FROM_LITERAL("(unknown)"); return "(unknown)";
} }
hsKeyedObject::~hsKeyedObject() hsKeyedObject::~hsKeyedObject()

77
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 // 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) // 3) Make sure the Obj is unique for this location/Type Combo... (validated at runtime)
#define _TCFL _TEMP_CONVERT_FROM_LITERAL
plKeySeed SeedList[] = { plKeySeed SeedList[] = {
// Key Enum Type Obj // Key Enum Type Obj
{ kFirst_Fixed_KEY, CLASS_INDEX_SCOPED( plSceneObject ), _TCFL("kFirst_Fixed_KEY") }, { kFirst_Fixed_KEY, CLASS_INDEX_SCOPED( plSceneObject ), "kFirst_Fixed_KEY", },
{ kLOSObject_KEY, CLASS_INDEX_SCOPED( plLOSDispatch ), _TCFL("kLOSObject_KEY"), }, { kLOSObject_KEY, CLASS_INDEX_SCOPED( plLOSDispatch ), "kLOSObject_KEY", },
{ kTimerCallbackManager_KEY, CLASS_INDEX_SCOPED( plTimerCallbackManager ), _TCFL("kTimerCallbackManager_KEY"), }, { kTimerCallbackManager_KEY, CLASS_INDEX_SCOPED( plTimerCallbackManager ), "kTimerCallbackManager_KEY", },
{ kConsoleObject_KEY, CLASS_INDEX_SCOPED( pfConsole ), _TCFL("kConsoleObject_KEY"), }, { kConsoleObject_KEY, CLASS_INDEX_SCOPED( pfConsole ), "kConsoleObject_KEY", },
{ kAudioSystem_KEY, CLASS_INDEX_SCOPED( plAudioSystem ), _TCFL("kAudioSystem_KEY"), }, { kAudioSystem_KEY, CLASS_INDEX_SCOPED( plAudioSystem ), "kAudioSystem_KEY", },
{ kInput_KEY, CLASS_INDEX_SCOPED( plInputManager ), _TCFL("kInput_KEY"), }, { kInput_KEY, CLASS_INDEX_SCOPED( plInputManager ), "kInput_KEY", },
{ kClient_KEY, CLASS_INDEX_SCOPED( plClient ), _TCFL("kClient_KEY"), }, { kClient_KEY, CLASS_INDEX_SCOPED( plClient ), "kClient_KEY", },
{ kNetClientMgr_KEY, CLASS_INDEX_SCOPED( plNetClientMgr ), _TCFL("kNetClientMgr_KEY"), }, { kNetClientMgr_KEY, CLASS_INDEX_SCOPED( plNetClientMgr ), "kNetClientMgr_KEY", },
{ kListenerMod_KEY, CLASS_INDEX_SCOPED( plListener ), _TCFL("kListenerMod_KEY"), }, { kListenerMod_KEY, CLASS_INDEX_SCOPED( plListener ), "kListenerMod_KEY", },
{ kTransitionMgr_KEY, CLASS_INDEX_SCOPED( plTransitionMgr ), _TCFL("kTransitionMgr_KEY"), }, { kTransitionMgr_KEY, CLASS_INDEX_SCOPED( plTransitionMgr ), "kTransitionMgr_KEY", },
{ kLinkEffectsMgr_KEY, CLASS_INDEX_SCOPED( plLinkEffectsMgr ), _TCFL("kLinkEffectsMgr_KEY"), }, { kLinkEffectsMgr_KEY, CLASS_INDEX_SCOPED( plLinkEffectsMgr ), "kLinkEffectsMgr_KEY", },
{ kGameGUIMgr_KEY, CLASS_INDEX_SCOPED( pfGameGUIMgr ), _TCFL("kGameGUIMgr_KEY"), }, { kGameGUIMgr_KEY, CLASS_INDEX_SCOPED( pfGameGUIMgr ), "kGameGUIMgr_KEY", },
{ kGameGUIDynamicDlg_KEY, CLASS_INDEX_SCOPED( plSceneNode ), _TCFL("kGameGUIDynamicDlg_KEY"), }, { kGameGUIDynamicDlg_KEY, CLASS_INDEX_SCOPED( plSceneNode ), "kGameGUIDynamicDlg_KEY", },
{ kVirtualCamera1_KEY, CLASS_INDEX_SCOPED( plVirtualCam1 ), _TCFL("kVirtualCamera_KEY"), }, { kVirtualCamera1_KEY, CLASS_INDEX_SCOPED( plVirtualCam1 ), "kVirtualCamera_KEY", },
{ kDefaultCameraMod1_KEY, CLASS_INDEX_SCOPED( plCameraModifier1 ), _TCFL("kDefaultCameraMod1_KEY"), }, { kDefaultCameraMod1_KEY, CLASS_INDEX_SCOPED( plCameraModifier1 ), "kDefaultCameraMod1_KEY", },
{ kKIGUIGlue_KEY, CLASS_INDEX_SCOPED( pfKI ), _TCFL("kKIGUIGlue_KEY"), }, { kKIGUIGlue_KEY, CLASS_INDEX_SCOPED( pfKI ), "kKIGUIGlue_KEY", },
{ kClothingMgr_KEY, CLASS_INDEX_SCOPED( plClothingMgr ), _TCFL("kClothingMgr_KEY"), }, { kClothingMgr_KEY, CLASS_INDEX_SCOPED( plClothingMgr ), "kClothingMgr_KEY", },
{ kInputInterfaceMgr_KEY, CLASS_INDEX_SCOPED( plInputInterfaceMgr ), _TCFL("kInputInterfaceMgr_KEY"), }, { kInputInterfaceMgr_KEY, CLASS_INDEX_SCOPED( plInputInterfaceMgr ), "kInputInterfaceMgr_KEY", },
{ kAVIWriter_KEY, CLASS_INDEX_SCOPED( plAVIWriter ), _TCFL("kAVIWriter_KEY"), }, { kAVIWriter_KEY, CLASS_INDEX_SCOPED( plAVIWriter ), "kAVIWriter_KEY", },
{ kResManagerHelper_KEY, CLASS_INDEX_SCOPED( plResManagerHelper ), _TCFL("kResManagerHelper_KEY"), }, { kResManagerHelper_KEY, CLASS_INDEX_SCOPED( plResManagerHelper ), "kResManagerHelper_KEY", },
{ kAvatarMgr_KEY, CLASS_INDEX_SCOPED( plAvatarMgr ), _TCFL("kAvatarMgr_KEY"), }, { kAvatarMgr_KEY, CLASS_INDEX_SCOPED( plAvatarMgr ), "kAvatarMgr_KEY", },
{ kSimulationMgr_KEY, CLASS_INDEX_SCOPED( plSimulationMgr ), _TCFL("kSimulationMgr_KEY"), }, { kSimulationMgr_KEY, CLASS_INDEX_SCOPED( plSimulationMgr ), "kSimulationMgr_KEY", },
{ kTransitionCamera_KEY, CLASS_INDEX_SCOPED( plCameraModifier1 ), _TCFL("kTransitionCamera_KEY"), }, { kTransitionCamera_KEY, CLASS_INDEX_SCOPED( plCameraModifier1 ), "kTransitionCamera_KEY", },
{ kCCRMgr_KEY, CLASS_INDEX_SCOPED( plCCRMgr ), _TCFL("kCCRMgr_KEY"), }, { kCCRMgr_KEY, CLASS_INDEX_SCOPED( plCCRMgr ), "kCCRMgr_KEY", },
{ kNetClientCloneRoom_KEY, CLASS_INDEX_SCOPED( plSceneNode ), _TCFL("kNetClientCloneRoom_KEY"), }, { kNetClientCloneRoom_KEY, CLASS_INDEX_SCOPED( plSceneNode ), "kNetClientCloneRoom_KEY", },
{ kMarkerMgr_KEY, CLASS_INDEX_SCOPED( pfMarkerMgr ), _TCFL("kMarkerMgr_KEY"), }, { kMarkerMgr_KEY, CLASS_INDEX_SCOPED( pfMarkerMgr ), "kMarkerMgr_KEY", },
{ kAutoProfile_KEY, CLASS_INDEX_SCOPED( plAutoProfile ), _TCFL("kAutoProfile_KEY"), }, { kAutoProfile_KEY, CLASS_INDEX_SCOPED( plAutoProfile ), "kAutoProfile_KEY", },
{ kGlobalVisMgr_KEY, CLASS_INDEX_SCOPED( plVisMgr ), _TCFL("kGlobalVisMgr_KEY"), }, { kGlobalVisMgr_KEY, CLASS_INDEX_SCOPED( plVisMgr ), "kGlobalVisMgr_KEY", },
{ kFontCache_KEY, CLASS_INDEX_SCOPED( plFontCache ), _TCFL("kFontCache_KEY"), }, { kFontCache_KEY, CLASS_INDEX_SCOPED( plFontCache ), "kFontCache_KEY", },
{ kRelevanceMgr_KEY, CLASS_INDEX_SCOPED( plRelevanceMgr ), _TCFL("kRelevanceMgr_KEY"), }, { kRelevanceMgr_KEY, CLASS_INDEX_SCOPED( plRelevanceMgr ), "kRelevanceMgr_KEY", },
{ kJournalBookMgr_KEY, CLASS_INDEX_SCOPED( pfJournalBook ), _TCFL("kJournalBookMgr_KEY") }, { kJournalBookMgr_KEY, CLASS_INDEX_SCOPED( pfJournalBook ), "kJournalBookMgr_KEY", },
{ kAgeLoader_KEY, CLASS_INDEX_SCOPED( plAgeLoader), _TCFL("kAgeLoader_KEY") }, { kAgeLoader_KEY, CLASS_INDEX_SCOPED( plAgeLoader), "kAgeLoader_KEY", },
{ kBuiltIn3rdPersonCamera_KEY, CLASS_INDEX_SCOPED( plCameraModifier1 ), _TCFL("kBuiltIn3rdPersonCamera_KEY"), }, { kBuiltIn3rdPersonCamera_KEY, CLASS_INDEX_SCOPED( plCameraModifier1 ), "kBuiltIn3rdPersonCamera_KEY", },
{ kSecurePreloader_KEY, CLASS_INDEX_SCOPED( pfSecurePreloader ), _TCFL("kSecurePreloader_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 #undef _TCFL

2
Sources/Plasma/NucleusLib/pnUUID/pnUUID_Unix.cpp

@ -112,7 +112,7 @@ bool plUUID::ToString( plString & out ) const
plUUIDHelper::CopyToNative( g, this ); plUUIDHelper::CopyToNative( g, this );
char buf[40]; char buf[40];
uuid_unparse( g, buf ); uuid_unparse( g, buf );
out = _TEMP_CONVERT_FROM_LITERAL( buf ); out = buf;
return true; return true;
} }

2
Sources/Plasma/NucleusLib/pnUUID/pnUUID_Win32.cpp

@ -90,7 +90,7 @@ bool plUUID::FromString( const char * str )
bool plUUID::ToString( plString & out ) const bool plUUID::ToString( plString & out ) const
{ {
out = _TEMP_CONVERT_FROM_LITERAL(""); out = plString();
unsigned char * ubuf; unsigned char * ubuf;
RPC_STATUS s; RPC_STATUS s;
s = UuidToString( (GUID *) this, &ubuf ); s = UuidToString( (GUID *) this, &ubuf );

4
Sources/Plasma/PubUtilLib/plAudio/plSound.cpp

@ -163,7 +163,7 @@ void plSound::IUpdateDebugPlate( void )
fDebugPlate->SetPosition( -0.5, 0 ); fDebugPlate->SetPosition( -0.5, 0 );
fDebugPlate->SetDataRange( 0, 100, 100 ); fDebugPlate->SetDataRange( 0, 100, 100 );
fDebugPlate->SetColors( 0x80202000 ); fDebugPlate->SetColors( 0x80202000 );
fDebugPlate->SetTitle( _TEMP_CONVERT_TO_CONST_CHAR( GetKeyName() ) ); // Bleah fDebugPlate->SetTitle( GetKeyName().c_str() ); // Bleah
fDebugPlate->SetLabelText( "Desired", "Curr", "Soft", "Dist" ); fDebugPlate->SetLabelText( "Desired", "Curr", "Soft", "Dist" );
} }
@ -190,7 +190,7 @@ void plSound::SetCurrDebugPlate( const plKey soundKey )
{ {
fDebugPlate->ClearData(); fDebugPlate->ClearData();
fDebugPlate->SetVisible( true ); fDebugPlate->SetVisible( true );
fDebugPlate->SetTitle( _TEMP_CONVERT_TO_CONST_CHAR( fCurrDebugPlateSound->GetKeyName() ) ); // Bleah fDebugPlate->SetTitle( fCurrDebugPlateSound->GetKeyName().c_str() ); // Bleah
} }
} }
} }

4
Sources/Plasma/PubUtilLib/plAvatar/plAGApplicator.h

@ -104,10 +104,6 @@ public:
void SetChannelName(const plString &name); void SetChannelName(const plString &name);
plString GetChannelName(); 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. /** Optionally suppress the action of this applicator.
The applicator can still be forced to apply using the force The applicator can still be forced to apply using the force
paramater of the Apply function. */ paramater of the Apply function. */

2
Sources/Plasma/PubUtilLib/plAvatar/plAGMasterMod.cpp

@ -631,7 +631,7 @@ bool plAGMasterMod::MsgReceive(plMessage* msg)
plString targetName = cmdMsg->GetAnimName(); plString targetName = cmdMsg->GetAnimName();
if (targetName.IsNull()) if (targetName.IsNull())
targetName = _TEMP_CONVERT_FROM_LITERAL(ENTIRE_ANIMATION_NAME); targetName = ENTIRE_ANIMATION_NAME;
plAGAnimInstance *inst = FindAnimInstance(targetName); plAGAnimInstance *inst = FindAnimInstance(targetName);
if (inst != nil) if (inst != nil)

2
Sources/Plasma/PubUtilLib/plAvatar/plAnimStage.cpp

@ -277,7 +277,7 @@ plAGAnimInstance * plAnimStage::Attach(plArmatureMod *armature, plArmatureBrain
if(fAnimInstance) if(fAnimInstance)
{ {
fAnimInstance->Stop(); // we'll be setting the time directly. 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; fAttached = true;
// this is too early to send the enter notify. we're attached, but we may not // this is too early to send the enter notify. we're attached, but we may not
// have faded in yet. // have faded in yet.

16
Sources/Plasma/PubUtilLib/plAvatar/plArmatureMod.cpp

@ -663,7 +663,7 @@ void plArmatureMod::IInitDefaults()
fDontPanicLink = false; fDontPanicLink = false;
fBodyAgeName = "GlobalAvatars"; fBodyAgeName = "GlobalAvatars";
fBodyFootstepSoundPage = "Audio"; fBodyFootstepSoundPage = "Audio";
fAnimationPrefix = _TEMP_CONVERT_FROM_LITERAL("Male"); fAnimationPrefix = "Male";
fUserStr = ""; fUserStr = "";
} }
@ -1034,7 +1034,7 @@ void plArmatureMod::PanicLink(bool playLinkOutAnim /* = true */)
plString animName = MakeAnimationName("FallingLinkOut"); plString animName = MakeAnimationName("FallingLinkOut");
task->SetAnimName(animName); task->SetAnimName(animName);
task->SetMarkerName(_TEMP_CONVERT_FROM_LITERAL("touch")); task->SetMarkerName("touch");
plAvTaskMsg *taskMsg = new plAvTaskMsg(GetKey(), GetKey(), task); plAvTaskMsg *taskMsg = new plAvTaskMsg(GetKey(), GetKey(), task);
taskMsg->Send(); taskMsg->Send();
@ -1057,7 +1057,7 @@ void plArmatureMod::PersonalLink()
plAvOneShotLinkTask *task = new plAvOneShotLinkTask; plAvOneShotLinkTask *task = new plAvOneShotLinkTask;
plString animName = MakeAnimationName("PersonalLink"); plString animName = MakeAnimationName("PersonalLink");
task->SetAnimName(animName); task->SetAnimName(animName);
task->SetMarkerName(_TEMP_CONVERT_FROM_LITERAL("touch")); task->SetMarkerName("touch");
plAvTaskMsg *taskMsg = new plAvTaskMsg(GetKey(), GetKey(), task); plAvTaskMsg *taskMsg = new plAvTaskMsg(GetKey(), GetKey(), task);
taskMsg->SetBCastFlag(plMessage::kNetPropagate); taskMsg->SetBCastFlag(plMessage::kNetPropagate);
@ -1781,7 +1781,7 @@ void plArmatureMod::Read(hsStream * stream, hsResMgr *mgr)
if (gLoc.IsValid()) if (gLoc.IsValid())
{ {
const plUoid &myUoid = GetKey()->GetUoid(); 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); fFootSoundSOKey = mgr->FindKey(SOUoid);
if (fFootSoundSOKey) if (fFootSoundSOKey)
{ {
@ -1791,7 +1791,7 @@ void plArmatureMod::Read(hsStream * stream, hsResMgr *mgr)
} }
// Add the effect to our effects manager // 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); plKey effectKey = mgr->FindKey(effectUoid);
if (effectKey) 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); mgr->AddViaNotify(effectKey, new plGenRefMsg(effectMgrKey, plRefMsg::kOnCreate, -1, -1), plRefFlags::kActiveRef);
// Get the linking sound // Get the linking sound
plUoid LinkUoid(gLoc, plSceneObject::Index(), _TEMP_CONVERT_FROM_LITERAL("LinkSoundSource")); plUoid LinkUoid(gLoc, plSceneObject::Index(), "LinkSoundSource");
fLinkSoundSOKey = mgr->FindKey(LinkUoid); fLinkSoundSOKey = mgr->FindKey(LinkUoid);
if (fLinkSoundSOKey) if (fLinkSoundSOKey)
{ {
@ -1896,7 +1896,7 @@ void plArmatureMod::ICustomizeApplicator()
{ {
plArmatureModBase::ICustomizeApplicator(); plArmatureModBase::ICustomizeApplicator();
const plAGModifier *agMod = GetChannelMod(_TEMP_CONVERT_FROM_LITERAL("Bone_Root"), true); const plAGModifier *agMod = GetChannelMod("Bone_Root", true);
if (agMod) if (agMod)
{ {
// are there any applicators that manipulate the transform? // 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 plString plArmatureMod::MakeAnimationName(const char *baseName) const
{ {
return fAnimationPrefix + _TEMP_CONVERT_FROM_LITERAL(baseName); return fAnimationPrefix + baseName;
} }
plString plArmatureMod::GetRootName() plString plArmatureMod::GetRootName()

4
Sources/Plasma/PubUtilLib/plAvatar/plAvBrainClimb.cpp

@ -714,7 +714,7 @@ void plAvBrainClimb::ICalcProbeLengths()
hsAssert(up, "Couldn't find ClimbUp animation."); hsAssert(up, "Couldn't find ClimbUp animation.");
if(up) if(up)
{ {
GetStartToEndTransform(up, &upMove, nil, _TEMP_CONVERT_FROM_LITERAL("Handle")); GetStartToEndTransform(up, &upMove, nil, "Handle");
fVerticalProbeLength = upMove.GetTranslate().fZ; fVerticalProbeLength = upMove.GetTranslate().fZ;
} else } else
fVerticalProbeLength = 4.0f; // guess fVerticalProbeLength = 4.0f; // guess
@ -722,7 +722,7 @@ void plAvBrainClimb::ICalcProbeLengths()
hsAssert(left, "Couldn't find ClimbLeft animation."); hsAssert(left, "Couldn't find ClimbLeft animation.");
if(left) if(left)
{ {
GetStartToEndTransform(left, &leftMove, nil, _TEMP_CONVERT_FROM_LITERAL("Handle")); GetStartToEndTransform(left, &leftMove, nil, "Handle");
fHorizontalProbeLength = leftMove.GetTranslate().fX; fHorizontalProbeLength = leftMove.GetTranslate().fX;
} else } else
fHorizontalProbeLength = 3.0f; // guess fHorizontalProbeLength = 3.0f; // guess

2
Sources/Plasma/PubUtilLib/plAvatar/plAvBrainCritter.cpp

@ -300,7 +300,7 @@ std::string plAvBrainCritter::BehaviorName(int behavior) const
plString plAvBrainCritter::AnimationName(int behavior) const plString plAvBrainCritter::AnimationName(int behavior) const
{ {
if ((behavior >= fBehaviors.Count()) || (behavior < 0)) if ((behavior >= fBehaviors.Count()) || (behavior < 0))
return _TEMP_CONVERT_FROM_LITERAL(""); return plString();
return ((CritterBehavior*)fBehaviors[behavior])->AnimName(); return ((CritterBehavior*)fBehaviors[behavior])->AnimName();
} }

2
Sources/Plasma/PubUtilLib/plAvatar/plAvBrainHuman.cpp

@ -309,7 +309,7 @@ void plAvBrainHuman::IInitBoneMap()
for(int i = 0; i < numTuples; i++) for(int i = 0; i < numTuples; i++)
{ {
HumanBoneID id = tupleMap[i].fID; 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); const plSceneObject * bone = this->fAvMod->FindBone(name);
if( bone ) if( bone )

2
Sources/Plasma/PubUtilLib/plAvatar/plAvTaskSeek.cpp

@ -535,7 +535,7 @@ bool plAvTaskSeek::IUpdateObjective(plArmatureMod *avatar)
plAGAnim *anim = avatar->FindCustomAnim(fAnimName); plAGAnim *anim = avatar->FindCustomAnim(fAnimName);
// don't need to do this every frame; the animation doesn't change. // don't need to do this every frame; the animation doesn't change.
// *** cache the adjustment; // *** 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 // ... but we do still need to multiply by the (potentially changed) target
targL2W = targL2W * adjustment; targL2W = targL2W * adjustment;
} }

6
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); const plLocation& loc = (globalLoc.IsValid() ? globalLoc : custLoc.IsValid() ? custLoc : maleLoc);
#endif #endif
plString theName = _TEMP_CONVERT_FROM_LITERAL(name); plString theName = name;
if ( loc == maleLoc ) if ( loc == maleLoc )
theName = _TEMP_CONVERT_FROM_LITERAL("Male"); theName = "Male";
if (loc.IsValid()) if (loc.IsValid())
{ {
@ -1012,7 +1012,7 @@ void plAvatarMgr::OfferLinkingBook(plKey hostKey, plKey guestKey, plMessage *lin
brainG->AddStage(guestAccept); brainG->AddStage(guestAccept);
brainG->AddStage(guestAcceptIdle); 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); plAvCoopMsg *coMg = new plAvCoopMsg(hostKey, coord);

4
Sources/Plasma/PubUtilLib/plAvatar/plAvatarTasks.cpp

@ -249,7 +249,7 @@ bool plAvSeekTask::Start(plArmatureMod *avatar, plArmatureBrain *brain, double t
{ {
hsMatrix44 adjustment; hsMatrix44 adjustment;
plAGAnim *anim = avatar->FindCustomAnim(fAnimName); 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; targetL2W = targetL2W * adjustment;
} }
break; break;
@ -624,7 +624,7 @@ bool plAvOneShotTask::Start(plArmatureMod *avatar, plArmatureBrain *brain, doubl
plgDispatch::MsgSend( pMsg ); // whoosh... off it goes 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) if(fMoveHandle)
{ {
plMatrixDifferenceApp *differ = avatar->GetRootAnimator(); plMatrixDifferenceApp *differ = avatar->GetRootAnimator();

2
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 // 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 // animation. That's what this next line is doing. It's a bit unintuitive
// until you look at the parameter definitions. // 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; hsMatrix44 candidateGoal = sitGoal * animEndToStart;
hsPoint3 distP = candidateGoal.GetTranslate() - curPosition; hsPoint3 distP = candidateGoal.GetTranslate() - curPosition;
hsVector3 distV(distP.fX, distP.fY, distP.fZ); hsVector3 distV(distP.fX, distP.fY, distP.fZ);

4
Sources/Plasma/PubUtilLib/plDrawable/plProxyGen.cpp

@ -161,7 +161,7 @@ hsGMaterial* plProxyGen::IMakeProxyMaterial() const
if( !GetKey()->GetName().IsNull() ) if( !GetKey()->GetName().IsNull() )
buff = plString::Format("%s_Material", GetKey()->GetName().c_str()); buff = plString::Format("%s_Material", GetKey()->GetName().c_str());
else else
buff = _TEMP_CONVERT_FROM_LITERAL("ProxyMaterial"); buff = "ProxyMaterial";
hsgResMgr::ResMgr()->NewKey( buff, retVal, GetKey() ? GetKey()->GetUoid().GetLocation() : plLocation::kGlobalFixedLoc ); hsgResMgr::ResMgr()->NewKey( buff, retVal, GetKey() ? GetKey()->GetUoid().GetLocation() : plLocation::kGlobalFixedLoc );
plLayer *lay = retVal->MakeBaseLayer(); plLayer *lay = retVal->MakeBaseLayer();
@ -236,7 +236,7 @@ void plProxyGen::IGenerateProxy()
if( !GetKey()->GetName().IsNull() ) if( !GetKey()->GetName().IsNull() )
buff = plString::Format("%s_ProxyDrawable", GetKey()->GetName().c_str()); buff = plString::Format("%s_ProxyDrawable", GetKey()->GetName().c_str());
else else
buff = _TEMP_CONVERT_FROM_LITERAL("ProxyDrawable"); buff = "ProxyDrawable";
hsgResMgr::ResMgr()->NewKey( buff, fProxyDrawables[ idx ], GetKey() ? GetKey()->GetUoid().GetLocation() : plLocation::kGlobalFixedLoc ); hsgResMgr::ResMgr()->NewKey( buff, fProxyDrawables[ idx ], GetKey() ? GetKey()->GetUoid().GetLocation() : plLocation::kGlobalFixedLoc );
} }

2
Sources/Plasma/PubUtilLib/plGImage/plMipmap.cpp

@ -2138,7 +2138,7 @@ void plMipmap::IAddToMemRecord( plMipmap *mip, plRecord::Method method )
if( mip->GetKey() ) if( mip->GetKey() )
newRecord->fKeyName = mip->GetKeyName(); newRecord->fKeyName = mip->GetKeyName();
else else
newRecord->fKeyName = _TEMP_CONVERT_FROM_LITERAL( "<noKey>" ); newRecord->fKeyName = "<noKey>";
if( mip->fCompressionType != kDirectXCompression ) if( mip->fCompressionType != kDirectXCompression )
newRecord->fUncompressedInfo.fType = mip->fUncompressedInfo.fType; newRecord->fUncompressedInfo.fType = mip->fUncompressedInfo.fType;
else else

2
Sources/Plasma/PubUtilLib/plInputCore/plInputDevice.h

@ -189,7 +189,7 @@ public:
static bool GetInverted() { return plMouseDevice::bInverted; } static bool GetInverted() { return plMouseDevice::bInverted; }
static void SetInverted(bool inverted) { plMouseDevice::bInverted = inverted; } static void SetInverted(bool inverted) { plMouseDevice::bInverted = inverted; }
static void AddNameToCursor(const char* name); 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 AddIDNumToCursor(uint32_t idNum);
static void AddCCRToCursor(); static void AddCCRToCursor();

20
Sources/Plasma/PubUtilLib/plMessage/plAnimCmdMsg.cpp

@ -56,26 +56,6 @@ void plAnimCmdMsg::ClearCmd()
fCmd.Clear(); 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() bool plAnimCmdMsg::CmdChangesAnimTime()
{ {
return (Cmd(kContinue) || return (Cmd(kContinue) ||

12
Sources/Plasma/PubUtilLib/plMessage/plAnimCmdMsg.h

@ -111,16 +111,12 @@ public:
bool Cmd(int n) const { return fCmd.IsBitSet(n); } bool Cmd(int n) const { return fCmd.IsBitSet(n); }
void SetCmd(int n) { fCmd.SetBit(n); } void SetCmd(int n) { fCmd.SetBit(n); }
void ClearCmd(); void ClearCmd();
void SetAnimName(const plString &name); void SetAnimName(const plString &name) { fAnimName = name; }
plString GetAnimName(); plString GetAnimName() { return fAnimName; }
bool CmdChangesAnimTime(); // Will this command cause an update to the current anim time? bool CmdChangesAnimTime(); // Will this command cause an update to the current anim time?
// TEMP plString REVISIT void SetLoopName(const plString &name) { fLoopName = name; }
// Because I'm TOO LAZY to keep converting all these calls to SetAnimName plString GetLoopName() { return fLoopName; }
void SetAnimName(const char *name) { SetAnimName(_TEMP_CONVERT_FROM_LITERAL(name)); }
void SetLoopName(const plString &name);
plString GetLoopName();
float fBegin; float fBegin;
float fEnd; float fEnd;

4
Sources/Plasma/PubUtilLib/plMessage/plDynamicTextMsg.cpp

@ -253,7 +253,7 @@ void plDynamicTextMsg::Write( hsStream *s, hsResMgr *mgr )
fClearColor.Write( s ); fClearColor.Write( s );
fColor.Write( s ); fColor.Write( s );
s->WriteSafeWString( fString ); s->WriteSafeWString( plString::FromWchar(fString) );
mgr->WriteKey( s, fImageKey ); mgr->WriteKey( s, fImageKey );
s->WriteLE( fFlags ); s->WriteLE( fFlags );
@ -360,7 +360,7 @@ void plDynamicTextMsg::WriteVersion(hsStream* s, hsResMgr* mgr)
fColor.Write( s ); fColor.Write( s );
// kDynTextMsgString // kDynTextMsgString
s->WriteSafeWString( fString ); s->WriteSafeWString( plString::FromWchar(fString) );
// kDynTextMsgImageKey // kDynTextMsgImageKey
mgr->WriteKey( s, fImageKey ); mgr->WriteKey( s, fImageKey );

2
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"); const plLocation& loc = plKeyFinder::Instance().FindLocation(cloneAge, "BuiltIn");
// Find the clone template key // 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); plKey key = resMgr->FindKey(objUoid);
if (key) if (key)

2
Sources/Plasma/PubUtilLib/plModifier/plResponderModifier.cpp

@ -775,7 +775,7 @@ void plResponderModifier::ILog(uint32_t color, const char* format, ...)
if (!format || *format == '\0') if (!format || *format == '\0')
return; 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 // Make sure this key isn't in our list of keys to deny
for (int i = 0; i < gNoLogStrings.size(); i++) for (int i = 0; i < gNoLogStrings.size(); i++)

2
Sources/Plasma/PubUtilLib/plNetClient/plNetCliAgeJoiner.cpp

@ -181,7 +181,7 @@ void plNCAgeJoiner::IDispatchMsgReceiveCallback () {
void plNCAgeJoiner::IResMgrProgressBarCallback (plKey key) { void plNCAgeJoiner::IResMgrProgressBarCallback (plKey key) {
#ifndef PLASMA_EXTERNAL_RELEASE #ifndef PLASMA_EXTERNAL_RELEASE
if (s_instance) if (s_instance)
s_instance->progressBar->SetStatusText(_TEMP_CONVERT_TO_CONST_CHAR(key->GetName())); s_instance->progressBar->SetStatusText(key->GetName().c_str());
#endif #endif
} }

2
Sources/Plasma/PubUtilLib/plNetClient/plNetClientMgrSend.cpp

@ -159,7 +159,7 @@ void plNetClientMgr::ISendCCRPetition(plCCRPetitionMsg* petMsg)
char buffy[20]; char buffy[20];
sprintf( buffy, "%lu", GetPlayerID() ); sprintf( buffy, "%lu", GetPlayerID() );
info.AddValue( "Petition", "PlayerID", buffy ); 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 // write config info formatted like an ini file to a buffer
hsRAMStream ram; hsRAMStream ram;

8
Sources/Plasma/PubUtilLib/plNetClient/plNetClientMgrShow.cpp

@ -231,8 +231,8 @@ void plNetClientMgr::IShowRelevanceRegions()
// //
uint32_t maxPlayerName = 0; uint32_t maxPlayerName = 0;
txt.DrawString(x, y, _TEMP_CONVERT_TO_CONST_CHAR(GetPlayerName())); txt.DrawString(x, y, GetPlayerName().c_str());
maxPlayerName = hsMaximum(maxPlayerName, txt.CalcStringWidth(_TEMP_CONVERT_TO_CONST_CHAR(GetPlayerName()))); maxPlayerName = hsMaximum(maxPlayerName, txt.CalcStringWidth(GetPlayerName().c_str()));
y += yOff; y += yOff;
int i; int i;
@ -244,8 +244,8 @@ void plNetClientMgr::IShowRelevanceRegions()
continue; continue;
const plString& name = mbr->GetPlayerName(); const plString& name = mbr->GetPlayerName();
txt.DrawString(x, y, _TEMP_CONVERT_TO_CONST_CHAR(name)); txt.DrawString(x, y, name.c_str());
maxPlayerName = hsMaximum(maxPlayerName, txt.CalcStringWidth(_TEMP_CONVERT_TO_CONST_CHAR(name))); maxPlayerName = hsMaximum(maxPlayerName, txt.CalcStringWidth(name.c_str()));
y += yOff; y += yOff;
} }

6
Sources/Plasma/PubUtilLib/plNetClient/plNetLinkingMgr.cpp

@ -947,7 +947,7 @@ uint8_t plNetLinkingMgr::IPreProcessLink(void)
title = plString::Format("%s'", nc->GetPlayerName().c_str()); title = plString::Format("%s'", nc->GetPlayerName().c_str());
else else
title = plString::Format("%s's", nc->GetPlayerName().c_str()); 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()) if (!info->HasAgeDescription())
{ {
@ -986,7 +986,7 @@ uint8_t plNetLinkingMgr::IPreProcessLink(void)
title = plString::Format("%s'", nc->GetPlayerName().c_str()); title = plString::Format("%s'", nc->GetPlayerName().c_str());
else else
title = plString::Format("%s's", nc->GetPlayerName().c_str()); 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()) if (!info->HasAgeDescription())
@ -998,7 +998,7 @@ uint8_t plNetLinkingMgr::IPreProcessLink(void)
desc = plString::Format("%s' %s", nc->GetPlayerName().c_str(), info->GetAgeInstanceName()); desc = plString::Format("%s' %s", nc->GetPlayerName().c_str(), info->GetAgeInstanceName());
else else
desc = plString::Format("%s's %s", nc->GetPlayerName().c_str(), info->GetAgeInstanceName()); 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()) { if (!info->HasAgeInstanceGuid()) {

2
Sources/Plasma/PubUtilLib/plNetClient/plNetObjectDebugger.cpp

@ -130,7 +130,7 @@ bool plNetObjectDebugger::DebugObject::ObjectMatches(const hsKeyedObject* obj)
if ((fFlags & kPageMatch)==0) if ((fFlags & kPageMatch)==0)
{ {
// match based on object name only // 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); return (obj->GetKey()->GetUoid().GetLocation()==fLoc);

4
Sources/Plasma/PubUtilLib/plNetCommon/plNetServerSessionInfo.cpp

@ -663,11 +663,11 @@ plString plNetServerSessionInfo::AsLogString() const
const char* spacer = kSemicolon; const char* spacer = kSemicolon;
plStringStream ss; plStringStream ss;
plString typeName = _TEMP_CONVERT_FROM_LITERAL(""); plString typeName;
if (HasServerType()) if (HasServerType())
{ {
typeName = _TEMP_CONVERT_FROM_LITERAL(plNetServerConstants::GetServerTypeStr(fServerType)); typeName = plNetServerConstants::GetServerTypeStr(fServerType);
} }
if (HasServerName()) if (HasServerName())

14
Sources/Plasma/PubUtilLib/plNetGameLib/Private/plNglAuth.cpp

@ -2196,7 +2196,7 @@ static bool Recv_ServerAddr (
s_active->token = msg.token; s_active->token = msg.token;
s_active->addr.SetHost(msg.srvAddr); s_active->addr.SetHost(msg.srvAddr);
plString logmsg = _TEMP_CONVERT_FROM_LITERAL("SrvAuth addr: "); plString logmsg = "SrvAuth addr: ";
logmsg += s_active->addr.GetHostString(); logmsg += s_active->addr.GetHostString();
LogMsg(kLogPerf, L"SrvAuth addr: %s", logmsg.c_str()); LogMsg(kLogPerf, L"SrvAuth addr: %s", logmsg.c_str());
} }
@ -2804,8 +2804,8 @@ AccountCreateRequestTrans::AccountCreateRequestTrans (
StrCopy(m_accountName, accountName, arrsize(m_accountName)); StrCopy(m_accountName, accountName, arrsize(m_accountName));
CryptHashPassword( CryptHashPassword(
_TEMP_CONVERT_FROM_WCHAR_T(m_accountName), plString::FromWchar(m_accountName),
_TEMP_CONVERT_FROM_WCHAR_T(password), plString::FromWchar(password),
m_namePassHash m_namePassHash
); );
} }
@ -2874,8 +2874,8 @@ AccountCreateFromKeyRequestTrans::AccountCreateFromKeyRequestTrans (
StrCopy(m_accountName, accountName, arrsize(m_accountName)); StrCopy(m_accountName, accountName, arrsize(m_accountName));
CryptHashPassword( CryptHashPassword(
_TEMP_CONVERT_FROM_WCHAR_T(m_accountName), plString::FromWchar(m_accountName),
_TEMP_CONVERT_FROM_WCHAR_T(password), plString::FromWchar(password),
m_namePassHash m_namePassHash
); );
} }
@ -3172,8 +3172,8 @@ AccountChangePasswordRequestTrans::AccountChangePasswordRequestTrans (
StrCopy(m_accountName, accountName, arrsize(m_accountName)); StrCopy(m_accountName, accountName, arrsize(m_accountName));
CryptHashPassword( CryptHashPassword(
_TEMP_CONVERT_FROM_WCHAR_T(m_accountName), plString::FromWchar(m_accountName),
_TEMP_CONVERT_FROM_WCHAR_T(password), plString::FromWchar(password),
m_namePassHash m_namePassHash
); );
} }

2
Sources/Plasma/PubUtilLib/plNetMessage/plNetMessage.cpp

@ -1104,7 +1104,7 @@ int plNetMsgMemberUpdate::IPokeBuffer(hsStream* stream, uint32_t peekOptions)
if (bytes) if (bytes)
{ {
// FIX ME to something nice // FIX ME to something nice
fMemberInfo.GetClientGuid()->SetClientKey(_TEMP_CONVERT_FROM_LITERAL("")); fMemberInfo.GetClientGuid()->SetClientKey(plString());
fMemberInfo.GetClientGuid()->SetAccountUUID(plUUID()); fMemberInfo.GetClientGuid()->SetAccountUUID(plUUID());
fMemberInfo.Poke(stream, peekOptions); fMemberInfo.Poke(stream, peekOptions);
stream->WriteByte(fAddMember); stream->WriteByte(fAddMember);

2
Sources/Plasma/PubUtilLib/plNetMessage/plNetMsgHelpers.cpp

@ -505,7 +505,7 @@ int plNetMsgMemberListHelper::Poke(hsStream* stream, const uint32_t peekOptions)
int i; int i;
for(i=0;i<numMembers;i++) for(i=0;i<numMembers;i++)
{ {
fMembers[i]->GetClientGuid()->SetClientKey(_TEMP_CONVERT_FROM_LITERAL("")); fMembers[i]->GetClientGuid()->SetClientKey(plString());
fMembers[i]->GetClientGuid()->SetAccountUUID(plUUID()); fMembers[i]->GetClientGuid()->SetAccountUUID(plUUID());
fMembers[i]->Poke(stream, peekOptions); fMembers[i]->Poke(stream, peekOptions);
} }

2
Sources/Plasma/PubUtilLib/plNetTransport/plNetTransportMember.cpp

@ -77,7 +77,7 @@ plString plNetTransportMember::AsString() const
{ {
if (IsServer()) if (IsServer())
{ {
return _TEMP_CONVERT_FROM_LITERAL("(server)"); return "(server)";
} }
else else
{ {

4
Sources/Plasma/PubUtilLib/plPhysX/plPXPhysical.cpp

@ -616,7 +616,7 @@ bool plPXPhysical::HandleRefMsg(plGenRefMsg* refMsg)
plKey ourKey = GetKey(); plKey ourKey = GetKey();
PhysRefType refType = PhysRefType(refMsg->fType); PhysRefType refType = PhysRefType(refMsg->fType);
plString refKeyName = refKey ? refKey->GetName() : _TEMP_CONVERT_FROM_LITERAL("MISSING"); plString refKeyName = refKey ? refKey->GetName() : "MISSING";
if (refType == kPhysRefWorld) if (refType == kPhysRefWorld)
{ {
@ -694,7 +694,7 @@ plPhysical& plPXPhysical::SetProperty(int prop, bool status)
case plSimulationInterface::kNoSynchronize: propName = "kNoSynchronize"; break; case plSimulationInterface::kNoSynchronize: propName = "kNoSynchronize"; break;
} }
plString name = _TEMP_CONVERT_FROM_LITERAL("(unknown)"); plString name = "(unknown)";
if (GetKey()) if (GetKey())
name = GetKeyName(); name = GetKeyName();
if (plSimulationMgr::fExtraProfile) if (plSimulationMgr::fExtraProfile)

8
Sources/Plasma/PubUtilLib/plPhysical/plPhysicalSDLModifier.cpp

@ -220,22 +220,22 @@ void plPhysicalSDLModifier::ILogState(const plStateDataRecord* state, bool useDi
if (isPosSet) if (isPosSet)
log += plString::Format(" Pos=%.1f %.1f %.1f", pos.fX, pos.fY, pos.fZ); log += plString::Format(" Pos=%.1f %.1f %.1f", pos.fX, pos.fY, pos.fZ);
else else
log += _TEMP_CONVERT_FROM_LITERAL(" Pos=None"); log += " Pos=None";
if (isLinVSet) if (isLinVSet)
log += plString::Format(" LinV=%.1f %.1f %.1f", linV.fX, linV.fY, linV.fZ); log += plString::Format(" LinV=%.1f %.1f %.1f", linV.fX, linV.fY, linV.fZ);
else else
log += _TEMP_CONVERT_FROM_LITERAL(" LinV=None"); log += " LinV=None";
if (isAngVSet) if (isAngVSet)
log += plString::Format(" AngV=%.1f %.1f %.1f", angV.fX, angV.fY, angV.fZ); log += plString::Format(" AngV=%.1f %.1f %.1f", angV.fX, angV.fY, angV.fZ);
else else
log += _TEMP_CONVERT_FROM_LITERAL(" AngV=None"); log += " AngV=None";
if (isRotSet) if (isRotSet)
log += plString::Format(" Rot=%.1f %.1f %.1f %.1f", rot.fX, rot.fY, rot.fZ, rot.fW); log += plString::Format(" Rot=%.1f %.1f %.1f %.1f", rot.fX, rot.fY, rot.fZ, rot.fW);
else else
log += _TEMP_CONVERT_FROM_LITERAL(" Rot=None"); log += " Rot=None";
IGetLog()->AddLine(log.c_str(), color); IGetLog()->AddLine(log.c_str(), color);
} }

6
Sources/Plasma/PubUtilLib/plPipeline/plDXPipeline.cpp

@ -1341,10 +1341,10 @@ bool plDXPipeline::ICreateDeviceObjects()
/// Ok, we're done now /// Ok, we're done now
#if MCN_BOUNDS_SPANS #if MCN_BOUNDS_SPANS
fBoundsSpans = new plDrawableSpans(); 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 ); fBoundsSpans->SetNativeProperty( plDrawable::kPropVolatile, true );
fBoundsMat = new hsGMaterial(); 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(); plLayer *lay = fBoundsMat->MakeBaseLayer();
lay->SetMiscFlags( hsGMatState::kMiscWireFrame | hsGMatState::kMiscTwoSided ); lay->SetMiscFlags( hsGMatState::kMiscWireFrame | hsGMatState::kMiscTwoSided );
lay->SetShadeFlags( lay->GetShadeFlags() | hsGMatState::kShadeWhite ); lay->SetShadeFlags( lay->GetShadeFlags() | hsGMatState::kShadeWhite );
@ -9375,7 +9375,7 @@ void plDXPipeline::IMakeOcclusionSnap()
ident.Reset(); ident.Reset();
hsGMaterial* mat = new hsGMaterial; 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(); plLayer *lay = mat->MakeBaseLayer();
lay->SetZFlags(hsGMatState::kZNoZWrite); lay->SetZFlags(hsGMatState::kZNoZWrite);
lay->SetPreshadeColor(hsColorRGBA().Set(1.f, 0.5f, 0.5f, 1.f)); lay->SetPreshadeColor(hsColorRGBA().Set(1.f, 0.5f, 0.5f, 1.f));

6
Sources/Plasma/PubUtilLib/plResMgr/plKeyFinder.cpp

@ -109,7 +109,7 @@ bool NameMatches(const char* obName, const char* pKName, bool subString)
} }
else else
{ {
if (_TEMP_CONVERT_FROM_LITERAL(p).Find(o, plString::kCaseInsensitive) >= 0) if (plString(p).Find(o, plString::kCaseInsensitive) >= 0)
return true; return true;
} }
@ -264,12 +264,12 @@ void plKeyFinder::IGetNames(std::vector<plString>& names, const plString& search
void plKeyFinder::GetResponderNames(std::vector<plString>& names) void plKeyFinder::GetResponderNames(std::vector<plString>& names)
{ {
IGetNames(names, _TEMP_CONVERT_FROM_LITERAL(""), CLASS_INDEX_SCOPED(plResponderModifier)); IGetNames(names, plString(), CLASS_INDEX_SCOPED(plResponderModifier));
} }
void plKeyFinder::GetActivatorNames(std::vector<plString>& names) void plKeyFinder::GetActivatorNames(std::vector<plString>& names)
{ {
IGetNames(names, _TEMP_CONVERT_FROM_LITERAL(""), CLASS_INDEX_SCOPED(plLogicModifier)); IGetNames(names, plString(), CLASS_INDEX_SCOPED(plLogicModifier));
} }
class plKeyFinderIterator : public plRegistryKeyIterator, public plRegistryPageIterator class plKeyFinderIterator : public plRegistryKeyIterator, public plRegistryPageIterator

8
Sources/Plasma/PubUtilLib/plResMgr/plResManager.cpp

@ -536,9 +536,9 @@ inline plKeyImp* IFindKeyLocalized(const plUoid& uoid, plRegistryPageNode* page)
if ((!objectName.IsNull()) && plLocalization::IsLocalized()) if ((!objectName.IsNull()) && plLocalization::IsLocalized())
{ {
char localName[256]; 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) if (localKey != nil)
return localKey; return localKey;
} }
@ -921,7 +921,7 @@ plKey plResManager::ICloneKey(const plUoid& objUoid, uint32_t playerID, uint32_t
fCurCloneID = cloneID; fCurCloneID = cloneID;
fCurClonePlayerID = playerID; fCurClonePlayerID = playerID;
plKey cloneKey = ReRegister(_TEMP_CONVERT_FROM_LITERAL(""), objUoid); plKey cloneKey = ReRegister(plString(), objUoid);
fCurClonePlayerID = 0; fCurClonePlayerID = 0;
fCurCloneID = 0; fCurCloneID = 0;
@ -1272,7 +1272,7 @@ public:
{ {
if (stricmp(page->GetPageInfo().GetAge(), fAgeName) == 0) 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()); fLocations.push_back(uoid.GetLocation());
} }
return true; return true;

6
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 "plNetMessage/plNetMessage.h"
#include "pnNetCommon/plNetApp.h" #include "pnNetCommon/plNetApp.h"
const plString plSDL::kAgeSDLObjectName = _TEMP_CONVERT_FROM_LITERAL("AgeSDLHook"); const plString plSDL::kAgeSDLObjectName = "AgeSDLHook";
// static // static
const uint8_t plStateDataRecord::kIOVersion=6; const uint8_t plStateDataRecord::kIOVersion=6;
@ -737,7 +737,7 @@ void plStateDataRecord::DumpToObjectDebugger(const char* msg, bool dirtyOnly, in
plString pad; plString pad;
int i; int i;
for(i=0;i<level; i++) for(i=0;i<level; i++)
pad += _TEMP_CONVERT_FROM_LITERAL(" "); pad += " ";
int numVars = dirtyOnly ? GetNumDirtyVars() : GetNumUsedVars(); int numVars = dirtyOnly ? GetNumDirtyVars() : GetNumUsedVars();
int numSDVars = dirtyOnly ? GetNumDirtySDVars() : GetNumUsedSDVars(); int numSDVars = dirtyOnly ? GetNumDirtySDVars() : GetNumUsedSDVars();
@ -808,7 +808,7 @@ void plStateDataRecord::DumpToStream(hsStream* stream, const char* msg, bool dir
} }
} }
logStr = _TEMP_CONVERT_FROM_LITERAL("\n"); logStr = "\n";
stream->Write(logStr.GetSize(), logStr.c_str()); stream->Write(logStr.GetSize(), logStr.c_str());
} }

2
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"); hsAssert(false, "passing wrong value type to SDL variable");
return _TEMP_CONVERT_FROM_LITERAL("(nil)"); return "(nil)";
} }
#pragma optimize( "g", off ) // disable float optimizations #pragma optimize( "g", off ) // disable float optimizations

10
Sources/Plasma/PubUtilLib/plScene/plRelevanceMgr.cpp

@ -222,7 +222,7 @@ void plRelevanceMgr::ParseCsvInput(hsStream *s)
plRegionInfo *info = new plRegionInfo; plRegionInfo *info = new plRegionInfo;
regions.Append(info); regions.Append(info);
info->fName = hsStrcpy(buff); info->fName = hsStrcpy(buff);
info->fIndex = GetIndex(_TEMP_CONVERT_FROM_LITERAL(buff)); info->fIndex = GetIndex(buff);
} }
} }
else // parsing actual settings. else // parsing actual settings.
@ -231,7 +231,7 @@ void plRelevanceMgr::ParseCsvInput(hsStream *s)
if (!toke.Next(buff, kBufSize)) if (!toke.Next(buff, kBufSize))
continue; continue;
int rowIndex = GetIndex(_TEMP_CONVERT_FROM_LITERAL(buff)); int rowIndex = GetIndex(buff);
int column = 0; int column = 0;
while (toke.Next(buff, kBufSize) && column < regions.GetCount()) while (toke.Next(buff, kBufSize) && column < regions.GetCount())
{ {
@ -252,20 +252,20 @@ plString plRelevanceMgr::GetRegionNames(hsBitVector regions)
{ {
plString retVal; plString retVal;
if (regions.IsBitSet(0)) if (regions.IsBitSet(0))
retVal = _TEMP_CONVERT_FROM_LITERAL("-Nowhere (0)-"); retVal = "-Nowhere (0)-";
for (int i = 0; i < fRegions.GetCount(); ++i) for (int i = 0; i < fRegions.GetCount(); ++i)
{ {
if (regions.IsBitSet(i + 1)) if (regions.IsBitSet(i + 1))
{ {
if (!retVal.IsEmpty()) if (!retVal.IsEmpty())
retVal += _TEMP_CONVERT_FROM_LITERAL(", "); retVal += ", ";
if (fRegions[i]) if (fRegions[i])
retVal += fRegions[i]->GetKeyName(); retVal += fRegions[i]->GetKeyName();
} }
} }
if (retVal.IsEmpty()) if (retVal.IsEmpty())
retVal = _TEMP_CONVERT_FROM_LITERAL("<NONE>"); retVal = "<NONE>";
return retVal; return retVal;
} }

12
Sources/Plasma/PubUtilLib/plStatGather/plAutoProfile.cpp

@ -219,7 +219,7 @@ void plAutoProfileImp::INextProfile()
if (!fLastSpawnPointName.IsNull()) if (!fLastSpawnPointName.IsNull())
{ {
const char * ageName = NetCommGetAge()->ageDatasetName; const char * ageName = NetCommGetAge()->ageDatasetName;
plProfileManagerFull::Instance().LogStats(ageName, _TEMP_CONVERT_TO_CONST_CHAR(fLastSpawnPointName)); plProfileManagerFull::Instance().LogStats(ageName, fLastSpawnPointName.c_str());
plMipmap mipmap; plMipmap mipmap;
if (plClient::GetInstance()->GetPipeline()->CaptureScreen(&mipmap)) if (plClient::GetInstance()->GetPipeline()->CaptureScreen(&mipmap))
@ -276,8 +276,8 @@ bool plAutoProfileImp::INextAge()
link.SetLinkingRules(plNetCommon::LinkingRules::kBasicLink); link.SetLinkingRules(plNetCommon::LinkingRules::kBasicLink);
plNetLinkingMgr::GetInstance()->LinkToAge(&link); plNetLinkingMgr::GetInstance()->LinkToAge(&link);
fStatusMessage = _TEMP_CONVERT_FROM_LITERAL("Linking to age "); fStatusMessage = "Linking to age ";
fStatusMessage += _TEMP_CONVERT_FROM_LITERAL(ageName); fStatusMessage += ageName;
return true; return true;
} }
@ -299,7 +299,7 @@ bool plAutoProfileImp::INextSpawnPoint()
if (fLastSpawnPointName.CompareN(kPerfSpawnPrefix, kPerfSpawnLen) == 0) if (fLastSpawnPointName.CompareN(kPerfSpawnPrefix, kPerfSpawnLen) == 0)
{ {
fStatusMessage = _TEMP_CONVERT_FROM_LITERAL("Profiling spawn point "); fStatusMessage = "Profiling spawn point ";
fStatusMessage += fLastSpawnPointName; fStatusMessage += fLastSpawnPointName;
foundGood = true; foundGood = true;
@ -312,7 +312,7 @@ bool plAutoProfileImp::INextSpawnPoint()
if (!foundGood) if (!foundGood)
{ {
fLastSpawnPointName = plString::Null; fLastSpawnPointName = plString::Null;
fStatusMessage = _TEMP_CONVERT_FROM_LITERAL("No profile spawn point found"); fStatusMessage = "No profile spawn point found";
return false; return false;
} }
@ -368,7 +368,7 @@ bool plAutoProfileImp::MsgReceive(plMessage* msg)
ms); 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) // Age is loaded, start profiling in 5 seconds (to make sure the avatar is linked in all the way)
plTimerCallbackMsg* timerMsg = new plTimerCallbackMsg(GetKey()); plTimerCallbackMsg* timerMsg = new plTimerCallbackMsg(GetKey());

8
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 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 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 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 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));
} }
/////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////

2
Sources/Plasma/PubUtilLib/plSurface/hsGMaterial.cpp

@ -136,7 +136,7 @@ plLayer* hsGMaterial::MakeBaseLayer()
if( !GetKey()->GetName().IsNull() ) if( !GetKey()->GetName().IsNull() )
buff = plString::Format("%s_Layer", GetKey()->GetName().c_str()); buff = plString::Format("%s_Layer", GetKey()->GetName().c_str());
else else
buff = _TEMP_CONVERT_FROM_LITERAL("Layer"); buff = "Layer";
hsgResMgr::ResMgr()->NewKey( buff, newLay, GetKey() != nil ? GetKey()->GetUoid().GetLocation() : plLocation::kGlobalFixedLoc ); hsgResMgr::ResMgr()->NewKey( buff, newLay, GetKey() != nil ? GetKey()->GetUoid().GetLocation() : plLocation::kGlobalFixedLoc );
// Add layer so we have it now. // Add layer so we have it now.

4
Sources/Tools/MaxComponent/plAnimComponent.cpp

@ -719,7 +719,7 @@ bool plAnimComponentBase::PreConvert(plMaxNode *node, plErrorMsg *pErrMsg)
plString animName = plString::FromUtf8(fCompPB->GetStr(kAnimName)); plString animName = plString::FromUtf8(fCompPB->GetStr(kAnimName));
if (animName.IsEmpty()) if (animName.IsEmpty())
animName = _TEMP_CONVERT_FROM_LITERAL(ENTIRE_ANIMATION_NAME); animName = ENTIRE_ANIMATION_NAME;
if (fCompPB->GetInt(ParamID(kAnimUseGlobal))) if (fCompPB->GetInt(ParamID(kAnimUseGlobal)))
{ {
@ -995,7 +995,7 @@ plString plAnimComponentBase::GetIfaceSegmentName( bool allowNil )
plString name = GetAnimName(); plString name = GetAnimName();
if( allowNil || !name.IsNull() ) if( allowNil || !name.IsNull() )
return name; return name;
return _TEMP_CONVERT_FROM_LITERAL( ENTIRE_ANIMATION_NAME ); return ENTIRE_ANIMATION_NAME;
} }
//// Hit Callback for Animations ///////////////////////////////////////////// //// Hit Callback for Animations /////////////////////////////////////////////

8
Sources/Tools/MaxComponent/plAudioComponents.cpp

@ -622,7 +622,7 @@ plSoundBuffer *plBaseSoundEmitterComponent::IGetSourceBuffer( const char *file
char tempPath[ MAX_PATH ]; char tempPath[ MAX_PATH ];
strncpy(tempPath, fileName, MAX_PATH); strncpy(tempPath, fileName, MAX_PATH);
::PathStripPath( tempPath ); ::PathStripPath( tempPath );
keyName = _TEMP_CONVERT_FROM_LITERAL( tempPath ); keyName = tempPath;
// TEMP HACK until we get packed sounds: // 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 // 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 ); plFileUtils::CreateDir( fullPath );
// Now finish the path... // Now finish the path...
strcat( fullPath, _TEMP_CONVERT_TO_CONST_CHAR( keyName ) ); strcat( fullPath, keyName.c_str() );
// Check filestamp // Check filestamp
WIN32_FILE_ATTRIBUTE_DATA oldFileAttrib, newFileAttrib; 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 // Additional info for the keyName--need some flag mangling, specifically for the left/right channel mangling
if( srcBufferFlags & plSoundBuffer::kOnlyLeftChannel ) if( srcBufferFlags & plSoundBuffer::kOnlyLeftChannel )
keyName += _TEMP_CONVERT_FROM_LITERAL( ":L" ); keyName += ":L";
else if( srcBufferFlags & plSoundBuffer::kOnlyRightChannel ) else if( srcBufferFlags & plSoundBuffer::kOnlyRightChannel )
keyName += _TEMP_CONVERT_FROM_LITERAL( ":R" ); keyName += ":R";
key = srcNode->FindPageKey( plSoundBuffer::Index(), keyName ); key = srcNode->FindPageKey( plSoundBuffer::Index(), keyName );
if( key != nil ) if( key != nil )

6
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; // MakeCharacterHierarchy will attach agmodifiers to all the bones in the hierarchy;
// have to manually add any for non-bone objects... // 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)); 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 // Get the position and radius of the head and torso physicals
if (ClassID() == AVATAR_CLASS_ID || ClassID() == LOD_AVATAR_CLASS_ID) 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(); plString name = node->GetKey()->GetName();
node->MakeCharacterHierarchy(pErrMsg); node->MakeCharacterHierarchy(pErrMsg);
node->SetupBonesAliasesRecur(_TEMP_CONVERT_TO_CONST_CHAR(name)); node->SetupBonesAliasesRecur(name.c_str());
// create and register the player modifier // create and register the player modifier

2
Sources/Tools/MaxComponent/plClickDragComponent.cpp

@ -453,7 +453,7 @@ bool plClickDragComponent::Convert(plMaxNode *node, plErrorMsg *pErrMsg)
{ {
//pMsg->SetAnimName(ENTIRE_ANIMATION_NAME); //pMsg->SetAnimName(ENTIRE_ANIMATION_NAME);
pMsg->SetAnimName(pAnim->GetModKey(node)->GetName()); pMsg->SetAnimName(pAnim->GetModKey(node)->GetName());
pAxis->SetAnimLabel(_TEMP_CONVERT_FROM_LITERAL(ENTIRE_ANIMATION_NAME)); pAxis->SetAnimLabel(ENTIRE_ANIMATION_NAME);
} }
else else
{ {

2
Sources/Tools/MaxComponent/plFootstepComponent.cpp

@ -115,7 +115,7 @@ bool plFootstepSoundComponent::Convert(plMaxNode *node, plErrorMsg *pErrMsg)
plArmatureEffectFootSound *effect = new plArmatureEffectFootSound(); plArmatureEffectFootSound *effect = new plArmatureEffectFootSound();
// Note: MUST be a hard-coded keyname, since we search for same name in plArmatureMod.cpp // 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; int i;
for (i = 0; i < plArmatureEffectsMgr::kMaxSurface; i++) for (i = 0; i < plArmatureEffectsMgr::kMaxSurface; i++)

4
Sources/Tools/MaxComponent/plGUIComponents.cpp

@ -2728,7 +2728,7 @@ bool plGUIKnobCtrlComponent::Convert(plMaxNode *node, plErrorMsg *pErrMsg)
plAGMasterMod *master = node->GetAGMasterMod(); plAGMasterMod *master = node->GetAGMasterMod();
hsTArray<plKey> keys; hsTArray<plKey> keys;
keys.Append( master->GetKey() ); 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 ) if( fCompPB->GetInt( kRefOrientation ) == 1 )
@ -4450,7 +4450,7 @@ bool plGUIProgressCtrlComponent::Convert(plMaxNode *node, plErrorMsg *pErrMsg)
plAGMasterMod *master = node->GetAGMasterMod(); plAGMasterMod *master = node->GetAGMasterMod();
hsTArray<plKey> keys; hsTArray<plKey> keys;
keys.Append( master->GetKey() ); 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 ); const char *errMsg = ISetSoundIndex( kRefAnimateSound, kRefAnimateSoundComp, pfGUIProgressCtrl::kAnimateSound, node );

4
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); int matchedFields = sscanf(note, " %[^@] @ %s ", segName, segSuffix);
plString name = _TEMP_CONVERT_FROM_LITERAL(segName); plString name = segName;
plString suffix = _TEMP_CONVERT_FROM_LITERAL(segSuffix); plString suffix = segSuffix;
if (matchedFields == 2) if (matchedFields == 2)
{ {

6
Sources/Tools/MaxComponent/plPythonFileComponent.cpp

@ -457,7 +457,7 @@ bool plPythonFileComponent::Convert(plMaxNode *node, plErrorMsg *pErrMsg)
break; break;
case plAutoUIParam::kTypeString: case plAutoUIParam::kTypeString:
pyParam.SetToString(_TEMP_CONVERT_FROM_LITERAL(param->GetString(pb))); pyParam.SetToString(param->GetString(pb));
mod->AddParameter(pyParam); mod->AddParameter(pyParam);
break; break;
@ -807,7 +807,7 @@ bool plPythonFileComponent::Convert(plMaxNode *node, plErrorMsg *pErrMsg)
// save out the animation name first // save out the animation name first
plString tempAnimName = animcomp->GetAnimName(); plString tempAnimName = animcomp->GetAnimName();
if (tempAnimName.IsNull()) if (tempAnimName.IsNull())
pyParam.SetToAnimationName(_TEMP_CONVERT_FROM_LITERAL(ENTIRE_ANIMATION_NAME)); pyParam.SetToAnimationName(ENTIRE_ANIMATION_NAME);
else else
pyParam.SetToAnimationName(tempAnimName); pyParam.SetToAnimationName(tempAnimName);
mod->AddParameter(pyParam); mod->AddParameter(pyParam);
@ -929,7 +929,7 @@ bool plPythonFileComponent::Convert(plMaxNode *node, plErrorMsg *pErrMsg)
break; break;
case plAutoUIParam::kTypeDropDownList: case plAutoUIParam::kTypeDropDownList:
pyParam.SetToString(_TEMP_CONVERT_FROM_LITERAL(param->GetString(pb))); pyParam.SetToString(param->GetString(pb));
mod->AddParameter(pyParam); mod->AddParameter(pyParam);
break; break;

3
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<plKey>& keys) int ISearchLayerRecur(hsGMaterial* mat, const plString &segName, hsTArray<plKey>& keys)
{ {
plString name = segName.IsNull() ? _TEMP_CONVERT_FROM_LITERAL("") : segName;
int i; int i;
for( i = 0; i < mat->GetNumLayers(); i++ ) for( i = 0; i < mat->GetNumLayers(); i++ )
ISearchLayerRecur(mat->GetLayer(i), name, keys); ISearchLayerRecur(mat->GetLayer(i), segName, keys);
return keys.GetCount(); return keys.GetCount();
} }

2
Sources/Tools/MaxConvert/hsControlConverter.cpp

@ -2158,7 +2158,7 @@ void hsControlConverter::IExportAnimatedCameraFOV(plMaxNode* node, hsTArray <hsG
pMsg->AddReceiver(pCamMod->GetKey()); pMsg->AddReceiver(pCamMod->GetKey());
pMsg->SetSender(pAnim->GetModKey(node)); pMsg->SetSender(pAnim->GetModKey(node));
pMsg->SetCmd(plAnimCmdMsg::kAddCallbacks); 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->fTime = kfArray[0][i].fFrame / MAX_FRAMES_PER_SEC;
pMsg->AddCallback(pCall); pMsg->AddCallback(pCall);
hsRefCnt_SafeUnRef(pCall); hsRefCnt_SafeUnRef(pCall);

2
Sources/Tools/MaxConvert/hsConverterUtils.cpp

@ -346,7 +346,7 @@ INode* hsConverterUtils::FindINodeFromKeyedObject(hsKeyedObject* obj)
{ {
hsGuardBegin("hsConverterUtils::FindINodeFromKeyedObject"); hsGuardBegin("hsConverterUtils::FindINodeFromKeyedObject");
INode* retVal = FindINodeFromMangledName(_TEMP_CONVERT_TO_CONST_CHAR(obj->GetKey()->GetName())); INode* retVal = FindINodeFromMangledName(obj->GetKey()->GetName().c_str());
if( retVal ) if( retVal )
return (retVal); return (retVal);

30
Sources/Tools/MaxConvert/hsMaterialConverter.cpp

@ -762,7 +762,7 @@ hsMaterialConverter::CreateMaterialArray(Mtl *maxMaterial, plMaxNode *node, uint
if (maxMaterial) if (maxMaterial)
name = plString::FromUtf8(maxMaterial->GetName()); name = plString::FromUtf8(maxMaterial->GetName());
else else
name = _TEMP_CONVERT_FROM_LITERAL("nil"); name = "nil";
/// Get the material /// Get the material
bool isMultiMat = IsMultiMat( maxMaterial ); bool isMultiMat = IsMultiMat( maxMaterial );
@ -1183,7 +1183,7 @@ hsGMaterial *hsMaterialConverter::IProcessMaterial(Mtl *mtl, plMaxNode *node, co
plLayer* hLay = new plLayer; plLayer* hLay = new plLayer;
hLay->InitToDefault(); hLay->InitToDefault();
hsgResMgr::ResMgr()->NewKey(name + _TEMP_CONVERT_FROM_LITERAL("_DefLay"), hLay, nodeLoc); hsgResMgr::ResMgr()->NewKey(name + "_DefLay", hLay, nodeLoc);
IAddLayerToMaterial(hMat, hLay); IAddLayerToMaterial(hMat, hLay);
} }
@ -1337,7 +1337,7 @@ hsGMaterial *hsMaterialConverter::IAddDefaultMaterial(plMaxNode *node)
plLayer *layer = new plLayer; plLayer *layer = new plLayer;
layer->InitToDefault(); 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(); DWORD color = node->GetWireColor();
float r = float(GetRValue(color)) / 255.f; float r = float(GetRValue(color)) / 255.f;
@ -1353,8 +1353,8 @@ hsGMaterial *hsMaterialConverter::IAddDefaultMaterial(plMaxNode *node)
plMipmap *hsMaterialConverter::IGetUVTransTexture(plMaxNode *node, bool useU /* = true */) plMipmap *hsMaterialConverter::IGetUVTransTexture(plMaxNode *node, bool useU /* = true */)
{ {
plString texName = (useU ? _TEMP_CONVERT_FROM_LITERAL("ALPHA_BLEND_FILTER_U2ALPHA_TRANS_64x4") plString texName = (useU ? "ALPHA_BLEND_FILTER_U2ALPHA_TRANS_64x4"
: _TEMP_CONVERT_FROM_LITERAL("ALPHA_BLEND_FILTER_V2ALPHA_TRANS_4x64") ); : "ALPHA_BLEND_FILTER_V2ALPHA_TRANS_4x64" );
int w = (useU ? 64 : 4); int w = (useU ? 64 : 4);
int h = (useU ? 4 : 64); int h = (useU ? 4 : 64);
@ -1412,7 +1412,7 @@ void hsMaterialConverter::IInsertSingleBlendLayer(plMipmap *texture, hsGMaterial
plLayer* layer = new plLayer; plLayer* layer = new plLayer;
layer->InitToDefault(); 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); 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->SetAmbientColor(hsColorRGBA().Set(1.f, 1.f, 1.f, 1.f));
// layer->SetZFlags(hsGMatState::kZNoZWrite | hsGMatState::kZIncLayer); // layer->SetZFlags(hsGMatState::kZNoZWrite | hsGMatState::kZIncLayer);
@ -1848,7 +1848,7 @@ plLayerAnimation *IConvertNoteTrackAnims(plLayerAnimation *animLayer, SegmentMap
void ISetDefaultAnim(plPassMtlBase* mtl, plAnimTimeConvert& tc, SegmentMap* segMap) 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()) ) if( segMap && !animName.IsNull() && (segMap->find(animName) != segMap->end()) )
{ {
SegmentSpec *spec = (*segMap)[animName]; SegmentSpec *spec = (*segMap)[animName];
@ -1997,12 +1997,12 @@ static plLayerInterface* IProcessLayerMovie(plPassMtlBase* mtl, plLayerTex* layT
if (isBink) if (isBink)
{ {
movieLayer = new plLayerBink; movieLayer = new plLayerBink;
moviePostfix = _TEMP_CONVERT_FROM_LITERAL("_bink"); moviePostfix = "_bink";
} }
else if (isAvi) else if (isAvi)
{ {
movieLayer = new plLayerAVI; movieLayer = new plLayerAVI;
moviePostfix = _TEMP_CONVERT_FROM_LITERAL("_avi"); moviePostfix = "_avi";
} }
plString movieKeyName = layerIFace->GetKeyName() + moviePostfix; plString movieKeyName = layerIFace->GetKeyName() + moviePostfix;
@ -2075,8 +2075,8 @@ plLayerInterface* IProcessLayerAnimation(plPassMtlBase* mtl, plLayerTex* layTex,
plString segName = stealth->GetSegmentName(); plString segName = stealth->GetSegmentName();
bool isDefault = ( segName.IsNull() || segName.Compare( ENTIRE_ANIMATION_NAME ) == 0 ) ? true : false; bool isDefault = ( segName.IsNull() || segName.Compare( ENTIRE_ANIMATION_NAME ) == 0 ) ? true : false;
plString animName = name + ( ( isDefault ) ? _TEMP_CONVERT_FROM_LITERAL( "_LayerAnim_" ) plString animName = name + ( ( isDefault ) ? "_LayerAnim_"
: ( _TEMP_CONVERT_FROM_LITERAL("_LayerAnim") + segName ) ); : ( plString("_LayerAnim") + segName ) );
hsgResMgr::ResMgr()->NewKey( animName, noteAnim, node->GetLocation() ); hsgResMgr::ResMgr()->NewKey( animName, noteAnim, node->GetLocation() );
StdUVGen *uvGen = (StdUVGen *)layTex->GetTheUVGen(); StdUVGen *uvGen = (StdUVGen *)layTex->GetTheUVGen();
@ -2191,8 +2191,8 @@ plLayerInterface* IProcessAnimation(plPassMtlBase *mtl, plMaxNode *node, const p
plString segName = stealth->GetSegmentName(); plString segName = stealth->GetSegmentName();
bool isDefault = ( segName.IsNull() || segName.Compare( ENTIRE_ANIMATION_NAME ) == 0 ) ? true : false; bool isDefault = ( segName.IsNull() || segName.Compare( ENTIRE_ANIMATION_NAME ) == 0 ) ? true : false;
plString animName = name + ( ( isDefault ) ? _TEMP_CONVERT_FROM_LITERAL( "_anim" ) plString animName = name + ( ( isDefault ) ? "_anim"
: ( _TEMP_CONVERT_FROM_LITERAL("_anim_") + segName ) ); : ( plString("_anim_") + segName ) );
hsgResMgr::ResMgr()->NewKey( animName, noteAnim, node->GetLocation() ); hsgResMgr::ResMgr()->NewKey( animName, noteAnim, node->GetLocation() );
plController *noteColCtl = cc.MakeColorController( maxColCtl, node ); 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) 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 kLUTWidth = 16;
const int kLUTHeight = 16; const int kLUTHeight = 16;
@ -3510,7 +3510,7 @@ BitmapTex* hsMaterialConverter::GetBumpLayer(plMaxNode* node, Mtl* mtl)
plMipmap *hsMaterialConverter::IGetBumpLutTexture(plMaxNode *node) plMipmap *hsMaterialConverter::IGetBumpLutTexture(plMaxNode *node)
{ {
const plString texName = _TEMP_CONVERT_FROM_LITERAL("BumpLutTexture"); const plString texName = "BumpLutTexture";
//#define FUNKYBUMP //#define FUNKYBUMP
#ifndef FUNKYBUMP #ifndef FUNKYBUMP

4
Sources/Tools/MaxConvert/plBitmapCreator.cpp

@ -548,8 +548,8 @@ plBitmap *plBitmapCreator::ICreateTexture( plBitmapData *bd, const plLocation &l
else else
name = plString::Format( "%s*%x", temp, bd->texFlags ); name = plString::Format( "%s*%x", temp, bd->texFlags );
if( bd->invertAlpha ) if( bd->invertAlpha )
name += _TEMP_CONVERT_FROM_LITERAL( "_inva" ); name += "_inva";
name += _TEMP_CONVERT_FROM_LITERAL( ".hsm" ); name += ".hsm";
// Has this texture been used before? // Has this texture been used before?

2
Sources/Tools/MaxMain/plTextureExportLog.cpp

@ -146,7 +146,7 @@ void plTextureExportLog::Write( void )
plRenderTarget* rend = plRenderTarget::ConvertNoRef( node->fBitmap ); plRenderTarget* rend = plRenderTarget::ConvertNoRef( node->fBitmap );
// Name // 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, formatted
size = node->fBitmap->GetTotalSize(); size = node->fBitmap->GetTotalSize();

2
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<plKey>& keys) static int ISearchLayerRecur(hsGMaterial* mat, const plString &segName, hsTArray<plKey>& 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; int i;
for( i = 0; i < mat->GetNumLayers(); i++ ) for( i = 0; i < mat->GetNumLayers(); i++ )
ISearchLayerRecur(mat->GetLayer(i), name, keys); ISearchLayerRecur(mat->GetLayer(i), name, keys);

2
Sources/Tools/MaxPlasmaMtls/Materials/plAnimStealthNode.cpp

@ -254,7 +254,7 @@ plString plAnimStealthNode::GetSegmentName( void ) const
{ {
const char *str = fParamBlock->GetStr( (ParamID)kPBName ); const char *str = fParamBlock->GetStr( (ParamID)kPBName );
if( str == nil || str[ 0 ] == 0 ) if( str == nil || str[ 0 ] == 0 )
return _TEMP_CONVERT_FROM_LITERAL( ENTIRE_ANIMATION_NAME ); return ENTIRE_ANIMATION_NAME;
return plString::FromUtf8(str); return plString::FromUtf8(str);
} }

2
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, // 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. // somewhere in Max. It didn't in 4, it does in 7. This seems to fix it.
if (!loading) if (!loading)
IVerifyStealthPresent(_TEMP_CONVERT_FROM_LITERAL(ENTIRE_ANIMATION_NAME)); IVerifyStealthPresent(ENTIRE_ANIMATION_NAME);
} }
ParamDlg* plBumpMtl::CreateParamDlg(HWND hwMtlEdit, IMtlParams *imp) ParamDlg* plBumpMtl::CreateParamDlg(HWND hwMtlEdit, IMtlParams *imp)

2
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, // 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. // somewhere in Max. It didn't in 4, it does in 7. This seems to fix it.
if (!loading) if (!loading)
IVerifyStealthPresent(_TEMP_CONVERT_FROM_LITERAL(ENTIRE_ANIMATION_NAME)); IVerifyStealthPresent(ENTIRE_ANIMATION_NAME);
} }
ParamDlg* plDecalMtl::CreateParamDlg(HWND hwMtlEdit, IMtlParams *imp) ParamDlg* plDecalMtl::CreateParamDlg(HWND hwMtlEdit, IMtlParams *imp)

2
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, // 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. // somewhere in Max. It didn't in 4, it does in 7. This seems to fix it.
if (!loading) if (!loading)
IVerifyStealthPresent(_TEMP_CONVERT_FROM_LITERAL(ENTIRE_ANIMATION_NAME)); IVerifyStealthPresent(ENTIRE_ANIMATION_NAME);
} }
plPassMtl::~plPassMtl() plPassMtl::~plPassMtl()

6
Sources/Tools/MaxPlasmaMtls/Materials/plPassMtlBase.cpp

@ -215,7 +215,7 @@ plAnimStealthNode *plPassMtlBase::IVerifyStealthPresent( const plString &animN
// New segment, add a new stealth node // New segment, add a new stealth node
stealth = (plAnimStealthNode *)GetCOREInterface()->CreateInstance( HELPER_CLASS_ID, ANIMSTEALTH_CLASSID ); stealth = (plAnimStealthNode *)GetCOREInterface()->CreateInstance( HELPER_CLASS_ID, ANIMSTEALTH_CLASSID );
INode *node = GetCOREInterface()->CreateObjectNode( stealth ); 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() ); stealth->SetNodeName( GetName() );
node->Freeze( true ); node->Freeze( true );
@ -277,7 +277,7 @@ void plPassMtlBase::IUpdateAnimNodes( void )
fStealthsChanged = false; fStealthsChanged = false;
// Verify one for "entire animation" // Verify one for "entire animation"
plAnimStealthNode *stealth = IVerifyStealthPresent( _TEMP_CONVERT_FROM_LITERAL(ENTIRE_ANIMATION_NAME) ); plAnimStealthNode *stealth = IVerifyStealthPresent( ENTIRE_ANIMATION_NAME );
goodNodes.Append( stealth ); goodNodes.Append( stealth );
// Verify segment nodes // Verify segment nodes
@ -519,7 +519,7 @@ void plPassMtlBase::PostLoadAnimPBFixup( void )
plAnimStealthNode *node = (plAnimStealthNode *)fAnimPB->GetReferenceTarget( (ParamID)kPBAnimStealthNodes, 0, i ); plAnimStealthNode *node = (plAnimStealthNode *)fAnimPB->GetReferenceTarget( (ParamID)kPBAnimStealthNodes, 0, i );
plString name = node->GetSegmentName(); plString name = node->GetSegmentName();
node->SetAutoStart( false ); 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->SetEaseIn( plAnimEaseTypes::kNoEase, 1.f, 1.f, 1.f );
node->SetEaseOut( plAnimEaseTypes::kNoEase, 1.f, 1.f, 1.f ); node->SetEaseOut( plAnimEaseTypes::kNoEase, 1.f, 1.f, 1.f );
} }

Loading…
Cancel
Save