Browse Source

Merge pull request #430 from zrax/plFormat_stuff

Start taking over the world with plFormat
Adam Johnson 11 years ago
parent
commit
8ca4af9a78
  1. 4
      Sources/Plasma/Apps/plClient/plClient.cpp
  2. 4
      Sources/Plasma/Apps/plFileEncrypt/main.cpp
  3. 2
      Sources/Plasma/Apps/plFileSecure/main.cpp
  4. 2
      Sources/Plasma/Apps/plPageInfo/plPageInfo.cpp
  5. 2
      Sources/Plasma/Apps/plPageOptimizer/main.cpp
  6. 42
      Sources/Plasma/Apps/plPythonPack/main.cpp
  7. 2
      Sources/Plasma/CoreLib/plFormat.cpp
  8. 13
      Sources/Plasma/CoreLib/plFormat.h
  9. 12
      Sources/Plasma/FeatureLib/pfAnimation/plAnimDebugList.cpp
  10. 12
      Sources/Plasma/FeatureLib/pfAudio/plListener.cpp
  11. 8
      Sources/Plasma/FeatureLib/pfConsole/pfConsole.cpp
  12. 18
      Sources/Plasma/FeatureLib/pfConsole/pfConsoleCommands.cpp
  13. 6
      Sources/Plasma/FeatureLib/pfConsole/pfDispatchLog.cpp
  14. 19
      Sources/Plasma/FeatureLib/pfConsoleCore/pfConsoleEngine.cpp
  15. 2
      Sources/Plasma/FeatureLib/pfGameGUIMgr/pfGUICtrlGenerator.cpp
  16. 2
      Sources/Plasma/FeatureLib/pfGameGUIMgr/pfGUIListElement.cpp
  17. 2
      Sources/Plasma/FeatureLib/pfGameGUIMgr/pfGUIPopUpMenu.cpp
  18. 8
      Sources/Plasma/FeatureLib/pfJournalBook/pfJournalBook.cpp
  19. 26
      Sources/Plasma/FeatureLib/pfLocalizationMgr/pfLocalizationDataMgr.cpp
  20. 2
      Sources/Plasma/FeatureLib/pfPython/cyAvatar.cpp
  21. 14
      Sources/Plasma/FeatureLib/pfPython/cyMisc.cpp
  22. 8
      Sources/Plasma/FeatureLib/pfPython/cyPhysics.cpp
  23. 2
      Sources/Plasma/FeatureLib/pfPython/cyPythonInterface.cpp
  24. 11
      Sources/Plasma/FeatureLib/pfPython/plPythonFileMod.cpp
  25. 4
      Sources/Plasma/FeatureLib/pfPython/plPythonPack.cpp
  26. 2
      Sources/Plasma/FeatureLib/pfPython/plPythonSDLModifier.cpp
  27. 8
      Sources/Plasma/FeatureLib/pfPython/pyAgeInfoStruct.cpp
  28. 4
      Sources/Plasma/FeatureLib/pfPython/pyImage.cpp
  29. 2
      Sources/Plasma/FeatureLib/pfPython/pyJournalBook.cpp
  30. 32
      Sources/Plasma/FeatureLib/pfPython/pySceneObject.cpp
  31. 8
      Sources/Plasma/FeatureLib/pfPython/pyVault.cpp
  32. 2
      Sources/Plasma/FeatureLib/pfPython/pyVaultImageNode.cpp
  33. 2
      Sources/Plasma/FeatureLib/pfSurface/plLayerMovie.cpp
  34. 5
      Sources/Plasma/NucleusLib/pnDispatch/plDispatch.cpp
  35. 4
      Sources/Plasma/NucleusLib/pnKeyedObject/hsKeyedObject.cpp
  36. 6
      Sources/Plasma/NucleusLib/pnMessage/plMessage.cpp
  37. 11
      Sources/Plasma/NucleusLib/pnNetCommon/plGenericVar.cpp
  38. 2
      Sources/Plasma/NucleusLib/pnNetCommon/pnNetCommon.cpp
  39. 4
      Sources/Plasma/PubUtilLib/plAgeDescription/plAgeDescription.cpp
  40. 10
      Sources/Plasma/PubUtilLib/plAgeLoader/plResPatcher.cpp
  41. 2
      Sources/Plasma/PubUtilLib/plAudible/plWinAudible.cpp
  42. 2
      Sources/Plasma/PubUtilLib/plAudio/plVoiceChat.cpp
  43. 21
      Sources/Plasma/PubUtilLib/plAudio/plWin32GroupedSound.cpp
  44. 9
      Sources/Plasma/PubUtilLib/plAudio/plWin32StaticSound.cpp
  45. 14
      Sources/Plasma/PubUtilLib/plAudio/plWin32StreamingSound.cpp
  46. 10
      Sources/Plasma/PubUtilLib/plAvatar/plAnimStage.cpp
  47. 27
      Sources/Plasma/PubUtilLib/plAvatar/plArmatureMod.cpp
  48. 7
      Sources/Plasma/PubUtilLib/plAvatar/plAvBehaviors.cpp
  49. 2
      Sources/Plasma/PubUtilLib/plAvatar/plAvBrainCritter.cpp
  50. 2
      Sources/Plasma/PubUtilLib/plAvatar/plAvBrainHuman.cpp
  51. 4
      Sources/Plasma/PubUtilLib/plAvatar/plAvBrainSwim.cpp
  52. 4
      Sources/Plasma/PubUtilLib/plAvatar/plAvatarClothing.cpp
  53. 2
      Sources/Plasma/PubUtilLib/plAvatar/plAvatarTasks.cpp
  54. 2
      Sources/Plasma/PubUtilLib/plAvatar/plCoopCoordinator.cpp
  55. 2
      Sources/Plasma/PubUtilLib/plAvatar/plSittingModifier.cpp
  56. 16
      Sources/Plasma/PubUtilLib/plContainer/plConfigInfo.h
  57. 53
      Sources/Plasma/PubUtilLib/plContainer/plConfigInfoLogging.cpp
  58. 18
      Sources/Plasma/PubUtilLib/plContainer/plKeysAndValues.cpp
  59. 2
      Sources/Plasma/PubUtilLib/plDrawable/plDrawableGenerator.cpp
  60. 8
      Sources/Plasma/PubUtilLib/plDrawable/plDynaDecalMgr.cpp
  61. 10
      Sources/Plasma/PubUtilLib/plDrawable/plProxyGen.cpp
  62. 56
      Sources/Plasma/PubUtilLib/plDrawable/plWaveSet7.cpp
  63. 2
      Sources/Plasma/PubUtilLib/plGImage/plFontCache.cpp
  64. 13
      Sources/Plasma/PubUtilLib/plInputCore/plSceneInputInterface.cpp
  65. 8
      Sources/Plasma/PubUtilLib/plModifier/plSDLModifier.cpp
  66. 2
      Sources/Plasma/PubUtilLib/plNetClient/plNetCliAgeJoiner.cpp
  67. 2
      Sources/Plasma/PubUtilLib/plNetClient/plNetClientMgr.cpp
  68. 10
      Sources/Plasma/PubUtilLib/plNetClient/plNetClientMgrSend.cpp
  69. 6
      Sources/Plasma/PubUtilLib/plNetClient/plNetClientMsgHandler.cpp
  70. 5
      Sources/Plasma/PubUtilLib/plNetCommon/plSpawnPointInfo.cpp
  71. 6
      Sources/Plasma/PubUtilLib/plNetMessage/plNetMessage.cpp
  72. 16
      Sources/Plasma/PubUtilLib/plPhysX/plPXPhysicalControllerCore.cpp
  73. 21
      Sources/Plasma/PubUtilLib/plPhysical/plPhysicalSDLModifier.cpp
  74. 11
      Sources/Plasma/PubUtilLib/plPipeline/DX/plDXEnumerate.cpp
  75. 4
      Sources/Plasma/PubUtilLib/plPipeline/plCaptureRender.cpp
  76. 8
      Sources/Plasma/PubUtilLib/plPipeline/plPlates.cpp
  77. 3
      Sources/Plasma/PubUtilLib/plProgressMgr/plProgressMgr.cpp
  78. 2
      Sources/Plasma/PubUtilLib/plResMgr/plKeyFinder.cpp
  79. 10
      Sources/Plasma/PubUtilLib/plResMgr/plRegistryNode.cpp
  80. 4
      Sources/Plasma/PubUtilLib/plResMgr/plResManager.cpp
  81. 56
      Sources/Plasma/PubUtilLib/plSDL/plSDLParser.cpp
  82. 64
      Sources/Plasma/PubUtilLib/plSDL/plStateDataRecord.cpp
  83. 147
      Sources/Plasma/PubUtilLib/plSDL/plStateVariable.cpp
  84. 2
      Sources/Plasma/PubUtilLib/plSDL/plVarDescriptor.cpp
  85. 6
      Sources/Plasma/PubUtilLib/plStatGather/plAutoProfile.cpp
  86. 8
      Sources/Plasma/PubUtilLib/plStatGather/plProfileManagerFull.cpp
  87. 21
      Sources/Plasma/PubUtilLib/plStatusLog/plStatusLog.cpp
  88. 2
      Sources/Plasma/PubUtilLib/plSurface/hsGMaterial.cpp
  89. 4
      Sources/Plasma/PubUtilLib/plSurface/plGrassShaderMod.cpp
  90. 2
      Sources/Plasma/PubUtilLib/plVault/plDniCoordinateInfo.cpp
  91. 1
      Sources/Tools/MaxComponent/Pch.h
  92. 2
      Sources/Tools/MaxComponent/plAnimComponent.cpp
  93. 6
      Sources/Tools/MaxComponent/plAudioComponents.cpp
  94. 4
      Sources/Tools/MaxComponent/plAvatarComponent.cpp
  95. 3
      Sources/Tools/MaxComponent/plComponentBase.cpp
  96. 2
      Sources/Tools/MaxComponent/plInventoryObjComponent.cpp
  97. 2
      Sources/Tools/MaxComponent/plMiscComponents.cpp
  98. 2
      Sources/Tools/MaxComponent/plMultistageBehComponent.cpp
  99. 8
      Sources/Tools/MaxComponent/plVolumeGadgetComponent.cpp
  100. 6
      Sources/Tools/MaxConvert/hsConverterUtils.cpp
  101. Some files were not shown because too many files have changed in this diff Show More

4
Sources/Plasma/Apps/plClient/plClient.cpp

@ -774,8 +774,8 @@ bool plClient::MsgReceive(plMessage* msg)
plEventCallbackMsg* callback = plEventCallbackMsg::ConvertNoRef(msg); plEventCallbackMsg* callback = plEventCallbackMsg::ConvertNoRef(msg);
if( callback ) if( callback )
{ {
plString str = plString::Format("Callback event from %s\n", callback->GetSender() plString str = plFormat("Callback event from {}\n", callback->GetSender()
? callback->GetSender()->GetName().c_str() ? callback->GetSender()->GetName()
: "Unknown"); : "Unknown");
hsStatusMessage(str.c_str()); hsStatusMessage(str.c_str());
static int gotten = 0; static int gotten = 0;

4
Sources/Plasma/Apps/plFileEncrypt/main.cpp

@ -108,12 +108,12 @@ void EncryptFiles(const plFileName& dir, const char* ext, bool encrypt)
{ {
if (encrypt) if (encrypt)
{ {
printf("encrypting: %s\n", iter->GetFileName().c_str()); plPrintf("encrypting: {}\n", iter->GetFileName());
plEncryptedStream::FileEncrypt(*iter); plEncryptedStream::FileEncrypt(*iter);
} }
else else
{ {
printf("decrypting: %s\n", iter->GetFileName().c_str()); plPrintf("decrypting: {}\n", iter->GetFileName());
plEncryptedStream::FileDecrypt(*iter); plEncryptedStream::FileDecrypt(*iter);
} }
} }

2
Sources/Plasma/Apps/plFileSecure/main.cpp

@ -110,7 +110,7 @@ void SecureFiles(const plFileName& dir, const plString& ext, uint32_t* key)
std::vector<plFileName> files = plFileSystem::ListDir(dir, ext.c_str()); std::vector<plFileName> files = plFileSystem::ListDir(dir, ext.c_str());
for (auto iter = files.begin(); iter != files.end(); ++iter) for (auto iter = files.begin(); iter != files.end(); ++iter)
{ {
printf("securing: %s\n", iter->GetFileName().c_str()); plPrintf("securing: {}\n", iter->GetFileName());
plSecureStream::FileEncrypt(*iter, key); plSecureStream::FileEncrypt(*iter, key);
} }
} }

2
Sources/Plasma/Apps/plPageInfo/plPageInfo.cpp

@ -240,7 +240,7 @@ public:
const plPageInfo& info = page->GetPageInfo(); const plPageInfo& info = page->GetPageInfo();
plFileName fileName = plFileName::Join(fOutputDir, plFileName fileName = plFileName::Join(fOutputDir,
plString::Format("%s_%s.csv", info.GetAge().c_str(), info.GetPage().c_str())); plFormat("{}_{}.csv", info.GetAge(), info.GetPage()));
fStream.Open(fileName, "wt"); fStream.Open(fileName, "wt");
page->LoadKeys(); page->LoadKeys();

2
Sources/Plasma/Apps/plPageOptimizer/main.cpp

