mirror of
https://foundry.openuru.org/gitblit/r/CWE-ou-minkata.git
synced 2025-07-18 19:29:09 +00:00
Get rid of NEW(), TRACKED_NEW, and ZERO().
This commit is contained in:
@ -116,7 +116,7 @@ hsGMaterial* hsGMaterial::Clone()
|
||||
|
||||
hsGMaterial* hsGMaterial::CloneNoLayers()
|
||||
{
|
||||
hsGMaterial* clo = TRACKED_NEW hsGMaterial;
|
||||
hsGMaterial* clo = new hsGMaterial;
|
||||
|
||||
clo->fCompFlags = fCompFlags;
|
||||
clo->fLoadFlags = fLoadFlags;
|
||||
@ -126,7 +126,7 @@ hsGMaterial* hsGMaterial::CloneNoLayers()
|
||||
|
||||
plLayer* hsGMaterial::MakeBaseLayer()
|
||||
{
|
||||
plLayer* newLay = TRACKED_NEW plLayer;
|
||||
plLayer* newLay = new plLayer;
|
||||
newLay->InitToDefault();
|
||||
IClearLayers();
|
||||
|
||||
@ -150,7 +150,7 @@ uint32_t hsGMaterial::AddLayerViaNotify(plLayerInterface* layer)
|
||||
int idx = GetNumLayers();
|
||||
|
||||
// Add via notify so we'll dispose of it properly later.
|
||||
plMatRefMsg* msg = TRACKED_NEW plMatRefMsg(GetKey(), plRefMsg::kOnRequest, idx, plMatRefMsg::kLayer);
|
||||
plMatRefMsg* msg = new plMatRefMsg(GetKey(), plRefMsg::kOnRequest, idx, plMatRefMsg::kLayer);
|
||||
hsgResMgr::ResMgr()->SendRef(layer->GetKey(), msg, plRefFlags::kActiveRef);
|
||||
|
||||
fLayers.SetCount(idx+1);
|
||||
@ -266,12 +266,12 @@ void hsGMaterial::Read(hsStream *stream, hsResMgr *group)
|
||||
// Assign texture(s)
|
||||
for (iLay = 0; iLay < GetNumLayers(); iLay++)
|
||||
{
|
||||
plMatRefMsg* msg = TRACKED_NEW plMatRefMsg(GetKey(), plRefMsg::kOnCreate, iLay, plMatRefMsg::kLayer);
|
||||
plMatRefMsg* msg = new plMatRefMsg(GetKey(), plRefMsg::kOnCreate, iLay, plMatRefMsg::kLayer);
|
||||
plKey key = group->ReadKeyNotifyMe(stream, msg, plRefFlags::kActiveRef);
|
||||
}
|
||||
for (iLay = 0; iLay < GetNumPiggyBacks(); iLay++)
|
||||
{
|
||||
plMatRefMsg* msg = TRACKED_NEW plMatRefMsg(GetKey(), plRefMsg::kOnCreate, iLay, plMatRefMsg::kPiggyBack);
|
||||
plMatRefMsg* msg = new plMatRefMsg(GetKey(), plRefMsg::kOnCreate, iLay, plMatRefMsg::kPiggyBack);
|
||||
plKey key = group->ReadKeyNotifyMe(stream, msg, plRefFlags::kActiveRef);
|
||||
}
|
||||
}
|
||||
|
@ -200,7 +200,7 @@ void plGrassShaderMod::Read(hsStream *stream, hsResMgr *mgr)
|
||||
{
|
||||
plModifier::Read(stream, mgr);
|
||||
|
||||
mgr->ReadKeyNotifyMe(stream, TRACKED_NEW plGenRefMsg(GetKey(), plRefMsg::kOnRequest, 0, kRefMaterial), plRefFlags::kActiveRef);
|
||||
mgr->ReadKeyNotifyMe(stream, new plGenRefMsg(GetKey(), plRefMsg::kOnRequest, 0, kRefMaterial), plRefFlags::kActiveRef);
|
||||
|
||||
int i;
|
||||
for (i = 0; i < kNumWaves; i++)
|
||||
@ -225,7 +225,7 @@ void plGrassShaderMod::ISetupShaders()
|
||||
{
|
||||
if (!fVShader)
|
||||
{
|
||||
plShader* vShader = TRACKED_NEW plShader;
|
||||
plShader* vShader = new plShader;
|
||||
char buff[256];
|
||||
sprintf(buff, "%s_GrassVS", GetKey()->GetName());
|
||||
hsgResMgr::ResMgr()->NewKey(buff, vShader, GetKey()->GetUoid().GetLocation());
|
||||
@ -244,12 +244,12 @@ void plGrassShaderMod::ISetupShaders()
|
||||
vShader->SetPipeConst(0, plPipeConst::kLocalToNDC, plGrassVS::kLocalToNDC);
|
||||
|
||||
vShader->SetDecl(plShaderTable::Decl(plShaderID::vs_GrassShader));
|
||||
hsgResMgr::ResMgr()->SendRef(vShader->GetKey(), TRACKED_NEW plGenRefMsg(GetKey(), plRefMsg::kOnRequest, 0, kRefGrassVS), plRefFlags::kActiveRef);
|
||||
hsgResMgr::ResMgr()->SendRef(vShader->GetKey(), new plGenRefMsg(GetKey(), plRefMsg::kOnRequest, 0, kRefGrassVS), plRefFlags::kActiveRef);
|
||||
}
|
||||
|
||||
if (!fPShader)
|
||||
{
|
||||
plShader* pShader = TRACKED_NEW plShader;
|
||||
plShader* pShader = new plShader;
|
||||
char buff[256];
|
||||
sprintf(buff, "%s_GrassPS", GetKey()->GetName());
|
||||
hsgResMgr::ResMgr()->NewKey(buff, pShader, GetKey()->GetUoid().GetLocation());
|
||||
@ -258,18 +258,18 @@ void plGrassShaderMod::ISetupShaders()
|
||||
pShader->SetInputFormat(0);
|
||||
pShader->SetOutputFormat(0);
|
||||
pShader->SetDecl(plShaderTable::Decl(plShaderID::ps_GrassShader));
|
||||
hsgResMgr::ResMgr()->SendRef(pShader->GetKey(), TRACKED_NEW plGenRefMsg(GetKey(), plRefMsg::kOnRequest, 0, kRefGrassPS), plRefFlags::kActiveRef);
|
||||
hsgResMgr::ResMgr()->SendRef(pShader->GetKey(), new plGenRefMsg(GetKey(), plRefMsg::kOnRequest, 0, kRefGrassPS), plRefFlags::kActiveRef);
|
||||
}
|
||||
|
||||
plLayer* layer = plLayer::ConvertNoRef(fMaterial->GetLayer(0)->BottomOfStack());
|
||||
if (layer && (layer->GetVertexShader() != fVShader))
|
||||
{
|
||||
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(fVShader->GetKey(), refMsg, plRefFlags::kActiveRef);
|
||||
}
|
||||
if (layer && (layer->GetPixelShader() != fPShader))
|
||||
{
|
||||
plLayRefMsg* refMsg = TRACKED_NEW plLayRefMsg(layer->GetKey(), plRefMsg::kOnCreate, 0, plLayRefMsg::kPixelShader);
|
||||
plLayRefMsg* refMsg = new plLayRefMsg(layer->GetKey(), plRefMsg::kOnCreate, 0, plLayRefMsg::kPixelShader);
|
||||
hsgResMgr::ResMgr()->SendRef(fPShader->GetKey(), refMsg, plRefFlags::kActiveRef);
|
||||
}
|
||||
}
|
||||
|
@ -73,32 +73,32 @@ plLayer::plLayer()
|
||||
| kPixelShader
|
||||
| kBumpEnvXfm;
|
||||
|
||||
fTransform = TRACKED_NEW hsMatrix44;
|
||||
fTransform = new hsMatrix44;
|
||||
fTransform->Reset();
|
||||
|
||||
fPreshadeColor = TRACKED_NEW hsColorRGBA;
|
||||
fRuntimeColor = TRACKED_NEW hsColorRGBA;
|
||||
fAmbientColor = TRACKED_NEW hsColorRGBA;
|
||||
fSpecularColor = TRACKED_NEW hsColorRGBA;
|
||||
fOpacity = TRACKED_NEW float;
|
||||
fPreshadeColor = new hsColorRGBA;
|
||||
fRuntimeColor = new hsColorRGBA;
|
||||
fAmbientColor = new hsColorRGBA;
|
||||
fSpecularColor = new hsColorRGBA;
|
||||
fOpacity = new float;
|
||||
|
||||
fState = TRACKED_NEW hsGMatState;
|
||||
fState = new hsGMatState;
|
||||
fState->Reset();
|
||||
|
||||
fUVWSrc = TRACKED_NEW uint32_t;
|
||||
fLODBias = TRACKED_NEW float;
|
||||
fSpecularPower = TRACKED_NEW float;
|
||||
fUVWSrc = new uint32_t;
|
||||
fLODBias = new float;
|
||||
fSpecularPower = new float;
|
||||
|
||||
fTexture = TRACKED_NEW plBitmap*;
|
||||
fTexture = new plBitmap*;
|
||||
*fTexture = nil;
|
||||
|
||||
fVertexShader = TRACKED_NEW plShader*;
|
||||
fVertexShader = new plShader*;
|
||||
*fVertexShader = nil;
|
||||
|
||||
fPixelShader = TRACKED_NEW plShader*;
|
||||
fPixelShader = new plShader*;
|
||||
*fPixelShader = nil;
|
||||
|
||||
fBumpEnvXfm = TRACKED_NEW hsMatrix44;
|
||||
fBumpEnvXfm = new hsMatrix44;
|
||||
fBumpEnvXfm->Reset();
|
||||
}
|
||||
|
||||
@ -128,14 +128,14 @@ void plLayer::Read(hsStream* s, hsResMgr* mgr)
|
||||
*fLODBias = s->ReadLEScalar();
|
||||
*fSpecularPower = s->ReadLEScalar();
|
||||
|
||||
plLayRefMsg* refMsg = TRACKED_NEW plLayRefMsg(GetKey(), plRefMsg::kOnCreate, 0, plLayRefMsg::kTexture);
|
||||
plLayRefMsg* refMsg = new plLayRefMsg(GetKey(), plRefMsg::kOnCreate, 0, plLayRefMsg::kTexture);
|
||||
mgr->ReadKeyNotifyMe(s,refMsg, plRefFlags::kActiveRef);
|
||||
|
||||
#if 1 // For read/write shaders
|
||||
refMsg = TRACKED_NEW plLayRefMsg(GetKey(), plRefMsg::kOnCreate, 0, plLayRefMsg::kVertexShader);
|
||||
refMsg = new plLayRefMsg(GetKey(), plRefMsg::kOnCreate, 0, plLayRefMsg::kVertexShader);
|
||||
mgr->ReadKeyNotifyMe(s,refMsg, plRefFlags::kActiveRef);
|
||||
|
||||
refMsg = TRACKED_NEW plLayRefMsg(GetKey(), plRefMsg::kOnCreate, 0, plLayRefMsg::kPixelShader);
|
||||
refMsg = new plLayRefMsg(GetKey(), plRefMsg::kOnCreate, 0, plLayRefMsg::kPixelShader);
|
||||
mgr->ReadKeyNotifyMe(s,refMsg, plRefFlags::kActiveRef);
|
||||
|
||||
fBumpEnvXfm->Read(s);
|
||||
|
@ -98,32 +98,32 @@ void plLayerAnimationBase::Read(hsStream* s, hsResMgr* mgr)
|
||||
if( fOpacityCtl )
|
||||
{
|
||||
fOwnedChannels |= kOpacity;
|
||||
fOpacity = TRACKED_NEW float;
|
||||
fOpacity = new float;
|
||||
}
|
||||
if( fPreshadeColorCtl )
|
||||
{
|
||||
fOwnedChannels |= kPreshadeColor;
|
||||
fPreshadeColor = TRACKED_NEW hsColorRGBA;
|
||||
fPreshadeColor = new hsColorRGBA;
|
||||
}
|
||||
if( fRuntimeColorCtl )
|
||||
{
|
||||
fOwnedChannels |= kRuntimeColor;
|
||||
fRuntimeColor = TRACKED_NEW hsColorRGBA;
|
||||
fRuntimeColor = new hsColorRGBA;
|
||||
}
|
||||
if( fAmbientColorCtl )
|
||||
{
|
||||
fOwnedChannels |= kAmbientColor;
|
||||
fAmbientColor = TRACKED_NEW hsColorRGBA;
|
||||
fAmbientColor = new hsColorRGBA;
|
||||
}
|
||||
if( fSpecularColorCtl )
|
||||
{
|
||||
fOwnedChannels |= kSpecularColor;
|
||||
fSpecularColor = TRACKED_NEW hsColorRGBA;
|
||||
fSpecularColor = new hsColorRGBA;
|
||||
}
|
||||
if( fTransformCtl )
|
||||
{
|
||||
fOwnedChannels |= kTransform;
|
||||
fTransform = TRACKED_NEW hsMatrix44;
|
||||
fTransform = new hsMatrix44;
|
||||
}
|
||||
fLength = IMakeUniformLength();
|
||||
}
|
||||
@ -220,7 +220,7 @@ void plLayerAnimationBase::SetPreshadeColorCtl(plController* colCtl)
|
||||
if( fPreshadeColorCtl )
|
||||
delete fPreshadeColorCtl;
|
||||
else
|
||||
fPreshadeColor = TRACKED_NEW hsColorRGBA;
|
||||
fPreshadeColor = new hsColorRGBA;
|
||||
|
||||
fOwnedChannels |= kPreshadeColor;
|
||||
fPreshadeColorCtl = colCtl;
|
||||
@ -231,7 +231,7 @@ void plLayerAnimationBase::SetRuntimeColorCtl(plController* colCtl)
|
||||
if( fRuntimeColorCtl )
|
||||
delete fRuntimeColorCtl;
|
||||
else
|
||||
fRuntimeColor = TRACKED_NEW hsColorRGBA;
|
||||
fRuntimeColor = new hsColorRGBA;
|
||||
|
||||
fOwnedChannels |= kRuntimeColor;
|
||||
fRuntimeColorCtl = colCtl;
|
||||
@ -242,7 +242,7 @@ void plLayerAnimationBase::SetAmbientColorCtl(plController* ambCtl)
|
||||
if( fAmbientColorCtl )
|
||||
delete fAmbientColorCtl;
|
||||
else
|
||||
fAmbientColor = TRACKED_NEW hsColorRGBA;
|
||||
fAmbientColor = new hsColorRGBA;
|
||||
|
||||
fOwnedChannels |= kAmbientColor;
|
||||
fAmbientColorCtl = ambCtl;
|
||||
@ -253,7 +253,7 @@ void plLayerAnimationBase::SetSpecularColorCtl(plController* ambCtl)
|
||||
if( fSpecularColorCtl )
|
||||
delete fSpecularColorCtl;
|
||||
else
|
||||
fSpecularColor = TRACKED_NEW hsColorRGBA;
|
||||
fSpecularColor = new hsColorRGBA;
|
||||
|
||||
fOwnedChannels |= kSpecularColor;
|
||||
fSpecularColorCtl = ambCtl;
|
||||
@ -264,7 +264,7 @@ void plLayerAnimationBase::SetOpacityCtl(plController* opaCtl)
|
||||
if( fOpacityCtl )
|
||||
delete fOpacityCtl;
|
||||
else
|
||||
fOpacity = TRACKED_NEW float;
|
||||
fOpacity = new float;
|
||||
|
||||
fOwnedChannels |= kOpacity;
|
||||
fOpacityCtl = opaCtl;
|
||||
@ -275,7 +275,7 @@ void plLayerAnimationBase::SetTransformCtl(plController* xfmCtl)
|
||||
if( fTransformCtl )
|
||||
delete fTransformCtl;
|
||||
else
|
||||
fTransform = TRACKED_NEW hsMatrix44;
|
||||
fTransform = new hsMatrix44;
|
||||
|
||||
fOwnedChannels |= kTransform;
|
||||
fTransformCtl = xfmCtl;
|
||||
@ -330,7 +330,7 @@ void plLayerAnimation::Read(hsStream* s, hsResMgr* mgr)
|
||||
|
||||
// add sdl modifier
|
||||
delete fLayerSDLMod;
|
||||
fLayerSDLMod = TRACKED_NEW plLayerSDLModifier;
|
||||
fLayerSDLMod = new plLayerSDLModifier;
|
||||
fLayerSDLMod->SetLayerAnimation(this);
|
||||
}
|
||||
|
||||
@ -427,7 +427,7 @@ plLayerLinkAnimation::plLayerLinkAnimation() :
|
||||
fLastFadeFlag(0),
|
||||
fFadeFlagsDirty(false)
|
||||
{
|
||||
fIFaceCallback = TRACKED_NEW plEventCallbackMsg();
|
||||
fIFaceCallback = new plEventCallbackMsg();
|
||||
fIFaceCallback->fEvent = kTime;
|
||||
fIFaceCallback->fRepeats = 0;
|
||||
}
|
||||
@ -527,7 +527,7 @@ uint32_t plLayerLinkAnimation::Eval(double wSecs, uint32_t frame, uint32_t ignor
|
||||
{
|
||||
// Either we're going opaque, or we were opaque and now we're fading.
|
||||
// Tell the armature to re-eval its opacity settings.
|
||||
plAvatarOpacityCallbackMsg *opacityMsg = TRACKED_NEW plAvatarOpacityCallbackMsg(fLinkKey, kStop);
|
||||
plAvatarOpacityCallbackMsg *opacityMsg = new plAvatarOpacityCallbackMsg(fLinkKey, kStop);
|
||||
opacityMsg->SetBCastFlag(plMessage::kPropagateToModifiers);
|
||||
opacityMsg->Send();
|
||||
}
|
||||
|
@ -148,7 +148,7 @@ uint32_t plLayerInterface::Eval(double secs, uint32_t frame, uint32_t ignore)
|
||||
// Export Only
|
||||
void plLayerInterface::AttachViaNotify(plLayerInterface *prev)
|
||||
{
|
||||
plLayRefMsg* refMsg = TRACKED_NEW plLayRefMsg(GetKey(), plRefMsg::kOnCreate, 0, plLayRefMsg::kUnderLay);
|
||||
plLayRefMsg* refMsg = new plLayRefMsg(GetKey(), plRefMsg::kOnCreate, 0, plLayRefMsg::kUnderLay);
|
||||
hsgResMgr::ResMgr()->AddViaNotify(prev->GetKey(), refMsg, plRefFlags::kActiveRef);
|
||||
}
|
||||
|
||||
@ -330,7 +330,7 @@ void plLayerInterface::Read(hsStream* s, hsResMgr* mgr)
|
||||
{
|
||||
plSynchedObject::Read(s, mgr);
|
||||
|
||||
plLayRefMsg* refMsg = TRACKED_NEW plLayRefMsg(GetKey(), plRefMsg::kOnCreate, 0, plLayRefMsg::kUnderLay);
|
||||
plLayRefMsg* refMsg = new plLayRefMsg(GetKey(), plRefMsg::kOnCreate, 0, plLayRefMsg::kUnderLay);
|
||||
plKey key = mgr->ReadKeyNotifyMe(s,refMsg, plRefFlags::kActiveRef);
|
||||
if( key && !fUnderLay )
|
||||
Attach(plLayer::DefaultLayer());
|
||||
|
@ -60,14 +60,14 @@ void plLayerMultiply::Read(hsStream* s, hsResMgr* mgr)
|
||||
fOwnedChannels = s->ReadLE32();
|
||||
if (fOwnedChannels & kOpacity)
|
||||
{
|
||||
fOpacity = TRACKED_NEW float;
|
||||
fOpacity = new float;
|
||||
*fOpacity = fSrcOpacity = s->ReadLEScalar();
|
||||
fDirtyChannels |= kOpacity;
|
||||
}
|
||||
|
||||
if (fOwnedChannels & kPreshadeColor)
|
||||
{
|
||||
fPreshadeColor = TRACKED_NEW hsColorRGBA;
|
||||
fPreshadeColor = new hsColorRGBA;
|
||||
fSrcPreshadeColor.Read(s);
|
||||
*fPreshadeColor = fSrcPreshadeColor;
|
||||
fDirtyChannels |= kPreshadeColor;
|
||||
@ -75,7 +75,7 @@ void plLayerMultiply::Read(hsStream* s, hsResMgr* mgr)
|
||||
|
||||
if (fOwnedChannels & kRuntimeColor)
|
||||
{
|
||||
fRuntimeColor = TRACKED_NEW hsColorRGBA;
|
||||
fRuntimeColor = new hsColorRGBA;
|
||||
fSrcRuntimeColor.Read(s);
|
||||
*fRuntimeColor = fSrcRuntimeColor;
|
||||
fDirtyChannels |= kRuntimeColor;
|
||||
@ -83,7 +83,7 @@ void plLayerMultiply::Read(hsStream* s, hsResMgr* mgr)
|
||||
|
||||
if (fOwnedChannels & kAmbientColor)
|
||||
{
|
||||
fAmbientColor = TRACKED_NEW hsColorRGBA;
|
||||
fAmbientColor = new hsColorRGBA;
|
||||
fSrcAmbientColor.Read(s);
|
||||
*fAmbientColor = fSrcAmbientColor;
|
||||
fDirtyChannels |= kAmbientColor;
|
||||
@ -91,7 +91,7 @@ void plLayerMultiply::Read(hsStream* s, hsResMgr* mgr)
|
||||
|
||||
if (fOwnedChannels & kTransform)
|
||||
{
|
||||
fTransform = TRACKED_NEW hsMatrix44;
|
||||
fTransform = new hsMatrix44;
|
||||
fSrcTransform.Read(s);
|
||||
*fTransform = fSrcTransform;
|
||||
fDirtyChannels |= kTransform;
|
||||
@ -181,4 +181,4 @@ void plLayerMultiply::SetTransform(const hsMatrix44& xfm)
|
||||
{
|
||||
fSrcTransform = xfm;
|
||||
fDirtyChannels |= kTransform;
|
||||
}
|
||||
}
|
||||
|
@ -45,7 +45,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||
|
||||
plLayerOr::plLayerOr()
|
||||
{
|
||||
fState = TRACKED_NEW hsGMatState;
|
||||
fState = new hsGMatState;
|
||||
fState->Reset();
|
||||
|
||||
fOwnedChannels = kState;
|
||||
|
@ -51,13 +51,13 @@ plLayerLightBase::plLayerLightBase()
|
||||
| kAmbientColor
|
||||
| kPreshadeColor;
|
||||
|
||||
fState = TRACKED_NEW hsGMatState;
|
||||
fState = new hsGMatState;
|
||||
fState->Reset();
|
||||
|
||||
fAmbientColor = TRACKED_NEW hsColorRGBA;
|
||||
fAmbientColor = new hsColorRGBA;
|
||||
fAmbientColor->Set(0,0,0,1.f);
|
||||
|
||||
fPreshadeColor = TRACKED_NEW hsColorRGBA;
|
||||
fPreshadeColor = new hsColorRGBA;
|
||||
fPreshadeColor->Set(0,0,0,1.f);
|
||||
}
|
||||
|
||||
@ -114,13 +114,13 @@ plLayerShadowBase::plLayerShadowBase()
|
||||
| kAmbientColor
|
||||
| kPreshadeColor;
|
||||
|
||||
fState = TRACKED_NEW hsGMatState;
|
||||
fState = new hsGMatState;
|
||||
fState->Reset();
|
||||
|
||||
fAmbientColor = TRACKED_NEW hsColorRGBA;
|
||||
fAmbientColor = new hsColorRGBA;
|
||||
fAmbientColor->Set(0,0,0,1.f);
|
||||
|
||||
fPreshadeColor = TRACKED_NEW hsColorRGBA;
|
||||
fPreshadeColor = new hsColorRGBA;
|
||||
fPreshadeColor->Set(0,0,0,1.f);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user