Browse Source

Merge pull request #430 from zrax/plFormat_stuff

Start taking over the world with plFormat
Adam Johnson 10 years ago
parent
commit
8ca4af9a78
  1. 4
      Sources/Plasma/Apps/plClient/plClient.cpp
  2. 6
      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. 66
      Sources/Plasma/PubUtilLib/plSDL/plStateDataRecord.cpp
  83. 153
      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);
if( callback )
{
plString str = plString::Format("Callback event from %s\n", callback->GetSender()
? callback->GetSender()->GetName().c_str()
plString str = plFormat("Callback event from {}\n", callback->GetSender()
? callback->GetSender()->GetName()
: "Unknown");
hsStatusMessage(str.c_str());
static int gotten = 0;

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

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

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

@ -240,7 +240,7 @@ public:
const plPageInfo& info = page->GetPageInfo();
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");
page->LoadKeys();

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

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

2
Sources/Plasma/CoreLib/plFormat.cpp

@ -449,7 +449,7 @@ PL_FORMAT_IMPL(double)
PL_FORMAT_IMPL(char)
{
/* 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) {
case plFormat_Private::kDigitBin:
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...);
}
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

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

@ -123,10 +123,10 @@ void plAnimDebugList::ShowReport()
plLayerAnimation *layerAnim = plLayerAnimation::ConvertNoRef(layer);
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().WorldToAnimTimeNoUpdate(hsTimer::GetSysSeconds()));
txt.DrawString(x, y, str.c_str());
txt.DrawString(x, y, str);
y += yOff;
}
layer = layer->GetOverLay();
@ -147,17 +147,17 @@ void plAnimDebugList::ShowReport()
if (!mod)
continue;
str = plString::Format(" %s", so->GetKeyName().c_str());
txt.DrawString(x, y, str.c_str());
str = plFormat(" {}", so->GetKeyName());
txt.DrawString(x, y, str);
y += yOff;
for (j = 0; j < mod->GetNumATCAnimations(); 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()->WorldToAnimTimeNoUpdate(hsTimer::GetSysSeconds()));
txt.DrawString(x, y, str.c_str());
txt.DrawString(x, y, str);
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 )
{
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 );
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 );
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 );
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 );
y += 12;
}

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

@ -280,7 +280,7 @@ bool pfConsole::MsgReceive( plMessage *msg )
plString prefix = plProduct::ShortName();
// 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::set<uint32_t> indices;
std::for_each(images.begin(), images.end(),
@ -298,7 +298,7 @@ bool pfConsole::MsgReceive( plMessage *msg )
}
// 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());
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
// errors in the parsing
plString str = plString::Format("Error parsing %s", cmd->GetString());
plString msg = plString::Format("%s:\n\nCommand: '%s'\n%s", fEngine->GetErrorMsg(), fEngine->GetLastErrorLine(),
plString str = plFormat("Error parsing {}", cmd->GetString());
plString msg = plFormat("{}:\n\nCommand: '{}'\n{}", fEngine->GetErrorMsg(), fEngine->GetLastErrorLine(),
#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")
{
char str[256];
plString foo = plString::Format("%s_", (char*)params[0]);
plString foo = plFormat("{}_", (char*)params[0]);
plKey key = FindObjectByNameAndType(foo, "plCameraModifier1", "", str, true);
PrintString(str);
@ -4204,7 +4204,7 @@ PF_CONSOLE_CMD( Access,
{
char str[256];
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);
PrintString(str);
if (!key)
@ -4229,7 +4229,7 @@ PF_CONSOLE_CMD( Access,
{
char str[256];
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);
PrintString(str);
if (!key)
@ -4250,7 +4250,7 @@ PF_CONSOLE_CMD( Access,
{
char str[256];
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);
PrintString(str);
if (!key)
@ -4405,7 +4405,7 @@ PF_CONSOLE_CMD( Access,
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,
@ -4422,7 +4422,7 @@ PF_CONSOLE_CMD( Access,
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,
@ -4444,8 +4444,7 @@ PF_CONSOLE_CMD( Access,
seq->SetUseSharedMesh(true);
seq->AddSharedMesh(item->fMeshes[plClothingItem::kLODHigh]);
PrintString(plString::Format("%s on item %s\n", seq->GetKey()->GetName().c_str(),
(char *)params[0]).c_str());
PrintString(plFormat("{} on item {}\n", seq->GetKey()->GetName(), (char *)params[0]).c_str());
}
#include "pfSurface/plFadeOpacityMod.h"
@ -6869,8 +6868,7 @@ PF_CONSOLE_CMD( Python,
plString args;
if (numParams > 1)
{
const char* tmp = params[1];
args = plString::Format("(%s,)", tmp);
args = plFormat("({},)", (char*)params[1]);
}
else
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);
if (pageInfo)
info += plString::Format("%s-%s ", pageInfo->GetAge().c_str(), pageInfo->GetPage().c_str());
info += plFormat("{}-{} ", pageInfo->GetAge(), pageInfo->GetPage());
}
}
break;
case plClientMsg::kLoadAgeKeys:
case plClientMsg::kReleaseAgeKeys:
info += plString::Format(" - Age: %s", clientMsg->GetAgeName().c_str());
info += plFormat(" - Age: {}", clientMsg->GetAgeName());
break;
}
return true;
@ -321,7 +321,7 @@ static bool DumpSpecificMsgInfo(plMessage* msg, plString& info)
GetType(kOnRequest);
GetType(kOnRemove);
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;
}

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

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

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

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

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

@ -97,7 +97,7 @@ class pfPopUpKeyGenerator
plKey CreateKey( hsKeyedObject *ko )
{
plString name = plString::Format( "%s-%d", fPrefix, fKeyCount++ );
plString name = plFormat("{}-{}", fPrefix, fKeyCount++);
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;
plString buff;
buff = plString::Format("%s_%d_ml", GetKey()->GetName().c_str(), uniqueSuffix);
buff = plFormat("{}_{}_ml", GetKey()->GetName(), uniqueSuffix);
layer = new plLayer;
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;
hsgResMgr::ResMgr()->NewKey(buff, movieLayer, GetKey()->GetUoid().GetLocation());
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.
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;
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.
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;
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")
file->IHandleTranslationTag(parentTag, newTag);
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)
@ -496,7 +496,7 @@ LocalizationXMLFile::set LocalizationDatabase::IMergeSetData(LocalizationXMLFile
firstSet[curElement->first] = curElement->second;
else // merge the element in
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;
@ -515,7 +515,7 @@ LocalizationXMLFile::age LocalizationDatabase::IMergeAgeData(LocalizationXMLFile
firstAge[curSet->first] = curSet->second;
else // merge the data in
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;
@ -919,7 +919,7 @@ void pfLocalizationDataMgr::IConvertSet(LocSetInfo *setInfo, const plString & cu
LocElementInfo elementInfo;
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;
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;
fileData << "<?xml version=\"1.0\" encoding=\"utf-8\"?>\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);
for (int curSet = 0; curSet < setNames.size(); curSet++)
{
setEmpty = true; // so far, this set is empty
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]);
for (int curElement = 0; curElement < elementNames.size(); curElement++)
{
setCode << plString::Format("\t\t\t<element name=\"%s\">\n", elementNames[curElement].c_str());
plString key = plString::Format("%s.%s.%s", ageName.c_str(), setNames[curSet].c_str(), elementNames[curElement].c_str());
setCode << "\t\t\t<element name=\"" << elementNames[curElement] << "\">\n";
plString key = plFormat("{}.{}.{}", ageName, setNames[curSet], elementNames[curElement]);
if (fLocalizedElements[key].find(languageName) != fLocalizedElements[key].end())
{
weWroteData = true;
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 << "</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> 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))
{
// age, set, and element exists
@ -1209,8 +1209,8 @@ void pfLocalizationDataMgr::WriteDatabaseToDisk(const plFileName & path)
{
for (int curLanguage = 0; curLanguage < languageNames.size(); curLanguage++)
{
plFileName locPath = plFileName::Join(path, plString::Format("%s%s.loc",
ageNames[curAge].c_str(), languageNames[curLanguage].c_str()));
plFileName locPath = plFileName::Join(path, plFormat("{}{}.loc",
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());
// returning nil means an error occurred
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 )
{
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());
return nil; // return nil cause we errored
}
@ -935,7 +935,7 @@ PyObject* cyMisc::GetDialogFromTagID(uint32_t tag)
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());
return nil; // return nil, cause we threw an error
}
@ -951,7 +951,7 @@ PyObject* cyMisc::GetDialogFromString(const char* name)
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());
return nil; // return nil, cause we threw an error
}
@ -2497,7 +2497,7 @@ plString cyMisc::GetCameraNumber(int number)
if (pCam && pCam->GetTarget())
{
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());
return ret;
}
@ -2508,7 +2508,7 @@ plString cyMisc::GetCameraNumber(int number)
void cyMisc::RebuildCameraStack(const plString& name, const char* ageName)
{
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());
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
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());
}
}
@ -2549,7 +2549,7 @@ void cyMisc::RebuildCameraStack(const plString& name, const char* ageName)
}
}
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());
}

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

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

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

@ -431,7 +431,7 @@ bool plPythonFileMod::ILoadPythonCode()
#ifndef PLASMA_EXTERNAL_RELEASE
// get code from file and execute in module
// 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())
{
char fromLoad[256];
@ -1002,7 +1002,8 @@ plString plPythonFileMod::IMakeModuleName(plSceneObject* sobj)
}
modulename[k] = '\0';
plString name = plString::FromUtf8(modulename);
plStringStream name;
name << modulename;
// check to see if we are attaching to a clone?
plKeyImp* pKeyImp = (plKeyImp*)(sKey);
@ -1012,7 +1013,7 @@ plString plPythonFileMod::IMakeModuleName(plSceneObject* sobj)
// add the cloneID to the end of the module name
// and set the fIAmAClone flag
uint32_t cloneID = pKeyImp->GetUoid().GetCloneID();
name += plString::Format("%d", cloneID);
name << cloneID;
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
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];
uint32_t readSize = fPackStream->Read(size, buf);
hsAssert(readSize <= size, plString::Format("Python PackFile %s: Incorrect amount of data, read %d instead of %d",
fileName.c_str(), readSize, size).c_str());
hsAssert(readSize <= size, plFormat("Python PackFile {}: Incorrect amount of data, read {} instead of {}",
fileName, readSize, size).c_str());
// let the python marshal make it back into a code object
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())
{
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());
PYTHON_RETURN_ERROR;
}

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

@ -190,9 +190,9 @@ plString pyAgeInfoStruct::GetDisplayName() const
{
int32_t seq = GetAgeSequenceNumber();
if (seq > 0)
return plString::Format("%s (%d) %s", user.c_str(), seq, instance.c_str());
return plFormat("{} ({}) {}", user, seq, instance);
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();
if (seq > 0)
return plString::Format("%s (%d) %s", user.c_str(), seq, instance.c_str());
return plFormat("{} ({}) {}", user, seq, instance);
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
plString name = plString::Format("PtImageFromDisk_%s", filename.AsString().c_str());
plString name = plFormat("PtImageFromDisk_{}", filename);
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
plString name = plString::Format("PtImageFromDisk_%s", filename.AsString().c_str());
plString name = plFormat("PtImageFromDisk_{}", filename);
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 )
{
plString name = plString::Format( "pyJournalBook-%d", fNextKeyID++ );
plString name = plFormat("pyJournalBook-{}", fNextKeyID++);
hsgResMgr::ResMgr()->NewKey( name, fBook, plLocation::kGlobalFixedLoc );
fBook->GetKey()->RefObject();

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

@ -293,8 +293,8 @@ PyObject* pySceneObject::GetLocalToWorld()
return pyMatrix44::New((hsMatrix44)ci->GetLocalToWorld());
else
{
plString errmsg = plString::Format("Sceneobject %s does not have a coordinate interface.",
obj->GetKeyName().c_str());
plString errmsg = plFormat("Sceneobject {} does not have a coordinate interface.",
obj->GetKeyName());
PyErr_SetString(PyExc_RuntimeError, errmsg.c_str());
return nil; // return nil to tell python we errored
}
@ -322,8 +322,8 @@ PyObject* pySceneObject::GetWorldToLocal()
return pyMatrix44::New((hsMatrix44)ci->GetWorldToLocal());
else
{
plString errmsg = plString::Format("Sceneobject %s does not have a coordinate interface.",
obj->GetKeyName().c_str());
plString errmsg = plFormat("Sceneobject {} does not have a coordinate interface.",
obj->GetKeyName());
PyErr_SetString(PyExc_RuntimeError, errmsg.c_str());
return nil; // return nil to tell python we errored
}
@ -351,8 +351,8 @@ PyObject* pySceneObject::GetLocalToParent()
return pyMatrix44::New((hsMatrix44)ci->GetLocalToParent());
else
{
plString errmsg = plString::Format("Sceneobject %s does not have a coordinate interface.",
obj->GetKeyName().c_str());
plString errmsg = plFormat("Sceneobject {} does not have a coordinate interface.",
obj->GetKeyName());
PyErr_SetString(PyExc_RuntimeError, errmsg.c_str());
return nil; // return nil to tell python we errored
}
@ -380,8 +380,8 @@ PyObject* pySceneObject::GetParentToLocal()
return pyMatrix44::New((hsMatrix44)ci->GetParentToLocal());
else
{
plString errmsg = plString::Format("Sceneobject %s does not have a coordinate interface.",
obj->GetKeyName().c_str());
plString errmsg = plFormat("Sceneobject {} does not have a coordinate interface.",
obj->GetKeyName());
PyErr_SetString(PyExc_RuntimeError, errmsg.c_str());
return nil; // return nil to tell python we errored
}
@ -425,8 +425,8 @@ PyObject* pySceneObject::GetWorldPosition()
return pyPoint3::New((hsPoint3)ci->GetWorldPos());
else
{
plString errmsg = plString::Format("Sceneobject %s does not have a coordinate interface.",
obj->GetKeyName().c_str());
plString errmsg = plFormat("Sceneobject {} does not have a coordinate interface.",
obj->GetKeyName());
PyErr_SetString(PyExc_RuntimeError, errmsg.c_str());
return nil; // return nil to tell python we errored
}
@ -454,8 +454,8 @@ PyObject* pySceneObject::GetViewVector()
return pyVector3::New(ci->GetLocalToWorld().GetAxis(hsMatrix44::kView));
else
{
plString errmsg = plString::Format("Sceneobject %s does not have a coordinate interface.",
obj->GetKeyName().c_str());
plString errmsg = plFormat("Sceneobject {} does not have a coordinate interface.",
obj->GetKeyName());
PyErr_SetString(PyExc_RuntimeError, errmsg.c_str());
return nil; // return nil to tell python we errored
}
@ -483,8 +483,8 @@ PyObject* pySceneObject::GetUpVector()
return pyVector3::New(ci->GetLocalToWorld().GetAxis(hsMatrix44::kUp));
else
{
plString errmsg = plString::Format("Sceneobject %s does not have a coordinate interface.",
obj->GetKeyName().c_str());
plString errmsg = plFormat("Sceneobject {} does not have a coordinate interface.",
obj->GetKeyName());
PyErr_SetString(PyExc_RuntimeError, errmsg.c_str());
return nil; // return nil to tell python we errored
}
@ -512,8 +512,8 @@ PyObject* pySceneObject::GetRightVector()
return pyVector3::New(ci->GetLocalToWorld().GetAxis(hsMatrix44::kRight));
else
{
plString errmsg = plString::Format("Sceneobject %s does not have a coordinate interface.",
obj->GetKeyName().c_str());
plString errmsg = plFormat("Sceneobject {} does not have a coordinate interface.",
obj->GetKeyName());
PyErr_SetString(PyExc_RuntimeError, errmsg.c_str());
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();
if (nc->GetPlayerName().CharAt(nameLen - 1) == 's' || nc->GetPlayerName().CharAt(nameLen - 1) == 'S')
{
title = plString::Format( "%s'", nc->GetPlayerName().c_str() );
desc = plString::Format( "%s' %s", nc->GetPlayerName().c_str(), link.GetAgeInfo()->GetAgeInstanceName().c_str() );
title = plFormat("{}'", nc->GetPlayerName());
desc = plFormat("{}' {}", nc->GetPlayerName(), link.GetAgeInfo()->GetAgeInstanceName());
}
else
{
title = plString::Format( "%s's", nc->GetPlayerName().c_str() );
desc = plString::Format( "%s's %s", nc->GetPlayerName().c_str(), link.GetAgeInfo()->GetAgeInstanceName().c_str() );
title = plFormat("{}'s", nc->GetPlayerName());
desc = plFormat("{}'s {}", nc->GetPlayerName(), link.GetAgeInfo()->GetAgeInstanceName());
}
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) {
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);

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

@ -112,7 +112,7 @@ bool plLayerMovie::ISetupBitmap()
memset(b->GetImage(), 0x10, b->GetHeight() * b->GetRowBytes() );
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 );
*fTexture = (plBitmap *)b;

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

@ -335,8 +335,9 @@ void plDispatch::IMsgDispatch()
if (plNetObjectDebuggerBase::GetInstance()->IsDebugObject(ko))
{
hsLogEntry(plNetObjectDebuggerBase::GetInstance()->LogMsg(
plString::Format("<RCV> object:%s, GameMessage %s st=%.3f rt=%.3f",
ko->GetKeyName().c_str(), msg->ClassName(), hsTimer::GetSysSeconds(), hsTimer::GetSeconds()).c_str()));
plFormat("<RCV> object:{}, GameMessage {} st={.3f} rt={.3f}",
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
hsAssert(false,
plString::Format("Request to Unregister wrong FixedKey, keyName=%s, inUoid=%s, myUoid=%s",
fpKey->GetName().c_str("?"), inUoid.StringIze().c_str(), myUoid.StringIze().c_str()).c_str());
plFormat("Request to Unregister wrong FixedKey, keyName={}, inUoid={}, myUoid={}",
fpKey->GetName(), inUoid, myUoid).c_str());
#endif
}
((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);
if (strlen){
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
@ -302,7 +302,7 @@ int plMsgStdStringHelper::PeekBig(std::string & stringref, hsStream* stream, co
stringref.resize(bufsz);
if (bufsz){
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
@ -357,7 +357,7 @@ int plMsgCStringHelper::Peek(char *& str, hsStream* stream, const uint32_t peekO
str[strlen] = '\0';
if (strlen) {
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)
{
case kInt :
return plString::Format("%d", fI);
return plFormat("{}", fI);
case kBool :
case kUInt :
return plString::Format("%u", fType==kBool?fB:fU);
return plFormat("{}", fB ? 1 : 0);
case kUInt:
return plFormat("{}", fU);
case kFloat :
case kDouble :
return plString::Format("%f", fType==kDouble?fD:fF);
return plFormat("{f}", fType==kDouble ? fD : fF);
case kChar :
return plString::Format("%c", fC);
return plFormat("{}", fC);
case kAny :
case kString :
return fS;

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

@ -63,7 +63,7 @@ plString GetTextAddr(uint32_t binAddr)
{
in_addr in;
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.

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

@ -118,9 +118,9 @@ bool plAgePage::SetFromString( const plString &stringIn )
plString plAgePage::GetAsString( void ) const
{
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;
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));
}
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) {
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);
}
plString status = plString::Format("%s / %s",
plFileSystem::ConvertFileSize(dl).c_str(),
plFileSystem::ConvertFileSize(total).c_str()
plString status = plFormat("%s / %s",
plFileSystem::ConvertFileSize(dl),
plFileSystem::ConvertFileSize(total)
);
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 )
{
plString keyName = plString::Format( "%s_%d", name, i );
plString keyName = plFormat("{}_{}", name, i);
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);
fLastUpdate = 0;
plString keyName = plString::Format("VoiceSound_%d", fCount);
plString keyName = plFormat("VoiceSound_{}", fCount);
fCount++;
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
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 );
fFailed = true;
return false;
@ -211,9 +211,10 @@ bool plWin32GroupedSound::LoadSound( bool is3D )
fDSoundBuffer = new plDSoundBuffer( bufferSize, header, is3D, IsPropertySet( kPropLooping ), true );
if( !fDSoundBuffer->IsValid() )
{
char str[256];
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());
IPrintDbgMessage( str, true );
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.",
GetFileName());
IPrintDbgMessage(str.c_str(), true);
fFailed = true;
delete fDSoundBuffer;
@ -228,14 +229,14 @@ bool plWin32GroupedSound::LoadSound( bool is3D )
IFillCurrentSound( 0 );
// Logging
plString str = plString::Format(" Grouped %s %s allocated (%d msec).", buffer->GetFileName().IsValid() ? "file" : "buffer",
buffer->GetFileName().IsValid() ? buffer->GetFileName().AsString().c_str() : buffer->GetKey()->GetUoid().GetObjectName().c_str(),
//fDSoundBuffer->IsHardwareAccelerated() ? "hardware" : "software",
//fDSoundBuffer->IsStaticVoice() ? "static" : "dynamic",
plString str = plFormat(" Grouped {} {} allocated ({} msec).", buffer->GetFileName().IsValid() ? "file" : "buffer",
buffer->GetFileName().IsValid() ? buffer->GetFileName() : buffer->GetKeyName(),
//fDSoundBuffer->IsHardwareAccelerated() ? "hardware" : "software",
//fDSoundBuffer->IsStaticVoice() ? "static" : "dynamic",
#ifdef PL_PROFILE_ENABLED
gProfileVarStaticSndShoveTime.GetValue() );
gProfileVarStaticSndShoveTime.GetValue());
#else
0 );
0);
#endif
IPrintDbgMessage( str.c_str() );
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 )
{
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 );
fFailed = true;
return false;
@ -143,9 +143,10 @@ bool plWin32StaticSound::LoadSound( bool is3D )
fDSoundBuffer = new plDSoundBuffer( bufferSize, header, is3D, IsPropertySet( kPropLooping ), tryStatic );
if( !fDSoundBuffer->IsValid() )
{
char str[256];
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());
IPrintDbgMessage( str, true );
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.",
GetFileName());
IPrintDbgMessage(str.c_str(), true);
fFailed = true;
delete fDSoundBuffer;

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

@ -195,7 +195,7 @@ plSoundBuffer::ELoadReturnVal plWin32StreamingSound::IPreLoadBuffer( bool playWh
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
@ -251,8 +251,8 @@ bool plWin32StreamingSound::LoadSound( bool is3D )
if( retVal == plSoundBuffer::kError )
{
plString str = plString::Format( "Unable to open streaming source %s",
fDataBufferKey->GetName().c_str() );
plString str = plFormat("Unable to open streaming source {}",
fDataBufferKey->GetName());
IPrintDbgMessage( str.c_str(), true );
fFailed = true;
return false;
@ -282,9 +282,9 @@ bool plWin32StreamingSound::LoadSound( bool is3D )
delete fDSoundBuffer;
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."
" Stereo files are not supported on 3D sounds. If the file is not stereo then please report this error.",
GetFileName().AsString().c_str());
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.",
GetFileName());
IPrintDbgMessage(str.c_str(), true);
fFailed = true;
return false;
@ -337,7 +337,7 @@ bool plWin32StreamingSound::LoadSound( bool is3D )
IRefreshEAXSettings( true );
// Debug info
plString dbg = plString::Format(" Streaming %s.", fSrcFilename.AsString().c_str());
plString dbg = plFormat(" Streaming {}.", fSrcFilename);
IPrintDbgMessage(dbg.c_str());
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 << " ";
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)
debugTxt.DrawString(x, y, str.GetString().c_str(), 0, 255, 0);
debugTxt.DrawString(x, y, str.GetString(), 0, 255, 0);
else if(fAnimInstance)
debugTxt.DrawString(x, y, str.GetString().c_str());
debugTxt.DrawString(x, y, str.GetString());
else
debugTxt.DrawString(x, y, str.GetString().c_str(), 255, 255, 0);
debugTxt.DrawString(x, y, str.GetString(), 255, 255, 0);
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)
{
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;
plSceneObject * SO = GetTarget(0);
@ -2664,9 +2664,8 @@ void plArmatureMod::DumpToDebugDisplay(int &x, int &y, int lineHeight, plDebugTe
hsMatrix44 l2w = SO->GetLocalToWorld();
hsPoint3 worldPos = l2w.GetTranslate();
const char *opaque = IsOpaque() ? "yes" : "no";
debugTxt.DrawString(x, y, plString::Format("position(world): %.2f, %.2f, %.2f Opaque: %3s",
worldPos.fX, worldPos.fY, worldPos.fZ, opaque));
debugTxt.DrawString(x, y, plFormat("position(world): {.2f}, {.2f}, {.2f} Opaque: {>3}",
worldPos.fX, worldPos.fY, worldPos.fZ, IsOpaque() ? "yes" : "no"));
y += lineHeight;
const char* frozen = "n.a.";
@ -2677,8 +2676,8 @@ void plArmatureMod::DumpToDebugDisplay(int &x, int &y, int lineHeight, plDebugTe
plKey world = nil;
if (fController)
world = fController->GetSubworld();
debugTxt.DrawString(x, y, plString::Format("In world: %s Frozen: %s",
world ? world->GetName().c_str() : "nil", frozen));
debugTxt.DrawString(x, y, plFormat("In world: {} Frozen: {}",
world ? world->GetName() : "nil", frozen));
y+= lineHeight;
plString details;
@ -2687,8 +2686,8 @@ void plArmatureMod::DumpToDebugDisplay(int &x, int &y, int lineHeight, plDebugTe
hsPoint3 physPos;
GetPositionAndRotationSim(&physPos, nil);
const hsVector3& vel = fController->GetLinearVelocity();
details = plString::Format("position(physical): <%.2f, %.2f, %.2f> velocity: <%5.2f, %5.2f, %5.2f>",
physPos.fX, physPos.fY, physPos.fZ, vel.fX, vel.fY, vel.fZ);
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);
}
else
{
@ -2747,11 +2746,11 @@ void plArmatureMod::DumpToDebugDisplay(int &x, int &y, int lineHeight, plDebugTe
debugTxt.DrawString(x, y, "Relevance Regions:");
y += lineHeight;
debugTxt.DrawString(x, y, plString::Format(" In: %s",
plRelevanceMgr::Instance()->GetRegionNames(fRegionsImIn).c_str()));
debugTxt.DrawString(x, y, plFormat(" In: {}",
plRelevanceMgr::Instance()->GetRegionNames(fRegionsImIn)));
y += lineHeight;
debugTxt.DrawString(x, y, plString::Format(" Care about: %s",
plRelevanceMgr::Instance()->GetRegionNames(fRegionsICareAbout).c_str()));
debugTxt.DrawString(x, y, plFormat(" Care about: %s",
plRelevanceMgr::Instance()->GetRegionNames(fRegionsICareAbout)));
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)
{
debugTxt.DrawString(x, y, plString::Format("Mouse Input Map: %s",
debugTxt.DrawString(x, y, plFormat("Mouse Input Map: {}",
plAvatarInputInterface::GetInstance()->GetInputMapName()));
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()));
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();
const char *onOff = strength > 0 ? "on" : "off";
char blendBar[11] = "||||||||||";
char blendBar[] = "||||||||||";
int bars = (int)min(10 * strength, 10);
blendBar[bars] = '\0';
plString details;
if (fAnim)
{
plString animName = fAnim->GetName();
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
details = plString::Format(" Behavior %2d %3s %s", fIndex, onOff, blendBar);
details = plFormat(" Behavior {2} {>3} {}", fIndex, onOff, blendBar);
debugTxt.DrawString(x, y, details);
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
plString mode = "Mode: Unknown";
if (fBehaviors[fCurMode])
mode = plString::Format("Mode: %s", ((CritterBehavior*)(fBehaviors[fCurMode]))->Name().c_str());
mode = plFormat("Mode: {}", ((CritterBehavior*)(fBehaviors[fCurMode]))->Name());
// draw it
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 *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));
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;
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;
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;
int i;

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

@ -267,11 +267,11 @@ void plClothingItem::Write(hsStream *s, hsResMgr *mgr)
plKey accessoryKey = nil;
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);
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);
}
}

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

@ -636,7 +636,7 @@ bool plAvOneShotTask::Start(plArmatureMod *avatar, plArmatureBrain *brain, doubl
}
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());
result = true;
}

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

@ -116,7 +116,7 @@ plCoopCoordinator::plCoopCoordinator(plKey host, plKey guest,
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());

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

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

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

@ -142,11 +142,17 @@ public:
plConfigInfo* GetConfigInfo() { return &fConfigInfo; }
plConfigInfo* GetConfigInfoLog() { return &fLog; }
bool GetValue(plString& retval, const plString & section, const plString & key, const plString & desc, const plString& defval = "");
bool GetValue(int& retval, const plString & section, const plString & key, const plString & desc, int defval);
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);
bool GetValue(double& retval, const plString & section, const plString & key, const plString & desc, double defval);
template <typename _Type>
bool GetValue(_Type& retval, const plString & section, const plString & key, const plString & desc, const _Type& defval = _Type())
{
plString descwdef = plFormat("{} # {}", defval, desc);
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);
#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)
{
plString descwdef = plString::Format("%s # %s","\"Multiple Entries\"",desc.c_str());
plString descwdef = plFormat("\"Multiple Entries\" # {}", desc);
fLog.AddValue(section,key,descwdef,kReplaceIfExists);
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)
{
return KeyHasValue(key, plString::Format("%d", value));
return KeyHasValue(key, plFormat("{}", 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)
@ -116,12 +116,12 @@ bool plKeysAndValues::AddValue(const plString & key, const plString & value, KAd
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)
{
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)
@ -139,12 +139,12 @@ bool plKeysAndValues::SetValue(const plString & key, const plString & 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)
{
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
@ -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
{
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
{
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
{
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)

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

@ -259,7 +259,7 @@ plDrawableSpans *plDrawableGenerator::GenerateDrawable( uint32_t vertCount, hsPo
}
static int nameIdx = 0;
plString buff = plString::Format( "GenDrawable_%d", nameIdx++ );
plString buff = plFormat("GenDrawable_{}", nameIdx++);
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);
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());
static plTweak<float> kSmooth(1.f);
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, 0, 0);
buff = plString::Format("%s_BumpMap", GetKey()->GetName().c_str());
buff = plFormat("{}_BumpMap", GetKey()->GetName());
hsgResMgr::ResMgr()->NewKey(buff, bumpMap, GetKey()->GetUoid().GetLocation());
bumpMap->SetFlags(bumpMap->GetFlags() | plMipmap::kBumpEnvMap | plMipmap::kForceNonCompressed);
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());
bumpLay->SetState(oldLay->GetState());
@ -1613,7 +1613,7 @@ hsGMaterial* plDynaDecalMgr::IConvertToEnvMap(hsGMaterial* mat, plBitmap* envMap
newMat->AddLayerViaNotify(bumpLay);
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());
envLay->SetBlendFlags(hsGMatState::kBlendMult);

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

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

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

@ -1616,7 +1616,7 @@ plMipmap* plWaveSet7::ICreateBiasNoiseMap()
plMipmap::kUncompressed,
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());
int i;
@ -1661,7 +1661,7 @@ plMipmap* plWaveSet7::ICreateBumpMipmapPS()
plMipmap::kUncompressed,
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()->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++ )
{
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());
layer->SetBlendFlags(hsGMatState::kBlendAdd);
@ -1748,7 +1748,7 @@ void plWaveSet7::IAddBumpBiasLayer(hsGMaterial* mat)
plLayer* plWaveSet7::ICreateBumpLayerPS(plMipmap* mipMap, hsGMaterial* bumpMat, int which)
{
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());
layer->SetBlendFlags(which ? hsGMatState::kBlendAdd : 0);
@ -1805,7 +1805,7 @@ hsGMaterial* plWaveSet7::ICreateBumpLayersPS()
// Create a blank material
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());
plMipmap* mipMap = ICreateBumpMipmapPS();
@ -1846,7 +1846,7 @@ void plWaveSet7::IAddBumpBiasShaders(plLayer* layer)
{
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());
vShader->SetIsPixelShader(false);
@ -1909,7 +1909,7 @@ void plWaveSet7::IAddBumpBiasShaders(plLayer* layer)
{
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());
pShader->SetIsPixelShader(true);
@ -1942,7 +1942,7 @@ void plWaveSet7::IAddBumpVertexShader(hsGMaterial* mat, int iShader, int iFirst,
int iShader = iBase / kBumpPerPass;
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());
vShader->SetIsPixelShader(false);
@ -1987,7 +1987,7 @@ void plWaveSet7::IAddBumpPixelShader(hsGMaterial* mat, int iShader, int iFirst,
int iShader = iBase / kBumpPerPass;
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());
pShader->SetIsPixelShader(true);
@ -2029,7 +2029,7 @@ void plWaveSet7::IAddBumpPixelShader(hsGMaterial* mat, int iShader, int iFirst,
plDrawableSpans* plWaveSet7::ICreateBumpDrawable()
{
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());
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);
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());
return rt;
@ -2156,7 +2156,7 @@ plLayer* plWaveSet7::ICreateTotalLayer(plBitmap* bm, hsGMaterial* mat, int which
if( !layer )
{
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());
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* 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());
layer->SetBlendFlags(which ? hsGMatState::kBlendAddSigned : 0);
@ -2290,7 +2290,7 @@ void plWaveSet7::IAddShoreVertexShader(hsGMaterial* mat)
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());
vShader->SetIsPixelShader(false);
@ -2343,7 +2343,7 @@ void plWaveSet7::IAddShorePixelShader(hsGMaterial* mat)
{
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());
pShader->SetIsPixelShader(true);
@ -2366,7 +2366,7 @@ void plWaveSet7::IAddFixedVertexShader(hsGMaterial* mat, const int numUVWs)
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());
vShader->SetIsPixelShader(false);
@ -2435,7 +2435,7 @@ void plWaveSet7::IAddFixedPixelShader(hsGMaterial* mat)
if( !fFixedPShader )
{
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());
pShader->SetIsPixelShader(true);
@ -2463,7 +2463,7 @@ void plWaveSet7::IAddRipVertexShader(hsGMaterial* mat, const plRipVSConsts& ripC
if( !fRipVShader )
{
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());
vShader->SetIsPixelShader(false);
@ -2548,7 +2548,7 @@ void plWaveSet7::IAddRipPixelShader(hsGMaterial* mat, const plRipVSConsts& ripCo
if( !fRipPShader )
{
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());
pShader->SetIsPixelShader(true);
@ -2607,7 +2607,7 @@ plShader* plWaveSet7::ICreateDecalVShader(DecalVType t)
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());
vShader->SetIsPixelShader(false);
@ -2735,7 +2735,7 @@ plShader* plWaveSet7::ICreateDecalPShader(DecalPType t)
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());
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* 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()->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;
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()->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* 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());
return lay;
@ -3714,7 +3714,7 @@ plMipmap* plWaveSet7::ICreateBlankTex(const char* name, int width, int height, u
plMipmap::kUncompressed,
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()->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] )
{
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());
vShader->SetIsPixelShader(false);
@ -4154,7 +4154,7 @@ void plWaveSet7::IAddGraphPShader(hsGMaterial* mat, int iPass)
if( !fGraphPShader[iPass] )
{
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());
pShader->SetIsPixelShader(true);
@ -4228,7 +4228,7 @@ void plWaveSet7::IMakeShoreLayer(hsGMaterial* mat, int which)
if( which >= mat->GetNumLayers() )
{
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());
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;
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 );
}

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

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

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

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

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

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

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

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

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

@ -393,10 +393,10 @@ int plNetClientMgr::ISendGameMessage(plMessage* msg)
{
#if 0
hsLogEntry(plNetObjectDebugger::GetInstance()->LogMsg(
plString::Format("<SND> object:%s, rcvr %s %s",
msg->GetSender().GetKeyName().c_str(),
msg->GetNumReceivers() ? msg->GetReceiver(0)->GetName().c_str() : "?",
netMsgWrap->AsStdString().c_str()).c_str()));
plFormat("<SND> object:{}, rcvr {} {}",
msg->GetSender().GetKeyName(),
msg->GetNumReceivers() ? msg->GetReceiver(0)->GetName() : "?",
netMsgWrap->AsStdString()).c_str()));
#endif
}
@ -434,7 +434,7 @@ int plNetClientMgr::SendMsg(plNetMessage* msg)
if (plNetMsgGameMessage::ConvertNoRef(msg))
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());
return ret;

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

@ -252,10 +252,10 @@ MSG_HANDLER_DEFN(plNetClientMsgHandler,plNetMsgSDLState)
{
plString err;
if (!sdRec)
err = plString::Format( "SDL descriptor %s missing, v=%d", descName.c_str(), ver);
err = plFormat("SDL descriptor {} missing, v={}", descName, ver);
else
err = plString::Format( "SDL descriptor %s, version mismatch, server v=%d, client v=%d",
descName.c_str(), ver, sdRec->GetDescriptor()->GetVersion());
err = plFormat("SDL descriptor {}, version mismatch, server v={}, client v={}",
descName, ver, sdRec->GetDescriptor()->GetVersion());
hsAssert(false, 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
{
return plString::Format( "t:%s,n:%s,c:%s",
fTitle.c_str("(nil)"),
fSpawnPt.c_str("(nil)"),
fCameraStack.c_str("(nil)") );
return plFormat("t:{},n:{},c:{}", fTitle, fSpawnPt, fCameraStack);
}

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

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

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

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

@ -215,29 +215,30 @@ void plPhysicalSDLModifier::ILogState(const plStateDataRecord* state, bool useDi
plPhysical* phys = IGetPhysical();
plString log = plString::Format("%s: %s", phys->GetKeyName().c_str(), prefix);
plStringStream log;
log << phys->GetKeyName() << ": " << prefix;
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
log += " Pos=None";
log << " Pos=None";
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
log += " LinV=None";
log << " LinV=None";
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
log += " AngV=None";
log << " AngV=None";
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
log += " Rot=None";
log << " Rot=None";
IGetLog()->AddLine(log.c_str(), color);
IGetLog()->AddLine(log.GetString().c_str(), color);
}
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 "plPipeline/hsG3DDeviceSelector.h"
#include "hsGDirect3D.h"
#include "plFormat.h"
//// 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->GetDriverDesc().c_str(),
devRec->GetDriverName().c_str(),
devRec->GetDriverVersion().c_str(),
devRec->GetDeviceDesc().c_str());
devRec->GetDriverDesc(),
devRec->GetDriverName(),
devRec->GetDriverVersion(),
devRec->GetDeviceDesc());
DWORD enumFlags = 0;
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);
static int idx=0;
plString buff = plString::Format("tRT%d", idx++);
plString buff = plFormat("tRT{}", idx++);
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;
// 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);
mipMap->Ref();

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

@ -160,7 +160,7 @@ void plPlate::SetTexture(plBitmap *texture)
plString keyName;
material = new hsGMaterial();
keyName = plString::Format( "PlateBlank#%d", fMagicUniqueKeyInt++ );
keyName = plFormat("PlateBlank#{}", fMagicUniqueKeyInt++);
hsgResMgr::ResMgr()->NewKey( keyName, material, plLocation::kGlobalFixedLoc );
layer = material->MakeBaseLayer();
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
fMipmap = new plMipmap( width, height, withAlpha ? plMipmap::kARGB32Config : plMipmap::kRGB32Config, 1 );
memset( fMipmap->GetImage(), 0xff, height * fMipmap->GetRowBytes() );
keyName = plString::Format( "PlateBitmap#%d", fMagicUniqueKeyInt++ );
keyName = plFormat("PlateBitmap#{}", fMagicUniqueKeyInt++);
hsgResMgr::ResMgr()->NewKey( keyName, fMipmap, plLocation::kGlobalFixedLoc );
fMipmap->SetFlags( fMipmap->GetFlags() | plMipmap::kDontThrowAwayImage );
}
/// NOW create a layer wrapper and a material for that layer
material = new hsGMaterial();
keyName = plString::Format( "PlateBlank#%d", fMagicUniqueKeyInt++ );
keyName = plFormat("PlateBlank#{}", fMagicUniqueKeyInt++);
hsgResMgr::ResMgr()->NewKey( keyName, material, plLocation::kGlobalFixedLoc );
layer = material->MakeBaseLayer();
layer->SetShadeFlags( layer->GetShadeFlags() | hsGMatState::kShadeNoShade | hsGMatState::kShadeWhite | hsGMatState::kShadeReallyNoFog );
@ -245,7 +245,7 @@ void plPlate::CreateFromResource(const plString& resName)
plMipmap* resTexture = new plMipmap;
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);
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;
#define LOADING_RES "xLoading_Linking.%02d.png"
#define LOADING_RES_COUNT 18
plString plProgressMgr::fImageRotation[LOADING_RES_COUNT];
@ -83,7 +82,7 @@ plProgressMgr::plProgressMgr()
// Fill array with pre-computed loading frame IDs
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()

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

@ -368,7 +368,7 @@ class plPageFinder : public plRegistryPageIterator
}
// 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;
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
// of age_page.extension
fPath = plFileName::Join(dataPath, plString::Format("%s_District_%s.prp",
fPageInfo.GetAge().c_str(), fPageInfo.GetPage().c_str()));
fPath = plFileName::Join(dataPath, plFormat("{}_District_{}.prp",
fPageInfo.GetAge(), fPageInfo.GetPage()));
}
plRegistryPageNode::~plRegistryPageNode()
@ -152,8 +152,8 @@ void plRegistryPageNode::LoadKeys()
hsStream* stream = OpenStream();
if (!stream)
{
hsAssert(0, plString::Format("plRegistryPageNode::LoadKeysFromSource - bad stream %s,%s",
GetPageInfo().GetAge().c_str(), GetPageInfo().GetPage().c_str()).c_str());
hsAssert(0, plFormat("plRegistryPageNode::LoadKeysFromSource - bad stream {},{}",
GetPageInfo().GetAge(), GetPageInfo().GetPage()).c_str());
return;
}
@ -331,7 +331,7 @@ void plRegistryPageNode::AddKey(plKeyImp* key)
// Attempt recovery
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)
{
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()));
plString msg = plString::Format("Data Problem: Age:%s Page:%s Error:%s",
pageNode->GetPageInfo().GetAge().c_str(), pageNode->GetPageInfo().GetPage().c_str(), condStr.c_str());
plString msg = plFormat("Data Problem: Age:{} Page:{} Error:{}",
pageNode->GetPageInfo().GetAge(), pageNode->GetPageInfo().GetPage(), condStr);
hsMessageBox(msg.c_str(), "Error", hsMessageBoxNormal, hsMessageBoxIconError);
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"))
{
// read desc version
hsAssert(curDesc, plString::Format("Syntax problem with .sdl file, fileName=%s",
fileName.AsString().c_str()).c_str());
hsAssert(curDesc, plFormat("Syntax problem with .sdl file, fileName={}", fileName).c_str());
if (stream->GetToken(token, kTokenLen))
{
int v=atoi(token);
@ -119,15 +118,13 @@ bool plSDLParser::IParseStateDesc(const plFileName& fileName, hsStream* stream,
}
else
{
hsAssert(false, plString::Format("Error parsing state desc, missing VERSION, fileName=%s",
fileName.AsString().c_str()).c_str());
hsAssert(false, plFormat("Error parsing state desc, missing VERSION, fileName={}", fileName).c_str());
ok = false;
}
}
else
{
hsAssert(false, plString::Format("Error parsing state desc, fileName=%s",
fileName.AsString().c_str()).c_str());
hsAssert(false, plFormat("Error parsing state desc, fileName={}", fileName).c_str());
ok = false;
}
@ -136,8 +133,8 @@ bool plSDLParser::IParseStateDesc(const plFileName& fileName, hsStream* stream,
ok = ( plSDLMgr::GetInstance()->FindDescriptor(curDesc->GetName(), curDesc->GetVersion())==nil );
if ( !ok )
{
plString err = plString::Format("Found duplicate SDL descriptor for %s version %d.\nFailed to parse file: %s",
curDesc->GetName().c_str(), curDesc->GetVersion(), fileName.AsString().c_str());
plString err = plFormat("Found duplicate SDL descriptor for {} version {}.\nFailed to parse file: {}",
curDesc->GetName(), curDesc->GetVersion(), fileName);
plNetApp::StaticErrorMsg( 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[],
plStateDescriptor*& curDesc, plVarDescriptor*& curVar) const
{
hsAssert(curDesc, plString::Format("Syntax problem with .sdl file, fileName=%s",
fileName.AsString().c_str()).c_str());
hsAssert(curDesc, plFormat("Syntax problem with .sdl file, fileName={}", fileName).c_str());
if ( !curDesc )
return false;
@ -183,8 +179,8 @@ bool plSDLParser::IParseVarDesc(const plFileName& fileName, hsStream* stream, ch
// nested sdls
char* sdlName = token+1;
plStateDescriptor* stateDesc = plSDLMgr::GetInstance()->FindDescriptor(sdlName, plSDL::kLatestVersion);
hsAssert(stateDesc, plString::Format("can't find nested state desc reference %s, fileName=%s",
sdlName, fileName.AsString().c_str()).c_str());
hsAssert(stateDesc, plFormat("can't find nested state desc reference {}, fileName={}",
sdlName, fileName).c_str());
curVar = new plSDVarDescriptor(stateDesc);
}
else
@ -192,21 +188,20 @@ bool plSDLParser::IParseVarDesc(const plFileName& fileName, hsStream* stream, ch
curDesc->AddVar(curVar);
bool ok=curVar->SetType(token);
hsAssert(ok, plString::Format("Variable 'type' syntax problem with .sdl file, type=%s, fileName=%s",
token, fileName.AsString().c_str()).c_str());
dbgStr = plString::Format("\tVAR Type=%s ", token);
hsAssert(ok, plFormat("Variable 'type' syntax problem with .sdl file, type={}, fileName={}",
token, fileName).c_str());
dbgStr = plFormat("\tVAR Type={} ", token);
//
// NAME (foo[1])
//
if (stream->GetToken(token, kTokenLen))
{
hsAssert(strstr(token, "[") && strstr(token, "]"), plString::Format("invalid var syntax, missing [x], fileName=%s",
fileName.AsString().c_str()).c_str());
hsAssert(strstr(token, "[") != nullptr && strstr(token, "]") != nullptr,
plFormat("invalid var syntax, missing [x], fileName={}", fileName).c_str());
char* ptr = strtok( token, seps ); // skip [
hsAssert(curVar, plString::Format("Missing current var. Syntax problem with .sdl file, fileName=%s",
fileName.AsString().c_str()).c_str());
hsAssert(curVar, plFormat("Missing current var. Syntax problem with .sdl file, fileName={}", fileName).c_str());
curVar->SetName(token);
//
// COUNT
@ -216,7 +211,7 @@ bool plSDLParser::IParseVarDesc(const plFileName& fileName, hsStream* stream, ch
curVar->SetCount(cnt);
if (cnt==0)
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"))
{
hsAssert(curVar, plString::Format("Syntax problem with .sdl file, fileName=%s",
fileName.AsString().c_str()).c_str());
hsAssert(curVar, plFormat("Syntax problem with .sdl file, fileName={}", fileName).c_str());
// read state var type
plString defaultStr;
@ -254,8 +248,7 @@ bool plSDLParser::IParseVarDesc(const plFileName& fileName, hsStream* stream, ch
else
if (!strcmp(token, "DISPLAYOPTION"))
{
hsAssert(curVar, plString::Format("Syntax problem with .sdl file, fileName=%s",
fileName.AsString().c_str()).c_str());
hsAssert(curVar, plFormat("Syntax problem with .sdl file, fileName={}", fileName).c_str());
dbgStr += plString(" ") + token;
bool read=stream->GetToken(token, kTokenLen);
@ -272,15 +265,13 @@ bool plSDLParser::IParseVarDesc(const plFileName& fileName, hsStream* stream, ch
}
else
{
hsAssert(false, plString::Format("missing displayOption string, fileName=%s",
fileName.AsString().c_str()).c_str());
hsAssert(false, plFormat("missing displayOption string, fileName={}", fileName).c_str());
}
}
else
if (!strcmp(token, "DEFAULTOPTION"))
{
hsAssert(curVar, plString::Format("Syntax problem with .sdl file, fileName=%s",
fileName.AsString().c_str()).c_str());
hsAssert(curVar, plFormat("Syntax problem with .sdl file, fileName={}", fileName).c_str());
dbgStr += plString(" ") + token;
bool read=stream->GetToken(token, kTokenLen);
@ -292,8 +283,7 @@ bool plSDLParser::IParseVarDesc(const plFileName& fileName, hsStream* stream, ch
}
else
{
hsAssert(false, plString::Format("missing defaultOption string, fileName=%s",
fileName.AsString().c_str()).c_str());
hsAssert(false, plFormat("missing defaultOption string, fileName={}", fileName).c_str());
}
}
@ -301,16 +291,14 @@ bool plSDLParser::IParseVarDesc(const plFileName& fileName, hsStream* stream, ch
else
if (!strcmp(token, "INTERNAL"))
{
hsAssert(curVar, plString::Format("Syntax problem with .sdl file, fileName=%s",
fileName.AsString().c_str()).c_str());
hsAssert(curVar, plFormat("Syntax problem with .sdl file, fileName={}", fileName).c_str());
curVar->SetInternal(true);
dbgStr += plString(" ") + token;
}
else
if (!strcmp(token, "PHASED"))
{
hsAssert(curVar, plString::Format("Syntax problem with .sdl file, fileName=%s",
fileName.AsString().c_str()).c_str());
hsAssert(curVar, plFormat("Syntax problem with .sdl file, fileName={}", fileName).c_str());
curVar->SetAlwaysNew(true);
dbgStr += plString(" ") + token;
}

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

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

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

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

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

@ -216,9 +216,9 @@ void plAutoProfileImp::INextProfile()
plMipmap mipmap;
if (plClient::GetInstance()->GetPipeline()->CaptureScreen(&mipmap))
{
plString fileName = plString::Format("%s\\%s_%s.jpg",
plProfileManagerFull::Instance().GetProfilePath().AsString().c_str(),
ageName, fLastSpawnPointName.c_str());
plString fileName = plFormat("{}\\{}_{}.jpg",
plProfileManagerFull::Instance().GetProfilePath(),
ageName, fLastSpawnPointName);
plJPEG::Instance().SetWriteQuality(100);
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);
profilePath = plFileName::Join(plFileSystem::GetUserDataPath(), "Profile",
plString::Format("%02d-%02d-%04d_%02d-%02d",
curTime.GetMonth(), curTime.GetDay(),
curTime.GetYear(), curTime.GetHour(),
curTime.GetMinute()));
plFormat("{_02}-{_02}-{_04}_{_02}-{_02}",
curTime.GetMonth(), curTime.GetDay(),
curTime.GetYear(), curTime.GetHour(),
curTime.GetMinute()));
plFileSystem::CreateDir(profilePath, true);
}

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

@ -330,15 +330,15 @@ bool plStatusLog::IReOpen( void )
plFileName fileNoExt;
plString 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))
{
plFileName work, work2;
work = plString::Format("%s.3.%s", fileNoExt.AsString().c_str(), ext.c_str());
work = plFormat("{}.3.{}", fileNoExt, ext);
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);
work = plString::Format("%s.1.%s", fileNoExt.AsString().c_str(), ext.c_str());
work = plFormat("{}.1.{}", fileNoExt, ext);
plFileSystem::Move(work, work2);
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
#ifndef PLASMA_EXTERNAL_RELEASE
plString str = plString::Format( "%.*s\n", count, line );
OutputDebugString( str.c_str() );
OutputDebugString(out_str.c_str());
#endif
#else
fprintf( stderr, "%.*s\n", count, line );
fputs(str.c_str(), str);
#endif
}
if ( fFlags & kStdout )
if (fFlags & kStdout)
{
fprintf( stdout, "%.*s\n", count, line );
fputs(out_str.c_str(), stdout);
}
return ret;

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

@ -134,7 +134,7 @@ plLayer* hsGMaterial::MakeBaseLayer()
plString buff;
if( !GetKeyName().IsNull() )
buff = plString::Format("%s_Layer", GetKeyName().c_str());
buff = plFormat("{}_Layer", GetKeyName());
else
buff = "Layer";
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)
{
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());
vShader->SetIsPixelShader(false);
vShader->SetInputFormat(1);
@ -249,7 +249,7 @@ void plGrassShaderMod::ISetupShaders()
if (!fPShader)
{
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());
pShader->SetIsPixelShader(true);
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 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

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 "hsThread.h"
#include "plTweak.h"
#include "plFormat.h"
// Windows
#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]);
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();
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() )
index = fIndices[ baseNode ];
keyName = plString::Format( "%s_MergedSound", GetINode()->GetName() );
keyName = plFormat("{}_MergedSound", GetINode()->GetName());
plKey buffKey = baseNode->FindPageKey( plSoundBuffer::Index(), keyName );
if( buffKey != nil )
@ -2485,7 +2485,7 @@ bool plBackgroundMusicComponent::Convert(plMaxNode *node, plErrorMsg *pErrMsg)
if( srcBuffer == nil )
return false;
plString keyName = plString::Format( "%s_Win32BgndSnd", GetINode()->GetName() );
plString keyName = plFormat("{}_Win32BgndSnd", GetINode()->GetName());
plWin32Sound *sound = nil;
if( srcBuffer->GetDataLengthInSecs() > 4.f )
@ -2643,7 +2643,7 @@ bool plGUISoundComponent::Convert(plMaxNode *node, plErrorMsg *pErrMsg)
return false;
}
plString keyName = plString::Format( "%s_Win32GUISound", GetINode()->GetName() );
plString keyName = plFormat("{}_Win32GUISound", GetINode()->GetName());
plWin32StaticSound *sound = new plWin32StaticSound;
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
base->SetLayoutName("BasicHuman");
keyName = plString::Format("%s_ClothingBase", node->GetName());
keyName = plFormat("{}_ClothingBase", node->GetName());
hsgResMgr::ResMgr()->NewKey(keyName, base, node->GetLocation());
plClothingOutfit *outfit = new plClothingOutfit();
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());
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==*/
#include "HeadSpin.h"
#include "plFormat.h"
#include "plComponentBase.h"
#include "plComponentReg.h"
@ -309,7 +310,7 @@ plString plComponentBase::IGetUniqueName(plMaxNodeBase* target)
hsAssert(thisTargIdx != -1, "Bad target for IGetUniqueName");
if (numUsedTargs > 1)
return plString::Format("%s_%d", GetINode()->GetName(), thisTargIdx);
return plFormat("{}_{}", GetINode()->GetName(), thisTargIdx);
else
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
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());
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 );
return;
}
plFileName path = plFileName::Join(ageFolder, plString::Format("%s.age", curAge));
plFileName path = plFileName::Join(ageFolder, plFormat("{}.age", curAge));
IVerifyLatestAgeAsset( curAge, path, errMsg );
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++)
{
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))
{
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());
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))
{
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());
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";
// 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);
hsgResMgr::ResMgr()->AddViaNotify(detectorKey, new plObjRefMsg(obj->GetKey(), plRefMsg::kOnCreate, -1, plObjRefMsg::kModifier), plRefFlags::kActiveRef);
plVolumeSensorConditionalObject* boxCond=nil;
@ -419,7 +419,7 @@ void plVolumeGadgetComponent::ICreateConditions(plMaxNode* node, plErrorMsg* err
{
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);
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
// room as referencer) with defRoom.
plString tempName = plString::Format("%s..%s", defRoom, nodeName);
plString tempName = plFormat("{}..{}", defRoom, nodeName);
return hsStrcpy(mangName, tempName.c_str());
}
@ -278,9 +278,9 @@ char *hsConverterUtils::MangleReference(char *mangName, INode *node, const char*
)
tempName = nodeName;
else if (roomName && *roomName)
tempName = plString::Format("%s..%s", roomName, nodeName);
tempName = plFormat("{}..{}", roomName, nodeName);
else
tempName = plString::Format("%s..%s", defRoom, nodeName);
tempName = plFormat("{}..{}", defRoom, nodeName);
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