@ -53,7 +53,7 @@ int main(int argc, char* argv[])
} }
plFileName filename = argv[1]; plFileName filename = argv[1];
printf("Optimizing %s...", filename.GetFileName().c_str()); plPrintf("Optimizing {}...", filename);
#ifndef _DEBUG #ifndef _DEBUG
try { try {

42
Sources/Plasma/Apps/plPythonPack/main.cpp

@ -84,11 +84,11 @@ void WritePythonFile(const plFileName &fileName, const plFileName &path, hsStrea
if (!pyStream.Open(filePath) || !glueStream.Open(glueFile)) if (!pyStream.Open(filePath) || !glueStream.Open(glueFile))
{ {
printf("Unable to open path %s, ", filePath.AsString().c_str()); plPrintf("Unable to open path {}, ", filePath);
return; return;
} }
printf("==Packing %s, ", fileName.AsString().c_str()); plPrintf("==Packing {}, ", fileName);
pyStream.FastFwd(); pyStream.FastFwd();
uint32_t pyFileSize = pyStream.GetPosition(); uint32_t pyFileSize = pyStream.GetPosition();
@ -168,20 +168,20 @@ void WritePythonFile(const plFileName &fileName, const plFileName &path, hsStrea
} }
pythonCode = PythonInterface::CompileString(code, fileName); pythonCode = PythonInterface::CompileString(code, fileName);
hsAssert(pythonCode,"Not sure why this didn't compile the second time???"); hsAssert(pythonCode,"Not sure why this didn't compile the second time???");
printf("an import file "); fputs("an import file ", stdout);
} }
else else
printf("a PythonFile modifier(tm) "); fputs("a PythonFile modifier(tm) ", stdout);
} }
else else
{ {
printf("......blast! Error during run-code!\n"); fputs("......blast! Error during run-code!\n", stdout);
char* errmsg; char* errmsg;
int chars_read = PythonInterface::getOutputAndReset(&errmsg); int chars_read = PythonInterface::getOutputAndReset(&errmsg);
if (chars_read > 0) if (chars_read > 0)
{ {
printf("%s\n", errmsg); plPrintf("{}\n", errmsg);
} }
} }
} }
@ -193,20 +193,20 @@ void WritePythonFile(const plFileName &fileName, const plFileName &path, hsStrea
char* pycode; char* pycode;
PythonInterface::DumpObject(pythonCode,&pycode,&size); PythonInterface::DumpObject(pythonCode,&pycode,&size);
printf("\n"); fputc('\n', stdout);
// print any message after each module // print any message after each module
char* errmsg; char* errmsg;
int chars_read = PythonInterface::getOutputAndReset(&errmsg); int chars_read = PythonInterface::getOutputAndReset(&errmsg);
if (chars_read > 0) if (chars_read > 0)
{ {
printf("%s\n", errmsg); plPrintf("{}\n", errmsg);
} }
s->WriteLE32(size); s->WriteLE32(size);
s->Write(size, pycode); s->Write(size, pycode);
} }
else else
{ {
printf("......blast! Compile error!\n"); fputs("......blast! Compile error!\n", stdout);
s->WriteLE32(0); s->WriteLE32(0);
PyErr_Print(); PyErr_Print();
@ -216,7 +216,7 @@ void WritePythonFile(const plFileName &fileName, const plFileName &path, hsStrea
int chars_read = PythonInterface::getOutputAndReset(&errmsg); int chars_read = PythonInterface::getOutputAndReset(&errmsg);
if (chars_read > 0) if (chars_read > 0)
{ {
printf("%s\n", errmsg); plPrintf("{}\n", errmsg);
} }
} }
@ -353,16 +353,16 @@ void FindPackages(std::vector<plFileName>& fileNames, std::vector<plFileName>& p
void PackDirectory(const plFileName& dir, const plFileName& rootPath, const plFileName& pakName, std::vector<plFileName>& extraDirs, bool packSysAndPlasma = false) void PackDirectory(const plFileName& dir, const plFileName& rootPath, const plFileName& pakName, std::vector<plFileName>& extraDirs, bool packSysAndPlasma = false)
{ {
printf("\nCreating %s using the contents of %s\n", pakName.AsString().c_str(), dir.AsString().c_str()); plPrintf("\nCreating {} using the contents of {}\n", pakName, dir);
printf("Changing working directory to %s\n", rootPath.AsString().c_str()); plPrintf("Changing working directory to {}\n", rootPath);
if (!plFileSystem::SetCWD(rootPath)) if (!plFileSystem::SetCWD(rootPath))
{ {
printf("ERROR: Directory change to %s failed for some reason\n", rootPath.AsString().c_str()); plPrintf("ERROR: Directory change to {} failed for some reason\n", rootPath);
printf("Unable to continue with the packing of this directory, aborting...\n"); fputs("Unable to continue with the packing of this directory, aborting...\n", stdout);
return; return;
} }
else else
printf("Directory changed to %s\n", rootPath.AsString().c_str()); plPrintf("Directory changed to {}\n", rootPath);
std::vector<plFileName> fileNames; std::vector<plFileName> fileNames;
std::vector<plFileName> pathNames; std::vector<plFileName> pathNames;
@ -371,7 +371,7 @@ void PackDirectory(const plFileName& dir, const plFileName& rootPath, const plFi
FindPackages(fileNames, pathNames, dir); FindPackages(fileNames, pathNames, dir);
if (packSysAndPlasma) if (packSysAndPlasma)
{ {
printf("Adding the system and plasma directories to this pack file\n"); fputs("Adding the system and plasma directories to this pack file\n", stdout);
plFileName tempPath; plFileName tempPath;
tempPath = plFileName::Join(dir, "system"); tempPath = plFileName::Join(dir, "system");
FindFiles(fileNames, pathNames, tempPath); FindFiles(fileNames, pathNames, tempPath);
@ -431,15 +431,15 @@ void PackDirectory(const plFileName& dir, const plFileName& rootPath, const plFi
void PrintUsage() void PrintUsage()
{ {
printf("Usage:\n"); fputs("Usage:\n", stdout);
printf("plPythonPack [directory to pack...]\n"); fputs("plPythonPack [directory to pack...]\n", stdout);
printf("NOTE: the directory to pack must have full system and plasma dirs and\n"); fputs("NOTE: the directory to pack must have full system and plasma dirs and\n", stdout);
printf(" must be a relative path to the current working directory\n"); fputs(" must be a relative path to the current working directory\n", stdout);
} }
int main(int argc, char *argv[]) int main(int argc, char *argv[])
{ {
printf("The Python Pack Utility\n"); fputs("The Python Pack Utility\n", stdout);
plFileName baseWorkingDir = plFileSystem::GetCWD(); plFileName baseWorkingDir = plFileSystem::GetCWD();

2
Sources/Plasma/CoreLib/plFormat.cpp

@ -449,7 +449,7 @@ PL_FORMAT_IMPL(double)
PL_FORMAT_IMPL(char) PL_FORMAT_IMPL(char)
{ {
/* Note: The use of unsigned here is not a typo -- we only format decimal /* Note: The use of unsigned here is not a typo -- we only format decimal
values with a sign, so we can convert everything else to unsigned. */ values with a sign, so we can convert everything else to unsigned. */
switch (format.fDigitClass) { switch (format.fDigitClass) {
case plFormat_Private::kDigitBin: case plFormat_Private::kDigitBin:
return _formatNumeric<unsigned char>(format, value, 2); return _formatNumeric<unsigned char>(format, value, 2);

13
Sources/Plasma/CoreLib/plFormat.h

@ -251,4 +251,17 @@ plString plFormat(const char *fmt_str, _Type value, _Args... args)
return plFormat_Private::_IFormat(data, args...); return plFormat_Private::_IFormat(data, args...);
} }
template <typename _Type, typename... _Args>
void plPrintf(FILE *fd, const char *fmt_str, _Type value, _Args... args)
{
plString output = plFormat(fmt_str, value, args...);
fwrite(output.c_str(), sizeof(char), output.GetSize(), fd);
}
template <typename _Type, typename... _Args>
void plPrintf(const char *fmt_str, _Type value, _Args... args)
{
plPrintf(stdout, fmt_str, value, args...);
}
#endif // plFormat_Defined #endif // plFormat_Defined

12
Sources/Plasma/FeatureLib/pfAnimation/plAnimDebugList.cpp

@ -123,10 +123,10 @@ void plAnimDebugList::ShowReport()
plLayerAnimation *layerAnim = plLayerAnimation::ConvertNoRef(layer); plLayerAnimation *layerAnim = plLayerAnimation::ConvertNoRef(layer);
if (layerAnim) if (layerAnim)
{ {
str = plString::Format("%s: %s %.3f (%.3f)", mat->GetKeyName().c_str(), layerAnim->GetKeyName().c_str(), str = plFormat("{}: {} {.3f} ({.3f})", mat->GetKeyName(), layerAnim->GetKeyName(),
layerAnim->GetTimeConvert().CurrentAnimTime(), layerAnim->GetTimeConvert().CurrentAnimTime(),
layerAnim->GetTimeConvert().WorldToAnimTimeNoUpdate(hsTimer::GetSysSeconds())); layerAnim->GetTimeConvert().WorldToAnimTimeNoUpdate(hsTimer::GetSysSeconds()));
txt.DrawString(x, y, str.c_str()); txt.DrawString(x, y, str);
y += yOff; y += yOff;
} }
layer = layer->GetOverLay(); layer = layer->GetOverLay();
@ -147,17 +147,17 @@ void plAnimDebugList::ShowReport()
if (!mod) if (!mod)
continue; continue;
str = plString::Format(" %s", so->GetKeyName().c_str()); str = plFormat(" {}", so->GetKeyName());
txt.DrawString(x, y, str.c_str()); txt.DrawString(x, y, str);
y += yOff; y += yOff;
for (j = 0; j < mod->GetNumATCAnimations(); j++) for (j = 0; j < mod->GetNumATCAnimations(); j++)
{ {
plAGAnimInstance *anim = mod->GetATCAnimInstance(j); plAGAnimInstance *anim = mod->GetATCAnimInstance(j);
str = plString::Format(" %s: %.3f (%.3f)", anim->GetAnimation()->GetName().c_str(), str = plFormat(" {}: {.3f} ({.3f})", anim->GetAnimation()->GetName(),
anim->GetTimeConvert()->CurrentAnimTime(), anim->GetTimeConvert()->CurrentAnimTime(),
anim->GetTimeConvert()->WorldToAnimTimeNoUpdate(hsTimer::GetSysSeconds())); anim->GetTimeConvert()->WorldToAnimTimeNoUpdate(hsTimer::GetSysSeconds()));
txt.DrawString(x, y, str.c_str()); txt.DrawString(x, y, str);
y += yOff; y += yOff;
} }
} }

12
Sources/Plasma/FeatureLib/pfAudio/plListener.cpp

@ -183,19 +183,23 @@ bool plListener::IEval(double secs, float del, uint32_t dirty)
if( fPrintDbgInfo ) if( fPrintDbgInfo )
{ {
plString str; plString str;
str = plString::Format( "Direction: (%3.2f,%3.2f,%3.2f) from %s", dir.fX, dir.fY, dir.fZ, ( facingType == kObject ) ? pRefObject->GetKey()->GetUoid().GetObjectName().c_str() : "VCam" ); str = plFormat("Direction: ({3.2f},{3.2f},{3.2f}) from {}", dir.fX, dir.fY, dir.fZ,
(facingType == kObject) ? pRefObject->GetKeyName() : "VCam");
plDebugText::Instance().DrawString( x, y, str.c_str(), (uint32_t)0xffffffff ); plDebugText::Instance().DrawString( x, y, str.c_str(), (uint32_t)0xffffffff );
y += 12; y += 12;
str = plString::Format( "Up: (%3.2f,%3.2f,%3.2f) from %s", up.fX, up.fY, up.fZ, ( facingType == kObject ) ? pRefObject->GetKey()->GetUoid().GetObjectName().c_str() : "VCam" ); str = plFormat("Up: ({3.2f},{3.2f},{3.2f}) from {}", up.fX, up.fY, up.fZ,
(facingType == kObject) ? pRefObject->GetKeyName() : "VCam");
plDebugText::Instance().DrawString( x, y, str.c_str(), (uint32_t)0xffffffff ); plDebugText::Instance().DrawString( x, y, str.c_str(), (uint32_t)0xffffffff );
y += 12; y += 12;
str = plString::Format( "Position: (%3.2f,%3.2f,%3.2f) from %s", position.fX, position.fY, position.fZ, ( posType == kObject ) ? pRefObject->GetKey()->GetUoid().GetObjectName().c_str() : "VCam" ); str = plFormat("Position: ({3.2f},{3.2f},{3.2f}) from {}", position.fX, position.fY, position.fZ,
(posType == kObject) ? pRefObject->GetKeyName() : "VCam");
plDebugText::Instance().DrawString( x, y, str.c_str(), (uint32_t)0xffffffff ); plDebugText::Instance().DrawString( x, y, str.c_str(), (uint32_t)0xffffffff );
y += 12; y += 12;
str = plString::Format( "Velocity: (%3.2f,%3.2f,%3.2f) from %s", velocity.fX, velocity.fY, velocity.fZ, ( velType == kObject ) ? pRefObject->GetKey()->GetUoid().GetObjectName().c_str() : "VCam" ); str = plFormat("Velocity: ({3.2f},{3.2f},{3.2f}) from {}", velocity.fX, velocity.fY, velocity.fZ,
(velType == kObject) ? pRefObject->GetKeyName() : "VCam");
plDebugText::Instance().DrawString( x, y, str.c_str(), (uint32_t)0xffffffff ); plDebugText::Instance().DrawString( x, y, str.c_str(), (uint32_t)0xffffffff );
y += 12; y += 12;
} }

8
Sources/Plasma/FeatureLib/pfConsole/pfConsole.cpp

@ -280,7 +280,7 @@ bool pfConsole::MsgReceive( plMessage *msg )
plString prefix = plProduct::ShortName(); plString prefix = plProduct::ShortName();
// List all of the PNG indices we have taken up already... // List all of the PNG indices we have taken up already...
plString pattern = plString::Format("%s*.png", prefix.c_str()); plString pattern = plFormat("{}*.png", prefix);
std::vector<plFileName> images = plFileSystem::ListDir(screenshots, pattern.c_str()); std::vector<plFileName> images = plFileSystem::ListDir(screenshots, pattern.c_str());
std::set<uint32_t> indices; std::set<uint32_t> indices;
std::for_each(images.begin(), images.end(), std::for_each(images.begin(), images.end(),
@ -298,7 +298,7 @@ bool pfConsole::MsgReceive( plMessage *msg )
} }
// Got our num, save the screenshot. // Got our num, save the screenshot.
plFileName fn = plString::Format("%s%04d.png", prefix.c_str(), num); plFileName fn = plFormat("{}{_04}.png", prefix, num);
plPNG::Instance().WriteToFile(plFileName::Join(screenshots, fn), capMsg->GetMipmap()); plPNG::Instance().WriteToFile(plFileName::Join(screenshots, fn), capMsg->GetMipmap());
AddLineF("Saved screenshot as '%s'", fn.AsString().c_str()); AddLineF("Saved screenshot as '%s'", fn.AsString().c_str());
@ -325,8 +325,8 @@ bool pfConsole::MsgReceive( plMessage *msg )
{ {
// Change the following line once we have a better way of reporting // Change the following line once we have a better way of reporting
// errors in the parsing // errors in the parsing
plString str = plString::Format("Error parsing %s", cmd->GetString()); plString str = plFormat("Error parsing {}", cmd->GetString());
plString msg = plString::Format("%s:\n\nCommand: '%s'\n%s", fEngine->GetErrorMsg(), fEngine->GetLastErrorLine(), plString msg = plFormat("{}:\n\nCommand: '{}'\n{}", fEngine->GetErrorMsg(), fEngine->GetLastErrorLine(),
#ifdef HS_DEBUGGING #ifdef HS_DEBUGGING
"" ); "" );

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

@ -2872,7 +2872,7 @@ PF_CONSOLE_CMD( Camera, // groupName
PF_CONSOLE_CMD( Camera, SwitchTo, "string cameraName", "Switch to the named camera") PF_CONSOLE_CMD( Camera, SwitchTo, "string cameraName", "Switch to the named camera")
{ {
char str[256]; char str[256];
plString foo = plString::Format("%s_", (char*)params[0]); plString foo = plFormat("{}_", (char*)params[0]);
plKey key = FindObjectByNameAndType(foo, "plCameraModifier1", "", str, true); plKey key = FindObjectByNameAndType(foo, "plCameraModifier1", "", str, true);
PrintString(str); PrintString(str);
@ -4204,7 +4204,7 @@ PF_CONSOLE_CMD( Access,
{ {
char str[256]; char str[256];
char* preFix = params[0]; char* preFix = params[0];
plString name = plString::Format("%s_plMorphSequence_0", preFix); plString name = plFormat("{}_plMorphSequence_0", preFix);
plKey key = FindObjectByName(name, plMorphSequence::Index(), "", str); plKey key = FindObjectByName(name, plMorphSequence::Index(), "", str);
PrintString(str); PrintString(str);
if (!key) if (!key)
@ -4229,7 +4229,7 @@ PF_CONSOLE_CMD( Access,
{ {
char str[256]; char str[256];
char* preFix = params[0]; char* preFix = params[0];
plString name = plString::Format("%s_plMorphSequence_2", preFix); plString name = plFormat("{}_plMorphSequence_2", preFix);
plKey key = FindObjectByName(name, plMorphSequence::Index(), "", str); plKey key = FindObjectByName(name, plMorphSequence::Index(), "", str);
PrintString(str); PrintString(str);
if (!key) if (!key)
@ -4250,7 +4250,7 @@ PF_CONSOLE_CMD( Access,
{ {
char str[256]; char str[256];
char* preFix = params[0]; char* preFix = params[0];
plString name = plString::Format("%s_plMorphSequence_2", preFix); plString name = plFormat("{}_plMorphSequence_2", preFix);
plKey key = FindObjectByName(name, plMorphSequence::Index(), "", str); plKey key = FindObjectByName(name, plMorphSequence::Index(), "", str);
PrintString(str); PrintString(str);
if (!key) if (!key)
@ -4405,7 +4405,7 @@ PF_CONSOLE_CMD( Access,
seq->Activate(); seq->Activate();
PrintString(plString::Format("%s Active\n", seq->GetKey()->GetName().c_str()).c_str()); PrintString(plFormat("{} Active\n", seq->GetKey()->GetName()).c_str());
} }
PF_CONSOLE_CMD( Access, PF_CONSOLE_CMD( Access,
@ -4422,7 +4422,7 @@ PF_CONSOLE_CMD( Access,
seq->DeActivate(); seq->DeActivate();
PrintString(plString::Format("%s Unactive\n", seq->GetKey()->GetName().c_str()).c_str()); PrintString(plFormat("{} Unactive\n", seq->GetKey()->GetName()).c_str());
} }
PF_CONSOLE_CMD( Access, PF_CONSOLE_CMD( Access,
@ -4444,8 +4444,7 @@ PF_CONSOLE_CMD( Access,
seq->SetUseSharedMesh(true); seq->SetUseSharedMesh(true);
seq->AddSharedMesh(item->fMeshes[plClothingItem::kLODHigh]); seq->AddSharedMesh(item->fMeshes[plClothingItem::kLODHigh]);
PrintString(plString::Format("%s on item %s\n", seq->GetKey()->GetName().c_str(), PrintString(plFormat("{} on item {}\n", seq->GetKey()->GetName(), (char *)params[0]).c_str());
(char *)params[0]).c_str());
} }
#include "pfSurface/plFadeOpacityMod.h" #include "pfSurface/plFadeOpacityMod.h"
@ -6869,8 +6868,7 @@ PF_CONSOLE_CMD( Python,
plString args; plString args;
if (numParams > 1) if (numParams > 1)
{ {
const char* tmp = params[1]; args = plFormat("({},)", (char*)params[1]);
args = plString::Format("(%s,)", tmp);
} }
else else
args = "()"; args = "()";

6
Sources/Plasma/FeatureLib/pfConsole/pfDispatchLog.cpp

@ -298,14 +298,14 @@ static bool DumpSpecificMsgInfo(plMessage* msg, plString& info)
const plPageInfo* pageInfo = plKeyFinder::Instance().GetLocationInfo(loc); const plPageInfo* pageInfo = plKeyFinder::Instance().GetLocationInfo(loc);
if (pageInfo) if (pageInfo)
info += plString::Format("%s-%s ", pageInfo->GetAge().c_str(), pageInfo->GetPage().c_str()); info += plFormat("{}-{} ", pageInfo->GetAge(), pageInfo->GetPage());
} }
} }
break; break;
case plClientMsg::kLoadAgeKeys: case plClientMsg::kLoadAgeKeys:
case plClientMsg::kReleaseAgeKeys: case plClientMsg::kReleaseAgeKeys:
info += plString::Format(" - Age: %s", clientMsg->GetAgeName().c_str()); info += plFormat(" - Age: {}", clientMsg->GetAgeName());
break; break;
} }
return true; return true;
@ -321,7 +321,7 @@ static bool DumpSpecificMsgInfo(plMessage* msg, plString& info)
GetType(kOnRequest); GetType(kOnRequest);
GetType(kOnRemove); GetType(kOnRemove);
GetType(kOnReplace); GetType(kOnReplace);
info = plString::Format("Obj: %s RefType: %s", refMsg->GetRef()->GetKeyName().c_str(), typeName); info = plFormat("Obj: {} RefType: {}", refMsg->GetRef()->GetKeyName(), typeName);
return true; return true;
} }

19
Sources/Plasma/FeatureLib/pfConsoleCore/pfConsoleEngine.cpp

@ -152,11 +152,11 @@ bool pfConsoleEngine::PrintCmdHelp( char *name, void (*PrintFn)( const char *
if( group == pfConsoleCmdGroup::GetBaseGroup() ) if( group == pfConsoleCmdGroup::GetBaseGroup() )
PrintFn("Base commands and groups:"); PrintFn("Base commands and groups:");
else else
PrintFn(plString::Format("Group %s:", group->GetName()).c_str()); PrintFn(plFormat("Group {}:", group->GetName()).c_str());
PrintFn(" Subgroups:"); PrintFn(" Subgroups:");
for( subGrp = group->GetFirstSubGroup(); subGrp != nil; subGrp = subGrp->GetNext() ) for( subGrp = group->GetFirstSubGroup(); subGrp != nil; subGrp = subGrp->GetNext() )
{ {
PrintFn(plString::Format(" %s", subGrp->GetName()).c_str()); PrintFn(plFormat(" {}", subGrp->GetName()).c_str());
} }
PrintFn(" Commands:"); PrintFn(" Commands:");
for( cmd = group->GetFirstCommand(); cmd != nil; cmd = cmd->GetNext() ) for( cmd = group->GetFirstCommand(); cmd != nil; cmd = cmd->GetNext() )
@ -167,7 +167,7 @@ bool pfConsoleEngine::PrintCmdHelp( char *name, void (*PrintFn)( const char *
} }
tempString[ i ] = 0; tempString[ i ] = 0;
PrintFn(plString::Format(" %s: %s", cmd->GetName(), tempString).c_str()); PrintFn(plFormat(" {}: {}", cmd->GetName(), tempString).c_str());
} }
return true; return true;
@ -182,9 +182,9 @@ bool pfConsoleEngine::PrintCmdHelp( char *name, void (*PrintFn)( const char *
} }
/// That's it! /// That's it!
PrintFn(plString::Format("\nHelp for the command %s:", cmd->GetName()).c_str()); PrintFn(plFormat("\nHelp for the command {}:", cmd->GetName()).c_str());
PrintFn(plString::Format("\\i%s", cmd->GetHelp()).c_str()); PrintFn(plFormat("\\i{}", cmd->GetHelp()).c_str());
PrintFn(plString::Format("\\iUsage: %s", cmd->GetSignature()).c_str()); PrintFn(plFormat("\\iUsage: {}", cmd->GetSignature()).c_str());
return true; return true;
} }
@ -368,12 +368,9 @@ bool pfConsoleEngine::RunCommand( char *line, void (*PrintFn)( const char * )
cmd->GetSigEntry( (uint8_t)numParams ) != pfConsoleCmd::kNone ) ) cmd->GetSigEntry( (uint8_t)numParams ) != pfConsoleCmd::kNone ) )
{ {
// Print help string and return // Print help string and return
static char string[ 512 ];
ISetErrorMsg( "" ); // Printed on next line ISetErrorMsg( "" ); // Printed on next line
PrintFn( "Invalid parameters to command" ); PrintFn("Invalid parameters to command");
sprintf( string, "Usage: %s", cmd->GetSignature() ); PrintFn(plFormat("Usage: {}", cmd->GetSignature()).c_str());
PrintFn( string );
return false; return false;
} }

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

@ -126,7 +126,7 @@ plString pfGUICtrlGenerator::IGetNextKeyName( const char *prefix )
{ {
static uint32_t keyCount = 0; static uint32_t keyCount = 0;
return plString::Format( "%s%d", prefix, keyCount++ ); return plFormat("{}{}", prefix, keyCount++);
} }
//// IAddKey ///////////////////////////////////////////////////////////////// //// IAddKey /////////////////////////////////////////////////////////////////

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

@ -184,7 +184,7 @@ pfGUIListPicture::pfGUIListPicture( plKey mipKey, bool respectAlpha ) : pfGUILis
{ {
// Gotta make and grab an uncompressed one // Gotta make and grab an uncompressed one
plMipmap *uncompBuffer = hsCodecManager::Instance().CreateUncompressedMipmap( mip, hsCodecManager::k32BitDepth ); plMipmap *uncompBuffer = hsCodecManager::Instance().CreateUncompressedMipmap( mip, hsCodecManager::k32BitDepth );
plString str = plString::Format( "%s_uncomp", mip->GetKeyName().c_str() ); plString str = plFormat("{}_uncomp", mip->GetKeyName());
fMipmapKey = hsgResMgr::ResMgr()->NewKey( str, uncompBuffer, fMipmapKey->GetUoid().GetLocation() ); fMipmapKey = hsgResMgr::ResMgr()->NewKey( str, uncompBuffer, fMipmapKey->GetUoid().GetLocation() );
fMipmapKey->RefObject(); fMipmapKey->RefObject();
} }

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

@ -97,7 +97,7 @@ class pfPopUpKeyGenerator
plKey CreateKey( hsKeyedObject *ko ) plKey CreateKey( hsKeyedObject *ko )
{ {
plString name = plString::Format( "%s-%d", fPrefix, fKeyCount++ ); plString name = plFormat("{}-{}", fPrefix, fKeyCount++);
return hsgResMgr::ResMgr()->NewKey( name, ko, fLoc ); return hsgResMgr::ResMgr()->NewKey( name, ko, fLoc );
} }

8
Sources/Plasma/FeatureLib/pfJournalBook/pfJournalBook.cpp

@ -3036,11 +3036,11 @@ plLayerBink *pfJournalBook::IMakeMovieLayer(pfEsHTMLChunk *chunk, uint16_t x, ui
static int uniqueSuffix = 0; static int uniqueSuffix = 0;
plString buff; plString buff;
buff = plString::Format("%s_%d_ml", GetKey()->GetName().c_str(), uniqueSuffix); buff = plFormat("{}_{}_ml", GetKey()->GetName(), uniqueSuffix);
layer = new plLayer; layer = new plLayer;
hsgResMgr::ResMgr()->NewKey(buff, layer, GetKey()->GetUoid().GetLocation()); hsgResMgr::ResMgr()->NewKey(buff, layer, GetKey()->GetUoid().GetLocation());
buff = plString::Format("%s_%d_m", GetKey()->GetName().c_str(), uniqueSuffix++); buff = plFormat("{}_{}_m", GetKey()->GetName(), uniqueSuffix++);
movieLayer = new plLayerBink; movieLayer = new plLayerBink;
hsgResMgr::ResMgr()->NewKey(buff, movieLayer, GetKey()->GetUoid().GetLocation()); hsgResMgr::ResMgr()->NewKey(buff, movieLayer, GetKey()->GetUoid().GetLocation());
movieLayer->GetKey()->RefObject(); // we want to own a ref so we can nuke it at will movieLayer->GetKey()->RefObject(); // we want to own a ref so we can nuke it at will
@ -3183,7 +3183,7 @@ plLayerInterface *pfJournalBook::IMakeBaseLayer(plMipmap *image)
// We'll need a unique name. This is a hack, but an effective hack. // We'll need a unique name. This is a hack, but an effective hack.
static int uniqueSuffix = 0; static int uniqueSuffix = 0;
plString buff = plString::Format("%s_%d", GetKey()->GetName().c_str(), uniqueSuffix++); plString buff = plFormat("{}_{}", GetKey()->GetName(), uniqueSuffix++);
plLayer* layer = new plLayer; plLayer* layer = new plLayer;
hsgResMgr::ResMgr()->NewKey(buff, layer, GetKey()->GetUoid().GetLocation()); hsgResMgr::ResMgr()->NewKey(buff, layer, GetKey()->GetUoid().GetLocation());
@ -3237,7 +3237,7 @@ plLayerInterface *pfJournalBook::IMakeDecalLayer(pfEsHTMLChunk *decalChunk, plMi
// We'll need a unique name. This is a hack, but an effective hack. // We'll need a unique name. This is a hack, but an effective hack.
static int uniqueSuffix = 0; static int uniqueSuffix = 0;
plString buff = plString::Format("%s_%d_d", GetKey()->GetName().c_str(), uniqueSuffix++); plString buff = plFormat("{}_{}_d", GetKey()->GetName(), uniqueSuffix++);
plLayer* layer = new plLayer; plLayer* layer = new plLayer;
hsgResMgr::ResMgr()->NewKey(buff, layer, GetKey()->GetUoid().GetLocation()); hsgResMgr::ResMgr()->NewKey(buff, layer, GetKey()->GetUoid().GetLocation());

26
Sources/Plasma/FeatureLib/pfLocalizationMgr/pfLocalizationDataMgr.cpp

@ -203,7 +203,7 @@ void XMLCALL LocalizationXMLFile::StartTag(void *userData, const XML_Char *eleme
else if (wElement == "translation") else if (wElement == "translation")
file->IHandleTranslationTag(parentTag, newTag); file->IHandleTranslationTag(parentTag, newTag);
else else
file->AddError(plString::Format("Unknown tag %s found", wElement.c_str())); file->AddError(plFormat("Unknown tag {} found", wElement));
} }
void XMLCALL LocalizationXMLFile::EndTag(void *userData, const XML_Char *element) void XMLCALL LocalizationXMLFile::EndTag(void *userData, const XML_Char *element)
@ -496,7 +496,7 @@ LocalizationXMLFile::set LocalizationDatabase::IMergeSetData(LocalizationXMLFile
firstSet[curElement->first] = curElement->second; firstSet[curElement->first] = curElement->second;
else // merge the element in else // merge the element in
firstSet[curElement->first] = IMergeElementData(firstSet[curElement->first], curElement->second, fileName, firstSet[curElement->first] = IMergeElementData(firstSet[curElement->first], curElement->second, fileName,
plString::Format("%s.%s", path.c_str(), curElement->first.c_str())); plFormat("{}.{}", path, curElement->first));
} }
return firstSet; return firstSet;
@ -515,7 +515,7 @@ LocalizationXMLFile::age LocalizationDatabase::IMergeAgeData(LocalizationXMLFile
firstAge[curSet->first] = curSet->second; firstAge[curSet->first] = curSet->second;
else // merge the data in else // merge the data in
firstAge[curSet->first] = IMergeSetData(firstAge[curSet->first], curSet->second, fileName, firstAge[curSet->first] = IMergeSetData(firstAge[curSet->first], curSet->second, fileName,
plString::Format("%s.%s", path.c_str(), curSet->first.c_str())); plFormat("{}.{}", path, curSet->first));
} }
return firstAge; return firstAge;
@ -919,7 +919,7 @@ void pfLocalizationDataMgr::IConvertSet(LocSetInfo *setInfo, const plString & cu
LocElementInfo elementInfo; LocElementInfo elementInfo;
elementInfo.fElement = curElement->second; elementInfo.fElement = curElement->second;
IConvertElement(&elementInfo, plString::Format("%s.%s", curPath.c_str(), curElement->first.c_str())); IConvertElement(&elementInfo, plFormat("{}.{}", curPath, curElement->first));
} }
} }
@ -933,7 +933,7 @@ void pfLocalizationDataMgr::IConvertAge(LocAgeInfo *ageInfo, const plString & cu
LocSetInfo setInfo; LocSetInfo setInfo;
setInfo.fSet = curSet->second; setInfo.fSet = curSet->second;
IConvertSet(&setInfo, plString::Format("%s.%s", curPath.c_str(), curSet->first.c_str())); IConvertSet(&setInfo, plFormat("{}.{}", curPath, curSet->first));
} }
} }
@ -948,26 +948,26 @@ void pfLocalizationDataMgr::IWriteText(const plFileName & filename, const plStri
plStringStream fileData; plStringStream fileData;
fileData << "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n"; fileData << "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n";
fileData << "<localizations>\n"; fileData << "<localizations>\n";
fileData << plString::Format("\t<age name=\"%s\">\n", ageName.c_str()); fileData << "\t<age name=\"" << ageName << "\">\n";
std::vector<plString> setNames = GetSetList(ageName); std::vector<plString> setNames = GetSetList(ageName);
for (int curSet = 0; curSet < setNames.size(); curSet++) for (int curSet = 0; curSet < setNames.size(); curSet++)
{ {
setEmpty = true; // so far, this set is empty setEmpty = true; // so far, this set is empty
plStringStream setCode; plStringStream setCode;
setCode << plString::Format("\t\t<set name=\"%s\">\n", setNames[curSet].c_str()); setCode << "\t\t<set name=\"" << setNames[curSet] << "\">\n";
std::vector<plString> elementNames = GetElementList(ageName, setNames[curSet]); std::vector<plString> elementNames = GetElementList(ageName, setNames[curSet]);
for (int curElement = 0; curElement < elementNames.size(); curElement++) for (int curElement = 0; curElement < elementNames.size(); curElement++)
{ {
setCode << plString::Format("\t\t\t<element name=\"%s\">\n", elementNames[curElement].c_str()); setCode << "\t\t\t<element name=\"" << elementNames[curElement] << "\">\n";
plString key = plString::Format("%s.%s.%s", ageName.c_str(), setNames[curSet].c_str(), elementNames[curElement].c_str()); plString key = plFormat("{}.{}.{}", ageName, setNames[curSet], elementNames[curElement]);
if (fLocalizedElements[key].find(languageName) != fLocalizedElements[key].end()) if (fLocalizedElements[key].find(languageName) != fLocalizedElements[key].end())
{ {
weWroteData = true; weWroteData = true;
setEmpty = false; setEmpty = false;
setCode << plString::Format("\t\t\t\t<translation language=\"%s\">", languageName.c_str()); setCode << "\t\t\t\t<translation language=\"" << languageName << "\">";
setCode << fLocalizedElements[key][languageName].ToXML(); setCode << fLocalizedElements[key][languageName].ToXML();
setCode << "</translation>\n"; setCode << "</translation>\n";
} }
@ -1093,7 +1093,7 @@ pfLocalizedString pfLocalizationDataMgr::GetSpecificElement(const plString & nam
std::vector<plString> pfLocalizationDataMgr::GetLanguages(const plString & ageName, const plString & setName, const plString & elementName) std::vector<plString> pfLocalizationDataMgr::GetLanguages(const plString & ageName, const plString & setName, const plString & elementName)
{ {
std::vector<plString> retVal; std::vector<plString> retVal;
plString key = plString::Format("%s.%s.%s", ageName.c_str(), setName.c_str(), elementName.c_str()); plString key = plFormat("{}.{}.{}", ageName, setName, elementName);
if (fLocalizedElements.exists(key)) if (fLocalizedElements.exists(key))
{ {
// age, set, and element exists // age, set, and element exists
@ -1209,8 +1209,8 @@ void pfLocalizationDataMgr::WriteDatabaseToDisk(const plFileName & path)
{ {
for (int curLanguage = 0; curLanguage < languageNames.size(); curLanguage++) for (int curLanguage = 0; curLanguage < languageNames.size(); curLanguage++)
{ {
plFileName locPath = plFileName::Join(path, plString::Format("%s%s.loc", plFileName locPath = plFileName::Join(path, plFormat("{}{}.loc",
ageNames[curAge].c_str(), languageNames[curLanguage].c_str())); ageNames[curAge], languageNames[curLanguage]));
IWriteText(locPath, ageNames[curAge], languageNames[curLanguage]); IWriteText(locPath, ageNames[curAge], languageNames[curLanguage]);
} }
} }

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

@ -1272,7 +1272,7 @@ PyObject* cyAvatar::GetTintClothingItemL(const plString& clothing_name, uint8_t
} }
} }
plString errmsg = plString::Format("Cannot find clothing item %s to find out what tint it is", clothing_name.c_str()); plString errmsg = plFormat("Cannot find clothing item {} to find out what tint it is", clothing_name);
PyErr_SetString(PyExc_KeyError, errmsg.c_str()); PyErr_SetString(PyExc_KeyError, errmsg.c_str());
// returning nil means an error occurred // returning nil means an error occurred
return nil; return nil;

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

@ -215,7 +215,7 @@ PyObject* cyMisc::FindSceneObject(const plString& name, const char* ageName)
if ( key == nil ) if ( key == nil )
{ {
plString errmsg = plString::Format("Sceneobject %s not found",name.c_str()); plString errmsg = plFormat("Sceneobject {} not found", name);
PyErr_SetString(PyExc_NameError, errmsg.c_str()); PyErr_SetString(PyExc_NameError, errmsg.c_str());
return nil; // return nil cause we errored return nil; // return nil cause we errored
} }
@ -935,7 +935,7 @@ PyObject* cyMisc::GetDialogFromTagID(uint32_t tag)
return pyGUIDialog::New(pdialog->GetKey()); return pyGUIDialog::New(pdialog->GetKey());
} }
plString errmsg = plString::Format("GUIDialog TagID %d not found", tag); plString errmsg = plFormat("GUIDialog TagID {} not found", tag);
PyErr_SetString(PyExc_KeyError, errmsg.c_str()); PyErr_SetString(PyExc_KeyError, errmsg.c_str());
return nil; // return nil, cause we threw an error return nil; // return nil, cause we threw an error
} }
@ -951,7 +951,7 @@ PyObject* cyMisc::GetDialogFromString(const char* name)
return pyGUIDialog::New(pdialog->GetKey()); return pyGUIDialog::New(pdialog->GetKey());
} }
plString errmsg = plString::Format("GUIDialog %s not found", name); plString errmsg = plFormat("GUIDialog {} not found", name);
PyErr_SetString(PyExc_KeyError, errmsg.c_str()); PyErr_SetString(PyExc_KeyError, errmsg.c_str());
return nil; // return nil, cause we threw an error return nil; // return nil, cause we threw an error
} }
@ -2497,7 +2497,7 @@ plString cyMisc::GetCameraNumber(int number)
if (pCam && pCam->GetTarget()) if (pCam && pCam->GetTarget())
{ {
plString ret = pCam->GetTarget()->GetKeyName(); plString ret = pCam->GetTarget()->GetKeyName();
plString log = plString::Format("saving camera named %s to chronicle\n", ret.c_str()); plString log = plFormat("saving camera named {} to chronicle\n", ret);
plVirtualCam1::Instance()->AddMsgToLog(log.c_str()); plVirtualCam1::Instance()->AddMsgToLog(log.c_str());
return ret; return ret;
} }
@ -2508,7 +2508,7 @@ plString cyMisc::GetCameraNumber(int number)
void cyMisc::RebuildCameraStack(const plString& name, const char* ageName) void cyMisc::RebuildCameraStack(const plString& name, const char* ageName)
{ {
plKey key=nil; plKey key=nil;
plString str = plString::Format("attempting to restore camera named %s from chronicle\n",name.c_str()); plString str = plFormat("attempting to restore camera named {} from chronicle\n", name);
plVirtualCam1::Instance()->AddMsgToLog(str.c_str()); plVirtualCam1::Instance()->AddMsgToLog(str.c_str());
if (name.Compare("empty") == 0) if (name.Compare("empty") == 0)
@ -2525,7 +2525,7 @@ void cyMisc::RebuildCameraStack(const plString& name, const char* ageName)
{ {
// give up and force built in 3rd person // give up and force built in 3rd person
plVirtualCam1::Instance()->PushThirdPerson(); plVirtualCam1::Instance()->PushThirdPerson();
plString errmsg = plString::Format("Sceneobject %s not found",name.c_str()); plString errmsg = plFormat("Sceneobject {} not found", name);
PyErr_SetString(PyExc_NameError, errmsg.c_str()); PyErr_SetString(PyExc_NameError, errmsg.c_str());
} }
} }
@ -2549,7 +2549,7 @@ void cyMisc::RebuildCameraStack(const plString& name, const char* ageName)
} }
} }
plVirtualCam1::Instance()->PushThirdPerson(); plVirtualCam1::Instance()->PushThirdPerson();
plString errmsg = plString::Format("Sceneobject %s has no camera modifier",name.c_str()); plString errmsg = plFormat("Sceneobject {} has no camera modifier", name);
PyErr_SetString(PyExc_NameError, errmsg.c_str()); PyErr_SetString(PyExc_NameError, errmsg.c_str());
} }

8
Sources/Plasma/FeatureLib/pfPython/cyPhysics.cpp

@ -322,8 +322,8 @@ void cyPhysics::Move(pyVector3& direction, float distance)
} }
else else
{ {
plString errmsg = plString::Format("Sceneobject %s does not have a coordinate interface.", plString errmsg = plFormat("Sceneobject {} does not have a coordinate interface.",
obj->GetKeyName().c_str()); obj->GetKeyName());
PyErr_SetString(PyExc_RuntimeError, errmsg.c_str()); PyErr_SetString(PyExc_RuntimeError, errmsg.c_str());
} }
} }
@ -392,8 +392,8 @@ void cyPhysics::Rotate(float rad, pyVector3& axis)
} }
else else
{ {
plString errmsg = plString::Format("Sceneobject %s does not have a coordinate interface.", plString errmsg = plFormat("Sceneobject {} does not have a coordinate interface.",
obj->GetKeyName().c_str()); obj->GetKeyName());
PyErr_SetString(PyExc_RuntimeError, errmsg.c_str()); PyErr_SetString(PyExc_RuntimeError, errmsg.c_str());
} }
} }

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

