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:
@ -138,8 +138,7 @@ hsBool plCaptureRender::Capture(const plKey& ack, UInt16 width, UInt16 height)
|
||||
plRenderTarget* rt = TRACKED_NEW plRenderTarget(flags, width, height, bitDepth, zDepth, stencilDepth);
|
||||
|
||||
static int idx=0;
|
||||
char buff[32];
|
||||
sprintf(buff, "tRT%d", idx++);
|
||||
plString buff = plString::Format("tRT%d", idx++);
|
||||
hsgResMgr::ResMgr()->NewKey(buff, rt, ack->GetUoid().GetLocation());
|
||||
|
||||
|
||||
@ -181,8 +180,7 @@ hsBool plCaptureRender::IProcess(plPipeline* pipe, const plKey& ack, plRenderTar
|
||||
static int currentCapIndex = 0;
|
||||
|
||||
// Mipmap isn't created with a key so let's give it one now
|
||||
char buff[512];
|
||||
sprintf(buff, "CaptureRender_%d", currentCapIndex++);
|
||||
plString buff = plString::Format("CaptureRender_%d", currentCapIndex++);
|
||||
|
||||
hsgResMgr::ResMgr()->NewKey(buff, mipMap, plLocation::kGlobalFixedLoc);
|
||||
mipMap->Ref();
|
||||
|
@ -235,7 +235,7 @@ void plDXTextureRef::Release( void )
|
||||
{
|
||||
plProfile_DelMem(MemTexture, fDataSize + sizeof(plDXTextureRef));
|
||||
plProfile_Extern(ManagedMem);
|
||||
PROFILE_POOL_MEM(D3DPOOL_MANAGED, fDataSize, false, (fOwner ? fOwner->GetKey() ? fOwner->GetKey()->GetUoid().GetObjectName() : "(UnknownTexture)" : "(UnknownTexture)"));
|
||||
PROFILE_POOL_MEM(D3DPOOL_MANAGED, fDataSize, false, (fOwner ? fOwner->GetKey() ? fOwner->GetKey()->GetUoid().GetObjectName().c_str() : "(UnknownTexture)" : "(UnknownTexture)"));
|
||||
plDXPipeline::FreeManagedTexture(fDataSize);
|
||||
fDataSize = 0;
|
||||
|
||||
|
@ -1333,10 +1333,10 @@ hsBool plDXPipeline::ICreateDeviceObjects()
|
||||
/// Ok, we're done now
|
||||
#if MCN_BOUNDS_SPANS
|
||||
fBoundsSpans = TRACKED_NEW plDrawableSpans();
|
||||
hsgResMgr::ResMgr()->NewKey( "BoundsSpans", fBoundsSpans, plLocation::kGlobalFixedLoc );
|
||||
hsgResMgr::ResMgr()->NewKey( _TEMP_CONVERT_FROM_LITERAL("BoundsSpans"), fBoundsSpans, plLocation::kGlobalFixedLoc );
|
||||
fBoundsSpans->SetNativeProperty( plDrawable::kPropVolatile, true );
|
||||
fBoundsMat = TRACKED_NEW hsGMaterial();
|
||||
hsgResMgr::ResMgr()->NewKey( "BoundsMaterial", fBoundsMat, plLocation::kGlobalFixedLoc );
|
||||
hsgResMgr::ResMgr()->NewKey( _TEMP_CONVERT_FROM_LITERAL("BoundsMaterial"), fBoundsMat, plLocation::kGlobalFixedLoc );
|
||||
plLayer *lay = fBoundsMat->MakeBaseLayer();
|
||||
lay->SetMiscFlags( hsGMatState::kMiscWireFrame | hsGMatState::kMiscTwoSided );
|
||||
lay->SetShadeFlags( lay->GetShadeFlags() | hsGMatState::kShadeWhite );
|
||||
@ -8304,11 +8304,11 @@ IDirect3DTexture9 *plDXPipeline::IMakeD3DTexture( plDXTextureRef *ref, D3DFORM
|
||||
IGetD3DError();
|
||||
plStatusLog::AddLineS( "pipeline.log", 0xffff0000, "Unable to create texture (%s) Owner: %s "
|
||||
"Size: %d x %d NumLvls: %d Flags: %x",
|
||||
fSettings.fErrorStr, ref->fOwner ? ref->fOwner->GetKey() ? ref->fOwner->GetKey()->GetUoid().GetObjectName() : "" : "",
|
||||
fSettings.fErrorStr, ref->fOwner ? ref->fOwner->GetKey() ? ref->fOwner->GetKey()->GetUoid().GetObjectName().c_str() : "" : "",
|
||||
ref->fMaxWidth, ref->fMaxHeight, ref->fMMLvs, ref->GetFlags() );
|
||||
return nil;
|
||||
}
|
||||
PROFILE_POOL_MEM(poolType, ref->fDataSize, true, (ref->fOwner ? ref->fOwner->GetKey() ? ref->fOwner->GetKey()->GetUoid().GetObjectName() : "(UnknownTexture)" : "(UnknownTexture)"));
|
||||
PROFILE_POOL_MEM(poolType, ref->fDataSize, true, (ref->fOwner ? ref->fOwner->GetKey() ? ref->fOwner->GetKey()->GetUoid().GetObjectName().c_str() : "(UnknownTexture)" : "(UnknownTexture)"));
|
||||
fTexManaged += ref->fDataSize;
|
||||
|
||||
return texPtr;
|
||||
@ -8326,7 +8326,7 @@ void plDXPipeline::IFillD3DTexture( plDXTextureRef *ref )
|
||||
if( pTexDat == nil )
|
||||
{
|
||||
plStatusLog::AddLineS( "pipeline.log", 0xffff0000, "Unable to fill texture ref (data is nil) Owner: %s",
|
||||
ref->fOwner ? ref->fOwner->GetKey() ? ref->fOwner->GetKey()->GetUoid().GetObjectName() : "" : "" );
|
||||
ref->fOwner ? ref->fOwner->GetKey() ? ref->fOwner->GetKey()->GetUoid().GetObjectName().c_str() : "" : "" );
|
||||
return;
|
||||
}
|
||||
|
||||
@ -8341,7 +8341,7 @@ void plDXPipeline::IFillD3DTexture( plDXTextureRef *ref )
|
||||
IGetD3DError();
|
||||
plStatusLog::AddLineS( "pipeline.log", 0xffff0000, "Unable to lock texture level %d for filling (%s) Owner: %s "
|
||||
"Size: %d x %d NumLvls: %d Flags: %x",
|
||||
i, fSettings.fErrorStr, ref->fOwner ? ref->fOwner->GetKey() ? ref->fOwner->GetKey()->GetUoid().GetObjectName() : "" : "",
|
||||
i, fSettings.fErrorStr, ref->fOwner ? ref->fOwner->GetKey() ? ref->fOwner->GetKey()->GetUoid().GetObjectName().c_str() : "" : "",
|
||||
ref->fMaxWidth, ref->fMaxHeight, ref->fMMLvs, ref->GetFlags() );
|
||||
return;
|
||||
}
|
||||
@ -8361,7 +8361,7 @@ IDirect3DCubeTexture9 *plDXPipeline::IMakeD3DCubeTexture( plDXTextureRef *ref,
|
||||
IDirect3DCubeTexture9 *texPtr = nil;
|
||||
fManagedAlloced = true;
|
||||
WEAK_ERROR_CHECK(fD3DDevice->CreateCubeTexture( ref->fMaxWidth, ref->fMMLvs, 0, formatType, poolType, &texPtr, NULL));
|
||||
PROFILE_POOL_MEM(poolType, ref->fDataSize, true, (ref->fOwner ? ref->fOwner->GetKey() ? ref->fOwner->GetKey()->GetUoid().GetObjectName() : "(UnknownTexture)" : "(UnknownTexture)"));
|
||||
PROFILE_POOL_MEM(poolType, ref->fDataSize, true, (ref->fOwner ? ref->fOwner->GetKey() ? ref->fOwner->GetKey()->GetUoid().GetObjectName().c_str() : "(UnknownTexture)" : "(UnknownTexture)"));
|
||||
fTexManaged += ref->fDataSize;
|
||||
return texPtr;
|
||||
}
|
||||
@ -9367,7 +9367,7 @@ void plDXPipeline::IMakeOcclusionSnap()
|
||||
ident.Reset();
|
||||
|
||||
hsGMaterial* mat = TRACKED_NEW hsGMaterial;
|
||||
hsgResMgr::ResMgr()->NewKey( "OcclusionSnapMat", mat, plLocation::kGlobalFixedLoc );
|
||||
hsgResMgr::ResMgr()->NewKey( _TEMP_CONVERT_FROM_LITERAL("OcclusionSnapMat"), mat, plLocation::kGlobalFixedLoc );
|
||||
plLayer *lay = mat->MakeBaseLayer();
|
||||
lay->SetZFlags(hsGMatState::kZNoZWrite);
|
||||
lay->SetPreshadeColor(hsColorRGBA().Set(1.f, 0.5f, 0.5f, 1.f));
|
||||
|
@ -439,9 +439,7 @@ void plDynamicEnvMap::Read(hsStream* s, hsResMgr* mgr)
|
||||
nVis = s->ReadLE32();
|
||||
for( i = 0; i < nVis; i++)
|
||||
{
|
||||
char *name = s->ReadSafeString();
|
||||
plKey key = plKeyFinder::Instance().StupidSearch(nil, nil, plVisRegion::Index(), name);
|
||||
delete[] name;
|
||||
plKey key = plKeyFinder::Instance().StupidSearch(nil, nil, plVisRegion::Index(), s->ReadSafeString_TEMP());
|
||||
if (key)
|
||||
hsgResMgr::ResMgr()->AddViaNotify(key, TRACKED_NEW plGenRefMsg(GetKey(), plRefMsg::kOnCreate, -1, kRefVisSet), plRefFlags::kActiveRef);
|
||||
}
|
||||
@ -910,9 +908,7 @@ void plDynamicCamMap::Read(hsStream* s, hsResMgr* mgr)
|
||||
nVis = s->ReadLE32();
|
||||
for( i = 0; i < nVis; i++)
|
||||
{
|
||||
char *name = s->ReadSafeString();
|
||||
plKey key = plKeyFinder::Instance().StupidSearch(nil, nil, plVisRegion::Index(), name);
|
||||
delete[] name;
|
||||
plKey key = plKeyFinder::Instance().StupidSearch(nil, nil, plVisRegion::Index(), s->ReadSafeString_TEMP());
|
||||
if (key)
|
||||
hsgResMgr::ResMgr()->AddViaNotify(key, TRACKED_NEW plGenRefMsg(GetKey(), plRefMsg::kOnCreate, -1, kRefVisSet), plRefFlags::kActiveRef);
|
||||
}
|
||||
|
@ -164,10 +164,10 @@ void plPlate::SetTexture(plBitmap *texture)
|
||||
{
|
||||
plLayer *layer;
|
||||
hsGMaterial *material;
|
||||
char keyName[ 128 ];
|
||||
plString keyName;
|
||||
|
||||
material = TRACKED_NEW hsGMaterial();
|
||||
sprintf( keyName, "PlateBlank#%d", fMagicUniqueKeyInt++ );
|
||||
keyName = plString::Format( "PlateBlank#%d", fMagicUniqueKeyInt++ );
|
||||
hsgResMgr::ResMgr()->NewKey( keyName, material, plLocation::kGlobalFixedLoc );
|
||||
layer = material->MakeBaseLayer();
|
||||
layer->SetShadeFlags( layer->GetShadeFlags() | hsGMatState::kShadeNoShade | hsGMatState::kShadeWhite | hsGMatState::kShadeReallyNoFog );
|
||||
@ -202,7 +202,7 @@ plMipmap *plPlate::CreateMaterial( UInt32 width, UInt32 height, hsBool withAl
|
||||
{
|
||||
plLayer *layer;
|
||||
hsGMaterial *material;
|
||||
char keyName[ 128 ];
|
||||
plString keyName;
|
||||
|
||||
|
||||
if (texture)
|
||||
@ -214,14 +214,14 @@ plMipmap *plPlate::CreateMaterial( UInt32 width, UInt32 height, hsBool withAl
|
||||
/// Create a new bitmap
|
||||
fMipmap = TRACKED_NEW plMipmap( width, height, withAlpha ? plMipmap::kARGB32Config : plMipmap::kRGB32Config, 1 );
|
||||
memset( fMipmap->GetImage(), 0xff, height * fMipmap->GetRowBytes() );
|
||||
sprintf( keyName, "PlateBitmap#%d", fMagicUniqueKeyInt++ );
|
||||
keyName = plString::Format( "PlateBitmap#%d", 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 = TRACKED_NEW hsGMaterial();
|
||||
sprintf( keyName, "PlateBlank#%d", fMagicUniqueKeyInt++ );
|
||||
keyName = plString::Format( "PlateBlank#%d", fMagicUniqueKeyInt++ );
|
||||
hsgResMgr::ResMgr()->NewKey( keyName, material, plLocation::kGlobalFixedLoc );
|
||||
layer = material->MakeBaseLayer();
|
||||
layer->SetShadeFlags( layer->GetShadeFlags() | hsGMatState::kShadeNoShade | hsGMatState::kShadeWhite | hsGMatState::kShadeReallyNoFog );
|
||||
@ -252,8 +252,7 @@ void plPlate::CreateFromResource(const char *resName)
|
||||
plMipmap* resTexture = TRACKED_NEW plMipmap;
|
||||
resTexture->CopyFrom(plClientResMgr::Instance().getResource(resName));
|
||||
|
||||
char keyName[128];
|
||||
sprintf( keyName, "PlateResource#%d", fMagicUniqueKeyInt++ );
|
||||
plString keyName = plString::Format( "PlateResource#%d", fMagicUniqueKeyInt++ );
|
||||
hsgResMgr::ResMgr()->NewKey(keyName, resTexture, plLocation::kGlobalFixedLoc);
|
||||
CreateMaterial(resTexture->GetWidth(), resTexture->GetHeight(), true, resTexture);
|
||||
}
|
||||
|
Reference in New Issue
Block a user