mirror of
https://foundry.openuru.org/gitblit/r/CWE-ou-minkata.git
synced 2025-07-17 10:52:46 +00:00
Convert plUoid's object name to a plString
This commit is contained in:
@ -259,8 +259,7 @@ plDrawableSpans *plDrawableGenerator::GenerateDrawable( UInt32 vertCount, hsPoin
|
||||
}
|
||||
|
||||
static int nameIdx = 0;
|
||||
char buff[256];
|
||||
sprintf(buff, "%s_%d", "GenDrawable", nameIdx++);
|
||||
plString buff = plString::Format( "GenDrawable_%d", nameIdx++ );
|
||||
hsgResMgr::ResMgr()->NewKey( buff, newDraw, plLocation::kGlobalFixedLoc );
|
||||
}
|
||||
|
||||
|
@ -1320,7 +1320,7 @@ hsBool plDrawableSpans::MsgReceive( plMessage* msg )
|
||||
}
|
||||
else if( plRenderMsg::ConvertNoRef( msg ) )
|
||||
{
|
||||
plProfile_BeginLap(PalletteHack, this->GetKey()->GetUoid().GetObjectName());
|
||||
plProfile_BeginLap(PalletteHack, this->GetKey()->GetUoid().GetObjectName().c_str());
|
||||
|
||||
IUpdateMatrixPaletteBoundsHack();
|
||||
|
||||
@ -1331,7 +1331,7 @@ hsBool plDrawableSpans::MsgReceive( plMessage* msg )
|
||||
// The pipeline will then clear out those bits as it blends them, and then we simply
|
||||
// re-set them here, since plRenderMsg is sent once before all the rendering is done :)
|
||||
fFakeBlendingSpanVector = fBlendingSpanVector;
|
||||
plProfile_EndLap(PalletteHack, this->GetKey()->GetUoid().GetObjectName());
|
||||
plProfile_EndLap(PalletteHack, this->GetKey()->GetUoid().GetObjectName().c_str());
|
||||
|
||||
return true;
|
||||
}
|
||||
|
@ -387,7 +387,7 @@ static void ILogSpan(plStatusLog* statusLog, plGeometrySpan* geo, plVertexSpan*
|
||||
|
||||
statusLog->AddLineF("From obj <%s> mat <%s> size %d bytes grp=%d (%d offset)",
|
||||
geo->fMaxOwner ? geo->fMaxOwner : "<unknown>",
|
||||
geo->fMaterial ? geo->fMaterial->GetKey()->GetName() : "<unknown>",
|
||||
geo->fMaterial ? geo->fMaterial->GetKey()->GetName().c_str() : "<unknown>",
|
||||
geo->GetVertexSize(geo->fFormat) * geo->fNumVerts + sizeof(UInt16) * geo->fNumIndices,
|
||||
span->fGroupIdx,
|
||||
ptr
|
||||
@ -405,7 +405,7 @@ static void ILogSpan(plStatusLog* statusLog, plGeometrySpan* geo, plVertexSpan*
|
||||
{
|
||||
statusLog->AddLineF("Instanced obj <%s> mat <%s> grp=%d (%d/%d/%d/%d/%d/%d/%d/%d)",
|
||||
geo->fMaxOwner ? geo->fMaxOwner : "<unknown>",
|
||||
geo->fMaterial ? geo->fMaterial->GetKey()->GetName() : "<unknown>",
|
||||
geo->fMaterial ? geo->fMaterial->GetKey()->GetName().c_str() : "<unknown>",
|
||||
span->fGroupIdx,
|
||||
span->fVBufferIdx,
|
||||
span->fCellIdx,
|
||||
@ -424,7 +424,7 @@ static void ILogSpan(plStatusLog* statusLog, plGeometrySpan* geo, plVertexSpan*
|
||||
{
|
||||
statusLog->AddLineF("From obj <%s> mat <%s> size %d bytes grp=%d (%d/%d/%d/%d/%d)",
|
||||
geo->fMaxOwner ? geo->fMaxOwner : "<unknown>",
|
||||
geo->fMaterial ? geo->fMaterial->GetKey()->GetName() : "<unknown>",
|
||||
geo->fMaterial ? geo->fMaterial->GetKey()->GetName().c_str() : "<unknown>",
|
||||
geo->GetVertexSize(geo->fFormat) * geo->fNumVerts + sizeof(UInt16) * geo->fNumIndices,
|
||||
span->fGroupIdx,
|
||||
span->fVBufferIdx,
|
||||
@ -438,7 +438,7 @@ static void ILogSpan(plStatusLog* statusLog, plGeometrySpan* geo, plVertexSpan*
|
||||
{
|
||||
statusLog->AddLineF("Instanced obj <%s> mat <%s> grp=%d (%d/%d/%d/%d/%d)",
|
||||
geo->fMaxOwner ? geo->fMaxOwner : "<unknown>",
|
||||
geo->fMaterial ? geo->fMaterial->GetKey()->GetName() : "<unknown>",
|
||||
geo->fMaterial ? geo->fMaterial->GetKey()->GetName().c_str() : "<unknown>",
|
||||
span->fGroupIdx,
|
||||
span->fVBufferIdx,
|
||||
span->fCellIdx,
|
||||
@ -755,18 +755,18 @@ short plDrawableSpans::ICompareSpans( plGeometrySpan *span1, plGeometrySpan *s
|
||||
else if( t1 == nil && t2 == nil )
|
||||
break; // Textures equal up to here--keep going with rest of tests
|
||||
|
||||
if( t1->GetKeyName() != nil && t2->GetKeyName() != nil )
|
||||
if( !t1->GetKeyName().IsNull() && !t2->GetKeyName().IsNull() )
|
||||
{
|
||||
j = stricmp( t1->GetKeyName(), t2->GetKeyName() );
|
||||
j = t1->GetKeyName().Compare( t2->GetKeyName(), plString::kCaseInsensitive );
|
||||
if( j != 0 )
|
||||
return (short)j;
|
||||
}
|
||||
}
|
||||
|
||||
// Finally, by material itself.
|
||||
if( span1->fMaterial->GetKeyName() != nil && span2->fMaterial->GetKeyName() != nil )
|
||||
if( !span1->fMaterial->GetKeyName().IsNull() && !span2->fMaterial->GetKeyName().IsNull() )
|
||||
{
|
||||
j = stricmp( span1->fMaterial->GetKeyName(), span2->fMaterial->GetKeyName() );
|
||||
j = span1->fMaterial->GetKeyName().Compare( span2->fMaterial->GetKeyName(), plString::kCaseInsensitive );
|
||||
if( j != 0 )
|
||||
return (short)j;
|
||||
}
|
||||
|
@ -1578,21 +1578,20 @@ hsGMaterial* plDynaDecalMgr::IConvertToEnvMap(hsGMaterial* mat, plBitmap* envMap
|
||||
oldMip->SetCurrLevel(0);
|
||||
|
||||
hsGMaterial* newMat = TRACKED_NEW hsGMaterial;
|
||||
char buff[256];
|
||||
sprintf(buff, "%s_%s", GetKey()->GetName(), "EnvMat");
|
||||
plString buff = plString::Format("%s_EnvMat", GetKey()->GetName().c_str());
|
||||
hsgResMgr::ResMgr()->NewKey(buff, newMat, GetKey()->GetUoid().GetLocation());
|
||||
|
||||
static plTweak<hsScalar> 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);
|
||||
sprintf(buff, "%s_%s", GetKey()->GetName(), "BumpMap");
|
||||
buff = plString::Format("%s_BumpMap", GetKey()->GetName().c_str());
|
||||
hsgResMgr::ResMgr()->NewKey(buff, bumpMap, GetKey()->GetUoid().GetLocation());
|
||||
|
||||
bumpMap->SetFlags(bumpMap->GetFlags() | plMipmap::kBumpEnvMap | plMipmap::kForceNonCompressed);
|
||||
|
||||
plLayer* bumpLay = TRACKED_NEW plLayer;
|
||||
sprintf(buff, "%s_%s_%d", GetKey()->GetName(), "BumpMap", 0);
|
||||
buff = plString::Format("%s_BumpMap_0", GetKey()->GetName().c_str());
|
||||
hsgResMgr::ResMgr()->NewKey(buff, bumpLay, GetKey()->GetUoid().GetLocation());
|
||||
|
||||
bumpLay->SetState(oldLay->GetState());
|
||||
@ -1614,7 +1613,7 @@ hsGMaterial* plDynaDecalMgr::IConvertToEnvMap(hsGMaterial* mat, plBitmap* envMap
|
||||
newMat->AddLayerViaNotify(bumpLay);
|
||||
|
||||
plLayer* envLay = TRACKED_NEW plLayer;
|
||||
sprintf(buff, "%s_%s_%d", GetKey()->GetName(), "EnvMap", 0);
|
||||
buff = plString::Format("%s_EnvMap_0", GetKey()->GetName().c_str());
|
||||
hsgResMgr::ResMgr()->NewKey(buff, envLay, GetKey()->GetUoid().GetLocation());
|
||||
|
||||
envLay->SetBlendFlags(hsGMatState::kBlendMult);
|
||||
|
@ -80,16 +80,16 @@ void plProxyGen::Init(const hsKeyedObject* owner)
|
||||
{
|
||||
if( !GetKey() )
|
||||
{
|
||||
char buff[256];
|
||||
plString buff;
|
||||
plLocation loc;
|
||||
if( owner->GetKey() )
|
||||
{
|
||||
sprintf(buff, "%s_%s_%d_%d", owner->GetKey()->GetName(), "ProxyGen", owner->GetKey()->GetUoid().GetClonePlayerID(), fProxyKeyCounter++);
|
||||
buff = plString::Format("%s_ProxyGen_%d_%d", owner->GetKey()->GetName().c_str(), owner->GetKey()->GetUoid().GetClonePlayerID(), fProxyKeyCounter++);
|
||||
loc = owner->GetKey()->GetUoid().GetLocation();
|
||||
}
|
||||
else
|
||||
{
|
||||
sprintf( buff, "ProxyGen%d", fProxyKeyCounter++ );
|
||||
buff = plString::Format( "ProxyGen%d", fProxyKeyCounter++ );
|
||||
loc = plLocation::kGlobalFixedLoc;
|
||||
}
|
||||
|
||||
@ -157,11 +157,11 @@ hsGMaterial* plProxyGen::IMakeProxyMaterial() const
|
||||
|
||||
hsGMaterial* retVal = TRACKED_NEW hsGMaterial();
|
||||
|
||||
char buff[256];
|
||||
if( GetKey()->GetName() )
|
||||
sprintf(buff, "%s_%s", GetKey()->GetName(), "Material");
|
||||
plString buff;
|
||||
if( !GetKey()->GetName().IsNull() )
|
||||
buff = plString::Format("%s_Material", GetKey()->GetName().c_str());
|
||||
else
|
||||
strcpy(buff, "ProxyMaterial");
|
||||
buff = _TEMP_CONVERT_FROM_LITERAL("ProxyMaterial");
|
||||
hsgResMgr::ResMgr()->NewKey( buff, retVal, GetKey() ? GetKey()->GetUoid().GetLocation() : plLocation::kGlobalFixedLoc );
|
||||
|
||||
plLayer *lay = retVal->MakeBaseLayer();
|
||||
@ -232,11 +232,11 @@ void plProxyGen::IGenerateProxy()
|
||||
|
||||
if( fProxyDrawables[idx] && !fProxyDrawables[idx]->GetKey() )
|
||||
{
|
||||
char buff[256];
|
||||
if( GetKey()->GetName() )
|
||||
sprintf(buff, "%s_%s", GetKey()->GetName(), "ProxyDrawable");
|
||||
plString buff;
|
||||
if( !GetKey()->GetName().IsNull() )
|
||||
buff = plString::Format("%s_ProxyDrawable", GetKey()->GetName().c_str());
|
||||
else
|
||||
strcpy(buff, "ProxyDrawable");
|
||||
buff = _TEMP_CONVERT_FROM_LITERAL("ProxyDrawable");
|
||||
|
||||
hsgResMgr::ResMgr()->NewKey( buff, fProxyDrawables[ idx ], GetKey() ? GetKey()->GetUoid().GetLocation() : plLocation::kGlobalFixedLoc );
|
||||
}
|
||||
|
@ -1617,8 +1617,7 @@ plMipmap* plWaveSet7::ICreateBiasNoiseMap()
|
||||
plMipmap::kUncompressed,
|
||||
plMipmap::UncompressedInfo::kRGB8888);
|
||||
|
||||
char buff[256];
|
||||
sprintf(buff, "%s_%s", GetKey()->GetName(), "BiasBitPS");
|
||||
plString buff = plString::Format("%s_BiasBitPS", GetKey()->GetName().c_str());
|
||||
hsgResMgr::ResMgr()->NewKey(buff, mipMap, GetKey()->GetUoid().GetLocation());
|
||||
|
||||
int i;
|
||||
@ -1663,8 +1662,7 @@ plMipmap* plWaveSet7::ICreateBumpMipmapPS()
|
||||
plMipmap::kUncompressed,
|
||||
plMipmap::UncompressedInfo::kRGB8888);
|
||||
|
||||
char buff[256];
|
||||
sprintf(buff, "%s_%s", GetKey()->GetName(), "BumpBitPS");
|
||||
plString buff = plString::Format("%s_BumpBitPS", GetKey()->GetName().c_str());
|
||||
hsgResMgr::ResMgr()->NewKey(buff, mipMap, GetKey()->GetUoid().GetLocation());
|
||||
|
||||
hsgResMgr::ResMgr()->SendRef(mipMap->GetKey(), TRACKED_NEW plGenRefMsg(GetKey(), plRefMsg::kOnRequest, 0, kRefCosineLUT), plRefFlags::kActiveRef);
|
||||
@ -1716,8 +1714,7 @@ void plWaveSet7::IAddBumpBiasLayer(hsGMaterial* mat)
|
||||
for( i = 0; i < 2; i++ )
|
||||
{
|
||||
plLayer* layer = TRACKED_NEW plLayer;
|
||||
char buff[256];
|
||||
sprintf(buff, "%s_%s_%d", GetKey()->GetName(), "Bias", i);
|
||||
plString buff = plString::Format("%s_Bias_%d", GetKey()->GetName().c_str(), i);
|
||||
hsgResMgr::ResMgr()->NewKey(buff, layer, GetKey()->GetUoid().GetLocation());
|
||||
|
||||
layer->SetBlendFlags(hsGMatState::kBlendAdd);
|
||||
@ -1752,8 +1749,7 @@ void plWaveSet7::IAddBumpBiasLayer(hsGMaterial* mat)
|
||||
plLayer* plWaveSet7::ICreateBumpLayerPS(plMipmap* mipMap, hsGMaterial* bumpMat, int which)
|
||||
{
|
||||
plLayer* layer = TRACKED_NEW plLayer;
|
||||
char buff[256];
|
||||
sprintf(buff, "%s_%s_%d", GetKey()->GetName(), "BumpLayerPS", which);
|
||||
plString buff = plString::Format("%s_BumpLayerPS_%d", GetKey()->GetName().c_str(), which);
|
||||
hsgResMgr::ResMgr()->NewKey(buff, layer, GetKey()->GetUoid().GetLocation());
|
||||
|
||||
layer->SetBlendFlags(which ? hsGMatState::kBlendAdd : 0);
|
||||
@ -1810,8 +1806,7 @@ hsGMaterial* plWaveSet7::ICreateBumpLayersPS()
|
||||
|
||||
// Create a blank material
|
||||
hsGMaterial* bumpMat = TRACKED_NEW hsGMaterial;
|
||||
char buff[256];
|
||||
sprintf(buff, "%s_%s", GetKey()->GetName(), "BumpMatPS");
|
||||
plString buff = plString::Format("%s_BumpMatPS", GetKey()->GetName());
|
||||
hsgResMgr::ResMgr()->NewKey(buff, bumpMat, GetKey()->GetUoid().GetLocation());
|
||||
|
||||
plMipmap* mipMap = ICreateBumpMipmapPS();
|
||||
@ -1852,8 +1847,7 @@ void plWaveSet7::IAddBumpBiasShaders(plLayer* layer)
|
||||
{
|
||||
plShader* vShader = TRACKED_NEW plShader;
|
||||
|
||||
char buff[256];
|
||||
sprintf(buff, "%s_BiasVS", GetKey()->GetName());
|
||||
plString buff = plString::Format("%s_BiasVS", GetKey()->GetName().c_str());
|
||||
hsgResMgr::ResMgr()->NewKey(buff, vShader, GetKey()->GetUoid().GetLocation());
|
||||
vShader->SetIsPixelShader(false);
|
||||
|
||||
@ -1916,8 +1910,7 @@ void plWaveSet7::IAddBumpBiasShaders(plLayer* layer)
|
||||
{
|
||||
plShader* pShader = TRACKED_NEW plShader;
|
||||
|
||||
char buff[256];
|
||||
sprintf(buff, "%s_BiasPS", GetKey()->GetName());
|
||||
plString buff = plString::Format("%s_BiasPS", GetKey()->GetName().c_str());
|
||||
hsgResMgr::ResMgr()->NewKey(buff, pShader, GetKey()->GetUoid().GetLocation());
|
||||
pShader->SetIsPixelShader(true);
|
||||
|
||||
@ -1950,8 +1943,7 @@ void plWaveSet7::IAddBumpVertexShader(hsGMaterial* mat, int iShader, int iFirst,
|
||||
int iShader = iBase / kBumpPerPass;
|
||||
|
||||
plShader* vShader = TRACKED_NEW plShader;
|
||||
char buff[256];
|
||||
sprintf(buff, "%s_BumpVS_%d", GetKey()->GetName(), iShader);
|
||||
plString buff = plString::Format("%s_BumpVS_%d", GetKey()->GetName().c_str(), iShader);
|
||||
hsgResMgr::ResMgr()->NewKey(buff, vShader, GetKey()->GetUoid().GetLocation());
|
||||
vShader->SetIsPixelShader(false);
|
||||
|
||||
@ -1996,8 +1988,7 @@ void plWaveSet7::IAddBumpPixelShader(hsGMaterial* mat, int iShader, int iFirst,
|
||||
int iShader = iBase / kBumpPerPass;
|
||||
|
||||
plShader* pShader = TRACKED_NEW plShader;
|
||||
char buff[256];
|
||||
sprintf(buff, "%s_BumpPS_%d", GetKey()->GetName(), iShader);
|
||||
plString buff = plString::Format("%s_BumpPS_%d", GetKey()->GetName().c_str(), iShader);
|
||||
hsgResMgr::ResMgr()->NewKey(buff, pShader, GetKey()->GetUoid().GetLocation());
|
||||
pShader->SetIsPixelShader(true);
|
||||
|
||||
@ -2039,8 +2030,7 @@ void plWaveSet7::IAddBumpPixelShader(hsGMaterial* mat, int iShader, int iFirst,
|
||||
plDrawableSpans* plWaveSet7::ICreateBumpDrawable()
|
||||
{
|
||||
fBumpDraw = TRACKED_NEW plDrawableSpans;
|
||||
char buff[256];
|
||||
sprintf(buff, "%s_BumpDraw", GetKey()->GetName());
|
||||
plString buff = plString::Format("%s_BumpDraw", GetKey()->GetName().c_str());
|
||||
hsgResMgr::ResMgr()->NewKey(buff, fBumpDraw, GetKey()->GetUoid().GetLocation());
|
||||
|
||||
ICreateClearDrawable(fBumpDraw, fBumpMat);
|
||||
@ -2155,8 +2145,7 @@ plRenderTarget* plWaveSet7::ICreateTransferRenderTarget(const char* name, int si
|
||||
|
||||
plRenderTarget* rt = TRACKED_NEW plRenderTarget(flags, size, size, bitDepth, zDepth, stencilDepth);
|
||||
|
||||
char buff[256];
|
||||
sprintf(buff, "%s_%s", GetKey()->GetName(), name);
|
||||
plString buff = plString::Format("%s_%s", GetKey()->GetName().c_str(), name);
|
||||
hsgResMgr::ResMgr()->NewKey(buff, rt, GetKey()->GetUoid().GetLocation());
|
||||
|
||||
return rt;
|
||||
@ -2168,8 +2157,7 @@ plLayer* plWaveSet7::ICreateTotalLayer(plBitmap* bm, hsGMaterial* mat, int which
|
||||
if( !layer )
|
||||
{
|
||||
layer = TRACKED_NEW plLayer;
|
||||
char buff[256];
|
||||
sprintf(buff, "%s_%sLayerPS_%d", GetKey()->GetName(), suff, which);
|
||||
plString buff = plString::Format("%s_%sLayerPS_%d", GetKey()->GetName().c_str(), suff, which);
|
||||
hsgResMgr::ResMgr()->NewKey(buff, layer, GetKey()->GetUoid().GetLocation());
|
||||
|
||||
layer->SetAmbientColor(hsColorRGBA().Set(0.f, 0.f, 0.f, 1.f));
|
||||
@ -2203,8 +2191,7 @@ plLayer* plWaveSet7::ICreateTotalLayer(plBitmap* bm, hsGMaterial* mat, int which
|
||||
plLayer* plWaveSet7::ICreateTotalEnvLayer(plBitmap* envMap, hsGMaterial* mat, int which, const char* pref)
|
||||
{
|
||||
plLayer* layer = TRACKED_NEW plLayer;
|
||||
char buff[256];
|
||||
sprintf(buff, "%s_%s_%s_%d", GetKey()->GetName(), pref, "EnvLayerPS", which);
|
||||
plString buff = plString::Format("%s_%s_EnvLayerPS_%d", GetKey()->GetName().c_str(), pref, which);
|
||||
hsgResMgr::ResMgr()->NewKey(buff, layer, GetKey()->GetUoid().GetLocation());
|
||||
|
||||
layer->SetBlendFlags(which ? hsGMatState::kBlendAddSigned : 0);
|
||||
@ -2304,8 +2291,7 @@ void plWaveSet7::IAddShoreVertexShader(hsGMaterial* mat)
|
||||
|
||||
plShader* vShader = TRACKED_NEW plShader;
|
||||
|
||||
char buff[256];
|
||||
sprintf(buff, "%s_ShoreVS", GetKey()->GetName());
|
||||
plString buff = plString::Format("%s_ShoreVS", GetKey()->GetName().c_str());
|
||||
hsgResMgr::ResMgr()->NewKey(buff, vShader, GetKey()->GetUoid().GetLocation());
|
||||
vShader->SetIsPixelShader(false);
|
||||
|
||||
@ -2358,8 +2344,7 @@ void plWaveSet7::IAddShorePixelShader(hsGMaterial* mat)
|
||||
{
|
||||
plShader* pShader = TRACKED_NEW plShader;
|
||||
|
||||
char buff[256];
|
||||
sprintf(buff, "%s_ShorePS", GetKey()->GetName());
|
||||
plString buff = plString::Format("%s_ShorePS", GetKey()->GetName().c_str());
|
||||
hsgResMgr::ResMgr()->NewKey(buff, pShader, GetKey()->GetUoid().GetLocation());
|
||||
pShader->SetIsPixelShader(true);
|
||||
|
||||
@ -2382,8 +2367,7 @@ void plWaveSet7::IAddFixedVertexShader(hsGMaterial* mat, const int numUVWs)
|
||||
|
||||
plShader* vShader = TRACKED_NEW plShader;
|
||||
|
||||
char buff[256];
|
||||
sprintf(buff, "%s_FixedVS", GetKey()->GetName());
|
||||
plString buff = plString::Format("%s_FixedVS", GetKey()->GetName().c_str());
|
||||
hsgResMgr::ResMgr()->NewKey(buff, vShader, GetKey()->GetUoid().GetLocation());
|
||||
vShader->SetIsPixelShader(false);
|
||||
|
||||
@ -2452,8 +2436,7 @@ void plWaveSet7::IAddFixedPixelShader(hsGMaterial* mat)
|
||||
if( !fFixedPShader )
|
||||
{
|
||||
plShader* pShader = TRACKED_NEW plShader;
|
||||
char buff[256];
|
||||
sprintf(buff, "%s_FixedPS", GetKey()->GetName());
|
||||
plString buff = plString::Format("%s_FixedPS", GetKey()->GetName().c_str());
|
||||
hsgResMgr::ResMgr()->NewKey(buff, pShader, GetKey()->GetUoid().GetLocation());
|
||||
pShader->SetIsPixelShader(true);
|
||||
|
||||
@ -2481,8 +2464,7 @@ void plWaveSet7::IAddRipVertexShader(hsGMaterial* mat, const plRipVSConsts& ripC
|
||||
if( !fRipVShader )
|
||||
{
|
||||
plShader* vShader = TRACKED_NEW plShader;
|
||||
char buff[256];
|
||||
sprintf(buff, "%s_RipVS", GetKey()->GetName());
|
||||
plString buff = plString::Format("%s_RipVS", GetKey()->GetName().c_str());
|
||||
hsgResMgr::ResMgr()->NewKey(buff, vShader, GetKey()->GetUoid().GetLocation());
|
||||
vShader->SetIsPixelShader(false);
|
||||
|
||||
@ -2567,8 +2549,7 @@ void plWaveSet7::IAddRipPixelShader(hsGMaterial* mat, const plRipVSConsts& ripCo
|
||||
if( !fRipPShader )
|
||||
{
|
||||
plShader* pShader = TRACKED_NEW plShader;
|
||||
char buff[256];
|
||||
sprintf(buff, "%s_RipPS", GetKey()->GetName());
|
||||
plString buff = plString::Format("%s_RipPS", GetKey()->GetName().c_str());
|
||||
hsgResMgr::ResMgr()->NewKey(buff, pShader, GetKey()->GetUoid().GetLocation());
|
||||
pShader->SetIsPixelShader(true);
|
||||
|
||||
@ -2627,8 +2608,7 @@ plShader* plWaveSet7::ICreateDecalVShader(DecalVType t)
|
||||
|
||||
|
||||
plShader* vShader = TRACKED_NEW plShader;
|
||||
char buff[256];
|
||||
sprintf(buff, "%s_%s", GetKey()->GetName(), fname[t]);
|
||||
plString buff = plString::Format("%s_%s", GetKey()->GetName().c_str(), fname[t]);
|
||||
hsgResMgr::ResMgr()->NewKey(buff, vShader, GetKey()->GetUoid().GetLocation());
|
||||
vShader->SetIsPixelShader(false);
|
||||
|
||||
@ -2756,8 +2736,7 @@ plShader* plWaveSet7::ICreateDecalPShader(DecalPType t)
|
||||
|
||||
plShader* pShader = TRACKED_NEW plShader;
|
||||
|
||||
char buff[256];
|
||||
sprintf(buff, "%s_%s", GetKey()->GetName(), fname[t]);
|
||||
plString buff = plString::Format("%s_%s", GetKey()->GetName().c_str(), fname[t]);
|
||||
hsgResMgr::ResMgr()->NewKey(buff, pShader, GetKey()->GetUoid().GetLocation());
|
||||
pShader->SetIsPixelShader(true);
|
||||
|
||||
@ -3698,8 +3677,7 @@ plDrawableSpans* plWaveSet7::ICreateGraphDrawable(plDrawableSpans* drawable, hsG
|
||||
plDrawableSpans* plWaveSet7::ICreateEmptyGraphDrawable(const char* name, UInt32 ref, int which)
|
||||
{
|
||||
plDrawableSpans* drawable = TRACKED_NEW plDrawableSpans;
|
||||
char buff[256];
|
||||
sprintf(buff, "%s_%s_%d", GetKey()->GetName(), name, which);
|
||||
plString buff = plString::Format("%s_%s_%d", GetKey()->GetName().c_str(), name, which);
|
||||
hsgResMgr::ResMgr()->NewKey(buff, drawable, GetKey()->GetUoid().GetLocation());
|
||||
|
||||
hsgResMgr::ResMgr()->SendRef(drawable->GetKey(), TRACKED_NEW plGenRefMsg(GetKey(), plRefMsg::kOnRequest, which, (Int8)ref), plRefFlags::kActiveRef);
|
||||
@ -3711,8 +3689,7 @@ hsGMaterial* plWaveSet7::ICreateEmptyMaterial(const char* name, UInt32 ref, int
|
||||
{
|
||||
hsGMaterial* mat = TRACKED_NEW hsGMaterial;
|
||||
|
||||
char buff[256];
|
||||
sprintf(buff, "%s_%s_%d", GetKey()->GetName(), name, which);
|
||||
plString buff = plString::Format("%s_%s_%d", GetKey()->GetName().c_str(), name, which);
|
||||
hsgResMgr::ResMgr()->NewKey(buff, mat, GetKey()->GetUoid().GetLocation());
|
||||
|
||||
hsgResMgr::ResMgr()->SendRef(mat->GetKey(), TRACKED_NEW plGenRefMsg(GetKey(), plRefMsg::kOnRequest, which, (Int8)ref), plRefFlags::kActiveRef);
|
||||
@ -3723,8 +3700,7 @@ hsGMaterial* plWaveSet7::ICreateEmptyMaterial(const char* name, UInt32 ref, int
|
||||
plLayer* plWaveSet7::ICreateBlankLayer(const char* name, int suff)
|
||||
{
|
||||
plLayer* lay = TRACKED_NEW plLayer;
|
||||
char buff[256];
|
||||
sprintf(buff, "%s_%s_%d", GetKey()->GetName(), name, suff);
|
||||
plString buff = plString::Format("%s_%s_%d", GetKey()->GetName().c_str(), name, suff);
|
||||
hsgResMgr::ResMgr()->NewKey(buff, lay, GetKey()->GetUoid().GetLocation());
|
||||
|
||||
return lay;
|
||||
@ -3739,8 +3715,7 @@ plMipmap* plWaveSet7::ICreateBlankTex(const char* name, int width, int height, U
|
||||
plMipmap::kUncompressed,
|
||||
plMipmap::UncompressedInfo::kRGB8888);
|
||||
|
||||
char buff[256];
|
||||
sprintf(buff, "%s_%s", GetKey()->GetName(), name);
|
||||
plString buff = plString::Format("%s_%s", GetKey()->GetName().c_str(), name);
|
||||
hsgResMgr::ResMgr()->NewKey(buff, mipMap, GetKey()->GetUoid().GetLocation());
|
||||
|
||||
hsgResMgr::ResMgr()->SendRef(mipMap->GetKey(), TRACKED_NEW plGenRefMsg(GetKey(), plRefMsg::kOnRequest, 0, (Int8)ref), plRefFlags::kActiveRef);
|
||||
@ -4146,8 +4121,7 @@ void plWaveSet7::IAddGraphVShader(hsGMaterial* mat, int iPass)
|
||||
if( !fGraphVShader[iPass] )
|
||||
{
|
||||
plShader* vShader = TRACKED_NEW plShader;
|
||||
char buff[256];
|
||||
sprintf(buff, "%s_GraphVS_%d", GetKey()->GetName(), iPass);
|
||||
plString buff = plString::Format("%s_GraphVS_%d", GetKey()->GetName().c_str(), iPass);
|
||||
hsgResMgr::ResMgr()->NewKey(buff, vShader, GetKey()->GetUoid().GetLocation());
|
||||
vShader->SetIsPixelShader(false);
|
||||
|
||||
@ -4181,8 +4155,7 @@ void plWaveSet7::IAddGraphPShader(hsGMaterial* mat, int iPass)
|
||||
if( !fGraphPShader[iPass] )
|
||||
{
|
||||
plShader* pShader = TRACKED_NEW plShader;
|
||||
char buff[256];
|
||||
sprintf(buff, "%s_GraphPS_%d", GetKey()->GetName(), iPass);
|
||||
plString buff = plString::Format("%s_GraphPS_%d", GetKey()->GetName().c_str(), iPass);
|
||||
hsgResMgr::ResMgr()->NewKey(buff, pShader, GetKey()->GetUoid().GetLocation());
|
||||
pShader->SetIsPixelShader(true);
|
||||
|
||||
@ -4252,11 +4225,11 @@ void plWaveSet7::ISetupGraphShore(hsGMaterial* mat)
|
||||
|
||||
void plWaveSet7::IMakeShoreLayer(hsGMaterial* mat, int which)
|
||||
{
|
||||
char name[512];
|
||||
plString name;
|
||||
if( which >= mat->GetNumLayers() )
|
||||
{
|
||||
plLayer* lay = TRACKED_NEW plLayer;
|
||||
sprintf(name, "%s_lay_%d", mat->GetKey()->GetName(), which);
|
||||
name = plString::Format("%s_lay_%d", mat->GetKey()->GetName().c_str(), which);
|
||||
hsgResMgr::ResMgr()->NewKey(name, lay, GetKey()->GetUoid().GetLocation());
|
||||
|
||||
lay->SetAmbientColor(hsColorRGBA().Set(0.f, 0.f, 0.f, 1.f));
|
||||
|
Reference in New Issue
Block a user