@ -2003,7 +2003,7 @@ PyObject* PythonInterface::CreateModule(const char* module)
if ((m = PyDict_GetItemString(modules, module)) != NULL && PyModule_Check(m)) if ((m = PyDict_GetItemString(modules, module)) != NULL && PyModule_Check(m))
{ {
// clear it // clear it
hsAssert(false, plString::Format("ERROR! Creating a python module of the same name - %s", module).c_str()); hsAssert(false, plFormat("ERROR! Creating a python module of the same name - {}", module).c_str());
_PyModule_Clear(m); _PyModule_Clear(m);
} }

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

@ -431,7 +431,7 @@ bool plPythonFileMod::ILoadPythonCode()
#ifndef PLASMA_EXTERNAL_RELEASE #ifndef PLASMA_EXTERNAL_RELEASE
// get code from file and execute in module // get code from file and execute in module
// see if the file exists first before trying to import it // see if the file exists first before trying to import it
plFileName pyfile = plFileName::Join(".", "python", plString::Format("%s.py", fPythonFile.c_str())); plFileName pyfile = plFileName::Join(".", "python", plFormat("{}.py", fPythonFile));
if (plFileInfo(pyfile).Exists()) if (plFileInfo(pyfile).Exists())
{ {
char fromLoad[256]; char fromLoad[256];
@ -1002,7 +1002,8 @@ plString plPythonFileMod::IMakeModuleName(plSceneObject* sobj)
} }
modulename[k] = '\0'; modulename[k] = '\0';
plString name = plString::FromUtf8(modulename); plStringStream name;
name << modulename;
// check to see if we are attaching to a clone? // check to see if we are attaching to a clone?
plKeyImp* pKeyImp = (plKeyImp*)(sKey); plKeyImp* pKeyImp = (plKeyImp*)(sKey);
@ -1012,7 +1013,7 @@ plString plPythonFileMod::IMakeModuleName(plSceneObject* sobj)
// add the cloneID to the end of the module name // add the cloneID to the end of the module name
// and set the fIAmAClone flag // and set the fIAmAClone flag
uint32_t cloneID = pKeyImp->GetUoid().GetCloneID(); uint32_t cloneID = pKeyImp->GetUoid().GetCloneID();
name += plString::Format("%d", cloneID); name << cloneID;
fAmIAttachedToClone = true; fAmIAttachedToClone = true;
} }
@ -1021,10 +1022,10 @@ plString plPythonFileMod::IMakeModuleName(plSceneObject* sobj)
{ {
// if not unique then add the sequence number to the end of the modulename // if not unique then add the sequence number to the end of the modulename
uint32_t seqID = pKeyImp->GetUoid().GetLocation().GetSequenceNumber(); uint32_t seqID = pKeyImp->GetUoid().GetLocation().GetSequenceNumber();
name += plString::Format("%d", seqID); name << seqID;
} }
return name; return name.GetString();
} }
///////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////

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

@ -209,8 +209,8 @@ PyObject* plPythonPack::OpenPacked(const plString& fileName)
{ {
char *buf = new char[size]; char *buf = new char[size];
uint32_t readSize = fPackStream->Read(size, buf); uint32_t readSize = fPackStream->Read(size, buf);
hsAssert(readSize <= size, plString::Format("Python PackFile %s: Incorrect amount of data, read %d instead of %d", hsAssert(readSize <= size, plFormat("Python PackFile {}: Incorrect amount of data, read {} instead of {}",
fileName.c_str(), readSize, size).c_str()); fileName, readSize, size).c_str());
// let the python marshal make it back into a code object // let the python marshal make it back into a code object
PyObject *pythonCode = PyMarshal_ReadObjectFromString(buf, size); PyObject *pythonCode = PyMarshal_ReadObjectFromString(buf, size);

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

@ -105,7 +105,7 @@ PyObject* plPythonSDLModifier::GetItem(const plString& key)
if (it == fMap.end()) if (it == fMap.end())
{ {
plString errmsg = plString::Format("SDL key %s not found", key.c_str()); plString errmsg = plFormat("SDL key {} not found", key);
PyErr_SetString(PyExc_KeyError, errmsg.c_str()); PyErr_SetString(PyExc_KeyError, errmsg.c_str());
PYTHON_RETURN_ERROR; PYTHON_RETURN_ERROR;
} }

8
Sources/Plasma/FeatureLib/pfPython/pyAgeInfoStruct.cpp

@ -190,9 +190,9 @@ plString pyAgeInfoStruct::GetDisplayName() const
{ {
int32_t seq = GetAgeSequenceNumber(); int32_t seq = GetAgeSequenceNumber();
if (seq > 0) if (seq > 0)
return plString::Format("%s (%d) %s", user.c_str(), seq, instance.c_str()); return plFormat("{} ({}) {}", user, seq, instance);
else else
return plString::Format("%s %s", user.c_str(), instance.c_str()); return plFormat("{} {}", user, instance);
} }
} }
@ -275,8 +275,8 @@ plString pyAgeInfoStructRef::GetDisplayName() const
{ {
int32_t seq = GetAgeSequenceNumber(); int32_t seq = GetAgeSequenceNumber();
if (seq > 0) if (seq > 0)
return plString::Format("%s (%d) %s", user.c_str(), seq, instance.c_str()); return plFormat("{} ({}) {}", user, seq, instance);
else else
return plString::Format("%s %s", user.c_str(), instance.c_str()); return plFormat("{} {}", user, instance);
} }
} }

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

@ -210,7 +210,7 @@ PyObject* pyImage::LoadJPEGFromDisk(const plFileName& filename, uint16_t width,
} }
// let's create a nice name for this thing based on the filename // let's create a nice name for this thing based on the filename
plString name = plString::Format("PtImageFromDisk_%s", filename.AsString().c_str()); plString name = plFormat("PtImageFromDisk_{}", filename);
hsgResMgr::ResMgr()->NewKey(name, theMipmap, plLocation::kGlobalFixedLoc); hsgResMgr::ResMgr()->NewKey(name, theMipmap, plLocation::kGlobalFixedLoc);
@ -235,7 +235,7 @@ PyObject* pyImage::LoadPNGFromDisk(const plFileName& filename, uint16_t width, u
} }
// let's create a nice name for this thing based on the filename // let's create a nice name for this thing based on the filename
plString name = plString::Format("PtImageFromDisk_%s", filename.AsString().c_str()); plString name = plFormat("PtImageFromDisk_{}", filename);
hsgResMgr::ResMgr()->NewKey(name, theMipmap, plLocation::kGlobalFixedLoc); hsgResMgr::ResMgr()->NewKey(name, theMipmap, plLocation::kGlobalFixedLoc);

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

@ -62,7 +62,7 @@ uint32_t pyJournalBook::fNextKeyID = 0;
void pyJournalBook::IMakeNewKey( void ) void pyJournalBook::IMakeNewKey( void )
{ {
plString name = plString::Format( "pyJournalBook-%d", fNextKeyID++ ); plString name = plFormat("pyJournalBook-{}", fNextKeyID++);
hsgResMgr::ResMgr()->NewKey( name, fBook, plLocation::kGlobalFixedLoc ); hsgResMgr::ResMgr()->NewKey( name, fBook, plLocation::kGlobalFixedLoc );
fBook->GetKey()->RefObject(); fBook->GetKey()->RefObject();

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

@ -293,8 +293,8 @@ PyObject* pySceneObject::GetLocalToWorld()
return pyMatrix44::New((hsMatrix44)ci->GetLocalToWorld()); return pyMatrix44::New((hsMatrix44)ci->GetLocalToWorld());
else else
{ {
plString errmsg = plString::Format("Sceneobject %s does not have a coordinate interface.", plString errmsg = plFormat("Sceneobject {} does not have a coordinate interface.",
obj->GetKeyName().c_str()); obj->GetKeyName());
PyErr_SetString(PyExc_RuntimeError, errmsg.c_str()); PyErr_SetString(PyExc_RuntimeError, errmsg.c_str());
return nil; // return nil to tell python we errored return nil; // return nil to tell python we errored
} }
@ -322,8 +322,8 @@ PyObject* pySceneObject::GetWorldToLocal()
return pyMatrix44::New((hsMatrix44)ci->GetWorldToLocal()); return pyMatrix44::New((hsMatrix44)ci->GetWorldToLocal());
else else
{ {
plString errmsg = plString::Format("Sceneobject %s does not have a coordinate interface.", plString errmsg = plFormat("Sceneobject {} does not have a coordinate interface.",
obj->GetKeyName().c_str()); obj->GetKeyName());
PyErr_SetString(PyExc_RuntimeError, errmsg.c_str()); PyErr_SetString(PyExc_RuntimeError, errmsg.c_str());
return nil; // return nil to tell python we errored return nil; // return nil to tell python we errored
} }
@ -351,8 +351,8 @@ PyObject* pySceneObject::GetLocalToParent()
return pyMatrix44::New((hsMatrix44)ci->GetLocalToParent()); return pyMatrix44::New((hsMatrix44)ci->GetLocalToParent());
else else
{ {
plString errmsg = plString::Format("Sceneobject %s does not have a coordinate interface.", plString errmsg = plFormat("Sceneobject {} does not have a coordinate interface.",
obj->GetKeyName().c_str()); obj->GetKeyName());
PyErr_SetString(PyExc_RuntimeError, errmsg.c_str()); PyErr_SetString(PyExc_RuntimeError, errmsg.c_str());
return nil; // return nil to tell python we errored return nil; // return nil to tell python we errored
} }
@ -380,8 +380,8 @@ PyObject* pySceneObject::GetParentToLocal()
return pyMatrix44::New((hsMatrix44)ci->GetParentToLocal()); return pyMatrix44::New((hsMatrix44)ci->GetParentToLocal());
else else
{ {
plString errmsg = plString::Format("Sceneobject %s does not have a coordinate interface.", plString errmsg = plFormat("Sceneobject {} does not have a coordinate interface.",
obj->GetKeyName().c_str()); obj->GetKeyName());
PyErr_SetString(PyExc_RuntimeError, errmsg.c_str()); PyErr_SetString(PyExc_RuntimeError, errmsg.c_str());
return nil; // return nil to tell python we errored return nil; // return nil to tell python we errored
} }
@ -425,8 +425,8 @@ PyObject* pySceneObject::GetWorldPosition()
return pyPoint3::New((hsPoint3)ci->GetWorldPos()); return pyPoint3::New((hsPoint3)ci->GetWorldPos());
else else
{ {
plString errmsg = plString::Format("Sceneobject %s does not have a coordinate interface.", plString errmsg = plFormat("Sceneobject {} does not have a coordinate interface.",
obj->GetKeyName().c_str()); obj->GetKeyName());
PyErr_SetString(PyExc_RuntimeError, errmsg.c_str()); PyErr_SetString(PyExc_RuntimeError, errmsg.c_str());
return nil; // return nil to tell python we errored return nil; // return nil to tell python we errored
} }
@ -454,8 +454,8 @@ PyObject* pySceneObject::GetViewVector()
return pyVector3::New(ci->GetLocalToWorld().GetAxis(hsMatrix44::kView)); return pyVector3::New(ci->GetLocalToWorld().GetAxis(hsMatrix44::kView));
else else
{ {
plString errmsg = plString::Format("Sceneobject %s does not have a coordinate interface.", plString errmsg = plFormat("Sceneobject {} does not have a coordinate interface.",
obj->GetKeyName().c_str()); obj->GetKeyName());
PyErr_SetString(PyExc_RuntimeError, errmsg.c_str()); PyErr_SetString(PyExc_RuntimeError, errmsg.c_str());
return nil; // return nil to tell python we errored return nil; // return nil to tell python we errored
} }
@ -483,8 +483,8 @@ PyObject* pySceneObject::GetUpVector()
return pyVector3::New(ci->GetLocalToWorld().GetAxis(hsMatrix44::kUp)); return pyVector3::New(ci->GetLocalToWorld().GetAxis(hsMatrix44::kUp));
else else
{ {
plString errmsg = plString::Format("Sceneobject %s does not have a coordinate interface.", plString errmsg = plFormat("Sceneobject {} does not have a coordinate interface.",
obj->GetKeyName().c_str()); obj->GetKeyName());
PyErr_SetString(PyExc_RuntimeError, errmsg.c_str()); PyErr_SetString(PyExc_RuntimeError, errmsg.c_str());
return nil; // return nil to tell python we errored return nil; // return nil to tell python we errored
} }
@ -512,8 +512,8 @@ PyObject* pySceneObject::GetRightVector()
return pyVector3::New(ci->GetLocalToWorld().GetAxis(hsMatrix44::kRight)); return pyVector3::New(ci->GetLocalToWorld().GetAxis(hsMatrix44::kRight));
else else
{ {
plString errmsg = plString::Format("Sceneobject %s does not have a coordinate interface.", plString errmsg = plFormat("Sceneobject {} does not have a coordinate interface.",
obj->GetKeyName().c_str()); obj->GetKeyName());
PyErr_SetString(PyExc_RuntimeError, errmsg.c_str()); PyErr_SetString(PyExc_RuntimeError, errmsg.c_str());
return nil; // return nil to tell python we errored return nil; // return nil to tell python we errored
} }

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

@ -670,13 +670,13 @@ void pyVault::CreateNeighborhood()
unsigned nameLen = nc->GetPlayerName().GetSize(); unsigned nameLen = nc->GetPlayerName().GetSize();
if (nc->GetPlayerName().CharAt(nameLen - 1) == 's' || nc->GetPlayerName().CharAt(nameLen - 1) == 'S') if (nc->GetPlayerName().CharAt(nameLen - 1) == 's' || nc->GetPlayerName().CharAt(nameLen - 1) == 'S')
{ {
title = plString::Format( "%s'", nc->GetPlayerName().c_str() ); title = plFormat("{}'", nc->GetPlayerName());
desc = plString::Format( "%s' %s", nc->GetPlayerName().c_str(), link.GetAgeInfo()->GetAgeInstanceName().c_str() ); desc = plFormat("{}' {}", nc->GetPlayerName(), link.GetAgeInfo()->GetAgeInstanceName());
} }
else else
{ {
title = plString::Format( "%s's", nc->GetPlayerName().c_str() ); title = plFormat("{}'s", nc->GetPlayerName());
desc = plString::Format( "%s's %s", nc->GetPlayerName().c_str(), link.GetAgeInfo()->GetAgeInstanceName().c_str() ); desc = plFormat("{}'s {}", nc->GetPlayerName(), link.GetAgeInfo()->GetAgeInstanceName());
} }
plUUID guid = plUUID::Generate(); plUUID guid = plUUID::Generate();

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

@ -68,7 +68,7 @@ static unsigned s_keyseq;
//============================================================================ //============================================================================
static plKey CreateAndRefImageKey (unsigned nodeId, plMipmap * mipmap) { static plKey CreateAndRefImageKey (unsigned nodeId, plMipmap * mipmap) {
plString keyName = plString::Format("VaultImg_%u_%u", nodeId, s_keyseq++); plString keyName = plFormat("VaultImg_{}_{}", nodeId, s_keyseq++);
plKey key = hsgResMgr::ResMgr()->NewKey(keyName, mipmap, plLocation::kGlobalFixedLoc); plKey key = hsgResMgr::ResMgr()->NewKey(keyName, mipmap, plLocation::kGlobalFixedLoc);

2
Sources/Plasma/FeatureLib/pfSurface/plLayerMovie.cpp

@ -112,7 +112,7 @@ bool plLayerMovie::ISetupBitmap()
memset(b->GetImage(), 0x10, b->GetHeight() * b->GetRowBytes() ); memset(b->GetImage(), 0x10, b->GetHeight() * b->GetRowBytes() );
b->SetFlags( b->GetFlags() | plMipmap::kDontThrowAwayImage ); b->SetFlags( b->GetFlags() | plMipmap::kDontThrowAwayImage );
plString name = plString::Format( "%s_BMap", fMovieName.AsString().c_str() ); plString name = plFormat("{}_BMap", fMovieName);
hsgResMgr::ResMgr()->NewKey( name, b, plLocation::kGlobalFixedLoc ); hsgResMgr::ResMgr()->NewKey( name, b, plLocation::kGlobalFixedLoc );
*fTexture = (plBitmap *)b; *fTexture = (plBitmap *)b;

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

@ -335,8 +335,9 @@ void plDispatch::IMsgDispatch()
if (plNetObjectDebuggerBase::GetInstance()->IsDebugObject(ko)) if (plNetObjectDebuggerBase::GetInstance()->IsDebugObject(ko))
{ {
hsLogEntry(plNetObjectDebuggerBase::GetInstance()->LogMsg( hsLogEntry(plNetObjectDebuggerBase::GetInstance()->LogMsg(
plString::Format("<RCV> object:%s, GameMessage %s st=%.3f rt=%.3f", plFormat("<RCV> object:{}, GameMessage {} st={.3f} rt={.3f}",
ko->GetKeyName().c_str(), msg->ClassName(), hsTimer::GetSysSeconds(), hsTimer::GetSeconds()).c_str())); ko->GetKeyName(), msg->ClassName(), hsTimer::GetSysSeconds(),
hsTimer::GetSeconds()).c_str()));
} }
} }
} }

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

@ -148,8 +148,8 @@ void hsKeyedObject::UnRegisterAsManual(plUoid& inUoid)
{ {
#if !HS_BUILD_FOR_UNIX // disable for unix servers #if !HS_BUILD_FOR_UNIX // disable for unix servers
hsAssert(false, hsAssert(false,
plString::Format("Request to Unregister wrong FixedKey, keyName=%s, inUoid=%s, myUoid=%s", plFormat("Request to Unregister wrong FixedKey, keyName={}, inUoid={}, myUoid={}",
fpKey->GetName().c_str("?"), inUoid.StringIze().c_str(), myUoid.StringIze().c_str()).c_str()); fpKey->GetName(), inUoid, myUoid).c_str());
#endif #endif
} }
((plKeyImp*)fpKey)->UnRegister(); ((plKeyImp*)fpKey)->UnRegister();

6
Sources/Plasma/NucleusLib/pnMessage/plMessage.cpp

@ -280,7 +280,7 @@ int plMsgStdStringHelper::Peek(std::string & stringref, hsStream* stream, const
stringref.resize(strlen); stringref.resize(strlen);
if (strlen){ if (strlen){
stream->LogRead(strlen,(void*)stringref.data(),"StdString"); stream->LogRead(strlen,(void*)stringref.data(),"StdString");
stream->LogStringString(plString::Format("Value: %s", stringref.data()).c_str()); stream->LogStringString(plFormat("Value: {}", stringref).c_str());
} }
} }
else else
@ -302,7 +302,7 @@ int plMsgStdStringHelper::PeekBig(std::string & stringref, hsStream* stream, co
stringref.resize(bufsz); stringref.resize(bufsz);
if (bufsz){ if (bufsz){
stream->LogRead(bufsz,(void*)stringref.data(),"StdString"); stream->LogRead(bufsz,(void*)stringref.data(),"StdString");
stream->LogStringString(plString::Format("Value: %s", stringref.data()).c_str()); stream->LogStringString(plFormat("Value: {}", stringref).c_str());
} }
} }
else else
@ -357,7 +357,7 @@ int plMsgCStringHelper::Peek(char *& str, hsStream* stream, const uint32_t peekO
str[strlen] = '\0'; str[strlen] = '\0';
if (strlen) { if (strlen) {
stream->LogRead(strlen,str,"CString"); stream->LogRead(strlen,str,"CString");
stream->LogStringString(plString::Format("Value: %s",str).c_str()); stream->LogStringString(plFormat("Value: {}", str).c_str());
} }
} }
} }

11
Sources/Plasma/NucleusLib/pnNetCommon/plGenericVar.cpp

