Browse Source

Convert many of the now-deprecated plString::Format calls to plFormat

Michael Hansen 11 years ago
parent
commit
1debf8180b
  1. 4
      Sources/Plasma/Apps/plClient/plClient.cpp
  2. 2
      Sources/Plasma/Apps/plPageInfo/plPageInfo.cpp
  3. 2
      Sources/Plasma/FeatureLib/pfAnimation/plAnimDebugList.cpp
  4. 8
      Sources/Plasma/FeatureLib/pfConsole/pfConsole.cpp
  5. 18
      Sources/Plasma/FeatureLib/pfConsole/pfConsoleCommands.cpp
  6. 6
      Sources/Plasma/FeatureLib/pfConsole/pfDispatchLog.cpp
  7. 17
      Sources/Plasma/FeatureLib/pfConsoleCore/pfConsoleEngine.cpp
  8. 2
      Sources/Plasma/FeatureLib/pfGameGUIMgr/pfGUICtrlGenerator.cpp
  9. 2
      Sources/Plasma/FeatureLib/pfGameGUIMgr/pfGUIListElement.cpp
  10. 2
      Sources/Plasma/FeatureLib/pfGameGUIMgr/pfGUIPopUpMenu.cpp
  11. 8
      Sources/Plasma/FeatureLib/pfJournalBook/pfJournalBook.cpp
  12. 26
      Sources/Plasma/FeatureLib/pfLocalizationMgr/pfLocalizationDataMgr.cpp
  13. 2
      Sources/Plasma/FeatureLib/pfPython/cyAvatar.cpp
  14. 14
      Sources/Plasma/FeatureLib/pfPython/cyMisc.cpp
  15. 8
      Sources/Plasma/FeatureLib/pfPython/cyPhysics.cpp
  16. 2
      Sources/Plasma/FeatureLib/pfPython/cyPythonInterface.cpp
  17. 11
      Sources/Plasma/FeatureLib/pfPython/plPythonFileMod.cpp
  18. 4
      Sources/Plasma/FeatureLib/pfPython/plPythonPack.cpp
  19. 2
      Sources/Plasma/FeatureLib/pfPython/plPythonSDLModifier.cpp
  20. 8
      Sources/Plasma/FeatureLib/pfPython/pyAgeInfoStruct.cpp
  21. 4
      Sources/Plasma/FeatureLib/pfPython/pyImage.cpp
  22. 2
      Sources/Plasma/FeatureLib/pfPython/pyJournalBook.cpp
  23. 32
      Sources/Plasma/FeatureLib/pfPython/pySceneObject.cpp
  24. 8
      Sources/Plasma/FeatureLib/pfPython/pyVault.cpp
  25. 2
      Sources/Plasma/FeatureLib/pfPython/pyVaultImageNode.cpp
  26. 2
      Sources/Plasma/FeatureLib/pfSurface/plLayerMovie.cpp
  27. 6
      Sources/Plasma/NucleusLib/pnMessage/plMessage.cpp
  28. 7
      Sources/Plasma/NucleusLib/pnNetCommon/plGenericVar.cpp
  29. 2
      Sources/Plasma/NucleusLib/pnNetCommon/pnNetCommon.cpp
  30. 4
      Sources/Plasma/PubUtilLib/plAgeDescription/plAgeDescription.cpp
  31. 10
      Sources/Plasma/PubUtilLib/plAgeLoader/plResPatcher.cpp
  32. 2
      Sources/Plasma/PubUtilLib/plAudible/plWinAudible.cpp
  33. 2
      Sources/Plasma/PubUtilLib/plAudio/plVoiceChat.cpp
  34. 13
      Sources/Plasma/PubUtilLib/plAudio/plWin32GroupedSound.cpp
  35. 9
      Sources/Plasma/PubUtilLib/plAudio/plWin32StaticSound.cpp
  36. 12
      Sources/Plasma/PubUtilLib/plAudio/plWin32StreamingSound.cpp
  37. 10
      Sources/Plasma/PubUtilLib/plAvatar/plAnimStage.cpp
  38. 16
      Sources/Plasma/PubUtilLib/plAvatar/plArmatureMod.cpp
  39. 2
      Sources/Plasma/PubUtilLib/plAvatar/plAvBehaviors.cpp
  40. 2
      Sources/Plasma/PubUtilLib/plAvatar/plAvBrainCritter.cpp
  41. 4
      Sources/Plasma/PubUtilLib/plAvatar/plAvatarClothing.cpp
  42. 2
      Sources/Plasma/PubUtilLib/plAvatar/plAvatarTasks.cpp
  43. 2
      Sources/Plasma/PubUtilLib/plAvatar/plCoopCoordinator.cpp
  44. 2
      Sources/Plasma/PubUtilLib/plAvatar/plSittingModifier.cpp
  45. 2
      Sources/Plasma/PubUtilLib/plContainer/plConfigInfoLogging.cpp
  46. 12
      Sources/Plasma/PubUtilLib/plContainer/plKeysAndValues.cpp
  47. 2
      Sources/Plasma/PubUtilLib/plDrawable/plDrawableGenerator.cpp
  48. 8
      Sources/Plasma/PubUtilLib/plDrawable/plDynaDecalMgr.cpp
  49. 10
      Sources/Plasma/PubUtilLib/plDrawable/plProxyGen.cpp
  50. 56
      Sources/Plasma/PubUtilLib/plDrawable/plWaveSet7.cpp
  51. 2
      Sources/Plasma/PubUtilLib/plGImage/plFontCache.cpp
  52. 13
      Sources/Plasma/PubUtilLib/plInputCore/plSceneInputInterface.cpp
  53. 4
      Sources/Plasma/PubUtilLib/plModifier/plSDLModifier.cpp
  54. 2
      Sources/Plasma/PubUtilLib/plNetClient/plNetCliAgeJoiner.cpp
  55. 2
      Sources/Plasma/PubUtilLib/plNetClient/plNetClientMgrSend.cpp
  56. 6
      Sources/Plasma/PubUtilLib/plNetClient/plNetClientMsgHandler.cpp
  57. 2
      Sources/Plasma/PubUtilLib/plNetMessage/plNetMessage.cpp
  58. 6
      Sources/Plasma/PubUtilLib/plPhysX/plPXPhysicalControllerCore.cpp
  59. 2
      Sources/Plasma/PubUtilLib/plPhysical/plPhysicalSDLModifier.cpp
  60. 11
      Sources/Plasma/PubUtilLib/plPipeline/DX/plDXEnumerate.cpp
  61. 4
      Sources/Plasma/PubUtilLib/plPipeline/plCaptureRender.cpp
  62. 8
      Sources/Plasma/PubUtilLib/plPipeline/plPlates.cpp
  63. 3
      Sources/Plasma/PubUtilLib/plProgressMgr/plProgressMgr.cpp
  64. 2
      Sources/Plasma/PubUtilLib/plResMgr/plKeyFinder.cpp
  65. 10
      Sources/Plasma/PubUtilLib/plResMgr/plRegistryNode.cpp
  66. 4
      Sources/Plasma/PubUtilLib/plResMgr/plResManager.cpp
  67. 56
      Sources/Plasma/PubUtilLib/plSDL/plSDLParser.cpp
  68. 30
      Sources/Plasma/PubUtilLib/plSDL/plStateDataRecord.cpp
  69. 64
      Sources/Plasma/PubUtilLib/plSDL/plStateVariable.cpp
  70. 2
      Sources/Plasma/PubUtilLib/plSDL/plVarDescriptor.cpp
  71. 6
      Sources/Plasma/PubUtilLib/plStatGather/plAutoProfile.cpp
  72. 2
      Sources/Plasma/PubUtilLib/plStatGather/plProfileManagerFull.cpp
  73. 8
      Sources/Plasma/PubUtilLib/plStatusLog/plStatusLog.cpp
  74. 2
      Sources/Plasma/PubUtilLib/plSurface/hsGMaterial.cpp
  75. 4
      Sources/Plasma/PubUtilLib/plSurface/plGrassShaderMod.cpp
  76. 2
      Sources/Plasma/PubUtilLib/plVault/plDniCoordinateInfo.cpp
  77. 2
      Sources/Tools/MaxComponent/plAnimComponent.cpp
  78. 6
      Sources/Tools/MaxComponent/plAudioComponents.cpp
  79. 4
      Sources/Tools/MaxComponent/plAvatarComponent.cpp
  80. 3
      Sources/Tools/MaxComponent/plComponentBase.cpp
  81. 2
      Sources/Tools/MaxComponent/plInventoryObjComponent.cpp
  82. 2
      Sources/Tools/MaxComponent/plMiscComponents.cpp
  83. 2
      Sources/Tools/MaxComponent/plMultistageBehComponent.cpp
  84. 8
      Sources/Tools/MaxComponent/plVolumeGadgetComponent.cpp
  85. 6
      Sources/Tools/MaxConvert/hsConverterUtils.cpp
  86. 44
      Sources/Tools/MaxConvert/hsMaterialConverter.cpp
  87. 4
      Sources/Tools/MaxConvert/plBitmapCreator.cpp
  88. 2
      Sources/Tools/MaxConvert/plClusterUtil.cpp
  89. 14
      Sources/Tools/MaxConvert/plLayerConverter.cpp
  90. 10
      Sources/Tools/MaxConvert/plLightMapGen.cpp
  91. 2
      Sources/Tools/MaxConvert/plMeshConverter.cpp
  92. 10
      Sources/Tools/MaxMain/plMaxNode.cpp
  93. 2
      Sources/Tools/MaxMain/plPluginResManager.cpp
  94. 2
      Sources/Tools/MaxPlasmaMtls/Layers/plPlasmaMAXLayer.cpp
  95. 2
      Sources/Tools/plFontConverter/plFontConverter.cpp
  96. 4
      Sources/Tools/plLocalizationEditor/plAddDlgs.h
  97. 10
      Sources/Tools/plLocalizationEditor/plEditDlg.cpp

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

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

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

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

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

