1
0
mirror of https://foundry.openuru.org/gitblit/r/CWE-ou-minkata.git synced 2025-07-18 03:09:13 +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

@ -77,7 +77,7 @@ void plAnimEventModifier::Read(hsStream* stream, hsResMgr* mgr)
//
plKey animKey = fCallback->GetReceiver(0);
hsgResMgr::ResMgr()->AddViaNotify(animKey,
TRACKED_NEW plGenRefMsg(GetKey(), plRefMsg::kOnCreate, 0, 0),
new plGenRefMsg(GetKey(), plRefMsg::kOnCreate, 0, 0),
plRefFlags::kPassiveRef);
}
@ -128,7 +128,7 @@ void plAnimEventModifier::ISendNotify(bool triggered)
{
if (fDisabled)
return;
plNotifyMsg* notify = TRACKED_NEW plNotifyMsg;
plNotifyMsg* notify = new plNotifyMsg;
// Setup the event data in case this is a OneShot responder that needs it
plKey playerKey = plNetClientApp::GetInstance()->GetLocalPlayerKey();

View File

@ -88,7 +88,7 @@ class plAxisInputInterface : public plInputInterface
if( pMMsg->GetButton() == kLeftButtonUp )
{
// Remove ourselves from the stack
plInputIfaceMgrMsg *msg = TRACKED_NEW plInputIfaceMgrMsg( plInputIfaceMgrMsg::kRemoveInterface );
plInputIfaceMgrMsg *msg = new plInputIfaceMgrMsg( plInputIfaceMgrMsg::kRemoveInterface );
msg->SetIFace( this );
plgDispatch::MsgSend( msg );
return true;
@ -112,8 +112,8 @@ fYPos(0.0f),
fIface(0),
fAllOrNothing(false)
{
fNotify = TRACKED_NEW plNotifyMsg;
fInputIface = TRACKED_NEW plAxisInputInterface( this );
fNotify = new plNotifyMsg;
fInputIface = new plAxisInputInterface( this );
}
plAxisAnimModifier::~plAxisAnimModifier()
{
@ -172,7 +172,7 @@ hsBool plAxisAnimModifier::MsgReceive(plMessage* msg)
fYPos = plMouseDevice::Instance()->GetCursorY();
// Insert our input interface onto the input stack
plInputIfaceMgrMsg *msg = TRACKED_NEW plInputIfaceMgrMsg( plInputIfaceMgrMsg::kAddInterface );
plInputIfaceMgrMsg *msg = new plInputIfaceMgrMsg( plInputIfaceMgrMsg::kAddInterface );
msg->SetIFace( fInputIface );
plgDispatch::MsgSend( msg );
}
@ -183,7 +183,7 @@ hsBool plAxisAnimModifier::MsgReceive(plMessage* msg)
fActive = false;
// Remove our input interface from the input stack
plInputIfaceMgrMsg *msg = TRACKED_NEW plInputIfaceMgrMsg( plInputIfaceMgrMsg::kRemoveInterface );
plInputIfaceMgrMsg *msg = new plInputIfaceMgrMsg( plInputIfaceMgrMsg::kRemoveInterface );
msg->SetIFace( fInputIface );
plgDispatch::MsgSend( msg );
}
@ -201,7 +201,7 @@ hsBool plAxisAnimModifier::MsgReceive(plMessage* msg)
{
if (pMMsg->GetDX() > 0.05f)
return true;
plAnimCmdMsg* pMsg = TRACKED_NEW plAnimCmdMsg;
plAnimCmdMsg* pMsg = new plAnimCmdMsg;
pMsg->AddReceiver(fXAnim);
pMsg->SetAnimName(fAnimLabel.c_str());
// pMsg->SetAnimName()
@ -221,7 +221,7 @@ hsBool plAxisAnimModifier::MsgReceive(plMessage* msg)
if (pMMsg->GetDY() > 0.05f)
return true;
plAnimCmdMsg* pMsg = TRACKED_NEW plAnimCmdMsg;
plAnimCmdMsg* pMsg = new plAnimCmdMsg;
pMsg->AddReceiver(fYAnim);
pMsg->SetAnimName(fAnimLabel.c_str());
if (fYPos > pMMsg->GetYPos())
@ -233,7 +233,7 @@ hsBool plAxisAnimModifier::MsgReceive(plMessage* msg)
fActive = false;
// Remove our input interface from the input stack
plInputIfaceMgrMsg *msg = TRACKED_NEW plInputIfaceMgrMsg( plInputIfaceMgrMsg::kRemoveInterface );
plInputIfaceMgrMsg *msg = new plInputIfaceMgrMsg( plInputIfaceMgrMsg::kRemoveInterface );
msg->SetIFace( fInputIface );
plgDispatch::MsgSend( msg );
plInputManager::SetRecenterMouse(false);
@ -252,7 +252,7 @@ hsBool plAxisAnimModifier::MsgReceive(plMessage* msg)
fActive = false;
// Remove our input interface from the input stack
plInputIfaceMgrMsg *msg = TRACKED_NEW plInputIfaceMgrMsg( plInputIfaceMgrMsg::kRemoveInterface );
plInputIfaceMgrMsg *msg = new plInputIfaceMgrMsg( plInputIfaceMgrMsg::kRemoveInterface );
msg->SetIFace( fInputIface );
plgDispatch::MsgSend( msg );
@ -287,17 +287,17 @@ hsBool plAxisAnimModifier::MsgReceive(plMessage* msg)
fXAnim = pRefMsg->GetRef()->GetKey();
// add callbacks for beginning and end of animation
plEventCallbackMsg* pCall1 = TRACKED_NEW plEventCallbackMsg;
plEventCallbackMsg* pCall1 = new plEventCallbackMsg;
pCall1->fEvent = kBegin;
pCall1->fRepeats = -1;
pCall1->AddReceiver(GetKey());
plEventCallbackMsg* pCall2 = TRACKED_NEW plEventCallbackMsg;
plEventCallbackMsg* pCall2 = new plEventCallbackMsg;
pCall2->fEvent = kEnd;
pCall2->fRepeats = -1;
pCall2->AddReceiver(GetKey());
plAnimCmdMsg* pMsg = TRACKED_NEW plAnimCmdMsg;
plAnimCmdMsg* pMsg = new plAnimCmdMsg;
pMsg->SetCmd(plAnimCmdMsg::kAddCallbacks);
pMsg->AddCallback(pCall1);
pMsg->AddCallback(pCall2);
@ -315,17 +315,17 @@ hsBool plAxisAnimModifier::MsgReceive(plMessage* msg)
fYAnim = pRefMsg->GetRef()->GetKey();
// add callbacks for beginning and end of animation
plEventCallbackMsg* pCall1 = TRACKED_NEW plEventCallbackMsg;
plEventCallbackMsg* pCall1 = new plEventCallbackMsg;
pCall1->fEvent = kBegin;
pCall1->fRepeats = -1;
pCall1->AddReceiver(GetKey());
plEventCallbackMsg* pCall2 = TRACKED_NEW plEventCallbackMsg;
plEventCallbackMsg* pCall2 = new plEventCallbackMsg;
pCall2->fEvent = kEnd;
pCall2->fRepeats = -1;
pCall2->AddReceiver(GetKey());
plAnimCmdMsg* pMsg = TRACKED_NEW plAnimCmdMsg;
plAnimCmdMsg* pMsg = new plAnimCmdMsg;
pMsg->SetCmd(plAnimCmdMsg::kAddCallbacks);
pMsg->AddCallback(pCall1);
pMsg->AddCallback(pCall2);
@ -365,9 +365,9 @@ void plAxisAnimModifier::Read(hsStream* s, hsResMgr* mgr)
{
plSingleModifier::Read(s, mgr);
mgr->ReadKeyNotifyMe( s, TRACKED_NEW plGenRefMsg(GetKey(), plRefMsg::kOnCreate, 0, kTypeX), plRefFlags::kPassiveRef);
mgr->ReadKeyNotifyMe( s, TRACKED_NEW plGenRefMsg(GetKey(), plRefMsg::kOnCreate, 0, kTypeY), plRefFlags::kPassiveRef);
mgr->ReadKeyNotifyMe( s, TRACKED_NEW plGenRefMsg(GetKey(), plRefMsg::kOnCreate, 0, kTypeLogic), plRefFlags::kPassiveRef);
mgr->ReadKeyNotifyMe( s, new plGenRefMsg(GetKey(), plRefMsg::kOnCreate, 0, kTypeX), plRefFlags::kPassiveRef);
mgr->ReadKeyNotifyMe( s, new plGenRefMsg(GetKey(), plRefMsg::kOnCreate, 0, kTypeY), plRefFlags::kPassiveRef);
mgr->ReadKeyNotifyMe( s, new plGenRefMsg(GetKey(), plRefMsg::kOnCreate, 0, kTypeLogic), plRefFlags::kPassiveRef);
fAllOrNothing = s->ReadBool();
plNotifyMsg* pMsg = plNotifyMsg::ConvertNoRef(mgr->ReadCreatable(s));

View File

@ -111,18 +111,18 @@ plKey plCloneSpawnModifier::SpawnClone(const char* cloneName, const char* cloneA
if (key)
{
plLoadCloneMsg* cloneMsg = TRACKED_NEW plLoadCloneMsg(objUoid, requestor, 0);
plLoadCloneMsg* cloneMsg = new plLoadCloneMsg(objUoid, requestor, 0);
cloneMsg->SetBCastFlag(plMessage::kMsgWatch);
plKey cloneKey = cloneMsg->GetCloneKey();//resMgr->CloneKey(key);
cloneMsg->Send();
// Put the clone into the clone room, which also forces it to load.
plKey cloneNodeKey = resMgr->FindKey(kNetClientCloneRoom_KEY);
plNodeRefMsg* nodeRefCloneMsg = TRACKED_NEW plNodeRefMsg(cloneNodeKey, plNodeRefMsg::kOnRequest, -1, plNodeRefMsg::kObject);
plNodeRefMsg* nodeRefCloneMsg = new plNodeRefMsg(cloneNodeKey, plNodeRefMsg::kOnRequest, -1, plNodeRefMsg::kObject);
resMgr->AddViaNotify(cloneKey, nodeRefCloneMsg, plRefFlags::kActiveRef);
// Warp it into position
plWarpMsg *warpMsg = TRACKED_NEW plWarpMsg;
plWarpMsg *warpMsg = new plWarpMsg;
warpMsg->AddReceiver(cloneKey);
warpMsg->SetTransform(pos);
plgDispatch::MsgSend(warpMsg);

View File

@ -79,7 +79,7 @@ hsBool plDecalEnableMod::MsgReceive(plMessage* msg)
int i;
for( i = 0; i < fDecalMgrs.GetCount(); i++ )
{
plDynaDecalEnableMsg* ena = TRACKED_NEW plDynaDecalEnableMsg(fDecalMgrs[i], armKey, hsTimer::GetSysSeconds(), fWetLength, !coll->fEntering);
plDynaDecalEnableMsg* ena = new plDynaDecalEnableMsg(fDecalMgrs[i], armKey, hsTimer::GetSysSeconds(), fWetLength, !coll->fEntering);
ena->Send();
}

View File

@ -189,7 +189,7 @@ void plExcludeRegionModifier::AddTarget(plSceneObject* so)
if (so)
{
delete fSDLModifier;
fSDLModifier = TRACKED_NEW plExcludeRegionSDLModifier(this);
fSDLModifier = new plExcludeRegionSDLModifier(this);
so->AddModifier(fSDLModifier);
}
plSingleModifier::SetTarget(so);
@ -285,7 +285,7 @@ void plExcludeRegionModifier::IMoveAvatars()
if (closestIdx != -1)
{
plAvSeekMsg* msg = TRACKED_NEW plAvSeekMsg;
plAvSeekMsg* msg = new plAvSeekMsg;
msg->SetBCastFlag(plMessage::kPropagateToModifiers);
msg->AddReceiver(fContainedAvatars[i]);
msg->fSmartSeek = fSeek;
@ -305,7 +305,7 @@ void plExcludeRegionModifier::IMoveAvatars()
int numControllers = plPXPhysicalControllerCore::GetNumberOfControllersInThisSubWorld(phys->GetWorldKey());
if (numControllers > 0)
{
plPXPhysicalControllerCore** controllers = TRACKED_NEW plPXPhysicalControllerCore*[numControllers];
plPXPhysicalControllerCore** controllers = new plPXPhysicalControllerCore*[numControllers];
int actualCount = plPXPhysicalControllerCore::GetControllersInThisSubWorld(phys->GetWorldKey(), numControllers, controllers);
@ -323,7 +323,7 @@ void plExcludeRegionModifier::IMoveAvatars()
// *** warning; if there's more than one generic brain active, this will only look at the first
if (curGenBrain && curGenBrain->GetType() == plAvBrainGeneric::kLadder)
{
plAvBrainGenericMsg* pMsg = TRACKED_NEW plAvBrainGenericMsg(
plAvBrainGenericMsg* pMsg = new plAvBrainGenericMsg(
nil,
constAvMod->GetKey(),
plAvBrainGenericMsg::kGotoStage,
@ -341,7 +341,7 @@ void plExcludeRegionModifier::IMoveAvatars()
int closestIdx = IFindClosestSafePoint(controllers[i]->GetOwner());
if (closestIdx != -1)
{
plAvSeekMsg* msg = TRACKED_NEW plAvSeekMsg;
plAvSeekMsg* msg = new plAvSeekMsg;
msg->SetBCastFlag(plMessage::kPropagateToModifiers);
msg->AddReceiver(controllers[i]->GetOwner());
msg->fSmartSeek = fSeek;

View File

@ -52,7 +52,7 @@ hsBool plGameMarkerModifier::MsgReceive(plMessage* msg)
{
if (collideMsg->fEntering)
{
plNotifyMsg* notify = TRACKED_NEW plNotifyMsg;
plNotifyMsg* notify = new plNotifyMsg;
notify->AddCollisionEvent(true, collideMsg->fOtherKey, GetTarget()->GetKey());
notify->Send(hsgResMgr::ResMgr()->FindKey(kMarkerMgr_KEY));
}

View File

@ -88,7 +88,7 @@ void plImageLibMod::Read(hsStream* stream, hsResMgr* mgr)
uint32_t i, count = stream->ReadLE32();
fImages.SetCountAndZero( count );
for( i = 0; i < count; i++ )
mgr->ReadKeyNotifyMe( stream, TRACKED_NEW plGenRefMsg( GetKey(), plRefMsg::kOnCreate, i, kRefImage ), plRefFlags::kActiveRef );
mgr->ReadKeyNotifyMe( stream, new plGenRefMsg( GetKey(), plRefMsg::kOnCreate, i, kRefImage ), plRefFlags::kActiveRef );
}
void plImageLibMod::Write(hsStream* stream, hsResMgr* mgr)

View File

@ -162,7 +162,7 @@ hsBool plLogicModifier::MsgReceive(plMessage* msg)
{
plCursorChangeMsg* pMsg = 0;
if ((VerifyConditions(pFakeMsg) && fMyCursor) && !Disabled())
pMsg = TRACKED_NEW plCursorChangeMsg(fMyCursor, 1);
pMsg = new plCursorChangeMsg(fMyCursor, 1);
else
{
#ifndef PLASMA_EXTERNAL_RELEASE
@ -190,7 +190,7 @@ hsBool plLogicModifier::MsgReceive(plMessage* msg)
}
}
#endif // PLASMA_EXTERNAL_RELEASE
pMsg = TRACKED_NEW plCursorChangeMsg(plCursorChangeMsg::kNullCursor, 1);
pMsg = new plCursorChangeMsg(plCursorChangeMsg::kNullCursor, 1);
}
pMsg->AddReceiver( pFakeMsg->GetSender() );
@ -221,7 +221,7 @@ void plLogicModifier::PreTrigger(hsBool netRequest)
if (fTimer)
{
plgTimerCallbackMgr::NewTimer( fTimer, TRACKED_NEW plTimerCallbackMsg( GetKey() ) );
plgTimerCallbackMgr::NewTimer( fTimer, new plTimerCallbackMsg( GetKey() ) );
return;
}
plLogicModBase::PreTrigger(netRequest);
@ -244,7 +244,7 @@ void plLogicModifier::Read(hsStream* stream, hsResMgr* mgr)
int i;
for(i = 0; i < n; i++ )
{
refMsg = TRACKED_NEW plCondRefMsg(GetKey(), i);
refMsg = new plCondRefMsg(GetKey(), i);
mgr->ReadKeyNotifyMe(stream,refMsg, plRefFlags::kActiveRef);
}
fMyCursor = stream->ReadLE32();
@ -261,7 +261,7 @@ void plLogicModifier::Write(hsStream* stream, hsResMgr* mgr)
void plLogicModifier::AddCondition(plConditionalObject* c)
{
plGenRefMsg *msg= TRACKED_NEW plGenRefMsg(GetKey(), plRefMsg::kOnCreate, -1, -1);
plGenRefMsg *msg= new plGenRefMsg(GetKey(), plRefMsg::kOnCreate, -1, -1);
hsgResMgr::ResMgr()->AddViaNotify(c->GetKey(), msg, plRefFlags::kActiveRef);
fConditionList.Append(c);

View File

@ -457,14 +457,14 @@ void plResponderModifier::Restore()
if (plAnimCmdMsg* animMsg = plAnimCmdMsg::ConvertNoRef(callbackMsg))
{
plAnimCmdMsg* newAnimMsg = TRACKED_NEW plAnimCmdMsg;
plAnimCmdMsg* newAnimMsg = new plAnimCmdMsg;
newAnimMsg->SetCmd(plAnimCmdMsg::kAddCallbacks);
newCallbackMsg = newAnimMsg;
ResponderLog(ILog(plStatusLog::kGreen, "Restoring anim callback"));
}
else if (plSoundMsg* soundMsg = plSoundMsg::ConvertNoRef(callbackMsg))
{
plSoundMsg* newSoundMsg = TRACKED_NEW plSoundMsg;
plSoundMsg* newSoundMsg = new plSoundMsg;
newSoundMsg->SetCmd(plSoundMsg::kAddCallbacks);
newCallbackMsg = newSoundMsg;
ResponderLog(ILog(plStatusLog::kGreen, "Restoring sound callback"));
@ -502,7 +502,7 @@ plMessage* plResponderModifier::IGetFastForwardMsg(plMessage* msg, bool python)
if (animMsg->Cmd(plAnimCmdMsg::kContinue) ||
animMsg->Cmd(plAnimCmdMsg::kAddCallbacks))
{
plAnimCmdMsg* newAnimMsg = TRACKED_NEW plAnimCmdMsg;
plAnimCmdMsg* newAnimMsg = new plAnimCmdMsg;
newAnimMsg->fCmd = animMsg->fCmd;
newAnimMsg->fBegin = animMsg->fBegin;
newAnimMsg->fEnd = animMsg->fEnd;
@ -544,7 +544,7 @@ plMessage* plResponderModifier::IGetFastForwardMsg(plMessage* msg, bool python)
soundMsg->Cmd(plSoundMsg::kToggleState) ||
soundMsg->Cmd(plAnimCmdMsg::kAddCallbacks))
{
plSoundMsg *newSoundMsg = TRACKED_NEW plSoundMsg;
plSoundMsg *newSoundMsg = new plSoundMsg;
newSoundMsg->fCmd = soundMsg->fCmd;
newSoundMsg->fBegin = soundMsg->fBegin;
newSoundMsg->fEnd = soundMsg->fEnd;
@ -677,7 +677,7 @@ void plResponderModifier::Read(hsStream* stream, hsResMgr* mgr)
// attach responderSDLMod
delete fResponderSDLMod;
fResponderSDLMod = TRACKED_NEW plResponderSDLModifier;
fResponderSDLMod = new plResponderSDLModifier;
fResponderSDLMod->SetResponder(this);
}
@ -740,7 +740,7 @@ void plResponderModifier::IDebugAnimBox(bool start)
void plResponderModifier::IDebugPlayMsg(plAnimCmdMsg* msg)
{
// Create a stop callback so we can do a cue for that too
plEventCallbackMsg *eventMsg = TRACKED_NEW plEventCallbackMsg;
plEventCallbackMsg *eventMsg = new plEventCallbackMsg;
eventMsg->AddReceiver(GetKey());
eventMsg->fRepeats = 0;
eventMsg->fUser = -1;

View File

@ -70,7 +70,7 @@ void plSDLModifier::AddTarget(plSceneObject* so)
if (so)
plSingleModifier::AddTarget(so);
if (!fStateCache)
fStateCache = TRACKED_NEW plStateDataRecord(GetSDLName());
fStateCache = new plStateDataRecord(GetSDLName());
}
uint32_t plSDLModifier::IApplyModFlags(uint32_t sendFlags)
@ -161,7 +161,7 @@ void plSDLModifier::SendState(uint32_t sendFlags)
bool broadcast = (sendFlags & plSynchedObject::kBCastToClients) != 0;
// record current state
plStateDataRecord* curState = TRACKED_NEW plStateDataRecord(GetSDLName());
plStateDataRecord* curState = new plStateDataRecord(GetSDLName());
IPutCurrentStateIn(curState); // return sdl record which reflects current state of sceneObj, dirties curState
if (!force)
{

View File

@ -63,7 +63,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
// fTargets.GetCount();
// for (int i=0; i < GetNumTargets(); i++)
// {
// plSpawnModMsg* pMsg = NEW(plSpawnModMsg);
// plSpawnModMsg* pMsg = new plSpawnModMsg;
// pMsg->AddReceiver( pSpawnMsg->GetSender() );
// //pMsg->fPos= GetTarget(i)->GetDrawInterface()->GetWorldBounds().GetCenter();
// pMsg->fPos= GetTarget(i)->GetCoordinateInterface()->GetLocalToWorld().GetTranslate();