@ -237,15 +237,16 @@ plString plGenericType::GetAsString() const
switch (fType) switch (fType)
{ {
case kInt : case kInt :
return plString::Format("%d", fI); return plFormat("{}", fI);
case kBool : case kBool :
case kUInt : return plFormat("{}", fB ? 1 : 0);
return plString::Format("%u", fType==kBool?fB:fU); case kUInt:
return plFormat("{}", fU);
case kFloat : case kFloat :
case kDouble : case kDouble :
return plString::Format("%f", fType==kDouble?fD:fF); return plFormat("{f}", fType==kDouble ? fD : fF);
case kChar : case kChar :
return plString::Format("%c", fC); return plFormat("{}", fC);
case kAny : case kAny :
case kString : case kString :
return fS; return fS;

2
Sources/Plasma/NucleusLib/pnNetCommon/pnNetCommon.cpp

@ -63,7 +63,7 @@ plString GetTextAddr(uint32_t binAddr)
{ {
in_addr in; in_addr in;
memcpy(&in, &binAddr, sizeof(binAddr)); memcpy(&in, &binAddr, sizeof(binAddr));
return plString::Format("%s", inet_ntoa(in)); return plString::FromUtf8(inet_ntoa(in));
} }
// NOTE: On Win32, WSAStartup() must be called before GetBinAddr() will work. // NOTE: On Win32, WSAStartup() must be called before GetBinAddr() will work.

4
Sources/Plasma/PubUtilLib/plAgeDescription/plAgeDescription.cpp

@ -118,9 +118,9 @@ bool plAgePage::SetFromString( const plString &stringIn )
plString plAgePage::GetAsString( void ) const plString plAgePage::GetAsString( void ) const
{ {
if (fFlags) if (fFlags)
return plString::Format("%s,%d,%d", fName.c_str(), fSeqSuffix, fFlags); return plFormat("{},{},{}", fName, fSeqSuffix, fFlags);
return plString::Format("%s,%d", fName.c_str(), fSeqSuffix); return plFormat("{},{}", fName, fSeqSuffix);
} }

10
Sources/Plasma/PubUtilLib/plAgeLoader/plResPatcher.cpp

@ -78,13 +78,13 @@ void plResPatcher::OnCompletion(ENetError result, const plString& status)
{ {
plString error = plString::Null; plString error = plString::Null;
if (IS_NET_ERROR(result)) if (IS_NET_ERROR(result))
error = plString::Format("Update Failed: %S\n%s", NetErrorAsString(result), status.c_str()); error = plFormat("Update Failed: {}\n{}", NetErrorAsString(result), status);
plgDispatch::Dispatch()->MsgQueue(new plResPatcherMsg(IS_NET_SUCCESS(result), error)); plgDispatch::Dispatch()->MsgQueue(new plResPatcherMsg(IS_NET_SUCCESS(result), error));
} }
void plResPatcher::OnFileDownloadBegin(const plFileName& file) void plResPatcher::OnFileDownloadBegin(const plFileName& file)
{ {
fProgress->SetTitle(plString::Format("Downloading %s...", file.GetFileName().c_str())); fProgress->SetTitle(plFormat("Downloading {}...", file.GetFileName()));
if (file.GetFileExt().CompareI("prp") == 0) { if (file.GetFileExt().CompareI("prp") == 0) {
plResManager* mgr = static_cast<plResManager*>(hsgResMgr::ResMgr()); plResManager* mgr = static_cast<plResManager*>(hsgResMgr::ResMgr());
@ -124,9 +124,9 @@ void plResPatcher::OnProgressTick(uint64_t dl, uint64_t total, const plString& m
fProgress->SetHowMuch(dl); fProgress->SetHowMuch(dl);
} }
plString status = plString::Format("%s / %s", plString status = plFormat("%s / %s",
plFileSystem::ConvertFileSize(dl).c_str(), plFileSystem::ConvertFileSize(dl),
plFileSystem::ConvertFileSize(total).c_str() plFileSystem::ConvertFileSize(total)
); );
fProgress->SetStatusText(status); fProgress->SetStatusText(status);

2
Sources/Plasma/PubUtilLib/plAudible/plWinAudible.cpp

@ -474,7 +474,7 @@ void plWinAudible::Read(hsStream* s, hsResMgr* mgr)
void plWinAudible::IAssignSoundKey( plSound *sound, const char *name, uint32_t i ) void plWinAudible::IAssignSoundKey( plSound *sound, const char *name, uint32_t i )
{ {
plString keyName = plString::Format( "%s_%d", name, i ); plString keyName = plFormat("{}_{}", name, i);
hsgResMgr::ResMgr()->NewKey( keyName, sound, GetKey() ? GetKey()->GetUoid().GetLocation() : plLocation::kGlobalFixedLoc ); hsgResMgr::ResMgr()->NewKey( keyName, sound, GetKey() ? GetKey()->GetUoid().GetLocation() : plLocation::kGlobalFixedLoc );
} }

2
Sources/Plasma/PubUtilLib/plAudio/plVoiceChat.cpp

@ -411,7 +411,7 @@ plVoiceSound::plVoiceSound()
fEAXSettings.SetRoomParams(-1200, -100, 0, 0); fEAXSettings.SetRoomParams(-1200, -100, 0, 0);
fLastUpdate = 0; fLastUpdate = 0;
plString keyName = plString::Format("VoiceSound_%d", fCount); plString keyName = plFormat("VoiceSound_{}", fCount);
fCount++; fCount++;
hsgResMgr::ResMgr()->NewKey(keyName, this, plLocation::kGlobalFixedLoc); hsgResMgr::ResMgr()->NewKey(keyName, this, plLocation::kGlobalFixedLoc);
} }

21
Sources/Plasma/PubUtilLib/plAudio/plWin32GroupedSound.cpp

@ -160,7 +160,7 @@ bool plWin32GroupedSound::LoadSound( bool is3D )
// We need it to be resident to read in // We need it to be resident to read in
if( retVal == plSoundBuffer::kError) if( retVal == plSoundBuffer::kError)
{ {
plString str = plString::Format("Unable to open .wav file %s", fDataBufferKey ? fDataBufferKey->GetName().c_str() : "nil"); plString str = plFormat("Unable to open .wav file {}", fDataBufferKey ? fDataBufferKey->GetName() : "nil");
IPrintDbgMessage( str.c_str(), true ); IPrintDbgMessage( str.c_str(), true );
fFailed = true; fFailed = true;
return false; return false;
@ -211,9 +211,10 @@ bool plWin32GroupedSound::LoadSound( bool is3D )
fDSoundBuffer = new plDSoundBuffer( bufferSize, header, is3D, IsPropertySet( kPropLooping ), true ); fDSoundBuffer = new plDSoundBuffer( bufferSize, header, is3D, IsPropertySet( kPropLooping ), true );
if( !fDSoundBuffer->IsValid() ) if( !fDSoundBuffer->IsValid() )
{ {
char str[256]; plString str = plFormat("Can't create sound buffer for {}.wav. This could happen if the wav file is a stereo file."
sprintf(str, "Can't create sound buffer for %s.wav. This could happen if the wav file is a stereo file. Stereo files are not supported on 3D sounds. If the file is not stereo then please report this error.", GetFileName().AsString().c_str()); " Stereo files are not supported on 3D sounds. If the file is not stereo then please report this error.",
IPrintDbgMessage( str, true ); GetFileName());
IPrintDbgMessage(str.c_str(), true);
fFailed = true; fFailed = true;
delete fDSoundBuffer; delete fDSoundBuffer;
@ -228,14 +229,14 @@ bool plWin32GroupedSound::LoadSound( bool is3D )
IFillCurrentSound( 0 ); IFillCurrentSound( 0 );
// Logging // Logging
plString str = plString::Format(" Grouped %s %s allocated (%d msec).", buffer->GetFileName().IsValid() ? "file" : "buffer", plString str = plFormat(" Grouped {} {} allocated ({} msec).", buffer->GetFileName().IsValid() ? "file" : "buffer",
buffer->GetFileName().IsValid() ? buffer->GetFileName().AsString().c_str() : buffer->GetKey()->GetUoid().GetObjectName().c_str(), buffer->GetFileName().IsValid() ? buffer->GetFileName() : buffer->GetKeyName(),
//fDSoundBuffer->IsHardwareAccelerated() ? "hardware" : "software", //fDSoundBuffer->IsHardwareAccelerated() ? "hardware" : "software",
//fDSoundBuffer->IsStaticVoice() ? "static" : "dynamic", //fDSoundBuffer->IsStaticVoice() ? "static" : "dynamic",
#ifdef PL_PROFILE_ENABLED #ifdef PL_PROFILE_ENABLED
gProfileVarStaticSndShoveTime.GetValue() ); gProfileVarStaticSndShoveTime.GetValue());
#else #else
0 ); 0);
#endif #endif
IPrintDbgMessage( str.c_str() ); IPrintDbgMessage( str.c_str() );
if( GetKey() != nil && GetKeyName().Find( "Footstep" ) >= 0 ) if( GetKey() != nil && GetKeyName().Find( "Footstep" ) >= 0 )

9
Sources/Plasma/PubUtilLib/plAudio/plWin32StaticSound.cpp

@ -115,7 +115,7 @@ bool plWin32StaticSound::LoadSound( bool is3D )
if( retVal == plSoundBuffer::kError ) if( retVal == plSoundBuffer::kError )
{ {
plString str = plString::Format( "Unable to open .wav file %s", fDataBufferKey ? fDataBufferKey->GetName().c_str() : "nil"); plString str = plFormat("Unable to open .wav file {}", fDataBufferKey ? fDataBufferKey->GetName() : "nil");
IPrintDbgMessage( str.c_str(), true ); IPrintDbgMessage( str.c_str(), true );
fFailed = true; fFailed = true;
return false; return false;
@ -143,9 +143,10 @@ bool plWin32StaticSound::LoadSound( bool is3D )
fDSoundBuffer = new plDSoundBuffer( bufferSize, header, is3D, IsPropertySet( kPropLooping ), tryStatic ); fDSoundBuffer = new plDSoundBuffer( bufferSize, header, is3D, IsPropertySet( kPropLooping ), tryStatic );
if( !fDSoundBuffer->IsValid() ) if( !fDSoundBuffer->IsValid() )
{ {
char str[256]; plString str = plFormat("Can't create sound buffer for {}.wav. This could happen if the wav file is a stereo file."
sprintf(str, "Can't create sound buffer for %s.wav. This could happen if the wav file is a stereo file. Stereo files are not supported on 3D sounds. If the file is not stereo then please report this error.", GetFileName().AsString().c_str()); " Stereo files are not supported on 3D sounds. If the file is not stereo then please report this error.",
IPrintDbgMessage( str, true ); GetFileName());
IPrintDbgMessage(str.c_str(), true);
fFailed = true; fFailed = true;
delete fDSoundBuffer; delete fDSoundBuffer;

14
Sources/Plasma/PubUtilLib/plAudio/plWin32StreamingSound.cpp

@ -195,7 +195,7 @@ plSoundBuffer::ELoadReturnVal plWin32StreamingSound::IPreLoadBuffer( bool playWh
return plSoundBuffer::kError; return plSoundBuffer::kError;
} }
IPrintDbgMessage(plString::Format(" Readied file %s for streaming", fSrcFilename.AsString().c_str()).c_str()); IPrintDbgMessage(plFormat(" Readied file {} for streaming", fSrcFilename).c_str());
// dont free sound data until we have a chance to use it in load sound // dont free sound data until we have a chance to use it in load sound
@ -251,8 +251,8 @@ bool plWin32StreamingSound::LoadSound( bool is3D )
if( retVal == plSoundBuffer::kError ) if( retVal == plSoundBuffer::kError )
{ {
plString str = plString::Format( "Unable to open streaming source %s", plString str = plFormat("Unable to open streaming source {}",
fDataBufferKey->GetName().c_str() ); fDataBufferKey->GetName());
IPrintDbgMessage( str.c_str(), true ); IPrintDbgMessage( str.c_str(), true );
fFailed = true; fFailed = true;
return false; return false;
@ -282,9 +282,9 @@ bool plWin32StreamingSound::LoadSound( bool is3D )
delete fDSoundBuffer; delete fDSoundBuffer;
fDSoundBuffer = nil; fDSoundBuffer = nil;
plString str = plString::Format("Can't create sound buffer for %s.wav. This could happen if the wav file is a stereo file." plString str = plFormat("Can't create sound buffer for {}.wav. This could happen if the wav file is a stereo file."
" Stereo files are not supported on 3D sounds. If the file is not stereo then please report this error.", " Stereo files are not supported on 3D sounds. If the file is not stereo then please report this error.",
GetFileName().AsString().c_str()); GetFileName());
IPrintDbgMessage(str.c_str(), true); IPrintDbgMessage(str.c_str(), true);
fFailed = true; fFailed = true;
return false; return false;
@ -337,7 +337,7 @@ bool plWin32StreamingSound::LoadSound( bool is3D )
IRefreshEAXSettings( true ); IRefreshEAXSettings( true );
// Debug info // Debug info
plString dbg = plString::Format(" Streaming %s.", fSrcFilename.AsString().c_str()); plString dbg = plFormat(" Streaming {}.", fSrcFilename);
IPrintDbgMessage(dbg.c_str()); IPrintDbgMessage(dbg.c_str());
plStatusLog::AddLineS( "audioTimes.log", 0xffffffff, "Streaming %4.2f secs of %s", plStatusLog::AddLineS( "audioTimes.log", 0xffffffff, "Streaming %4.2f secs of %s",

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

@ -724,16 +724,16 @@ void plAnimStage::DumpDebug(bool active, int &x, int &y, int lineHeight, plDebug
str << " "; str << " ";
if(fLoops) if(fLoops)
str << plString::Format("loop(%d/%d)", fCurLoop, fLoops); str << "loop(" << fCurLoop << '/' << fLoops << ')';
str << plString::Format("time: (%f/%f)", fLocalTime, fLength); str << "time: (" << fLocalTime << '/' << fLength << ')';
if(active) if(active)
debugTxt.DrawString(x, y, str.GetString().c_str(), 0, 255, 0); debugTxt.DrawString(x, y, str.GetString(), 0, 255, 0);
else if(fAnimInstance) else if(fAnimInstance)
debugTxt.DrawString(x, y, str.GetString().c_str()); debugTxt.DrawString(x, y, str.GetString());
else else
debugTxt.DrawString(x, y, str.GetString().c_str(), 255, 255, 0); debugTxt.DrawString(x, y, str.GetString(), 255, 255, 0);
y += lineHeight; y += lineHeight;
} }

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

@ -2654,7 +2654,7 @@ int plArmatureMod::RefreshDebugDisplay()
void plArmatureMod::DumpToDebugDisplay(int &x, int &y, int lineHeight, plDebugText &debugTxt) void plArmatureMod::DumpToDebugDisplay(int &x, int &y, int lineHeight, plDebugText &debugTxt)
{ {
debugTxt.DrawString(x, y, plString::Format("Armature <%s>:", fRootName.c_str()), 255, 128, 128); debugTxt.DrawString(x, y, plFormat("Armature <{}>:", fRootName), 255, 128, 128);
y += lineHeight; y += lineHeight;
plSceneObject * SO = GetTarget(0); plSceneObject * SO = GetTarget(0);
@ -2664,9 +2664,8 @@ void plArmatureMod::DumpToDebugDisplay(int &x, int &y, int lineHeight, plDebugTe
hsMatrix44 l2w = SO->GetLocalToWorld(); hsMatrix44 l2w = SO->GetLocalToWorld();
hsPoint3 worldPos = l2w.GetTranslate(); hsPoint3 worldPos = l2w.GetTranslate();
const char *opaque = IsOpaque() ? "yes" : "no"; debugTxt.DrawString(x, y, plFormat("position(world): {.2f}, {.2f}, {.2f} Opaque: {>3}",
debugTxt.DrawString(x, y, plString::Format("position(world): %.2f, %.2f, %.2f Opaque: %3s", worldPos.fX, worldPos.fY, worldPos.fZ, IsOpaque() ? "yes" : "no"));
worldPos.fX, worldPos.fY, worldPos.fZ, opaque));
y += lineHeight; y += lineHeight;
const char* frozen = "n.a."; const char* frozen = "n.a.";
@ -2677,8 +2676,8 @@ void plArmatureMod::DumpToDebugDisplay(int &x, int &y, int lineHeight, plDebugTe
plKey world = nil; plKey world = nil;
if (fController) if (fController)
world = fController->GetSubworld(); world = fController->GetSubworld();
debugTxt.DrawString(x, y, plString::Format("In world: %s Frozen: %s", debugTxt.DrawString(x, y, plFormat("In world: {} Frozen: {}",
world ? world->GetName().c_str() : "nil", frozen)); world ? world->GetName() : "nil", frozen));
y+= lineHeight; y+= lineHeight;
plString details; plString details;
@ -2687,8 +2686,8 @@ void plArmatureMod::DumpToDebugDisplay(int &x, int &y, int lineHeight, plDebugTe
hsPoint3 physPos; hsPoint3 physPos;
GetPositionAndRotationSim(&physPos, nil); GetPositionAndRotationSim(&physPos, nil);
const hsVector3& vel = fController->GetLinearVelocity(); const hsVector3& vel = fController->GetLinearVelocity();
details = plString::Format("position(physical): <%.2f, %.2f, %.2f> velocity: <%5.2f, %5.2f, %5.2f>", details = plFormat("position(physical): <{.2f}, {.2f}, {.2f}> velocity: <{5.2f}, {5.2f}, {5.2f}>",
physPos.fX, physPos.fY, physPos.fZ, vel.fX, vel.fY, vel.fZ); physPos.fX, physPos.fY, physPos.fZ, vel.fX, vel.fY, vel.fZ);
} }
else else
{ {
@ -2747,11 +2746,11 @@ void plArmatureMod::DumpToDebugDisplay(int &x, int &y, int lineHeight, plDebugTe
debugTxt.DrawString(x, y, "Relevance Regions:"); debugTxt.DrawString(x, y, "Relevance Regions:");
y += lineHeight; y += lineHeight;
debugTxt.DrawString(x, y, plString::Format(" In: %s", debugTxt.DrawString(x, y, plFormat(" In: {}",
plRelevanceMgr::Instance()->GetRegionNames(fRegionsImIn).c_str())); plRelevanceMgr::Instance()->GetRegionNames(fRegionsImIn)));
y += lineHeight; y += lineHeight;
debugTxt.DrawString(x, y, plString::Format(" Care about: %s", debugTxt.DrawString(x, y, plFormat(" Care about: %s",
plRelevanceMgr::Instance()->GetRegionNames(fRegionsICareAbout).c_str())); plRelevanceMgr::Instance()->GetRegionNames(fRegionsICareAbout)));
y += lineHeight; y += lineHeight;
} }
} }
@ -2792,11 +2791,11 @@ void plAvBoneMap::AddBoneMapping(uint32_t boneID, const plSceneObject *SO)
void plArmatureMod::DebugDumpMoveKeys(int &x, int &y, int lineHeight, plDebugText &debugTxt) void plArmatureMod::DebugDumpMoveKeys(int &x, int &y, int lineHeight, plDebugText &debugTxt)
{ {
debugTxt.DrawString(x, y, plString::Format("Mouse Input Map: %s", debugTxt.DrawString(x, y, plFormat("Mouse Input Map: {}",
plAvatarInputInterface::GetInstance()->GetInputMapName())); plAvatarInputInterface::GetInstance()->GetInputMapName()));
y += lineHeight; y += lineHeight;
debugTxt.DrawString(x, y, plString::Format("Turn strength: %.2f (key: %.2f, analog: %.2f)", debugTxt.DrawString(x, y, plFormat("Turn strength: {.2f} (key: {.2f}, analog: {.2f})",
GetTurnStrength(), GetKeyTurnStrength(), GetAnalogTurnStrength())); GetTurnStrength(), GetKeyTurnStrength(), GetAnalogTurnStrength()));
y += lineHeight; y += lineHeight;

7
Sources/Plasma/PubUtilLib/plAvatar/plAvBehaviors.cpp

@ -105,19 +105,18 @@ void plArmatureBehavior::DumpDebug(int &x, int &y, int lineHeight, plDebugText &
{ {
float strength = GetStrength(); float strength = GetStrength();
const char *onOff = strength > 0 ? "on" : "off"; const char *onOff = strength > 0 ? "on" : "off";
char blendBar[11] = "||||||||||"; char blendBar[] = "||||||||||";
int bars = (int)min(10 * strength, 10); int bars = (int)min(10 * strength, 10);
blendBar[bars] = '\0'; blendBar[bars] = '\0';
plString details; plString details;
if (fAnim) if (fAnim)
{ {
plString animName = fAnim->GetName();
float time = fAnim->GetTimeConvert()->CurrentAnimTime(); float time = fAnim->GetTimeConvert()->CurrentAnimTime();
details = plString::Format("%20s %3s time: %5.2f %s", animName.c_str(), onOff, time, blendBar); details = plFormat("{>20} {>3} time: {5.2f} {}", fAnim->GetName(), onOff, time, blendBar);
} }
else else
details = plString::Format(" Behavior %2d %3s %s", fIndex, onOff, blendBar); details = plFormat(" Behavior {2} {>3} {}", fIndex, onOff, blendBar);
debugTxt.DrawString(x, y, details); debugTxt.DrawString(x, y, details);
y += lineHeight; y += lineHeight;

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

@ -443,7 +443,7 @@ void plAvBrainCritter::DumpToDebugDisplay(int& x, int& y, int lineHeight, plDebu
// extract the name from the behavior running // extract the name from the behavior running
plString mode = "Mode: Unknown"; plString mode = "Mode: Unknown";
if (fBehaviors[fCurMode]) if (fBehaviors[fCurMode])
mode = plString::Format("Mode: %s", ((CritterBehavior*)(fBehaviors[fCurMode]))->Name().c_str()); mode = plFormat("Mode: {}", ((CritterBehavior*)(fBehaviors[fCurMode]))->Name());
// draw it // draw it
debugTxt.DrawString(x, y, mode); debugTxt.DrawString(x, y, mode);

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

@ -903,7 +903,7 @@ void plAvBrainHuman::DumpToDebugDisplay(int &x, int &y, int lineHeight, plDebugT
const char *grounded = fWalkingStrategy->IsOnGround() ? "yes" : "no"; const char *grounded = fWalkingStrategy->IsOnGround() ? "yes" : "no";
const char *pushing = (fWalkingStrategy->GetPushingPhysical() ? (fWalkingStrategy->GetFacingPushingPhysical() ? "facing" : "behind") : "none"); const char *pushing = (fWalkingStrategy->GetPushingPhysical() ? (fWalkingStrategy->GetFacingPushingPhysical() ? "facing" : "behind") : "none");
debugTxt.DrawString(x, y, plString::Format("Ground: %3s, AirTime: %5.2f (Peak: %5.2f), PushingPhys: %6s", debugTxt.DrawString(x, y, plFormat("Ground: {>3}, AirTime: {5.2f} (Peak: {5.2f}), PushingPhys: {>6}",
grounded, fWalkingStrategy->GetAirTime(), fWalkingStrategy->GetImpactTime(), pushing)); grounded, fWalkingStrategy->GetAirTime(), fWalkingStrategy->GetImpactTime(), pushing));
y += lineHeight; y += lineHeight;

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

@ -619,11 +619,11 @@ void plAvBrainSwim::DumpToDebugDisplay(int &x, int &y, int lineHeight, plDebugTe
y += lineHeight; y += lineHeight;
float buoy = fSwimStrategy ? fSwimStrategy->GetBuoyancy() : 0.0f; float buoy = fSwimStrategy ? fSwimStrategy->GetBuoyancy() : 0.0f;
debugTxt.DrawString(x, y, plString::Format("Distance to surface: %f Buoyancy: %f", fSurfaceDistance, buoy)); debugTxt.DrawString(x, y, plFormat("Distance to surface: {f} Buoyancy: {f}", fSurfaceDistance, buoy));
y += lineHeight; y += lineHeight;
hsVector3 linV = fAvMod->GetController()->GetAchievedLinearVelocity(); hsVector3 linV = fAvMod->GetController()->GetAchievedLinearVelocity();
debugTxt.DrawString(x, y, plString::Format("Linear Velocity: (%5.2f, %5.2f, %5.2f)", linV.fX, linV.fY, linV.fZ)); debugTxt.DrawString(x, y, plFormat("Linear Velocity: ({5.2f}, {5.2f}, {5.2f})", linV.fX, linV.fY, linV.fZ));
y += lineHeight; y += lineHeight;
int i; int i;

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

@ -267,11 +267,11 @@ void plClothingItem::Write(hsStream *s, hsResMgr *mgr)
plKey accessoryKey = nil; plKey accessoryKey = nil;
if (!fAccessoryName.IsEmpty()) if (!fAccessoryName.IsEmpty())
{ {
plString strBuf = plString::Format("CItm_%s", fAccessoryName.c_str()); plString strBuf = plFormat("CItm_{}", fAccessoryName);
accessoryKey = plKeyFinder::Instance().StupidSearch("GlobalClothing", "", plClothingItem::Index(), strBuf); accessoryKey = plKeyFinder::Instance().StupidSearch("GlobalClothing", "", plClothingItem::Index(), strBuf);
if (accessoryKey == nil) if (accessoryKey == nil)
{ {
strBuf = plString::Format("Couldn't find accessory \"%s\". It won't show at runtime.", fAccessoryName.c_str()); strBuf = plFormat("Couldn't find accessory \"{}\". It won't show at runtime.", fAccessoryName);
hsMessageBox(strBuf.c_str(), GetKeyName().c_str(), hsMessageBoxNormal); hsMessageBox(strBuf.c_str(), GetKeyName().c_str(), hsMessageBoxNormal);
} }
} }

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

@ -636,7 +636,7 @@ bool plAvOneShotTask::Start(plArmatureMod *avatar, plArmatureBrain *brain, doubl
} }
else else
{ {
plString buf = plString::Format("Oneshot: Can't find animation <%s>; all bets are off.", fAnimName.c_str()); plString buf = plFormat("Oneshot: Can't find animation <{}>; all bets are off.", fAnimName);
hsAssert(false, buf.c_str()); hsAssert(false, buf.c_str());
result = true; result = true;
} }

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

@ -116,7 +116,7 @@ plCoopCoordinator::plCoopCoordinator(plKey host, plKey guest,
serial = serial % 999; serial = serial % 999;
plString newName = plString::Format("%s%s%3i\x000", host->GetName().c_str(), guest->GetName().c_str(), serial++); plString newName = plFormat("{}{}{3}\x000", host->GetName(), guest->GetName(), serial++);
plKey newKey = hsgResMgr::ResMgr()->NewKey(newName, this, host->GetUoid().GetLocation()); plKey newKey = hsgResMgr::ResMgr()->NewKey(newName, this, host->GetUoid().GetLocation());

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

@ -290,7 +290,7 @@ bool IIsClosestAnim(const char *animName, hsMatrix44 &sitGoal, float &closestDis
return true; return true;
} }
} else { } else {
hsAssert(false, plString::Format("Missing sit animation: %s", animName).c_str()); hsAssert(false, plFormat("Missing sit animation: {}", animName).c_str());
} }
return false; return false;
} }

16
Sources/Plasma/PubUtilLib/plContainer/plConfigInfo.h

@ -142,11 +142,17 @@ public:
plConfigInfo* GetConfigInfo() { return &fConfigInfo; } plConfigInfo* GetConfigInfo() { return &fConfigInfo; }
plConfigInfo* GetConfigInfoLog() { return &fLog; } plConfigInfo* GetConfigInfoLog() { return &fLog; }
bool GetValue(plString& retval, const plString & section, const plString & key, const plString & desc, const plString& defval = ""); template <typename _Type>
bool GetValue(int& retval, const plString & section, const plString & key, const plString & desc, int defval); bool GetValue(_Type& retval, const plString & section, const plString & key, const plString & desc, const _Type& defval = _Type())
bool GetValue(bool& retval, const plString & section, const plString & key, const plString & desc, bool defval); {
bool GetValue(float& retval, const plString & section, const plString & key, const plString & desc, float defval); plString descwdef = plFormat("{} # {}", defval, desc);
bool GetValue(double& retval, const plString & section, const plString & key, const plString & desc, double defval); fLog.AddValue(section, key, descwdef, kReplaceIfExists);
bool found;
retval = fConfigInfo.GetValue(section, key, defval, &found);
return found;
}
bool GetAllValues(std::vector<plString>& values, const plString & section, const plString & key, const plString & desc); bool GetAllValues(std::vector<plString>& values, const plString & section, const plString & key, const plString & desc);
#if USE_MULT_SECTIONS #if USE_MULT_SECTIONS

53
Sources/Plasma/PubUtilLib/plContainer/plConfigInfoLogging.cpp

@ -49,60 +49,9 @@ plConfigInfoLogging::~plConfigInfoLogging()
{ {
} }
bool plConfigInfoLogging::GetValue(plString& retval, const plString & section, const plString & key, const plString & desc, const plString& defval)
{
plString descwdef = plString::Format("%s # %s",defval.c_str(),desc.c_str());
fLog.AddValue(section,key,descwdef,kReplaceIfExists);
bool found;
retval = fConfigInfo.GetValue(section,key,defval,&found);
return found;
}
bool plConfigInfoLogging::GetValue(int& retval, const plString & section, const plString & key, const plString & desc, int defval)
{
plString descwdef = plString::Format("%d # %s",defval,desc.c_str());
fLog.AddValue(section,key,descwdef,kReplaceIfExists);
bool found;
retval = fConfigInfo.GetValue(section,key,defval,&found);
return found;
}
bool plConfigInfoLogging::GetValue(bool& retval, const plString & section, const plString & key, const plString & desc, bool defval)
{
plString descwdef = plString::Format("%d # %s",defval,desc.c_str());
fLog.AddValue(section,key,descwdef,kReplaceIfExists);
bool found;
retval = ( fConfigInfo.GetValue(section,key,(int)defval,&found)!=0 );
return found;
}
bool plConfigInfoLogging::GetValue(float& retval, const plString & section, const plString & key, const plString & desc, float defval)
{
plString descwdef = plString::Format("%f # %s",defval,desc.c_str());
fLog.AddValue(section,key,descwdef,kReplaceIfExists);
bool found;
double retvald = fConfigInfo.GetValue(section,key,defval,&found);
retval = (float)retvald;
return found;
}
bool plConfigInfoLogging::GetValue(double& retval, const plString & section, const plString & key, const plString & desc, double defval)
{
plString descwdef = plString::Format("%f # %s",defval,desc.c_str());
fLog.AddValue(section,key,descwdef,kReplaceIfExists);
bool found;
retval = fConfigInfo.GetValue(section,key,defval,&found);
return found;
}
bool plConfigInfoLogging::GetAllValues(std::vector<plString>& values, const plString & section, const plString & key, const plString & desc) bool plConfigInfoLogging::GetAllValues(std::vector<plString>& values, const plString & section, const plString & key, const plString & desc)
{ {
plString descwdef = plString::Format("%s # %s","\"Multiple Entries\"",desc.c_str()); plString descwdef = plFormat("\"Multiple Entries\" # {}", desc);
fLog.AddValue(section,key,descwdef,kReplaceIfExists); fLog.AddValue(section,key,descwdef,kReplaceIfExists);
values = fConfigInfo.GetAllValues(section,key); values = fConfigInfo.GetAllValues(section,key);

18
Sources/Plasma/PubUtilLib/plContainer/plKeysAndValues.cpp

@ -87,12 +87,12 @@ bool plKeysAndValues::KeyHasValue(const plString & key, const plString & value)
bool plKeysAndValues::KeyHasValue(const plString & key, int value) bool plKeysAndValues::KeyHasValue(const plString & key, int value)
{ {
return KeyHasValue(key, plString::Format("%d", value)); return KeyHasValue(key, plFormat("{}", value));
} }
bool plKeysAndValues::KeyHasValue(const plString & key, double value) bool plKeysAndValues::KeyHasValue(const plString & key, double value)
{ {
return KeyHasValue(key, plString::Format("%f", value)); return KeyHasValue(key, plFormat("{f}", value));
} }
bool plKeysAndValues::AddValue(const plString & key, const plString & value, KAddValueMode mode) bool plKeysAndValues::AddValue(const plString & key, const plString & value, KAddValueMode mode)
@ -116,12 +116,12 @@ bool plKeysAndValues::AddValue(const plString & key, const plString & value, KAd
bool plKeysAndValues::AddValue(const plString & key, int value, KAddValueMode mode) bool plKeysAndValues::AddValue(const plString & key, int value, KAddValueMode mode)
{ {
return AddValue(key, plString::Format("%d", value), mode); return AddValue(key, plFormat("{}", value), mode);
} }
bool plKeysAndValues::AddValue(const plString & key, double value, KAddValueMode mode) bool plKeysAndValues::AddValue(const plString & key, double value, KAddValueMode mode)
{ {
return AddValue(key, plString::Format("%f", value), mode); return AddValue(key, plFormat("{f}", value), mode);
} }
bool plKeysAndValues::AddValues(const plString & key, const std::vector<plString> & values, KAddValueMode mode) bool plKeysAndValues::AddValues(const plString & key, const std::vector<plString> & values, KAddValueMode mode)
@ -139,12 +139,12 @@ bool plKeysAndValues::SetValue(const plString & key, const plString & value)
bool plKeysAndValues::SetValue(const plString & key, int value) bool plKeysAndValues::SetValue(const plString & key, int value)
{ {
return SetValue(key, plString::Format("%d", value)); return SetValue(key, plFormat("{}", value));
} }
bool plKeysAndValues::SetValue(const plString & key, double value) bool plKeysAndValues::SetValue(const plString & key, double value)
{ {
return SetValue(key, plString::Format("%f", value)); return SetValue(key, plFormat("{f}", value));
} }
plString plKeysAndValues::GetValue(const plString & key, const plString & defval, bool * outFound) const plString plKeysAndValues::GetValue(const plString & key, const plString & defval, bool * outFound) const
@ -160,17 +160,17 @@ plString plKeysAndValues::GetValue(const plString & key, const plString & defval
uint32_t plKeysAndValues::GetValue(const plString & key, uint32_t defval, bool * outFound) const uint32_t plKeysAndValues::GetValue(const plString & key, uint32_t defval, bool * outFound) const
{ {
return strtoul(GetValue(key, plString::Format("%ul", defval), outFound).c_str(), nil, 0); return GetValue(key, plFormat("{}", defval), outFound).ToUInt();
} }
int plKeysAndValues::GetValue(const plString & key, int defval, bool * outFound) const int plKeysAndValues::GetValue(const plString & key, int defval, bool * outFound) const
{ {
return atol(GetValue(key, plString::Format("%d", defval), outFound).c_str()); return GetValue(key, plFormat("{}", defval), outFound).ToInt();
} }
double plKeysAndValues::GetValue(const plString & key, double defval, bool * outFound) const double plKeysAndValues::GetValue(const plString & key, double defval, bool * outFound) const
{ {
return atof(GetValue(key, plString::Format("%f", defval), outFound).c_str()); return GetValue(key, plFormat("{f}", defval), outFound).ToDouble();
} }
std::vector<plString> plKeysAndValues::GetAllValues(const plString & key) std::vector<plString> plKeysAndValues::GetAllValues(const plString & key)

2
Sources/Plasma/PubUtilLib/plDrawable/plDrawableGenerator.cpp

@ -259,7 +259,7 @@ plDrawableSpans *plDrawableGenerator::GenerateDrawable( uint32_t vertCount, hsPo
} }
static int nameIdx = 0; static int nameIdx = 0;
plString buff = plString::Format( "GenDrawable_%d", nameIdx++ ); plString buff = plFormat("GenDrawable_{}", nameIdx++);
hsgResMgr::ResMgr()->NewKey( buff, newDraw, plLocation::kGlobalFixedLoc ); hsgResMgr::ResMgr()->NewKey( buff, newDraw, plLocation::kGlobalFixedLoc );
} }

8
Sources/Plasma/PubUtilLib/plDrawable/plDynaDecalMgr.cpp

@ -1578,20 +1578,20 @@ hsGMaterial* plDynaDecalMgr::IConvertToEnvMap(hsGMaterial* mat, plBitmap* envMap
oldMip->SetCurrLevel(0); oldMip->SetCurrLevel(0);
hsGMaterial* newMat = new hsGMaterial; hsGMaterial* newMat = new hsGMaterial;
plString buff = plString::Format("%s_EnvMat", GetKey()->GetName().c_str()); plString buff = plFormat("{}_EnvMat", GetKey()->GetName());
hsgResMgr::ResMgr()->NewKey(buff, newMat, GetKey()->GetUoid().GetLocation()); hsgResMgr::ResMgr()->NewKey(buff, newMat, GetKey()->GetUoid().GetLocation());
static plTweak<float> kSmooth(1.f); static plTweak<float> kSmooth(1.f);
plMipmap* bumpMap = plBumpMapGen::QikNormalMap(nil, oldMip, 0xffffffff, plBumpMapGen::kBubbleTest, kSmooth); plMipmap* bumpMap = plBumpMapGen::QikNormalMap(nil, oldMip, 0xffffffff, plBumpMapGen::kBubbleTest, kSmooth);
// plMipmap* bumpMap = plBumpMapGen::QikNormalMap(nil, oldMip, 0xffffffff, plBumpMapGen::kNormalize, kSmooth); // plMipmap* bumpMap = plBumpMapGen::QikNormalMap(nil, oldMip, 0xffffffff, plBumpMapGen::kNormalize, kSmooth);
// plMipmap* bumpMap = plBumpMapGen::QikNormalMap(nil, oldMip, 0xffffffff, 0, 0); // plMipmap* bumpMap = plBumpMapGen::QikNormalMap(nil, oldMip, 0xffffffff, 0, 0);
buff = plString::Format("%s_BumpMap", GetKey()->GetName().c_str()); buff = plFormat("{}_BumpMap", GetKey()->GetName());
hsgResMgr::ResMgr()->NewKey(buff, bumpMap, GetKey()->GetUoid().GetLocation()); hsgResMgr::ResMgr()->NewKey(buff, bumpMap, GetKey()->GetUoid().GetLocation());
bumpMap->SetFlags(bumpMap->GetFlags() | plMipmap::kBumpEnvMap | plMipmap::kForceNonCompressed); bumpMap->SetFlags(bumpMap->GetFlags() | plMipmap::kBumpEnvMap | plMipmap::kForceNonCompressed);
plLayer* bumpLay = new plLayer; plLayer* bumpLay = new plLayer;
buff = plString::Format("%s_BumpMap_0", GetKey()->GetName().c_str()); buff = plFormat("{}_BumpMap_0", GetKey()->GetName());
hsgResMgr::ResMgr()->NewKey(buff, bumpLay, GetKey()->GetUoid().GetLocation()); hsgResMgr::ResMgr()->NewKey(buff, bumpLay, GetKey()->GetUoid().GetLocation());
bumpLay->SetState(oldLay->GetState()); bumpLay->SetState(oldLay->GetState());
@ -1613,7 +1613,7 @@ hsGMaterial* plDynaDecalMgr::IConvertToEnvMap(hsGMaterial* mat, plBitmap* envMap
newMat->AddLayerViaNotify(bumpLay); newMat->AddLayerViaNotify(bumpLay);
plLayer* envLay = new plLayer; plLayer* envLay = new plLayer;
buff = plString::Format("%s_EnvMap_0", GetKey()->GetName().c_str()); buff = plFormat("{}_EnvMap_0", GetKey()->GetName());
hsgResMgr::ResMgr()->NewKey(buff, envLay, GetKey()->GetUoid().GetLocation()); hsgResMgr::ResMgr()->NewKey(buff, envLay, GetKey()->GetUoid().GetLocation());
envLay->SetBlendFlags(hsGMatState::kBlendMult); envLay->SetBlendFlags(hsGMatState::kBlendMult);

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

@ -84,12 +84,14 @@ void plProxyGen::Init(const hsKeyedObject* owner)
plLocation loc; plLocation loc;
if( owner->GetKey() ) if( owner->GetKey() )
{ {
buff = plString::Format("%s_ProxyGen_%d_%d", owner->GetKey()->GetName().c_str(), owner->GetKey()->GetUoid().GetClonePlayerID(), fProxyKeyCounter++); buff = plFormat("{}_ProxyGen_{}_{}", owner->GetKey()->GetName(),
owner->GetKey()->GetUoid().GetClonePlayerID(),
fProxyKeyCounter++);
loc = owner->GetKey()->GetUoid().GetLocation(); loc = owner->GetKey()->GetUoid().GetLocation();
} }
else else
{ {
buff = plString::Format( "ProxyGen%d", fProxyKeyCounter++ ); buff = plFormat("ProxyGen{}", fProxyKeyCounter++);
loc = plLocation::kGlobalFixedLoc; loc = plLocation::kGlobalFixedLoc;
} }
@ -159,7 +161,7 @@ hsGMaterial* plProxyGen::IMakeProxyMaterial() const
plString buff; plString buff;
if( !GetKeyName().IsNull() ) if( !GetKeyName().IsNull() )
buff = plString::Format("%s_Material", GetKeyName().c_str()); buff = plFormat("{}_Material", GetKeyName());
else else
buff = "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 );
@ -234,7 +236,7 @@ void plProxyGen::IGenerateProxy()
{ {
plString buff; plString buff;
if( !GetKeyName().IsNull() ) if( !GetKeyName().IsNull() )
buff = plString::Format("%s_ProxyDrawable", GetKeyName().c_str()); buff = plFormat("{}_ProxyDrawable", GetKeyName());
else else
buff = "ProxyDrawable"; buff = "ProxyDrawable";

56
Sources/Plasma/PubUtilLib/plDrawable/plWaveSet7.cpp

@ -1616,7 +1616,7 @@ plMipmap* plWaveSet7::ICreateBiasNoiseMap()
plMipmap::kUncompressed, plMipmap::kUncompressed,
plMipmap::UncompressedInfo::kRGB8888); plMipmap::UncompressedInfo::kRGB8888);
plString buff = plString::Format("%s_BiasBitPS", GetKey()->GetName().c_str()); plString buff = plFormat("{}_BiasBitPS", GetKey()->GetName());
hsgResMgr::ResMgr()->NewKey(buff, mipMap, GetKey()->GetUoid().GetLocation()); hsgResMgr::ResMgr()->NewKey(buff, mipMap, GetKey()->GetUoid().GetLocation());
int i; int i;
@ -1661,7 +1661,7 @@ plMipmap* plWaveSet7::ICreateBumpMipmapPS()
plMipmap::kUncompressed, plMipmap::kUncompressed,
plMipmap::UncompressedInfo::kRGB8888); plMipmap::UncompressedInfo::kRGB8888);
plString buff = plString::Format("%s_BumpBitPS", GetKey()->GetName().c_str()); plString buff = plFormat("{}_BumpBitPS", GetKey()->GetName());
hsgResMgr::ResMgr()->NewKey(buff, mipMap, GetKey()->GetUoid().GetLocation()); hsgResMgr::ResMgr()->NewKey(buff, mipMap, GetKey()->GetUoid().GetLocation());
hsgResMgr::ResMgr()->SendRef(mipMap->GetKey(), new plGenRefMsg(GetKey(), plRefMsg::kOnRequest, 0, kRefCosineLUT), plRefFlags::kActiveRef); hsgResMgr::ResMgr()->SendRef(mipMap->GetKey(), new plGenRefMsg(GetKey(), plRefMsg::kOnRequest, 0, kRefCosineLUT), plRefFlags::kActiveRef);
@ -1713,7 +1713,7 @@ void plWaveSet7::IAddBumpBiasLayer(hsGMaterial* mat)
for( i = 0; i < 2; i++ ) for( i = 0; i < 2; i++ )
{ {
plLayer* layer = new plLayer; plLayer* layer = new plLayer;
plString buff = plString::Format("%s_Bias_%d", GetKey()->GetName().c_str(), i); plString buff = plFormat("{}_Bias_{}", GetKey()->GetName(), i);
hsgResMgr::ResMgr()->NewKey(buff, layer, GetKey()->GetUoid().GetLocation()); hsgResMgr::ResMgr()->NewKey(buff, layer, GetKey()->GetUoid().GetLocation());
layer->SetBlendFlags(hsGMatState::kBlendAdd); layer->SetBlendFlags(hsGMatState::kBlendAdd);
@ -1748,7 +1748,7 @@ void plWaveSet7::IAddBumpBiasLayer(hsGMaterial* mat)
plLayer* plWaveSet7::ICreateBumpLayerPS(plMipmap* mipMap, hsGMaterial* bumpMat, int which) plLayer* plWaveSet7::ICreateBumpLayerPS(plMipmap* mipMap, hsGMaterial* bumpMat, int which)
{ {
plLayer* layer = new plLayer; plLayer* layer = new plLayer;
plString buff = plString::Format("%s_BumpLayerPS_%d", GetKey()->GetName().c_str(), which); plString buff = plFormat("{}_BumpLayerPS_{}", GetKey()->GetName(), which);
hsgResMgr::ResMgr()->NewKey(buff, layer, GetKey()->GetUoid().GetLocation()); hsgResMgr::ResMgr()->NewKey(buff, layer, GetKey()->GetUoid().GetLocation());
layer->SetBlendFlags(which ? hsGMatState::kBlendAdd : 0); layer->SetBlendFlags(which ? hsGMatState::kBlendAdd : 0);
@ -1805,7 +1805,7 @@ hsGMaterial* plWaveSet7::ICreateBumpLayersPS()
// Create a blank material // Create a blank material
hsGMaterial* bumpMat = new hsGMaterial; hsGMaterial* bumpMat = new hsGMaterial;
plString buff = plString::Format("%s_BumpMatPS", GetKey()->GetName().c_str()); plString buff = plFormat("{}_BumpMatPS", GetKey()->GetName());
hsgResMgr::ResMgr()->NewKey(buff, bumpMat, GetKey()->GetUoid().GetLocation()); hsgResMgr::ResMgr()->NewKey(buff, bumpMat, GetKey()->GetUoid().GetLocation());
plMipmap* mipMap = ICreateBumpMipmapPS(); plMipmap* mipMap = ICreateBumpMipmapPS();
@ -1846,7 +1846,7 @@ void plWaveSet7::IAddBumpBiasShaders(plLayer* layer)
{ {
plShader* vShader = new plShader; plShader* vShader = new plShader;
plString buff = plString::Format("%s_BiasVS", GetKey()->GetName().c_str()); plString buff = plFormat("{}_BiasVS", GetKey()->GetName());
hsgResMgr::ResMgr()->NewKey(buff, vShader, GetKey()->GetUoid().GetLocation()); hsgResMgr::ResMgr()->NewKey(buff, vShader, GetKey()->GetUoid().GetLocation());
vShader->SetIsPixelShader(false); vShader->SetIsPixelShader(false);
@ -1909,7 +1909,7 @@ void plWaveSet7::IAddBumpBiasShaders(plLayer* layer)
{ {
plShader* pShader = new plShader; plShader* pShader = new plShader;
plString buff = plString::Format("%s_BiasPS", GetKey()->GetName().c_str()); plString buff = plFormat("{}_BiasPS", GetKey()->GetName());
hsgResMgr::ResMgr()->NewKey(buff, pShader, GetKey()->GetUoid().GetLocation()); hsgResMgr::ResMgr()->NewKey(buff, pShader, GetKey()->GetUoid().GetLocation());
pShader->SetIsPixelShader(true); pShader->SetIsPixelShader(true);
@ -1942,7 +1942,7 @@ void plWaveSet7::IAddBumpVertexShader(hsGMaterial* mat, int iShader, int iFirst,
int iShader = iBase / kBumpPerPass; int iShader = iBase / kBumpPerPass;
plShader* vShader = new plShader; plShader* vShader = new plShader;
plString buff = plString::Format("%s_BumpVS_%d", GetKey()->GetName().c_str(), iShader); plString buff = plFormat("{}_BumpVS_{}", GetKey()->GetName(), iShader);
hsgResMgr::ResMgr()->NewKey(buff, vShader, GetKey()->GetUoid().GetLocation()); hsgResMgr::ResMgr()->NewKey(buff, vShader, GetKey()->GetUoid().GetLocation());
vShader->SetIsPixelShader(false); vShader->SetIsPixelShader(false);
@ -1987,7 +1987,7 @@ void plWaveSet7::IAddBumpPixelShader(hsGMaterial* mat, int iShader, int iFirst,
int iShader = iBase / kBumpPerPass; int iShader = iBase / kBumpPerPass;
plShader* pShader = new plShader; plShader* pShader = new plShader;
plString buff = plString::Format("%s_BumpPS_%d", GetKey()->GetName().c_str(), iShader); plString buff = plFormat("{}_BumpPS_{}", GetKey()->GetName(), iShader);
hsgResMgr::ResMgr()->NewKey(buff, pShader, GetKey()->GetUoid().GetLocation()); hsgResMgr::ResMgr()->NewKey(buff, pShader, GetKey()->GetUoid().GetLocation());
pShader->SetIsPixelShader(true); pShader->SetIsPixelShader(true);
@ -2029,7 +2029,7 @@ void plWaveSet7::IAddBumpPixelShader(hsGMaterial* mat, int iShader, int iFirst,
plDrawableSpans* plWaveSet7::ICreateBumpDrawable() plDrawableSpans* plWaveSet7::ICreateBumpDrawable()
{ {
fBumpDraw = new plDrawableSpans; fBumpDraw = new plDrawableSpans;
plString buff = plString::Format("%s_BumpDraw", GetKey()->GetName().c_str()); plString buff = plFormat("{}_BumpDraw", GetKey()->GetName());
hsgResMgr::ResMgr()->NewKey(buff, fBumpDraw, GetKey()->GetUoid().GetLocation()); hsgResMgr::ResMgr()->NewKey(buff, fBumpDraw, GetKey()->GetUoid().GetLocation());
ICreateClearDrawable(fBumpDraw, fBumpMat); ICreateClearDrawable(fBumpDraw, fBumpMat);
@ -2144,7 +2144,7 @@ plRenderTarget* plWaveSet7::ICreateTransferRenderTarget(const char* name, int si
plRenderTarget* rt = new plRenderTarget(flags, size, size, bitDepth, zDepth, stencilDepth); plRenderTarget* rt = new plRenderTarget(flags, size, size, bitDepth, zDepth, stencilDepth);
plString buff = plString::Format("%s_%s", GetKey()->GetName().c_str(), name); plString buff = plFormat("{}_{}", GetKey()->GetName(), name);
hsgResMgr::ResMgr()->NewKey(buff, rt, GetKey()->GetUoid().GetLocation()); hsgResMgr::ResMgr()->NewKey(buff, rt, GetKey()->GetUoid().GetLocation());
return rt; return rt;
@ -2156,7 +2156,7 @@ plLayer* plWaveSet7::ICreateTotalLayer(plBitmap* bm, hsGMaterial* mat, int which
if( !layer ) if( !layer )
{ {
layer = new plLayer; layer = new plLayer;
plString buff = plString::Format("%s_%sLayerPS_%d", GetKey()->GetName().c_str(), suff, which); plString buff = plFormat("{}_{}LayerPS_{}", GetKey()->GetName(), suff, which);
hsgResMgr::ResMgr()->NewKey(buff, layer, GetKey()->GetUoid().GetLocation()); hsgResMgr::ResMgr()->NewKey(buff, layer, GetKey()->GetUoid().GetLocation());
layer->SetAmbientColor(hsColorRGBA().Set(0.f, 0.f, 0.f, 1.f)); layer->SetAmbientColor(hsColorRGBA().Set(0.f, 0.f, 0.f, 1.f));
@ -2190,7 +2190,7 @@ plLayer* plWaveSet7::ICreateTotalLayer(plBitmap* bm, hsGMaterial* mat, int which
plLayer* plWaveSet7::ICreateTotalEnvLayer(plBitmap* envMap, hsGMaterial* mat, int which, const char* pref) plLayer* plWaveSet7::ICreateTotalEnvLayer(plBitmap* envMap, hsGMaterial* mat, int which, const char* pref)
{ {
plLayer* layer = new plLayer; plLayer* layer = new plLayer;
plString buff = plString::Format("%s_%s_EnvLayerPS_%d", GetKey()->GetName().c_str(), pref, which); plString buff = plFormat("{}_{}_EnvLayerPS_{}", GetKey()->GetName(), pref, which);
hsgResMgr::ResMgr()->NewKey(buff, layer, GetKey()->GetUoid().GetLocation()); hsgResMgr::ResMgr()->NewKey(buff, layer, GetKey()->GetUoid().GetLocation());
layer->SetBlendFlags(which ? hsGMatState::kBlendAddSigned : 0); layer->SetBlendFlags(which ? hsGMatState::kBlendAddSigned : 0);
@ -2290,7 +2290,7 @@ void plWaveSet7::IAddShoreVertexShader(hsGMaterial* mat)
plShader* vShader = new plShader; plShader* vShader = new plShader;
plString buff = plString::Format("%s_ShoreVS", GetKey()->GetName().c_str()); plString buff = plFormat("{}_ShoreVS", GetKey()->GetName());
hsgResMgr::ResMgr()->NewKey(buff, vShader, GetKey()->GetUoid().GetLocation()); hsgResMgr::ResMgr()->NewKey(buff, vShader, GetKey()->GetUoid().GetLocation());
vShader->SetIsPixelShader(false); vShader->SetIsPixelShader(false);
@ -2343,7 +2343,7 @@ void plWaveSet7::IAddShorePixelShader(hsGMaterial* mat)
{ {
plShader* pShader = new plShader; plShader* pShader = new plShader;
plString buff = plString::Format("%s_ShorePS", GetKey()->GetName().c_str()); plString buff = plFormat("{}_ShorePS", GetKey()->GetName());
hsgResMgr::ResMgr()->NewKey(buff, pShader, GetKey()->GetUoid().GetLocation()); hsgResMgr::ResMgr()->NewKey(buff, pShader, GetKey()->GetUoid().GetLocation());
pShader->SetIsPixelShader(true); pShader->SetIsPixelShader(true);
@ -2366,7 +2366,7 @@ void plWaveSet7::IAddFixedVertexShader(hsGMaterial* mat, const int numUVWs)
plShader* vShader = new plShader; plShader* vShader = new plShader;
plString buff = plString::Format("%s_FixedVS", GetKey()->GetName().c_str()); plString buff = plFormat("{}_FixedVS", GetKey()->GetName());
hsgResMgr::ResMgr()->NewKey(buff, vShader, GetKey()->GetUoid().GetLocation()); hsgResMgr::ResMgr()->NewKey(buff, vShader, GetKey()->GetUoid().GetLocation());
vShader->SetIsPixelShader(false); vShader->SetIsPixelShader(false);
@ -2435,7 +2435,7 @@ void plWaveSet7::IAddFixedPixelShader(hsGMaterial* mat)
if( !fFixedPShader ) if( !fFixedPShader )
{ {
plShader* pShader = new plShader; plShader* pShader = new plShader;
plString buff = plString::Format("%s_FixedPS", GetKey()->GetName().c_str()); plString buff = plFormat("{}_FixedPS", GetKey()->GetName());
hsgResMgr::ResMgr()->NewKey(buff, pShader, GetKey()->GetUoid().GetLocation()); hsgResMgr::ResMgr()->NewKey(buff, pShader, GetKey()->GetUoid().GetLocation());
pShader->SetIsPixelShader(true); pShader->SetIsPixelShader(true);
@ -2463,7 +2463,7 @@ void plWaveSet7::IAddRipVertexShader(hsGMaterial* mat, const plRipVSConsts& ripC
if( !fRipVShader ) if( !fRipVShader )
{ {
plShader* vShader = new plShader; plShader* vShader = new plShader;
plString buff = plString::Format("%s_RipVS", GetKey()->GetName().c_str()); plString buff = plFormat("{}_RipVS", GetKey()->GetName());
hsgResMgr::ResMgr()->NewKey(buff, vShader, GetKey()->GetUoid().GetLocation()); hsgResMgr::ResMgr()->NewKey(buff, vShader, GetKey()->GetUoid().GetLocation());
vShader->SetIsPixelShader(false); vShader->SetIsPixelShader(false);
@ -2548,7 +2548,7 @@ void plWaveSet7::IAddRipPixelShader(hsGMaterial* mat, const plRipVSConsts& ripCo
if( !fRipPShader ) if( !fRipPShader )
{ {
plShader* pShader = new plShader; plShader* pShader = new plShader;
plString buff = plString::Format("%s_RipPS", GetKey()->GetName().c_str()); plString buff = plFormat("{}_RipPS", GetKey()->GetName());
hsgResMgr::ResMgr()->NewKey(buff, pShader, GetKey()->GetUoid().GetLocation()); hsgResMgr::ResMgr()->NewKey(buff, pShader, GetKey()->GetUoid().GetLocation());
pShader->SetIsPixelShader(true); pShader->SetIsPixelShader(true);
@ -2607,7 +2607,7 @@ plShader* plWaveSet7::ICreateDecalVShader(DecalVType t)
plShader* vShader = new plShader; plShader* vShader = new plShader;
plString buff = plString::Format("%s_%s", GetKey()->GetName().c_str(), fname[t]); plString buff = plFormat("{}_{}", GetKey()->GetName(), fname[t]);
hsgResMgr::ResMgr()->NewKey(buff, vShader, GetKey()->GetUoid().GetLocation()); hsgResMgr::ResMgr()->NewKey(buff, vShader, GetKey()->GetUoid().GetLocation());
vShader->SetIsPixelShader(false); vShader->SetIsPixelShader(false);
@ -2735,7 +2735,7 @@ plShader* plWaveSet7::ICreateDecalPShader(DecalPType t)
plShader* pShader = new plShader; plShader* pShader = new plShader;
plString buff = plString::Format("%s_%s", GetKey()->GetName().c_str(), fname[t]); plString buff = plFormat("{}_{}", GetKey()->GetName(), fname[t]);
hsgResMgr::ResMgr()->NewKey(buff, pShader, GetKey()->GetUoid().GetLocation()); hsgResMgr::ResMgr()->NewKey(buff, pShader, GetKey()->GetUoid().GetLocation());
pShader->SetIsPixelShader(true); pShader->SetIsPixelShader(true);
@ -3676,7 +3676,7 @@ plDrawableSpans* plWaveSet7::ICreateGraphDrawable(plDrawableSpans* drawable, hsG
plDrawableSpans* plWaveSet7::ICreateEmptyGraphDrawable(const char* name, uint32_t ref, int which) plDrawableSpans* plWaveSet7::ICreateEmptyGraphDrawable(const char* name, uint32_t ref, int which)
{ {
plDrawableSpans* drawable = new plDrawableSpans; plDrawableSpans* drawable = new plDrawableSpans;
plString buff = plString::Format("%s_%s_%d", GetKey()->GetName().c_str(), name, which); plString buff = plFormat("{}_{}_{}", GetKey()->GetName(), name, which);
hsgResMgr::ResMgr()->NewKey(buff, drawable, GetKey()->GetUoid().GetLocation()); hsgResMgr::ResMgr()->NewKey(buff, drawable, GetKey()->GetUoid().GetLocation());
hsgResMgr::ResMgr()->SendRef(drawable->GetKey(), new plGenRefMsg(GetKey(), plRefMsg::kOnRequest, which, (int8_t)ref), plRefFlags::kActiveRef); hsgResMgr::ResMgr()->SendRef(drawable->GetKey(), new plGenRefMsg(GetKey(), plRefMsg::kOnRequest, which, (int8_t)ref), plRefFlags::kActiveRef);
@ -3688,7 +3688,7 @@ hsGMaterial* plWaveSet7::ICreateEmptyMaterial(const char* name, uint32_t ref, in
{ {
hsGMaterial* mat = new hsGMaterial; hsGMaterial* mat = new hsGMaterial;
plString buff = plString::Format("%s_%s_%d", GetKey()->GetName().c_str(), name, which); plString buff = plFormat("{}_{}_{}", GetKey()->GetName(), name, which);
hsgResMgr::ResMgr()->NewKey(buff, mat, GetKey()->GetUoid().GetLocation()); hsgResMgr::ResMgr()->NewKey(buff, mat, GetKey()->GetUoid().GetLocation());
hsgResMgr::ResMgr()->SendRef(mat->GetKey(), new plGenRefMsg(GetKey(), plRefMsg::kOnRequest, which, (int8_t)ref), plRefFlags::kActiveRef); hsgResMgr::ResMgr()->SendRef(mat->GetKey(), new plGenRefMsg(GetKey(), plRefMsg::kOnRequest, which, (int8_t)ref), plRefFlags::kActiveRef);
@ -3699,7 +3699,7 @@ hsGMaterial* plWaveSet7::ICreateEmptyMaterial(const char* name, uint32_t ref, in
plLayer* plWaveSet7::ICreateBlankLayer(const char* name, int suff) plLayer* plWaveSet7::ICreateBlankLayer(const char* name, int suff)
{ {
plLayer* lay = new plLayer; plLayer* lay = new plLayer;
plString buff = plString::Format("%s_%s_%d", GetKey()->GetName().c_str(), name, suff); plString buff = plFormat("{}_{}_{}", GetKey()->GetName(), name, suff);
hsgResMgr::ResMgr()->NewKey(buff, lay, GetKey()->GetUoid().GetLocation()); hsgResMgr::ResMgr()->NewKey(buff, lay, GetKey()->GetUoid().GetLocation());
return lay; return lay;
@ -3714,7 +3714,7 @@ plMipmap* plWaveSet7::ICreateBlankTex(const char* name, int width, int height, u
plMipmap::kUncompressed, plMipmap::kUncompressed,
plMipmap::UncompressedInfo::kRGB8888); plMipmap::UncompressedInfo::kRGB8888);
plString buff = plString::Format("%s_%s", GetKey()->GetName().c_str(), name); plString buff = plFormat("{}_{}", GetKey()->GetName(), name);
hsgResMgr::ResMgr()->NewKey(buff, mipMap, GetKey()->GetUoid().GetLocation()); hsgResMgr::ResMgr()->NewKey(buff, mipMap, GetKey()->GetUoid().GetLocation());
hsgResMgr::ResMgr()->SendRef(mipMap->GetKey(), new plGenRefMsg(GetKey(), plRefMsg::kOnRequest, 0, (int8_t)ref), plRefFlags::kActiveRef); hsgResMgr::ResMgr()->SendRef(mipMap->GetKey(), new plGenRefMsg(GetKey(), plRefMsg::kOnRequest, 0, (int8_t)ref), plRefFlags::kActiveRef);
@ -4120,7 +4120,7 @@ void plWaveSet7::IAddGraphVShader(hsGMaterial* mat, int iPass)
if( !fGraphVShader[iPass] ) if( !fGraphVShader[iPass] )
{ {
plShader* vShader = new plShader; plShader* vShader = new plShader;
plString buff = plString::Format("%s_GraphVS_%d", GetKey()->GetName().c_str(), iPass); plString buff = plFormat("{}_GraphVS_{}", GetKey()->GetName(), iPass);
hsgResMgr::ResMgr()->NewKey(buff, vShader, GetKey()->GetUoid().GetLocation()); hsgResMgr::ResMgr()->NewKey(buff, vShader, GetKey()->GetUoid().GetLocation());
vShader->SetIsPixelShader(false); vShader->SetIsPixelShader(false);
@ -4154,7 +4154,7 @@ void plWaveSet7::IAddGraphPShader(hsGMaterial* mat, int iPass)
if( !fGraphPShader[iPass] ) if( !fGraphPShader[iPass] )
{ {
plShader* pShader = new plShader; plShader* pShader = new plShader;
plString buff = plString::Format("%s_GraphPS_%d", GetKey()->GetName().c_str(), iPass); plString buff = plFormat("{}_GraphPS_{}", GetKey()->GetName(), iPass);
hsgResMgr::ResMgr()->NewKey(buff, pShader, GetKey()->GetUoid().GetLocation()); hsgResMgr::ResMgr()->NewKey(buff, pShader, GetKey()->GetUoid().GetLocation());
pShader->SetIsPixelShader(true); pShader->SetIsPixelShader(true);
@ -4228,7 +4228,7 @@ void plWaveSet7::IMakeShoreLayer(hsGMaterial* mat, int which)
if( which >= mat->GetNumLayers() ) if( which >= mat->GetNumLayers() )
{ {
plLayer* lay = new plLayer; plLayer* lay = new plLayer;
name = plString::Format("%s_lay_%d", mat->GetKey()->GetName().c_str(), which); name = plFormat("{}_lay_{}", mat->GetKey()->GetName(), which);
hsgResMgr::ResMgr()->NewKey(name, lay, GetKey()->GetUoid().GetLocation()); hsgResMgr::ResMgr()->NewKey(name, lay, GetKey()->GetUoid().GetLocation());
lay->SetAmbientColor(hsColorRGBA().Set(0.f, 0.f, 0.f, 1.f)); lay->SetAmbientColor(hsColorRGBA().Set(0.f, 0.f, 0.f, 1.f));

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

@ -163,7 +163,7 @@ void plFontCache::ILoadCustomFonts( void )
plString keyName; plString keyName;
if (font->GetKey() == nil) if (font->GetKey() == nil)
{ {
keyName = plString::Format( "%s-%d", font->GetFace().c_str(), font->GetSize() ); keyName = plFormat("{}-{}", font->GetFace(), font->GetSize());
hsgResMgr::ResMgr()->NewKey( keyName, font, plLocation::kGlobalFixedLoc ); hsgResMgr::ResMgr()->NewKey( keyName, font, plLocation::kGlobalFixedLoc );
} }

13
Sources/Plasma/PubUtilLib/plInputCore/plSceneInputInterface.cpp

@ -837,13 +837,16 @@ void plSceneInputInterface::ILinkOffereeToAge()
plString title, desc; plString title, desc;
unsigned nameLen = plNetClientMgr::GetInstance()->GetPlayerName().GetSize(); unsigned nameLen = plNetClientMgr::GetInstance()->GetPlayerName().GetSize();
if (plNetClientMgr::GetInstance()->GetPlayerName().CharAt(nameLen - 1) == 's' || plNetClientMgr::GetInstance()->GetPlayerName().CharAt(nameLen - 1) == 'S') { if (plNetClientMgr::GetInstance()->GetPlayerName().CharAt(nameLen - 1) == 's'
title = plString::Format( "%s'", plNetClientMgr::GetInstance()->GetPlayerName().c_str() ); || plNetClientMgr::GetInstance()->GetPlayerName().CharAt(nameLen - 1) == 'S') {
desc = plString::Format( "%s' %s", plNetClientMgr::GetInstance()->GetPlayerName().c_str(), link.GetAgeInfo()->GetAgeInstanceName().c_str() ); title = plFormat("{}'", plNetClientMgr::GetInstance()->GetPlayerName());
desc = plFormat("{}' {}", plNetClientMgr::GetInstance()->GetPlayerName(),
link.GetAgeInfo()->GetAgeInstanceName());
} }
else { else {
title = plString::Format( "%s's", plNetClientMgr::GetInstance()->GetPlayerName().c_str() ); title = plFormat("{}'s", plNetClientMgr::GetInstance()->GetPlayerName());
desc = plString::Format( "%s's %s", plNetClientMgr::GetInstance()->GetPlayerName().c_str(), link.GetAgeInfo()->GetAgeInstanceName().c_str() ); desc = plFormat("{}'s {}", plNetClientMgr::GetInstance()->GetPlayerName(),
link.GetAgeInfo()->GetAgeInstanceName());
} }
info.SetAgeUserDefinedName( title.c_str() ); info.SetAgeUserDefinedName( title.c_str() );

8
Sources/Plasma/PubUtilLib/plModifier/plSDLModifier.cpp

@ -178,8 +178,8 @@ void plSDLModifier::SendState(uint32_t sendFlags)
{ {
gMooseDump=true; gMooseDump=true;
plNetObjectDebugger::GetInstance()->SetDebugging(true); plNetObjectDebugger::GetInstance()->SetDebugging(true);
curState->DumpToObjectDebugger(plString::Format("Object %s SENDS SDL state", curState->DumpToObjectDebugger(plFormat("Object {} SENDS SDL state",
GetStateOwnerKey()->GetName().c_str(), dirtyOnly).c_str()); GetStateOwnerKey()->GetName()).c_str(), dirtyOnly);
gMooseDump=false; gMooseDump=false;
} }
@ -203,8 +203,8 @@ void plSDLModifier::ReceiveState(const plStateDataRecord* srcState)
{ {
gMooseDump=true; gMooseDump=true;
plNetObjectDebugger::GetInstance()->SetDebugging(true); plNetObjectDebugger::GetInstance()->SetDebugging(true);
srcState->DumpToObjectDebugger(plString::Format("Object %s RECVS SDL state", srcState->DumpToObjectDebugger(plFormat("Object {} RECVS SDL state",
GetStateOwnerKey()->GetName().c_str()).c_str()); GetStateOwnerKey()->GetName()).c_str());
gMooseDump=false; gMooseDump=false;
} }

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

@ -261,7 +261,7 @@ void plNCAgeJoiner::ExecNextOp () {
// Start progress bar // Start progress bar
plString str; plString str;
#ifndef PLASMA_EXTERNAL_RELEASE #ifndef PLASMA_EXTERNAL_RELEASE
str = plString::Format("Loading age... %s", age.ageDatasetName); str = plFormat("Loading age... {}", age.ageDatasetName);
#endif #endif
progressBar = plProgressMgr::GetInstance()->RegisterOperation(0, str.c_str(), plProgressMgr::kNone, false, true); progressBar = plProgressMgr::GetInstance()->RegisterOperation(0, str.c_str(), plProgressMgr::kNone, false, true);
plDispatch::SetMsgRecieveCallback(IDispatchMsgReceiveCallback); plDispatch::SetMsgRecieveCallback(IDispatchMsgReceiveCallback);

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

@ -279,7 +279,7 @@ bool plNetClientMgr::Log(const char* str) const
return true; return true;
// prepend raw time // prepend raw time
plString buf2 = plString::Format("%.2f %s", hsTimer::GetSeconds(), ProcessTab(str)); plString buf2 = plFormat("{.2f} {}", hsTimer::GetSeconds(), ProcessTab(str));
if ( GetConsoleOutput() ) if ( GetConsoleOutput() )
hsStatusMessage(buf2.c_str()); hsStatusMessage(buf2.c_str());

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

@ -393,10 +393,10 @@ int plNetClientMgr::ISendGameMessage(plMessage* msg)
{ {
#if 0 #if 0
hsLogEntry(plNetObjectDebugger::GetInstance()->LogMsg( hsLogEntry(plNetObjectDebugger::GetInstance()->LogMsg(
plString::Format("<SND> object:%s, rcvr %s %s", plFormat("<SND> object:{}, rcvr {} {}",
msg->GetSender().GetKeyName().c_str(), msg->GetSender().GetKeyName(),
msg->GetNumReceivers() ? msg->GetReceiver(0)->GetName().c_str() : "?", msg->GetNumReceivers() ? msg->GetReceiver(0)->GetName() : "?",
netMsgWrap->AsStdString().c_str()).c_str())); netMsgWrap->AsStdString()).c_str()));
#endif #endif
} }
@ -434,7 +434,7 @@ int plNetClientMgr::SendMsg(plNetMessage* msg)
if (plNetMsgGameMessage::ConvertNoRef(msg)) if (plNetMsgGameMessage::ConvertNoRef(msg))
SetFlagsBit(kSendingActions); SetFlagsBit(kSendingActions);
plCheckNetMgrResult_ValReturn(ret, plString::Format("Failed to send %s, NC ret=%d", plCheckNetMgrResult_ValReturn(ret, plFormat("Failed to send {}, NC ret={}",
msg->ClassName(), ret).c_str()); msg->ClassName(), ret).c_str());
return ret; return ret;

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

@ -252,10 +252,10 @@ MSG_HANDLER_DEFN(plNetClientMsgHandler,plNetMsgSDLState)
{ {
plString err; plString err;
if (!sdRec) if (!sdRec)
err = plString::Format( "SDL descriptor %s missing, v=%d", descName.c_str(), ver); err = plFormat("SDL descriptor {} missing, v={}", descName, ver);
else else
err = plString::Format( "SDL descriptor %s, version mismatch, server v=%d, client v=%d", err = plFormat("SDL descriptor {}, version mismatch, server v={}, client v={}",
descName.c_str(), ver, sdRec->GetDescriptor()->GetVersion()); descName, ver, sdRec->GetDescriptor()->GetVersion());
hsAssert(false, err.c_str()); hsAssert(false, err.c_str());
nc->ErrorMsg(err.c_str()); nc->ErrorMsg(err.c_str());

5
Sources/Plasma/PubUtilLib/plNetCommon/plSpawnPointInfo.cpp

@ -122,8 +122,5 @@ void plSpawnPointInfo::Reset()
plString plSpawnPointInfo::AsString() const plString plSpawnPointInfo::AsString() const
{ {
return plString::Format( "t:%s,n:%s,c:%s", return plFormat("t:{},n:{},c:{}", fTitle, fSpawnPt, fCameraStack);
fTitle.c_str("(nil)"),
fSpawnPt.c_str("(nil)"),
fCameraStack.c_str("(nil)") );
} }

6
Sources/Plasma/PubUtilLib/plNetMessage/plNetMessage.cpp

@ -226,7 +226,7 @@ int plNetMessage::PeekBuffer(const char* bufIn, int bufLen, uint32_t peekOptions
readStream.LogSetList(el); readStream.LogSetList(el);
readStream.Init(bufLen, bufIn); readStream.Init(bufLen, bufIn);
readStream.LogSubStreamStart("plNetMessage"); readStream.LogSubStreamStart("plNetMessage");
readStream.LogStringString(plString::Format("ClassName: %s", this->ClassName()).c_str()); readStream.LogStringString(plFormat("ClassName: {}", this->ClassName()).c_str());
int ret; int ret;
if (peekOptions & kBaseClassOnly) if (peekOptions & kBaseClassOnly)
{ {
@ -704,8 +704,8 @@ plString plNetMsgSDLState::AsString() const
{ {
ISetDescName(); // set desc name for debug if necessary ISetDescName(); // set desc name for debug if necessary
return plString::Format("object:%s, initial:%d, %s", return plFormat("object:{}, initial:{}, {}",
ObjectInfo()->GetObjectName().c_str(), fIsInitialState, plNetMsgStreamedObject::AsString().c_str() ); ObjectInfo()->GetObjectName(), fIsInitialState, plNetMsgStreamedObject::AsString());
} }
// //

16
Sources/Plasma/PubUtilLib/plPhysX/plPXPhysicalControllerCore.cpp

@ -857,8 +857,8 @@ void plPXPhysicalControllerCore::IDrawDebugDisplay(int controllerIdx)
if (controllerIdx == 0) if (controllerIdx == 0)
{ {
y = 10; y = 10;
debugString = plString::Format("Controller Count: %d", gControllers.size()); debugString = plFormat("Controller Count: {}", gControllers.size());
debugTxt.DrawString(x, y, debugString.c_str()); debugTxt.DrawString(x, y, debugString);
y += lineHeight; y += lineHeight;
} }
@ -866,9 +866,9 @@ void plPXPhysicalControllerCore::IDrawDebugDisplay(int controllerIdx)
int collisionCount = fDbgCollisionInfo.GetCount(); int collisionCount = fDbgCollisionInfo.GetCount();
if (collisionCount > 0) if (collisionCount > 0)
{ {
debugString = plString::Format("Controller #%d (%s) Collisions:", debugString = plFormat("Controller #{} ({}) Collisions:",
controllerIdx + 1, gControllers[controllerIdx]->fOwner->GetName().c_str()); controllerIdx + 1, gControllers[controllerIdx]->fOwner->GetName());
debugTxt.DrawString(x, y, debugString.c_str()); debugTxt.DrawString(x, y, debugString);
y += lineHeight; y += lineHeight;
for (int i = 0; i < collisionCount; i++) for (int i = 0; i < collisionCount; i++)
@ -876,11 +876,11 @@ void plPXPhysicalControllerCore::IDrawDebugDisplay(int controllerIdx)
hsVector3 normal = fDbgCollisionInfo[i].fNormal; hsVector3 normal = fDbgCollisionInfo[i].fNormal;
const char* overlapStr = fDbgCollisionInfo[i].fOverlap ? "yes" : "no"; const char* overlapStr = fDbgCollisionInfo[i].fOverlap ? "yes" : "no";
float angle = hsRadiansToDegrees(acos(normal * hsVector3(0, 0, 1))); float angle = hsRadiansToDegrees(acos(normal * hsVector3(0, 0, 1)));
debugString = plString::Format("\tObj: %s, Normal: (%.2f, %.2f, %.2f), Angle(%.1f), Overlap(%s)", debugString = plFormat("\tObj: {}, Normal: ({.2f}, {.2f}, {.2f}), Angle({.1f}), Overlap({})",
fDbgCollisionInfo[i].fSO->GetKeyName().c_str(), fDbgCollisionInfo[i].fSO->GetKeyName(),
normal.fX, normal.fY, normal.fZ, angle, normal.fX, normal.fY, normal.fZ, angle,
overlapStr); overlapStr);
debugTxt.DrawString(x, y, debugString.c_str()); debugTxt.DrawString(x, y, debugString);
y += lineHeight; y += lineHeight;
} }
} }

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

@ -215,29 +215,30 @@ void plPhysicalSDLModifier::ILogState(const plStateDataRecord* state, bool useDi
plPhysical* phys = IGetPhysical(); plPhysical* phys = IGetPhysical();
plString log = plString::Format("%s: %s", phys->GetKeyName().c_str(), prefix); plStringStream log;
log << phys->GetKeyName() << ": " << prefix;
if (isPosSet) if (isPosSet)
log += plString::Format(" Pos=%.1f %.1f %.1f", pos.fX, pos.fY, pos.fZ); log << plFormat(" Pos={.1f} {.1f} {.1f}", pos.fX, pos.fY, pos.fZ);
else else
log += " Pos=None"; log << " Pos=None";
if (isLinVSet) if (isLinVSet)
log += plString::Format(" LinV=%.1f %.1f %.1f", linV.fX, linV.fY, linV.fZ); log << plFormat(" LinV={.1f} {.1f} {.1f}", linV.fX, linV.fY, linV.fZ);
else else
log += " LinV=None"; log << " LinV=None";
if (isAngVSet) if (isAngVSet)
log += plString::Format(" AngV=%.1f %.1f %.1f", angV.fX, angV.fY, angV.fZ); log << plFormat(" AngV={.1f} {.1f} {.1f}", angV.fX, angV.fY, angV.fZ);
else else
log += " 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 << plFormat(" Rot={.1f} {.1f} {.1f} {.1f}", rot.fX, rot.fY, rot.fZ, rot.fW);
else else
log += " Rot=None"; log << " Rot=None";
IGetLog()->AddLine(log.c_str(), color); IGetLog()->AddLine(log.GetString().c_str(), color);
} }
plStatusLog* plPhysicalSDLModifier::IGetLog() plStatusLog* plPhysicalSDLModifier::IGetLog()

11
Sources/Plasma/PubUtilLib/plPipeline/DX/plDXEnumerate.cpp

@ -43,6 +43,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
#include "plDXEnumerate.h" #include "plDXEnumerate.h"
#include "plPipeline/hsG3DDeviceSelector.h" #include "plPipeline/hsG3DDeviceSelector.h"
#include "hsGDirect3D.h" #include "hsGDirect3D.h"
#include "plFormat.h"
//// Local Typedefs /////////////////////////////////////////////////////////// //// Local Typedefs ///////////////////////////////////////////////////////////
@ -84,12 +85,12 @@ HRESULT hsGDirect3DTnLEnumerate::SelectFromDevMode(const hsG3DDeviceRecord* devR
} }
} }
} }
plString errStr = plString::Format("Can't find requested device - %s:%s:%s:%s:%s", plString errStr = plFormat("Can't find requested device - {}:{}:{}:{}:{}",
devRec->GetG3DDeviceTypeName(), devRec->GetG3DDeviceTypeName(),
devRec->GetDriverDesc().c_str(), devRec->GetDriverDesc(),
devRec->GetDriverName().c_str(), devRec->GetDriverName(),
devRec->GetDriverVersion().c_str(), devRec->GetDriverVersion(),
devRec->GetDeviceDesc().c_str()); devRec->GetDeviceDesc());
DWORD enumFlags = 0; DWORD enumFlags = 0;
int width = devMode->GetWidth(); int width = devMode->GetWidth();

4
Sources/Plasma/PubUtilLib/plPipeline/plCaptureRender.cpp

@ -141,7 +141,7 @@ bool plCaptureRender::Capture(const plKey& ack, uint16_t width, uint16_t height)
plRenderTarget* rt = new plRenderTarget(flags, width, height, bitDepth, zDepth, stencilDepth); plRenderTarget* rt = new plRenderTarget(flags, width, height, bitDepth, zDepth, stencilDepth);
static int idx=0; static int idx=0;
plString buff = plString::Format("tRT%d", idx++); plString buff = plFormat("tRT{}", idx++);
hsgResMgr::ResMgr()->NewKey(buff, rt, ack->GetUoid().GetLocation()); hsgResMgr::ResMgr()->NewKey(buff, rt, ack->GetUoid().GetLocation());
@ -183,7 +183,7 @@ bool plCaptureRender::IProcess(plPipeline* pipe, const plKey& ack, plRenderTarge
static int currentCapIndex = 0; static int currentCapIndex = 0;
// Mipmap isn't created with a key so let's give it one now // Mipmap isn't created with a key so let's give it one now
plString buff = plString::Format("CaptureRender_%d", currentCapIndex++); plString buff = plFormat("CaptureRender_{}", currentCapIndex++);
hsgResMgr::ResMgr()->NewKey(buff, mipMap, plLocation::kGlobalFixedLoc); hsgResMgr::ResMgr()->NewKey(buff, mipMap, plLocation::kGlobalFixedLoc);
mipMap->Ref(); mipMap->Ref();

8
Sources/Plasma/PubUtilLib/plPipeline/plPlates.cpp

@ -160,7 +160,7 @@ void plPlate::SetTexture(plBitmap *texture)
plString keyName; plString keyName;
material = new hsGMaterial(); material = new hsGMaterial();
keyName = plString::Format( "PlateBlank#%d", fMagicUniqueKeyInt++ ); keyName = plFormat("PlateBlank#{}", fMagicUniqueKeyInt++);
hsgResMgr::ResMgr()->NewKey( keyName, material, plLocation::kGlobalFixedLoc ); hsgResMgr::ResMgr()->NewKey( keyName, material, plLocation::kGlobalFixedLoc );
layer = material->MakeBaseLayer(); layer = material->MakeBaseLayer();
layer->SetShadeFlags( layer->GetShadeFlags() | hsGMatState::kShadeNoShade | hsGMatState::kShadeWhite | hsGMatState::kShadeReallyNoFog ); layer->SetShadeFlags( layer->GetShadeFlags() | hsGMatState::kShadeNoShade | hsGMatState::kShadeWhite | hsGMatState::kShadeReallyNoFog );
@ -207,14 +207,14 @@ plMipmap *plPlate::CreateMaterial( uint32_t width, uint32_t height, bool with
/// Create a new bitmap /// Create a new bitmap
fMipmap = new plMipmap( width, height, withAlpha ? plMipmap::kARGB32Config : plMipmap::kRGB32Config, 1 ); fMipmap = new plMipmap( width, height, withAlpha ? plMipmap::kARGB32Config : plMipmap::kRGB32Config, 1 );
memset( fMipmap->GetImage(), 0xff, height * fMipmap->GetRowBytes() ); memset( fMipmap->GetImage(), 0xff, height * fMipmap->GetRowBytes() );
keyName = plString::Format( "PlateBitmap#%d", fMagicUniqueKeyInt++ ); keyName = plFormat("PlateBitmap#{}", fMagicUniqueKeyInt++);
hsgResMgr::ResMgr()->NewKey( keyName, fMipmap, plLocation::kGlobalFixedLoc ); hsgResMgr::ResMgr()->NewKey( keyName, fMipmap, plLocation::kGlobalFixedLoc );
fMipmap->SetFlags( fMipmap->GetFlags() | plMipmap::kDontThrowAwayImage ); fMipmap->SetFlags( fMipmap->GetFlags() | plMipmap::kDontThrowAwayImage );
} }
/// NOW create a layer wrapper and a material for that layer /// NOW create a layer wrapper and a material for that layer
material = new hsGMaterial(); material = new hsGMaterial();
keyName = plString::Format( "PlateBlank#%d", fMagicUniqueKeyInt++ ); keyName = plFormat("PlateBlank#{}", fMagicUniqueKeyInt++);
hsgResMgr::ResMgr()->NewKey( keyName, material, plLocation::kGlobalFixedLoc ); hsgResMgr::ResMgr()->NewKey( keyName, material, plLocation::kGlobalFixedLoc );
layer = material->MakeBaseLayer(); layer = material->MakeBaseLayer();
layer->SetShadeFlags( layer->GetShadeFlags() | hsGMatState::kShadeNoShade | hsGMatState::kShadeWhite | hsGMatState::kShadeReallyNoFog ); layer->SetShadeFlags( layer->GetShadeFlags() | hsGMatState::kShadeNoShade | hsGMatState::kShadeWhite | hsGMatState::kShadeReallyNoFog );
@ -245,7 +245,7 @@ void plPlate::CreateFromResource(const plString& resName)
plMipmap* resTexture = new plMipmap; plMipmap* resTexture = new plMipmap;
resTexture->CopyFrom(plClientResMgr::Instance().getResource(resName)); resTexture->CopyFrom(plClientResMgr::Instance().getResource(resName));
plString keyName = plString::Format( "PlateResource#%d", fMagicUniqueKeyInt++ ); plString keyName = plFormat("PlateResource#{}", fMagicUniqueKeyInt++);
hsgResMgr::ResMgr()->NewKey(keyName, resTexture, plLocation::kGlobalFixedLoc); hsgResMgr::ResMgr()->NewKey(keyName, resTexture, plLocation::kGlobalFixedLoc);
CreateMaterial(resTexture->GetWidth(), resTexture->GetHeight(), true, resTexture); CreateMaterial(resTexture->GetWidth(), resTexture->GetHeight(), true, resTexture);
} }

3
Sources/Plasma/PubUtilLib/plProgressMgr/plProgressMgr.cpp

@ -62,7 +62,6 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
plProgressMgr* plProgressMgr::fManager = nullptr; plProgressMgr* plProgressMgr::fManager = nullptr;
#define LOADING_RES "xLoading_Linking.%02d.png"
#define LOADING_RES_COUNT 18 #define LOADING_RES_COUNT 18
plString plProgressMgr::fImageRotation[LOADING_RES_COUNT]; plString plProgressMgr::fImageRotation[LOADING_RES_COUNT];
@ -83,7 +82,7 @@ plProgressMgr::plProgressMgr()
// Fill array with pre-computed loading frame IDs // Fill array with pre-computed loading frame IDs
for (int i=0; i < LOADING_RES_COUNT; i++) for (int i=0; i < LOADING_RES_COUNT; i++)
fImageRotation[i] = plString::Format(LOADING_RES, i); fImageRotation[i] = plFormat("xLoading_Linking.{_02}.png", i);
} }
plProgressMgr::~plProgressMgr() plProgressMgr::~plProgressMgr()

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

@ -368,7 +368,7 @@ class plPageFinder : public plRegistryPageIterator
} }
// Try for full location // Try for full location
if (plString::Format("%s_%s", info.GetAge().c_str(), info.GetPage().c_str()).CompareI(fFindString) == 0) if (plFormat("{}_{}", info.GetAge(), info.GetPage()).CompareI(fFindString) == 0)
{ {
*fPagePtr = node; *fPagePtr = node;
return false; return false;

10
Sources/Plasma/PubUtilLib/plResMgr/plRegistryNode.cpp

@ -78,8 +78,8 @@ plRegistryPageNode::plRegistryPageNode(const plLocation& location, const plStrin
// Time to construct our actual file name. For now, we'll use the same old format // Time to construct our actual file name. For now, we'll use the same old format
// of age_page.extension // of age_page.extension
fPath = plFileName::Join(dataPath, plString::Format("%s_District_%s.prp", fPath = plFileName::Join(dataPath, plFormat("{}_District_{}.prp",
fPageInfo.GetAge().c_str(), fPageInfo.GetPage().c_str())); fPageInfo.GetAge(), fPageInfo.GetPage()));
} }
plRegistryPageNode::~plRegistryPageNode() plRegistryPageNode::~plRegistryPageNode()
@ -152,8 +152,8 @@ void plRegistryPageNode::LoadKeys()
hsStream* stream = OpenStream(); hsStream* stream = OpenStream();
if (!stream) if (!stream)
{ {
hsAssert(0, plString::Format("plRegistryPageNode::LoadKeysFromSource - bad stream %s,%s", hsAssert(0, plFormat("plRegistryPageNode::LoadKeysFromSource - bad stream {},{}",
GetPageInfo().GetAge().c_str(), GetPageInfo().GetPage().c_str()).c_str()); GetPageInfo().GetAge(), GetPageInfo().GetPage()).c_str());
return; return;
} }
@ -331,7 +331,7 @@ void plRegistryPageNode::AddKey(plKeyImp* key)
// Attempt recovery // Attempt recovery
for (int i = 0; i < 500; i++) for (int i = 0; i < 500; i++)
{ {
plString tempName = plString::Format("%s%d", key->GetUoid().GetObjectName().c_str(), i); plString tempName = plFormat("{}{}", key->GetUoid().GetObjectName(), i);
if (keys->FindKey(tempName) == nil) if (keys->FindKey(tempName) == nil)
{ {
plUoid uoid(key->GetUoid().GetLocation(), key->GetUoid().GetClassType(), tempName, key->GetUoid().GetLoadMask()); plUoid uoid(key->GetUoid().GetLocation(), key->GetUoid().GetClassType(), tempName, key->GetUoid().GetLoadMask());

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

@ -1162,8 +1162,8 @@ void plResManager::PageInRoom(const plLocation& page, uint16_t objClassToRef, pl
kResMgrLog(1, ILog(1, "...IGNORING pageIn request; verification failed! (%s)", condStr.c_str())); kResMgrLog(1, ILog(1, "...IGNORING pageIn request; verification failed! (%s)", condStr.c_str()));
plString msg = plString::Format("Data Problem: Age:%s Page:%s Error:%s", plString msg = plFormat("Data Problem: Age:{} Page:{} Error:{}",
pageNode->GetPageInfo().GetAge().c_str(), pageNode->GetPageInfo().GetPage().c_str(), condStr.c_str()); pageNode->GetPageInfo().GetAge(), pageNode->GetPageInfo().GetPage(), condStr);
hsMessageBox(msg.c_str(), "Error", hsMessageBoxNormal, hsMessageBoxIconError); hsMessageBox(msg.c_str(), "Error", hsMessageBoxNormal, hsMessageBoxIconError);
hsRefCnt_SafeUnRef(refMsg); hsRefCnt_SafeUnRef(refMsg);

56
Sources/Plasma/PubUtilLib/plSDL/plSDLParser.cpp

@ -108,8 +108,7 @@ bool plSDLParser::IParseStateDesc(const plFileName& fileName, hsStream* stream,
if (!strcmp(token, "VERSION")) if (!strcmp(token, "VERSION"))
{ {
// read desc version // read desc version
hsAssert(curDesc, plString::Format("Syntax problem with .sdl file, fileName=%s", hsAssert(curDesc, plFormat("Syntax problem with .sdl file, fileName={}", fileName).c_str());
fileName.AsString().c_str()).c_str());
if (stream->GetToken(token, kTokenLen)) if (stream->GetToken(token, kTokenLen))
{ {
int v=atoi(token); int v=atoi(token);
@ -119,15 +118,13 @@ bool plSDLParser::IParseStateDesc(const plFileName& fileName, hsStream* stream,
} }
else else
{ {
hsAssert(false, plString::Format("Error parsing state desc, missing VERSION, fileName=%s", hsAssert(false, plFormat("Error parsing state desc, missing VERSION, fileName={}", fileName).c_str());
fileName.AsString().c_str()).c_str());
ok = false; ok = false;
} }
} }
else else
{ {
hsAssert(false, plString::Format("Error parsing state desc, fileName=%s", hsAssert(false, plFormat("Error parsing state desc, fileName={}", fileName).c_str());
fileName.AsString().c_str()).c_str());
ok = false; ok = false;
} }
@ -136,8 +133,8 @@ bool plSDLParser::IParseStateDesc(const plFileName& fileName, hsStream* stream,
ok = ( plSDLMgr::GetInstance()->FindDescriptor(curDesc->GetName(), curDesc->GetVersion())==nil ); ok = ( plSDLMgr::GetInstance()->FindDescriptor(curDesc->GetName(), curDesc->GetVersion())==nil );
if ( !ok ) if ( !ok )
{ {
plString err = plString::Format("Found duplicate SDL descriptor for %s version %d.\nFailed to parse file: %s", plString err = plFormat("Found duplicate SDL descriptor for {} version {}.\nFailed to parse file: {}",
curDesc->GetName().c_str(), curDesc->GetVersion(), fileName.AsString().c_str()); curDesc->GetName(), curDesc->GetVersion(), fileName);
plNetApp::StaticErrorMsg( err.c_str() ); plNetApp::StaticErrorMsg( err.c_str() );
hsAssert( false, err.c_str() ); hsAssert( false, err.c_str() );
} }
@ -164,8 +161,7 @@ bool plSDLParser::IParseStateDesc(const plFileName& fileName, hsStream* stream,
bool plSDLParser::IParseVarDesc(const plFileName& fileName, hsStream* stream, char token[], bool plSDLParser::IParseVarDesc(const plFileName& fileName, hsStream* stream, char token[],
plStateDescriptor*& curDesc, plVarDescriptor*& curVar) const plStateDescriptor*& curDesc, plVarDescriptor*& curVar) const
{ {
hsAssert(curDesc, plString::Format("Syntax problem with .sdl file, fileName=%s", hsAssert(curDesc, plFormat("Syntax problem with .sdl file, fileName={}", fileName).c_str());
fileName.AsString().c_str()).c_str());
if ( !curDesc ) if ( !curDesc )
return false; return false;
@ -183,8 +179,8 @@ bool plSDLParser::IParseVarDesc(const plFileName& fileName, hsStream* stream, ch
// nested sdls // nested sdls
char* sdlName = token+1; char* sdlName = token+1;
plStateDescriptor* stateDesc = plSDLMgr::GetInstance()->FindDescriptor(sdlName, plSDL::kLatestVersion); plStateDescriptor* stateDesc = plSDLMgr::GetInstance()->FindDescriptor(sdlName, plSDL::kLatestVersion);
hsAssert(stateDesc, plString::Format("can't find nested state desc reference %s, fileName=%s", hsAssert(stateDesc, plFormat("can't find nested state desc reference {}, fileName={}",
sdlName, fileName.AsString().c_str()).c_str()); sdlName, fileName).c_str());
curVar = new plSDVarDescriptor(stateDesc); curVar = new plSDVarDescriptor(stateDesc);
} }
else else
@ -192,21 +188,20 @@ bool plSDLParser::IParseVarDesc(const plFileName& fileName, hsStream* stream, ch
curDesc->AddVar(curVar); curDesc->AddVar(curVar);
bool ok=curVar->SetType(token); bool ok=curVar->SetType(token);
hsAssert(ok, plString::Format("Variable 'type' syntax problem with .sdl file, type=%s, fileName=%s", hsAssert(ok, plFormat("Variable 'type' syntax problem with .sdl file, type={}, fileName={}",
token, fileName.AsString().c_str()).c_str()); token, fileName).c_str());
dbgStr = plString::Format("\tVAR Type=%s ", token); dbgStr = plFormat("\tVAR Type={} ", token);
// //
// NAME (foo[1]) // NAME (foo[1])
// //
if (stream->GetToken(token, kTokenLen)) if (stream->GetToken(token, kTokenLen))
{ {
hsAssert(strstr(token, "[") && strstr(token, "]"), plString::Format("invalid var syntax, missing [x], fileName=%s", hsAssert(strstr(token, "[") != nullptr && strstr(token, "]") != nullptr,
fileName.AsString().c_str()).c_str()); plFormat("invalid var syntax, missing [x], fileName={}", fileName).c_str());
char* ptr = strtok( token, seps ); // skip [ char* ptr = strtok( token, seps ); // skip [
hsAssert(curVar, plString::Format("Missing current var. Syntax problem with .sdl file, fileName=%s", hsAssert(curVar, plFormat("Missing current var. Syntax problem with .sdl file, fileName={}", fileName).c_str());
fileName.AsString().c_str()).c_str());
curVar->SetName(token); curVar->SetName(token);
// //
// COUNT // COUNT
@ -216,7 +211,7 @@ bool plSDLParser::IParseVarDesc(const plFileName& fileName, hsStream* stream, ch
curVar->SetCount(cnt); curVar->SetCount(cnt);
if (cnt==0) if (cnt==0)
curVar->SetVariableLength(true); curVar->SetVariableLength(true);
dbgStr += plString::Format("Name=%s[%d]", curVar->GetName().c_str(), cnt); dbgStr += plFormat("Name={}[{}]", curVar->GetName(), cnt);
} }
// //
@ -226,8 +221,7 @@ bool plSDLParser::IParseVarDesc(const plFileName& fileName, hsStream* stream, ch
{ {
if (!strcmp(token, "DEFAULT")) if (!strcmp(token, "DEFAULT"))
{ {
hsAssert(curVar, plString::Format("Syntax problem with .sdl file, fileName=%s", hsAssert(curVar, plFormat("Syntax problem with .sdl file, fileName={}", fileName).c_str());
fileName.AsString().c_str()).c_str());
// read state var type // read state var type
plString defaultStr; plString defaultStr;
@ -254,8 +248,7 @@ bool plSDLParser::IParseVarDesc(const plFileName& fileName, hsStream* stream, ch
else else
if (!strcmp(token, "DISPLAYOPTION")) if (!strcmp(token, "DISPLAYOPTION"))
{ {
hsAssert(curVar, plString::Format("Syntax problem with .sdl file, fileName=%s", hsAssert(curVar, plFormat("Syntax problem with .sdl file, fileName={}", fileName).c_str());
fileName.AsString().c_str()).c_str());
dbgStr += plString(" ") + token; dbgStr += plString(" ") + token;
bool read=stream->GetToken(token, kTokenLen); bool read=stream->GetToken(token, kTokenLen);
@ -272,15 +265,13 @@ bool plSDLParser::IParseVarDesc(const plFileName& fileName, hsStream* stream, ch
} }
else else
{ {
hsAssert(false, plString::Format("missing displayOption string, fileName=%s", hsAssert(false, plFormat("missing displayOption string, fileName={}", fileName).c_str());
fileName.AsString().c_str()).c_str());
} }
} }
else else
if (!strcmp(token, "DEFAULTOPTION")) if (!strcmp(token, "DEFAULTOPTION"))
{ {
hsAssert(curVar, plString::Format("Syntax problem with .sdl file, fileName=%s", hsAssert(curVar, plFormat("Syntax problem with .sdl file, fileName={}", fileName).c_str());
fileName.AsString().c_str()).c_str());
dbgStr += plString(" ") + token; dbgStr += plString(" ") + token;
bool read=stream->GetToken(token, kTokenLen); bool read=stream->GetToken(token, kTokenLen);
@ -292,8 +283,7 @@ bool plSDLParser::IParseVarDesc(const plFileName& fileName, hsStream* stream, ch
} }
else else
{ {
hsAssert(false, plString::Format("missing defaultOption string, fileName=%s", hsAssert(false, plFormat("missing defaultOption string, fileName={}", fileName).c_str());
fileName.AsString().c_str()).c_str());
} }
} }
@ -301,16 +291,14 @@ bool plSDLParser::IParseVarDesc(const plFileName& fileName, hsStream* stream, ch
else else
if (!strcmp(token, "INTERNAL")) if (!strcmp(token, "INTERNAL"))
{ {
hsAssert(curVar, plString::Format("Syntax problem with .sdl file, fileName=%s", hsAssert(curVar, plFormat("Syntax problem with .sdl file, fileName={}", fileName).c_str());
fileName.AsString().c_str()).c_str());
curVar->SetInternal(true); curVar->SetInternal(true);
dbgStr += plString(" ") + token; dbgStr += plString(" ") + token;
} }
else else
if (!strcmp(token, "PHASED")) if (!strcmp(token, "PHASED"))
{ {
hsAssert(curVar, plString::Format("Syntax problem with .sdl file, fileName=%s", hsAssert(curVar, plFormat("Syntax problem with .sdl file, fileName={}", fileName).c_str());
fileName.AsString().c_str()).c_str());
curVar->SetAlwaysNew(true); curVar->SetAlwaysNew(true);
dbgStr += plString(" ") + token; dbgStr += plString(" ") + token;
} }

64
Sources/Plasma/PubUtilLib/plSDL/plStateDataRecord.cpp

@ -277,8 +277,8 @@ bool plStateDataRecord::Read(hsStream* s, float timeConvert, uint32_t readOption
catch(...) catch(...)
{ {
hsAssert( false, hsAssert( false,
plString::Format("Something bad happened while reading simple var data, desc:%s", plFormat("Something bad happened while reading simple var data, desc:{}",
fDescriptor ? fDescriptor->GetName().c_str("?") : "?").c_str()); fDescriptor ? fDescriptor->GetName() : "?").c_str());
return false; return false;
} }
@ -311,15 +311,15 @@ bool plStateDataRecord::Read(hsStream* s, float timeConvert, uint32_t readOption
catch(...) catch(...)
{ {
hsAssert( false, hsAssert( false,
plString::Format("Something bad happened while reading nested var data, desc:%s", plFormat("Something bad happened while reading nested var data, desc:{}",
fDescriptor ? fDescriptor->GetName().c_str("?") : "?").c_str()); fDescriptor ? fDescriptor->GetName() : "?").c_str());
return false; return false;
} }
// convert to latest descriptor // convert to latest descriptor
// Only really need to do this the first time this descriptor is read... // Only really need to do this the first time this descriptor is read...
plStateDescriptor* latestDesc=plSDLMgr::GetInstance()->FindDescriptor(fDescriptor->GetName(), plSDL::kLatestVersion); plStateDescriptor* latestDesc=plSDLMgr::GetInstance()->FindDescriptor(fDescriptor->GetName(), plSDL::kLatestVersion);
hsAssert( latestDesc, plString::Format("Failed to find latest sdl descriptor for: %s", fDescriptor->GetName().c_str() ).c_str() ); hsAssert(latestDesc, plFormat("Failed to find latest sdl descriptor for: {}", fDescriptor->GetName()).c_str());
bool forceConvert = (readOptions&plSDL::kForceConvert)!=0; bool forceConvert = (readOptions&plSDL::kForceConvert)!=0;
if ( latestDesc && ( forceConvert || ( fDescriptor->GetVersion()!=latestDesc->GetVersion() ) ) ) if ( latestDesc && ( forceConvert || ( fDescriptor->GetVersion()!=latestDesc->GetVersion() ) ) )
{ {
@ -493,14 +493,14 @@ void plStateDataRecord::UpdateFrom(const plStateDataRecord& other, uint32_t writ
if ( GetDescriptor()->GetVersion()!=other.GetDescriptor()->GetVersion() ) if ( GetDescriptor()->GetVersion()!=other.GetDescriptor()->GetVersion() )
{ {
plStateDescriptor* sd=plSDLMgr::GetInstance()->FindDescriptor( other.GetDescriptor()->GetName(), other.GetDescriptor()->GetVersion() ); plStateDescriptor* sd=plSDLMgr::GetInstance()->FindDescriptor( other.GetDescriptor()->GetName(), other.GetDescriptor()->GetVersion() );
hsAssert( sd, plString::Format( "Failed to find sdl descriptor %s,%d. Missing legacy descriptor?", hsAssert(sd, plFormat("Failed to find sdl descriptor {},{}. Missing legacy descriptor?",
other.GetDescriptor()->GetName().c_str(), other.GetDescriptor()->GetVersion() ).c_str() ); other.GetDescriptor()->GetName(), other.GetDescriptor()->GetVersion()).c_str());
ConvertTo( sd ); ConvertTo( sd );
} }
hsAssert(other.GetDescriptor()==fDescriptor, hsAssert(other.GetDescriptor()==fDescriptor,
plString::Format("descriptor mismatch in UpdateFromDirty, SDL=%s,%s version %d %d", plFormat("descriptor mismatch in UpdateFromDirty, SDL={},{} version {} {}",
GetDescriptor()->GetName().c_str(), other.GetDescriptor()->GetName().c_str(), GetDescriptor()->GetName(), other.GetDescriptor()->GetName(),
GetDescriptor()->GetVersion(), other.GetDescriptor()->GetVersion()).c_str()); GetDescriptor()->GetVersion(), other.GetDescriptor()->GetVersion()).c_str());
bool dirtyOnly = (writeOptions & plSDL::kDirtyOnly); bool dirtyOnly = (writeOptions & plSDL::kDirtyOnly);
@ -545,9 +545,9 @@ void plStateDataRecord::FlagDifferentState(const plStateDataRecord& other)
} }
else else
{ {
hsAssert(false, plString::Format("descriptor mismatch in FlagDifferentState, mine %s %d, other %s %d", hsAssert(false, plFormat("descriptor mismatch in FlagDifferentState, mine {} {}, other {} {}",
fDescriptor->GetName().c_str(), fDescriptor->GetVersion(), fDescriptor->GetName(), fDescriptor->GetVersion(),
other.GetDescriptor()->GetName().c_str(), other.GetDescriptor()->GetVersion()).c_str()); other.GetDescriptor()->GetName(), other.GetDescriptor()->GetVersion()).c_str());
} }
} }
@ -599,9 +599,9 @@ void plStateDataRecord::FlagNewerState(const plStateDataRecord& other, bool resp
} }
else else
{ {
hsAssert(false, plString::Format("descriptor mismatch in FlagNewerState, mine %s %d, other %s %d", hsAssert(false, plFormat("descriptor mismatch in FlagNewerState, mine {} {}, other {} {}",
fDescriptor->GetName().c_str(), fDescriptor->GetVersion(), fDescriptor->GetName(), fDescriptor->GetVersion(),
other.GetDescriptor()->GetName().c_str(), other.GetDescriptor()->GetVersion()).c_str()); other.GetDescriptor()->GetName(), other.GetDescriptor()->GetVersion()).c_str());
} }
} }
@ -736,23 +736,20 @@ void plStateDataRecord::DumpToObjectDebugger(const char* msg, bool dirtyOnly, in
if (!dbg) if (!dbg)
return; return;
plString pad; plString pad = plString::Fill(level * 3, ' ');
int i;
for(i=0;i<level; i++)
pad += " ";
int numVars = dirtyOnly ? GetNumDirtyVars() : GetNumUsedVars(); int numVars = dirtyOnly ? GetNumDirtyVars() : GetNumUsedVars();
int numSDVars = dirtyOnly ? GetNumDirtySDVars() : GetNumUsedSDVars(); int numSDVars = dirtyOnly ? GetNumDirtySDVars() : GetNumUsedSDVars();
dbg->LogMsg(plString::Format("%s", fAssocObject.IsValid() ? fAssocObject.GetObjectName().c_str() : " ").c_str()); dbg->LogMsg(fAssocObject.IsValid() ? fAssocObject.GetObjectName().c_str() : " ");
if (msg) if (msg)
dbg->LogMsg(plString::Format("%s%s", pad.c_str(),msg).c_str()); dbg->LogMsg(plFormat("{}{}", pad, msg).c_str());
dbg->LogMsg(plString::Format("%sSDR(%p), desc=%s, showDirty=%d, numVars=%d, vol=%d", dbg->LogMsg(plFormat("{}SDR(0x{x}), desc={}, showDirty={}, numVars={}, vol={}",
pad.c_str(), this, fDescriptor->GetName().c_str(), dirtyOnly, numVars+numSDVars, fFlags&kVolatile).c_str()); pad, (uintptr_t)this, fDescriptor->GetName(), dirtyOnly, numVars+numSDVars, fFlags&kVolatile).c_str());
// dump simple vars // dump simple vars
for(i=0;i<fVarsList.size(); i++) for (size_t i=0; i<fVarsList.size(); i++)
{ {
if ( (dirtyOnly && fVarsList[i]->IsDirty()) || (!dirtyOnly && fVarsList[i]->IsUsed()) ) if ( (dirtyOnly && fVarsList[i]->IsDirty()) || (!dirtyOnly && fVarsList[i]->IsUsed()) )
{ {
@ -761,7 +758,7 @@ void plStateDataRecord::DumpToObjectDebugger(const char* msg, bool dirtyOnly, in
} }
// dump nested vars // dump nested vars
for(i=0;i<fSDVarsList.size(); i++) for (size_t i=0; i<fSDVarsList.size(); i++)
{ {
if ( (dirtyOnly && fSDVarsList[i]->IsDirty()) || (!dirtyOnly && fSDVarsList[i]->IsUsed()) ) if ( (dirtyOnly && fSDVarsList[i]->IsDirty()) || (!dirtyOnly && fSDVarsList[i]->IsUsed()) )
{ {
@ -772,29 +769,26 @@ void plStateDataRecord::DumpToObjectDebugger(const char* msg, bool dirtyOnly, in
void plStateDataRecord::DumpToStream(hsStream* stream, const char* msg, bool dirtyOnly, int level) const void plStateDataRecord::DumpToStream(hsStream* stream, const char* msg, bool dirtyOnly, int level) const
{ {
std::string pad; plString pad = plString::Fill(level * 3, ' ');
int i;
for(i=0;i<level; i++)
pad += " ";
int numVars = dirtyOnly ? GetNumDirtyVars() : GetNumUsedVars(); int numVars = dirtyOnly ? GetNumDirtyVars() : GetNumUsedVars();
int numSDVars = dirtyOnly ? GetNumDirtySDVars() : GetNumUsedSDVars(); int numSDVars = dirtyOnly ? GetNumDirtySDVars() : GetNumUsedSDVars();
plString logStr = plString::Format("%s", fAssocObject.IsValid() ? fAssocObject.GetObjectName().c_str() : " "); plString logStr = fAssocObject.IsValid() ? fAssocObject.GetObjectName() : " ";
stream->Write(logStr.GetSize(), logStr.c_str()); stream->Write(logStr.GetSize(), logStr.c_str());
if (msg) if (msg)
{ {
logStr = plString::Format("%s%s", pad.c_str(),msg); logStr = plFormat("{}{}", pad, msg);
stream->Write(logStr.GetSize(), logStr.c_str()); stream->Write(logStr.GetSize(), logStr.c_str());
} }
logStr = plString::Format("%sSDR(%p), desc=%s, showDirty=%d, numVars=%d, vol=%d", logStr = plFormat("{}SDR(0x{x}), desc={}, showDirty={}, numVars={}, vol={}",
pad.c_str(), this, fDescriptor->GetName().c_str(), dirtyOnly, numVars+numSDVars, fFlags&kVolatile); pad, (uintptr_t)this, fDescriptor->GetName(), dirtyOnly, numVars+numSDVars, fFlags&kVolatile);
stream->Write(logStr.GetSize(), logStr.c_str()); stream->Write(logStr.GetSize(), logStr.c_str());
// dump simple vars // dump simple vars
for(i=0;i<fVarsList.size(); i++) for (size_t i=0; i<fVarsList.size(); i++)
{ {
if ( (dirtyOnly && fVarsList[i]->IsDirty()) || (!dirtyOnly && fVarsList[i]->IsUsed()) ) if ( (dirtyOnly && fVarsList[i]->IsDirty()) || (!dirtyOnly && fVarsList[i]->IsUsed()) )
{ {
@ -803,7 +797,7 @@ void plStateDataRecord::DumpToStream(hsStream* stream, const char* msg, bool dir
} }
// dump nested vars // dump nested vars
for(i=0;i<fSDVarsList.size(); i++) for (size_t i=0; i<fSDVarsList.size(); i++)
{ {
if ( (dirtyOnly && fSDVarsList[i]->IsDirty()) || (!dirtyOnly && fSDVarsList[i]->IsUsed()) ) if ( (dirtyOnly && fSDVarsList[i]->IsDirty()) || (!dirtyOnly && fSDVarsList[i]->IsUsed()) )
{ {

147
Sources/Plasma/PubUtilLib/plSDL/plStateVariable.cpp

@ -209,8 +209,8 @@ void plSimpleStateVariable::IDeAlloc()
} }
break; break;
default: default:
hsAssert(false, plString::Format("undefined atomic type:%d var:%s cnt:%d", hsAssert(false, plFormat("undefined atomic type:{} var:{} cnt:{}",
type, GetName().c_str("?"), GetCount()).c_str()); type, GetName(), GetCount()).c_str());
break; break;
}; };
@ -411,9 +411,9 @@ void plSimpleStateVariable::IVarSet(bool timeStampNow/*=true*/)
plString plSimpleStateVariable::GetAsString(int idx) const plString plSimpleStateVariable::GetAsString(int idx) const
{ {
int j; int j;
plString str; plStringStream str;
if (fVar.GetAtomicCount()>1) if (fVar.GetAtomicCount()>1)
str += "("; str << '(';
plVarDescriptor::Type type=fVar.GetAtomicType(); plVarDescriptor::Type type=fVar.GetAtomicType();
switch(type) switch(type)
@ -431,29 +431,29 @@ plString plSimpleStateVariable::GetAsString(int idx) const
for(j=0;j<fVar.GetAtomicCount();j++) for(j=0;j<fVar.GetAtomicCount();j++)
{ {
if (type==plVarDescriptor::kInt) if (type==plVarDescriptor::kInt)
str += plString::Format( "%d", fI[i++]); str << fI[i++];
else if (type==plVarDescriptor::kShort) else if (type==plVarDescriptor::kShort)
str += plString::Format( "%d", fS[i++]); str << fS[i++];
else if (type==plVarDescriptor::kByte) else if (type==plVarDescriptor::kByte)
str += plString::Format( "%d", fBy[i++]); str << fBy[i++];
else if (type==plVarDescriptor::kFloat || type==plVarDescriptor::kAgeTimeOfDay) else if (type==plVarDescriptor::kFloat || type==plVarDescriptor::kAgeTimeOfDay)
str += plString::Format( "%.3f", fF[i++]); str << plFormat("{.3f}", fF[i++]);
else if (type==plVarDescriptor::kDouble) else if (type==plVarDescriptor::kDouble)
str += plString::Format( "%.3f", fD[i++]); str << plFormat("{.3f}", fD[i++]);
else if (type==plVarDescriptor::kTime) else if (type==plVarDescriptor::kTime)
{ {
double tmp; double tmp;
Get(&tmp, i++); Get(&tmp, i++);
str += plString::Format( "%.3f", tmp); str << plFormat("{.3f}", tmp);
} }
if (j==fVar.GetAtomicCount()-1) if (j==fVar.GetAtomicCount()-1)
{ {
if (j) if (j)
str += ")"; str << ')';
} }
else else
str += ","; str << ',';
} }
} }
break; break;
@ -463,15 +463,15 @@ plString plSimpleStateVariable::GetAsString(int idx) const
int i=idx*fVar.GetAtomicCount(); int i=idx*fVar.GetAtomicCount();
for(j=0;j<fVar.GetAtomicCount();j++) for(j=0;j<fVar.GetAtomicCount();j++)
{ {
str += plString::Format( "%s", fB[i++] ? "true" : "false"); str << (fB[i++] ? "true" : "false");
if (j==fVar.GetAtomicCount()-1) if (j==fVar.GetAtomicCount()-1)
{ {
if (j) if (j)
str += ")"; str << ')';
} }
else else
str += ","; str << ',';
} }
} }
break; break;
@ -481,15 +481,15 @@ plString plSimpleStateVariable::GetAsString(int idx) const
int i=idx*fVar.GetAtomicCount(); int i=idx*fVar.GetAtomicCount();
for(j=0;j<fVar.GetAtomicCount();j++) for(j=0;j<fVar.GetAtomicCount();j++)
{ {
str += plString::Format( "%s", fS32[i++]); str << fS32[i++];
if (j==fVar.GetAtomicCount()-1) if (j==fVar.GetAtomicCount()-1)
{ {
if (j) if (j)
str += ")"; str << ')';
} }
else else
str += ","; str << ',';
} }
} }
break; break;
@ -499,21 +499,21 @@ plString plSimpleStateVariable::GetAsString(int idx) const
int i=idx*fVar.GetAtomicCount(); int i=idx*fVar.GetAtomicCount();
for(j=0;j<fVar.GetAtomicCount();j++) for(j=0;j<fVar.GetAtomicCount();j++)
{ {
str += "other"; str << "other";
if (j==fVar.GetAtomicCount()-1) if (j==fVar.GetAtomicCount()-1)
{ {
if (j) if (j)
str += ")"; str << ')';
} }
else else
str += ","; str << ',';
} }
} }
break; break;
} }
return str; return str.GetString();
} }
// //
@ -2163,8 +2163,8 @@ void plSimpleStateVariable::NotifyStateChange(const plSimpleStateVariable* other
if (plNetObjectDebuggerBase::GetInstance() && plNetObjectDebuggerBase::GetInstance()->GetDebugging()) if (plNetObjectDebuggerBase::GetInstance() && plNetObjectDebuggerBase::GetInstance()->GetDebugging())
{ {
plNetObjectDebuggerBase::GetInstance()->LogMsg( plNetObjectDebuggerBase::GetInstance()->LogMsg(
plString::Format("Var %s did %s send notification difference. Has %d notifiers with %d recipients.", plFormat("Var {} did {} send notification difference. Has {} notifiers with {} recipients.",
GetName().c_str(), !notify ? "NOT" : "", fChangeNotifiers.size(), numNotifiers).c_str()); GetName(), !notify ? "NOT" : "", fChangeNotifiers.size(), numNotifiers).c_str());
} }
} }
@ -2279,77 +2279,87 @@ void plSimpleStateVariable::DumpToObjectDebugger(bool dirtyOnly, int level) cons
if (!dbg) if (!dbg)
return; return;
plString pad; plString pad = plString::Fill(level * 3, ' ');
int i;
for(i=0;i<level; i++) plStringStream logMsg;
pad += " "; logMsg << pad << "SimpleVar, name:" << GetName() << '[' << GetCount() << ']';
plString logMsg = plString::Format( "%sSimpleVar, name:%s[%d]", pad.c_str(), GetName().c_str(), GetCount());
if (GetCount()>1) if (GetCount()>1)
{ {
dbg->LogMsg(logMsg.c_str()); // it's going to be a long msg, so print it on its own line dbg->LogMsg(logMsg.GetString().c_str()); // it's going to be a long msg, so print it on its own line
logMsg = ""; logMsg.Truncate();
} }
pad += "\t"; pad += "\t";
for(i=0;i<GetCount(); i++) for (size_t i=0; i<GetCount(); i++)
{ {
logMsg << pad;
logMsg << "Var:" << i;
plString s=GetAsString(i); plString s=GetAsString(i);
if (fVar.GetAtomicType() == plVarDescriptor::kTime) if (fVar.GetAtomicType() == plVarDescriptor::kTime)
{ {
const char* p=fT[i].PrintWMillis(); logMsg << " gameTime:" << s;
logMsg += plString::Format( "%sVar:%d gameTime:%s pst:%s ts:%s", logMsg << " pst:" << fT[i].PrintWMillis();
pad.c_str(), i, s.c_str("?"), p, fTimeStamp.Format("%c").c_str() ); logMsg << " ts:" << fTimeStamp.Format("%c").c_str();
} }
else else
{ {
logMsg += plString::Format( "%sVar:%d value:%s ts:%s", logMsg << " value:" << s;
pad.c_str(), i, s.c_str("?"), fTimeStamp.AtEpoch() ? "0" : fTimeStamp.Format("%c").c_str() ); logMsg << " ts:" << (fTimeStamp.AtEpoch() ? "0" : fTimeStamp.Format("%c").c_str());
} }
if ( !dirtyOnly ) if (!dirtyOnly)
logMsg += plString::Format( " dirty:%d", IsDirty() ); {
logMsg << " dirty:";
logMsg << (IsDirty() ? 0 : 1);
}
dbg->LogMsg(logMsg.c_str()); dbg->LogMsg(logMsg.GetString().c_str());
logMsg = ""; logMsg.Truncate();
} }
} }
void plSimpleStateVariable::DumpToStream(hsStream* stream, bool dirtyOnly, int level) const void plSimpleStateVariable::DumpToStream(hsStream* stream, bool dirtyOnly, int level) const
{ {
plString pad; plString pad = plString::Fill(level * 3, ' ');
int i;
for(i=0;i<level; i++) plStringStream logMsg;
pad += " "; logMsg << pad << "SimpleVar, name:" << GetName() << '[' << GetCount() << ']';
plString logMsg = plString::Format( "%sSimpleVar, name:%s[%d]", pad.c_str(), GetName().c_str(), GetCount());
if (GetCount()>1) if (GetCount()>1)
{ {
stream->WriteString(logMsg); // it's going to be a long msg, so print it on its own line stream->WriteString(logMsg.GetString()); // it's going to be a long msg, so print it on its own line
logMsg = ""; logMsg.Truncate();
} }
pad += "\t"; pad += "\t";
for(i=0;i<GetCount(); i++) for (size_t i=0; i<GetCount(); i++)
{ {
plString s=GetAsString(i); logMsg << pad;
logMsg << "Var:" << i;
plString s = GetAsString(i);
if (fVar.GetAtomicType() == plVarDescriptor::kTime) if (fVar.GetAtomicType() == plVarDescriptor::kTime)
{ {
const char* p=fT[i].PrintWMillis(); logMsg << " gameTime:" << s;
logMsg += plString::Format( "%sVar:%d gameTime:%s pst:%s ts:%s", logMsg << " pst:" << fT[i].PrintWMillis();
pad.c_str(), i, s.c_str("?"), p, fTimeStamp.Format("%c").c_str() ); logMsg << " ts:" << fTimeStamp.Format("%c").c_str();
} }
else else
{ {
logMsg += plString::Format( "%sVar:%d value:%s ts:%s", logMsg << " value:" << s;
pad.c_str(), i, s.c_str("?"), fTimeStamp.AtEpoch() ? "0" : fTimeStamp.Format("%c").c_str() ); logMsg << " ts:" << (fTimeStamp.AtEpoch() ? "0" : fTimeStamp.Format("%c").c_str());
} }
if ( !dirtyOnly ) if (!dirtyOnly)
logMsg += plString::Format( " dirty:%d", IsDirty() ); {
logMsg << " dirty:";
logMsg << (IsDirty() ? 0 : 1);
}
stream->WriteString(logMsg); stream->WriteString(logMsg.GetString());
logMsg = ""; logMsg.Truncate();
} }
} }
@ -2485,8 +2495,8 @@ void plSDStateVariable::CopyFrom(plSDStateVariable* other, uint32_t writeOptions
void plSDStateVariable::UpdateFrom(plSDStateVariable* other, uint32_t writeOptions/*=0*/) void plSDStateVariable::UpdateFrom(plSDStateVariable* other, uint32_t writeOptions/*=0*/)
{ {
hsAssert(!other->GetSDVarDescriptor()->GetName().CompareI(fVarDescriptor->GetName()), hsAssert(!other->GetSDVarDescriptor()->GetName().CompareI(fVarDescriptor->GetName()),
plString::Format("var descriptor mismatch in UpdateFrom, name %s,%s ver %d,%d", plFormat("var descriptor mismatch in UpdateFrom, name {},{}",
GetName().c_str(), other->GetName().c_str()).c_str()); GetName(), other->GetName()).c_str());
Resize(other->GetCount()); // make sure sizes match Resize(other->GetCount()); // make sure sizes match
bool dirtyOnly = (writeOptions & plSDL::kDirtyOnly); bool dirtyOnly = (writeOptions & plSDL::kDirtyOnly);
@ -2676,16 +2686,13 @@ void plSDStateVariable::DumpToObjectDebugger(bool dirtyOnly, int level) const
if (!dbg) if (!dbg)
return; return;
std::string pad; plString pad = plString::Fill(level * 3, ' ');
int i;
for(i=0;i<level; i++)
pad += " ";
int cnt = dirtyOnly ? GetDirtyCount() : GetUsedCount(); int cnt = dirtyOnly ? GetDirtyCount() : GetUsedCount();
dbg->LogMsg(plString::Format( "%sSDVar, name:%s dirtyOnly:%d count:%d", dbg->LogMsg(plFormat("{}SDVar, name:{} dirtyOnly:{} count:{}",
pad.c_str(), GetName().c_str(), dirtyOnly, cnt).c_str()); pad, GetName(), dirtyOnly, cnt).c_str());
for(i=0;i<GetCount();i++) for (size_t i=0; i<GetCount(); i++)
{ {
if ( (dirtyOnly && fDataRecList[i]->IsDirty()) || if ( (dirtyOnly && fDataRecList[i]->IsDirty()) ||
(!dirtyOnly && fDataRecList[i]->IsUsed()) ) (!dirtyOnly && fDataRecList[i]->IsUsed()) )
@ -2703,8 +2710,8 @@ void plSDStateVariable::DumpToStream(hsStream* stream, bool dirtyOnly, int level
pad += " "; pad += " ";
int cnt = dirtyOnly ? GetDirtyCount() : GetUsedCount(); int cnt = dirtyOnly ? GetDirtyCount() : GetUsedCount();
stream->WriteString(plString::Format( "%sSDVar, name:%s dirtyOnly:%d count:%d", stream->WriteString(plFormat("{}SDVar, name:{} dirtyOnly:{} count:{}",
pad.c_str(), GetName().c_str(), dirtyOnly, cnt)); pad, GetName(), dirtyOnly, cnt));
for(i=0;i<GetCount();i++) for(i=0;i<GetCount();i++)
{ {

2
Sources/Plasma/PubUtilLib/plSDL/plVarDescriptor.cpp

@ -375,7 +375,7 @@ bool plSDVarDescriptor::Read(hsStream* s)
plString sdName=s->ReadSafeString(); plString sdName=s->ReadSafeString();
uint16_t version = s->ReadLE16(); uint16_t version = s->ReadLE16();
plStateDescriptor* sd=plSDLMgr::GetInstance()->FindDescriptor(sdName, version); plStateDescriptor* sd=plSDLMgr::GetInstance()->FindDescriptor(sdName, version);
hsAssert( sd, plString::Format("Failed to find sdl descriptor: %s,%d. Missing legacy descriptor?", sdName.c_str(), version ).c_str() ); hsAssert(sd, plFormat("Failed to find sdl descriptor: {},{}. Missing legacy descriptor?", sdName, version).c_str());
SetStateDesc(sd); SetStateDesc(sd);
return true; return true;
} }

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

@ -216,9 +216,9 @@ void plAutoProfileImp::INextProfile()
plMipmap mipmap; plMipmap mipmap;
if (plClient::GetInstance()->GetPipeline()->CaptureScreen(&mipmap)) if (plClient::GetInstance()->GetPipeline()->CaptureScreen(&mipmap))
{ {
plString fileName = plString::Format("%s\\%s_%s.jpg", plString fileName = plFormat("{}\\{}_{}.jpg",
plProfileManagerFull::Instance().GetProfilePath().AsString().c_str(), plProfileManagerFull::Instance().GetProfilePath(),
ageName, fLastSpawnPointName.c_str()); ageName, fLastSpawnPointName);
plJPEG::Instance().SetWriteQuality(100); plJPEG::Instance().SetWriteQuality(100);
plJPEG::Instance().WriteToFile(fileName.c_str(), &mipmap); plJPEG::Instance().WriteToFile(fileName.c_str(), &mipmap);

8
Sources/Plasma/PubUtilLib/plStatGather/plProfileManagerFull.cpp

@ -433,10 +433,10 @@ plFileName plProfileManagerFull::GetProfilePath()
plUnifiedTime curTime = plUnifiedTime::GetCurrent(plUnifiedTime::kLocal); plUnifiedTime curTime = plUnifiedTime::GetCurrent(plUnifiedTime::kLocal);
profilePath = plFileName::Join(plFileSystem::GetUserDataPath(), "Profile", profilePath = plFileName::Join(plFileSystem::GetUserDataPath(), "Profile",
plString::Format("%02d-%02d-%04d_%02d-%02d", plFormat("{_02}-{_02}-{_04}_{_02}-{_02}",
curTime.GetMonth(), curTime.GetDay(), curTime.GetMonth(), curTime.GetDay(),
curTime.GetYear(), curTime.GetHour(), curTime.GetYear(), curTime.GetHour(),
curTime.GetMinute())); curTime.GetMinute()));
plFileSystem::CreateDir(profilePath, true); plFileSystem::CreateDir(profilePath, true);
} }

21
Sources/Plasma/PubUtilLib/plStatusLog/plStatusLog.cpp

@ -330,15 +330,15 @@ bool plStatusLog::IReOpen( void )
plFileName fileNoExt; plFileName fileNoExt;
plString ext; plString ext;
IParseFileName(fileNoExt, ext); IParseFileName(fileNoExt, ext);
plFileName fileToOpen = plString::Format("%s.0.%s", fileNoExt.AsString().c_str(), ext.c_str()); plFileName fileToOpen = plFormat("{}.0.{}", fileNoExt, ext);
if (!(fFlags & kDontRotateLogs)) if (!(fFlags & kDontRotateLogs))
{ {
plFileName work, work2; plFileName work, work2;
work = plString::Format("%s.3.%s", fileNoExt.AsString().c_str(), ext.c_str()); work = plFormat("{}.3.{}", fileNoExt, ext);
plFileSystem::Unlink(work); plFileSystem::Unlink(work);
work2 = plString::Format("%s.2.%s", fileNoExt.AsString().c_str(), ext.c_str()); work2 = plFormat("{}.2.{}", fileNoExt, ext);
plFileSystem::Move(work2, work); plFileSystem::Move(work2, work);
work = plString::Format("%s.1.%s", fileNoExt.AsString().c_str(), ext.c_str()); work = plFormat("{}.1.{}", fileNoExt, ext);
plFileSystem::Move(work, work2); plFileSystem::Move(work, work2);
plFileSystem::Move(fileToOpen, work); plFileSystem::Move(fileToOpen, work);
} }
@ -715,21 +715,22 @@ bool plStatusLog::IPrintLineToFile( const char *line, uint32_t count )
} }
if ( fFlags & kDebugOutput ) plString out_str = plString::FromUtf8(line, count) + "\n";
if (fFlags & kDebugOutput)
{ {
#if HS_BUILD_FOR_WIN32 #if HS_BUILD_FOR_WIN32
#ifndef PLASMA_EXTERNAL_RELEASE #ifndef PLASMA_EXTERNAL_RELEASE
plString str = plString::Format( "%.*s\n", count, line ); OutputDebugString(out_str.c_str());
OutputDebugString( str.c_str() );
#endif #endif
#else #else
fprintf( stderr, "%.*s\n", count, line ); fputs(str.c_str(), str);
#endif #endif
} }
if ( fFlags & kStdout ) if (fFlags & kStdout)
{ {
fprintf( stdout, "%.*s\n", count, line ); fputs(out_str.c_str(), stdout);
} }
return ret; return ret;

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

@ -134,7 +134,7 @@ plLayer* hsGMaterial::MakeBaseLayer()
plString buff; plString buff;
if( !GetKeyName().IsNull() ) if( !GetKeyName().IsNull() )
buff = plString::Format("%s_Layer", GetKeyName().c_str()); buff = plFormat("{}_Layer", GetKeyName());
else else
buff = "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 );

4
Sources/Plasma/PubUtilLib/plSurface/plGrassShaderMod.cpp

@ -226,7 +226,7 @@ void plGrassShaderMod::ISetupShaders()
if (!fVShader) if (!fVShader)
{ {
plShader* vShader = new plShader; plShader* vShader = new plShader;
plString buff = plString::Format("%s_GrassVS", GetKey()->GetName().c_str()); plString buff = plFormat("{}_GrassVS", GetKey()->GetName());
hsgResMgr::ResMgr()->NewKey(buff, vShader, GetKey()->GetUoid().GetLocation()); hsgResMgr::ResMgr()->NewKey(buff, vShader, GetKey()->GetUoid().GetLocation());
vShader->SetIsPixelShader(false); vShader->SetIsPixelShader(false);
vShader->SetInputFormat(1); vShader->SetInputFormat(1);
@ -249,7 +249,7 @@ void plGrassShaderMod::ISetupShaders()
if (!fPShader) if (!fPShader)
{ {
plShader* pShader = new plShader; plShader* pShader = new plShader;
plString buff = plString::Format("%s_GrassPS", GetKey()->GetName().c_str()); plString buff = plFormat("{}_GrassPS", GetKey()->GetName());
hsgResMgr::ResMgr()->NewKey(buff, pShader, GetKey()->GetUoid().GetLocation()); hsgResMgr::ResMgr()->NewKey(buff, pShader, GetKey()->GetUoid().GetLocation());
pShader->SetIsPixelShader(true); pShader->SetIsPixelShader(true);
pShader->SetNumConsts(0); pShader->SetNumConsts(0);

2
Sources/Plasma/PubUtilLib/plVault/plDniCoordinateInfo.cpp

@ -94,6 +94,6 @@ void plDniCoordinateInfo::Write( hsStream* s, hsResMgr* mgr )
plString plDniCoordinateInfo::AsString( int level ) const plString plDniCoordinateInfo::AsString( int level ) const
{ {
plString space = plString::Fill( level, ' ' ); plString space = plString::Fill( level, ' ' );
return plString::Format( "%sDniCoords[%d,%d,%d]", space.c_str(), fHSpans, fVSpans, fTorans ); return plFormat("{}DniCoords[{},{},{}]", space, fHSpans, fVSpans, fTorans);
} }
#endif // def CLIENT #endif // def CLIENT

1
Sources/Tools/MaxComponent/Pch.h

@ -72,6 +72,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
#include "hsTemplates.h" #include "hsTemplates.h"
#include "hsThread.h" #include "hsThread.h"
#include "plTweak.h" #include "plTweak.h"
#include "plFormat.h"
// Windows // Windows
#include "hsWindows.h" #include "hsWindows.h"

2
Sources/Tools/MaxComponent/plAnimComponent.cpp

@ -890,7 +890,7 @@ bool plAnimComponentBase::IMakePersistent(plMaxNode *node, plAGAnim *anim, plErr
plAGMasterMod *mod = plAGMasterMod::ConvertNoRef(fMods[node]); plAGMasterMod *mod = plAGMasterMod::ConvertNoRef(fMods[node]);
hsAssert(mod != nil, "No MasterMod to make animation persistent!"); hsAssert(mod != nil, "No MasterMod to make animation persistent!");
plString buffer = plString::Format("%s_%s_anim_%d", node->GetName(), anim->GetName().c_str(), mod->GetNumPrivateAnimations()); plString buffer = plFormat("{}_{}_anim_{}", node->GetName(), anim->GetName(), mod->GetNumPrivateAnimations());
plLocation nodeLoc = node->GetLocation(); plLocation nodeLoc = node->GetLocation();
plKey animKey = hsgResMgr::ResMgr()->NewKey(buffer, anim, nodeLoc); plKey animKey = hsgResMgr::ResMgr()->NewKey(buffer, anim, nodeLoc);

6
Sources/Tools/MaxComponent/plAudioComponents.cpp

@ -2317,7 +2317,7 @@ bool plSound3DEmitterComponent::ConvertGrouped( plMaxNode *baseNode, hsTArray
if( fIndices.find( baseNode ) != fIndices.end() ) if( fIndices.find( baseNode ) != fIndices.end() )
index = fIndices[ baseNode ]; index = fIndices[ baseNode ];
keyName = plString::Format( "%s_MergedSound", GetINode()->GetName() ); keyName = plFormat("{}_MergedSound", GetINode()->GetName());
plKey buffKey = baseNode->FindPageKey( plSoundBuffer::Index(), keyName ); plKey buffKey = baseNode->FindPageKey( plSoundBuffer::Index(), keyName );
if( buffKey != nil ) if( buffKey != nil )
@ -2485,7 +2485,7 @@ bool plBackgroundMusicComponent::Convert(plMaxNode *node, plErrorMsg *pErrMsg)
if( srcBuffer == nil ) if( srcBuffer == nil )
return false; return false;
plString keyName = plString::Format( "%s_Win32BgndSnd", GetINode()->GetName() ); plString keyName = plFormat("{}_Win32BgndSnd", GetINode()->GetName());
plWin32Sound *sound = nil; plWin32Sound *sound = nil;
if( srcBuffer->GetDataLengthInSecs() > 4.f ) if( srcBuffer->GetDataLengthInSecs() > 4.f )
@ -2643,7 +2643,7 @@ bool plGUISoundComponent::Convert(plMaxNode *node, plErrorMsg *pErrMsg)
return false; return false;
} }
plString keyName = plString::Format( "%s_Win32GUISound", GetINode()->GetName() ); plString keyName = plFormat("{}_Win32GUISound", GetINode()->GetName());
plWin32StaticSound *sound = new plWin32StaticSound; plWin32StaticSound *sound = new plWin32StaticSound;
hsgResMgr::ResMgr()->NewKey(keyName, sound, node->GetLocation(), node->GetLoadMask()); hsgResMgr::ResMgr()->NewKey(keyName, sound, node->GetLocation(), node->GetLoadMask());

4
Sources/Tools/MaxComponent/plAvatarComponent.cpp

@ -509,11 +509,11 @@ void AddClothingToMod(plMaxNode *node, plArmatureMod *mod, int group, hsGMateria
} }
else else
base->SetLayoutName("BasicHuman"); base->SetLayoutName("BasicHuman");
keyName = plString::Format("%s_ClothingBase", node->GetName()); keyName = plFormat("{}_ClothingBase", node->GetName());
hsgResMgr::ResMgr()->NewKey(keyName, base, node->GetLocation()); hsgResMgr::ResMgr()->NewKey(keyName, base, node->GetLocation());
plClothingOutfit *outfit = new plClothingOutfit(); plClothingOutfit *outfit = new plClothingOutfit();
outfit->fGroup = group; outfit->fGroup = group;
keyName = plString::Format("%s_outfit", mod->GetKey()->GetName().c_str()); keyName = plFormat("{}_outfit", mod->GetKey()->GetName());
hsgResMgr::ResMgr()->NewKey(keyName, outfit, node->GetLocation()); hsgResMgr::ResMgr()->NewKey(keyName, outfit, node->GetLocation());
msg = new plGenRefMsg(outfit->GetKey(), plRefMsg::kOnCreate, -1, -1); msg = new plGenRefMsg(outfit->GetKey(), plRefMsg::kOnCreate, -1, -1);

3
Sources/Tools/MaxComponent/plComponentBase.cpp

@ -41,6 +41,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
*==LICENSE==*/ *==LICENSE==*/
#include "HeadSpin.h" #include "HeadSpin.h"
#include "plFormat.h"
#include "plComponentBase.h" #include "plComponentBase.h"
#include "plComponentReg.h" #include "plComponentReg.h"
@ -309,7 +310,7 @@ plString plComponentBase::IGetUniqueName(plMaxNodeBase* target)
hsAssert(thisTargIdx != -1, "Bad target for IGetUniqueName"); hsAssert(thisTargIdx != -1, "Bad target for IGetUniqueName");
if (numUsedTargs > 1) if (numUsedTargs > 1)
return plString::Format("%s_%d", GetINode()->GetName(), thisTargIdx); return plFormat("{}_{}", GetINode()->GetName(), thisTargIdx);
else else
return plString::FromUtf8(GetINode()->GetName()); return plString::FromUtf8(GetINode()->GetName());
} }

2
Sources/Tools/MaxComponent/plInventoryObjComponent.cpp

@ -193,7 +193,7 @@ bool plInventoryObjComponent::PreConvert(plMaxNode *node, plErrorMsg *pErrMsg)
// Create and register the ClickDrag's logic component // Create and register the ClickDrag's logic component
plLogicModifier *logic = new plLogicModifier; plLogicModifier *logic = new plLogicModifier;
plString tmpName = plString::Format("%s_%s_LogicModifier", obj->GetKeyName().c_str(), GetINode()->GetName()); plString tmpName = plFormat("{}_{}_LogicModifier", obj->GetKeyName(), GetINode()->GetName());
plKey logicKey = hsgResMgr::ResMgr()->NewKey(tmpName, logic, node->GetLocation()); plKey logicKey = hsgResMgr::ResMgr()->NewKey(tmpName, logic, node->GetLocation());
hsgResMgr::ResMgr()->AddViaNotify(logicKey, new plObjRefMsg(obj->GetKey(), plRefMsg::kOnCreate, -1, plObjRefMsg::kModifier), plRefFlags::kActiveRef); hsgResMgr::ResMgr()->AddViaNotify(logicKey, new plObjRefMsg(obj->GetKey(), plRefMsg::kOnCreate, -1, plObjRefMsg::kModifier), plRefFlags::kActiveRef);

2
Sources/Tools/MaxComponent/plMiscComponents.cpp

@ -648,7 +648,7 @@ void plPageInfoComponent::IUpdateSeqNumbersFromAgeFile( plErrorMsg *errMsg )
fCompPB->SetValue( kInfoSeqSuffix, 0, 0 ); fCompPB->SetValue( kInfoSeqSuffix, 0, 0 );
return; return;
} }
plFileName path = plFileName::Join(ageFolder, plString::Format("%s.age", curAge)); plFileName path = plFileName::Join(ageFolder, plFormat("{}.age", curAge));
IVerifyLatestAgeAsset( curAge, path, errMsg ); IVerifyLatestAgeAsset( curAge, path, errMsg );
std::unique_ptr<plAgeDescription> aged(plPageInfoUtils::GetAgeDesc(curAge)); std::unique_ptr<plAgeDescription> aged(plPageInfoUtils::GetAgeDesc(curAge));

2
Sources/Tools/MaxComponent/plMultistageBehComponent.cpp

@ -333,7 +333,7 @@ void plMultistageBehComponent::FixStageNames()
for (int i = 0; i < fStages.size(); i++) for (int i = 0; i < fStages.size(); i++)
{ {
plBaseStage* stage = fStages[i]; plBaseStage* stage = fStages[i];
stage->SetName(plString::Format("Stage %d", i)); stage->SetName(plFormat("Stage {}", i));
} }
} }
} }

8
Sources/Tools/MaxComponent/plVolumeGadgetComponent.cpp

@ -335,7 +335,7 @@ bool plVolumeGadgetComponent::PreConvert(plMaxNode *node, plErrorMsg *pErrMsg)
if(fCompPB->GetInt(kVolumeGadgetEnter) || fCompPB->GetInt(kVolumeTriggerOnFacing)) if(fCompPB->GetInt(kVolumeGadgetEnter) || fCompPB->GetInt(kVolumeTriggerOnFacing))
{ {
plLogicModifier *logic = new plLogicModifier; plLogicModifier *logic = new plLogicModifier;
plString tmpName = plString::Format("%s_Enter", IGetUniqueName(node).c_str()); plString tmpName = plFormat("{}_Enter", IGetUniqueName(node));
plKey logicKey = hsgResMgr::ResMgr()->NewKey(tmpName, logic, node->GetLocation()); plKey logicKey = hsgResMgr::ResMgr()->NewKey(tmpName, logic, node->GetLocation());
hsgResMgr::ResMgr()->AddViaNotify(logicKey, new plObjRefMsg(obj->GetKey(), plRefMsg::kOnCreate, -1, plObjRefMsg::kModifier), plRefFlags::kActiveRef); hsgResMgr::ResMgr()->AddViaNotify(logicKey, new plObjRefMsg(obj->GetKey(), plRefMsg::kOnCreate, -1, plObjRefMsg::kModifier), plRefFlags::kActiveRef);
@ -349,7 +349,7 @@ bool plVolumeGadgetComponent::PreConvert(plMaxNode *node, plErrorMsg *pErrMsg)
if(fCompPB->GetInt(kVolumeGadgetExit)) if(fCompPB->GetInt(kVolumeGadgetExit))
{ {
plLogicModifier *logic = new plLogicModifier; plLogicModifier *logic = new plLogicModifier;
plString tmpName = plString::Format("%s_Exit", IGetUniqueName(node).c_str()); plString tmpName = plFormat("{}_Exit", IGetUniqueName(node));
plKey logicKey = hsgResMgr::ResMgr()->NewKey(tmpName, logic, node->GetLocation()); plKey logicKey = hsgResMgr::ResMgr()->NewKey(tmpName, logic, node->GetLocation());
hsgResMgr::ResMgr()->AddViaNotify(logicKey, new plObjRefMsg(obj->GetKey(), plRefMsg::kOnCreate, -1, plObjRefMsg::kModifier), plRefFlags::kActiveRef); hsgResMgr::ResMgr()->AddViaNotify(logicKey, new plObjRefMsg(obj->GetKey(), plRefMsg::kOnCreate, -1, plObjRefMsg::kModifier), plRefFlags::kActiveRef);
@ -407,7 +407,7 @@ void plVolumeGadgetComponent::ICreateConditions(plMaxNode* node, plErrorMsg* err
prefix = "Enter"; prefix = "Enter";
// Register the detector // Register the detector
plString tmpName = plString::Format("%s_%s", IGetUniqueName(node).c_str(), prefix); plString tmpName = plFormat("{}_{}", IGetUniqueName(node), prefix);
plKey detectorKey = hsgResMgr::ResMgr()->NewKey(tmpName, detector, loc); plKey detectorKey = hsgResMgr::ResMgr()->NewKey(tmpName, detector, loc);
hsgResMgr::ResMgr()->AddViaNotify(detectorKey, new plObjRefMsg(obj->GetKey(), plRefMsg::kOnCreate, -1, plObjRefMsg::kModifier), plRefFlags::kActiveRef); hsgResMgr::ResMgr()->AddViaNotify(detectorKey, new plObjRefMsg(obj->GetKey(), plRefMsg::kOnCreate, -1, plObjRefMsg::kModifier), plRefFlags::kActiveRef);
plVolumeSensorConditionalObject* boxCond=nil; plVolumeSensorConditionalObject* boxCond=nil;
@ -419,7 +419,7 @@ void plVolumeGadgetComponent::ICreateConditions(plMaxNode* node, plErrorMsg* err
{ {
boxCond = new plVolumeSensorConditionalObjectNoArbitration; boxCond = new plVolumeSensorConditionalObjectNoArbitration;
} }
tmpName = plString::Format("%s_%s", IGetUniqueName(node).c_str(), prefix); tmpName = plFormat("{}_{}", IGetUniqueName(node), prefix);
plKey boxKey = hsgResMgr::ResMgr()->NewKey(tmpName, boxCond, loc); plKey boxKey = hsgResMgr::ResMgr()->NewKey(tmpName, boxCond, loc);
if (enter) if (enter)

6
Sources/Tools/MaxConvert/hsConverterUtils.cpp

@ -239,7 +239,7 @@ char *hsConverterUtils::MangleReference(char *mangName, const char *nodeName, co
// Default is to make it global, but you can set another default (like same // Default is to make it global, but you can set another default (like same
// room as referencer) with defRoom. // room as referencer) with defRoom.
plString tempName = plString::Format("%s..%s", defRoom, nodeName); plString tempName = plFormat("{}..{}", defRoom, nodeName);
return hsStrcpy(mangName, tempName.c_str()); return hsStrcpy(mangName, tempName.c_str());
} }
@ -278,9 +278,9 @@ char *hsConverterUtils::MangleReference(char *mangName, INode *node, const char*
) )
tempName = nodeName; tempName = nodeName;
else if (roomName && *roomName) else if (roomName && *roomName)
tempName = plString::Format("%s..%s", roomName, nodeName); tempName = plFormat("{}..{}", roomName, nodeName);
else else
tempName = plString::Format("%s..%s", defRoom, nodeName); tempName = plFormat("{}..{}", defRoom, nodeName);
return hsStrcpy(mangName, tempName.c_str()); return hsStrcpy(mangName, tempName.c_str());

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save