@ -147,7 +147,7 @@ void plAnimDebugList::ShowReport()
if (!mod) if (!mod)
continue; continue;
str = plString::Format(" %s", so->GetKeyName().c_str()); str = plFormat(" {}", so->GetKeyName());
txt.DrawString(x, y, str.c_str()); txt.DrawString(x, y, str.c_str());
y += yOff; y += yOff;

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

@ -2654,7 +2654,7 @@ int plArmatureMod::RefreshDebugDisplay()
void plArmatureMod::DumpToDebugDisplay(int &x, int &y, int lineHeight, plDebugText &debugTxt) void plArmatureMod::DumpToDebugDisplay(int &x, int &y, int lineHeight, plDebugText &debugTxt)
{ {
debugTxt.DrawString(x, y, plString::Format("Armature <%s>:", fRootName.c_str()), 255, 128, 128); debugTxt.DrawString(x, y, plFormat("Armature <{}>:", fRootName), 255, 128, 128);
y += lineHeight; y += lineHeight;
plSceneObject * SO = GetTarget(0); plSceneObject * SO = GetTarget(0);
@ -2677,8 +2677,8 @@ void plArmatureMod::DumpToDebugDisplay(int &x, int &y, int lineHeight, plDebugTe
plKey world = nil; plKey world = nil;
if (fController) if (fController)
world = fController->GetSubworld(); world = fController->GetSubworld();
debugTxt.DrawString(x, y, plString::Format("In world: %s Frozen: %s", debugTxt.DrawString(x, y, plFormat("In world: {} Frozen: {}",
world ? world->GetName().c_str() : "nil", frozen)); world ? world->GetName() : "nil", frozen));
y+= lineHeight; y+= lineHeight;
plString details; plString details;
@ -2747,11 +2747,11 @@ void plArmatureMod::DumpToDebugDisplay(int &x, int &y, int lineHeight, plDebugTe
debugTxt.DrawString(x, y, "Relevance Regions:"); debugTxt.DrawString(x, y, "Relevance Regions:");
y += lineHeight; y += lineHeight;
debugTxt.DrawString(x, y, plString::Format(" In: %s", debugTxt.DrawString(x, y, plFormat(" In: {}",
plRelevanceMgr::Instance()->GetRegionNames(fRegionsImIn).c_str())); plRelevanceMgr::Instance()->GetRegionNames(fRegionsImIn)));
y += lineHeight; y += lineHeight;
debugTxt.DrawString(x, y, plString::Format(" Care about: %s", debugTxt.DrawString(x, y, plFormat(" Care about: %s",
plRelevanceMgr::Instance()->GetRegionNames(fRegionsICareAbout).c_str())); plRelevanceMgr::Instance()->GetRegionNames(fRegionsICareAbout)));
y += lineHeight; y += lineHeight;
} }
} }
@ -2792,7 +2792,7 @@ void plAvBoneMap::AddBoneMapping(uint32_t boneID, const plSceneObject *SO)
void plArmatureMod::DebugDumpMoveKeys(int &x, int &y, int lineHeight, plDebugText &debugTxt) void plArmatureMod::DebugDumpMoveKeys(int &x, int &y, int lineHeight, plDebugText &debugTxt)
{ {
debugTxt.DrawString(x, y, plString::Format("Mouse Input Map: %s", debugTxt.DrawString(x, y, plFormat("Mouse Input Map: {}",
plAvatarInputInterface::GetInstance()->GetInputMapName())); plAvatarInputInterface::GetInstance()->GetInputMapName()));
y += lineHeight; y += lineHeight;

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

@ -117,7 +117,7 @@ void plArmatureBehavior::DumpDebug(int &x, int &y, int lineHeight, plDebugText &
details = plString::Format("%20s %3s time: %5.2f %s", animName.c_str(), onOff, time, blendBar); details = plString::Format("%20s %3s time: %5.2f %s", animName.c_str(), onOff, time, blendBar);
} }
else else
details = plString::Format(" Behavior %2d %3s %s", fIndex, onOff, blendBar); details = plFormat(" Behavior {2} {>3} {}", fIndex, onOff, blendBar);
debugTxt.DrawString(x, y, details); debugTxt.DrawString(x, y, details);
y += lineHeight; y += lineHeight;

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

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

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

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

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

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

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

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

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

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

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

@ -102,7 +102,7 @@ bool plConfigInfoLogging::GetValue(double& retval, const plString & section, con
bool plConfigInfoLogging::GetAllValues(std::vector<plString>& values, const plString & section, const plString & key, const plString & desc) bool plConfigInfoLogging::GetAllValues(std::vector<plString>& values, const plString & section, const plString & key, const plString & desc)
{ {
plString descwdef = plString::Format("%s # %s","\"Multiple Entries\"",desc.c_str()); plString descwdef = plFormat("\"Multiple Entries\" # {}", desc);
fLog.AddValue(section,key,descwdef,kReplaceIfExists); fLog.AddValue(section,key,descwdef,kReplaceIfExists);
values = fConfigInfo.GetAllValues(section,key); values = fConfigInfo.GetAllValues(section,key);

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

@ -434,7 +434,7 @@ int plNetClientMgr::SendMsg(plNetMessage* msg)
if (plNetMsgGameMessage::ConvertNoRef(msg)) if (plNetMsgGameMessage::ConvertNoRef(msg))
SetFlagsBit(kSendingActions); SetFlagsBit(kSendingActions);
plCheckNetMgrResult_ValReturn(ret, plString::Format("Failed to send %s, NC ret=%d", plCheckNetMgrResult_ValReturn(ret, plFormat("Failed to send {}, NC ret={}",
msg->ClassName(), ret).c_str()); msg->ClassName(), ret).c_str());
return ret; return ret;

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

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

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

@ -226,7 +226,7 @@ int plNetMessage::PeekBuffer(const char* bufIn, int bufLen, uint32_t peekOptions
readStream.LogSetList(el); readStream.LogSetList(el);
readStream.Init(bufLen, bufIn); readStream.Init(bufLen, bufIn);
readStream.LogSubStreamStart("plNetMessage"); readStream.LogSubStreamStart("plNetMessage");
readStream.LogStringString(plString::Format("ClassName: %s", this->ClassName()).c_str()); readStream.LogStringString(plFormat("ClassName: {}", this->ClassName()).c_str());
int ret; int ret;
if (peekOptions & kBaseClassOnly) if (peekOptions & kBaseClassOnly)
{ {

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

@ -857,7 +857,7 @@ void plPXPhysicalControllerCore::IDrawDebugDisplay(int controllerIdx)
if (controllerIdx == 0) if (controllerIdx == 0)
{ {
y = 10; y = 10;
debugString = plString::Format("Controller Count: %d", gControllers.size()); debugString = plFormat("Controller Count: {}", gControllers.size());
debugTxt.DrawString(x, y, debugString.c_str()); debugTxt.DrawString(x, y, debugString.c_str());
y += lineHeight; y += lineHeight;
} }
@ -866,8 +866,8 @@ void plPXPhysicalControllerCore::IDrawDebugDisplay(int controllerIdx)
int collisionCount = fDbgCollisionInfo.GetCount(); int collisionCount = fDbgCollisionInfo.GetCount();
if (collisionCount > 0) if (collisionCount > 0)
{ {
debugString = plString::Format("Controller #%d (%s) Collisions:", debugString = plFormat("Controller #{} ({}) Collisions:",
controllerIdx + 1, gControllers[controllerIdx]->fOwner->GetName().c_str()); controllerIdx + 1, gControllers[controllerIdx]->fOwner->GetName());
debugTxt.DrawString(x, y, debugString.c_str()); debugTxt.DrawString(x, y, debugString.c_str());
y += lineHeight; y += lineHeight;

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

@ -215,7 +215,7 @@ void plPhysicalSDLModifier::ILogState(const plStateDataRecord* state, bool useDi
plPhysical* phys = IGetPhysical(); plPhysical* phys = IGetPhysical();
plString log = plString::Format("%s: %s", phys->GetKeyName().c_str(), prefix); plString log = plFormat("{}: {}", phys->GetKeyName(), prefix);
if (isPosSet) if (isPosSet)
log += plString::Format(" Pos=%.1f %.1f %.1f", pos.fX, pos.fY, pos.fZ); log += plString::Format(" Pos=%.1f %.1f %.1f", pos.fX, pos.fY, pos.fZ);

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

@ -319,7 +319,7 @@ bool plStateDataRecord::Read(hsStream* s, float timeConvert, uint32_t readOption
// convert to latest descriptor // convert to latest descriptor
// Only really need to do this the first time this descriptor is read... // Only really need to do this the first time this descriptor is read...
plStateDescriptor* latestDesc=plSDLMgr::GetInstance()->FindDescriptor(fDescriptor->GetName(), plSDL::kLatestVersion); plStateDescriptor* latestDesc=plSDLMgr::GetInstance()->FindDescriptor(fDescriptor->GetName(), plSDL::kLatestVersion);
hsAssert( latestDesc, plString::Format("Failed to find latest sdl descriptor for: %s", fDescriptor->GetName().c_str() ).c_str() ); hsAssert(latestDesc, plFormat("Failed to find latest sdl descriptor for: {}", fDescriptor->GetName()).c_str());
bool forceConvert = (readOptions&plSDL::kForceConvert)!=0; bool forceConvert = (readOptions&plSDL::kForceConvert)!=0;
if ( latestDesc && ( forceConvert || ( fDescriptor->GetVersion()!=latestDesc->GetVersion() ) ) ) if ( latestDesc && ( forceConvert || ( fDescriptor->GetVersion()!=latestDesc->GetVersion() ) ) )
{ {
@ -493,14 +493,14 @@ void plStateDataRecord::UpdateFrom(const plStateDataRecord& other, uint32_t writ
if ( GetDescriptor()->GetVersion()!=other.GetDescriptor()->GetVersion() ) if ( GetDescriptor()->GetVersion()!=other.GetDescriptor()->GetVersion() )
{ {
plStateDescriptor* sd=plSDLMgr::GetInstance()->FindDescriptor( other.GetDescriptor()->GetName(), other.GetDescriptor()->GetVersion() ); plStateDescriptor* sd=plSDLMgr::GetInstance()->FindDescriptor( other.GetDescriptor()->GetName(), other.GetDescriptor()->GetVersion() );
hsAssert( sd, plString::Format( "Failed to find sdl descriptor %s,%d. Missing legacy descriptor?", hsAssert(sd, plFormat("Failed to find sdl descriptor {},{}. Missing legacy descriptor?",
other.GetDescriptor()->GetName().c_str(), other.GetDescriptor()->GetVersion() ).c_str() ); other.GetDescriptor()->GetName(), other.GetDescriptor()->GetVersion()).c_str());
ConvertTo( sd ); ConvertTo( sd );
} }
hsAssert(other.GetDescriptor()==fDescriptor, hsAssert(other.GetDescriptor()==fDescriptor,
plString::Format("descriptor mismatch in UpdateFromDirty, SDL=%s,%s version %d %d", plFormat("descriptor mismatch in UpdateFromDirty, SDL={},{} version {} {}",
GetDescriptor()->GetName().c_str(), other.GetDescriptor()->GetName().c_str(), GetDescriptor()->GetName(), other.GetDescriptor()->GetName(),
GetDescriptor()->GetVersion(), other.GetDescriptor()->GetVersion()).c_str()); GetDescriptor()->GetVersion(), other.GetDescriptor()->GetVersion()).c_str());
bool dirtyOnly = (writeOptions & plSDL::kDirtyOnly); bool dirtyOnly = (writeOptions & plSDL::kDirtyOnly);
@ -545,9 +545,9 @@ void plStateDataRecord::FlagDifferentState(const plStateDataRecord& other)
} }
else else
{ {
hsAssert(false, plString::Format("descriptor mismatch in FlagDifferentState, mine %s %d, other %s %d", hsAssert(false, plFormat("descriptor mismatch in FlagDifferentState, mine {} {}, other {} {}",
fDescriptor->GetName().c_str(), fDescriptor->GetVersion(), fDescriptor->GetName(), fDescriptor->GetVersion(),
other.GetDescriptor()->GetName().c_str(), other.GetDescriptor()->GetVersion()).c_str()); other.GetDescriptor()->GetName(), other.GetDescriptor()->GetVersion()).c_str());
} }
} }
@ -599,9 +599,9 @@ void plStateDataRecord::FlagNewerState(const plStateDataRecord& other, bool resp
} }
else else
{ {
hsAssert(false, plString::Format("descriptor mismatch in FlagNewerState, mine %s %d, other %s %d", hsAssert(false, plFormat("descriptor mismatch in FlagNewerState, mine {} {}, other {} {}",
fDescriptor->GetName().c_str(), fDescriptor->GetVersion(), fDescriptor->GetName(), fDescriptor->GetVersion(),
other.GetDescriptor()->GetName().c_str(), other.GetDescriptor()->GetVersion()).c_str()); other.GetDescriptor()->GetName(), other.GetDescriptor()->GetVersion()).c_str());
} }
} }
@ -744,9 +744,9 @@ void plStateDataRecord::DumpToObjectDebugger(const char* msg, bool dirtyOnly, in
int numVars = dirtyOnly ? GetNumDirtyVars() : GetNumUsedVars(); int numVars = dirtyOnly ? GetNumDirtyVars() : GetNumUsedVars();
int numSDVars = dirtyOnly ? GetNumDirtySDVars() : GetNumUsedSDVars(); int numSDVars = dirtyOnly ? GetNumDirtySDVars() : GetNumUsedSDVars();
dbg->LogMsg(plString::Format("%s", fAssocObject.IsValid() ? fAssocObject.GetObjectName().c_str() : " ").c_str()); dbg->LogMsg(fAssocObject.IsValid() ? fAssocObject.GetObjectName().c_str() : " ");
if (msg) if (msg)
dbg->LogMsg(plString::Format("%s%s", pad.c_str(),msg).c_str()); dbg->LogMsg(plFormat("{}{}", pad, msg).c_str());
dbg->LogMsg(plString::Format("%sSDR(%p), desc=%s, showDirty=%d, numVars=%d, vol=%d", dbg->LogMsg(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()); pad.c_str(), this, fDescriptor->GetName().c_str(), dirtyOnly, numVars+numSDVars, fFlags&kVolatile).c_str());
@ -780,12 +780,12 @@ void plStateDataRecord::DumpToStream(hsStream* stream, const char* msg, bool dir
int numVars = dirtyOnly ? GetNumDirtyVars() : GetNumUsedVars(); int numVars = dirtyOnly ? GetNumDirtyVars() : GetNumUsedVars();
int numSDVars = dirtyOnly ? GetNumDirtySDVars() : GetNumUsedSDVars(); int numSDVars = dirtyOnly ? GetNumDirtySDVars() : GetNumUsedSDVars();
plString logStr = plString::Format("%s", fAssocObject.IsValid() ? fAssocObject.GetObjectName().c_str() : " "); plString logStr = fAssocObject.IsValid() ? fAssocObject.GetObjectName() : " ";
stream->Write(logStr.GetSize(), logStr.c_str()); stream->Write(logStr.GetSize(), logStr.c_str());
if (msg) if (msg)
{ {
logStr = plString::Format("%s%s", pad.c_str(),msg); logStr = plFormat("{}{}", pad, msg);
stream->Write(logStr.GetSize(), logStr.c_str()); stream->Write(logStr.GetSize(), logStr.c_str());
} }

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

@ -411,9 +411,9 @@ void plSimpleStateVariable::IVarSet(bool timeStampNow/*=true*/)
plString plSimpleStateVariable::GetAsString(int idx) const plString plSimpleStateVariable::GetAsString(int idx) const
{ {
int j; int j;
plString str; plStringStream str;
if (fVar.GetAtomicCount()>1) if (fVar.GetAtomicCount()>1)
str += "("; str << '(';
plVarDescriptor::Type type=fVar.GetAtomicType(); plVarDescriptor::Type type=fVar.GetAtomicType();
switch(type) switch(type)
@ -431,29 +431,29 @@ plString plSimpleStateVariable::GetAsString(int idx) const
for(j=0;j<fVar.GetAtomicCount();j++) for(j=0;j<fVar.GetAtomicCount();j++)
{ {
if (type==plVarDescriptor::kInt) if (type==plVarDescriptor::kInt)
str += plString::Format( "%d", fI[i++]); str << fI[i++];
else if (type==plVarDescriptor::kShort) else if (type==plVarDescriptor::kShort)
str += plString::Format( "%d", fS[i++]); str << fS[i++];
else if (type==plVarDescriptor::kByte) else if (type==plVarDescriptor::kByte)
str += plString::Format( "%d", fBy[i++]); str << fBy[i++];
else if (type==plVarDescriptor::kFloat || type==plVarDescriptor::kAgeTimeOfDay) else if (type==plVarDescriptor::kFloat || type==plVarDescriptor::kAgeTimeOfDay)
str += plString::Format( "%.3f", fF[i++]); str << plString::Format( "%.3f", fF[i++]);
else if (type==plVarDescriptor::kDouble) else if (type==plVarDescriptor::kDouble)
str += plString::Format( "%.3f", fD[i++]); str << plString::Format( "%.3f", fD[i++]);
else if (type==plVarDescriptor::kTime) else if (type==plVarDescriptor::kTime)
{ {
double tmp; double tmp;
Get(&tmp, i++); Get(&tmp, i++);
str += plString::Format( "%.3f", tmp); str << plString::Format( "%.3f", tmp);
} }
if (j==fVar.GetAtomicCount()-1) if (j==fVar.GetAtomicCount()-1)
{ {
if (j) if (j)
str += ")"; str << ')';
} }
else else
str += ","; str << ',';
} }
} }
break; break;
@ -463,15 +463,15 @@ plString plSimpleStateVariable::GetAsString(int idx) const
int i=idx*fVar.GetAtomicCount(); int i=idx*fVar.GetAtomicCount();
for(j=0;j<fVar.GetAtomicCount();j++) for(j=0;j<fVar.GetAtomicCount();j++)
{ {
str += plString::Format( "%s", fB[i++] ? "true" : "false"); str << (fB[i++] ? "true" : "false");
if (j==fVar.GetAtomicCount()-1) if (j==fVar.GetAtomicCount()-1)
{ {
if (j) if (j)
str += ")"; str << ')';
} }
else else
str += ","; str << ',';
} }
} }
break; break;
@ -481,15 +481,15 @@ plString plSimpleStateVariable::GetAsString(int idx) const
int i=idx*fVar.GetAtomicCount(); int i=idx*fVar.GetAtomicCount();
for(j=0;j<fVar.GetAtomicCount();j++) for(j=0;j<fVar.GetAtomicCount();j++)
{ {
str += plString::Format( "%s", fS32[i++]); str << fS32[i++];
if (j==fVar.GetAtomicCount()-1) if (j==fVar.GetAtomicCount()-1)
{ {
if (j) if (j)
str += ")"; str << ')';
} }
else else
str += ","; str << ',';
} }
} }
break; break;
@ -499,21 +499,21 @@ plString plSimpleStateVariable::GetAsString(int idx) const
int i=idx*fVar.GetAtomicCount(); int i=idx*fVar.GetAtomicCount();
for(j=0;j<fVar.GetAtomicCount();j++) for(j=0;j<fVar.GetAtomicCount();j++)
{ {
str += "other"; str << "other";
if (j==fVar.GetAtomicCount()-1) if (j==fVar.GetAtomicCount()-1)
{ {
if (j) if (j)
str += ")"; str << ')';
} }
else else
str += ","; str << ',';
} }
} }
break; break;
} }
return str; return str.GetString();
} }
// //
@ -2163,8 +2163,8 @@ void plSimpleStateVariable::NotifyStateChange(const plSimpleStateVariable* other
if (plNetObjectDebuggerBase::GetInstance() && plNetObjectDebuggerBase::GetInstance()->GetDebugging()) if (plNetObjectDebuggerBase::GetInstance() && plNetObjectDebuggerBase::GetInstance()->GetDebugging())
{ {
plNetObjectDebuggerBase::GetInstance()->LogMsg( plNetObjectDebuggerBase::GetInstance()->LogMsg(
plString::Format("Var %s did %s send notification difference. Has %d notifiers with %d recipients.", plFormat("Var {} did {} send notification difference. Has {} notifiers with {} recipients.",
GetName().c_str(), !notify ? "NOT" : "", fChangeNotifiers.size(), numNotifiers).c_str()); GetName(), !notify ? "NOT" : "", fChangeNotifiers.size(), numNotifiers).c_str());
} }
} }
@ -2284,7 +2284,7 @@ void plSimpleStateVariable::DumpToObjectDebugger(bool dirtyOnly, int level) cons
for(i=0;i<level; i++) for(i=0;i<level; i++)
pad += " "; pad += " ";
plString logMsg = plString::Format( "%sSimpleVar, name:%s[%d]", pad.c_str(), GetName().c_str(), GetCount()); plString logMsg = plFormat("{}SimpleVar, name:{}[{}]", pad, GetName(), GetCount());
if (GetCount()>1) if (GetCount()>1)
{ {
dbg->LogMsg(logMsg.c_str()); // it's going to be a long msg, so print it on its own line dbg->LogMsg(logMsg.c_str()); // it's going to be a long msg, so print it on its own line
@ -2298,13 +2298,13 @@ void plSimpleStateVariable::DumpToObjectDebugger(bool dirtyOnly, int level) cons
if (fVar.GetAtomicType() == plVarDescriptor::kTime) if (fVar.GetAtomicType() == plVarDescriptor::kTime)
{ {
const char* p=fT[i].PrintWMillis(); const char* p=fT[i].PrintWMillis();
logMsg += plString::Format( "%sVar:%d gameTime:%s pst:%s ts:%s", logMsg += plFormat("{}Var:{} gameTime:{} pst:{} ts:{}",
pad.c_str(), i, s.c_str("?"), p, fTimeStamp.Format("%c").c_str() ); pad, i, s, p, fTimeStamp.Format("%c"));
} }
else else
{ {
logMsg += plString::Format( "%sVar:%d value:%s ts:%s", logMsg += plFormat("{}Var:{} value:{} ts:{}",
pad.c_str(), i, s.c_str("?"), fTimeStamp.AtEpoch() ? "0" : fTimeStamp.Format("%c").c_str() ); pad, i, s, fTimeStamp.AtEpoch() ? "0" : fTimeStamp.Format("%c"));
} }
if ( !dirtyOnly ) if ( !dirtyOnly )
@ -2322,7 +2322,7 @@ void plSimpleStateVariable::DumpToStream(hsStream* stream, bool dirtyOnly, int l
for(i=0;i<level; i++) for(i=0;i<level; i++)
pad += " "; pad += " ";
plString logMsg = plString::Format( "%sSimpleVar, name:%s[%d]", pad.c_str(), GetName().c_str(), GetCount()); plString logMsg = plFormat("{}SimpleVar, name:{}[{}]", pad, GetName(), GetCount());
if (GetCount()>1) if (GetCount()>1)
{ {
stream->WriteString(logMsg); // it's going to be a long msg, so print it on its own line stream->WriteString(logMsg); // it's going to be a long msg, so print it on its own line
@ -2336,13 +2336,13 @@ void plSimpleStateVariable::DumpToStream(hsStream* stream, bool dirtyOnly, int l
if (fVar.GetAtomicType() == plVarDescriptor::kTime) if (fVar.GetAtomicType() == plVarDescriptor::kTime)
{ {
const char* p=fT[i].PrintWMillis(); const char* p=fT[i].PrintWMillis();
logMsg += plString::Format( "%sVar:%d gameTime:%s pst:%s ts:%s", logMsg += plFormat("{}Var:{} gameTime:{} pst:{} ts:{}",
pad.c_str(), i, s.c_str("?"), p, fTimeStamp.Format("%c").c_str() ); pad, i, s, p, fTimeStamp.Format("%c"));
} }
else else
{ {
logMsg += plString::Format( "%sVar:%d value:%s ts:%s", logMsg += plFormat("{}Var:{} value:{} ts:{}",
pad.c_str(), i, s.c_str("?"), fTimeStamp.AtEpoch() ? "0" : fTimeStamp.Format("%c").c_str() ); pad, i, s, fTimeStamp.AtEpoch() ? "0" : fTimeStamp.Format("%c"));
} }
if ( !dirtyOnly ) if ( !dirtyOnly )

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

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

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

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

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

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

8
Sources/Plasma/PubUtilLib/plStatusLog/plStatusLog.cpp

@ -330,15 +330,15 @@ bool plStatusLog::IReOpen( void )
plFileName fileNoExt; plFileName fileNoExt;
plString ext; plString ext;
IParseFileName(fileNoExt, ext); IParseFileName(fileNoExt, ext);
plFileName fileToOpen = plString::Format("%s.0.%s", fileNoExt.AsString().c_str(), ext.c_str()); plFileName fileToOpen = plFormat("{}.0.{}", fileNoExt, ext);
if (!(fFlags & kDontRotateLogs)) if (!(fFlags & kDontRotateLogs))
{ {
plFileName work, work2; plFileName work, work2;
work = plString::Format("%s.3.%s", fileNoExt.AsString().c_str(), ext.c_str()); work = plFormat("{}.3.{}", fileNoExt, ext);
plFileSystem::Unlink(work); plFileSystem::Unlink(work);
work2 = plString::Format("%s.2.%s", fileNoExt.AsString().c_str(), ext.c_str()); work2 = plFormat("{}.2.{}", fileNoExt, ext);
plFileSystem::Move(work2, work); plFileSystem::Move(work2, work);
work = plString::Format("%s.1.%s", fileNoExt.AsString().c_str(), ext.c_str()); work = plFormat("{}.1.{}", fileNoExt, ext);
plFileSystem::Move(work, work2); plFileSystem::Move(work, work2);
plFileSystem::Move(fileToOpen, work); plFileSystem::Move(fileToOpen, work);
} }

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

@ -134,7 +134,7 @@ plLayer* hsGMaterial::MakeBaseLayer()
plString buff; plString buff;
if( !GetKeyName().IsNull() ) if( !GetKeyName().IsNull() )
buff = plString::Format("%s_Layer", GetKeyName().c_str()); buff = plFormat("{}_Layer", GetKeyName());
else else
buff = "Layer"; buff = "Layer";
hsgResMgr::ResMgr()->NewKey( buff, newLay, GetKey() != nil ? GetKey()->GetUoid().GetLocation() : plLocation::kGlobalFixedLoc ); hsgResMgr::ResMgr()->NewKey( buff, newLay, GetKey() != nil ? GetKey()->GetUoid().GetLocation() : plLocation::kGlobalFixedLoc );

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

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

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

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

2
Sources/Tools/MaxComponent/plAnimComponent.cpp

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

6
Sources/Tools/MaxComponent/plAudioComponents.cpp

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

4
Sources/Tools/MaxComponent/plAvatarComponent.cpp

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

3
Sources/Tools/MaxComponent/plComponentBase.cpp

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

2
Sources/Tools/MaxComponent/plInventoryObjComponent.cpp

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

2
Sources/Tools/MaxComponent/plMiscComponents.cpp

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

2
Sources/Tools/MaxComponent/plMultistageBehComponent.cpp

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

8
Sources/Tools/MaxComponent/plVolumeGadgetComponent.cpp

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

6
Sources/Tools/MaxConvert/hsConverterUtils.cpp

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

44
Sources/Tools/MaxConvert/hsMaterialConverter.cpp

@ -311,7 +311,7 @@ void AttachLinkMtlAnims(plMaxNode *node, hsGMaterial *mat)
animLayer = new plLayerLinkAnimation; animLayer = new plLayerLinkAnimation;
animLayer->SetLinkKey(node->GetAvatarSO()->GetKey()); animLayer->SetLinkKey(node->GetAvatarSO()->GetKey());
//animLayer->fLeavingAge = leaving[x]; //animLayer->fLeavingAge = leaving[x];
plString fullAnimName = plString::Format("%s_%s_%s", oldLayer->GetKeyName().c_str(), animName, suff); plString fullAnimName = plFormat("{}_{}_{}", oldLayer->GetKeyName(), animName, suff);
hsgResMgr::ResMgr()->NewKey(fullAnimName, animLayer, node->GetLocation()); hsgResMgr::ResMgr()->NewKey(fullAnimName, animLayer, node->GetLocation());
animLayer->SetOpacityCtl(opaCtl); animLayer->SetOpacityCtl(opaCtl);
animLayer->GetTimeConvert().SetBegin(times[0]); animLayer->GetTimeConvert().SetBegin(times[0]);
@ -908,7 +908,7 @@ hsGMaterial* hsMaterialConverter::NonAlphaHackPrint(plMaxNode* node, Texmap* bas
if( !(baseTex && node) ) if( !(baseTex && node) )
return nil; return nil;
plString name = plString::Format("%s_%s_%d", node->GetName(), baseTex->GetName(), 0); plString name = plFormat("{}_{}_0", node->GetName(), baseTex->GetName());
// Search done materials for it // Search done materials for it
@ -950,7 +950,7 @@ hsGMaterial* hsMaterialConverter::AlphaHackPrint(plMaxNode* node, Texmap* baseTe
if( !(baseTex && node) ) if( !(baseTex && node) )
return nil; return nil;
plString name = plString::Format("%s_%s_%d_AH", node->GetName(), baseTex->GetName(), 0); plString name = plFormat("{}_{}_0_AH", node->GetName(), baseTex->GetName());
// Search done materials for it // Search done materials for it
@ -999,7 +999,7 @@ hsGMaterial* hsMaterialConverter::NonAlphaHackVersion(plMaxNode* node, Mtl* mtl,
return nil; return nil;
} }
plString name = plString::Format("%s_%s_%d", node->GetName(), mtl->GetName(), subIndex); plString name = plFormat("{}_{}_{}", node->GetName(), mtl->GetName(), subIndex);
return ICreateMaterial(mtl, node, name, subIndex, 1, false); return ICreateMaterial(mtl, node, name, subIndex, 1, false);
} }
@ -1014,7 +1014,7 @@ hsGMaterial* hsMaterialConverter::AlphaHackVersion(plMaxNode* node, Mtl* mtl, in
return nil; return nil;
} }
plString name = plString::Format("%s_%s_%d_AH", node->GetName(), mtl->GetName(), subIndex); plString name = plFormat("{}_{}_{}_AH", node->GetName(), mtl->GetName(), subIndex);
return ICreateMaterial(mtl, node, name, subIndex, 1, true); return ICreateMaterial(mtl, node, name, subIndex, 1, true);
} }
@ -1334,7 +1334,7 @@ hsGMaterial *hsMaterialConverter::IAddDefaultMaterial(plMaxNode *node)
plLocation loc = node->GetLocation(); plLocation loc = node->GetLocation();
hsGMaterial *hMat = new hsGMaterial; hsGMaterial *hMat = new hsGMaterial;
hsgResMgr::ResMgr()->NewKey(plString::Format("%s_DefMat", node->GetName()), hMat, loc); hsgResMgr::ResMgr()->NewKey(plFormat("{}_DefMat", node->GetName()), hMat, loc);
plLayer *layer = new plLayer; plLayer *layer = new plLayer;
layer->InitToDefault(); layer->InitToDefault();
@ -1575,7 +1575,7 @@ hsGMaterial *hsMaterialConverter::IProcessCompositeMtl(Mtl *mtl, plMaxNode *node
uint32_t *layerCounts = new uint32_t[mtl->NumSubMtls()]; uint32_t *layerCounts = new uint32_t[mtl->NumSubMtls()];
IParamBlock2 *pb = mtl->GetParamBlockByID(plCompositeMtl::kBlkPasses); IParamBlock2 *pb = mtl->GetParamBlockByID(plCompositeMtl::kBlkPasses);
hsGMaterial *mat = new hsGMaterial; hsGMaterial *mat = new hsGMaterial;
hsgResMgr::ResMgr()->NewKey(plString::Format("%s_%d", name.c_str(), subMtlFlags), mat, node->GetLocation()); hsgResMgr::ResMgr()->NewKey(plFormat("{}_{}", name, subMtlFlags), mat, node->GetLocation());
int multiIndex = IFindSubIndex(node, mtl); int multiIndex = IFindSubIndex(node, mtl);
bool needAlphaHack = node->AlphaHackLayersNeeded(multiIndex) > 0; bool needAlphaHack = node->AlphaHackLayersNeeded(multiIndex) > 0;
@ -1589,7 +1589,7 @@ hsGMaterial *hsMaterialConverter::IProcessCompositeMtl(Mtl *mtl, plMaxNode *node
bool usingSubMtl = (i == 0 || pb->GetInt(kCompOn, 0, i - 1)); bool usingSubMtl = (i == 0 || pb->GetInt(kCompOn, 0, i - 1));
if ((bitMask & subMtlFlags) != 0 && usingSubMtl) if ((bitMask & subMtlFlags) != 0 && usingSubMtl)
{ {
plString pref = plString::Format("%s_%d", mat->GetKey()->GetName().c_str(), i); plString pref = plFormat("{}_{}", mat->GetKeyName(), i);
subMtl = mtl->GetSubMtl(i); subMtl = mtl->GetSubMtl(i);
if (subMtl != nil && subMtl->ClassID() == PASS_MTL_CLASS_ID) if (subMtl != nil && subMtl->ClassID() == PASS_MTL_CLASS_ID)
@ -1685,7 +1685,7 @@ hsGMaterial *hsMaterialConverter::IProcessMultipassMtl(Mtl *mtl, plMaxNode *node
if ( ( subMtl->ClassID() == PASS_MTL_CLASS_ID || if ( ( subMtl->ClassID() == PASS_MTL_CLASS_ID ||
subMtl->ClassID() == BUMP_MTL_CLASS_ID ) && check != 0) subMtl->ClassID() == BUMP_MTL_CLASS_ID ) && check != 0)
{ {
IProcessPlasmaMaterial(subMtl, node, mat, mat->GetKey()->GetName()); IProcessPlasmaMaterial(subMtl, node, mat, mat->GetKeyName());
} }
layerCounts[i] = mat->GetNumLayers(); layerCounts[i] = mat->GetNumLayers();
} }
@ -1822,7 +1822,7 @@ plLayerAnimation *IConvertNoteTrackAnims(plLayerAnimation *animLayer, SegmentMap
if (spec->fType == SegmentSpec::kAnim) if (spec->fType == SegmentSpec::kAnim)
{ {
plLayerAnimation *noteAnim = new plLayerAnimation; plLayerAnimation *noteAnim = new plLayerAnimation;
plString animName = plString::Format("%s_anim_%s", name.c_str(), spec->fName); plString animName = plFormat("{}_anim_{}", name, spec->fName);
hsgResMgr::ResMgr()->NewKey(animName, noteAnim, node->GetLocation()); hsgResMgr::ResMgr()->NewKey(animName, noteAnim, node->GetLocation());
if (animLayer->GetPreshadeColorCtl()) if (animLayer->GetPreshadeColorCtl())
@ -2049,7 +2049,7 @@ plLayerInterface* IProcessLayerAnimation(plPassMtlBase* mtl, plLayerTex* layTex,
if( mtl->GetUseGlobal() ) if( mtl->GetUseGlobal() )
{ {
plLayerSDLAnimation *SDLLayer = new plLayerSDLAnimation; plLayerSDLAnimation *SDLLayer = new plLayerSDLAnimation;
plString animName = plString::Format("%s_anim_%s", name.c_str(), mtl->GetGlobalVarName()); plString animName = plFormat("{}_anim_{}", name, mtl->GetGlobalVarName());
hsgResMgr::ResMgr()->NewKey(animName, SDLLayer, node->GetLocation()); hsgResMgr::ResMgr()->NewKey(animName, SDLLayer, node->GetLocation());
SDLLayer->SetVarName((char*)mtl->GetGlobalVarName()); SDLLayer->SetVarName((char*)mtl->GetGlobalVarName());
@ -2150,7 +2150,7 @@ plLayerInterface* IProcessAnimation(plPassMtlBase *mtl, plMaxNode *node, const p
// return layerIFace; // return layerIFace;
plLayerSDLAnimation *SDLLayer = new plLayerSDLAnimation; plLayerSDLAnimation *SDLLayer = new plLayerSDLAnimation;
plString animName = plString::Format("%s_anim_%s", name.c_str(), mtl->GetGlobalVarName()); plString animName = plFormat("{}_anim_{}", name, mtl->GetGlobalVarName());
hsgResMgr::ResMgr()->NewKey(animName, SDLLayer, node->GetLocation()); hsgResMgr::ResMgr()->NewKey(animName, SDLLayer, node->GetLocation());
SDLLayer->SetVarName((char*)mtl->GetGlobalVarName()); SDLLayer->SetVarName((char*)mtl->GetGlobalVarName());
@ -3084,7 +3084,7 @@ void hsMaterialConverter::IAppendFunkyLayer(plMaxNode* node, Texmap* texMap, hsG
plBitmap* funkRamp = IGetFunkyRamp(node, funkyType); plBitmap* funkRamp = IGetFunkyRamp(node, funkyType);
plString name = plString::Format("%s_funkRamp", prevLay->GetKey()->GetName().c_str()); plString name = plFormat("{}_funkRamp", prevLay->GetKeyName());
plLayer* layer = new plLayer; plLayer* layer = new plLayer;
layer->InitToDefault(); layer->InitToDefault();
@ -3223,7 +3223,7 @@ void hsMaterialConverter::IAppendWetLayer(plMaxNode* node, hsGMaterial* mat)
uvwXfm.fMap[1][2] = -1.f / (tr - op); uvwXfm.fMap[1][2] = -1.f / (tr - op);
uvwXfm.fMap[1][3] = uvwXfm.fMap[1][2] * -tr; uvwXfm.fMap[1][3] = uvwXfm.fMap[1][2] * -tr;
plString name = plString::Format("%s_funkRamp", prevLay->GetKey()->GetName().c_str()); plString name = plFormat("{}_funkRamp", prevLay->GetKeyName());
plLayer* layer = nil; plLayer* layer = nil;
plKey key = node->FindPageKey( plLayer::Index(), name ); plKey key = node->FindPageKey( plLayer::Index(), name );
@ -3695,13 +3695,13 @@ plLayer* hsMaterialConverter::IMakeBumpLayer(plMaxNode* node, const plString& na
switch( miscFlag & hsGMatState::kMiscBumpChans ) switch( miscFlag & hsGMatState::kMiscBumpChans )
{ {
case hsGMatState::kMiscBumpDu: case hsGMatState::kMiscBumpDu:
name = plString::Format("%s_DU_BumpLut", nameBase.c_str()); name = plFormat("{}_DU_BumpLut", nameBase);
break; break;
case hsGMatState::kMiscBumpDv: case hsGMatState::kMiscBumpDv:
name = plString::Format("%s_DV_BumpLut", nameBase.c_str()); name = plFormat("{}_DV_BumpLut", nameBase);
break; break;
case hsGMatState::kMiscBumpDw: case hsGMatState::kMiscBumpDw:
name = plString::Format("%s_DW_BumpLut", nameBase.c_str()); name = plFormat("{}_DW_BumpLut", nameBase);
break; break;
default: default:
hsAssert(false, "Bogus flag input to MakeBumpLayer"); hsAssert(false, "Bogus flag input to MakeBumpLayer");
@ -3779,7 +3779,7 @@ void hsMaterialConverter::IInsertBumpLayers(plMaxNode* node, hsGMaterial* mat, i
(bumpLay->GetBlendFlags() & ~hsGMatState::kBlendMask) (bumpLay->GetBlendFlags() & ~hsGMatState::kBlendMask)
| hsGMatState::kBlendDot3); | hsGMatState::kBlendDot3);
plString name = mat->GetLayer(bumpLayerIdx)->GetKey()->GetName(); plString name = mat->GetLayer(bumpLayerIdx)->GetKeyName();
plLayer* layerDu = IMakeBumpLayer(node, name, mat, hsGMatState::kMiscBumpDu); plLayer* layerDu = IMakeBumpLayer(node, name, mat, hsGMatState::kMiscBumpDu);
plLayer* layerDv = IMakeBumpLayer(node, name, mat, hsGMatState::kMiscBumpDv); plLayer* layerDv = IMakeBumpLayer(node, name, mat, hsGMatState::kMiscBumpDv);
@ -4542,7 +4542,7 @@ plClothingItem *hsMaterialConverter::GenerateClothingItem(plClothingMtl *mtl, co
cloth->fDefaultTint2[1] = (uint8_t)(tint2.g * 255.f); cloth->fDefaultTint2[1] = (uint8_t)(tint2.g * 255.f);
cloth->fDefaultTint2[2] = (uint8_t)(tint2.b * 255.f); cloth->fDefaultTint2[2] = (uint8_t)(tint2.b * 255.f);
clothKeyName = plString::Format("CItm_%s", cloth->fName.c_str()); clothKeyName = plFormat("CItm_{}", cloth->fName);
hsgResMgr::ResMgr()->NewKey(clothKeyName, cloth, loc); hsgResMgr::ResMgr()->NewKey(clothKeyName, cloth, loc);
plNodeRefMsg* nodeRefMsg = new plNodeRefMsg(plKeyFinder::Instance().FindSceneNodeKey(loc), plNodeRefMsg* nodeRefMsg = new plNodeRefMsg(plKeyFinder::Instance().FindSceneNodeKey(loc),
@ -4621,7 +4621,7 @@ static int ICompareBaseLayerTexture(const hsMaterialConverter::DoneMaterialData*
if( !oneTex && twoTex ) if( !oneTex && twoTex )
return -1; return -1;
return oneTex->GetKey()->GetName().Compare(twoTex->GetKey()->GetName(), plString::kCaseInsensitive); return oneTex->GetKeyName().Compare(twoTex->GetKeyName(), plString::kCaseInsensitive);
} }
static int IIsAnimatedLayer(const plLayerInterface* lay) static int IIsAnimatedLayer(const plLayerInterface* lay)
@ -4678,7 +4678,7 @@ static int ICompareDoneLayers(const plLayerInterface* one, const plLayerInterfac
if( one->GetTexture() && two->GetTexture() ) if( one->GetTexture() && two->GetTexture() )
{ {
retVal = one->GetTexture()->GetKey()->GetName().Compare(two->GetTexture()->GetKey()->GetName(), plString::kCaseInsensitive); retVal = one->GetTexture()->GetKeyName().Compare(two->GetTexture()->GetKeyName(), plString::kCaseInsensitive);
if( retVal < 0 ) if( retVal < 0 )
return -1; return -1;
else if( retVal > 0 ) else if( retVal > 0 )
@ -5132,7 +5132,7 @@ hsMaterialConverter::DoneMaterialData* hsMaterialConverter::IFindDoneMaterial(Do
plMipmap *hsMaterialConverter::GetStaticColorTexture(Color c, plLocation &loc) plMipmap *hsMaterialConverter::GetStaticColorTexture(Color c, plLocation &loc)
{ {
uint32_t colorHex = MakeUInt32Color(c.r, c.g, c.b, 1.f); uint32_t colorHex = MakeUInt32Color(c.r, c.g, c.b, 1.f);
plString texName = plString::Format("StaticColorTex_4x4_%X", colorHex); plString texName = plFormat("StaticColorTex_4x4_{X}", colorHex);
int w = 4; int w = 4;
int h = 4; int h = 4;

4
Sources/Tools/MaxConvert/plBitmapCreator.cpp

@ -547,9 +547,9 @@ plBitmap *plBitmapCreator::ICreateTexture( plBitmapData *bd, const plLocation &l
bd->detailDropoffStart, bd->detailDropoffStop, bd->detailMax, bd->detailMin ); bd->detailDropoffStart, bd->detailDropoffStop, bd->detailMax, bd->detailMin );
} }
else if( clipID != -1 ) else if( clipID != -1 )
name = plString::Format( "%s*%x#%d", temp.c_str(), bd->texFlags, clipID ); name = plFormat("{}*{x}#{}", temp, bd->texFlags, clipID);
else else
name = plString::Format( "%s*%x", temp.c_str(), bd->texFlags ); name = plFormat("{}*{x}", temp, bd->texFlags);
if( bd->invertAlpha ) if( bd->invertAlpha )
name += "_inva"; name += "_inva";
name += ".hsm"; name += ".hsm";

2
Sources/Tools/MaxConvert/plClusterUtil.cpp

@ -105,7 +105,7 @@ plClusterGroup* plClusterUtil::CreateGroup(plMaxNode* templNode, const char* nam
{ {
plClusterGroup* retVal = new plClusterGroup; plClusterGroup* retVal = new plClusterGroup;
plString buff = plString::Format("%s_%s_%d", name, templNode->GetName(), fIdx++); plString buff = plFormat("{}_{}_{}", name, templNode->GetName(), fIdx++);
hsgResMgr::ResMgr()->NewKey(buff, retVal, templNode->GetLocation(), templNode->GetLoadMask()); hsgResMgr::ResMgr()->NewKey(buff, retVal, templNode->GetLocation(), templNode->GetLoadMask());
plKey sceneNode = templNode->GetRoomKey(); plKey sceneNode = templNode->GetRoomKey();

14
Sources/Tools/MaxConvert/plLayerConverter.cpp

@ -570,10 +570,10 @@ plLayerInterface *plLayerConverter::IConvertDynamicEnvLayer( plPlasmaMAXLayer
if( anchor == maxNode ) if( anchor == maxNode )
{ {
// Self-anchoring material, make sure the name is unique via the nodeName // Self-anchoring material, make sure the name is unique via the nodeName
texName = plString::Format( "%s_cubicRT@%s", plasmaLayer->GetKeyName().c_str(), maxNode->GetName() ); texName = plFormat("{}_cubicRT@{}", plasmaLayer->GetKeyName(), maxNode->GetName());
} }
else else
texName = plString::Format( "%s_cubicRT", plasmaLayer->GetKeyName().c_str() ); texName = plFormat("{}_cubicRT", plasmaLayer->GetKeyName());
plBitmap *texture = (plBitmap *)IMakeCubicRenderTarget( texName, maxNode, anchor ); plBitmap *texture = (plBitmap *)IMakeCubicRenderTarget( texName, maxNode, anchor );
if( texture ) if( texture )
@ -776,10 +776,8 @@ static uint32_t MakeUInt32Color(float r, float g, float b, float a)
plBitmap* plLayerConverter::IGetAttenRamp(plMaxNode *node, BOOL isAdd, int loClamp, int hiClamp) plBitmap* plLayerConverter::IGetAttenRamp(plMaxNode *node, BOOL isAdd, int loClamp, int hiClamp)
{ {
plString funkName = plString::Format("%s_%d_%d", plString funkName = plFormat("{}_{}_{}", isAdd ? "AttenRampAdd" : "AttenRampMult",
isAdd ? "AttenRampAdd" : "AttenRampMult", loClamp, hiClamp);
loClamp,
hiClamp);
float range = float(hiClamp - loClamp) * 1.e-2f; float range = float(hiClamp - loClamp) * 1.e-2f;
float lowest = float(loClamp) * 1.e-2f; float lowest = float(loClamp) * 1.e-2f;
@ -1003,7 +1001,7 @@ plDynamicTextMap *plLayerConverter::ICreateDynTextMap( const plString &layerN
// Need a unique key name for every layer that uses one. We could also key // Need a unique key name for every layer that uses one. We could also key
// off of width and height, but layerName should be more than plenty // off of width and height, but layerName should be more than plenty
plString texName = plString::Format( "%s_dynText", layerName.c_str() ); plString texName = plFormat("{}_dynText", layerName);
// Does it already exist? // Does it already exist?
key = node->FindPageKey( plDynamicTextMap::Index(), texName ); key = node->FindPageKey( plDynamicTextMap::Index(), texName );
@ -1124,7 +1122,7 @@ plCubicRenderTarget *plLayerConverter::IMakeCubicRenderTarget( const plString &n
/// Now make a modifier /// Now make a modifier
plCubicRenderTargetModifier *mod = new plCubicRenderTargetModifier(); plCubicRenderTargetModifier *mod = new plCubicRenderTargetModifier();
plString modName = plString::Format( "%s_mod", name.c_str() ); plString modName = plFormat("{}_mod", name);
hsgResMgr::ResMgr()->NewKey( modName, mod, node->GetLocation() ); hsgResMgr::ResMgr()->NewKey( modName, mod, node->GetLocation() );
hsgResMgr::ResMgr()->AddViaNotify( cubic->GetKey(), new plGenRefMsg( mod->GetKey(), plRefMsg::kOnCreate, 0, 0 ), plRefFlags::kPassiveRef ); hsgResMgr::ResMgr()->AddViaNotify( cubic->GetKey(), new plGenRefMsg( mod->GetKey(), plRefMsg::kOnCreate, 0, 0 ), plRefFlags::kPassiveRef );

10
Sources/Tools/MaxConvert/plLightMapGen.cpp

@ -369,7 +369,7 @@ bool plLightMapGen::ICompressLightMaps()
{ {
const plLocation &textureLoc = plPluginResManager::ResMgr()->GetCommonPage(orig->GetKey()->GetUoid().GetLocation(), const plLocation &textureLoc = plPluginResManager::ResMgr()->GetCommonPage(orig->GetKey()->GetUoid().GetLocation(),
plAgeDescription::kTextures ); plAgeDescription::kTextures );
plString name = plString::Format("%s_DX", orig->GetKey()->GetName().c_str()); plString name = plFormat("{}_DX", orig->GetKey()->GetName());
plKey compKey = hsgResMgr::ResMgr()->FindKey(plUoid(textureLoc, plMipmap::Index(), name)); plKey compKey = hsgResMgr::ResMgr()->FindKey(plUoid(textureLoc, plMipmap::Index(), name));
if( compKey ) if( compKey )
@ -1255,7 +1255,7 @@ plLayerInterface* plLightMapGen::IMakeLightMapLayer(plMaxNode* node, plGeometryS
return mat->GetPiggyBack(i); return mat->GetPiggyBack(i);
} }
plString newMatName = plString::Format("%s_%s_LIGHTMAPGEN", mat->GetKey()->GetName().c_str(), node->GetName()); plString newMatName = plFormat("{}_{}_LIGHTMAPGEN", mat->GetKey()->GetName(), node->GetName());
plLocation nodeLoc = node->GetLocation(); plLocation nodeLoc = node->GetLocation();
plKey matKey = hsgResMgr::ResMgr()->FindKey(plUoid(nodeLoc, hsGMaterial::Index(), newMatName)); plKey matKey = hsgResMgr::ResMgr()->FindKey(plUoid(nodeLoc, hsGMaterial::Index(), newMatName));
@ -1293,7 +1293,7 @@ plLayerInterface* plLightMapGen::IMakeLightMapLayer(plMaxNode* node, plGeometryS
// Make sure layer (and mip) name are unique across pages by putting the page name in // Make sure layer (and mip) name are unique across pages by putting the page name in
const plPageInfo* pageInfo = plKeyFinder::Instance().GetLocationInfo(node->GetLocation()); const plPageInfo* pageInfo = plKeyFinder::Instance().GetLocationInfo(node->GetLocation());
plString layName = plString::Format("%s_%s_LIGHTMAPGEN", pageInfo->GetPage().c_str(), node->GetName()); plString layName = plFormat("{}_{}_LIGHTMAPGEN", pageInfo->GetPage(), node->GetName());
plKey layKey = node->FindPageKey(plLayer::Index(), layName); plKey layKey = node->FindPageKey(plLayer::Index(), layName);
@ -1310,7 +1310,7 @@ plLayerInterface* plLightMapGen::IMakeLightMapLayer(plMaxNode* node, plGeometryS
} }
else else
{ {
plString mipmapName = plString::Format( "%s_mip", layName.c_str() ); plString mipmapName = plFormat("{}_mip", layName);
// Deleted the NOTE here because it was incorrect in every meaningful sense of the word. - mf // Deleted the NOTE here because it was incorrect in every meaningful sense of the word. - mf
@ -1320,7 +1320,7 @@ plLayerInterface* plLightMapGen::IMakeLightMapLayer(plMaxNode* node, plGeometryS
if( !mipKey && !fRecalcLightMaps ) if( !mipKey && !fRecalcLightMaps )
{ {
plString compressedName = plString::Format("%s_DX", mipmapName.c_str()); plString compressedName = plFormat("{}_DX", mipmapName);
plKey compKey = hsgResMgr::ResMgr()->FindKey(plUoid(textureLoc, plMipmap::Index(), compressedName)); plKey compKey = hsgResMgr::ResMgr()->FindKey(plUoid(textureLoc, plMipmap::Index(), compressedName));

2
Sources/Tools/MaxConvert/plMeshConverter.cpp

@ -494,7 +494,7 @@ bool plMeshConverter::IValidateUVs(plMaxNode* node)
if (uvsAreBad) if (uvsAreBad)
{ {
plFileName logfile = plString::Format("UV_%s.log", GetCOREInterface()->GetCurFileName().data()); plFileName logfile = plFormat("UV_{}.log", GetCOREInterface()->GetCurFileName().data());
plStatusLog::AddLineS(logfile, "%s has suspicious UVs", node->GetName()); plStatusLog::AddLineS(logfile, "%s has suspicious UVs", node->GetName());
if (fWarnSuspiciousUVs) if (fWarnSuspiciousUVs)

10
Sources/Tools/MaxMain/plMaxNode.cpp

@ -1443,7 +1443,7 @@ bool plMaxNode::MakeMesh(plErrorMsg *pErrMsg, plConvertSettings *settings)
for (i = 0; i < spanArray.GetCount(); i++) for (i = 0; i < spanArray.GetCount(); i++)
swapSpans->Append(spanArray.Get(i)); swapSpans->Append(spanArray.Get(i));
plString tmpName = plString::Format("%s_SMsh", GetName()); plString tmpName = plFormat("{}_SMsh", GetName());
hsgResMgr::ResMgr()->NewKey(tmpName, GetSwappableGeom(), GetLocation(), GetLoadMask()); hsgResMgr::ResMgr()->NewKey(tmpName, GetSwappableGeom(), GetLocation(), GetLoadMask());
return true; return true;
@ -2255,12 +2255,12 @@ bool plMaxNode::ConvertToOccluder(plErrorMsg* pErrMsg, bool twoSided, bool isHol
plString tmpName; plString tmpName;
if( GetKey() && !GetKey()->GetName().IsEmpty() ) if( GetKey() && !GetKey()->GetName().IsEmpty() )
{ {
tmpName = plString::Format("%s_Occluder", GetKey()->GetName().c_str()); tmpName = plFormat("{}_Occluder", GetKey()->GetName());
} }
else else
{ {
static int numOcc = 0; static int numOcc = 0;
tmpName = plString::Format("Occluder_%4.4d", numOcc); tmpName = plFormat("Occluder_{_04d}", numOcc);
} }
plKey key = hsgResMgr::ResMgr()->NewKey( tmpName, occ, nodeLoc, GetLoadMask() ); plKey key = hsgResMgr::ResMgr()->NewKey( tmpName, occ, nodeLoc, GetLoadMask() );
@ -3341,13 +3341,13 @@ plDrawableSpans *plMaxNode::IGetSceneNodeSpans( plSceneNode *node, bool needBlen
{ {
/// Blending (deferred) spans /// Blending (deferred) spans
spans->SetCriteria( crit ); spans->SetCriteria( crit );
tmpName = plString::Format( "%s_%8.8x_%xBlendSpans", node->GetKeyName().c_str(), crit.fLevel.fLevel, crit.fCriteria); tmpName = plFormat("{}_{_08x}_{x}BlendSpans", node->GetKeyName(), crit.fLevel.fLevel, crit.fCriteria);
} }
else else
{ {
/// Normal spans /// Normal spans
spans->SetCriteria( crit ); spans->SetCriteria( crit );
tmpName = plString::Format( "%s_%8.8x_%xSpans", node->GetKeyName().c_str(), crit.fLevel.fLevel, crit.fCriteria); tmpName = plFormat("{}_{_08x}_{x}Spans", node->GetKeyName(), crit.fLevel.fLevel, crit.fCriteria);
} }
if (GetSwappableGeomTarget() != (uint32_t)-1 || GetSwappableGeom()) // We intend to swap geometry with this node... flag the drawable as volatile if (GetSwappableGeomTarget() != (uint32_t)-1 || GetSwappableGeom()) // We intend to swap geometry with this node... flag the drawable as volatile

2
Sources/Tools/MaxMain/plPluginResManager.cpp

@ -65,7 +65,7 @@ plKey plPluginResManager::NameToLoc(const plString& age, const plString& page, i
hsAssert(pageNode != nil, "No page returned from INameToPage(), shouldn't be possible"); hsAssert(pageNode != nil, "No page returned from INameToPage(), shouldn't be possible");
// Go find the sceneNode now, since we know the page exists (go through our normal channels, though) // Go find the sceneNode now, since we know the page exists (go through our normal channels, though)
plString keyName = plString::Format("%s_%s", age.c_str(), page.c_str()); plString keyName = plFormat("{}_{}", age, page);
plUoid nodeUoid(pageNode->GetPageInfo().GetLocation(), plSceneNode::Index(), keyName); plUoid nodeUoid(pageNode->GetPageInfo().GetLocation(), plSceneNode::Index(), keyName);

2
Sources/Tools/MaxPlasmaMtls/Layers/plPlasmaMAXLayer.cpp

@ -157,7 +157,7 @@ class plLayerTargetContainer : public hsKeyedObject
plLayerTargetContainer() plLayerTargetContainer()
{ {
plString str = plString::Format( "plLayerTargetContainer-%d", fKeyCount++ ); plString str = plFormat("plLayerTargetContainer-{}", fKeyCount++);
hsgResMgr::ResMgr()->NewKey( str, this, plLocation::kGlobalFixedLoc ); hsgResMgr::ResMgr()->NewKey( str, this, plLocation::kGlobalFixedLoc );
} }
}; };

2
Sources/Tools/plFontConverter/plFontConverter.cpp

@ -570,7 +570,7 @@ void plFontConverter::IBatchFreeType(const plFileName &path, void *init)
fFont->SetFace(fontName); fFont->SetFace(fontName);
plFileName fileName = plFileName::Join(destPath, plFileName fileName = plFileName::Join(destPath,
plString::Format("%s-%d.p2f", fFont->GetFace().c_str(), fFont->GetSize())); plFormat("{}-{}.p2f", fFont->GetFace(), fFont->GetSize()));
hsUNIXStream stream; hsUNIXStream stream;
if (!stream.Open(fileName, "wb")) if (!stream.Open(fileName, "wb"))
QMessageBox::critical(this, tr("ERROR"), tr("Can't open file for writing")); QMessageBox::critical(this, tr("ERROR"), tr("Can't open file for writing"));

4
Sources/Tools/plLocalizationEditor/plAddDlgs.h

@ -44,7 +44,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
#define __plAddDlgs_h__ #define __plAddDlgs_h__
#include <QDialog> #include <QDialog>
#include "plString.h" #include "plFormat.h"
class plAddElementDlg : public QDialog class plAddElementDlg : public QDialog
{ {
@ -57,7 +57,7 @@ public:
bool DoPick(); // returns true if [Ok] clicked, false otherwise. bool DoPick(); // returns true if [Ok] clicked, false otherwise.
plString GetValue() const plString GetValue() const
{ {
return plString::Format("%s.%s.%s", fAgeName.c_str(), fSetName.c_str(), fElementName.c_str()); return plFormat("{}.{}.{}", fAgeName, fSetName, fElementName);
} }
private slots: private slots:

10
Sources/Tools/plLocalizationEditor/plEditDlg.cpp

@ -117,7 +117,7 @@ void EditDialog::SaveLocalizationText()
if (ageName.IsEmpty() || setName.IsEmpty() || elementName.IsEmpty() || elementLanguage.IsEmpty()) if (ageName.IsEmpty() || setName.IsEmpty() || elementName.IsEmpty() || elementLanguage.IsEmpty())
return; return;
plString name = plString::Format("%s.%s.%s", ageName.c_str(), setName.c_str(), elementName.c_str()); plString name = plFormat("{}.{}.{}", ageName, setName, elementName);
pfLocalizationDataMgr::Instance().SetElementPlainTextData(name, elementLanguage, text); pfLocalizationDataMgr::Instance().SetElementPlainTextData(name, elementLanguage, text);
} }
@ -138,7 +138,7 @@ void EditDialog::LoadLocalization(const plString &locPath)
else else
{ {
EnableEdit(true); EnableEdit(true);
plString key = plString::Format("%s.%s.%s", ageName.c_str(), setName.c_str(), elementName.c_str()); plString key = plFormat("{}.{}.{}", ageName, setName, elementName);
plString elementText = pfLocalizationDataMgr::Instance().GetElementPlainTextData(key, elementLanguage); plString elementText = pfLocalizationDataMgr::Instance().GetElementPlainTextData(key, elementLanguage);
fUI->fLocalizationText->setPlainText(elementText.c_str()); fUI->fLocalizationText->setPlainText(elementText.c_str());
} }
@ -306,12 +306,12 @@ void EditDialog::AddClicked()
plString newLanguage = dlg.GetValue(); plString newLanguage = dlg.GetValue();
plString ageName, setName, elementName, elementLanguage; plString ageName, setName, elementName, elementLanguage;
SplitLocalizationPath(fCurrentLocPath, ageName, setName, elementName, elementLanguage); SplitLocalizationPath(fCurrentLocPath, ageName, setName, elementName, elementLanguage);
plString key = plString::Format("%s.%s.%s", ageName.c_str(), setName.c_str(), elementName.c_str()); plString key = plFormat("{}.{}.{}", ageName, setName, elementName);
if (!pfLocalizationDataMgr::Instance().AddLocalization(key, newLanguage)) if (!pfLocalizationDataMgr::Instance().AddLocalization(key, newLanguage))
QMessageBox::critical(this, tr("Error"), tr("Couldn't add additional localization!")); QMessageBox::critical(this, tr("Error"), tr("Couldn't add additional localization!"));
else else
{ {
plString path = plString::Format("%s.%s", key.c_str(), newLanguage.c_str()); plString path = plFormat("{}.{}", key, newLanguage);
fCurrentLocPath = ""; fCurrentLocPath = "";
fUI->fLocalizationTree->clear(); fUI->fLocalizationTree->clear();
fUI->fLocalizationTree->LoadData(path); fUI->fLocalizationTree->LoadData(path);
@ -347,7 +347,7 @@ void EditDialog::DeleteClicked()
{ {
plString ageName, setName, elementName, elementLanguage; plString ageName, setName, elementName, elementLanguage;
SplitLocalizationPath(fCurrentLocPath, ageName, setName, elementName, elementLanguage); SplitLocalizationPath(fCurrentLocPath, ageName, setName, elementName, elementLanguage);
plString key = plString::Format("%s.%s.%s", ageName.c_str(), setName.c_str(), elementName.c_str()); plString key = plFormat("{}.{}.{}", ageName, setName, elementName);
if (!pfLocalizationDataMgr::Instance().DeleteLocalization(key, elementLanguage)) if (!pfLocalizationDataMgr::Instance().DeleteLocalization(key, elementLanguage))
QMessageBox::critical(this, tr("Error"), tr("Couldn't delete localization!")); QMessageBox::critical(this, tr("Error"), tr("Couldn't delete localization!"));
else else

Loading…
Cancel
Save