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

Get rid of NEW(), TRACKED_NEW, and ZERO().

This commit is contained in:
Darryl Pogue
2012-01-21 01:09:48 -08:00
committed by Adam Johnson
parent 30430d3024
commit 5013a978eb
423 changed files with 2500 additions and 2503 deletions

View File

@ -60,7 +60,7 @@ public:
void plAccMeshSmooth::FindEdges(uint32_t maxVtxIdx, uint32_t nTris, uint16_t* idxList, hsTArray<uint16_t>& edgeVerts)
{
hsTArray<EdgeBin>* bins = TRACKED_NEW hsTArray<EdgeBin>[maxVtxIdx+1];
hsTArray<EdgeBin>* bins = new hsTArray<EdgeBin>[maxVtxIdx+1];
hsBitVector edgeVertBits;
// For each vert pair (edge) in idxList
@ -161,8 +161,8 @@ void plAccMeshSmooth::FindEdges(hsTArray<plGeometrySpan*>& spans, hsTArray<uint1
void plAccMeshSmooth::Smooth(hsTArray<plGeometrySpan*>& spans)
{
hsTArray<uint16_t>* shareVtx = TRACKED_NEW hsTArray<uint16_t>[spans.GetCount()];
hsTArray<uint16_t>* edgeVerts = TRACKED_NEW hsTArray<uint16_t>[spans.GetCount()];
hsTArray<uint16_t>* shareVtx = new hsTArray<uint16_t>[spans.GetCount()];
hsTArray<uint16_t>* edgeVerts = new hsTArray<uint16_t>[spans.GetCount()];
FindEdges(spans, edgeVerts);
int i;
@ -354,4 +354,4 @@ void plAccMeshSmooth::SetDistTol(float dist)
float plAccMeshSmooth::GetDistTol() const
{
return sqrt(fDistTolSq);
}
}

View File

@ -104,7 +104,7 @@ void plAccessGeometry::Init(plPipeline* pipe)
{
plAccessGeometry* oldAcc = fInstance;
fInstance = NEW(plAccessGeometry)(pipe);
fInstance = new plAccessGeometry(pipe);
hsRefCnt_SafeUnRef(oldAcc);
}
@ -326,7 +326,7 @@ void plAccessGeometry::TakeSnapShot(plDrawable* drawable, uint32_t spanIdx, uint
const plSpan* span = ds->GetSpan(spanIdx);
if( !span->fSnapShot )
span->fSnapShot = NEW(plAccessSnapShot);
span->fSnapShot = new plAccessSnapShot;
plAccessSpan tmp;
OpenRO(drawable, spanIdx, tmp, false);

View File

@ -154,7 +154,7 @@ void plAccessSnapShot::ICopyOldData(uint8_t* data, const uint16_t* const oldSize
void plAccessSnapShot::ISetupPointers(uint16_t newStride)
{
fData = TRACKED_NEW uint8_t[fNumVerts * newStride];
fData = new uint8_t[fNumVerts * newStride];
int size = 0;
int chan;

View File

@ -125,6 +125,6 @@ hsBool plActivePrintShape::INotify()
plRippleShapeMsg* plActivePrintShape::ISetupShapeMsg()
{
fShapeMsg = TRACKED_NEW plRippleShapeMsg(nil, this);
fShapeMsg = new plRippleShapeMsg(nil, this);
return fShapeMsg;
}

View File

@ -60,7 +60,7 @@ public:
void plAvMeshSmooth::FindEdges(uint32_t maxVtxIdx, uint32_t nTris, uint16_t* idxList, hsTArray<uint16_t>& edgeVerts)
{
hsTArray<EdgeBin>* bins = TRACKED_NEW hsTArray<EdgeBin>[maxVtxIdx+1];
hsTArray<EdgeBin>* bins = new hsTArray<EdgeBin>[maxVtxIdx+1];
hsBitVector edgeVertBits;
// For each vert pair (edge) in idxList
@ -171,10 +171,10 @@ void plAvMeshSmooth::FindEdges(hsTArray<XfmSpan>& spans, hsTArray<uint16_t>* edg
// morph target mesh's local space. Whatever.
void plAvMeshSmooth::Smooth(hsTArray<XfmSpan>& srcSpans, hsTArray<XfmSpan>& dstSpans)
{
hsTArray<uint16_t>* dstEdgeVerts = TRACKED_NEW hsTArray<uint16_t>[dstSpans.GetCount()];
hsTArray<uint16_t>* dstEdgeVerts = new hsTArray<uint16_t>[dstSpans.GetCount()];
FindEdges(dstSpans, dstEdgeVerts);
hsTArray<uint16_t>* srcEdgeVerts = TRACKED_NEW hsTArray<uint16_t>[srcSpans.GetCount()];
hsTArray<uint16_t>* srcEdgeVerts = new hsTArray<uint16_t>[srcSpans.GetCount()];
FindEdges(srcSpans, srcEdgeVerts);
int i;
@ -283,4 +283,4 @@ void plAvMeshSmooth::SetDistTol(float dist)
float plAvMeshSmooth::GetDistTol() const
{
return sqrt(fDistTolSq);
}
}

View File

@ -74,7 +74,7 @@ void plCluster::Read(hsStream* s, plClusterGroup* grp)
int i;
for( i = 0; i < numInst; i++ )
{
fInsts[i] = TRACKED_NEW plSpanInstance;
fInsts[i] = new plSpanInstance;
fInsts[i]->Read(s, fEncoding, numVerts);
}

View File

@ -86,7 +86,7 @@ plClusterGroup::~plClusterGroup()
plCluster* plClusterGroup::IAddCluster()
{
plCluster* cluster = TRACKED_NEW plCluster;
plCluster* cluster = new plCluster;
// Set the cluster's group.
cluster->SetGroup(this);
fClusters.Append(cluster);
@ -109,26 +109,26 @@ void plClusterGroup::Read(hsStream* stream, hsResMgr* mgr)
int i;
fTemplate = TRACKED_NEW plSpanTemplate;
fTemplate = new plSpanTemplate;
fTemplate->Read(stream);
mgr->ReadKeyNotifyMe(stream, TRACKED_NEW plGenRefMsg(GetKey(), plRefMsg::kOnCreate, -1, kRefMaterial), plRefFlags::kActiveRef);
mgr->ReadKeyNotifyMe(stream, new plGenRefMsg(GetKey(), plRefMsg::kOnCreate, -1, kRefMaterial), plRefFlags::kActiveRef);
const int numClust = stream->ReadLE32();
fClusters.SetCount(numClust);
for( i = 0; i < numClust; i++ )
{
fClusters[i] = TRACKED_NEW plCluster;
fClusters[i] = new plCluster;
fClusters[i]->Read(stream, this);
}
const int numRegions = stream->ReadLE32();
for( i = 0; i < numRegions; i++ )
mgr->ReadKeyNotifyMe(stream, TRACKED_NEW plGenRefMsg(GetKey(), plRefMsg::kOnCreate, -1, kRefRegion), plRefFlags::kActiveRef);
mgr->ReadKeyNotifyMe(stream, new plGenRefMsg(GetKey(), plRefMsg::kOnCreate, -1, kRefRegion), plRefFlags::kActiveRef);
const int numLights = stream->ReadLE32();
for( i = 0; i < numLights; i++ )
mgr->ReadKeyNotifyMe(stream, TRACKED_NEW plGenRefMsg(GetKey(), plRefMsg::kOnCreate, -1, kRefLight), plRefFlags::kActiveRef);
mgr->ReadKeyNotifyMe(stream, new plGenRefMsg(GetKey(), plRefMsg::kOnCreate, -1, kRefLight), plRefFlags::kActiveRef);
fLOD.Read(stream);
@ -172,7 +172,7 @@ void plClusterGroup::Write(hsStream* stream, hsResMgr* mgr)
void plClusterGroup::ISendToSelf(RefType t, hsKeyedObject* ref)
{
hsAssert(ref, "Sending self a nil object");
plGenRefMsg* refMsg = TRACKED_NEW plGenRefMsg(GetKey(), plRefMsg::kOnCreate, -1, t);
plGenRefMsg* refMsg = new plGenRefMsg(GetKey(), plRefMsg::kOnCreate, -1, t);
hsgResMgr::ResMgr()->SendRef(ref->GetKey(), refMsg, plRefFlags::kActiveRef);
}
@ -299,7 +299,7 @@ hsBool plClusterGroup::MsgReceive(plMessage* msg)
void plClusterGroup::UnPack()
{
plDrawableSpans* drawable = TRACKED_NEW plDrawableSpans;
plDrawableSpans* drawable = new plDrawableSpans;
fDrawable = hsgResMgr::ResMgr()->NewKey(GetKey()->GetName(), drawable, GetKey()->GetUoid().GetLocation());
drawable->UnPackCluster(this);

View File

@ -250,7 +250,7 @@ plDrawableSpans *plDrawableGenerator::GenerateDrawable( uint32_t vertCount, hsPo
newDraw = toAddTo;
else
{
newDraw = TRACKED_NEW plDrawableSpans;
newDraw = new plDrawableSpans;
// newDraw->SetNativeProperty( plDrawable::kPropVolatile, true );
if( blended )
{
@ -266,7 +266,7 @@ plDrawableSpans *plDrawableGenerator::GenerateDrawable( uint32_t vertCount, hsPo
// Create a temp plGeometrySpan
spanArray.SetCount( 1 );
span = spanArray[ 0 ] = TRACKED_NEW plGeometrySpan;
span = spanArray[ 0 ] = new plGeometrySpan;
IFillSpan( vertCount, positions, normals,
uvws, uvwsPerVtx,

View File

@ -204,7 +204,7 @@ void plDrawableSpans::SetSceneNode( plKey newNode )
return;
if( newNode )
{
plNodeRefMsg* refMsg = TRACKED_NEW plNodeRefMsg(newNode, plNodeRefMsg::kOnRequest, -1, plNodeRefMsg::kDrawable);
plNodeRefMsg* refMsg = new plNodeRefMsg(newNode, plNodeRefMsg::kOnRequest, -1, plNodeRefMsg::kDrawable);
hsgResMgr::ResMgr()->SendRef(GetKey(), refMsg, plRefFlags::kActiveRef);
}
if( curNode )
@ -943,7 +943,7 @@ void plDrawableSpans::Read( hsStream* s, hsResMgr* mgr )
fMaterials.SetCountAndZero( count );
for( i = 0; i < count; i++ )
{
refMsg = TRACKED_NEW plGenRefMsg( GetKey(), plRefMsg::kOnCreate, i, kMsgMaterial );
refMsg = new plGenRefMsg( GetKey(), plRefMsg::kOnCreate, i, kMsgMaterial );
mgr->ReadKeyNotifyMe( s, refMsg, plRefFlags::kActiveRef );
}
@ -991,7 +991,7 @@ void plDrawableSpans::Read( hsStream* s, hsResMgr* mgr )
for( i = 0; i < count; i++ )
{
// Ref message for the fog environment
refMsg = TRACKED_NEW plGenRefMsg( GetKey(), plRefMsg::kOnCreate, i, kMsgFogEnviron );
refMsg = new plGenRefMsg( GetKey(), plRefMsg::kOnCreate, i, kMsgFogEnviron );
mgr->ReadKeyNotifyMe( s, refMsg, plRefFlags::kActiveRef );
}
@ -1017,7 +1017,7 @@ void plDrawableSpans::Read( hsStream* s, hsResMgr* mgr )
int j;
for( j = 0; j < lcnt; j++ )
{
mgr->ReadKeyNotifyMe( s, TRACKED_NEW plGenRefMsg(GetKey(), plRefMsg::kOnCreate, i, kMsgPermaLight), plRefFlags::kPassiveRef);
mgr->ReadKeyNotifyMe( s, new plGenRefMsg(GetKey(), plRefMsg::kOnCreate, i, kMsgPermaLight), plRefFlags::kPassiveRef);
}
}
if( fSpans[i]->fProps & plSpan::kPropHasPermaProjs )
@ -1026,7 +1026,7 @@ void plDrawableSpans::Read( hsStream* s, hsResMgr* mgr )
int j;
for( j = 0; j < lcnt; j++ )
{
mgr->ReadKeyNotifyMe( s, TRACKED_NEW plGenRefMsg(GetKey(), plRefMsg::kOnCreate, i, kMsgPermaProj), plRefFlags::kPassiveRef);
mgr->ReadKeyNotifyMe( s, new plGenRefMsg(GetKey(), plRefMsg::kOnCreate, i, kMsgPermaProj), plRefFlags::kPassiveRef);
}
}
}
@ -1038,7 +1038,7 @@ void plDrawableSpans::Read( hsStream* s, hsResMgr* mgr )
fSourceSpans.SetCount( count );
for( i = 0; i < count; i++ )
{
fSourceSpans[ i ] = TRACKED_NEW plGeometrySpan;
fSourceSpans[ i ] = new plGeometrySpan;
fSourceSpans[ i ]->Read( s );
fSourceSpans[ i ]->fMaterial = GetMaterial( fSpans[ i ]->fMaterialIdx );
fSourceSpans[ i ]->fFogEnviron = fSpans[ i ]->fFogEnvironment;
@ -1068,7 +1068,7 @@ void plDrawableSpans::Read( hsStream* s, hsResMgr* mgr )
fDIIndices.SetCountAndZero( count );
for( i = 0; i < count; i++ )
{
fDIIndices[ i ] = TRACKED_NEW plDISpanIndex;
fDIIndices[ i ] = new plDISpanIndex;
fDIIndices[ i ]->fFlags = (uint8_t)(s->ReadLE32());
count2 = s->ReadLE32();
@ -1081,7 +1081,7 @@ void plDrawableSpans::Read( hsStream* s, hsResMgr* mgr )
count = s->ReadLE32();
while( count-- )
{
group = TRACKED_NEW plGBufferGroup(0, fProps & kPropVolatile, fProps & kPropSortFaces);
group = new plGBufferGroup(0, fProps & kPropVolatile, fProps & kPropSortFaces);
group->Read( s );
fGroups.Append( group );
@ -1098,7 +1098,7 @@ void plDrawableSpans::Read( hsStream* s, hsResMgr* mgr )
fSpaceTree = plSpaceTree::ConvertNoRef(mgr->ReadCreatable(s));
fSceneNode = mgr->ReadKey(s);
plNodeRefMsg* nRefMsg = TRACKED_NEW plNodeRefMsg(fSceneNode, plRefMsg::kOnCreate, -1, plNodeRefMsg::kDrawable);
plNodeRefMsg* nRefMsg = new plNodeRefMsg(fSceneNode, plRefMsg::kOnCreate, -1, plNodeRefMsg::kDrawable);
mgr->AddViaNotify(GetKey(), nRefMsg, plRefFlags::kActiveRef);
if( GetNativeProperty(plDrawable::kPropCharacter) )
@ -2297,7 +2297,7 @@ uint32_t plDrawableSpans::NewDIMatrixIndex()
break;
}
if( index == fDIIndices.GetCount() )
fDIIndices.Append( TRACKED_NEW plDISpanIndex );
fDIIndices.Append( new plDISpanIndex );
fDIIndices[index]->Reset();
fDIIndices[index]->fFlags = plDISpanIndex::kMatrixOnly;
@ -2323,7 +2323,7 @@ plDISpanIndex *plDrawableSpans::IFindDIIndices( uint32_t &index )
break;
}
if( index == fDIIndices.GetCount() )
fDIIndices.Append( TRACKED_NEW plDISpanIndex );
fDIIndices.Append( new plDISpanIndex );
spanLookup = fDIIndices[ index ];
spanLookup->fFlags = plDISpanIndex::kNone;
@ -2503,7 +2503,7 @@ uint32_t plDrawableSpans::IRefMaterial( uint32_t index )
hsGMaterial *material = fMaterials[ index ];
if( GetKey() && material != nil && material->GetKey() != nil )
hsgResMgr::ResMgr()->AddViaNotify( material->GetKey(), TRACKED_NEW plGenRefMsg( GetKey(), plRefMsg::kOnCreate, index, 0 ), plRefFlags::kActiveRef );
hsgResMgr::ResMgr()->AddViaNotify( material->GetKey(), new plGenRefMsg( GetKey(), plRefMsg::kOnCreate, index, 0 ), plRefFlags::kActiveRef );
return index;
}
@ -2947,14 +2947,14 @@ void plDrawableSpans::IRemoveGarbage( void )
for( i = 0; i < fGroups.GetCount(); i++ )
{
hsAssert( fGroups[ i ]->GetNumVertexBuffers() == 1, "Cannot clean garbage on a non-volatile buffer group!" );
usedFlags[ i ] = TRACKED_NEW hsTArray<bool>;
usedFlags[ i ] = new hsTArray<bool>;
usedFlags[ i ]->SetCountAndZero( fGroups[ i ]->GetVertBufferCount( 0 ) );
usedIdxFlags[ i ] = TRACKED_NEW hsTArray<hsTArray<bool> *>;
usedIdxFlags[ i ] = new hsTArray<hsTArray<bool> *>;
usedIdxFlags[ i ]->SetCount( fGroups[ i ]->GetNumIndexBuffers() );
for( j = 0; j < fGroups[ i ]->GetNumIndexBuffers(); j++ )
{
(*usedIdxFlags[ i ])[ j ] = TRACKED_NEW hsTArray<bool>;
(*usedIdxFlags[ i ])[ j ] = new hsTArray<bool>;
(*usedIdxFlags[ i ])[ j ]->SetCountAndZero( fGroups[ i ]->GetIndexBufferCount( j ) );
}
}
@ -3327,7 +3327,7 @@ void plDrawableSpans::UnPackCluster(plClusterGroup* cluster)
iStart = iEnd;
}
fMaterials.SetCountAndZero(1);
plGenRefMsg* refMsg = TRACKED_NEW plGenRefMsg(GetKey(), plRefMsg::kOnCreate, 0, kMsgMaterial);
plGenRefMsg* refMsg = new plGenRefMsg(GetKey(), plRefMsg::kOnCreate, 0, kMsgMaterial);
hsgResMgr::ResMgr()->SendRef(cluster->GetMaterial()->GetKey(), refMsg, plRefFlags::kActiveRef);
fRenderLevel = cluster->GetRenderLevel();
@ -3361,7 +3361,7 @@ uint8_t plDrawableSpans::IFindBufferGroup(uint8_t vtxFormat, uint32_t numVerts
}
// Add a new one of the right format
fGroups.Append( TRACKED_NEW plGBufferGroup(vtxFormat, vertVolatile, idxVolatile, lod) );
fGroups.Append( new plGBufferGroup(vtxFormat, vertVolatile, idxVolatile, lod) );
return i;
}
@ -3444,7 +3444,7 @@ uint32_t plDrawableSpans::CreateParticleSystem( uint32_t maxNumSpans, uint3
// Make a shiny new set
set = TRACKED_NEW plParticleSet;
set = new plParticleSet;
set->fRefCount = 0;
/// Fill out info
@ -3666,7 +3666,7 @@ void plDrawableSpans::AssignEmitterToParticleSystem( uint32_t setIndex, plPar
if( icicle->fSortData == nil || icicle->fSortCount < ( numParticles << 1 ) )
{
delete [] icicle->fSortData;
icicle->fSortData = sortArray = TRACKED_NEW plGBufferTriangle[ numParticles << 1 ];
icicle->fSortData = sortArray = new plGBufferTriangle[ numParticles << 1 ];
icicle->fSortCount = numParticles << 1;
}
else

View File

@ -232,7 +232,7 @@ uint32_t plDrawableSpans::AddDISpans( hsTArray<plGeometrySpan *> &spans, uint32
{
/// Create a lookup entry
index = fDIIndices.GetCount();
fDIIndices.Append( TRACKED_NEW plDISpanIndex );
fDIIndices.Append( new plDISpanIndex );
fDIIndices[ index ]->fFlags = plDISpanIndex::kNone;
}
plDISpanIndex *spanLookup = fDIIndices[ index ];

View File

@ -65,7 +65,7 @@ static plRandom sRand;
int plDynaBulletMgr::INewDecal()
{
int idx = fDecals.GetCount();
fDecals.Append(TRACKED_NEW plDynaSplot());
fDecals.Append(new plDynaSplot());
return idx;
}

View File

@ -153,7 +153,7 @@ plDynaDecalMgr::plDynaDecalMgr()
fScale(1.f, 1.f, 1.f),
fPartyTime(1.f)
{
fCutter = TRACKED_NEW plCutter;
fCutter = new plCutter;
}
plDynaDecalMgr::~plDynaDecalMgr()
@ -194,21 +194,21 @@ void plDynaDecalMgr::Read(hsStream* stream, hsResMgr* mgr)
{
plSynchedObject::Read(stream, mgr);
mgr->ReadKeyNotifyMe(stream, TRACKED_NEW plGenRefMsg(GetKey(), plRefMsg::kOnCreate, 0, kRefMatPreShade), plRefFlags::kActiveRef);
mgr->ReadKeyNotifyMe(stream, new plGenRefMsg(GetKey(), plRefMsg::kOnCreate, 0, kRefMatPreShade), plRefFlags::kActiveRef);
mgr->ReadKeyNotifyMe(stream, TRACKED_NEW plGenRefMsg(GetKey(), plRefMsg::kOnCreate, 0, kRefMatRTShade), plRefFlags::kActiveRef);
mgr->ReadKeyNotifyMe(stream, new plGenRefMsg(GetKey(), plRefMsg::kOnCreate, 0, kRefMatRTShade), plRefFlags::kActiveRef);
int n = stream->ReadLE32();
int i;
for( i = 0; i < n; i++ )
{
mgr->ReadKeyNotifyMe(stream, TRACKED_NEW plGenRefMsg(GetKey(), plRefMsg::kOnCreate, 0, kRefTarget), plRefFlags::kPassiveRef);
mgr->ReadKeyNotifyMe(stream, new plGenRefMsg(GetKey(), plRefMsg::kOnCreate, 0, kRefTarget), plRefFlags::kPassiveRef);
}
// Associated slave particle systems. We read in the scene objects now, and find the associated systems on loaded message.
n = stream->ReadLE32();
for( i = 0; i < n; i++ )
{
mgr->ReadKeyNotifyMe(stream, TRACKED_NEW plGenRefMsg(GetKey(), plRefMsg::kOnCreate, 0, kRefPartyObject), plRefFlags::kPassiveRef);
mgr->ReadKeyNotifyMe(stream, new plGenRefMsg(GetKey(), plRefMsg::kOnCreate, 0, kRefPartyObject), plRefFlags::kPassiveRef);
}
fMaxNumVerts = (uint16_t)(stream->ReadLE32());
@ -502,7 +502,7 @@ void plDynaDecalMgr::INotifyActive(plDynaDecalInfo& info, const plKey& armKey, u
int i;
for( i = 0; i < fNotifies.GetCount(); i++ )
{
plDynaDecalEnableMsg* enaMsg = TRACKED_NEW plDynaDecalEnableMsg(fNotifies[i], armKey, secs, fWetLength, false, id);
plDynaDecalEnableMsg* enaMsg = new plDynaDecalEnableMsg(fNotifies[i], armKey, secs, fWetLength, false, id);
enaMsg->Send();
}
info.fFlags |= plDynaDecalInfo::kActive;
@ -517,7 +517,7 @@ void plDynaDecalMgr::INotifyInactive(plDynaDecalInfo& info, const plKey& armKey,
int i;
for( i = 0; i < fNotifies.GetCount(); i++ )
{
plDynaDecalEnableMsg* enaMsg = TRACKED_NEW plDynaDecalEnableMsg(fNotifies[i], armKey, secs, fWetLength, true, id);
plDynaDecalEnableMsg* enaMsg = new plDynaDecalEnableMsg(fNotifies[i], armKey, secs, fWetLength, true, id);
enaMsg->Send();
}
info.fFlags &= ~plDynaDecalInfo::kActive;
@ -544,7 +544,7 @@ plDynaDecalInfo& plDynaDecalMgr::IGetDecalInfo(uintptr_t id, const plKey& key)
{
plDynaDecalInfo decalInfo;
decalInfo.Init(key);
plGenRefMsg* refMsg = TRACKED_NEW plGenRefMsg(GetKey(), plRefMsg::kOnRequest, 0, kRefAvatar);
plGenRefMsg* refMsg = new plGenRefMsg(GetKey(), plRefMsg::kOnRequest, 0, kRefAvatar);
hsgResMgr::ResMgr()->AddViaNotify(plKey(key), refMsg, plRefFlags::kPassiveRef);
pair<plDynaDecalMap::iterator, bool> iterPair;
@ -688,7 +688,7 @@ plAuxSpan* plDynaDecalMgr::IGetAuxSpan(plDrawableSpans* targ, int iSpan, hsGMate
#ifdef MF_NEVER_RUN_OUT
// Okay, nothing there. Let's get a new one.
plAuxSpan* aux = TRACKED_NEW plAuxSpan;
plAuxSpan* aux = new plAuxSpan;
fAuxSpans.Append(aux);
IAllocAuxSpan(aux, numVerts, numIdx);
@ -712,7 +712,7 @@ void plDynaDecalMgr::InitAuxSpans()
int i;
for( i = 0; i < kInitAuxSpans; i++ )
{
plAuxSpan* aux = TRACKED_NEW plAuxSpan;
plAuxSpan* aux = new plAuxSpan;
fAuxSpans.Append(aux);
IAllocAuxSpan(aux, fMaxNumVerts, fMaxNumIdx);
}
@ -721,7 +721,7 @@ void plDynaDecalMgr::InitAuxSpans()
void plDynaDecalMgr::IAllocAuxSpan(plAuxSpan* aux, uint32_t maxNumVerts, uint32_t maxNumIdx)
{
int iGrp = fGroups.GetCount();
plGBufferGroup* grp = TRACKED_NEW plGBufferGroup(kDecalVtxFormat, true, false);
plGBufferGroup* grp = new plGBufferGroup(kDecalVtxFormat, true, false);
fGroups.Append(grp);
grp->ReserveVertStorage(maxNumVerts,
@ -1577,7 +1577,7 @@ hsGMaterial* plDynaDecalMgr::IConvertToEnvMap(hsGMaterial* mat, plBitmap* envMap
return mat;
oldMip->SetCurrLevel(0);
hsGMaterial* newMat = TRACKED_NEW hsGMaterial;
hsGMaterial* newMat = new hsGMaterial;
char buff[256];
sprintf(buff, "%s_%s", GetKey()->GetName(), "EnvMat");
hsgResMgr::ResMgr()->NewKey(buff, newMat, GetKey()->GetUoid().GetLocation());
@ -1591,7 +1591,7 @@ hsGMaterial* plDynaDecalMgr::IConvertToEnvMap(hsGMaterial* mat, plBitmap* envMap
bumpMap->SetFlags(bumpMap->GetFlags() | plMipmap::kBumpEnvMap | plMipmap::kForceNonCompressed);
plLayer* bumpLay = TRACKED_NEW plLayer;
plLayer* bumpLay = new plLayer;
sprintf(buff, "%s_%s_%d", GetKey()->GetName(), "BumpMap", 0);
hsgResMgr::ResMgr()->NewKey(buff, bumpLay, GetKey()->GetUoid().GetLocation());
@ -1608,12 +1608,12 @@ hsGMaterial* plDynaDecalMgr::IConvertToEnvMap(hsGMaterial* mat, plBitmap* envMap
bumpLay->SetRuntimeColor(oldLay->GetRuntimeColor());
bumpLay->SetOpacity(1.f);
plLayRefMsg* refMsg = TRACKED_NEW plLayRefMsg(bumpLay->GetKey(), plRefMsg::kOnCreate, 0, plLayRefMsg::kTexture);
plLayRefMsg* refMsg = new plLayRefMsg(bumpLay->GetKey(), plRefMsg::kOnCreate, 0, plLayRefMsg::kTexture);
hsgResMgr::ResMgr()->SendRef(bumpMap->GetKey(), refMsg, plRefFlags::kActiveRef);
newMat->AddLayerViaNotify(bumpLay);
plLayer* envLay = TRACKED_NEW plLayer;
plLayer* envLay = new plLayer;
sprintf(buff, "%s_%s_%d", GetKey()->GetName(), "EnvMap", 0);
hsgResMgr::ResMgr()->NewKey(buff, envLay, GetKey()->GetUoid().GetLocation());
@ -1628,7 +1628,7 @@ hsGMaterial* plDynaDecalMgr::IConvertToEnvMap(hsGMaterial* mat, plBitmap* envMap
envLay->SetRuntimeColor(oldLay->GetRuntimeColor());
envLay->SetOpacity(1.f);
refMsg = TRACKED_NEW plLayRefMsg(envLay->GetKey(), plRefMsg::kOnCreate, 0, plLayRefMsg::kTexture);
refMsg = new plLayRefMsg(envLay->GetKey(), plRefMsg::kOnCreate, 0, plLayRefMsg::kTexture);
hsgResMgr::ResMgr()->SendRef(envMap->GetKey(), refMsg, plRefFlags::kActiveRef);
newMat->AddLayerViaNotify(envLay);
@ -1640,11 +1640,11 @@ void plDynaDecalMgr::ConvertToEnvMap(plBitmap* envMap)
{
hsGMaterial* newPreShade = IConvertToEnvMap(fMatPreShade, envMap);
if( newPreShade && (newPreShade != fMatPreShade) )
hsgResMgr::ResMgr()->SendRef(newPreShade->GetKey(), TRACKED_NEW plGenRefMsg(GetKey(), plRefMsg::kOnCreate, 0, kRefMatPreShade), plRefFlags::kActiveRef);
hsgResMgr::ResMgr()->SendRef(newPreShade->GetKey(), new plGenRefMsg(GetKey(), plRefMsg::kOnCreate, 0, kRefMatPreShade), plRefFlags::kActiveRef);
hsGMaterial* newRTShade = IConvertToEnvMap(fMatRTShade, envMap);
if( newRTShade && (newRTShade != fMatRTShade) )
hsgResMgr::ResMgr()->SendRef(newRTShade->GetKey(), TRACKED_NEW plGenRefMsg(GetKey(), plRefMsg::kOnCreate, 0, kRefMatRTShade), plRefFlags::kActiveRef);
hsgResMgr::ResMgr()->SendRef(newRTShade->GetKey(), new plGenRefMsg(GetKey(), plRefMsg::kOnCreate, 0, kRefMatRTShade), plRefFlags::kActiveRef);
}
const plMipmap* plDynaDecalMgr::GetMipmap() const
@ -1796,7 +1796,7 @@ void plDynaDecalMgr::IGetParticles()
// const_cast here is just to see if it's in our list, make Find happy.
if( sys && (fParticles.kMissingIndex == fParticles.Find(const_cast<plParticleSystem*>(sys))) )
{
hsgResMgr::ResMgr()->AddViaNotify(sys->GetKey(), TRACKED_NEW plGenRefMsg(GetKey(), plRefMsg::kOnCreate, 0, kRefParticles), plRefFlags::kPassiveRef);
hsgResMgr::ResMgr()->AddViaNotify(sys->GetKey(), new plGenRefMsg(GetKey(), plRefMsg::kOnCreate, 0, kRefParticles), plRefFlags::kPassiveRef);
}
}
}

View File

@ -74,7 +74,7 @@ static const uint32_t kPrintIDs[kNumPrintIDs] =
int plDynaFootMgr::INewDecal()
{
int idx = fDecals.GetCount();
fDecals.Append(TRACKED_NEW plDynaSplot());
fDecals.Append(new plDynaSplot());
return idx;
}

View File

@ -82,7 +82,7 @@ int plDynaRippleMgr::INewDecal()
int idx = fDecals.GetCount();
#if 1
plDynaRipple* rip = TRACKED_NEW plDynaRipple();
plDynaRipple* rip = new plDynaRipple();
rip->fC1U = fInitUVW.fX;
rip->fC2U = (fInitUVW.fX - fFinalUVW.fX) / (fLifeSpan * fFinalUVW.fX);
@ -91,7 +91,7 @@ int plDynaRippleMgr::INewDecal()
fDecals.Append(rip);
#else
plDynaWave* wave = TRACKED_NEW plDynaWave();
plDynaWave* wave = new plDynaWave();
static float kDefScrollRate = 0.1f;
wave->fScrollRate = kDefScrollRate;
fDecals.Append(wave);

View File

@ -77,7 +77,7 @@ int plDynaRippleVSMgr::INewDecal()
{
int idx = fDecals.GetCount();
plDynaRippleVS* rip = TRACKED_NEW plDynaRippleVS();
plDynaRippleVS* rip = new plDynaRippleVS();
rip->fC1U = fInitUVW.fX;
rip->fC2U = (fInitUVW.fX - fFinalUVW.fX) / (fLifeSpan * fFinalUVW.fX);
@ -103,7 +103,7 @@ void plDynaRippleVSMgr::Read(hsStream* stream, hsResMgr* mgr)
{
plDynaRippleMgr::Read(stream, mgr);
mgr->ReadKeyNotifyMe(stream, TRACKED_NEW plGenRefMsg(GetKey(), plRefMsg::kOnCreate, 0, kRefWaveSetBase), plRefFlags::kPassiveRef);
mgr->ReadKeyNotifyMe(stream, new plGenRefMsg(GetKey(), plRefMsg::kOnCreate, 0, kRefWaveSetBase), plRefFlags::kPassiveRef);
}
void plDynaRippleVSMgr::Write(hsStream* stream, hsResMgr* mgr)

View File

@ -68,7 +68,7 @@ int plDynaTorpedoVSMgr::INewDecal()
{
int idx = fDecals.GetCount();
plDynaRippleVS* rip = TRACKED_NEW plDynaRippleVS();
plDynaRippleVS* rip = new plDynaRippleVS();
rip->fC1U = fInitUVW.fX;
rip->fC2U = (fInitUVW.fX - fFinalUVW.fX) / (fLifeSpan * fFinalUVW.fX);
@ -148,7 +148,7 @@ void plDynaTorpedoVSMgr::Read(hsStream* stream, hsResMgr* mgr)
{
plDynaTorpedoMgr::Read(stream, mgr);
mgr->ReadKeyNotifyMe(stream, TRACKED_NEW plGenRefMsg(GetKey(), plRefMsg::kOnCreate, 0, kRefWaveSetBase), plRefFlags::kPassiveRef);
mgr->ReadKeyNotifyMe(stream, new plGenRefMsg(GetKey(), plRefMsg::kOnCreate, 0, kRefWaveSetBase), plRefFlags::kPassiveRef);
}
void plDynaTorpedoVSMgr::Write(hsStream* stream, hsResMgr* mgr)

View File

@ -72,7 +72,7 @@ int plDynaWakeMgr::INewDecal()
{
int idx = fDecals.GetCount();
plDynaWake* wake = TRACKED_NEW plDynaWake();
plDynaWake* wake = new plDynaWake();
wake->fC1U = fInitUVW.fX;
wake->fC2U = (fInitUVW.fX - fFinalUVW.fX) / (fLifeSpan * fFinalUVW.fX);

View File

@ -299,7 +299,7 @@ plGeometrySpan* plGeoSpanDice::IExtractTris(plGeometrySpan* src, hsTArray<uint32
plGeometrySpan* plGeoSpanDice::IAllocSpace(plGeometrySpan* src, int numVerts, int numTris) const
{
plGeometrySpan* dst = TRACKED_NEW plGeometrySpan;
plGeometrySpan* dst = new plGeometrySpan;
// Do a structure copy here. That's okay, because we're going to immediately
// fix up the pointers and counters that shouldn't have been copied. If
// plGeometrySpan ever gets a copy constructor, this'll blow wide open.
@ -308,27 +308,27 @@ plGeometrySpan* plGeoSpanDice::IAllocSpace(plGeometrySpan* src, int numVerts, in
int stride = src->GetVertexSize(src->fFormat);
dst->fNumIndices = numTris * 3;
dst->fIndexData = TRACKED_NEW uint16_t[dst->fNumIndices];
dst->fIndexData = new uint16_t[dst->fNumIndices];
dst->fNumVerts = numVerts;
dst->fVertexData = TRACKED_NEW uint8_t[numVerts * stride];
dst->fVertexData = new uint8_t[numVerts * stride];
if( src->fMultColor )
{
dst->fMultColor = TRACKED_NEW hsColorRGBA[numVerts];
dst->fMultColor = new hsColorRGBA[numVerts];
}
if( src->fAddColor )
{
dst->fAddColor = TRACKED_NEW hsColorRGBA[numVerts];
dst->fAddColor = new hsColorRGBA[numVerts];
}
if( src->fDiffuseRGBA )
{
dst->fDiffuseRGBA = TRACKED_NEW uint32_t[numVerts];
dst->fDiffuseRGBA = new uint32_t[numVerts];
}
if( src->fSpecularRGBA )
{
dst->fSpecularRGBA = TRACKED_NEW uint32_t[numVerts];
dst->fSpecularRGBA = new uint32_t[numVerts];
}
return dst;
}
}

View File

@ -193,7 +193,7 @@ void plGeometrySpan::MakeInstanceOf( const plGeometrySpan *instance )
// Go find a new groupID
instance->fInstanceGroupID = IAllocateNewGroupID();
instance->fInstanceRefs = array = TRACKED_NEW hsTArray<plGeometrySpan *>;
instance->fInstanceRefs = array = new hsTArray<plGeometrySpan *>;
// Go figure, it won't append the const version to the array...this is a cheat,
// but then, so is making fInstanceRefs mutable :)
array->Append( (plGeometrySpan *)instance );
@ -220,7 +220,7 @@ void plGeometrySpan::IUnShareData()
uint32_t size = GetVertexSize( fFormat );
fVertexData = TRACKED_NEW uint8_t[ size * fNumVerts ];
fVertexData = new uint8_t[ size * fNumVerts ];
memcpy( fVertexData, oldVtxData, size * fNumVerts );
}
@ -228,7 +228,7 @@ void plGeometrySpan::IUnShareData()
{
hsColorRGBA* oldMult = fMultColor;
fMultColor = TRACKED_NEW hsColorRGBA[ fNumVerts ];
fMultColor = new hsColorRGBA[ fNumVerts ];
memcpy( fMultColor, oldMult, sizeof(hsColorRGBA) * fNumVerts );
}
@ -236,7 +236,7 @@ void plGeometrySpan::IUnShareData()
{
hsColorRGBA* oldAdd = fAddColor;
fAddColor = TRACKED_NEW hsColorRGBA[ fNumVerts ];
fAddColor = new hsColorRGBA[ fNumVerts ];
memcpy( fAddColor, oldAdd, sizeof(hsColorRGBA) * fNumVerts );
}
}
@ -250,7 +250,7 @@ void plGeometrySpan::BreakInstance()
hsAssert(fInstanceRefs->GetCount(), "Don't BreakInstance if I'm the last one, use UnInstance instead");
fInstanceGroupID = IAllocateNewGroupID();
fInstanceRefs = TRACKED_NEW hsTArray<plGeometrySpan*>;
fInstanceRefs = new hsTArray<plGeometrySpan*>;
fInstanceRefs->Append(this);
IUnShareData();
@ -350,7 +350,7 @@ hsTArray<plGeometrySpan *> *plGeometrySpan::IGetInstanceGroup( uint32_t groupID
if( fInstanceGroups.GetCount() <= groupID || fInstanceGroups[ groupID ] == nil )
{
// Not yet in the list--make a new hsTArray
array = TRACKED_NEW hsTArray<plGeometrySpan *>;
array = new hsTArray<plGeometrySpan *>;
fInstanceGroupIDFlags.SetBit( groupID, true );
if( expectedCount > 1 )
@ -416,7 +416,7 @@ void plGeometrySpan::IDuplicateUniqueData( const plGeometrySpan *source )
if( source->fIndexData != nil )
{
fIndexData = TRACKED_NEW uint16_t[ fNumIndices ];
fIndexData = new uint16_t[ fNumIndices ];
memcpy( fIndexData, source->fIndexData, sizeof( uint16_t ) * fNumIndices );
}
else
@ -424,7 +424,7 @@ void plGeometrySpan::IDuplicateUniqueData( const plGeometrySpan *source )
if( source->fDiffuseRGBA )
{
fDiffuseRGBA = TRACKED_NEW uint32_t[ fNumVerts ];
fDiffuseRGBA = new uint32_t[ fNumVerts ];
memcpy( fDiffuseRGBA, source->fDiffuseRGBA, sizeof( uint32_t ) * fNumVerts );
}
else
@ -432,7 +432,7 @@ void plGeometrySpan::IDuplicateUniqueData( const plGeometrySpan *source )
if( source->fSpecularRGBA )
{
fSpecularRGBA = TRACKED_NEW uint32_t[ fNumVerts ];
fSpecularRGBA = new uint32_t[ fNumVerts ];
memcpy( fSpecularRGBA, source->fSpecularRGBA, sizeof( uint32_t ) * fNumVerts );
}
else
@ -462,7 +462,7 @@ void plGeometrySpan::CopyFrom( const plGeometrySpan *source )
{
size = GetVertexSize( fFormat );
fVertexData = TRACKED_NEW uint8_t[ size * fNumVerts ];
fVertexData = new uint8_t[ size * fNumVerts ];
memcpy( fVertexData, source->fVertexData, size * fNumVerts );
}
else
@ -470,7 +470,7 @@ void plGeometrySpan::CopyFrom( const plGeometrySpan *source )
if( source->fMultColor )
{
fMultColor = TRACKED_NEW hsColorRGBA[ fNumVerts ];
fMultColor = new hsColorRGBA[ fNumVerts ];
memcpy( fMultColor, source->fMultColor, sizeof(hsColorRGBA) * fNumVerts );
}
else
@ -480,7 +480,7 @@ void plGeometrySpan::CopyFrom( const plGeometrySpan *source )
if( source->fAddColor )
{
fAddColor = TRACKED_NEW hsColorRGBA[ fNumVerts ];
fAddColor = new hsColorRGBA[ fNumVerts ];
memcpy( fAddColor, source->fAddColor, sizeof(hsColorRGBA) * fNumVerts );
}
else
@ -543,19 +543,19 @@ void plGeometrySpan::Read( hsStream *stream )
{
size = GetVertexSize( fFormat );
fVertexData = TRACKED_NEW uint8_t[ size * fNumVerts ];
fVertexData = new uint8_t[ size * fNumVerts ];
stream->Read( size * fNumVerts, fVertexData );
fMultColor = TRACKED_NEW hsColorRGBA[ fNumVerts ];
fAddColor = TRACKED_NEW hsColorRGBA[ fNumVerts ];
fMultColor = new hsColorRGBA[ fNumVerts ];
fAddColor = new hsColorRGBA[ fNumVerts ];
for( i = 0; i < fNumVerts; i++ )
{
fMultColor[ i ].Read( stream );
fAddColor[ i ].Read( stream );
}
fDiffuseRGBA = TRACKED_NEW uint32_t[ fNumVerts ];
fSpecularRGBA = TRACKED_NEW uint32_t[ fNumVerts ];
fDiffuseRGBA = new uint32_t[ fNumVerts ];
fSpecularRGBA = new uint32_t[ fNumVerts ];
stream->ReadLE32( fNumVerts, fDiffuseRGBA );
stream->ReadLE32( fNumVerts, fSpecularRGBA );
}
@ -570,7 +570,7 @@ void plGeometrySpan::Read( hsStream *stream )
if( fNumIndices > 0 )
{
fIndexData = TRACKED_NEW uint16_t[ fNumIndices ];
fIndexData = new uint16_t[ fNumIndices ];
stream->ReadLE16( fNumIndices, fIndexData );
}
else
@ -918,18 +918,18 @@ void plGeometrySpan::EndCreate( void )
delete [] fVertexData;
fNumVerts = fVertAccum.GetCount();
fVertexData = TRACKED_NEW uint8_t[ size * fNumVerts ];
fVertexData = new uint8_t[ size * fNumVerts ];
delete [] fMultColor;
fMultColor = TRACKED_NEW hsColorRGBA[ fNumVerts ];
fMultColor = new hsColorRGBA[ fNumVerts ];
delete [] fAddColor;
fAddColor = TRACKED_NEW hsColorRGBA[ fNumVerts ];
fAddColor = new hsColorRGBA[ fNumVerts ];
delete [] fDiffuseRGBA;
delete [] fSpecularRGBA;
fDiffuseRGBA = TRACKED_NEW uint32_t[ fNumVerts ];
fSpecularRGBA = TRACKED_NEW uint32_t[ fNumVerts ];
fDiffuseRGBA = new uint32_t[ fNumVerts ];
fSpecularRGBA = new uint32_t[ fNumVerts ];
}
else
fNumVerts = fVertAccum.GetCount();
@ -1000,7 +1000,7 @@ void plGeometrySpan::EndCreate( void )
delete [] fIndexData;
fNumIndices = fIndexAccum.GetCount();
fIndexData = TRACKED_NEW uint16_t[ fNumIndices ];
fIndexData = new uint16_t[ fNumIndices ];
}
else
fNumIndices = fIndexAccum.GetCount();

View File

@ -58,7 +58,7 @@ void plInstanceDrawInterface::Read(hsStream* stream, hsResMgr* mgr)
plDrawInterface::Read(stream, mgr);
fTargetID = stream->ReadLE32();
plSwapSpansRefMsg *sMsg = TRACKED_NEW plSwapSpansRefMsg(GetKey(), plRefMsg::kOnCreate, -1, -1);
plSwapSpansRefMsg *sMsg = new plSwapSpansRefMsg(GetKey(), plRefMsg::kOnCreate, -1, -1);
mgr->ReadKeyNotifyMe(stream, sMsg, plRefFlags::kActiveRef);
}
@ -148,12 +148,12 @@ void plInstanceDrawInterface::AddSharedMesh(plSharedMesh *mesh, hsGMaterial *mat
fDrawables[iDraw]->SetProperty(fDrawableIndices[iDraw], kDisable, true);
#ifdef HS_DEBUGGING
plDISpansMsg* diMsg = TRACKED_NEW plDISpansMsg(fDrawable->GetKey(), plDISpansMsg::kAddingSpan, index, plDISpansMsg::kLeaveEmptyDrawable);
plDISpansMsg* diMsg = new plDISpansMsg(fDrawable->GetKey(), plDISpansMsg::kAddingSpan, index, plDISpansMsg::kLeaveEmptyDrawable);
diMsg->SetSender(GetKey());
diMsg->Send();
#endif
plSharedMeshBCMsg *smMsg = TRACKED_NEW plSharedMeshBCMsg;
plSharedMeshBCMsg *smMsg = new plSharedMeshBCMsg;
smMsg->SetSender(GetKey());
smMsg->fDraw = fDrawable;
smMsg->fMesh = mesh;
@ -165,7 +165,7 @@ void plInstanceDrawInterface::AddSharedMesh(plSharedMesh *mesh, hsGMaterial *mat
plMorphSequence *morph = const_cast<plMorphSequence*>(plMorphSequence::ConvertNoRef(fOwner->GetModifierByType(plMorphSequence::Index())));
if (morph)
{
//hsgResMgr::ResMgr()->AddViaNotify(mesh->GetKey(), TRACKED_NEW plGenRefMsg(morph->GetKey(), plRefMsg::kOnCreate, -1, -1), plRefFlags::kPassiveRef);
//hsgResMgr::ResMgr()->AddViaNotify(mesh->GetKey(), new plGenRefMsg(morph->GetKey(), plRefMsg::kOnCreate, -1, -1), plRefFlags::kPassiveRef);
morph->AddSharedMesh(mesh);
}
}
@ -178,7 +178,7 @@ void plInstanceDrawInterface::RemoveSharedMesh(plSharedMesh *mesh)
{
IClearIndex((uint8_t)geoIndex);
plSharedMeshBCMsg *smMsg = TRACKED_NEW plSharedMeshBCMsg;
plSharedMeshBCMsg *smMsg = new plSharedMeshBCMsg;
smMsg->SetSender(GetKey());
smMsg->fDraw = fDrawable;
smMsg->fMesh = mesh;
@ -225,7 +225,7 @@ void plInstanceDrawInterface::IClearIndex(uint8_t which)
plDrawableSpans *drawable = plDrawableSpans::ConvertNoRef(fDrawables[which]);
if (drawable != nil)
{
plDISpansMsg* diMsg = TRACKED_NEW plDISpansMsg(fDrawable->GetKey(), plDISpansMsg::kRemovingSpan, fDrawableIndices[which], plDISpansMsg::kLeaveEmptyDrawable);
plDISpansMsg* diMsg = new plDISpansMsg(fDrawable->GetKey(), plDISpansMsg::kRemovingSpan, fDrawableIndices[which], plDISpansMsg::kLeaveEmptyDrawable);
diMsg->SetSender(GetKey());
diMsg->Send();
}

View File

@ -56,7 +56,7 @@ public:
void plInterMeshSmooth::FindEdges(uint32_t maxVtxIdx, uint32_t nTris, uint16_t* idxList, hsTArray<uint16_t>& edgeVerts)
{
hsTArray<EdgeBin>* bins = TRACKED_NEW hsTArray<EdgeBin>[maxVtxIdx+1];
hsTArray<EdgeBin>* bins = new hsTArray<EdgeBin>[maxVtxIdx+1];
hsBitVector edgeVertBits;
// For each vert pair (edge) in idxList
@ -153,8 +153,8 @@ void plInterMeshSmooth::FindEdges(hsTArray<plSpanHandle>& sets, hsTArray<uint16_
void plInterMeshSmooth::SmoothNormals(hsTArray<plSpanHandle>& sets)
{
hsTArray<uint16_t>* shareVtx = TRACKED_NEW hsTArray<uint16_t>[sets.GetCount()];
hsTArray<uint16_t>* edgeVerts = TRACKED_NEW hsTArray<uint16_t>[sets.GetCount()];
hsTArray<uint16_t>* shareVtx = new hsTArray<uint16_t>[sets.GetCount()];
hsTArray<uint16_t>* edgeVerts = new hsTArray<uint16_t>[sets.GetCount()];
FindEdges(sets, edgeVerts);
int i;
@ -245,4 +245,4 @@ void plInterMeshSmooth::SetAngle(float degs)
float plInterMeshSmooth::GetAngle() const
{
return hsRadiansToDegrees(acos(fMinNormDot));
}
}

View File

@ -282,7 +282,7 @@ void plMorphDelta::AllocDeltas(int iSpan, int nDel, int nUVW)
int uvwCnt = nDel * nUVW;
if( uvwCnt )
fSpans[iSpan].fUVWs = TRACKED_NEW hsPoint3[uvwCnt];
fSpans[iSpan].fUVWs = new hsPoint3[uvwCnt];
else
fSpans[iSpan].fUVWs = nil;
}

View File

@ -462,7 +462,7 @@ void plMorphSequence::AddTarget(plSceneObject* so)
if (!fMorphSDLMod)
{
fMorphSDLMod = TRACKED_NEW plMorphSequenceSDLMod;
fMorphSDLMod = new plMorphSequenceSDLMod;
so->AddModifier(fMorphSDLMod);
}
}
@ -493,7 +493,7 @@ void plMorphSequence::Read(hsStream* s, hsResMgr* mgr)
n = s->ReadLE32();
for( i = 0; i < n; i++)
mgr->ReadKeyNotifyMe(s, TRACKED_NEW plGenRefMsg(GetKey(), plRefMsg::kOnCreate, -1, -1), plRefFlags::kActiveRef);
mgr->ReadKeyNotifyMe(s, new plGenRefMsg(GetKey(), plRefMsg::kOnCreate, -1, -1), plRefFlags::kActiveRef);
}
void plMorphSequence::Write(hsStream* s, hsResMgr* mgr)

View File

@ -159,7 +159,7 @@ void plMorphSequenceSDLMod::ISetCurrentStateFrom(const plStateDataRecord* srcSta
// meshKey will be nil when dealing with non-sharedMesh data
if (meshKey)
hsgResMgr::ResMgr()->AddViaNotify(meshKey, TRACKED_NEW plGenRefMsg(morphMod->GetKey(), plRefMsg::kOnCreate, -1, -1), plRefFlags::kPassiveRef);
hsgResMgr::ResMgr()->AddViaNotify(meshKey, new plGenRefMsg(morphMod->GetKey(), plRefMsg::kOnCreate, -1, -1), plRefFlags::kPassiveRef);
plSimpleStateVariable *weights = morphSD->GetStateDataRecord(i)->FindVar(kStrWeights);

View File

@ -155,7 +155,7 @@ hsGMaterial* plProxyGen::IMakeProxyMaterial() const
const hsColorRGBA& dif = fColor;
float opac = fAmbient.a;
hsGMaterial* retVal = TRACKED_NEW hsGMaterial();
hsGMaterial* retVal = new hsGMaterial();
char buff[256];
if( GetKey()->GetName() )
@ -247,11 +247,11 @@ void plProxyGen::IGenerateProxy()
IApplyProxy(idx);
plGenRefMsg* msg = TRACKED_NEW plGenRefMsg(GetKey(), plRefMsg::kOnRequest, idx, 0);
plGenRefMsg* msg = new plGenRefMsg(GetKey(), plRefMsg::kOnRequest, idx, 0);
hsgResMgr::ResMgr()->AddViaNotify(mat->GetKey(), msg, plRefFlags::kActiveRef);
fProxyMat = mat;
plNodeRefMsg* refMsg = TRACKED_NEW plNodeRefMsg( GetKey(), plNodeRefMsg::kOnRequest, (int8_t)idx, plNodeRefMsg::kDrawable );
plNodeRefMsg* refMsg = new plNodeRefMsg( GetKey(), plNodeRefMsg::kOnRequest, (int8_t)idx, plNodeRefMsg::kDrawable );
hsgResMgr::ResMgr()->AddViaNotify(fProxyDrawables[idx]->GetKey(), refMsg, plRefFlags::kActiveRef);
fProxyDraw = fProxyDrawables[idx];
}

View File

@ -111,11 +111,11 @@ void plSharedMesh::Read(hsStream* s, hsResMgr* mgr)
fSpans.SetCount(s->ReadLE32());
for (i = 0; i < fSpans.GetCount(); i++)
{
fSpans[i] = TRACKED_NEW plGeometrySpan;
fSpans[i] = new plGeometrySpan;
fSpans[i]->Read(s);
}
mgr->ReadKeyNotifyMe(s, TRACKED_NEW plGenRefMsg(GetKey(), plRefMsg::kOnCreate, -1, -1), plRefFlags::kActiveRef);
mgr->ReadKeyNotifyMe(s, new plGenRefMsg(GetKey(), plRefMsg::kOnCreate, -1, -1), plRefFlags::kActiveRef);
fFlags = s->ReadByte();
}

View File

@ -212,7 +212,7 @@ plSpacePrepNode* plSpaceTreeMaker::IMakeFatTreeRecur(hsTArray<plSpacePrepNode*>&
StartTimer(kMakeFatTree);
plSpacePrepNode* subRoot = TRACKED_NEW plSpacePrepNode;
plSpacePrepNode* subRoot = new plSpacePrepNode;
fTreeSize++;
if( nodes.GetCount() == 1 )
@ -310,7 +310,7 @@ void plSpaceTreeMaker::IFindBigList(hsTArray<plSpacePrepNode*>& nodes, float len
plSpacePrepNode* plSpaceTreeMaker::INewSubRoot(const hsBounds3Ext& bnd)
{
plSpacePrepNode* subRoot = TRACKED_NEW plSpacePrepNode;
plSpacePrepNode* subRoot = new plSpacePrepNode;
subRoot->fDataIndex = int16_t(-1);
fTreeSize++;
@ -372,7 +372,7 @@ plSpacePrepNode* plSpaceTreeMaker::IMakeTreeRecur(hsTArray<plSpacePrepNode*>& no
void plSpaceTreeMaker::IMakeTree()
{
fSortScratch = TRACKED_NEW hsRadixSort::Elem[fLeaves.GetCount()];
fSortScratch = new hsRadixSort::Elem[fLeaves.GetCount()];
fPrepTree = IMakeTreeRecur(fLeaves);
@ -413,7 +413,7 @@ void plSpaceTreeMaker::Cleanup()
int32_t plSpaceTreeMaker::AddLeaf(const hsBounds3Ext& worldBnd, hsBool disable)
{
plSpacePrepNode* leaf = TRACKED_NEW plSpacePrepNode;
plSpacePrepNode* leaf = new plSpacePrepNode;
fLeaves.Append(leaf);
leaf->fDataIndex = fLeaves.GetCount()-1;
leaf->fChildren[0] = nil;
@ -548,7 +548,7 @@ plSpaceTree* plSpaceTreeMaker::MakeTree()
plSpaceTree* plSpaceTreeMaker::IMakeEmptyTree()
{
plSpaceTree* tree = TRACKED_NEW plSpaceTree;
plSpaceTree* tree = new plSpaceTree;
tree->fTree.SetCount(1);
hsPoint3 zero(0, 0, 0);
@ -564,7 +564,7 @@ plSpaceTree* plSpaceTreeMaker::IMakeEmptyTree()
plSpaceTree* plSpaceTreeMaker::IMakeDegenerateTree()
{
plSpaceTree* tree = TRACKED_NEW plSpaceTree;
plSpaceTree* tree = new plSpaceTree;
tree->fTree.Push();
@ -600,7 +600,7 @@ plSpaceTree* plSpaceTreeMaker::IMakeSpaceTree()
{
StartTimer(kMakeSpaceTree);
plSpaceTree* tree = TRACKED_NEW plSpaceTree;
plSpaceTree* tree = new plSpaceTree;
plSpacePrepNode* head = fPrepTree;

View File

@ -87,11 +87,11 @@ void plSpanInstance::Alloc(const plSpanEncoding& encoding, uint32_t numVerts)
DeAlloc();
uint32_t posStride = PosStrideFromEncoding(encoding);
if( posStride )
fPosDelta = TRACKED_NEW uint8_t[numVerts * posStride];
fPosDelta = new uint8_t[numVerts * posStride];
uint32_t colStride = ColStrideFromEncoding(encoding);
if( colStride )
fCol = TRACKED_NEW uint8_t[numVerts * colStride];
fCol = new uint8_t[numVerts * colStride];
}
void plSpanInstance::Read(hsStream* stream, const plSpanEncoding& encoding, uint32_t numVerts)

View File

@ -88,9 +88,9 @@ void plSpanTemplate::Alloc(uint16_t format, uint32_t numVerts, uint32_t numTris)
fNumTris = (uint16_t)numTris;
fData = TRACKED_NEW uint8_t[VertSize()];
fData = new uint8_t[VertSize()];
fIndices = TRACKED_NEW uint16_t[NumIndices()];
fIndices = new uint16_t[NumIndices()];
}
void plSpanTemplate::DeAlloc()
@ -139,8 +139,8 @@ void plSpanTemplateB::ComputeBounds()
void plSpanTemplateB::AllocColors()
{
fMultColors = TRACKED_NEW hsColorRGBA[NumVerts()];
fAddColors = TRACKED_NEW hsColorRGBA[NumVerts()];
fMultColors = new hsColorRGBA[NumVerts()];
fAddColors = new hsColorRGBA[NumVerts()];
}
void plSpanTemplateB::DeAllocColors()

View File

@ -432,7 +432,7 @@ void plIcicle::Read( hsStream *stream )
int i;
fSortData = TRACKED_NEW plGBufferTriangle[ fILength / 3 ];
fSortData = new plGBufferTriangle[ fILength / 3 ];
for( i = 0; i < fILength / 3; i++ )
fSortData[ i ].Read( stream );
}

View File

@ -375,18 +375,18 @@ void plWaveSet7::Read(hsStream* stream, hsResMgr* mgr)
int i;
for( i = 0; i < n; i++ )
{
mgr->ReadKeyNotifyMe(stream, TRACKED_NEW plGenRefMsg(GetKey(), plRefMsg::kOnCreate, -1, kRefShore), plRefFlags::kPassiveRef);
mgr->ReadKeyNotifyMe(stream, new plGenRefMsg(GetKey(), plRefMsg::kOnCreate, -1, kRefShore), plRefFlags::kPassiveRef);
}
n = stream->ReadLE32();
for( i = 0; i < n; i++ )
{
mgr->ReadKeyNotifyMe(stream, TRACKED_NEW plGenRefMsg(GetKey(), plRefMsg::kOnCreate, -1, kRefDecal), plRefFlags::kPassiveRef);
mgr->ReadKeyNotifyMe(stream, new plGenRefMsg(GetKey(), plRefMsg::kOnCreate, -1, kRefDecal), plRefFlags::kPassiveRef);
}
mgr->ReadKeyNotifyMe(stream, TRACKED_NEW plGenRefMsg(GetKey(), plRefMsg::kOnCreate, -1, kRefEnvMap), plRefFlags::kActiveRef);
mgr->ReadKeyNotifyMe(stream, new plGenRefMsg(GetKey(), plRefMsg::kOnCreate, -1, kRefEnvMap), plRefFlags::kActiveRef);
if( HasFlag(kHasRefObject) )
{
mgr->ReadKeyNotifyMe(stream, TRACKED_NEW plGenRefMsg(GetKey(), plRefMsg::kOnCreate, -1, kRefRefObj), plRefFlags::kPassiveRef);
mgr->ReadKeyNotifyMe(stream, new plGenRefMsg(GetKey(), plRefMsg::kOnCreate, -1, kRefRefObj), plRefFlags::kPassiveRef);
}
ISetupTextureWaves();
@ -1076,7 +1076,7 @@ void plWaveSet7::IFloatBuoy(float dt, plSceneObject* so)
plKey physKey = so->GetSimulationInterface()->GetPhysical()->GetKey();
// plImpulseMsg* iMsg = TRACKED_NEW plImpulseMsg(GetKey(), physKey, hsVector3(0, 0, 1.f) * forceMag * dt);
// plImpulseMsg* iMsg = new plImpulseMsg(GetKey(), physKey, hsVector3(0, 0, 1.f) * forceMag * dt);
// iMsg->Send();
#if 0
@ -1084,7 +1084,7 @@ void plWaveSet7::IFloatBuoy(float dt, plSceneObject* so)
hsVector3 rotAx = hsVector3(0, 0, 1.f) % surfNorm;
rotAx *= kRotScale * dt * volume;
plAngularImpulseMsg* aMsg = TRACKED_NEW plAngularImpulseMsg(GetKey(), physKey, rotAx);
plAngularImpulseMsg* aMsg = new plAngularImpulseMsg(GetKey(), physKey, rotAx);
aMsg->Send();
#endif
@ -1097,7 +1097,7 @@ void plWaveSet7::IFloatBuoy(float dt, plSceneObject* so)
damp *= kDampener;
damp += kBaseDamp;
// plDampMsg* dMsg = TRACKED_NEW plDampMsg(GetKey(), physKey, damp);
// plDampMsg* dMsg = new plDampMsg(GetKey(), physKey, damp);
// dMsg->Send();
}
}
@ -1122,7 +1122,7 @@ void plWaveSet7::IShiftCenter(plSceneObject* so) const
hsPoint3 center = so->GetDrawInterface()->GetWorldBounds().GetCenter();
hsPoint3 pos = so->GetLocalToWorld().GetTranslate();
hsVector3 offset(&pos, &center);
// plShiftMassMsg* msg = TRACKED_NEW plShiftMassMsg(GetKey(), so->GetSimulationInterface()->GetPhysical()->GetKey(), offset);
// plShiftMassMsg* msg = new plShiftMassMsg(GetKey(), so->GetSimulationInterface()->GetPhysical()->GetKey(), offset);
// msg->Send();
}
}
@ -1186,13 +1186,13 @@ void plWaveSet7::ICheckTargetMaterials()
void plWaveSet7::IAddTarget(const plKey& key)
{
plObjRefMsg* refMsg = TRACKED_NEW plObjRefMsg(key, plRefMsg::kOnRequest, -1, plObjRefMsg::kModifier);
plObjRefMsg* refMsg = new plObjRefMsg(key, plRefMsg::kOnRequest, -1, plObjRefMsg::kModifier);
hsgResMgr::ResMgr()->AddViaNotify( GetKey(), refMsg, plRefFlags::kActiveRef);
}
void plWaveSet7::IRemoveTarget(const plKey& key)
{
plObjRefMsg* refMsg = TRACKED_NEW plObjRefMsg(key, plRefMsg::kOnRemove, -1, plObjRefMsg::kModifier);
plObjRefMsg* refMsg = new plObjRefMsg(key, plRefMsg::kOnRemove, -1, plObjRefMsg::kModifier);
refMsg->SetRef(this);
refMsg->Send();
}
@ -1211,19 +1211,19 @@ void plWaveSet7::SetRefObject(plSceneObject* refObj)
{
fFlags.SetBit(kHasRefObject, refObj != nil);
plGenRefMsg* msg = TRACKED_NEW plGenRefMsg(GetKey(), plRefMsg::kOnRequest, 0, kRefRefObj);
plGenRefMsg* msg = new plGenRefMsg(GetKey(), plRefMsg::kOnRequest, 0, kRefRefObj);
hsgResMgr::ResMgr()->SendRef(refObj, msg, plRefFlags::kPassiveRef);
}
void plWaveSet7::AddBuoy(plKey soKey)
{
plGenRefMsg* msg = TRACKED_NEW plGenRefMsg(GetKey(), plRefMsg::kOnRequest, 0, kRefBuoy);
plGenRefMsg* msg = new plGenRefMsg(GetKey(), plRefMsg::kOnRequest, 0, kRefBuoy);
hsgResMgr::ResMgr()->AddViaNotify(soKey, msg, plRefFlags::kPassiveRef);
}
void plWaveSet7::RemoveBuoy(plKey soKey)
{
plGenRefMsg* msg = TRACKED_NEW plGenRefMsg(GetKey(), plRefMsg::kOnRemove, 0, kRefBuoy);
plGenRefMsg* msg = new plGenRefMsg(GetKey(), plRefMsg::kOnRemove, 0, kRefBuoy);
msg->SetRef(soKey->ObjectIsLoaded());
msg->Send();
}
@ -1448,20 +1448,20 @@ void plWaveSet7::SetSceneNode(const plKey& key)
void plWaveSet7::AddDynaDecalMgr(plKey& key)
{
plGenRefMsg* msg = TRACKED_NEW plGenRefMsg(GetKey(), plRefMsg::kOnRequest, 0, kRefDynaDecalMgr);
plGenRefMsg* msg = new plGenRefMsg(GetKey(), plRefMsg::kOnRequest, 0, kRefDynaDecalMgr);
hsgResMgr::ResMgr()->AddViaNotify(key, msg, plRefFlags::kPassiveRef);
msg = TRACKED_NEW plGenRefMsg(key, plRefMsg::kOnRequest, 0, plDynaRippleVSMgr::kRefWaveSetBase);
msg = new plGenRefMsg(key, plRefMsg::kOnRequest, 0, plDynaRippleVSMgr::kRefWaveSetBase);
hsgResMgr::ResMgr()->AddViaNotify(GetKey(), msg, plRefFlags::kPassiveRef);
}
void plWaveSet7::RemoveDynaDecalMgr(plKey& key)
{
plGenRefMsg* msg = TRACKED_NEW plGenRefMsg(GetKey(), plRefMsg::kOnRemove, 0, kRefDynaDecalMgr);
plGenRefMsg* msg = new plGenRefMsg(GetKey(), plRefMsg::kOnRemove, 0, kRefDynaDecalMgr);
msg->SetRef(key->ObjectIsLoaded());
msg->Send();
msg = TRACKED_NEW plGenRefMsg(key, plRefMsg::kOnRemove, 0, plDynaRippleVSMgr::kRefWaveSetBase);
msg = new plGenRefMsg(key, plRefMsg::kOnRemove, 0, plDynaRippleVSMgr::kRefWaveSetBase);
msg->SetRef(this);
msg->Send();
}
@ -1610,7 +1610,7 @@ hsGMaterial* plWaveSet7::ICreateBumpLayersFFP()
plMipmap* plWaveSet7::ICreateBiasNoiseMap()
{
const int size = kCompositeSize >> 2;
plMipmap* mipMap = TRACKED_NEW plMipmap(
plMipmap* mipMap = new plMipmap(
size, size,
plMipmap::kARGB32Config,
1,
@ -1656,7 +1656,7 @@ plMipmap* plWaveSet7::ICreateBumpMipmapPS()
if( !fCosineLUT )
{
plMipmap* mipMap = TRACKED_NEW plMipmap(
plMipmap* mipMap = new plMipmap(
kCompositeSize, sizeV,
plMipmap::kARGB32Config,
kNumLevels,
@ -1667,7 +1667,7 @@ plMipmap* plWaveSet7::ICreateBumpMipmapPS()
sprintf(buff, "%s_%s", GetKey()->GetName(), "BumpBitPS");
hsgResMgr::ResMgr()->NewKey(buff, mipMap, GetKey()->GetUoid().GetLocation());
hsgResMgr::ResMgr()->SendRef(mipMap->GetKey(), TRACKED_NEW plGenRefMsg(GetKey(), plRefMsg::kOnRequest, 0, kRefCosineLUT), plRefFlags::kActiveRef);
hsgResMgr::ResMgr()->SendRef(mipMap->GetKey(), new plGenRefMsg(GetKey(), plRefMsg::kOnRequest, 0, kRefCosineLUT), plRefFlags::kActiveRef);
}
hsAssert(fCosineLUT, "Failed to make cosine lookup table");
@ -1715,7 +1715,7 @@ void plWaveSet7::IAddBumpBiasLayer(hsGMaterial* mat)
int i;
for( i = 0; i < 2; i++ )
{
plLayer* layer = TRACKED_NEW plLayer;
plLayer* layer = new plLayer;
char buff[256];
sprintf(buff, "%s_%s_%d", GetKey()->GetName(), "Bias", i);
hsgResMgr::ResMgr()->NewKey(buff, layer, GetKey()->GetUoid().GetLocation());
@ -1735,7 +1735,7 @@ void plWaveSet7::IAddBumpBiasLayer(hsGMaterial* mat)
layer->SetUVWSrc(0);
plLayRefMsg* refMsg = TRACKED_NEW plLayRefMsg(layer->GetKey(), plRefMsg::kOnCreate, 0, plLayRefMsg::kTexture);
plLayRefMsg* refMsg = new plLayRefMsg(layer->GetKey(), plRefMsg::kOnCreate, 0, plLayRefMsg::kTexture);
hsgResMgr::ResMgr()->SendRef(mipMap->GetKey(), refMsg, plRefFlags::kActiveRef);
IAddBumpBiasShaders(layer);
@ -1751,7 +1751,7 @@ void plWaveSet7::IAddBumpBiasLayer(hsGMaterial* mat)
plLayer* plWaveSet7::ICreateBumpLayerPS(plMipmap* mipMap, hsGMaterial* bumpMat, int which)
{
plLayer* layer = TRACKED_NEW plLayer;
plLayer* layer = new plLayer;
char buff[256];
sprintf(buff, "%s_%s_%d", GetKey()->GetName(), "BumpLayerPS", which);
hsgResMgr::ResMgr()->NewKey(buff, layer, GetKey()->GetUoid().GetLocation());
@ -1786,7 +1786,7 @@ plLayer* plWaveSet7::ICreateBumpLayerPS(plMipmap* mipMap, hsGMaterial* bumpMat,
bumpMat->AddLayerViaNotify(layer);
plLayRefMsg* refMsg = TRACKED_NEW plLayRefMsg(layer->GetKey(), plRefMsg::kOnCreate, 0, plLayRefMsg::kTexture);
plLayRefMsg* refMsg = new plLayRefMsg(layer->GetKey(), plRefMsg::kOnCreate, 0, plLayRefMsg::kTexture);
hsgResMgr::ResMgr()->SendRef(mipMap->GetKey(), refMsg, plRefFlags::kActiveRef);
return layer;
@ -1809,7 +1809,7 @@ hsGMaterial* plWaveSet7::ICreateBumpLayersPS()
//
// Create a blank material
hsGMaterial* bumpMat = TRACKED_NEW hsGMaterial;
hsGMaterial* bumpMat = new hsGMaterial;
char buff[256];
sprintf(buff, "%s_%s", GetKey()->GetName(), "BumpMatPS");
hsgResMgr::ResMgr()->NewKey(buff, bumpMat, GetKey()->GetUoid().GetLocation());
@ -1839,7 +1839,7 @@ hsGMaterial* plWaveSet7::ICreateBumpLayersPS()
// Need to add this via notify to ourselves.
hsgResMgr::ResMgr()->SendRef(bumpMat->GetKey(), TRACKED_NEW plGenRefMsg(GetKey(), plRefMsg::kOnRequest, 0, kRefBumpMat), plRefFlags::kActiveRef);
hsgResMgr::ResMgr()->SendRef(bumpMat->GetKey(), new plGenRefMsg(GetKey(), plRefMsg::kOnRequest, 0, kRefBumpMat), plRefFlags::kActiveRef);
ICreateBumpDrawable();
@ -1850,7 +1850,7 @@ void plWaveSet7::IAddBumpBiasShaders(plLayer* layer)
{
if( !fBiasVShader )
{
plShader* vShader = TRACKED_NEW plShader;
plShader* vShader = new plShader;
char buff[256];
sprintf(buff, "%s_BiasVS", GetKey()->GetName());
@ -1902,19 +1902,19 @@ void plWaveSet7::IAddBumpBiasShaders(plLayer* layer)
// vShader->SetDecl(&vDecl);
vShader->SetDecl(plShaderTable::Decl(vs_BiasNormals));
hsgResMgr::ResMgr()->SendRef(vShader->GetKey(), TRACKED_NEW plGenRefMsg(GetKey(), plRefMsg::kOnRequest, 0, kRefBiasVShader), plRefFlags::kActiveRef);
hsgResMgr::ResMgr()->SendRef(vShader->GetKey(), new plGenRefMsg(GetKey(), plRefMsg::kOnRequest, 0, kRefBiasVShader), plRefFlags::kActiveRef);
fBiasVShader = vShader;
}
plLayRefMsg* refMsg = TRACKED_NEW plLayRefMsg(layer->GetKey(), plRefMsg::kOnCreate, 0, plLayRefMsg::kVertexShader);
plLayRefMsg* refMsg = new plLayRefMsg(layer->GetKey(), plRefMsg::kOnCreate, 0, plLayRefMsg::kVertexShader);
hsgResMgr::ResMgr()->SendRef(fBiasVShader->GetKey(), refMsg, plRefFlags::kActiveRef);
if( !fBiasPShader )
{
plShader* pShader = TRACKED_NEW plShader;
plShader* pShader = new plShader;
char buff[256];
sprintf(buff, "%s_BiasPS", GetKey()->GetName());
@ -1930,12 +1930,12 @@ void plWaveSet7::IAddBumpBiasShaders(plLayer* layer)
// pShader->SetDecl(&pDecl);
pShader->SetDecl(plShaderTable::Decl(ps_BiasNormals));
hsgResMgr::ResMgr()->SendRef(pShader->GetKey(), TRACKED_NEW plGenRefMsg(GetKey(), plRefMsg::kOnRequest, 0, kRefBiasPShader), plRefFlags::kActiveRef);
hsgResMgr::ResMgr()->SendRef(pShader->GetKey(), new plGenRefMsg(GetKey(), plRefMsg::kOnRequest, 0, kRefBiasPShader), plRefFlags::kActiveRef);
fBiasPShader = pShader;
}
refMsg = TRACKED_NEW plLayRefMsg(layer->GetKey(), plRefMsg::kOnCreate, 0, plLayRefMsg::kPixelShader);
refMsg = new plLayRefMsg(layer->GetKey(), plRefMsg::kOnCreate, 0, plLayRefMsg::kPixelShader);
hsgResMgr::ResMgr()->SendRef(fBiasPShader->GetKey(), refMsg, plRefFlags::kActiveRef);
}
@ -1949,7 +1949,7 @@ void plWaveSet7::IAddBumpVertexShader(hsGMaterial* mat, int iShader, int iFirst,
{
int iShader = iBase / kBumpPerPass;
plShader* vShader = TRACKED_NEW plShader;
plShader* vShader = new plShader;
char buff[256];
sprintf(buff, "%s_BumpVS_%d", GetKey()->GetName(), iShader);
hsgResMgr::ResMgr()->NewKey(buff, vShader, GetKey()->GetUoid().GetLocation());
@ -1975,7 +1975,7 @@ void plWaveSet7::IAddBumpVertexShader(hsGMaterial* mat, int iShader, int iFirst,
vShader->SetDecl(plShaderTable::Decl(vs_CompCosines));
hsgResMgr::ResMgr()->SendRef(vShader->GetKey(), TRACKED_NEW plGenRefMsg(GetKey(), plRefMsg::kOnRequest, iShader, kRefBumpVShader), plRefFlags::kActiveRef);
hsgResMgr::ResMgr()->SendRef(vShader->GetKey(), new plGenRefMsg(GetKey(), plRefMsg::kOnRequest, iShader, kRefBumpVShader), plRefFlags::kActiveRef);
fBumpVShader[iShader] = vShader;
@ -1995,7 +1995,7 @@ void plWaveSet7::IAddBumpPixelShader(hsGMaterial* mat, int iShader, int iFirst,
{
int iShader = iBase / kBumpPerPass;
plShader* pShader = TRACKED_NEW plShader;
plShader* pShader = new plShader;
char buff[256];
sprintf(buff, "%s_BumpPS_%d", GetKey()->GetName(), iShader);
hsgResMgr::ResMgr()->NewKey(buff, pShader, GetKey()->GetUoid().GetLocation());
@ -2025,7 +2025,7 @@ void plWaveSet7::IAddBumpPixelShader(hsGMaterial* mat, int iShader, int iFirst,
pShader->SetVector(plBumpPS::kHalfOne, 0.25f, 0.25f, 0.25f, 1.f);
hsgResMgr::ResMgr()->SendRef(pShader->GetKey(), TRACKED_NEW plGenRefMsg(GetKey(), plRefMsg::kOnRequest, iShader, kRefBumpPShader), plRefFlags::kActiveRef);
hsgResMgr::ResMgr()->SendRef(pShader->GetKey(), new plGenRefMsg(GetKey(), plRefMsg::kOnRequest, iShader, kRefBumpPShader), plRefFlags::kActiveRef);
fBumpPShader[iShader] = pShader;
@ -2038,14 +2038,14 @@ void plWaveSet7::IAddBumpPixelShader(hsGMaterial* mat, int iShader, int iFirst,
plDrawableSpans* plWaveSet7::ICreateBumpDrawable()
{
fBumpDraw = TRACKED_NEW plDrawableSpans;
fBumpDraw = new plDrawableSpans;
char buff[256];
sprintf(buff, "%s_BumpDraw", GetKey()->GetName());
hsgResMgr::ResMgr()->NewKey(buff, fBumpDraw, GetKey()->GetUoid().GetLocation());
ICreateClearDrawable(fBumpDraw, fBumpMat);
hsgResMgr::ResMgr()->SendRef(fBumpDraw->GetKey(), TRACKED_NEW plGenRefMsg(GetKey(), plRefMsg::kOnRequest, 0, kRefBumpDraw), plRefFlags::kActiveRef);
hsgResMgr::ResMgr()->SendRef(fBumpDraw->GetKey(), new plGenRefMsg(GetKey(), plRefMsg::kOnRequest, 0, kRefBumpDraw), plRefFlags::kActiveRef);
return fBumpDraw;
}
@ -2122,7 +2122,7 @@ plDrawableSpans* plWaveSet7::ICreateClearDrawable(plDrawableSpans* drawable, hsG
plRenderRequest* plWaveSet7::ICreateRenderRequest(plRenderTarget* rt, plDrawableSpans* draw, float pri)
{
plRenderRequest* req = TRACKED_NEW plRenderRequest;
plRenderRequest* req = new plRenderRequest;
static plPageTreeMgr emptyMgr;
req->SetPageTreeMgr(&emptyMgr);
@ -2153,7 +2153,7 @@ plRenderTarget* plWaveSet7::ICreateTransferRenderTarget(const char* name, int si
uint8_t zDepth = 0;
uint8_t stencilDepth = 0;
plRenderTarget* rt = TRACKED_NEW plRenderTarget(flags, size, size, bitDepth, zDepth, stencilDepth);
plRenderTarget* rt = new plRenderTarget(flags, size, size, bitDepth, zDepth, stencilDepth);
char buff[256];
sprintf(buff, "%s_%s", GetKey()->GetName(), name);
@ -2167,7 +2167,7 @@ plLayer* plWaveSet7::ICreateTotalLayer(plBitmap* bm, hsGMaterial* mat, int which
plLayer* layer = mat->GetNumLayers() > which ? plLayer::ConvertNoRef(mat->GetLayer(which)->BottomOfStack()) : nil;
if( !layer )
{
layer = TRACKED_NEW plLayer;
layer = new plLayer;
char buff[256];
sprintf(buff, "%s_%sLayerPS_%d", GetKey()->GetName(), suff, which);
hsgResMgr::ResMgr()->NewKey(buff, layer, GetKey()->GetUoid().GetLocation());
@ -2194,7 +2194,7 @@ plLayer* plWaveSet7::ICreateTotalLayer(plBitmap* bm, hsGMaterial* mat, int which
layer->SetTransform(xfm);
plLayRefMsg* refMsg = TRACKED_NEW plLayRefMsg(layer->GetKey(), plRefMsg::kOnCreate, 0, plLayRefMsg::kTexture);
plLayRefMsg* refMsg = new plLayRefMsg(layer->GetKey(), plRefMsg::kOnCreate, 0, plLayRefMsg::kTexture);
hsgResMgr::ResMgr()->SendRef(bm->GetKey(), refMsg, plRefFlags::kActiveRef);
return layer;
@ -2202,7 +2202,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;
plLayer* layer = new plLayer;
char buff[256];
sprintf(buff, "%s_%s_%s_%d", GetKey()->GetName(), pref, "EnvLayerPS", which);
hsgResMgr::ResMgr()->NewKey(buff, layer, GetKey()->GetUoid().GetLocation());
@ -2226,7 +2226,7 @@ plLayer* plWaveSet7::ICreateTotalEnvLayer(plBitmap* envMap, hsGMaterial* mat, in
layer->SetTransform(xfm);
plLayRefMsg* refMsg = TRACKED_NEW plLayRefMsg(layer->GetKey(), plRefMsg::kOnCreate, 0, plLayRefMsg::kTexture);
plLayRefMsg* refMsg = new plLayRefMsg(layer->GetKey(), plRefMsg::kOnCreate, 0, plLayRefMsg::kTexture);
hsgResMgr::ResMgr()->SendRef(envMap->GetKey(), refMsg, plRefFlags::kActiveRef);
mat->AddLayerViaNotify(layer);
@ -2248,7 +2248,7 @@ hsGMaterial* plWaveSet7::ICreateFixedMatPS(hsGMaterial* mat, const int numUVWs)
int i;
for( i = mat->GetNumLayers()-1; i > 0; i-- )
{
plMatRefMsg* refMsg = TRACKED_NEW plMatRefMsg(mat->GetKey(), plRefMsg::kOnRemove, i, plMatRefMsg::kLayer);
plMatRefMsg* refMsg = new plMatRefMsg(mat->GetKey(), plRefMsg::kOnRemove, i, plMatRefMsg::kLayer);
hsgResMgr::ResMgr()->SendRef(mat->GetLayer(i)->GetKey(), refMsg, plRefFlags::kActiveRef);
}
@ -2266,7 +2266,7 @@ hsGMaterial* plWaveSet7::ICreateFixedMatPS(hsGMaterial* mat, const int numUVWs)
fBumpReq = ICreateRenderRequest(rt, fBumpDraw, -100.f);
fBumpReqMsg = TRACKED_NEW plRenderRequestMsg(GetKey(), fBumpReq);
fBumpReqMsg = new plRenderRequestMsg(GetKey(), fBumpReq);
IAddFixedVertexShader(mat, numUVWs);
IAddFixedPixelShader(mat);
@ -2281,7 +2281,7 @@ void plWaveSet7::ICreateFixedMat(hsGMaterial* mat, const int numUVWs)
if( !fEnvMap )
{
plDynamicEnvMap* env = TRACKED_NEW plDynamicEnvMap((uint16_t)fEnvSize, (uint16_t)fEnvSize, 32);
plDynamicEnvMap* env = new plDynamicEnvMap((uint16_t)fEnvSize, (uint16_t)fEnvSize, 32);
hsgResMgr::ResMgr()->NewKey(GetKey()->GetName(), env, GetKey()->GetUoid().GetLocation());
fEnvMap = env;
env->SetPosition(hsPoint3(0, 0, 50.f));
@ -2302,7 +2302,7 @@ void plWaveSet7::IAddShoreVertexShader(hsGMaterial* mat)
if( !fShoreVShader )
{
plShader* vShader = TRACKED_NEW plShader;
plShader* vShader = new plShader;
char buff[256];
sprintf(buff, "%s_ShoreVS", GetKey()->GetName());
@ -2342,7 +2342,7 @@ void plWaveSet7::IAddShoreVertexShader(hsGMaterial* mat)
// vShader->SetDecl(&decl);
vShader->SetDecl(plShaderTable::Decl(vs_ShoreLeave7));
hsgResMgr::ResMgr()->SendRef(vShader->GetKey(), TRACKED_NEW plGenRefMsg(GetKey(), plRefMsg::kOnRequest, 0, kRefShoreVShader), plRefFlags::kActiveRef);
hsgResMgr::ResMgr()->SendRef(vShader->GetKey(), new plGenRefMsg(GetKey(), plRefMsg::kOnRequest, 0, kRefShoreVShader), plRefFlags::kActiveRef);
fShoreVShader = vShader;
@ -2356,7 +2356,7 @@ void plWaveSet7::IAddShorePixelShader(hsGMaterial* mat)
{
if( !fShorePShader )
{
plShader* pShader = TRACKED_NEW plShader;
plShader* pShader = new plShader;
char buff[256];
sprintf(buff, "%s_ShorePS", GetKey()->GetName());
@ -2367,7 +2367,7 @@ void plWaveSet7::IAddShorePixelShader(hsGMaterial* mat)
// pShader->SetShaderFileName("sha/ps_ShoreLeave6.inl");
pShader->SetDecl(plShaderTable::Decl(ps_ShoreLeave6));
hsgResMgr::ResMgr()->SendRef(pShader->GetKey(), TRACKED_NEW plGenRefMsg(GetKey(), plRefMsg::kOnRequest, 0, kRefShorePShader), plRefFlags::kActiveRef);
hsgResMgr::ResMgr()->SendRef(pShader->GetKey(), new plGenRefMsg(GetKey(), plRefMsg::kOnRequest, 0, kRefShorePShader), plRefFlags::kActiveRef);
fShorePShader = pShader;
}
@ -2380,7 +2380,7 @@ void plWaveSet7::IAddFixedVertexShader(hsGMaterial* mat, const int numUVWs)
if( !fFixedVShader )
{
plShader* vShader = TRACKED_NEW plShader;
plShader* vShader = new plShader;
char buff[256];
sprintf(buff, "%s_FixedVS", GetKey()->GetName());
@ -2414,7 +2414,7 @@ void plWaveSet7::IAddFixedVertexShader(hsGMaterial* mat, const int numUVWs)
// vShader->SetShaderFileName("sha/vs_WaveFixedFin.inl");
// vShader->SetShaderFileName("sha/vs_TestPos.inl");
hsgResMgr::ResMgr()->SendRef(vShader->GetKey(), TRACKED_NEW plGenRefMsg(GetKey(), plRefMsg::kOnRequest, 0, kRefFixedVShader), plRefFlags::kActiveRef);
hsgResMgr::ResMgr()->SendRef(vShader->GetKey(), new plGenRefMsg(GetKey(), plRefMsg::kOnRequest, 0, kRefFixedVShader), plRefFlags::kActiveRef);
fFixedVShader = vShader;
@ -2439,7 +2439,7 @@ void plWaveSet7::IAddShaderToLayers(hsGMaterial* mat, int iFirst, int iLast, uin
&& (layer->GetVertexShader() != shader)
&& (layer->GetPixelShader() != shader) )
{
plLayRefMsg* refMsg = TRACKED_NEW plLayRefMsg(layer->GetKey(), plRefMsg::kOnCreate, 0, type);
plLayRefMsg* refMsg = new plLayRefMsg(layer->GetKey(), plRefMsg::kOnCreate, 0, type);
hsgResMgr::ResMgr()->SendRef(shader->GetKey(), refMsg, plRefFlags::kActiveRef);
// layer->SetShadeFlags(layer->GetShadeFlags() | hsGMatState::kShadeReallyNoFog);
@ -2451,7 +2451,7 @@ void plWaveSet7::IAddFixedPixelShader(hsGMaterial* mat)
{
if( !fFixedPShader )
{
plShader* pShader = TRACKED_NEW plShader;
plShader* pShader = new plShader;
char buff[256];
sprintf(buff, "%s_FixedPS", GetKey()->GetName());
hsgResMgr::ResMgr()->NewKey(buff, pShader, GetKey()->GetUoid().GetLocation());
@ -2467,7 +2467,7 @@ void plWaveSet7::IAddFixedPixelShader(hsGMaterial* mat)
// pShader->SetShaderFileName("sha/ps_TestPos.inl");
pShader->SetDecl(plShaderTable::Decl(ps_WaveFixed));
hsgResMgr::ResMgr()->SendRef(pShader->GetKey(), TRACKED_NEW plGenRefMsg(GetKey(), plRefMsg::kOnRequest, 0, kRefFixedPShader), plRefFlags::kActiveRef);
hsgResMgr::ResMgr()->SendRef(pShader->GetKey(), new plGenRefMsg(GetKey(), plRefMsg::kOnRequest, 0, kRefFixedPShader), plRefFlags::kActiveRef);
fFixedPShader = pShader;
}
@ -2480,7 +2480,7 @@ void plWaveSet7::IAddRipVertexShader(hsGMaterial* mat, const plRipVSConsts& ripC
{
if( !fRipVShader )
{
plShader* vShader = TRACKED_NEW plShader;
plShader* vShader = new plShader;
char buff[256];
sprintf(buff, "%s_RipVS", GetKey()->GetName());
hsgResMgr::ResMgr()->NewKey(buff, vShader, GetKey()->GetUoid().GetLocation());
@ -2553,7 +2553,7 @@ void plWaveSet7::IAddRipVertexShader(hsGMaterial* mat, const plRipVSConsts& ripC
// vShader->SetDecl(&decl);
vShader->SetDecl(plShaderTable::Decl(vs_WaveRip7));
hsgResMgr::ResMgr()->SendRef(vShader->GetKey(), TRACKED_NEW plGenRefMsg(GetKey(), plRefMsg::kOnRequest, 0, kRefRipVShader), plRefFlags::kActiveRef);
hsgResMgr::ResMgr()->SendRef(vShader->GetKey(), new plGenRefMsg(GetKey(), plRefMsg::kOnRequest, 0, kRefRipVShader), plRefFlags::kActiveRef);
hsAssert(vShader == fRipVShader, "Should have been set by SendRef");
}
@ -2566,7 +2566,7 @@ void plWaveSet7::IAddRipPixelShader(hsGMaterial* mat, const plRipVSConsts& ripCo
{
if( !fRipPShader )
{
plShader* pShader = TRACKED_NEW plShader;
plShader* pShader = new plShader;
char buff[256];
sprintf(buff, "%s_RipPS", GetKey()->GetName());
hsgResMgr::ResMgr()->NewKey(buff, pShader, GetKey()->GetUoid().GetLocation());
@ -2580,7 +2580,7 @@ void plWaveSet7::IAddRipPixelShader(hsGMaterial* mat, const plRipVSConsts& ripCo
// pShader->SetShaderFileName("sha/ps_WaveRip.inl");
pShader->SetDecl(plShaderTable::Decl(ps_WaveRip));
hsgResMgr::ResMgr()->SendRef(pShader->GetKey(), TRACKED_NEW plGenRefMsg(GetKey(), plRefMsg::kOnRequest, 0, kRefRipPShader), plRefFlags::kActiveRef);
hsgResMgr::ResMgr()->SendRef(pShader->GetKey(), new plGenRefMsg(GetKey(), plRefMsg::kOnRequest, 0, kRefRipPShader), plRefFlags::kActiveRef);
hsAssert(pShader == fRipPShader, "Should have been set by SendRef");
}
@ -2626,7 +2626,7 @@ plShader* plWaveSet7::ICreateDecalVShader(DecalVType t)
};
plShader* vShader = TRACKED_NEW plShader;
plShader* vShader = new plShader;
char buff[256];
sprintf(buff, "%s_%s", GetKey()->GetName(), fname[t]);
hsgResMgr::ResMgr()->NewKey(buff, vShader, GetKey()->GetUoid().GetLocation());
@ -2688,7 +2688,7 @@ plShader* plWaveSet7::ICreateDecalVShader(DecalVType t)
// vShader->SetDecl(&shaderDecls[t]);
vShader->SetDecl(plShaderTable::Decl(shaderIDs[t]));
hsgResMgr::ResMgr()->SendRef(vShader->GetKey(), TRACKED_NEW plGenRefMsg(GetKey(), plRefMsg::kOnRequest, t, kRefDecVShader), plRefFlags::kActiveRef);
hsgResMgr::ResMgr()->SendRef(vShader->GetKey(), new plGenRefMsg(GetKey(), plRefMsg::kOnRequest, t, kRefDecVShader), plRefFlags::kActiveRef);
hsAssert(vShader == fDecalVShaders[t], "Should have been set by SendRef");
}
@ -2754,7 +2754,7 @@ plShader* plWaveSet7::ICreateDecalPShader(DecalPType t)
ps_WaveDecEnv
};
plShader* pShader = TRACKED_NEW plShader;
plShader* pShader = new plShader;
char buff[256];
sprintf(buff, "%s_%s", GetKey()->GetName(), fname[t]);
@ -2765,7 +2765,7 @@ plShader* plWaveSet7::ICreateDecalPShader(DecalPType t)
// pShader->SetShaderFileName(buff);
pShader->SetDecl(plShaderTable::Decl(shaderIDs[t]));
hsgResMgr::ResMgr()->SendRef(pShader->GetKey(), TRACKED_NEW plGenRefMsg(GetKey(), plRefMsg::kOnRequest, t, kRefDecPShader), plRefFlags::kActiveRef);
hsgResMgr::ResMgr()->SendRef(pShader->GetKey(), new plGenRefMsg(GetKey(), plRefMsg::kOnRequest, t, kRefDecPShader), plRefFlags::kActiveRef);
hsAssert(fDecalPShaders[t] == pShader, "Should have been set by SendRef");
}
@ -3532,14 +3532,14 @@ void plWaveSet7::ICheckDecalEnvLayers(hsGMaterial* mat)
}
else
{
refMsg = TRACKED_NEW plMatRefMsg(mat->GetKey(), plRefMsg::kOnRequest, i+1, plMatRefMsg::kLayer | plMatRefMsg::kInsert);
refMsg = new plMatRefMsg(mat->GetKey(), plRefMsg::kOnRequest, i+1, plMatRefMsg::kLayer | plMatRefMsg::kInsert);
hsgResMgr::ResMgr()->SendRef(lay3->GetKey(), refMsg, plRefFlags::kActiveRef);
}
refMsg = TRACKED_NEW plMatRefMsg(mat->GetKey(), plRefMsg::kOnRequest, i+2, plMatRefMsg::kLayer | plMatRefMsg::kInsert);
refMsg = new plMatRefMsg(mat->GetKey(), plRefMsg::kOnRequest, i+2, plMatRefMsg::kLayer | plMatRefMsg::kInsert);
hsgResMgr::ResMgr()->SendRef(lay3->GetKey(), refMsg, plRefFlags::kActiveRef);
refMsg = TRACKED_NEW plMatRefMsg(mat->GetKey(), plRefMsg::kOnRequest, i+3, plMatRefMsg::kLayer | plMatRefMsg::kInsert);
refMsg = new plMatRefMsg(mat->GetKey(), plRefMsg::kOnRequest, i+3, plMatRefMsg::kLayer | plMatRefMsg::kInsert);
hsgResMgr::ResMgr()->SendRef(lay3->GetKey(), refMsg, plRefFlags::kActiveRef);
}
}
@ -3577,7 +3577,7 @@ void plWaveSet7::ISetupDecal(hsGMaterial* mat)
void plWaveSet7::AddShoreTest(plKey& key)
{
hsgResMgr::ResMgr()->SendRef(key, TRACKED_NEW plGenRefMsg(GetKey(), plRefMsg::kOnCreate, -1, kRefShore), plRefFlags::kPassiveRef);
hsgResMgr::ResMgr()->SendRef(key, new plGenRefMsg(GetKey(), plRefMsg::kOnCreate, -1, kRefShore), plRefFlags::kPassiveRef);
plSceneObject* so = plSceneObject::ConvertNoRef(key->ObjectIsLoaded());
ICheckShoreMaterial(so);
@ -3697,32 +3697,32 @@ plDrawableSpans* plWaveSet7::ICreateGraphDrawable(plDrawableSpans* drawable, hsG
plDrawableSpans* plWaveSet7::ICreateEmptyGraphDrawable(const char* name, uint32_t ref, int which)
{
plDrawableSpans* drawable = TRACKED_NEW plDrawableSpans;
plDrawableSpans* drawable = new plDrawableSpans;
char buff[256];
sprintf(buff, "%s_%s_%d", GetKey()->GetName(), name, which);
hsgResMgr::ResMgr()->NewKey(buff, drawable, GetKey()->GetUoid().GetLocation());
hsgResMgr::ResMgr()->SendRef(drawable->GetKey(), TRACKED_NEW plGenRefMsg(GetKey(), plRefMsg::kOnRequest, which, (int8_t)ref), plRefFlags::kActiveRef);
hsgResMgr::ResMgr()->SendRef(drawable->GetKey(), new plGenRefMsg(GetKey(), plRefMsg::kOnRequest, which, (int8_t)ref), plRefFlags::kActiveRef);
return drawable;
}
hsGMaterial* plWaveSet7::ICreateEmptyMaterial(const char* name, uint32_t ref, int which)
{
hsGMaterial* mat = TRACKED_NEW hsGMaterial;
hsGMaterial* mat = new hsGMaterial;
char buff[256];
sprintf(buff, "%s_%s_%d", GetKey()->GetName(), name, which);
hsgResMgr::ResMgr()->NewKey(buff, mat, GetKey()->GetUoid().GetLocation());
hsgResMgr::ResMgr()->SendRef(mat->GetKey(), TRACKED_NEW plGenRefMsg(GetKey(), plRefMsg::kOnRequest, which, (int8_t)ref), plRefFlags::kActiveRef);
hsgResMgr::ResMgr()->SendRef(mat->GetKey(), new plGenRefMsg(GetKey(), plRefMsg::kOnRequest, which, (int8_t)ref), plRefFlags::kActiveRef);
return mat;
}
plLayer* plWaveSet7::ICreateBlankLayer(const char* name, int suff)
{
plLayer* lay = TRACKED_NEW plLayer;
plLayer* lay = new plLayer;
char buff[256];
sprintf(buff, "%s_%s_%d", GetKey()->GetName(), name, suff);
hsgResMgr::ResMgr()->NewKey(buff, lay, GetKey()->GetUoid().GetLocation());
@ -3732,7 +3732,7 @@ plLayer* plWaveSet7::ICreateBlankLayer(const char* name, int suff)
plMipmap* plWaveSet7::ICreateBlankTex(const char* name, int width, int height, uint32_t ref)
{
plMipmap* mipMap = TRACKED_NEW plMipmap(
plMipmap* mipMap = new plMipmap(
width, height,
plMipmap::kARGB32Config,
1,
@ -3743,7 +3743,7 @@ plMipmap* plWaveSet7::ICreateBlankTex(const char* name, int width, int height, u
sprintf(buff, "%s_%s", GetKey()->GetName(), name);
hsgResMgr::ResMgr()->NewKey(buff, mipMap, GetKey()->GetUoid().GetLocation());
hsgResMgr::ResMgr()->SendRef(mipMap->GetKey(), TRACKED_NEW plGenRefMsg(GetKey(), plRefMsg::kOnRequest, 0, (int8_t)ref), plRefFlags::kActiveRef);
hsgResMgr::ResMgr()->SendRef(mipMap->GetKey(), new plGenRefMsg(GetKey(), plRefMsg::kOnRequest, 0, (int8_t)ref), plRefFlags::kActiveRef);
return mipMap;
}
@ -3996,7 +3996,7 @@ plMipmap* plWaveSet7::ICreateEdgeShoreTex(int width, int height)
void plWaveSet7::ISetAsTexture(plLayer* lay, plBitmap* tex)
{
hsAssert(lay && tex, "Trying to set nil texture or nil layer");
plLayRefMsg* refMsg = TRACKED_NEW plLayRefMsg(lay->GetKey(), plRefMsg::kOnRequest, 0, plLayRefMsg::kTexture);
plLayRefMsg* refMsg = new plLayRefMsg(lay->GetKey(), plRefMsg::kOnRequest, 0, plLayRefMsg::kTexture);
hsgResMgr::ResMgr()->SendRef(tex->GetKey(), refMsg, plRefFlags::kActiveRef);
}
@ -4145,7 +4145,7 @@ void plWaveSet7::IAddGraphVShader(hsGMaterial* mat, int iPass)
{
if( !fGraphVShader[iPass] )
{
plShader* vShader = TRACKED_NEW plShader;
plShader* vShader = new plShader;
char buff[256];
sprintf(buff, "%s_GraphVS_%d", GetKey()->GetName(), iPass);
hsgResMgr::ResMgr()->NewKey(buff, vShader, GetKey()->GetUoid().GetLocation());
@ -4168,7 +4168,7 @@ void plWaveSet7::IAddGraphVShader(hsGMaterial* mat, int iPass)
// vShader->SetShaderFileName("sha/vs_WaveGraph2.inl");
vShader->SetDecl(plShaderTable::Decl(vs_WaveGraph2));
hsgResMgr::ResMgr()->SendRef(vShader->GetKey(), TRACKED_NEW plGenRefMsg(GetKey(), plRefMsg::kOnRequest, iPass, kRefGraphVShader), plRefFlags::kActiveRef);
hsgResMgr::ResMgr()->SendRef(vShader->GetKey(), new plGenRefMsg(GetKey(), plRefMsg::kOnRequest, iPass, kRefGraphVShader), plRefFlags::kActiveRef);
hsAssert(fGraphVShader[iPass] == vShader, "SendRef should have set shader");
}
@ -4180,7 +4180,7 @@ void plWaveSet7::IAddGraphPShader(hsGMaterial* mat, int iPass)
{
if( !fGraphPShader[iPass] )
{
plShader* pShader = TRACKED_NEW plShader;
plShader* pShader = new plShader;
char buff[256];
sprintf(buff, "%s_GraphPS_%d", GetKey()->GetName(), iPass);
hsgResMgr::ResMgr()->NewKey(buff, pShader, GetKey()->GetUoid().GetLocation());
@ -4194,7 +4194,7 @@ void plWaveSet7::IAddGraphPShader(hsGMaterial* mat, int iPass)
// pShader->SetShaderFileName("sha/ps_WaveGraph.inl");
pShader->SetDecl(plShaderTable::Decl(ps_WaveGraph));
hsgResMgr::ResMgr()->SendRef(pShader->GetKey(), TRACKED_NEW plGenRefMsg(GetKey(), plRefMsg::kOnRequest, iPass, kRefGraphPShader), plRefFlags::kActiveRef);
hsgResMgr::ResMgr()->SendRef(pShader->GetKey(), new plGenRefMsg(GetKey(), plRefMsg::kOnRequest, iPass, kRefGraphPShader), plRefFlags::kActiveRef);
hsAssert(fGraphPShader[iPass] == pShader, "SendRef should have set shader");
}
@ -4209,10 +4209,10 @@ plRenderTarget* plWaveSet7::ISetupGraphShoreRenderReq(int which)
sprintf(name, "Graph_%d", which);
plRenderTarget* rt = ICreateTransferRenderTarget(name, kGraphSize);
hsgResMgr::ResMgr()->SendRef(rt->GetKey(), TRACKED_NEW plGenRefMsg(GetKey(), plRefMsg::kOnRequest, which, kRefGraphShoreRT), plRefFlags::kActiveRef);
hsgResMgr::ResMgr()->SendRef(rt->GetKey(), new plGenRefMsg(GetKey(), plRefMsg::kOnRequest, which, kRefGraphShoreRT), plRefFlags::kActiveRef);
fGraphReq[which] = ICreateRenderRequest(rt, fGraphShoreDraw[which], -100.f);
fGraphReqMsg[which] = TRACKED_NEW plRenderRequestMsg(GetKey(), fGraphReq[which]);
fGraphReqMsg[which] = new plRenderRequestMsg(GetKey(), fGraphReq[which]);
return rt;
}
@ -4255,7 +4255,7 @@ void plWaveSet7::IMakeShoreLayer(hsGMaterial* mat, int which)
char name[512];
if( which >= mat->GetNumLayers() )
{
plLayer* lay = TRACKED_NEW plLayer;
plLayer* lay = new plLayer;
sprintf(name, "%s_lay_%d", mat->GetKey()->GetName(), which);
hsgResMgr::ResMgr()->NewKey(name, lay, GetKey()->GetUoid().GetLocation());

View File

@ -56,11 +56,11 @@ plWaveSetBase::~plWaveSetBase()
void plWaveSetBase::AddShore(plKey key)
{
hsgResMgr::ResMgr()->SendRef(key, TRACKED_NEW plGenRefMsg(GetKey(), plRefMsg::kOnCreate, -1, IShoreRef()), plRefFlags::kPassiveRef);
hsgResMgr::ResMgr()->SendRef(key, new plGenRefMsg(GetKey(), plRefMsg::kOnCreate, -1, IShoreRef()), plRefFlags::kPassiveRef);
}
void plWaveSetBase::AddDecal(plKey key)
{
hsgResMgr::ResMgr()->SendRef(key, TRACKED_NEW plGenRefMsg(GetKey(), plRefMsg::kOnCreate, -1, IDecalRef()), plRefFlags::kPassiveRef);
hsgResMgr::ResMgr()->SendRef(key, new plGenRefMsg(GetKey(), plRefMsg::kOnCreate, -1, IDecalRef()), plRefFlags::kPassiveRef);
}