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

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

View File

@ -311,7 +311,7 @@ void AttachLinkMtlAnims(plMaxNode *node, hsGMaterial *mat)
animLayer = new plLayerLinkAnimation;
animLayer->SetLinkKey(node->GetAvatarSO()->GetKey());
//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());
animLayer->SetOpacityCtl(opaCtl);
animLayer->GetTimeConvert().SetBegin(times[0]);
@ -908,7 +908,7 @@ hsGMaterial* hsMaterialConverter::NonAlphaHackPrint(plMaxNode* node, Texmap* bas
if( !(baseTex && node) )
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
@ -950,7 +950,7 @@ hsGMaterial* hsMaterialConverter::AlphaHackPrint(plMaxNode* node, Texmap* baseTe
if( !(baseTex && node) )
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
@ -999,7 +999,7 @@ hsGMaterial* hsMaterialConverter::NonAlphaHackVersion(plMaxNode* node, Mtl* mtl,
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);
}
@ -1014,7 +1014,7 @@ hsGMaterial* hsMaterialConverter::AlphaHackVersion(plMaxNode* node, Mtl* mtl, in
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);
}
@ -1334,7 +1334,7 @@ hsGMaterial *hsMaterialConverter::IAddDefaultMaterial(plMaxNode *node)
plLocation loc = node->GetLocation();
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;
layer->InitToDefault();
@ -1575,7 +1575,7 @@ hsGMaterial *hsMaterialConverter::IProcessCompositeMtl(Mtl *mtl, plMaxNode *node
uint32_t *layerCounts = new uint32_t[mtl->NumSubMtls()];
IParamBlock2 *pb = mtl->GetParamBlockByID(plCompositeMtl::kBlkPasses);
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);
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));
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);
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 ||
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();
}
@ -1822,7 +1822,7 @@ plLayerAnimation *IConvertNoteTrackAnims(plLayerAnimation *animLayer, SegmentMap
if (spec->fType == SegmentSpec::kAnim)
{
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());
if (animLayer->GetPreshadeColorCtl())
@ -2049,7 +2049,7 @@ plLayerInterface* IProcessLayerAnimation(plPassMtlBase* mtl, plLayerTex* layTex,
if( mtl->GetUseGlobal() )
{
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());
SDLLayer->SetVarName((char*)mtl->GetGlobalVarName());
@ -2150,7 +2150,7 @@ plLayerInterface* IProcessAnimation(plPassMtlBase *mtl, plMaxNode *node, const p
// return layerIFace;
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());
SDLLayer->SetVarName((char*)mtl->GetGlobalVarName());
@ -3084,7 +3084,7 @@ void hsMaterialConverter::IAppendFunkyLayer(plMaxNode* node, Texmap* texMap, hsG
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;
layer->InitToDefault();
@ -3223,7 +3223,7 @@ void hsMaterialConverter::IAppendWetLayer(plMaxNode* node, hsGMaterial* mat)
uvwXfm.fMap[1][2] = -1.f / (tr - op);
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;
plKey key = node->FindPageKey( plLayer::Index(), name );
@ -3695,13 +3695,13 @@ plLayer* hsMaterialConverter::IMakeBumpLayer(plMaxNode* node, const plString& na
switch( miscFlag & hsGMatState::kMiscBumpChans )
{
case hsGMatState::kMiscBumpDu:
name = plString::Format("%s_DU_BumpLut", nameBase.c_str());
name = plFormat("{}_DU_BumpLut", nameBase);
break;
case hsGMatState::kMiscBumpDv:
name = plString::Format("%s_DV_BumpLut", nameBase.c_str());
name = plFormat("{}_DV_BumpLut", nameBase);
break;
case hsGMatState::kMiscBumpDw:
name = plString::Format("%s_DW_BumpLut", nameBase.c_str());
name = plFormat("{}_DW_BumpLut", nameBase);
break;
default:
hsAssert(false, "Bogus flag input to MakeBumpLayer");
@ -3779,7 +3779,7 @@ void hsMaterialConverter::IInsertBumpLayers(plMaxNode* node, hsGMaterial* mat, i
(bumpLay->GetBlendFlags() & ~hsGMatState::kBlendMask)
| hsGMatState::kBlendDot3);
plString name = mat->GetLayer(bumpLayerIdx)->GetKey()->GetName();
plString name = mat->GetLayer(bumpLayerIdx)->GetKeyName();
plLayer* layerDu = IMakeBumpLayer(node, name, mat, hsGMatState::kMiscBumpDu);
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[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);
plNodeRefMsg* nodeRefMsg = new plNodeRefMsg(plKeyFinder::Instance().FindSceneNodeKey(loc),
@ -4621,7 +4621,7 @@ static int ICompareBaseLayerTexture(const hsMaterialConverter::DoneMaterialData*
if( !oneTex && twoTex )
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)
@ -4678,7 +4678,7 @@ static int ICompareDoneLayers(const plLayerInterface* one, const plLayerInterfac
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 )
return -1;
else if( retVal > 0 )
@ -5132,7 +5132,7 @@ hsMaterialConverter::DoneMaterialData* hsMaterialConverter::IFindDoneMaterial(Do
plMipmap *hsMaterialConverter::GetStaticColorTexture(Color c, plLocation &loc)
{
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 h = 4;

View File

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

View File

@ -105,7 +105,7 @@ plClusterGroup* plClusterUtil::CreateGroup(plMaxNode* templNode, const char* nam
{
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());
plKey sceneNode = templNode->GetRoomKey();

View File

@ -570,10 +570,10 @@ plLayerInterface *plLayerConverter::IConvertDynamicEnvLayer( plPlasmaMAXLayer
if( anchor == maxNode )
{
// 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
texName = plString::Format( "%s_cubicRT", plasmaLayer->GetKeyName().c_str() );
texName = plFormat("{}_cubicRT", plasmaLayer->GetKeyName());
plBitmap *texture = (plBitmap *)IMakeCubicRenderTarget( texName, maxNode, anchor );
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)
{
plString funkName = plString::Format("%s_%d_%d",
isAdd ? "AttenRampAdd" : "AttenRampMult",
loClamp,
hiClamp);
plString funkName = plFormat("{}_{}_{}", isAdd ? "AttenRampAdd" : "AttenRampMult",
loClamp, hiClamp);
float range = float(hiClamp - 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
// 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?
key = node->FindPageKey( plDynamicTextMap::Index(), texName );
@ -1124,7 +1122,7 @@ plCubicRenderTarget *plLayerConverter::IMakeCubicRenderTarget( const plString &n
/// Now make a modifier
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()->AddViaNotify( cubic->GetKey(), new plGenRefMsg( mod->GetKey(), plRefMsg::kOnCreate, 0, 0 ), plRefFlags::kPassiveRef );

View File

@ -369,7 +369,7 @@ bool plLightMapGen::ICompressLightMaps()
{
const plLocation &textureLoc = plPluginResManager::ResMgr()->GetCommonPage(orig->GetKey()->GetUoid().GetLocation(),
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));
if( compKey )
@ -1255,7 +1255,7 @@ plLayerInterface* plLightMapGen::IMakeLightMapLayer(plMaxNode* node, plGeometryS
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();
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
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);
@ -1310,7 +1310,7 @@ plLayerInterface* plLightMapGen::IMakeLightMapLayer(plMaxNode* node, plGeometryS
}
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
@ -1320,7 +1320,7 @@ plLayerInterface* plLightMapGen::IMakeLightMapLayer(plMaxNode* node, plGeometryS
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));

View File

@ -494,7 +494,7 @@ bool plMeshConverter::IValidateUVs(plMaxNode* node)
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());
if (fWarnSuspiciousUVs)