1
0
mirror of https://foundry.openuru.org/gitblit/r/CWE-ou-minkata.git synced 2025-07-18 11:19:10 +00:00

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

This commit is contained in:
2014-05-24 23:46:54 -07:00
parent 89a9bbb3c4
commit 1debf8180b
98 changed files with 404 additions and 413 deletions

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -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);
}
else
details = plString::Format(" Behavior %2d %3s %s", fIndex, onOff, blendBar);
details = plFormat(" Behavior {2} {>3} {}", fIndex, onOff, blendBar);
debugTxt.DrawString(x, y, details);
y += lineHeight;

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -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)
{
plString descwdef = plString::Format("%s # %s","\"Multiple Entries\"",desc.c_str());
plString descwdef = plFormat("\"Multiple Entries\" # {}", desc);
fLog.AddValue(section,key,descwdef,kReplaceIfExists);
values = fConfigInfo.GetAllValues(section,key);

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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