Browse Source

Remove TRACKED_NEW from tools.

Darryl Pogue 13 years ago committed by Adam Johnson
parent
commit
12ac9a79be
  1. 12
      Sources/Tools/MaxComponent/plAGComponents.cpp
  2. 4
      Sources/Tools/MaxComponent/plActivatorBaseComponent.cpp
  3. 20
      Sources/Tools/MaxComponent/plAnimComponent.cpp
  4. 10
      Sources/Tools/MaxComponent/plAnimEventComponent.cpp
  5. 62
      Sources/Tools/MaxComponent/plAudioComponents.cpp
  6. 2
      Sources/Tools/MaxComponent/plAutoComponent.cpp
  7. 48
      Sources/Tools/MaxComponent/plAutoUIBase.cpp
  8. 2
      Sources/Tools/MaxComponent/plAutoUIBlock.cpp
  9. 2
      Sources/Tools/MaxComponent/plAutoUIComp.cpp
  10. 4
      Sources/Tools/MaxComponent/plAutoUIParams.cpp
  11. 52
      Sources/Tools/MaxComponent/plAvatarComponent.cpp
  12. 2
      Sources/Tools/MaxComponent/plBehavioralComponents.cpp
  13. 8
      Sources/Tools/MaxComponent/plBipedKiller.cpp
  14. 2
      Sources/Tools/MaxComponent/plBlowComponent.cpp
  15. 56
      Sources/Tools/MaxComponent/plCameraComponents.cpp
  16. 30
      Sources/Tools/MaxComponent/plClickDragComponent.cpp
  17. 18
      Sources/Tools/MaxComponent/plClickableComponent.cpp
  18. 6
      Sources/Tools/MaxComponent/plClimbComponent.cpp
  19. 4
      Sources/Tools/MaxComponent/plClothingComponent.cpp
  20. 4
      Sources/Tools/MaxComponent/plClusterComponent.cpp
  21. 2
      Sources/Tools/MaxComponent/plExcludeRegionComponent.cpp
  22. 48
      Sources/Tools/MaxComponent/plFootPrintComponent.cpp
  23. 6
      Sources/Tools/MaxComponent/plFootstepComponent.cpp
  24. 84
      Sources/Tools/MaxComponent/plGUIComponents.cpp
  25. 6
      Sources/Tools/MaxComponent/plGrassComponent.cpp
  26. 4
      Sources/Tools/MaxComponent/plIgnoreComponent.cpp
  27. 6
      Sources/Tools/MaxComponent/plImpactGadgetComponent.cpp
  28. 4
      Sources/Tools/MaxComponent/plInventoryObjComponent.cpp
  29. 4
      Sources/Tools/MaxComponent/plLODFadeComponent.cpp
  30. 4
      Sources/Tools/MaxComponent/plLightGrpComponent.cpp
  31. 12
      Sources/Tools/MaxComponent/plLineFollowComp.cpp
  32. 16
      Sources/Tools/MaxComponent/plMaxAnimUtils.cpp
  33. 2
      Sources/Tools/MaxComponent/plMaxWaveUtils.cpp
  34. 22
      Sources/Tools/MaxComponent/plMiscComponents.cpp
  35. 6
      Sources/Tools/MaxComponent/plMorphSeqComp.cpp
  36. 8
      Sources/Tools/MaxComponent/plMultistageBehComponent.cpp
  37. 6
      Sources/Tools/MaxComponent/plMultistageStage.cpp
  38. 4
      Sources/Tools/MaxComponent/plNPCSpawnComp.cpp
  39. 2
      Sources/Tools/MaxComponent/plNavigableComponents.cpp
  40. 2
      Sources/Tools/MaxComponent/plObjectFlockerComponent.cpp
  41. 2
      Sources/Tools/MaxComponent/plOneShotComponent.cpp
  42. 88
      Sources/Tools/MaxComponent/plParticleComponents.cpp
  43. 18
      Sources/Tools/MaxComponent/plPhysConstraintComponents.cpp
  44. 34
      Sources/Tools/MaxComponent/plPhysicalComponents.cpp
  45. 2
      Sources/Tools/MaxComponent/plPickNodeBase.cpp
  46. 6
      Sources/Tools/MaxComponent/plPythonFileComponent.cpp
  47. 8
      Sources/Tools/MaxComponent/plResponderAnim.cpp
  48. 4
      Sources/Tools/MaxComponent/plResponderComponent.cpp
  49. 30
      Sources/Tools/MaxComponent/plResponderLink.cpp
  50. 4
      Sources/Tools/MaxComponent/plResponderMtl.cpp
  51. 4
      Sources/Tools/MaxComponent/plSeekPoint.cpp
  52. 12
      Sources/Tools/MaxComponent/plShadowComponents.cpp
  53. 46
      Sources/Tools/MaxComponent/plSoftVolumeComponent.cpp
  54. 2
      Sources/Tools/MaxComponent/plTemplateComponent.cpp
  55. 8
      Sources/Tools/MaxComponent/plTypesComponents.cpp
  56. 18
      Sources/Tools/MaxComponent/plVolumeGadgetComponent.cpp
  57. 16
      Sources/Tools/MaxComponent/plWaterComponent.cpp
  58. 8
      Sources/Tools/MaxConvert/StringTokenizer.cpp
  59. 2
      Sources/Tools/MaxConvert/UserPropMgr.cpp
  60. 32
      Sources/Tools/MaxConvert/hsControlConverter.cpp
  61. 2
      Sources/Tools/MaxConvert/hsConverterUtils.cpp
  62. 86
      Sources/Tools/MaxConvert/hsMaterialConverter.cpp
  63. 6
      Sources/Tools/MaxConvert/hsVertexShader.cpp
  64. 10
      Sources/Tools/MaxConvert/plBitmapCreator.cpp
  65. 14
      Sources/Tools/MaxConvert/plClusterUtil.cpp
  66. 2
      Sources/Tools/MaxConvert/plConvert.cpp
  67. 8
      Sources/Tools/MaxConvert/plDistributor.cpp
  68. 36
      Sources/Tools/MaxConvert/plLayerConverter.cpp
  69. 18
      Sources/Tools/MaxConvert/plLightMapGen.cpp
  70. 26
      Sources/Tools/MaxConvert/plMeshConverter.cpp
  71. 2
      Sources/Tools/MaxExport/SimpleExport.h
  72. 2
      Sources/Tools/MaxMain/GlobalUtility.cpp
  73. 4
      Sources/Tools/MaxMain/main.cpp
  74. 8
      Sources/Tools/MaxMain/plAgeDescInterface.cpp
  75. 2
      Sources/Tools/MaxMain/plCommonObjLib.cpp
  76. 2
      Sources/Tools/MaxMain/plComponentDlg.cpp
  77. 8
      Sources/Tools/MaxMain/plMaxMeshExtractor.cpp
  78. 130
      Sources/Tools/MaxMain/plMaxNode.cpp
  79. 6
      Sources/Tools/MaxMain/plMaxNodeData.h
  80. 18
      Sources/Tools/MaxMain/plPhysXCooking.cpp
  81. 2
      Sources/Tools/MaxMain/plPluginResManager.cpp
  82. 2
      Sources/Tools/MaxMain/plPythonMgr.cpp
  83. 2
      Sources/Tools/MaxMain/plSaveSelected.cpp
  84. 4
      Sources/Tools/MaxMain/plTextureExportLog.cpp
  85. 6
      Sources/Tools/MaxPlasmaLights/plRTProjDirLight.cpp
  86. 2
      Sources/Tools/MaxPlasmaLights/plRTProjDirLight.h
  87. 2
      Sources/Tools/MaxPlasmaLights/plRTProjDirLightClassDesc.h
  88. 14
      Sources/Tools/MaxPlasmaLights/plRealTimeLightBase.cpp
  89. 2
      Sources/Tools/MaxPlasmaLights/plRealTimeLightBase.h
  90. 12
      Sources/Tools/MaxPlasmaLights/plRealTimeLights.cpp
  91. 12
      Sources/Tools/MaxPlasmaLights/plRealTimeLights.h
  92. 4
      Sources/Tools/MaxPlasmaMtls/Layers/plAngleAttenLayer.cpp
  93. 4
      Sources/Tools/MaxPlasmaMtls/Layers/plDynamicEnvLayer.cpp
  94. 4
      Sources/Tools/MaxPlasmaMtls/Layers/plDynamicTextLayer.cpp
  95. 4
      Sources/Tools/MaxPlasmaMtls/Layers/plLayerTex.cpp
  96. 4
      Sources/Tools/MaxPlasmaMtls/Layers/plLayerTexBitmapPB.cpp
  97. 4
      Sources/Tools/MaxPlasmaMtls/Layers/plMAXCameraLayer.cpp
  98. 2
      Sources/Tools/MaxPlasmaMtls/Layers/plPlasmaMAXLayer.cpp
  99. 4
      Sources/Tools/MaxPlasmaMtls/Layers/plStaticEnvLayer.cpp
  100. 2
      Sources/Tools/MaxPlasmaMtls/Materials/plAnimStealthNode.cpp
  101. Some files were not shown because too many files have changed in this diff Show More

12
Sources/Tools/MaxComponent/plAGComponents.cpp

@ -254,7 +254,7 @@ hsBool plAnimAvatarComponent::ConvertNode(plMaxNode *node, plErrorMsg *pErrMsg)
// ------------- // -------------
plATCAnim * plAnimAvatarComponent::NewAnimation(const char *name, double begin, double end) plATCAnim * plAnimAvatarComponent::NewAnimation(const char *name, double begin, double end)
{ {
return TRACKED_NEW plATCAnim(name, begin, end); return new plATCAnim(name, begin, end);
} }
@ -288,15 +288,15 @@ hsBool plAnimAvatarComponent::ConvertNodeSegmentBranch(plMaxNode *node, plAGAnim
// around. Just nuke it and replace it with a constant channel. // around. Just nuke it and replace it with a constant channel.
if (tmc->PurgeRedundantSubcontrollers()) if (tmc->PurgeRedundantSubcontrollers())
{ {
channel = TRACKED_NEW plMatrixConstant(constSetting); channel = new plMatrixConstant(constSetting);
delete tmc; delete tmc;
tmc = nil; tmc = nil;
} }
else else
{ {
channel = TRACKED_NEW plMatrixControllerChannel(tmc, &parts); channel = new plMatrixControllerChannel(tmc, &parts);
} }
plMatrixChannelApplicator *app = TRACKED_NEW plMatrixChannelApplicator(); plMatrixChannelApplicator *app = new plMatrixChannelApplicator();
app->SetChannelName(node->GetKey()->GetName()); app->SetChannelName(node->GetKey()->GetName());
app->SetChannel(channel); app->SetChannel(channel);
mod->AddApplicator(app); mod->AddApplicator(app);
@ -345,7 +345,7 @@ hsBool plAnimAvatarComponent::MakePersistent(plMaxNode *node, plAGAnim *anim, co
{ {
plKey animKey = hsgResMgr::ResMgr()->NewKey(animName, anim, nodeLoc); plKey animKey = hsgResMgr::ResMgr()->NewKey(animName, anim, nodeLoc);
plNodeRefMsg* refMsg = TRACKED_NEW plNodeRefMsg(sceneNodeKey, plNodeRefMsg::kOnRequest, -1, plNodeRefMsg::kGeneric); plNodeRefMsg* refMsg = new plNodeRefMsg(sceneNodeKey, plNodeRefMsg::kOnRequest, -1, plNodeRefMsg::kGeneric);
hsgResMgr::ResMgr()->AddViaNotify(animKey, refMsg, plRefFlags::kActiveRef); hsgResMgr::ResMgr()->AddViaNotify(animKey, refMsg, plRefFlags::kActiveRef);
} }
@ -457,5 +457,5 @@ hsBool plEmoteComponent::Convert(plMaxNode *node, plErrorMsg *pErrMsg)
// ------------- // -------------
plATCAnim * plEmoteComponent::NewAnimation(const char *name, double begin, double end) plATCAnim * plEmoteComponent::NewAnimation(const char *name, double begin, double end)
{ {
return TRACKED_NEW plEmoteAnim(name, begin, end, fFadeIn, fFadeOut, fBodyUsage); return new plEmoteAnim(name, begin, end, fFadeIn, fFadeOut, fBodyUsage);
} }

4
Sources/Tools/MaxComponent/plActivatorBaseComponent.cpp

@ -96,9 +96,9 @@ hsBool plActivatorBaseComponent::PreConvert(plMaxNode *node, plErrorMsg *pErrMsg
plSceneObject *obj = node->GetSceneObject(); plSceneObject *obj = node->GetSceneObject();
// Create and register the VolumeGadget's logic component // Create and register the VolumeGadget's logic component
plLogicModifier *logic = TRACKED_NEW plLogicModifier; plLogicModifier *logic = new plLogicModifier;
plKey logicKey = hsgResMgr::ResMgr()->NewKey(IGetUniqueName(node), logic, node->GetLocation()); plKey logicKey = hsgResMgr::ResMgr()->NewKey(IGetUniqueName(node), logic, node->GetLocation());
hsgResMgr::ResMgr()->AddViaNotify(logicKey, TRACKED_NEW plObjRefMsg(obj->GetKey(), plRefMsg::kOnCreate, -1, plObjRefMsg::kModifier), plRefFlags::kActiveRef); hsgResMgr::ResMgr()->AddViaNotify(logicKey, new plObjRefMsg(obj->GetKey(), plRefMsg::kOnCreate, -1, plObjRefMsg::kModifier), plRefFlags::kActiveRef);
fLogicModKeys[node] = logicKey; fLogicModKeys[node] = logicKey;

20
Sources/Tools/MaxComponent/plAnimComponent.cpp

@ -580,10 +580,10 @@ hsBool plAnimGroupedComponent::PreConvert(plMaxNode *node, plErrorMsg *pErrMsg)
bool needSetMaster = fNeedReset; bool needSetMaster = fNeedReset;
if (fNeedReset) if (fNeedReset)
{ {
fForward = TRACKED_NEW plMsgForwarder; fForward = new plMsgForwarder;
plKey forwardKey = hsgResMgr::ResMgr()->NewKey(IGetUniqueName(node), fForward, node->GetLocation()); plKey forwardKey = hsgResMgr::ResMgr()->NewKey(IGetUniqueName(node), fForward, node->GetLocation());
plNodeRefMsg *refMsg = TRACKED_NEW plNodeRefMsg(node->GetRoomKey(), plRefMsg::kOnCreate, -1, plNodeRefMsg::kGeneric); plNodeRefMsg *refMsg = new plNodeRefMsg(node->GetRoomKey(), plRefMsg::kOnCreate, -1, plNodeRefMsg::kGeneric);
hsgResMgr::ResMgr()->AddViaNotify(forwardKey, refMsg, plRefFlags::kActiveRef); hsgResMgr::ResMgr()->AddViaNotify(forwardKey, refMsg, plRefFlags::kActiveRef);
} }
@ -699,7 +699,7 @@ hsBool plAnimComponentBase::PreConvert(plMaxNode *node, plErrorMsg *pErrMsg)
{ {
node->AddModifier(new plAGModifier(node->GetName()), IGetUniqueName(node)); node->AddModifier(new plAGModifier(node->GetName()), IGetUniqueName(node));
} }
mod = TRACKED_NEW plAGMasterMod(); mod = new plAGMasterMod();
plKey modKey = node->AddModifier(mod, IGetUniqueName(node)); plKey modKey = node->AddModifier(mod, IGetUniqueName(node));
} }
@ -723,14 +723,14 @@ hsBool plAnimComponentBase::PreConvert(plMaxNode *node, plErrorMsg *pErrMsg)
if (fCompPB->GetInt(ParamID(kAnimUseGlobal))) if (fCompPB->GetInt(ParamID(kAnimUseGlobal)))
{ {
plAgeGlobalAnim *ageAnim = TRACKED_NEW plAgeGlobalAnim(animName, 0, 0); plAgeGlobalAnim *ageAnim = new plAgeGlobalAnim(animName, 0, 0);
ageAnim->SetGlobalVarName((char*)fCompPB->GetStr(ParamID(kAnimGlobalName))); ageAnim->SetGlobalVarName((char*)fCompPB->GetStr(ParamID(kAnimGlobalName)));
fAnims[node] = ageAnim; fAnims[node] = ageAnim;
} }
else else
{ {
plATCAnim *ATCAnim = TRACKED_NEW plATCAnim(animName, 0, 0); plATCAnim *ATCAnim = new plATCAnim(animName, 0, 0);
plNotetrackAnim noteAnim(node, pErrMsg); plNotetrackAnim noteAnim(node, pErrMsg);
plAnimInfo info = noteAnim.GetAnimInfo(animName); plAnimInfo info = noteAnim.GetAnimInfo(animName);
ATCAnim->SetAutoStart(fCompPB->GetInt(kAnimAutoStart)); ATCAnim->SetAutoStart(fCompPB->GetInt(kAnimAutoStart));
@ -787,7 +787,7 @@ hsBool plAnimComponentBase::IAddTMToAnim(plMaxNode *node, plAGAnim *anim, plErro
// Get the affine parts and the TM Controller // Get the affine parts and the TM Controller
plSceneObject *obj = node->GetSceneObject(); plSceneObject *obj = node->GetSceneObject();
hsAffineParts * parts = TRACKED_NEW hsAffineParts; hsAffineParts * parts = new hsAffineParts;
plController* tmc; plController* tmc;
if (!strcmp(anim->GetName(), ENTIRE_ANIMATION_NAME)) if (!strcmp(anim->GetName(), ENTIRE_ANIMATION_NAME))
@ -797,9 +797,9 @@ hsBool plAnimComponentBase::IAddTMToAnim(plMaxNode *node, plAGAnim *anim, plErro
if (tmc) if (tmc)
{ {
plMatrixChannelApplicator *app = TRACKED_NEW plMatrixChannelApplicator(); plMatrixChannelApplicator *app = new plMatrixChannelApplicator();
app->SetChannelName(node->GetName()); app->SetChannelName(node->GetName());
plMatrixControllerChannel *channel = TRACKED_NEW plMatrixControllerChannel(tmc, parts); plMatrixControllerChannel *channel = new plMatrixControllerChannel(tmc, parts);
app->SetChannel(channel); app->SetChannel(channel);
anim->AddApplicator(app); anim->AddApplicator(app);
if (!strcmp(anim->GetName(), ENTIRE_ANIMATION_NAME)) if (!strcmp(anim->GetName(), ENTIRE_ANIMATION_NAME))
@ -888,7 +888,7 @@ hsBool plAnimComponentBase::IMakePersistent(plMaxNode *node, plAGAnim *anim, plE
plLocation nodeLoc = node->GetLocation(); plLocation nodeLoc = node->GetLocation();
plKey animKey = hsgResMgr::ResMgr()->NewKey(buffer, anim, nodeLoc); plKey animKey = hsgResMgr::ResMgr()->NewKey(buffer, anim, nodeLoc);
plGenRefMsg* refMsg = TRACKED_NEW plGenRefMsg(mod->GetKey(), plRefMsg::kOnCreate, 0, 0); plGenRefMsg* refMsg = new plGenRefMsg(mod->GetKey(), plRefMsg::kOnCreate, 0, 0);
hsgResMgr::ResMgr()->AddViaNotify(animKey, refMsg, plRefFlags::kActiveRef); hsgResMgr::ResMgr()->AddViaNotify(animKey, refMsg, plRefFlags::kActiveRef);
return true; return true;
@ -932,7 +932,7 @@ hsBool plAnimComponentBase::DeInit(plMaxNode *node, plErrorMsg *pErrMsg)
void plAnimComponentBase::SetupCtl( plAGAnim *anim, plController *ctl, plAGApplicator *app, plMaxNode *node ) void plAnimComponentBase::SetupCtl( plAGAnim *anim, plController *ctl, plAGApplicator *app, plMaxNode *node )
{ {
plScalarControllerChannel *channel = TRACKED_NEW plScalarControllerChannel(ctl); plScalarControllerChannel *channel = new plScalarControllerChannel(ctl);
app->SetChannel(channel); app->SetChannel(channel);
anim->AddApplicator(app); anim->AddApplicator(app);
if (!strcmp(anim->GetName(), ENTIRE_ANIMATION_NAME)) if (!strcmp(anim->GetName(), ENTIRE_ANIMATION_NAME))

10
Sources/Tools/MaxComponent/plAnimEventComponent.cpp

@ -147,7 +147,7 @@ hsBool plAnimEventComponent::PreConvert(plMaxNode* node, plErrorMsg* pErrMsg)
if (!fCanExport) if (!fCanExport)
return false; return false;
plAnimEventModifier* mod = TRACKED_NEW plAnimEventModifier; plAnimEventModifier* mod = new plAnimEventModifier;
plKey modKey = node->AddModifier(mod, IGetUniqueName(node)); plKey modKey = node->AddModifier(mod, IGetUniqueName(node));
fLogicModKeys[node] = modKey; fLogicModKeys[node] = modKey;
@ -157,7 +157,7 @@ hsBool plAnimEventComponent::PreConvert(plMaxNode* node, plErrorMsg* pErrMsg)
plEventCallbackMsg* CreateCallbackMsg(plAnimCmdMsg* animMsg, plKey modKey) plEventCallbackMsg* CreateCallbackMsg(plAnimCmdMsg* animMsg, plKey modKey)
{ {
plEventCallbackMsg *eventMsg = TRACKED_NEW plEventCallbackMsg; plEventCallbackMsg *eventMsg = new plEventCallbackMsg;
eventMsg->AddReceiver(modKey); eventMsg->AddReceiver(modKey);
eventMsg->fRepeats = -1; eventMsg->fRepeats = -1;
@ -185,7 +185,7 @@ hsBool plAnimEventComponent::Convert(plMaxNode *node, plErrorMsg *pErrMsg)
plKey animKey = animComp->GetModKey(animNode); plKey animKey = animComp->GetModKey(animNode);
const char* animName = animComp->GetAnimName(); const char* animName = animComp->GetAnimName();
plAnimCmdMsg *animMsg = TRACKED_NEW plAnimCmdMsg; plAnimCmdMsg *animMsg = new plAnimCmdMsg;
animMsg->SetCmd(plAnimCmdMsg::kAddCallbacks); animMsg->SetCmd(plAnimCmdMsg::kAddCallbacks);
animMsg->SetSender(modKey); animMsg->SetSender(modKey);
animMsg->SetAnimName(animName); animMsg->SetAnimName(animName);
@ -459,7 +459,7 @@ hsBool plMtlEventComponent::PreConvert(plMaxNode* node, plErrorMsg* pErrMsg)
if (!fCanExport) if (!fCanExport)
return false; return false;
plAnimEventModifier* mod = TRACKED_NEW plAnimEventModifier; plAnimEventModifier* mod = new plAnimEventModifier;
plKey modKey = node->AddModifier(mod, IGetUniqueName(node)); plKey modKey = node->AddModifier(mod, IGetUniqueName(node));
fLogicModKeys[node] = modKey; fLogicModKeys[node] = modKey;
@ -488,7 +488,7 @@ hsBool plMtlEventComponent::Convert(plMaxNode *node, plErrorMsg *pErrMsg)
hsTArray<plKey> animKeys; hsTArray<plKey> animKeys;
GetMatAnimModKey(mtl, mtlNode, mtlAnim, animKeys); GetMatAnimModKey(mtl, mtlNode, mtlAnim, animKeys);
plAnimCmdMsg *animMsg = TRACKED_NEW plAnimCmdMsg; plAnimCmdMsg *animMsg = new plAnimCmdMsg;
animMsg->SetCmd(plAnimCmdMsg::kAddCallbacks); animMsg->SetCmd(plAnimCmdMsg::kAddCallbacks);
animMsg->SetSender(modKey); animMsg->SetSender(modKey);
animMsg->SetAnimName(mtlAnim); animMsg->SetAnimName(mtlAnim);

62
Sources/Tools/MaxComponent/plAudioComponents.cpp

@ -480,17 +480,17 @@ hsBool plBaseSoundEmitterComponent::PreConvert( plMaxNode *node, plErrorMsg *pEr
const plAudioInterface *ai = node->GetSceneObject()->GetAudioInterface(); const plAudioInterface *ai = node->GetSceneObject()->GetAudioInterface();
if (!ai) if (!ai)
{ {
ai = TRACKED_NEW plAudioInterface; ai = new plAudioInterface;
plKey pAiKey = hsgResMgr::ResMgr()->NewKey(IGetUniqueName(node), (hsKeyedObject*)ai,node->GetKey()->GetUoid().GetLocation(), node->GetLoadMask()); plKey pAiKey = hsgResMgr::ResMgr()->NewKey(IGetUniqueName(node), (hsKeyedObject*)ai,node->GetKey()->GetUoid().GetLocation(), node->GetLoadMask());
hsgResMgr::ResMgr()->AddViaNotify(pAiKey, TRACKED_NEW plObjRefMsg(node->GetKey(), plRefMsg::kOnCreate, 0, plObjRefMsg::kInterface), plRefFlags::kActiveRef); hsgResMgr::ResMgr()->AddViaNotify(pAiKey, new plObjRefMsg(node->GetKey(), plRefMsg::kOnCreate, 0, plObjRefMsg::kInterface), plRefFlags::kActiveRef);
} }
if (!ai->GetAudible()) if (!ai->GetAudible())
{ {
plAudible *pAudible = TRACKED_NEW plWinAudible; plAudible *pAudible = new plWinAudible;
// Add a key for it // Add a key for it
plKey key = hsgResMgr::ResMgr()->NewKey(IGetUniqueName(node), pAudible, node->GetKey()->GetUoid().GetLocation(), node->GetLoadMask()); plKey key = hsgResMgr::ResMgr()->NewKey(IGetUniqueName(node), pAudible, node->GetKey()->GetUoid().GetLocation(), node->GetLoadMask());
plIntRefMsg* pMsg = TRACKED_NEW plIntRefMsg(node->GetKey(), plRefMsg::kOnCreate, 0, plIntRefMsg::kAudible); plIntRefMsg* pMsg = new plIntRefMsg(node->GetKey(), plRefMsg::kOnCreate, 0, plIntRefMsg::kAudible);
hsgResMgr::ResMgr()->AddViaNotify(pAudible->GetKey(), pMsg, plRefFlags::kActiveRef ); hsgResMgr::ResMgr()->AddViaNotify(pAudible->GetKey(), pMsg, plRefFlags::kActiveRef );
pAudible->SetSceneNode(node->GetRoomKey()); pAudible->SetSceneNode(node->GetRoomKey());
@ -557,7 +557,7 @@ void plBaseSoundEmitterComponent::IGrabSoftRegion( plSound *sound, plErrorMsg
if( vol != nil ) if( vol != nil )
{ {
vol->SetCheckListener(); vol->SetCheckListener();
hsgResMgr::ResMgr()->AddViaNotify( softKey, TRACKED_NEW plGenRefMsg( sound->GetKey(), plRefMsg::kOnCreate, 0, plSound::kSoftRegion ), plRefFlags::kActiveRef ); hsgResMgr::ResMgr()->AddViaNotify( softKey, new plGenRefMsg( sound->GetKey(), plRefMsg::kOnCreate, 0, plSound::kSoftRegion ), plRefFlags::kActiveRef );
} }
} }
} }
@ -673,7 +673,7 @@ plSoundBuffer *plBaseSoundEmitterComponent::IGetSourceBuffer( const char *file
return plSoundBuffer::ConvertNoRef( key->GetObjectPtr() ); return plSoundBuffer::ConvertNoRef( key->GetObjectPtr() );
// Not yet created, so make a new one // Not yet created, so make a new one
plSoundBuffer *buffer = TRACKED_NEW plSoundBuffer( fileName, srcBufferFlags ); plSoundBuffer *buffer = new plSoundBuffer( fileName, srcBufferFlags );
if( !buffer->IsValid() ) if( !buffer->IsValid() )
{ {
// Invalid, so delete and return nil // Invalid, so delete and return nil
@ -767,7 +767,7 @@ void plBaseSoundEmitterComponent::UpdateSoundFileSelection( void )
} }
else else
{ {
baseBuffer = TRACKED_NEW plSoundBuffer( GetSoundFileName( kBaseSound ) ); baseBuffer = new plSoundBuffer( GetSoundFileName( kBaseSound ) );
if( baseBuffer != nil && baseBuffer->IsValid() ) if( baseBuffer != nil && baseBuffer->IsValid() )
{ {
// Update our stereo channel selection if necessary // Update our stereo channel selection if necessary
@ -936,7 +936,7 @@ hsBool plBaseSoundEmitterComponent::AddToAnim( plAGAnim *anim, plMaxNode *node
} }
std::map<plMaxNode*, int>::iterator i = fIndices.begin(); std::map<plMaxNode*, int>::iterator i = fIndices.begin();
plSoundVolumeApplicator *app = TRACKED_NEW plSoundVolumeApplicator( (*i).second ); plSoundVolumeApplicator *app = new plSoundVolumeApplicator( (*i).second );
app->SetChannelName(node->GetName()); app->SetChannelName(node->GetName());
plAnimComponentBase::SetupCtl( anim, ctl, app, node ); plAnimComponentBase::SetupCtl( anim, ctl, app, node );
result = true; result = true;
@ -1699,7 +1699,7 @@ void plBaseSoundEmitterComponent::IGrabEAXParams( plSound *sound, plErrorMsg
if( vol != nil ) if( vol != nil )
{ {
vol->SetCheckListener(); vol->SetCheckListener();
hsgResMgr::ResMgr()->AddViaNotify( softKey, TRACKED_NEW plGenRefMsg( sound->GetKey(), plRefMsg::kOnCreate, 0, plSound::kRefSoftOcclusionRegion ), plRefFlags::kActiveRef ); hsgResMgr::ResMgr()->AddViaNotify( softKey, new plGenRefMsg( sound->GetKey(), plRefMsg::kOnCreate, 0, plSound::kRefSoftOcclusionRegion ), plRefFlags::kActiveRef );
} }
} }
} }
@ -2191,22 +2191,22 @@ hsBool plSound3DEmitterComponent::Convert(plMaxNode *node, plErrorMsg *pErrMsg)
plWin32Sound *sound = nil; plWin32Sound *sound = nil;
if (!strcmp(node->GetName(), "LinkSoundSource")) if (!strcmp(node->GetName(), "LinkSoundSource"))
sound = TRACKED_NEW plWin32LinkSound; sound = new plWin32LinkSound;
else else
{ {
#if 0 #if 0
sound = TRACKED_NEW plWin32StaticSound; sound = new plWin32StaticSound;
#else #else
/// New method, still in testing: any sounds over 4 seconds get made into streaming sounds /// New method, still in testing: any sounds over 4 seconds get made into streaming sounds
if( srcBuffer->GetDataLengthInSecs() > 4.f ) if( srcBuffer->GetDataLengthInSecs() > 4.f )
sound = TRACKED_NEW plWin32StreamingSound; sound = new plWin32StreamingSound;
else else
sound = TRACKED_NEW plWin32StaticSound; sound = new plWin32StaticSound;
} }
#endif #endif
hsgResMgr::ResMgr()->NewKey(keyName, sound, node->GetLocation(), node->GetLoadMask()); hsgResMgr::ResMgr()->NewKey(keyName, sound, node->GetLocation(), node->GetLoadMask());
hsgResMgr::ResMgr()->AddViaNotify( srcBuffer->GetKey(), TRACKED_NEW plGenRefMsg( sound->GetKey(), plRefMsg::kOnCreate, -1, plSound::kRefDataBuffer ), plRefFlags::kActiveRef ); hsgResMgr::ResMgr()->AddViaNotify( srcBuffer->GetKey(), new plGenRefMsg( sound->GetKey(), plRefMsg::kOnCreate, -1, plSound::kRefDataBuffer ), plRefFlags::kActiveRef );
if( pAudible->AddSound( sound, fIndex, true ) ) if( pAudible->AddSound( sound, fIndex, true ) )
{ {
@ -2257,7 +2257,7 @@ hsBool plSound3DEmitterComponent::ConvertGrouped( plMaxNode *baseNode, hsTArray
// Grab the buffer for this sound directly from the original source // Grab the buffer for this sound directly from the original source
const char *fileName = groupArray[ i ]->GetSoundFileName( kBaseSound ); const char *fileName = groupArray[ i ]->GetSoundFileName( kBaseSound );
plSoundBuffer *buffer = TRACKED_NEW plSoundBuffer( fileName ); plSoundBuffer *buffer = new plSoundBuffer( fileName );
if( !buffer->IsValid() || !buffer->EnsureInternal() ) if( !buffer->IsValid() || !buffer->EnsureInternal() )
{ {
// OK, because some *cough* machines are completely stupid and don't load AssetMan scenes with // OK, because some *cough* machines are completely stupid and don't load AssetMan scenes with
@ -2281,7 +2281,7 @@ hsBool plSound3DEmitterComponent::ConvertGrouped( plMaxNode *baseNode, hsTArray
// Got a path to try, so try it! // Got a path to try, so try it!
delete buffer; delete buffer;
buffer = TRACKED_NEW plSoundBuffer( newPath ); buffer = new plSoundBuffer( newPath );
if( buffer->IsValid() && buffer->EnsureInternal() ) if( buffer->IsValid() && buffer->EnsureInternal() )
worked = true; worked = true;
} }
@ -2347,7 +2347,7 @@ hsBool plSound3DEmitterComponent::ConvertGrouped( plMaxNode *baseNode, hsTArray
plPluginResManager::ResMgr()->NukeKeyAndObject( buffKey ); plPluginResManager::ResMgr()->NukeKeyAndObject( buffKey );
// Create a new one... // Create a new one...
plSoundBuffer *mergedBuffer = TRACKED_NEW plSoundBuffer(); plSoundBuffer *mergedBuffer = new plSoundBuffer();
mergedBuffer->SetInternalData( mergedHeader, mergedData.GetCount(), mergedData.AcquireArray() ); mergedBuffer->SetInternalData( mergedHeader, mergedData.GetCount(), mergedData.AcquireArray() );
mergedData.Reset(); mergedData.Reset();
// The buffer may be shared across multiple sources. We could or together the LoadMasks of all // The buffer may be shared across multiple sources. We could or together the LoadMasks of all
@ -2362,12 +2362,12 @@ hsBool plSound3DEmitterComponent::ConvertGrouped( plMaxNode *baseNode, hsTArray
plWinAudible* pAudible = (plWinAudible*)ai->GetAudible(); plWinAudible* pAudible = (plWinAudible*)ai->GetAudible();
sprintf( keyName, "%s", GetINode()->GetName()); sprintf( keyName, "%s", GetINode()->GetName());
plWin32GroupedSound *sound = TRACKED_NEW plWin32GroupedSound; plWin32GroupedSound *sound = new plWin32GroupedSound;
sound->SetPositionArray( startPoses.GetCount(), startPoses.AcquireArray(), volumes.AcquireArray() ); sound->SetPositionArray( startPoses.GetCount(), startPoses.AcquireArray(), volumes.AcquireArray() );
sound->SetProperty( plSound::kPropLoadOnlyOnCall, true ); sound->SetProperty( plSound::kPropLoadOnlyOnCall, true );
hsgResMgr::ResMgr()->NewKey( keyName, sound, baseNode->GetLocation(), baseNode->GetLoadMask() ); hsgResMgr::ResMgr()->NewKey( keyName, sound, baseNode->GetLocation(), baseNode->GetLoadMask() );
hsgResMgr::ResMgr()->AddViaNotify( mergedBuffer->GetKey(), TRACKED_NEW plGenRefMsg( sound->GetKey(), plRefMsg::kOnCreate, -1, plSound::kRefDataBuffer ), plRefFlags::kActiveRef ); hsgResMgr::ResMgr()->AddViaNotify( mergedBuffer->GetKey(), new plGenRefMsg( sound->GetKey(), plRefMsg::kOnCreate, -1, plSound::kRefDataBuffer ), plRefFlags::kActiveRef );
if( pAudible->AddSound( sound, index, true ) ) if( pAudible->AddSound( sound, index, true ) )
{ {
@ -2513,14 +2513,14 @@ hsBool plBackgroundMusicComponent::Convert(plMaxNode *node, plErrorMsg *pErrMsg)
plWin32Sound *sound = nil; plWin32Sound *sound = nil;
if( srcBuffer->GetDataLengthInSecs() > 4.f ) if( srcBuffer->GetDataLengthInSecs() > 4.f )
sound = TRACKED_NEW plWin32StreamingSound; sound = new plWin32StreamingSound;
else else
sound = TRACKED_NEW plWin32StaticSound; sound = new plWin32StaticSound;
hsgResMgr::ResMgr()->NewKey(keyName, sound, node->GetLocation(), node->GetLoadMask()); hsgResMgr::ResMgr()->NewKey(keyName, sound, node->GetLocation(), node->GetLoadMask());
srcBuffer->SetFlag( plSoundBuffer::kAlwaysExternal ); srcBuffer->SetFlag( plSoundBuffer::kAlwaysExternal );
hsgResMgr::ResMgr()->AddViaNotify( srcBuffer->GetKey(), TRACKED_NEW plGenRefMsg( sound->GetKey(), plRefMsg::kOnCreate, -1, plSound::kRefDataBuffer ), plRefFlags::kActiveRef ); hsgResMgr::ResMgr()->AddViaNotify( srcBuffer->GetKey(), new plGenRefMsg( sound->GetKey(), plRefMsg::kOnCreate, -1, plSound::kRefDataBuffer ), plRefFlags::kActiveRef );
if (pAudible->AddSound( sound, fIndex, false)) if (pAudible->AddSound( sound, fIndex, false))
{ {
@ -2670,10 +2670,10 @@ hsBool plGUISoundComponent::Convert(plMaxNode *node, plErrorMsg *pErrMsg)
char keyName[ 256 ]; char keyName[ 256 ];
sprintf( keyName, "%s_Win32GUISound", GetINode()->GetName() ); sprintf( keyName, "%s_Win32GUISound", GetINode()->GetName() );
plWin32StaticSound *sound = TRACKED_NEW plWin32StaticSound; plWin32StaticSound *sound = new plWin32StaticSound;
hsgResMgr::ResMgr()->NewKey(keyName, sound, node->GetLocation(), node->GetLoadMask()); hsgResMgr::ResMgr()->NewKey(keyName, sound, node->GetLocation(), node->GetLoadMask());
hsgResMgr::ResMgr()->AddViaNotify( srcBuffer->GetKey(), TRACKED_NEW plGenRefMsg( sound->GetKey(), plRefMsg::kOnCreate, -1, plSound::kRefDataBuffer ), plRefFlags::kActiveRef ); hsgResMgr::ResMgr()->AddViaNotify( srcBuffer->GetKey(), new plGenRefMsg( sound->GetKey(), plRefMsg::kOnCreate, -1, plSound::kRefDataBuffer ), plRefFlags::kActiveRef );
if (pAudible->AddSound( sound, fIndex, false)) if (pAudible->AddSound( sound, fIndex, false))
{ {
@ -2959,11 +2959,11 @@ hsBool plEAXListenerComponent::Convert(plMaxNode *node, plErrorMsg *errMsg)
return true; return true;
// Create a listener mod to handle these things // Create a listener mod to handle these things
plEAXListenerMod *listener = TRACKED_NEW plEAXListenerMod(); plEAXListenerMod *listener = new plEAXListenerMod();
node->AddModifier( listener, IGetUniqueName(node) ); node->AddModifier( listener, IGetUniqueName(node) );
// Add the soft region // Add the soft region
hsgResMgr::ResMgr()->AddViaNotify( softKey, TRACKED_NEW plGenRefMsg( listener->GetKey(), plRefMsg::kOnCreate, 0, plEAXListenerMod::kRefSoftRegion ), plRefFlags::kActiveRef ); hsgResMgr::ResMgr()->AddViaNotify( softKey, new plGenRefMsg( listener->GetKey(), plRefMsg::kOnCreate, 0, plEAXListenerMod::kRefSoftRegion ), plRefFlags::kActiveRef );
#ifdef EAX_SDK_AVAILABLE #ifdef EAX_SDK_AVAILABLE
// Set up the parameters of the listener mod // Set up the parameters of the listener mod
@ -3468,7 +3468,7 @@ hsBool plRandomSoundComponent::Convert(plMaxNode *node, plErrorMsg *pErrMsg)
pAudible = (plWinAudible*)ai->GetAudible(); pAudible = (plWinAudible*)ai->GetAudible();
hsTArray<plBaseSoundEmitterComponent *> comps; hsTArray<plBaseSoundEmitterComponent *> comps;
plRandomSoundModGroup *groups = TRACKED_NEW plRandomSoundModGroup[kMaxGroups]; plRandomSoundModGroup *groups = new plRandomSoundModGroup[kMaxGroups];
int i; int i;
int numSoFar = 0; int numSoFar = 0;
for (i = 0; i < kMaxGroups; i++) for (i = 0; i < kMaxGroups; i++)
@ -3482,7 +3482,7 @@ hsBool plRandomSoundComponent::Convert(plMaxNode *node, plErrorMsg *pErrMsg)
continue; continue;
} }
groups[i].fIndices = TRACKED_NEW uint16_t[numSounds]; groups[i].fIndices = new uint16_t[numSounds];
hsTArray<uint16_t> indices; hsTArray<uint16_t> indices;
int j; int j;
@ -3584,7 +3584,7 @@ hsBool plRandomSoundComponent::PreConvert(plMaxNode *pNode, plErrorMsg *pErrMsg
{ {
if (ICheckForSounds(pNode)) if (ICheckForSounds(pNode))
{ {
plRandomSoundMod* mod = TRACKED_NEW plRandomSoundMod; plRandomSoundMod* mod = new plRandomSoundMod;
hsgResMgr::ResMgr()->NewKey(IGetUniqueName(pNode), mod, pNode->GetLocation()); hsgResMgr::ResMgr()->NewKey(IGetUniqueName(pNode), mod, pNode->GetLocation());
fSoundMods[pNode] = mod; fSoundMods[pNode] = mod;
} }
@ -3942,7 +3942,7 @@ hsBool plPhysicsSndGroupComp::Convert( plMaxNode *node, plErrorMsg *pErrMsg )
if (si) if (si)
{ {
// Create a new sound group // Create a new sound group
plPhysicalSndGroup *grp = TRACKED_NEW plPhysicalSndGroup( fCompPB->GetInt( (ParamID)kRefGroup ) ); plPhysicalSndGroup *grp = new plPhysicalSndGroup( fCompPB->GetInt( (ParamID)kRefGroup ) );
hsgResMgr::ResMgr()->NewKey( IGetUniqueName( node ), grp, node->GetLocation(), node->GetLoadMask() ); hsgResMgr::ResMgr()->NewKey( IGetUniqueName( node ), grp, node->GetLocation(), node->GetLoadMask() );
// Convert each sound into a plWin32StaticSound and store onto the sound group // Convert each sound into a plWin32StaticSound and store onto the sound group
@ -4006,7 +4006,7 @@ hsBool plPhysicsSndGroupComp::Convert( plMaxNode *node, plErrorMsg *pErrMsg )
} }
// Attach the sound group to the physical // Attach the sound group to the physical
hsgResMgr::ResMgr()->AddViaNotify( grp->GetKey(), TRACKED_NEW plGenRefMsg( si->GetPhysical()->GetKey(), plRefMsg::kOnCreate, 0, plPXPhysical::kPhysRefSndGroup ), plRefFlags::kActiveRef ); hsgResMgr::ResMgr()->AddViaNotify( grp->GetKey(), new plGenRefMsg( si->GetPhysical()->GetKey(), plRefMsg::kOnCreate, 0, plPXPhysical::kPhysRefSndGroup ), plRefFlags::kActiveRef );
} }
} }

2
Sources/Tools/MaxComponent/plAutoComponent.cpp

@ -66,7 +66,7 @@ plAutoUIComp *gAutoUI;
void DummyCode() void DummyCode()
{ {
gAutoUI = TRACKED_NEW plAutoUIComp(&gAutoDesc); gAutoUI = new plAutoUIComp(&gAutoDesc);
gAutoUI->AddCheckBox(0, "test", "Test", true); gAutoUI->AddCheckBox(0, "test", "Test", true);
gAutoUI->AddFloatSpinner(1, "t2", "T2", 0.5, 0.f, 100.f); gAutoUI->AddFloatSpinner(1, "t2", "T2", 0.5, 0.f, 100.f);

48
Sources/Tools/MaxComponent/plAutoUIBase.cpp

@ -132,7 +132,7 @@ void plAutoUIBase::AddCheckBox(int16_t id, const char *scriptName, const char *n
fDesc->AddParam(id, scriptNameNew, TYPE_BOOL, 0, 0, fDesc->AddParam(id, scriptNameNew, TYPE_BOOL, 0, 0,
p_default, def, end, p_default, def, end,
end); end);
plAutoUIParam* param = TRACKED_NEW plCheckBoxParam(id, name); plAutoUIParam* param = new plCheckBoxParam(id, name);
param->SetVisInfo(vid, vstates); param->SetVisInfo(vid, vstates);
fParams.push_back(param); fParams.push_back(param);
} }
@ -146,7 +146,7 @@ void plAutoUIBase::AddFloatSpinner(int16_t id, const char *scriptName, const cha
p_range, min, max, p_range, min, max,
end, end,
end); end);
plAutoUIParam* param = TRACKED_NEW plSpinnerParam(id, name, true); plAutoUIParam* param = new plSpinnerParam(id, name, true);
param->SetVisInfo(vid, vstates); param->SetVisInfo(vid, vstates);
fParams.push_back(param); fParams.push_back(param);
} }
@ -160,7 +160,7 @@ void plAutoUIBase::AddIntSpinner(int16_t id, const char *scriptName, const char
p_range, min, max, p_range, min, max,
end, end,
end); end);
plAutoUIParam* param = TRACKED_NEW plSpinnerParam(id, name, false); plAutoUIParam* param = new plSpinnerParam(id, name, false);
param->SetVisInfo(vid, vstates); param->SetVisInfo(vid, vstates);
fParams.push_back(param); fParams.push_back(param);
} }
@ -172,7 +172,7 @@ void plAutoUIBase::AddEditBox(int16_t id, const char *scriptName, const char *na
fDesc->AddParam(id, scriptNameNew, TYPE_STRING, 0, 0, fDesc->AddParam(id, scriptNameNew, TYPE_STRING, 0, 0,
p_default, def ? hsStrcpy(def) : nil, end, p_default, def ? hsStrcpy(def) : nil, end,
end); end);
plAutoUIParam* param = TRACKED_NEW plEditParam(id, name, lines); plAutoUIParam* param = new plEditParam(id, name, lines);
param->SetVisInfo(vid, vstates); param->SetVisInfo(vid, vstates);
fParams.push_back(param); fParams.push_back(param);
} }
@ -184,7 +184,7 @@ void plAutoUIBase::AddPickNodeList(int16_t id, const char *scriptName, const cha
fDesc->AddParam(id, scriptNameNew, TYPE_INODE_TAB, 0, 0, 0, fDesc->AddParam(id, scriptNameNew, TYPE_INODE_TAB, 0, 0, 0,
end, end,
end); end);
plAutoUIParam* param = TRACKED_NEW plPickListParam(id, name, filter); plAutoUIParam* param = new plPickListParam(id, name, filter);
param->SetVisInfo(vid, vstates); param->SetVisInfo(vid, vstates);
fParams.push_back(param); fParams.push_back(param);
} }
@ -196,7 +196,7 @@ void plAutoUIBase::AddPickNodeButton(int16_t id, const char *scriptName, const c
fDesc->AddParam(id, scriptNameNew, TYPE_INODE, 0, 0, fDesc->AddParam(id, scriptNameNew, TYPE_INODE, 0, 0,
end, end,
end); end);
plAutoUIParam* param = TRACKED_NEW plPickButtonParam(id, name, filter, canConvertToType); plAutoUIParam* param = new plPickButtonParam(id, name, filter, canConvertToType);
param->SetVisInfo(vid, vstates); param->SetVisInfo(vid, vstates);
fParams.push_back(param); fParams.push_back(param);
} }
@ -208,7 +208,7 @@ void plAutoUIBase::AddPickComponentButton(int16_t id, const char *scriptName, co
fDesc->AddParam(id, scriptNameNew, TYPE_INODE, 0, 0, fDesc->AddParam(id, scriptNameNew, TYPE_INODE, 0, 0,
end, end,
end); end);
plAutoUIParam* param = TRACKED_NEW plPickComponentButtonParam(id, name, filter, canConvertToType); plAutoUIParam* param = new plPickComponentButtonParam(id, name, filter, canConvertToType);
param->SetVisInfo(vid, vstates); param->SetVisInfo(vid, vstates);
fParams.push_back(param); fParams.push_back(param);
} }
@ -220,7 +220,7 @@ void plAutoUIBase::AddPickComponentList(int16_t id, const char *scriptName, cons
fDesc->AddParam(id, scriptNameNew, TYPE_INODE_TAB, 0, 0, 0, fDesc->AddParam(id, scriptNameNew, TYPE_INODE_TAB, 0, 0, 0,
end, end,
end); end);
plAutoUIParam* param = TRACKED_NEW plPickComponentListParam(id, name, filter); plAutoUIParam* param = new plPickComponentListParam(id, name, filter);
param->SetVisInfo(vid, vstates); param->SetVisInfo(vid, vstates);
fParams.push_back(param); fParams.push_back(param);
} }
@ -232,7 +232,7 @@ void plAutoUIBase::AddPickActivatorButton(int16_t id, const char *scriptName, co
fDesc->AddParam(id, scriptNameNew, TYPE_INODE, 0, 0, fDesc->AddParam(id, scriptNameNew, TYPE_INODE, 0, 0,
end, end,
end); end);
plAutoUIParam* param = TRACKED_NEW plPickActivatorButtonParam(id, name); plAutoUIParam* param = new plPickActivatorButtonParam(id, name);
param->SetVisInfo(vid, vstates); param->SetVisInfo(vid, vstates);
fParams.push_back(param); fParams.push_back(param);
} }
@ -244,7 +244,7 @@ void plAutoUIBase::AddPickActivatorList(int16_t id, const char *scriptName, cons
fDesc->AddParam(id, scriptNameNew, TYPE_INODE_TAB, 0, 0, 0, fDesc->AddParam(id, scriptNameNew, TYPE_INODE_TAB, 0, 0, 0,
end, end,
end); end);
plAutoUIParam* param = TRACKED_NEW plPickActivatorListParam(id, name); plAutoUIParam* param = new plPickActivatorListParam(id, name);
param->SetVisInfo(vid, vstates); param->SetVisInfo(vid, vstates);
fParams.push_back(param); fParams.push_back(param);
} }
@ -256,7 +256,7 @@ void plAutoUIBase::AddPickDynamicTextButton(int16_t id, const char *scriptName,
fDesc->AddParam(id, scriptNameNew, TYPE_REFTARG, 0, 0, fDesc->AddParam(id, scriptNameNew, TYPE_REFTARG, 0, 0,
end, end,
end); end);
plAutoUIParam* param = TRACKED_NEW plPickDynamicTextButtonParam(id, name); plAutoUIParam* param = new plPickDynamicTextButtonParam(id, name);
param->SetVisInfo(vid, vstates); param->SetVisInfo(vid, vstates);
fParams.push_back(param); fParams.push_back(param);
} }
@ -268,7 +268,7 @@ void plAutoUIBase::AddPickGUIDialogButton(int16_t id, const char *scriptName, co
fDesc->AddParam(id, scriptNameNew, TYPE_INODE, 0, 0, fDesc->AddParam(id, scriptNameNew, TYPE_INODE, 0, 0,
end, end,
end); end);
plAutoUIParam* param = TRACKED_NEW plPickSingleComponentButtonParam(id, name,plAutoUIParam::kTypeGUIDialog,GUI_DIALOG_COMP_CLASS_ID); plAutoUIParam* param = new plPickSingleComponentButtonParam(id, name,plAutoUIParam::kTypeGUIDialog,GUI_DIALOG_COMP_CLASS_ID);
param->SetVisInfo(vid, vstates); param->SetVisInfo(vid, vstates);
fParams.push_back(param); fParams.push_back(param);
} }
@ -280,7 +280,7 @@ void plAutoUIBase::AddPickExcludeRegionButton(int16_t id, const char *scriptName
fDesc->AddParam(id, scriptNameNew, TYPE_INODE, 0, 0, fDesc->AddParam(id, scriptNameNew, TYPE_INODE, 0, 0,
end, end,
end); end);
plAutoUIParam* param = TRACKED_NEW plPickExcludeRegionButtonParam(id, name); plAutoUIParam* param = new plPickExcludeRegionButtonParam(id, name);
param->SetVisInfo(vid, vstates); param->SetVisInfo(vid, vstates);
fParams.push_back(param); fParams.push_back(param);
} }
@ -292,7 +292,7 @@ void plAutoUIBase::AddPickWaterComponentButton(int16_t id, const char *scriptNam
fDesc->AddParam(id, scriptNameNew, TYPE_INODE, 0, 0, fDesc->AddParam(id, scriptNameNew, TYPE_INODE, 0, 0,
end, end,
end); end);
plAutoUIParam* param = TRACKED_NEW plPickWaterComponentButtonParam(id, name); plAutoUIParam* param = new plPickWaterComponentButtonParam(id, name);
param->SetVisInfo(vid, vstates); param->SetVisInfo(vid, vstates);
fParams.push_back(param); fParams.push_back(param);
} }
@ -304,7 +304,7 @@ void plAutoUIBase::AddPickSwimCurrentInterfaceButton(int16_t id, const char *scr
fDesc->AddParam(id, scriptNameNew, TYPE_INODE, 0, 0, fDesc->AddParam(id, scriptNameNew, TYPE_INODE, 0, 0,
end, end,
end); end);
plAutoUIParam* param = TRACKED_NEW plPickSwimCurrentInterfaceButtonParam(id, name); plAutoUIParam* param = new plPickSwimCurrentInterfaceButtonParam(id, name);
param->SetVisInfo(vid, vstates); param->SetVisInfo(vid, vstates);
fParams.push_back(param); fParams.push_back(param);
} }
@ -316,7 +316,7 @@ void plAutoUIBase::AddPickClusterComponentButton(int16_t id, const char *scriptN
fDesc->AddParam(id, scriptNameNew, TYPE_INODE, 0, 0, fDesc->AddParam(id, scriptNameNew, TYPE_INODE, 0, 0,
end, end,
end); end);
plAutoUIParam* param = TRACKED_NEW plPickClusterComponentButtonParam(id, name); plAutoUIParam* param = new plPickClusterComponentButtonParam(id, name);
param->SetVisInfo(vid, vstates); param->SetVisInfo(vid, vstates);
fParams.push_back(param); fParams.push_back(param);
} }
@ -328,7 +328,7 @@ void plAutoUIBase::AddPickAnimationButton(int16_t id, const char *scriptName, co
fDesc->AddParam(id, scriptNameNew, TYPE_INODE, 0, 0, fDesc->AddParam(id, scriptNameNew, TYPE_INODE, 0, 0,
end, end,
end); end);
plAutoUIParam* param = TRACKED_NEW plPickAnimationButtonParam(id, name); plAutoUIParam* param = new plPickAnimationButtonParam(id, name);
param->SetVisInfo(vid, vstates); param->SetVisInfo(vid, vstates);
fParams.push_back(param); fParams.push_back(param);
} }
@ -340,7 +340,7 @@ void plAutoUIBase::AddPickBehaviorButton(int16_t id, const char *scriptName, con
fDesc->AddParam(id, scriptNameNew, TYPE_INODE, 0, 0, fDesc->AddParam(id, scriptNameNew, TYPE_INODE, 0, 0,
end, end,
end); end);
plAutoUIParam* param = TRACKED_NEW plPickBehaviorButtonParam(id, name); plAutoUIParam* param = new plPickBehaviorButtonParam(id, name);
param->SetVisInfo(vid, vstates); param->SetVisInfo(vid, vstates);
fParams.push_back(param); fParams.push_back(param);
} }
@ -352,7 +352,7 @@ void plAutoUIBase::AddPickMaterialButton(int16_t id, const char *scriptName, con
fDesc->AddParam(id, scriptNameNew, TYPE_REFTARG, 0, 0, fDesc->AddParam(id, scriptNameNew, TYPE_REFTARG, 0, 0,
end, end,
end); end);
plAutoUIParam* param = TRACKED_NEW plPickMaterialButtonParam(id, name); plAutoUIParam* param = new plPickMaterialButtonParam(id, name);
param->SetVisInfo(vid, vstates); param->SetVisInfo(vid, vstates);
fParams.push_back(param); fParams.push_back(param);
} }
@ -364,7 +364,7 @@ void plAutoUIBase::AddPickMaterialAnimationButton(int16_t id, const char *script
fDesc->AddParam(id, scriptNameNew, TYPE_REFTARG, 0, 0, fDesc->AddParam(id, scriptNameNew, TYPE_REFTARG, 0, 0,
end, end,
end); end);
plAutoUIParam* param = TRACKED_NEW plPickMaterialAnimationButtonParam(id, name); plAutoUIParam* param = new plPickMaterialAnimationButtonParam(id, name);
param->SetVisInfo(vid, vstates); param->SetVisInfo(vid, vstates);
fParams.push_back(param); fParams.push_back(param);
} }
@ -376,7 +376,7 @@ void plAutoUIBase::AddPickGUIPopUpMenuButton(int16_t id, const char *scriptName,
fDesc->AddParam(id, scriptNameNew, TYPE_INODE, 0, 0, fDesc->AddParam(id, scriptNameNew, TYPE_INODE, 0, 0,
end, end,
end); end);
plAutoUIParam* param = TRACKED_NEW plPickSingleComponentButtonParam(id, name,plAutoUIParam::kTypeGUIPopUpMenu,GUI_MENUANCHOR_CLASSID); plAutoUIParam* param = new plPickSingleComponentButtonParam(id, name,plAutoUIParam::kTypeGUIPopUpMenu,GUI_MENUANCHOR_CLASSID);
param->SetVisInfo(vid, vstates); param->SetVisInfo(vid, vstates);
fParams.push_back(param); fParams.push_back(param);
} }
@ -388,7 +388,7 @@ void plAutoUIBase::AddPickGUISkinButton(int16_t id, const char *scriptName, cons
fDesc->AddParam(id, scriptNameNew, TYPE_INODE, 0, 0, fDesc->AddParam(id, scriptNameNew, TYPE_INODE, 0, 0,
end, end,
end); end);
plAutoUIParam* param = TRACKED_NEW plPickSingleComponentButtonParam(id, name,plAutoUIParam::kTypeGUISkin,GUI_SKIN_CLASSID); plAutoUIParam* param = new plPickSingleComponentButtonParam(id, name,plAutoUIParam::kTypeGUISkin,GUI_SKIN_CLASSID);
param->SetVisInfo(vid, vstates); param->SetVisInfo(vid, vstates);
fParams.push_back(param); fParams.push_back(param);
} }
@ -400,7 +400,7 @@ void plAutoUIBase::AddDropDownList(int16_t id, const char *scriptName, const cha
fDesc->AddParam(id, scriptNameNew, TYPE_STRING, 0, 0, fDesc->AddParam(id, scriptNameNew, TYPE_STRING, 0, 0,
p_default, nil, end, p_default, nil, end,
end); end);
plAutoUIParam* param = TRACKED_NEW plDropDownListParam(id, name, options); plAutoUIParam* param = new plDropDownListParam(id, name, options);
param->SetVisInfo(vid, vstates); param->SetVisInfo(vid, vstates);
fParams.push_back(param); fParams.push_back(param);
} }
@ -412,7 +412,7 @@ void plAutoUIBase::AddPickGrassComponentButton(int16_t id, const char *scriptNam
fDesc->AddParam(id, scriptNameNew, TYPE_INODE, 0, 0, fDesc->AddParam(id, scriptNameNew, TYPE_INODE, 0, 0,
end, end,
end); end);
plAutoUIParam* param = TRACKED_NEW plPickGrassComponentButtonParam(id, name); plAutoUIParam* param = new plPickGrassComponentButtonParam(id, name);
param->SetVisInfo(vid, vstates); param->SetVisInfo(vid, vstates);
fParams.push_back(param); fParams.push_back(param);
} }

2
Sources/Tools/MaxComponent/plAutoUIBlock.cpp

@ -53,7 +53,7 @@ plAutoUIBlock::plAutoUIBlock(plComponentClassDesc *cd, int blockID, const char *
{ {
fName = hsStrcpy(name); fName = hsStrcpy(name);
fVersion = version; fVersion = version;
fDesc = TRACKED_NEW ParamBlockDesc2(blockID, "Auto", IDS_COMP_AUTO, cd, 0, end); fDesc = new ParamBlockDesc2(blockID, "Auto", IDS_COMP_AUTO, cd, 0, end);
fIsMultiModifier = false; fIsMultiModifier = false;
} }

2
Sources/Tools/MaxComponent/plAutoUIComp.cpp

@ -52,7 +52,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
plAutoUIComp::plAutoUIComp(plAutoUIClassDesc *cd) plAutoUIComp::plAutoUIComp(plAutoUIClassDesc *cd)
{ {
fDesc = TRACKED_NEW ParamBlockDesc2(plComponentBase::kBlkComp, "Auto", IDS_COMP_AUTO, cd, P_AUTO_CONSTRUCT, plComponentBase::kRefComp, end); fDesc = new ParamBlockDesc2(plComponentBase::kBlkComp, "Auto", IDS_COMP_AUTO, cd, P_AUTO_CONSTRUCT, plComponentBase::kRefComp, end);
cd->autoComp = this; cd->autoComp = this;
} }

4
Sources/Tools/MaxComponent/plAutoUIParams.cpp

@ -417,7 +417,7 @@ bool plEditParam::IsMyMessage(UINT msg, WPARAM wParam, LPARAM lParam, IParamBloc
int len = GetWindowTextLength(fhEdit)+1; int len = GetWindowTextLength(fhEdit)+1;
if (len > 1) if (len > 1)
{ {
char *buf = TRACKED_NEW char[len]; char *buf = new char[len];
GetWindowText(fhEdit, buf, len); GetWindowText(fhEdit, buf, len);
pb->SetValue(fID, 0, buf); pb->SetValue(fID, 0, buf);
delete [] buf; delete [] buf;
@ -1724,7 +1724,7 @@ bool plDropDownListParam::IsMyMessage(UINT msg, WPARAM wParam, LPARAM lParam, IP
if (idx >=0 && idx < fOptions.size()) if (idx >=0 && idx < fOptions.size())
{ {
char* buf = TRACKED_NEW char[fOptions[idx].size() + 1]; char* buf = new char[fOptions[idx].size() + 1];
strcpy(buf, fOptions[idx].c_str()); strcpy(buf, fOptions[idx].c_str());
pb->SetValue(fID, 0, buf); pb->SetValue(fID, 0, buf);
delete [] buf; delete [] buf;

52
Sources/Tools/MaxComponent/plAvatarComponent.cpp

@ -124,7 +124,7 @@ class plCritterCommands;
plArmatureMod* plArmatureComponent::IGenerateMyArmMod(plHKPhysical* myHKPhys, plMaxNode* node) plArmatureMod* plArmatureComponent::IGenerateMyArmMod(plHKPhysical* myHKPhys, plMaxNode* node)
{ {
plArmatureMod *avMod = TRACKED_NEW plArmatureMod(); plArmatureMod *avMod = new plArmatureMod();
avMod->SetRootName(node->GetKey()->GetName()); avMod->SetRootName(node->GetKey()->GetName());
return avMod; return avMod;
} }
@ -216,17 +216,17 @@ void plArmatureComponent::ISetArmatureSORecurse(plMaxNode *node, plSceneObject *
hsBool plArmatureComponent::PreConvert(plMaxNode* node, plErrorMsg* pErrMsg) hsBool plArmatureComponent::PreConvert(plMaxNode* node, plErrorMsg* pErrMsg)
{ {
// add audio interface and record/playback component // add audio interface and record/playback component
pl2WayWinAudible* pAudible = TRACKED_NEW pl2WayWinAudible; pl2WayWinAudible* pAudible = new pl2WayWinAudible;
// Add a key for it // Add a key for it
plKey key = hsgResMgr::ResMgr()->NewKey(IGetUniqueName(node), pAudible, node->GetLocation() ); plKey key = hsgResMgr::ResMgr()->NewKey(IGetUniqueName(node), pAudible, node->GetLocation() );
plAudioInterface* ai = TRACKED_NEW plAudioInterface; plAudioInterface* ai = new plAudioInterface;
plKey pAiKey = hsgResMgr::ResMgr()->NewKey(IGetUniqueName(node), (hsKeyedObject*)ai,node->GetLocation()); plKey pAiKey = hsgResMgr::ResMgr()->NewKey(IGetUniqueName(node), (hsKeyedObject*)ai,node->GetLocation());
hsgResMgr::ResMgr()->AddViaNotify(pAiKey, TRACKED_NEW plObjRefMsg(node->GetKey(), plRefMsg::kOnCreate, 0, plObjRefMsg::kInterface), plRefFlags::kActiveRef); hsgResMgr::ResMgr()->AddViaNotify(pAiKey, new plObjRefMsg(node->GetKey(), plRefMsg::kOnCreate, 0, plObjRefMsg::kInterface), plRefFlags::kActiveRef);
plIntRefMsg* pMsg = TRACKED_NEW plIntRefMsg(node->GetKey(), plRefMsg::kOnCreate, 0, plIntRefMsg::kAudible); plIntRefMsg* pMsg = new plIntRefMsg(node->GetKey(), plRefMsg::kOnCreate, 0, plIntRefMsg::kAudible);
hsgResMgr::ResMgr()->AddViaNotify(pAudible->GetKey(), pMsg, plRefFlags::kActiveRef ); hsgResMgr::ResMgr()->AddViaNotify(pAudible->GetKey(), pMsg, plRefFlags::kActiveRef );
ISetArmatureSORecurse(node, node->GetSceneObject()); ISetArmatureSORecurse(node, node->GetSceneObject());
@ -248,9 +248,9 @@ hsBool plArmatureComponent::Convert(plMaxNode* node, plErrorMsg *pErrMsg)
ISetupClothes(node, fArmMod, pErrMsg); ISetupClothes(node, fArmMod, pErrMsg);
// ArmatureEffects // ArmatureEffects
plArmatureEffectsMgr *effects = TRACKED_NEW plArmatureEffectsMgr(); plArmatureEffectsMgr *effects = new plArmatureEffectsMgr();
hsgResMgr::ResMgr()->NewKey(IGetUniqueName(node), effects, node->GetLocation()); hsgResMgr::ResMgr()->NewKey(IGetUniqueName(node), effects, node->GetLocation());
plGenRefMsg *msg = TRACKED_NEW plGenRefMsg(fArmMod->GetKey(), plRefMsg::kOnCreate, -1, -1); plGenRefMsg *msg = new plGenRefMsg(fArmMod->GetKey(), plRefMsg::kOnCreate, -1, -1);
hsgResMgr::ResMgr()->AddViaNotify(effects->GetKey(), msg, plRefFlags::kActiveRef); // Attach effects hsgResMgr::ResMgr()->AddViaNotify(effects->GetKey(), msg, plRefFlags::kActiveRef); // Attach effects
plSceneObject *obj = node->GetSceneObject(); plSceneObject *obj = node->GetSceneObject();
@ -264,7 +264,7 @@ hsBool plArmatureComponent::Convert(plMaxNode* node, plErrorMsg *pErrMsg)
{ {
// MakeCharacterHierarchy will attach agmodifiers to all the bones in the hierarchy; // MakeCharacterHierarchy will attach agmodifiers to all the bones in the hierarchy;
// have to manually add any for non-bone objects... // have to manually add any for non-bone objects...
agMod = TRACKED_NEW plAGModifier("Handle"); // the player root is known as the handle agMod = new plAGModifier("Handle"); // the player root is known as the handle
node->AddModifier(agMod, IGetUniqueName(node)); node->AddModifier(agMod, IGetUniqueName(node));
} }
@ -462,7 +462,7 @@ void plAvatarComponent::IAttachModifiers(plMaxNode *node, plErrorMsg *pErrMsg)
plSceneObject * bodySO = node->GetSceneObject(); plSceneObject * bodySO = node->GetSceneObject();
plArmatureMod* avMod = TRACKED_NEW plArmatureMod(); plArmatureMod* avMod = new plArmatureMod();
avMod->SetRootName(name); avMod->SetRootName(name);
avMod->AppendMeshKey(meshKey); avMod->AppendMeshKey(meshKey);
int skeletonType = fCompPB->GetInt(ParamID(kSkeleton)); int skeletonType = fCompPB->GetInt(ParamID(kSkeleton));
@ -470,9 +470,9 @@ void plAvatarComponent::IAttachModifiers(plMaxNode *node, plErrorMsg *pErrMsg)
// only make a human brain if we're a human // only make a human brain if we're a human
if (skeletonType == plArmatureMod::kBoneBaseCritter) if (skeletonType == plArmatureMod::kBoneBaseCritter)
avMod->PushBrain(TRACKED_NEW plAvBrainCritter()); avMod->PushBrain(new plAvBrainCritter());
else else
avMod->PushBrain(TRACKED_NEW plAvBrainHuman(skeletonType == plArmatureMod::kBoneBaseActor)); avMod->PushBrain(new plAvBrainHuman(skeletonType == plArmatureMod::kBoneBaseActor));
avMod->SetBodyAgeName(node->GetAgeName()); avMod->SetBodyAgeName(node->GetAgeName());
avMod->SetBodyFootstepSoundPage(fCompPB->GetStr(ParamID(kBodyFootstepSoundPage))); avMod->SetBodyFootstepSoundPage(fCompPB->GetStr(ParamID(kBodyFootstepSoundPage)));
@ -481,7 +481,7 @@ void plAvatarComponent::IAttachModifiers(plMaxNode *node, plErrorMsg *pErrMsg)
//AddLinkSound(node, node->GetSceneObject()->GetKey(), pErrMsg ); //AddLinkSound(node, node->GetSceneObject()->GetKey(), pErrMsg );
plKey avKey = hsgResMgr::ResMgr()->NewKey(IGetUniqueName(node), avMod, node->GetLocation()); plKey avKey = hsgResMgr::ResMgr()->NewKey(IGetUniqueName(node), avMod, node->GetLocation());
plObjRefMsg *objRefMsg = TRACKED_NEW plObjRefMsg(bodySO->GetKey(), plRefMsg::kOnCreate,-1, plObjRefMsg::kModifier); plObjRefMsg *objRefMsg = new plObjRefMsg(bodySO->GetKey(), plRefMsg::kOnCreate,-1, plObjRefMsg::kModifier);
hsgResMgr::ResMgr()->AddViaNotify(avKey, objRefMsg, plRefFlags::kActiveRef); hsgResMgr::ResMgr()->AddViaNotify(avKey, objRefMsg, plRefFlags::kActiveRef);
fArmMod = avMod; fArmMod = avMod;
@ -501,7 +501,7 @@ void AddClothingToMod(plMaxNode *node, plArmatureMod *mod, int group, hsGMateria
return; return;
} }
plClothingBase *base = TRACKED_NEW plClothingBase(); plClothingBase *base = new plClothingBase();
if (node->GetUserPropString("layout", sdata)) if (node->GetUserPropString("layout", sdata))
{ {
toker.Reset(sdata, hsConverterUtils::fTagSeps); toker.Reset(sdata, hsConverterUtils::fTagSeps);
@ -511,14 +511,14 @@ void AddClothingToMod(plMaxNode *node, plArmatureMod *mod, int group, hsGMateria
base->SetLayoutName("BasicHuman"); base->SetLayoutName("BasicHuman");
sprintf(keyName, "%s_ClothingBase", node->GetName()); sprintf(keyName, "%s_ClothingBase", node->GetName());
hsgResMgr::ResMgr()->NewKey(keyName, base, node->GetLocation()); hsgResMgr::ResMgr()->NewKey(keyName, base, node->GetLocation());
plClothingOutfit *outfit = TRACKED_NEW plClothingOutfit(); plClothingOutfit *outfit = new plClothingOutfit();
outfit->fGroup = group; outfit->fGroup = group;
sprintf(keyName, "%s_outfit", mod->GetKey()->GetName()); sprintf(keyName, "%s_outfit", mod->GetKey()->GetName());
hsgResMgr::ResMgr()->NewKey(keyName, outfit, node->GetLocation()); hsgResMgr::ResMgr()->NewKey(keyName, outfit, node->GetLocation());
msg = TRACKED_NEW plGenRefMsg(outfit->GetKey(), plRefMsg::kOnCreate, -1, -1); msg = new plGenRefMsg(outfit->GetKey(), plRefMsg::kOnCreate, -1, -1);
hsgResMgr::ResMgr()->AddViaNotify(base->GetKey(), msg, plRefFlags::kActiveRef); // Add clothing base to outfit hsgResMgr::ResMgr()->AddViaNotify(base->GetKey(), msg, plRefFlags::kActiveRef); // Add clothing base to outfit
msg = TRACKED_NEW plGenRefMsg(mod->GetKey(), plRefMsg::kOnCreate, -1, -1); msg = new plGenRefMsg(mod->GetKey(), plRefMsg::kOnCreate, -1, -1);
hsgResMgr::ResMgr()->AddViaNotify(outfit->GetKey(), msg, plRefFlags::kActiveRef); // Attach outfit hsgResMgr::ResMgr()->AddViaNotify(outfit->GetKey(), msg, plRefFlags::kActiveRef); // Attach outfit
@ -542,14 +542,14 @@ void AddClothingToMod(plMaxNode *node, plArmatureMod *mod, int group, hsGMateria
// The tex is what the outfit and the material hold onto. It's what // The tex is what the outfit and the material hold onto. It's what
// gets rendered. The base will hang onto the original baseTex. // gets rendered. The base will hang onto the original baseTex.
msg = TRACKED_NEW plGenRefMsg(base->GetKey(), plRefMsg::kOnCreate, -1, -1); msg = new plGenRefMsg(base->GetKey(), plRefMsg::kOnCreate, -1, -1);
hsgResMgr::ResMgr()->SendRef(baseTex->GetKey(), msg, plRefFlags::kActiveRef); // Set base texture of avatar hsgResMgr::ResMgr()->SendRef(baseTex->GetKey(), msg, plRefFlags::kActiveRef); // Set base texture of avatar
plLayRefMsg* layRef = TRACKED_NEW plLayRefMsg(li->GetKey(), plRefMsg::kOnRemove, 0, plLayRefMsg::kTexture); plLayRefMsg* layRef = new plLayRefMsg(li->GetKey(), plRefMsg::kOnRemove, 0, plLayRefMsg::kTexture);
hsgResMgr::ResMgr()->SendRef(baseTex->GetKey(), layRef, plRefFlags::kActiveRef); // Remove it from the material hsgResMgr::ResMgr()->SendRef(baseTex->GetKey(), layRef, plRefFlags::kActiveRef); // Remove it from the material
msg = TRACKED_NEW plGenRefMsg(outfit->GetKey(), plRefMsg::kOnCreate, -1, -1); msg = new plGenRefMsg(outfit->GetKey(), plRefMsg::kOnCreate, -1, -1);
hsgResMgr::ResMgr()->AddViaNotify(li->GetKey(), msg, plRefFlags::kActiveRef); // Set outfit's target layer interface hsgResMgr::ResMgr()->AddViaNotify(li->GetKey(), msg, plRefFlags::kActiveRef); // Set outfit's target layer interface
msg = TRACKED_NEW plGenRefMsg(outfit->GetKey(), plRefMsg::kOnCreate, -1, -1); msg = new plGenRefMsg(outfit->GetKey(), plRefMsg::kOnCreate, -1, -1);
hsgResMgr::ResMgr()->AddViaNotify(mat->GetKey(), msg, plRefFlags::kActiveRef); // Outfit needs the material hsgResMgr::ResMgr()->AddViaNotify(mat->GetKey(), msg, plRefFlags::kActiveRef); // Outfit needs the material
} }
else else
@ -689,7 +689,7 @@ hsBool plCompoundCtrlComponent::Convert(plMaxNode* node, plErrorMsg *pErrMsg)
// create and register the player modifier // create and register the player modifier
plAGMasterMod *agMaster = TRACKED_NEW plAGMasterMod(); plAGMasterMod *agMaster = new plAGMasterMod();
node->AddModifier(agMaster, IGetUniqueName(node)); node->AddModifier(agMaster, IGetUniqueName(node));
return true; return true;
@ -1055,14 +1055,14 @@ void plLODAvatarComponent::IAttachModifiers( plMaxNode *node, plErrorMsg *pEr
const char *avatarName = node->GetKey()->GetName(); const char *avatarName = node->GetKey()->GetName();
plMaxNode *animRoot = (plMaxNode *)fCompPB->GetINode(plLODAvatarComponent::kRootNodeAddBtn); plMaxNode *animRoot = (plMaxNode *)fCompPB->GetINode(plLODAvatarComponent::kRootNodeAddBtn);
plKey animRootKey = animRoot->GetSceneObject()->GetKey(); plKey animRootKey = animRoot->GetSceneObject()->GetKey();
plArmatureLODMod* avMod = TRACKED_NEW plArmatureLODMod(avatarName); plArmatureLODMod* avMod = new plArmatureLODMod(avatarName);
int skeletonType = fCompPB->GetInt(ParamID(kSkeleton)); int skeletonType = fCompPB->GetInt(ParamID(kSkeleton));
avMod->SetBodyType( skeletonType ); avMod->SetBodyType( skeletonType );
if (skeletonType == plArmatureLODMod::kBoneBaseCritter) if (skeletonType == plArmatureLODMod::kBoneBaseCritter)
avMod->PushBrain(TRACKED_NEW plAvBrainCritter()); avMod->PushBrain(new plAvBrainCritter());
else else
avMod->PushBrain(TRACKED_NEW plAvBrainHuman(skeletonType == plArmatureMod::kBoneBaseActor)); avMod->PushBrain(new plAvBrainHuman(skeletonType == plArmatureMod::kBoneBaseActor));
avMod->SetBodyAgeName(node->GetAgeName()); avMod->SetBodyAgeName(node->GetAgeName());
avMod->SetBodyFootstepSoundPage(fCompPB->GetStr(ParamID(kBodyFootstepSoundPage))); avMod->SetBodyFootstepSoundPage(fCompPB->GetStr(ParamID(kBodyFootstepSoundPage)));
@ -1136,7 +1136,7 @@ hsBool plLODAvatarComponent::Convert(plMaxNode* node, plErrorMsg* pErrMsg)
for (i = 0; i < kMaxNumLODLevels; i++) for (i = 0; i < kMaxNumLODLevels; i++)
{ {
int numBones = fCompPB->GetInt(ParamID(kGroupTotals), 0, i); int numBones = fCompPB->GetInt(ParamID(kGroupTotals), 0, i);
plKeyVector *keyVec = TRACKED_NEW plKeyVector; plKeyVector *keyVec = new plKeyVector;
int j; int j;
for (j = 0; j < numBones; j++) for (j = 0; j < numBones; j++)
@ -1176,7 +1176,7 @@ void plLODAvatarComponent::IAttachShadowCastModifiersRecur(plMaxNode* node, plSh
void plLODAvatarComponent::IAttachShadowCastToLODs(plMaxNode* rootNode) void plLODAvatarComponent::IAttachShadowCastToLODs(plMaxNode* rootNode)
{ {
plShadowCaster* caster = TRACKED_NEW plShadowCaster; plShadowCaster* caster = new plShadowCaster;
hsgResMgr::ResMgr()->NewKey(IGetUniqueName(rootNode), caster, rootNode->GetLocation()); hsgResMgr::ResMgr()->NewKey(IGetUniqueName(rootNode), caster, rootNode->GetLocation());
caster->SetSelfShadow(true); caster->SetSelfShadow(true);

2
Sources/Tools/MaxComponent/plBehavioralComponents.cpp

@ -155,7 +155,7 @@ hsBool plAvBehaviorSittingComponent::PreConvert(plMaxNode* node, plErrorMsg* pEr
bool hasRightApproach = fCompPB->GetInt(ParamID(kApproachRight)) ? true : false; bool hasRightApproach = fCompPB->GetInt(ParamID(kApproachRight)) ? true : false;
// Create our key here and give it to the detector so it will notify us // Create our key here and give it to the detector so it will notify us
plSittingModifier *sitMod = TRACKED_NEW plSittingModifier(hasFrontApproach, hasLeftApproach, hasRightApproach); plSittingModifier *sitMod = new plSittingModifier(hasFrontApproach, hasLeftApproach, hasRightApproach);
if (fCompPB->GetInt(ParamID(kDisableForward))) if (fCompPB->GetInt(ParamID(kDisableForward)))
sitMod->fMiscFlags |= plSittingModifier::kDisableForward; sitMod->fMiscFlags |= plSittingModifier::kDisableForward;

8
Sources/Tools/MaxComponent/plBipedKiller.cpp

@ -448,7 +448,7 @@ plSampleVec * SampleNodeMotion(INode* node, INode* parent, int sampleRate, Inter
// intended for use in the context of a full tree traversal // intended for use in the context of a full tree traversal
plSampleVec * SampleNodeMotion(INode * node, INode* parent, int sampleRate, TimeValue start, TimeValue end) plSampleVec * SampleNodeMotion(INode * node, INode* parent, int sampleRate, TimeValue start, TimeValue end)
{ {
plSampleVec *result = TRACKED_NEW plSampleVec; plSampleVec *result = new plSampleVec;
bool done = false; bool done = false;
@ -462,7 +462,7 @@ plSampleVec * SampleNodeMotion(INode * node, INode* parent, int sampleRate, Time
int frameNum= keyTime / GetTicksPerFrame(); int frameNum= keyTime / GetTicksPerFrame();
// get localTM // get localTM
nodeTMInfo * nti = TRACKED_NEW nodeTMInfo; nodeTMInfo * nti = new nodeTMInfo;
nti->fTime = keyTime; nti->fTime = keyTime;
Matrix3 localTM = node->GetNodeTM(keyTime); Matrix3 localTM = node->GetNodeTM(keyTime);
@ -564,7 +564,7 @@ plSampleVecMap *SampleTreeMotion(INode* node, INode* parent, int sampleRate, Int
Interval interval = theInterface->GetAnimRange(); Interval interval = theInterface->GetAnimRange();
TimeValue start = interval.Start(); // in ticks TimeValue start = interval.Start(); // in ticks
TimeValue end = interval.End(); TimeValue end = interval.End();
plSampleVecMap *ourMap = TRACKED_NEW plSampleVecMap(); plSampleVecMap *ourMap = new plSampleVecMap();
sampleRate *= GetTicksPerFrame(); // convert sample rate to ticks sampleRate *= GetTicksPerFrame(); // convert sample rate to ticks
@ -581,7 +581,7 @@ void SampleTreeMotionRecurse(INode * node, INode* parent, int sampleRate,
if(!HasBipController(node)) if(!HasBipController(node))
{ {
char *nodeName = node->GetName(); char *nodeName = node->GetName();
char *nameCopy = TRACKED_NEW char[strlen(nodeName) + 1]; char *nameCopy = new char[strlen(nodeName) + 1];
strcpy(nameCopy, nodeName); strcpy(nameCopy, nodeName);
plSampleVec *branch = SampleNodeMotion(node, parent, sampleRate, start, end); plSampleVec *branch = SampleNodeMotion(node, parent, sampleRate, start, end);

2
Sources/Tools/MaxComponent/plBlowComponent.cpp

@ -128,7 +128,7 @@ hsBool plBlowComponent::PreConvert(plMaxNode *node, plErrorMsg *pErrMsg)
hsBool plBlowComponent::Convert(plMaxNode *node, plErrorMsg *pErrMsg) hsBool plBlowComponent::Convert(plMaxNode *node, plErrorMsg *pErrMsg)
{ {
plBlower* pMod = TRACKED_NEW plBlower; plBlower* pMod = new plBlower;
float strength = fCompPB->GetFloat(kStrength) * 0.01f; float strength = fCompPB->GetFloat(kStrength) * 0.01f;
float speed = fCompPB->GetFloat(kSpeed) * 0.01f; float speed = fCompPB->GetFloat(kSpeed) * 0.01f;

56
Sources/Tools/MaxComponent/plCameraComponents.cpp

@ -440,9 +440,9 @@ hsBool plTransOverrideComponent::PreConvert(plMaxNode *pNode, plErrorMsg *pErrMs
PreTrans* pTrans = nil; PreTrans* pTrans = nil;
if (pCamNode) if (pCamNode)
pTrans = TRACKED_NEW PreTrans(((plMaxNode*)pCamNode)->GetSceneObject()); pTrans = new PreTrans(((plMaxNode*)pCamNode)->GetSceneObject());
else else
pTrans = TRACKED_NEW PreTrans(nil); pTrans = new PreTrans(nil);
if (fCompPB->GetInt(kIgnoreTrans)) if (fCompPB->GetInt(kIgnoreTrans))
{ {
@ -794,9 +794,9 @@ hsBool plCameraBaseComponent::Convert(plMaxNode *node, plErrorMsg *pErrMsg)
} }
CamTrans* camTrans = nil; CamTrans* camTrans = nil;
if (!pCamMod) if (!pCamMod)
camTrans = TRACKED_NEW CamTrans(nil); camTrans = new CamTrans(nil);
else else
camTrans = TRACKED_NEW CamTrans(pCamMod->GetKey()); camTrans = new CamTrans(pCamMod->GetKey());
camTrans->fAccel = trans->fAccel; camTrans->fAccel = trans->fAccel;
camTrans->fDecel = trans->fDecel; camTrans->fDecel = trans->fDecel;
@ -837,10 +837,10 @@ plCameraModifier1* plCameraBaseComponent::ICreateCameraModifier(plMaxNode* pNode
// create run-time objects // create run-time objects
plCameraModifier1* pMod = TRACKED_NEW plCameraModifier1; plCameraModifier1* pMod = new plCameraModifier1;
plKey modifierKey = hsgResMgr::ResMgr()->NewKey(IGetUniqueName(pNode), pMod, pNode->GetLocation()); plKey modifierKey = hsgResMgr::ResMgr()->NewKey(IGetUniqueName(pNode), pMod, pNode->GetLocation());
hsgResMgr::ResMgr()->AddViaNotify(modifierKey, TRACKED_NEW plObjRefMsg(pNode->GetSceneObject()->GetKey(), plRefMsg::kOnCreate, -1, plObjRefMsg::kModifier), plRefFlags::kActiveRef); hsgResMgr::ResMgr()->AddViaNotify(modifierKey, new plObjRefMsg(pNode->GetSceneObject()->GetKey(), plRefMsg::kOnCreate, -1, plObjRefMsg::kModifier), plRefFlags::kActiveRef);
obj = pNode->EvalWorldState(hsConverterUtils::Instance().GetTime(pNode->GetInterface())).obj; obj = pNode->EvalWorldState(hsConverterUtils::Instance().GetTime(pNode->GetInterface())).obj;
@ -950,17 +950,17 @@ plCameraModifier1* plCameraBaseComponent::ICreateFocalPointObject(plMaxNode* pNo
{ {
plMaxNode* node = ((plMaxNode*)pNode->GetTarget()); plMaxNode* node = ((plMaxNode*)pNode->GetTarget());
plCameraModifier1* pPOAMod = TRACKED_NEW plCameraModifier1; plCameraModifier1* pPOAMod = new plCameraModifier1;
plKey poaModifierKey = hsgResMgr::ResMgr()->NewKey(IGetUniqueName(pNode), pPOAMod, node->GetLocation()); plKey poaModifierKey = hsgResMgr::ResMgr()->NewKey(IGetUniqueName(pNode), pPOAMod, node->GetLocation());
hsgResMgr::ResMgr()->AddViaNotify(poaModifierKey, TRACKED_NEW plObjRefMsg(node->GetKey(), plRefMsg::kOnCreate, -1, plObjRefMsg::kModifier), plRefFlags::kActiveRef); hsgResMgr::ResMgr()->AddViaNotify(poaModifierKey, new plObjRefMsg(node->GetKey(), plRefMsg::kOnCreate, -1, plObjRefMsg::kModifier), plRefFlags::kActiveRef);
plCameraBrain1* pPOABrain = TRACKED_NEW plCameraBrain1(pPOAMod); plCameraBrain1* pPOABrain = new plCameraBrain1(pPOAMod);
// Give the brain a key // Give the brain a key
hsgResMgr::ResMgr()->NewKey(IGetUniqueName(pNode), pPOABrain, pNode->GetLocation()); hsgResMgr::ResMgr()->NewKey(IGetUniqueName(pNode), pPOABrain, pNode->GetLocation());
plGenRefMsg* pGRMsg = TRACKED_NEW plGenRefMsg(pPOAMod->GetKey(), plRefMsg::kOnCreate, -1, 0); plGenRefMsg* pGRMsg = new plGenRefMsg(pPOAMod->GetKey(), plRefMsg::kOnCreate, -1, 0);
pGRMsg->SetRef( (hsKeyedObject*)pPOABrain ); pGRMsg->SetRef( (hsKeyedObject*)pPOABrain );
plConvert::Instance().AddMessageToQueue(pGRMsg); plConvert::Instance().AddMessageToQueue(pGRMsg);
@ -1104,11 +1104,11 @@ hsBool plCamera1Component::PreConvert(plMaxNode *pNode, plErrorMsg *pErrMsg)
return false; return false;
//this is a fixed camera using the built-in target //this is a fixed camera using the built-in target
plCameraBrain1_Fixed* pBrain = TRACKED_NEW plCameraBrain1_Fixed(pMod); plCameraBrain1_Fixed* pBrain = new plCameraBrain1_Fixed(pMod);
// Give the brain a key // Give the brain a key
hsgResMgr::ResMgr()->NewKey(IGetUniqueName(pNode), pBrain, pNode->GetLocation()); hsgResMgr::ResMgr()->NewKey(IGetUniqueName(pNode), pBrain, pNode->GetLocation());
plGenRefMsg* pMsg = TRACKED_NEW plGenRefMsg(pMod->GetKey(), plRefMsg::kOnCreate, -1, 0); plGenRefMsg* pMsg = new plGenRefMsg(pMod->GetKey(), plRefMsg::kOnCreate, -1, 0);
pMsg->SetRef( (hsKeyedObject*)pBrain ); pMsg->SetRef( (hsKeyedObject*)pBrain );
plConvert::Instance().AddMessageToQueue(pMsg); plConvert::Instance().AddMessageToQueue(pMsg);
@ -1347,11 +1347,11 @@ hsBool plAutoCamComponent::PreConvert(plMaxNode *pNode, plErrorMsg *pErrMsg)
if (!pMod) if (!pMod)
return false; return false;
plCameraBrain1_Avatar* pBrain = TRACKED_NEW plCameraBrain1_Avatar(pMod); plCameraBrain1_Avatar* pBrain = new plCameraBrain1_Avatar(pMod);
// Give the brain a key // Give the brain a key
hsgResMgr::ResMgr()->NewKey(IGetUniqueName(pNode), pBrain, pNode->GetLocation()); hsgResMgr::ResMgr()->NewKey(IGetUniqueName(pNode), pBrain, pNode->GetLocation());
plGenRefMsg* pMsg = TRACKED_NEW plGenRefMsg(pMod->GetKey(), plRefMsg::kOnCreate, -1, 0); plGenRefMsg* pMsg = new plGenRefMsg(pMod->GetKey(), plRefMsg::kOnCreate, -1, 0);
pMsg->SetRef( (hsKeyedObject*)pBrain ); pMsg->SetRef( (hsKeyedObject*)pBrain );
plConvert::Instance().AddMessageToQueue(pMsg); plConvert::Instance().AddMessageToQueue(pMsg);
hsVector3 pt; hsVector3 pt;
@ -1509,11 +1509,11 @@ hsBool plFPCamComponent::PreConvert(plMaxNode *pNode, plErrorMsg *pErrMsg)
if (!pMod) if (!pMod)
return false; return false;
plCameraBrain1_FirstPerson* pBrain = TRACKED_NEW plCameraBrain1_FirstPerson(pMod); plCameraBrain1_FirstPerson* pBrain = new plCameraBrain1_FirstPerson(pMod);
// Give the brain a key // Give the brain a key
hsgResMgr::ResMgr()->NewKey(IGetUniqueName(pNode), pBrain, pNode->GetLocation()); hsgResMgr::ResMgr()->NewKey(IGetUniqueName(pNode), pBrain, pNode->GetLocation());
plGenRefMsg* pMsg2 = TRACKED_NEW plGenRefMsg(pMod->GetKey(), plRefMsg::kOnCreate, -1, 0); plGenRefMsg* pMsg2 = new plGenRefMsg(pMod->GetKey(), plRefMsg::kOnCreate, -1, 0);
pMsg2->SetRef( (hsKeyedObject*)pBrain ); pMsg2->SetRef( (hsKeyedObject*)pBrain );
plConvert::Instance().AddMessageToQueue(pMsg2); plConvert::Instance().AddMessageToQueue(pMsg2);
@ -1648,7 +1648,7 @@ plRailCameraComponent::plRailCameraComponent()
hsBool plRailCameraComponent::IMakeLineMod(plMaxNode* pNode, plErrorMsg* pErrMsg) hsBool plRailCameraComponent::IMakeLineMod(plMaxNode* pNode, plErrorMsg* pErrMsg)
{ {
plRailCameraMod* lineMod = TRACKED_NEW plRailCameraMod; plRailCameraMod* lineMod = new plRailCameraMod;
hsgResMgr::ResMgr()->NewKey(IGetUniqueName(pNode), lineMod, pNode->GetLocation()); hsgResMgr::ResMgr()->NewKey(IGetUniqueName(pNode), lineMod, pNode->GetLocation());
lineMod->SetFollowMode(plLineFollowMod::kFollowLocalAvatar); lineMod->SetFollowMode(plLineFollowMod::kFollowLocalAvatar);
@ -1686,7 +1686,7 @@ hsBool plRailCameraComponent::IMakeLineMod(plMaxNode* pNode, plErrorMsg* pErrMsg
hsAffineParts initParts; hsAffineParts initParts;
AP_SET(initParts, ap); AP_SET(initParts, ap);
plAnimPath* animPath = TRACKED_NEW plAnimPath; plAnimPath* animPath = new plAnimPath;
animPath->SetController(tmc); animPath->SetController(tmc);
animPath->InitParts(initParts); animPath->InitParts(initParts);
animPath->SetFarthest(fCompPB->GetInt(kRailFarthest)); animPath->SetFarthest(fCompPB->GetInt(kRailFarthest));
@ -1699,7 +1699,7 @@ hsBool plRailCameraComponent::IMakeLineMod(plMaxNode* pNode, plErrorMsg* pErrMsg
plSceneObject* parObj = parNode->GetSceneObject(); plSceneObject* parObj = parNode->GetSceneObject();
if( parObj ) if( parObj )
{ {
plGenRefMsg* refMsg = TRACKED_NEW plGenRefMsg(lineMod->GetKey(), plRefMsg::kOnCreate, 0, plLineFollowMod::kRefParent); plGenRefMsg* refMsg = new plGenRefMsg(lineMod->GetKey(), plRefMsg::kOnCreate, 0, plLineFollowMod::kRefParent);
hsgResMgr::ResMgr()->AddViaNotify(parObj->GetKey(), refMsg, plRefFlags::kPassiveRef); hsgResMgr::ResMgr()->AddViaNotify(parObj->GetKey(), refMsg, plRefFlags::kPassiveRef);
} }
} }
@ -1756,7 +1756,7 @@ hsBool plRailCameraComponent::PreConvert(plMaxNode* pNode, plErrorMsg* pErrMsg)
return false; return false;
//this is a fixed camera using the built-in target //this is a fixed camera using the built-in target
plCameraBrain1_Fixed* pBrain = TRACKED_NEW plCameraBrain1_Fixed(pMod); plCameraBrain1_Fixed* pBrain = new plCameraBrain1_Fixed(pMod);
// Give the brain a key // Give the brain a key
hsgResMgr::ResMgr()->NewKey(IGetUniqueName(pNode), pBrain, pNode->GetLocation()); hsgResMgr::ResMgr()->NewKey(IGetUniqueName(pNode), pBrain, pNode->GetLocation());
@ -1764,7 +1764,7 @@ hsBool plRailCameraComponent::PreConvert(plMaxNode* pNode, plErrorMsg* pErrMsg)
pBrain->SetAccel(5.0f); pBrain->SetAccel(5.0f);
pBrain->SetDecel(5.0f); pBrain->SetDecel(5.0f);
plGenRefMsg* pMsg = TRACKED_NEW plGenRefMsg(pMod->GetKey(), plRefMsg::kOnCreate, -1, 0); plGenRefMsg* pMsg = new plGenRefMsg(pMod->GetKey(), plRefMsg::kOnCreate, -1, 0);
pMsg->SetRef( (hsKeyedObject*)pBrain ); pMsg->SetRef( (hsKeyedObject*)pBrain );
plConvert::Instance().AddMessageToQueue(pMsg); plConvert::Instance().AddMessageToQueue(pMsg);
@ -1910,7 +1910,7 @@ hsBool plCircleCameraComponent::PreConvert(plMaxNode* pNode, plErrorMsg* pErrMsg
return false; return false;
//this is a circle camera using the built-in target //this is a circle camera using the built-in target
plCameraBrain1_Circle* pBrain = TRACKED_NEW plCameraBrain1_Circle(pMod); plCameraBrain1_Circle* pBrain = new plCameraBrain1_Circle(pMod);
// Give the brain a key // Give the brain a key
hsgResMgr::ResMgr()->NewKey(IGetUniqueName(pNode), pBrain, pNode->GetLocation()); hsgResMgr::ResMgr()->NewKey(IGetUniqueName(pNode), pBrain, pNode->GetLocation());
@ -1924,7 +1924,7 @@ hsBool plCircleCameraComponent::PreConvert(plMaxNode* pNode, plErrorMsg* pErrMsg
if (fCompPB->GetInt(kCircleFarthest)) if (fCompPB->GetInt(kCircleFarthest))
pBrain->SetFarCircleCam(true); pBrain->SetFarCircleCam(true);
plGenRefMsg* pMsg = TRACKED_NEW plGenRefMsg(pMod->GetKey(), plRefMsg::kOnCreate, -1, 0); plGenRefMsg* pMsg = new plGenRefMsg(pMod->GetKey(), plRefMsg::kOnCreate, -1, 0);
pMsg->SetRef( (hsKeyedObject*)pBrain ); pMsg->SetRef( (hsKeyedObject*)pBrain );
plConvert::Instance().AddMessageToQueue(pMsg); plConvert::Instance().AddMessageToQueue(pMsg);
@ -2077,14 +2077,14 @@ hsBool plCameraDetectorComponent::Convert(plMaxNode *node, plErrorMsg *pErrMsg)
plSceneObject *obj = node->GetSceneObject(); plSceneObject *obj = node->GetSceneObject();
plLocation loc = node->GetLocation(); plLocation loc = node->GetLocation();
plCameraRegionDetector *detector = TRACKED_NEW plCameraRegionDetector; plCameraRegionDetector *detector = new plCameraRegionDetector;
// Register the detector // Register the detector
plKey detectorKey = hsgResMgr::ResMgr()->NewKey(IGetUniqueName(node), detector, loc); plKey detectorKey = hsgResMgr::ResMgr()->NewKey(IGetUniqueName(node), detector, loc);
hsgResMgr::ResMgr()->AddViaNotify(detectorKey, TRACKED_NEW plObjRefMsg(obj->GetKey(), plRefMsg::kOnCreate, -1, plObjRefMsg::kModifier), plRefFlags::kActiveRef); hsgResMgr::ResMgr()->AddViaNotify(detectorKey, new plObjRefMsg(obj->GetKey(), plRefMsg::kOnCreate, -1, plObjRefMsg::kModifier), plRefFlags::kActiveRef);
plCameraMsg* pMsg = TRACKED_NEW plCameraMsg; plCameraMsg* pMsg = new plCameraMsg;
pMsg->SetBCastFlag(plMessage::kBCastByType); pMsg->SetBCastFlag(plMessage::kBCastByType);
// need to get the key for the camera here... // need to get the key for the camera here...
@ -2301,11 +2301,11 @@ hsBool plFollowCamComponent::PreConvert(plMaxNode *pNode, plErrorMsg *pErrMsg)
if (!pMod) if (!pMod)
return false; return false;
plCameraBrain1_Avatar* pBrain = TRACKED_NEW plCameraBrain1_Avatar(pMod); plCameraBrain1_Avatar* pBrain = new plCameraBrain1_Avatar(pMod);
// Give the brain a key // Give the brain a key
hsgResMgr::ResMgr()->NewKey(IGetUniqueName(pNode), pBrain, pNode->GetLocation()); hsgResMgr::ResMgr()->NewKey(IGetUniqueName(pNode), pBrain, pNode->GetLocation());
plGenRefMsg* pMsg = TRACKED_NEW plGenRefMsg(pMod->GetKey(), plRefMsg::kOnCreate, -1, 0); plGenRefMsg* pMsg = new plGenRefMsg(pMod->GetKey(), plRefMsg::kOnCreate, -1, 0);
pMsg->SetRef( (hsKeyedObject*)pBrain ); pMsg->SetRef( (hsKeyedObject*)pBrain );
plConvert::Instance().AddMessageToQueue(pMsg); plConvert::Instance().AddMessageToQueue(pMsg);
hsVector3 pt; hsVector3 pt;

30
Sources/Tools/MaxComponent/plClickDragComponent.cpp

@ -363,9 +363,9 @@ hsBool plClickDragComponent::PreConvert(plMaxNode *node, plErrorMsg *pErrMsg)
plSceneObject *obj = node->GetSceneObject(); plSceneObject *obj = node->GetSceneObject();
// do the same thing for axis animation controllers. // do the same thing for axis animation controllers.
plAxisAnimModifier* pAxis = TRACKED_NEW plAxisAnimModifier; plAxisAnimModifier* pAxis = new plAxisAnimModifier;
plKey axisKey = hsgResMgr::ResMgr()->NewKey(IGetUniqueName(node), pAxis, loc); plKey axisKey = hsgResMgr::ResMgr()->NewKey(IGetUniqueName(node), pAxis, loc);
hsgResMgr::ResMgr()->AddViaNotify(axisKey, TRACKED_NEW plObjRefMsg(obj->GetKey(), plRefMsg::kOnCreate, -1, plObjRefMsg::kModifier), plRefFlags::kActiveRef); hsgResMgr::ResMgr()->AddViaNotify(axisKey, new plObjRefMsg(obj->GetKey(), plRefMsg::kOnCreate, -1, plObjRefMsg::kModifier), plRefFlags::kActiveRef);
logic->AddNotifyReceiver(axisKey); logic->AddNotifyReceiver(axisKey);
fAxisKeys[node] = axisKey; fAxisKeys[node] = axisKey;
@ -384,11 +384,11 @@ hsBool plClickDragComponent::Convert(plMaxNode *node, plErrorMsg *pErrMsg)
// Create the detector // Create the detector
plDetectorModifier *detector = nil; plDetectorModifier *detector = nil;
detector = TRACKED_NEW plPickingDetector; detector = new plPickingDetector;
// Register the detector // Register the detector
plKey detectorKey = hsgResMgr::ResMgr()->NewKey(IGetUniqueName(node), detector, loc); plKey detectorKey = hsgResMgr::ResMgr()->NewKey(IGetUniqueName(node), detector, loc);
hsgResMgr::ResMgr()->AddViaNotify(detectorKey, TRACKED_NEW plObjRefMsg(obj->GetKey(), plRefMsg::kOnCreate, -1, plObjRefMsg::kModifier), plRefFlags::kActiveRef); hsgResMgr::ResMgr()->AddViaNotify(detectorKey, new plObjRefMsg(obj->GetKey(), plRefMsg::kOnCreate, -1, plObjRefMsg::kModifier), plRefFlags::kActiveRef);
// set up the axis anim controller // set up the axis anim controller
@ -437,17 +437,17 @@ hsBool plClickDragComponent::Convert(plMaxNode *node, plErrorMsg *pErrMsg)
pAxis->SetAllOrNothing(fCompPB->GetInt(kClickDragAllOrNothing)); pAxis->SetAllOrNothing(fCompPB->GetInt(kClickDragAllOrNothing));
// add callbacks for beginning and end of animation // add callbacks for beginning and end of animation
plEventCallbackMsg* pCall1 = TRACKED_NEW plEventCallbackMsg; plEventCallbackMsg* pCall1 = new plEventCallbackMsg;
pCall1->fEvent = kBegin; pCall1->fEvent = kBegin;
pCall1->fRepeats = -1; pCall1->fRepeats = -1;
pCall1->AddReceiver(axisKey); pCall1->AddReceiver(axisKey);
plEventCallbackMsg* pCall2 = TRACKED_NEW plEventCallbackMsg; plEventCallbackMsg* pCall2 = new plEventCallbackMsg;
pCall2->fEvent = kEnd; pCall2->fEvent = kEnd;
pCall2->fRepeats = -1; pCall2->fRepeats = -1;
pCall2->AddReceiver(axisKey); pCall2->AddReceiver(axisKey);
plAnimCmdMsg* pMsg = TRACKED_NEW plAnimCmdMsg; plAnimCmdMsg* pMsg = new plAnimCmdMsg;
const char *tempAnimName = pAnim->GetAnimName(); const char *tempAnimName = pAnim->GetAnimName();
if (tempAnimName == nil) if (tempAnimName == nil)
{ {
@ -504,11 +504,11 @@ hsBool plClickDragComponent::Convert(plMaxNode *node, plErrorMsg *pErrMsg)
if(pProxyNode->CanConvert()) if(pProxyNode->CanConvert())
{ {
det2 = TRACKED_NEW plPickingDetector; det2 = new plPickingDetector;
// Register the detector // Register the detector
det2Key = hsgResMgr::ResMgr()->NewKey(IGetUniqueName(node), det2, loc); det2Key = hsgResMgr::ResMgr()->NewKey(IGetUniqueName(node), det2, loc);
hsgResMgr::ResMgr()->AddViaNotify(det2Key, TRACKED_NEW plObjRefMsg(((plMaxNode*)pProxyNode)->GetSceneObject()->GetKey(), plRefMsg::kOnCreate, -1, plObjRefMsg::kModifier), plRefFlags::kActiveRef); hsgResMgr::ResMgr()->AddViaNotify(det2Key, new plObjRefMsg(((plMaxNode*)pProxyNode)->GetSceneObject()->GetKey(), plRefMsg::kOnCreate, -1, plObjRefMsg::kModifier), plRefFlags::kActiveRef);
hsgResMgr::ResMgr()->AddViaNotify(logicKey, TRACKED_NEW plObjRefMsg( det2Key, plRefMsg::kOnCreate, -1, plObjRefMsg::kModifier), plRefFlags::kActiveRef); hsgResMgr::ResMgr()->AddViaNotify(logicKey, new plObjRefMsg( det2Key, plRefMsg::kOnCreate, -1, plObjRefMsg::kModifier), plRefFlags::kActiveRef);
det2->SetProxyKey(node->GetSceneObject()->GetKey()); det2->SetProxyKey(node->GetSceneObject()->GetKey());
} }
else else
@ -523,7 +523,7 @@ hsBool plClickDragComponent::Convert(plMaxNode *node, plErrorMsg *pErrMsg)
// create and register the CONDITIONS for the DETECTOR's Logic Modifier // create and register the CONDITIONS for the DETECTOR's Logic Modifier
plActivatorConditionalObject* activatorCond = TRACKED_NEW plActivatorConditionalObject; plActivatorConditionalObject* activatorCond = new plActivatorConditionalObject;
plKey activatorKey = hsgResMgr::ResMgr()->NewKey(IGetUniqueName(node), activatorCond, loc); plKey activatorKey = hsgResMgr::ResMgr()->NewKey(IGetUniqueName(node), activatorCond, loc);
// do we have a required region? // do we have a required region?
@ -553,12 +553,12 @@ hsBool plClickDragComponent::Convert(plMaxNode *node, plErrorMsg *pErrMsg)
{ {
// need a player in box condition here... // need a player in box condition here...
// first a detector-any for the box // first a detector-any for the box
plObjectInVolumeDetector* pCDet = TRACKED_NEW plObjectInVolumeDetector(plCollisionDetector::kTypeAny); plObjectInVolumeDetector* pCDet = new plObjectInVolumeDetector(plCollisionDetector::kTypeAny);
plKey cDetKey = hsgResMgr::ResMgr()->NewKey(IGetUniqueName(node), pCDet, loc); plKey cDetKey = hsgResMgr::ResMgr()->NewKey(IGetUniqueName(node), pCDet, loc);
hsgResMgr::ResMgr()->AddViaNotify(cDetKey, TRACKED_NEW plObjRefMsg(((plMaxNode*)pProxyRegNode)->GetSceneObject()->GetKey(), plRefMsg::kOnCreate, -1, plObjRefMsg::kModifier), plRefFlags::kActiveRef); hsgResMgr::ResMgr()->AddViaNotify(cDetKey, new plObjRefMsg(((plMaxNode*)pProxyRegNode)->GetSceneObject()->GetKey(), plRefMsg::kOnCreate, -1, plObjRefMsg::kModifier), plRefFlags::kActiveRef);
pCDet->AddLogicObj(logicKey); pCDet->AddLogicObj(logicKey);
// then an object-in-box condition for the logic mod // then an object-in-box condition for the logic mod
plObjectInBoxConditionalObject* boxCond = TRACKED_NEW plObjectInBoxConditionalObject; plObjectInBoxConditionalObject* boxCond = new plObjectInBoxConditionalObject;
plKey boxCondKey = hsgResMgr::ResMgr()->NewKey(IGetUniqueName(node), boxCond, loc); plKey boxCondKey = hsgResMgr::ResMgr()->NewKey(IGetUniqueName(node), boxCond, loc);
logic->AddCondition(boxCond); logic->AddCondition(boxCond);
} }
@ -578,7 +578,7 @@ hsBool plClickDragComponent::Convert(plMaxNode *node, plErrorMsg *pErrMsg)
// How do we feel about player facing // How do we feel about player facing
plFacingConditionalObject* facingCond = TRACKED_NEW plFacingConditionalObject; plFacingConditionalObject* facingCond = new plFacingConditionalObject;
facingCond->SetDirectional(fCompPB->GetInt(kClickDragDirectional)); facingCond->SetDirectional(fCompPB->GetInt(kClickDragDirectional));
int deg = fCompPB->GetInt(kClickDragDegrees); int deg = fCompPB->GetInt(kClickDragDegrees);
if (deg > 180) if (deg > 180)

18
Sources/Tools/MaxComponent/plClickableComponent.cpp

@ -264,9 +264,9 @@ hsBool plClickableComponent::PreConvert(plMaxNode *node, plErrorMsg *pErrMsg)
plSceneObject *obj = clickNode->GetSceneObject(); plSceneObject *obj = clickNode->GetSceneObject();
// Create and register the VolumeGadget's logic component // Create and register the VolumeGadget's logic component
plLogicModifier *logic = TRACKED_NEW plLogicModifier; plLogicModifier *logic = new plLogicModifier;
plKey logicKey = hsgResMgr::ResMgr()->NewKey(IGetUniqueName(node), logic, clickNode->GetLocation()); plKey logicKey = hsgResMgr::ResMgr()->NewKey(IGetUniqueName(node), logic, clickNode->GetLocation());
hsgResMgr::ResMgr()->AddViaNotify(logicKey, TRACKED_NEW plObjRefMsg(obj->GetKey(), plRefMsg::kOnCreate, -1, plObjRefMsg::kModifier), plRefFlags::kActiveRef); hsgResMgr::ResMgr()->AddViaNotify(logicKey, new plObjRefMsg(obj->GetKey(), plRefMsg::kOnCreate, -1, plObjRefMsg::kModifier), plRefFlags::kActiveRef);
fLogicModKeys[clickNode] = logicKey; fLogicModKeys[clickNode] = logicKey;
@ -328,14 +328,14 @@ hsBool plClickableComponent::Convert(plMaxNode *node, plErrorMsg *pErrMsg)
// Create the detector // Create the detector
plDetectorModifier *detector = nil; plDetectorModifier *detector = nil;
detector = TRACKED_NEW plPickingDetector; detector = new plPickingDetector;
// Register the detector // Register the detector
plKey detectorKey = hsgResMgr::ResMgr()->NewKey(IGetUniqueName(node), detector, loc); plKey detectorKey = hsgResMgr::ResMgr()->NewKey(IGetUniqueName(node), detector, loc);
hsgResMgr::ResMgr()->AddViaNotify(detectorKey, TRACKED_NEW plObjRefMsg(obj->GetKey(), plRefMsg::kOnCreate, -1, plObjRefMsg::kModifier), plRefFlags::kActiveRef); hsgResMgr::ResMgr()->AddViaNotify(detectorKey, new plObjRefMsg(obj->GetKey(), plRefMsg::kOnCreate, -1, plObjRefMsg::kModifier), plRefFlags::kActiveRef);
// create and register the CONDITIONS for the DETECTOR's Logic Modifier // create and register the CONDITIONS for the DETECTOR's Logic Modifier
plActivatorConditionalObject* activatorCond = TRACKED_NEW plActivatorConditionalObject; plActivatorConditionalObject* activatorCond = new plActivatorConditionalObject;
plKey activatorKey = hsgResMgr::ResMgr()->NewKey(IGetUniqueName(node), activatorCond, loc); plKey activatorKey = hsgResMgr::ResMgr()->NewKey(IGetUniqueName(node), activatorCond, loc);
// //
@ -345,14 +345,14 @@ hsBool plClickableComponent::Convert(plMaxNode *node, plErrorMsg *pErrMsg)
// first a detector-any for the box // first a detector-any for the box
if (!ignoreProxyRegion) if (!ignoreProxyRegion)
{ {
plObjectInVolumeDetector* pCDet = TRACKED_NEW plObjectInVolumeDetector(plCollisionDetector::kTypeAny); plObjectInVolumeDetector* pCDet = new plObjectInVolumeDetector(plCollisionDetector::kTypeAny);
plKey pCDetKey = hsgResMgr::ResMgr()->NewKey(IGetUniqueName(node), pCDet, loc); plKey pCDetKey = hsgResMgr::ResMgr()->NewKey(IGetUniqueName(node), pCDet, loc);
hsgResMgr::ResMgr()->AddViaNotify(pCDetKey, TRACKED_NEW plObjRefMsg(detectNode->GetSceneObject()->GetKey(), plRefMsg::kOnCreate, -1, plObjRefMsg::kModifier), plRefFlags::kActiveRef); hsgResMgr::ResMgr()->AddViaNotify(pCDetKey, new plObjRefMsg(detectNode->GetSceneObject()->GetKey(), plRefMsg::kOnCreate, -1, plObjRefMsg::kModifier), plRefFlags::kActiveRef);
pCDet->AddLogicObj(logicKey); pCDet->AddLogicObj(logicKey);
// then an object-in-box condition for the logic mod // then an object-in-box condition for the logic mod
plObjectInBoxConditionalObject* boxCond = TRACKED_NEW plObjectInBoxConditionalObject; plObjectInBoxConditionalObject* boxCond = new plObjectInBoxConditionalObject;
plKey boxCondKey = hsgResMgr::ResMgr()->NewKey(IGetUniqueName(node), boxCond, loc); plKey boxCondKey = hsgResMgr::ResMgr()->NewKey(IGetUniqueName(node), boxCond, loc);
logic->AddCondition(boxCond); logic->AddCondition(boxCond);
} }
@ -360,7 +360,7 @@ hsBool plClickableComponent::Convert(plMaxNode *node, plErrorMsg *pErrMsg)
// //
// How do we feel about player facing // How do we feel about player facing
// //
plFacingConditionalObject* facingCond = TRACKED_NEW plFacingConditionalObject; plFacingConditionalObject* facingCond = new plFacingConditionalObject;
facingCond->SetDirectional(fCompPB->GetInt(kClickableDirectional)); facingCond->SetDirectional(fCompPB->GetInt(kClickableDirectional));
int deg = fCompPB->GetInt(kClickableDegrees); int deg = fCompPB->GetInt(kClickableDegrees);
if (deg > 180) if (deg > 180)

6
Sources/Tools/MaxComponent/plClimbComponent.cpp

@ -239,7 +239,7 @@ hsBool plClimbTriggerComponent::Convert(plMaxNode *node, plErrorMsg *pErrMsg)
plClimbMsg *enterMsg = nil; plClimbMsg *enterMsg = nil;
if(enterCommand != plClimbMsg::kNoCommand) if(enterCommand != plClimbMsg::kNoCommand)
{ {
enterMsg = TRACKED_NEW plClimbMsg(nilKey, nilKey, enterCommand, direction, enterStatus, target); enterMsg = new plClimbMsg(nilKey, nilKey, enterCommand, direction, enterStatus, target);
enterMsg->SetBCastFlag(plMessage::kPropagateToModifiers); enterMsg->SetBCastFlag(plMessage::kPropagateToModifiers);
enterMsg->SetBCastFlag(plMessage::kNetPropagate); enterMsg->SetBCastFlag(plMessage::kNetPropagate);
enterMsg->SetBCastFlag(plMessage::kNetForce); enterMsg->SetBCastFlag(plMessage::kNetForce);
@ -248,13 +248,13 @@ hsBool plClimbTriggerComponent::Convert(plMaxNode *node, plErrorMsg *pErrMsg)
plClimbMsg *exitMsg = nil; plClimbMsg *exitMsg = nil;
if(exitCommand != nil) if(exitCommand != nil)
{ {
exitMsg = TRACKED_NEW plClimbMsg(nilKey, nilKey, exitCommand, direction, exitStatus, target); exitMsg = new plClimbMsg(nilKey, nilKey, exitCommand, direction, exitStatus, target);
exitMsg->SetBCastFlag(plMessage::kPropagateToModifiers); exitMsg->SetBCastFlag(plMessage::kPropagateToModifiers);
exitMsg->SetBCastFlag(plMessage::kNetPropagate); exitMsg->SetBCastFlag(plMessage::kNetPropagate);
exitMsg->SetBCastFlag(plMessage::kNetForce); exitMsg->SetBCastFlag(plMessage::kNetForce);
} }
plSimpleRegionSensor *sensMod = TRACKED_NEW plSimpleRegionSensor(enterMsg, exitMsg); plSimpleRegionSensor *sensMod = new plSimpleRegionSensor(enterMsg, exitMsg);
node->AddModifier(sensMod, IGetUniqueName(node)); node->AddModifier(sensMod, IGetUniqueName(node));
return true; return true;

4
Sources/Tools/MaxComponent/plClothingComponent.cpp

@ -198,7 +198,7 @@ hsBool plClothingComponent::Convert(plMaxNode *node, plErrorMsg *pErrMsg)
for (i = 0; i < fCompPB->Count(kMeshNodeTab); i++) for (i = 0; i < fCompPB->Count(kMeshNodeTab); i++)
{ {
spanArray.Reset(); spanArray.Reset();
//plSharedMesh *mesh = TRACKED_NEW plSharedMesh; //plSharedMesh *mesh = new plSharedMesh;
LODNode = (plMaxNode *)fCompPB->GetINode(kMeshNodeTab, 0, i); LODNode = (plMaxNode *)fCompPB->GetINode(kMeshNodeTab, 0, i);
if (LODNode != nil) if (LODNode != nil)
{ {
@ -240,7 +240,7 @@ hsBool plClothingComponent::Convert(plMaxNode *node, plErrorMsg *pErrMsg)
{ {
if (keys[j] != nil) if (keys[j] != nil)
{ {
refMsg = TRACKED_NEW plGenRefMsg(cloth->GetKey(), plRefMsg::kOnCreate, j, -1); refMsg = new plGenRefMsg(cloth->GetKey(), plRefMsg::kOnCreate, j, -1);
hsgResMgr::ResMgr()->AddViaNotify(keys[j], refMsg, plRefFlags::kActiveRef); hsgResMgr::ResMgr()->AddViaNotify(keys[j], refMsg, plRefFlags::kActiveRef);
} }
} }

4
Sources/Tools/MaxComponent/plClusterComponent.cpp

@ -967,7 +967,7 @@ void plClusterComponent::IClusterBins(plDistribInstTab& nodes, Box3& box)
} }
int totSize = IGetBinCount(); int totSize = IGetBinCount();
fClusterBins = TRACKED_NEW plDistribInstTab*[totSize]; fClusterBins = new plDistribInstTab*[totSize];
memset(fClusterBins, 0, sizeof(*fClusterBins) * totSize); memset(fClusterBins, 0, sizeof(*fClusterBins) * totSize);
@ -1010,7 +1010,7 @@ plDistribInstTab* plClusterComponent::IGetClusterBin(const Box3& box, const Poin
} }
int idx = coord[0] * fSizes[1] * fSizes[2] + coord[1] * fSizes[2] + coord[2]; int idx = coord[0] * fSizes[1] * fSizes[2] + coord[1] * fSizes[2] + coord[2];
if( !fClusterBins[idx] ) if( !fClusterBins[idx] )
fClusterBins[idx] = TRACKED_NEW plDistribInstTab; fClusterBins[idx] = new plDistribInstTab;
return fClusterBins[idx]; return fClusterBins[idx];
} }

2
Sources/Tools/MaxComponent/plExcludeRegionComponent.cpp

@ -177,7 +177,7 @@ hsBool plExcludeRegionComponent::PreConvert(plMaxNode *node, plErrorMsg *pErrMsg
return false; return false;
} }
plExcludeRegionModifier *mod = TRACKED_NEW plExcludeRegionModifier; plExcludeRegionModifier *mod = new plExcludeRegionModifier;
plKey key = node->AddModifier(mod, IGetUniqueName(node)); plKey key = node->AddModifier(mod, IGetUniqueName(node));
fXRegionKeys[node] = key; fXRegionKeys[node] = key;

48
Sources/Tools/MaxComponent/plFootPrintComponent.cpp

@ -318,7 +318,7 @@ hsBool plFootPrintComponent::PreConvert(plMaxNode* node, plErrorMsg* pErrMsg)
// If we haven't already, create our DynaDecalMgr and stash it away. // If we haven't already, create our DynaDecalMgr and stash it away.
if( !fDecalMgr ) if( !fDecalMgr )
{ {
ISetupDecalMgr(node, pErrMsg, TRACKED_NEW plDynaFootMgr); ISetupDecalMgr(node, pErrMsg, new plDynaFootMgr);
} }
return true; return true;
@ -333,7 +333,7 @@ hsBool plFootPrintComponent::Convert(plMaxNode* node, plErrorMsg* pErrMsg)
ISetupNotifies(node, pErrMsg); ISetupNotifies(node, pErrMsg);
// Add this node's object to our DynaDecalMgr. // Add this node's object to our DynaDecalMgr.
hsgResMgr::ResMgr()->AddViaNotify(node->GetKey(), TRACKED_NEW plGenRefMsg(fDecalMgr->GetKey(), plRefMsg::kOnCreate, 0, plDynaDecalMgr::kRefTarget), plRefFlags::kActiveRef); hsgResMgr::ResMgr()->AddViaNotify(node->GetKey(), new plGenRefMsg(fDecalMgr->GetKey(), plRefMsg::kOnCreate, 0, plDynaDecalMgr::kRefTarget), plRefFlags::kActiveRef);
return true; return true;
} }
@ -400,7 +400,7 @@ hsBool plFootPrintComponent::ISetupDecalMgr(plMaxNode* node, plErrorMsg* pErrMsg
return fValid = false; return fValid = false;
} }
hsgResMgr::ResMgr()->AddViaNotify(mgrKey, TRACKED_NEW plNodeRefMsg(node->GetRoomKey(), plRefMsg::kOnCreate, -1, plNodeRefMsg::kGeneric), plRefFlags::kActiveRef); hsgResMgr::ResMgr()->AddViaNotify(mgrKey, new plNodeRefMsg(node->GetRoomKey(), plRefMsg::kOnCreate, -1, plNodeRefMsg::kGeneric), plRefFlags::kActiveRef);
ISetupParticles(node, pErrMsg); ISetupParticles(node, pErrMsg);
@ -473,11 +473,11 @@ hsBool plFootPrintComponent::ICreateDecalMaterials(plMaxNode* node, plErrorMsg*
if( !matRTShade ) if( !matRTShade )
return fValid = false; return fValid = false;
hsgResMgr::ResMgr()->AddViaNotify(matRTShade->GetKey(), TRACKED_NEW plGenRefMsg(fDecalMgr->GetKey(), plRefMsg::kOnCreate, 0, plDynaDecalMgr::kRefMatRTShade), plRefFlags::kActiveRef); hsgResMgr::ResMgr()->AddViaNotify(matRTShade->GetKey(), new plGenRefMsg(fDecalMgr->GetKey(), plRefMsg::kOnCreate, 0, plDynaDecalMgr::kRefMatRTShade), plRefFlags::kActiveRef);
hsGMaterial* matPreShade = hsMaterialConverter::Instance().AlphaHackPrint(node, fCompPB->GetTexmap(kLayer), hsGMatState::kBlendAlpha); hsGMaterial* matPreShade = hsMaterialConverter::Instance().AlphaHackPrint(node, fCompPB->GetTexmap(kLayer), hsGMatState::kBlendAlpha);
hsgResMgr::ResMgr()->AddViaNotify(matPreShade->GetKey(), TRACKED_NEW plGenRefMsg(fDecalMgr->GetKey(), plRefMsg::kOnCreate, 0, plDynaDecalMgr::kRefMatPreShade), plRefFlags::kActiveRef); hsgResMgr::ResMgr()->AddViaNotify(matPreShade->GetKey(), new plGenRefMsg(fDecalMgr->GetKey(), plRefMsg::kOnCreate, 0, plDynaDecalMgr::kRefMatPreShade), plRefFlags::kActiveRef);
return true; return true;
} }
@ -512,7 +512,7 @@ hsBool plFootPrintComponent::ISetupColorDecalMaterials(plMaxNode* node, plErrorM
layer->SetBlendFlags(layer->GetBlendFlags() | hsGMatState::kBlendInvertFinalColor); layer->SetBlendFlags(layer->GetBlendFlags() | hsGMatState::kBlendInvertFinalColor);
} }
hsgResMgr::ResMgr()->AddViaNotify(matRTShade->GetKey(), TRACKED_NEW plGenRefMsg(fDecalMgr->GetKey(), plRefMsg::kOnCreate, 0, plDynaDecalMgr::kRefMatRTShade), plRefFlags::kActiveRef); hsgResMgr::ResMgr()->AddViaNotify(matRTShade->GetKey(), new plGenRefMsg(fDecalMgr->GetKey(), plRefMsg::kOnCreate, 0, plDynaDecalMgr::kRefMatRTShade), plRefFlags::kActiveRef);
return true; return true;
} }
@ -691,11 +691,11 @@ hsBool plRippleComponent::PreConvert(plMaxNode* node, plErrorMsg* pErrMsg)
plDynaRippleMgr* ripple = nil; plDynaRippleMgr* ripple = nil;
if( node->GetVS() || node->UserPropExists("XXXWaterColor") ) if( node->GetVS() || node->UserPropExists("XXXWaterColor") )
{ {
ripple = TRACKED_NEW plDynaRippleVSMgr; ripple = new plDynaRippleVSMgr;
} }
else else
{ {
ripple = TRACKED_NEW plDynaRippleMgr; ripple = new plDynaRippleMgr;
} }
ISetupDecalMgr(node, pErrMsg, ripple); ISetupDecalMgr(node, pErrMsg, ripple);
if( fValid ) if( fValid )
@ -717,7 +717,7 @@ hsBool plRippleComponent::Convert(plMaxNode* node, plErrorMsg* pErrMsg)
plWaveSetBase* waveSet = plWaterComponent::GetWaveSetFromNode(node); plWaveSetBase* waveSet = plWaterComponent::GetWaveSetFromNode(node);
if( waveSet ) if( waveSet )
{ {
plGenRefMsg* refMsg = TRACKED_NEW plGenRefMsg(fDecalMgr->GetKey(), plRefMsg::kOnCreate, 0, plDynaRippleVSMgr::kRefWaveSetBase); plGenRefMsg* refMsg = new plGenRefMsg(fDecalMgr->GetKey(), plRefMsg::kOnCreate, 0, plDynaRippleVSMgr::kRefWaveSetBase);
hsgResMgr::ResMgr()->AddViaNotify(waveSet->GetKey(), refMsg, plRefFlags::kPassiveRef); hsgResMgr::ResMgr()->AddViaNotify(waveSet->GetKey(), refMsg, plRefFlags::kPassiveRef);
} }
@ -725,7 +725,7 @@ hsBool plRippleComponent::Convert(plMaxNode* node, plErrorMsg* pErrMsg)
} }
// Add this node's object to our DynaDecalMgr. // Add this node's object to our DynaDecalMgr.
hsgResMgr::ResMgr()->AddViaNotify(node->GetKey(), TRACKED_NEW plGenRefMsg(fDecalMgr->GetKey(), plRefMsg::kOnCreate, 0, plDynaDecalMgr::kRefTarget), plRefFlags::kActiveRef); hsgResMgr::ResMgr()->AddViaNotify(node->GetKey(), new plGenRefMsg(fDecalMgr->GetKey(), plRefMsg::kOnCreate, 0, plDynaDecalMgr::kRefTarget), plRefFlags::kActiveRef);
return true; return true;
} }
@ -863,7 +863,7 @@ hsBool plPuddleComponent::PreConvert(plMaxNode* node, plErrorMsg* pErrMsg)
// If we haven't already, create our DynaDecalMgr and stash it away. // If we haven't already, create our DynaDecalMgr and stash it away.
if( !fDecalMgr ) if( !fDecalMgr )
{ {
plDynaRippleMgr* puddle = TRACKED_NEW plDynaPuddleMgr; plDynaRippleMgr* puddle = new plDynaPuddleMgr;
ISetupDecalMgr(node, pErrMsg, puddle); ISetupDecalMgr(node, pErrMsg, puddle);
if( fValid ) if( fValid )
@ -883,7 +883,7 @@ hsBool plPuddleComponent::Convert(plMaxNode* node, plErrorMsg* pErrMsg)
ISetupNotifies(node, pErrMsg); ISetupNotifies(node, pErrMsg);
// Add this node's object to our DynaDecalMgr. // Add this node's object to our DynaDecalMgr.
hsgResMgr::ResMgr()->AddViaNotify(node->GetKey(), TRACKED_NEW plGenRefMsg(fDecalMgr->GetKey(), plRefMsg::kOnCreate, 0, plDynaDecalMgr::kRefTarget), plRefFlags::kActiveRef); hsgResMgr::ResMgr()->AddViaNotify(node->GetKey(), new plGenRefMsg(fDecalMgr->GetKey(), plRefMsg::kOnCreate, 0, plDynaDecalMgr::kRefTarget), plRefFlags::kActiveRef);
return true; return true;
} }
@ -1028,7 +1028,7 @@ hsBool plBulletComponent::PreConvert(plMaxNode* node, plErrorMsg* pErrMsg)
// If we haven't already, create our DynaDecalMgr and stash it away. // If we haven't already, create our DynaDecalMgr and stash it away.
if( !fDecalMgr ) if( !fDecalMgr )
{ {
plDynaBulletMgr* bullet = TRACKED_NEW plDynaBulletMgr; plDynaBulletMgr* bullet = new plDynaBulletMgr;
ISetupDecalMgr(node, pErrMsg, bullet); ISetupDecalMgr(node, pErrMsg, bullet);
} }
@ -1044,7 +1044,7 @@ hsBool plBulletComponent::Convert(plMaxNode* node, plErrorMsg* pErrMsg)
ISetupNotifies(node, pErrMsg); ISetupNotifies(node, pErrMsg);
// Add this node's object to our DynaDecalMgr. // Add this node's object to our DynaDecalMgr.
hsgResMgr::ResMgr()->AddViaNotify(node->GetKey(), TRACKED_NEW plGenRefMsg(fDecalMgr->GetKey(), plRefMsg::kOnCreate, 0, plDynaDecalMgr::kRefTarget), plRefFlags::kActiveRef); hsgResMgr::ResMgr()->AddViaNotify(node->GetKey(), new plGenRefMsg(fDecalMgr->GetKey(), plRefMsg::kOnCreate, 0, plDynaDecalMgr::kRefTarget), plRefFlags::kActiveRef);
return true; return true;
} }
@ -1193,9 +1193,9 @@ hsBool plTorpedoComponent::PreConvert(plMaxNode* node, plErrorMsg* pErrMsg)
{ {
plDynaRippleMgr* torpedo; plDynaRippleMgr* torpedo;
if( node->GetVS() ) if( node->GetVS() )
torpedo = TRACKED_NEW plDynaTorpedoVSMgr; torpedo = new plDynaTorpedoVSMgr;
else else
torpedo = TRACKED_NEW plDynaTorpedoMgr; torpedo = new plDynaTorpedoMgr;
ISetupDecalMgr(node, pErrMsg, torpedo); ISetupDecalMgr(node, pErrMsg, torpedo);
if( fValid ) if( fValid )
@ -1351,7 +1351,7 @@ hsBool plWakeComponent::PreConvert(plMaxNode* node, plErrorMsg* pErrMsg)
// If we haven't already, create our DynaDecalMgr and stash it away. // If we haven't already, create our DynaDecalMgr and stash it away.
if( !fDecalMgr ) if( !fDecalMgr )
{ {
plDynaWakeMgr* wake = TRACKED_NEW plDynaWakeMgr; plDynaWakeMgr* wake = new plDynaWakeMgr;
ISetupDecalMgr(node, pErrMsg, wake); ISetupDecalMgr(node, pErrMsg, wake);
if( fValid ) if( fValid )
{ {
@ -1371,7 +1371,7 @@ hsBool plWakeComponent::Convert(plMaxNode* node, plErrorMsg* pErrMsg)
ISetupNotifies(node, pErrMsg); ISetupNotifies(node, pErrMsg);
// Add this node's object to our DynaDecalMgr. // Add this node's object to our DynaDecalMgr.
hsgResMgr::ResMgr()->AddViaNotify(node->GetKey(), TRACKED_NEW plGenRefMsg(fDecalMgr->GetKey(), plRefMsg::kOnCreate, 0, plDynaDecalMgr::kRefTarget), plRefFlags::kActiveRef); hsgResMgr::ResMgr()->AddViaNotify(node->GetKey(), new plGenRefMsg(fDecalMgr->GetKey(), plRefMsg::kOnCreate, 0, plDynaDecalMgr::kRefTarget), plRefFlags::kActiveRef);
return true; return true;
} }
@ -1498,7 +1498,7 @@ hsBool plDirtyComponent::Convert(plMaxNode* node, plErrorMsg* pErrMsg)
} }
plDecalEnableMod* enable = TRACKED_NEW plDecalEnableMod; plDecalEnableMod* enable = new plDecalEnableMod;
plKey modKey = hsgResMgr::ResMgr()->NewKey(IGetUniqueName(node), enable, node->GetLocation()); plKey modKey = hsgResMgr::ResMgr()->NewKey(IGetUniqueName(node), enable, node->GetLocation());
int numDecals = fCompPB->Count(kDecals); int numDecals = fCompPB->Count(kDecals);
@ -1516,7 +1516,7 @@ hsBool plDirtyComponent::Convert(plMaxNode* node, plErrorMsg* pErrMsg)
} }
} }
enable->SetWetLength(fCompPB->GetFloat(kDirtyTime)); enable->SetWetLength(fCompPB->GetFloat(kDirtyTime));
hsgResMgr::ResMgr()->AddViaNotify(modKey, TRACKED_NEW plObjRefMsg(node->GetKey(), plRefMsg::kOnCreate, -1, plObjRefMsg::kModifier), plRefFlags::kActiveRef); hsgResMgr::ResMgr()->AddViaNotify(modKey, new plObjRefMsg(node->GetKey(), plRefMsg::kOnCreate, -1, plObjRefMsg::kModifier), plRefFlags::kActiveRef);
return true; return true;
} }
@ -1620,14 +1620,14 @@ hsBool plPrintShapeComponent::Convert(plMaxNode* node, plErrorMsg* pErrMsg)
if( !obj ) if( !obj )
return true; return true;
plPrintShape* shape = TRACKED_NEW plPrintShape(); plPrintShape* shape = new plPrintShape();
plKey shapeKey = hsgResMgr::ResMgr()->NewKey(IGetUniqueName(node), shape, node->GetLocation()); plKey shapeKey = hsgResMgr::ResMgr()->NewKey(IGetUniqueName(node), shape, node->GetLocation());
shape->SetWidth(fCompPB->GetFloat(kWidth)); shape->SetWidth(fCompPB->GetFloat(kWidth));
shape->SetLength(fCompPB->GetFloat(kLength)); shape->SetLength(fCompPB->GetFloat(kLength));
shape->SetHeight(fCompPB->GetFloat(kHeight)); shape->SetHeight(fCompPB->GetFloat(kHeight));
hsgResMgr::ResMgr()->AddViaNotify(shapeKey, TRACKED_NEW plObjRefMsg(obj->GetKey(), plRefMsg::kOnCreate, 0, plObjRefMsg::kInterface), plRefFlags::kActiveRef); hsgResMgr::ResMgr()->AddViaNotify(shapeKey, new plObjRefMsg(obj->GetKey(), plRefMsg::kOnCreate, 0, plObjRefMsg::kInterface), plRefFlags::kActiveRef);
return true; return true;
} }
@ -1770,7 +1770,7 @@ hsBool plActivePrintShapeComponent::Convert(plMaxNode* node, plErrorMsg* pErrMsg
if( !obj ) if( !obj )
return true; return true;
plActivePrintShape* shape = TRACKED_NEW plActivePrintShape(); plActivePrintShape* shape = new plActivePrintShape();
plKey shapeKey = hsgResMgr::ResMgr()->NewKey(IGetUniqueName(node), shape, node->GetLocation()); plKey shapeKey = hsgResMgr::ResMgr()->NewKey(IGetUniqueName(node), shape, node->GetLocation());
shape->SetWidth(fCompPB->GetFloat(kWidth)); shape->SetWidth(fCompPB->GetFloat(kWidth));
@ -1789,7 +1789,7 @@ hsBool plActivePrintShapeComponent::Convert(plMaxNode* node, plErrorMsg* pErrMsg
} }
hsgResMgr::ResMgr()->AddViaNotify(shapeKey, TRACKED_NEW plObjRefMsg(obj->GetKey(), plRefMsg::kOnCreate, 0, plObjRefMsg::kInterface), plRefFlags::kActiveRef); hsgResMgr::ResMgr()->AddViaNotify(shapeKey, new plObjRefMsg(obj->GetKey(), plRefMsg::kOnCreate, 0, plObjRefMsg::kInterface), plRefFlags::kActiveRef);
return true; return true;
} }

6
Sources/Tools/MaxComponent/plFootstepComponent.cpp

@ -112,7 +112,7 @@ extern const plArmatureMod * FindArmatureMod(const plSceneObject *obj);
hsBool plFootstepSoundComponent::Convert(plMaxNode *node, plErrorMsg *pErrMsg) hsBool plFootstepSoundComponent::Convert(plMaxNode *node, plErrorMsg *pErrMsg)
{ {
plGenRefMsg *msg; plGenRefMsg *msg;
plArmatureEffectFootSound *effect = TRACKED_NEW plArmatureEffectFootSound(); plArmatureEffectFootSound *effect = new plArmatureEffectFootSound();
// Note: MUST be a hard-coded keyname, since we search for same name in plArmatureMod.cpp // Note: MUST be a hard-coded keyname, since we search for same name in plArmatureMod.cpp
hsgResMgr::ResMgr()->NewKey( "FootstepSounds", effect, node->GetLocation()); hsgResMgr::ResMgr()->NewKey( "FootstepSounds", effect, node->GetLocation());
@ -129,7 +129,7 @@ hsBool plFootstepSoundComponent::Convert(plMaxNode *node, plErrorMsg *pErrMsg)
plRandomSoundMod *mod = rsComp->fSoundMods[node]; plRandomSoundMod *mod = rsComp->fSoundMods[node];
if (mod != nil) if (mod != nil)
{ {
msg = TRACKED_NEW plGenRefMsg(effect->GetKey(), plRefMsg::kOnCreate, i, -1); msg = new plGenRefMsg(effect->GetKey(), plRefMsg::kOnCreate, i, -1);
hsgResMgr::ResMgr()->AddViaNotify(mod->GetKey(), msg, plRefFlags::kActiveRef); hsgResMgr::ResMgr()->AddViaNotify(mod->GetKey(), msg, plRefFlags::kActiveRef);
} }
} }
@ -137,7 +137,7 @@ hsBool plFootstepSoundComponent::Convert(plMaxNode *node, plErrorMsg *pErrMsg)
} }
// Add it to the scene node's generic list, so that all avatars can access it. // Add it to the scene node's generic list, so that all avatars can access it.
plNodeRefMsg* nodeRefMsg = TRACKED_NEW plNodeRefMsg(node->GetRoomKey(), plNodeRefMsg::kOnRequest, -1, plNodeRefMsg::kGeneric); plNodeRefMsg* nodeRefMsg = new plNodeRefMsg(node->GetRoomKey(), plNodeRefMsg::kOnRequest, -1, plNodeRefMsg::kGeneric);
hsgResMgr::ResMgr()->AddViaNotify(effect->GetKey(), nodeRefMsg, plRefFlags::kActiveRef); hsgResMgr::ResMgr()->AddViaNotify(effect->GetKey(), nodeRefMsg, plRefFlags::kActiveRef);
return true; return true;

84
Sources/Tools/MaxComponent/plGUIComponents.cpp

@ -986,7 +986,7 @@ hsBool plGUIColorSchemeComp::Convert(plMaxNode *node, plErrorMsg *pErrMsg)
pfGUIControlMod *ctrl = plGUIControlBase::GrabControlFromObject( node ); pfGUIControlMod *ctrl = plGUIControlBase::GrabControlFromObject( node );
if( ctrl != nil ) if( ctrl != nil )
{ {
pfGUIColorScheme *cs = TRACKED_NEW pfGUIColorScheme; pfGUIColorScheme *cs = new pfGUIColorScheme;
ConvertScheme( fCompPB, cs, pErrMsg ); ConvertScheme( fCompPB, cs, pErrMsg );
ctrl->SetColorScheme( cs ); ctrl->SetColorScheme( cs );
} }
@ -1178,7 +1178,7 @@ plGUIDialogComponent::plGUIDialogComponent( hsBool dontInit )
pfGUIDialogMod *plGUIDialogComponent::IMakeDialog( void ) pfGUIDialogMod *plGUIDialogComponent::IMakeDialog( void )
{ {
return TRACKED_NEW pfGUIDialogMod(); return new pfGUIDialogMod();
} }
// SetupProperties - Internal setup and write-only set properties on the MaxNode. No reading // SetupProperties - Internal setup and write-only set properties on the MaxNode. No reading
@ -1268,7 +1268,7 @@ hsBool plGUIDialogComponent::Convert(plMaxNode *node, plErrorMsg *pErrMsg)
return true; return true;
} }
plPostEffectMod* mod = TRACKED_NEW plPostEffectMod; plPostEffectMod* mod = new plPostEffectMod;
float hither = cam->GetEnvRange(timeVal, ENV_NEAR_RANGE); float hither = cam->GetEnvRange(timeVal, ENV_NEAR_RANGE);
if( hither < 0.5f ) if( hither < 0.5f )
@ -1320,10 +1320,10 @@ hsBool plGUIDialogComponent::Convert(plMaxNode *node, plErrorMsg *pErrMsg)
plLocation nodeLoc = sceneNodeKey->GetUoid().GetLocation(); plLocation nodeLoc = sceneNodeKey->GetUoid().GetLocation();
plKey modKey = hsgResMgr::ResMgr()->NewKey( fCompPB->GetStr( kRefDialogName ), mod, nodeLoc ); plKey modKey = hsgResMgr::ResMgr()->NewKey( fCompPB->GetStr( kRefDialogName ), mod, nodeLoc );
hsgResMgr::ResMgr()->AddViaNotify( modKey, TRACKED_NEW plNodeRefMsg( sceneNodeKey, plRefMsg::kOnCreate, -1, plNodeRefMsg::kGeneric ), plRefFlags::kActiveRef ); hsgResMgr::ResMgr()->AddViaNotify( modKey, new plNodeRefMsg( sceneNodeKey, plRefMsg::kOnCreate, -1, plNodeRefMsg::kGeneric ), plRefFlags::kActiveRef );
// Also add our dialog mod to the scene node in the same way // Also add our dialog mod to the scene node in the same way
hsgResMgr::ResMgr()->AddViaNotify( fDialogMod->GetKey(), TRACKED_NEW plNodeRefMsg( sceneNodeKey, plRefMsg::kOnCreate, -1, plNodeRefMsg::kGeneric ), plRefFlags::kActiveRef ); hsgResMgr::ResMgr()->AddViaNotify( fDialogMod->GetKey(), new plNodeRefMsg( sceneNodeKey, plRefMsg::kOnCreate, -1, plNodeRefMsg::kGeneric ), plRefFlags::kActiveRef );
/// Already created our mod, just gotta fill it out /// Already created our mod, just gotta fill it out
fDialogMod->SetRenderMod( mod ); fDialogMod->SetRenderMod( mod );
@ -1645,7 +1645,7 @@ hsBool plGUIControlBase::Convert(plMaxNode *node, plErrorMsg *pErrMsg)
{ {
case 0: case 0:
// Console command // Console command
fControl->SetHandler( TRACKED_NEW pfGUIConsoleCmdProc( fCompPB->GetStr( kRefConsoleCmd ) ) ); fControl->SetHandler( new pfGUIConsoleCmdProc( fCompPB->GetStr( kRefConsoleCmd ) ) );
break; break;
case 1: case 1:
@ -1656,7 +1656,7 @@ hsBool plGUIControlBase::Convert(plMaxNode *node, plErrorMsg *pErrMsg)
break; break;
case 2: case 2:
fControl->SetHandler( TRACKED_NEW pfGUICloseDlgProc() ); fControl->SetHandler( new pfGUICloseDlgProc() );
break; break;
case 3: case 3:
@ -1878,7 +1878,7 @@ class plGUIButtonComponent : public plGUIControlBase
{ {
protected: protected:
virtual pfGUIControlMod *IGetNewControl( void ) { return TRACKED_NEW pfGUIButtonMod; } virtual pfGUIControlMod *IGetNewControl( void ) { return new pfGUIButtonMod; }
virtual bool ICanHaveProxy( void ) { return true; } virtual bool ICanHaveProxy( void ) { return true; }
public: public:
@ -2220,7 +2220,7 @@ class plGUICheckBoxComponent : public plGUIControlBase
{ {
protected: protected:
virtual pfGUIControlMod *IGetNewControl( void ) { return TRACKED_NEW pfGUICheckBoxCtrl; } virtual pfGUIControlMod *IGetNewControl( void ) { return new pfGUICheckBoxCtrl; }
virtual bool ICanHaveProxy( void ) { return true; } virtual bool ICanHaveProxy( void ) { return true; }
public: public:
@ -2420,7 +2420,7 @@ class plGUIDraggableComponent : public plGUIControlBase
{ {
protected: protected:
virtual pfGUIControlMod *IGetNewControl( void ) { return TRACKED_NEW pfGUIDraggableMod; } virtual pfGUIControlMod *IGetNewControl( void ) { return new pfGUIDraggableMod; }
virtual bool ICanHaveProxy( void ) { return true; } virtual bool ICanHaveProxy( void ) { return true; }
public: public:
@ -2529,7 +2529,7 @@ class plGUIKnobCtrlComponent : public plGUIControlBase
{ {
protected: protected:
virtual pfGUIControlMod *IGetNewControl( void ) { return TRACKED_NEW pfGUIKnobCtrl; } virtual pfGUIControlMod *IGetNewControl( void ) { return new pfGUIKnobCtrl; }
virtual bool ICanHaveProxy( void ) { return true; } virtual bool ICanHaveProxy( void ) { return true; }
hsBool IGrabAnimationRange( plMaxNode *node, plErrorMsg *pErrMsg, hsMatrix44 &startL2W, hsMatrix44 &endL2W ); hsBool IGrabAnimationRange( plMaxNode *node, plErrorMsg *pErrMsg, hsMatrix44 &startL2W, hsMatrix44 &endL2W );
@ -2644,12 +2644,12 @@ hsBool plGUIKnobCtrlComponent::IGrabAnimationRange( plMaxNode *node, plErrorMsg
// Get the affine parts and the TM Controller // Get the affine parts and the TM Controller
plSceneObject *obj = node->GetSceneObject(); plSceneObject *obj = node->GetSceneObject();
hsAffineParts * parts = TRACKED_NEW hsAffineParts; hsAffineParts * parts = new hsAffineParts;
plController* tmc = hsControlConverter::Instance().ConvertTMAnim(obj, node, parts); plController* tmc = hsControlConverter::Instance().ConvertTMAnim(obj, node, parts);
if (tmc) if (tmc)
{ {
plMatrixControllerChannel *channel = TRACKED_NEW plMatrixControllerChannel(tmc, parts); plMatrixControllerChannel *channel = new plMatrixControllerChannel(tmc, parts);
float length = tmc->GetLength(); float length = tmc->GetLength();
@ -2778,7 +2778,7 @@ class plGUIListBoxComponent : public plGUIControlBase
{ {
protected: protected:
virtual pfGUIControlMod *IGetNewControl( void ) { return TRACKED_NEW pfGUIListBoxMod; } virtual pfGUIControlMod *IGetNewControl( void ) { return new pfGUIListBoxMod; }
virtual bool INeedsDynamicText( void ) { return true; } virtual bool INeedsDynamicText( void ) { return true; }
public: public:
@ -2948,7 +2948,7 @@ hsBool plGUIListBoxComponent::Convert(plMaxNode *node, plErrorMsg *pErrMsg)
pfGUIValueCtrl *scroll = pfGUIValueCtrl::ConvertNoRef( GrabControlMod( fCompPB->GetINode( kRefScrollCtrl ) ) ); pfGUIValueCtrl *scroll = pfGUIValueCtrl::ConvertNoRef( GrabControlMod( fCompPB->GetINode( kRefScrollCtrl ) ) );
if( scroll != nil ) if( scroll != nil )
{ {
hsgResMgr::ResMgr()->AddViaNotify( scroll->GetKey(), TRACKED_NEW plGenRefMsg( ctrl->GetKey(), hsgResMgr::ResMgr()->AddViaNotify( scroll->GetKey(), new plGenRefMsg( ctrl->GetKey(),
plRefMsg::kOnCreate, -1, pfGUIListBoxMod::kRefScrollCtrl ), plRefFlags::kActiveRef ); plRefMsg::kOnCreate, -1, pfGUIListBoxMod::kRefScrollCtrl ), plRefFlags::kActiveRef );
} }
} }
@ -2993,7 +2993,7 @@ hsBool plGUIListBoxComponent::Convert(plMaxNode *node, plErrorMsg *pErrMsg)
hsAssert( nodeID == GUI_SKIN_CLASSID, "Bad node param in GUIMenu::Convert()" ); hsAssert( nodeID == GUI_SKIN_CLASSID, "Bad node param in GUIMenu::Convert()" );
plGUISkinComp *skin = (plGUISkinComp *)comp; plGUISkinComp *skin = (plGUISkinComp *)comp;
hsgResMgr::ResMgr()->AddViaNotify( skin->GetConvertedSkin()->GetKey(), TRACKED_NEW plGenRefMsg( ctrl->GetKey(), plRefMsg::kOnCreate, -1, pfGUIControlMod::kRefSkin ), plRefFlags::kActiveRef ); hsgResMgr::ResMgr()->AddViaNotify( skin->GetConvertedSkin()->GetKey(), new plGenRefMsg( ctrl->GetKey(), plRefMsg::kOnCreate, -1, pfGUIControlMod::kRefSkin ), plRefFlags::kActiveRef );
} }
} }
@ -3013,7 +3013,7 @@ class plGUITextBoxComponent : public plGUIControlBase
{ {
protected: protected:
virtual pfGUIControlMod *IGetNewControl( void ) { return TRACKED_NEW pfGUITextBoxMod; } virtual pfGUIControlMod *IGetNewControl( void ) { return new pfGUITextBoxMod; }
virtual bool INeedsDynamicText( void ) { return true; } virtual bool INeedsDynamicText( void ) { return true; }
public: public:
@ -3110,14 +3110,14 @@ public:
int strLen = SendDlgItemMessage( hWnd, IDC_GUI_INITTEXT, WM_GETTEXTLENGTH, 0, 0 ); int strLen = SendDlgItemMessage( hWnd, IDC_GUI_INITTEXT, WM_GETTEXTLENGTH, 0, 0 );
if( strLen > 0 ) if( strLen > 0 )
{ {
char *str = TRACKED_NEW char[ strLen + 1 ]; char *str = new char[ strLen + 1 ];
GetDlgItemText( hWnd, IDC_GUI_INITTEXT, str, strLen + 1 ); GetDlgItemText( hWnd, IDC_GUI_INITTEXT, str, strLen + 1 );
str[ strLen ] = 0; str[ strLen ] = 0;
ISetTranslation(fCurLanguage,str); ISetTranslation(fCurLanguage,str);
delete [] str; delete [] str;
std::string translation = plLocalization::LocalToString(fTranslations); std::string translation = plLocalization::LocalToString(fTranslations);
str = TRACKED_NEW char[ translation.length() + 1 ]; str = new char[ translation.length() + 1 ];
strcpy(str,translation.c_str()); strcpy(str,translation.c_str());
str[translation.length()] = 0; str[translation.length()] = 0;
@ -3141,7 +3141,7 @@ public:
int strLen = SendDlgItemMessage( hWnd, IDC_GUI_LOCALIZATION_PATH, WM_GETTEXTLENGTH, 0, 0 ); int strLen = SendDlgItemMessage( hWnd, IDC_GUI_LOCALIZATION_PATH, WM_GETTEXTLENGTH, 0, 0 );
if( strLen > 0 ) if( strLen > 0 )
{ {
char *str = TRACKED_NEW char[ strLen + 1 ]; char *str = new char[ strLen + 1 ];
GetDlgItemText( hWnd, IDC_GUI_LOCALIZATION_PATH, str, strLen + 1 ); GetDlgItemText( hWnd, IDC_GUI_LOCALIZATION_PATH, str, strLen + 1 );
str[ strLen ] = 0; str[ strLen ] = 0;
pmap->GetParamBlock()->SetValue( plGUITextBoxComponent::kRefLocalizationPath, 0, str ); pmap->GetParamBlock()->SetValue( plGUITextBoxComponent::kRefLocalizationPath, 0, str );
@ -3310,7 +3310,7 @@ class plGUIEditBoxComponent : public plGUIControlBase
{ {
protected: protected:
virtual pfGUIControlMod *IGetNewControl( void ) { return TRACKED_NEW pfGUIEditBoxMod; } virtual pfGUIControlMod *IGetNewControl( void ) { return new pfGUIEditBoxMod; }
virtual bool INeedsDynamicText( void ) { return true; } virtual bool INeedsDynamicText( void ) { return true; }
public: public:
@ -3405,7 +3405,7 @@ class plGUIUpDownPairComponent : public plGUIControlBase
{ {
protected: protected:
virtual pfGUIControlMod *IGetNewControl( void ) { return TRACKED_NEW pfGUIUpDownPairMod; } virtual pfGUIControlMod *IGetNewControl( void ) { return new pfGUIUpDownPairMod; }
public: public:
plGUIUpDownPairComponent(); plGUIUpDownPairComponent();
@ -3617,7 +3617,7 @@ class plGUIDragBarComponent : public plGUIControlBase
{ {
protected: protected:
virtual pfGUIControlMod *IGetNewControl( void ) { return TRACKED_NEW pfGUIDragBarCtrl; } virtual pfGUIControlMod *IGetNewControl( void ) { return new pfGUIDragBarCtrl; }
virtual bool ICanHaveProxy( void ) { return true; } virtual bool ICanHaveProxy( void ) { return true; }
public: public:
@ -3703,7 +3703,7 @@ class plGUIRadioGroupComponent : public plGUIControlBase
protected: protected:
virtual pfGUIControlMod *IGetNewControl( void ) { return TRACKED_NEW pfGUIRadioGroupCtrl; } virtual pfGUIControlMod *IGetNewControl( void ) { return new pfGUIRadioGroupCtrl; }
public: public:
plGUIRadioGroupComponent(); plGUIRadioGroupComponent();
@ -3916,7 +3916,7 @@ class plGUIDynDisplayComponent : public plGUIControlBase
{ {
protected: protected:
virtual pfGUIControlMod *IGetNewControl( void ) { return TRACKED_NEW pfGUIDynDisplayCtrl; } virtual pfGUIControlMod *IGetNewControl( void ) { return new pfGUIDynDisplayCtrl; }
virtual bool IHasProcRollout( void ) { return false; } virtual bool IHasProcRollout( void ) { return false; }
public: public:
@ -4092,7 +4092,7 @@ class plGUIMultiLineEditComp : public plGUIControlBase
{ {
protected: protected:
virtual pfGUIControlMod *IGetNewControl( void ) { return TRACKED_NEW pfGUIMultiLineEditCtrl; } virtual pfGUIControlMod *IGetNewControl( void ) { return new pfGUIMultiLineEditCtrl; }
virtual bool INeedsDynamicText( void ) { return true; } virtual bool INeedsDynamicText( void ) { return true; }
public: public:
@ -4192,7 +4192,7 @@ hsBool plGUIMultiLineEditComp::Convert(plMaxNode *node, plErrorMsg *pErrMsg)
pfGUIValueCtrl *scroll = pfGUIValueCtrl::ConvertNoRef( GrabControlMod( fCompPB->GetINode( kRefScrollCtrl ) ) ); pfGUIValueCtrl *scroll = pfGUIValueCtrl::ConvertNoRef( GrabControlMod( fCompPB->GetINode( kRefScrollCtrl ) ) );
if( scroll != nil ) if( scroll != nil )
{ {
hsgResMgr::ResMgr()->AddViaNotify( scroll->GetKey(), TRACKED_NEW plGenRefMsg( ctrl->GetKey(), hsgResMgr::ResMgr()->AddViaNotify( scroll->GetKey(), new plGenRefMsg( ctrl->GetKey(),
plRefMsg::kOnCreate, -1, pfGUIMultiLineEditCtrl::kRefScrollCtrl ), plRefFlags::kActiveRef ); plRefMsg::kOnCreate, -1, pfGUIMultiLineEditCtrl::kRefScrollCtrl ), plRefFlags::kActiveRef );
} }
} }
@ -4214,7 +4214,7 @@ class plGUIProgressCtrlComponent : public plGUIControlBase
{ {
protected: protected:
virtual pfGUIControlMod *IGetNewControl( void ) { return TRACKED_NEW pfGUIProgressCtrl; } virtual pfGUIControlMod *IGetNewControl( void ) { return new pfGUIProgressCtrl; }
virtual bool ICanHaveProxy( void ) { return false; } virtual bool ICanHaveProxy( void ) { return false; }
public: public:
@ -4476,7 +4476,7 @@ class plGUIClickMapComponent : public plGUIControlBase
{ {
protected: protected:
virtual pfGUIControlMod *IGetNewControl( void ) { return TRACKED_NEW pfGUIClickMapCtrl; } virtual pfGUIControlMod *IGetNewControl( void ) { return new pfGUIClickMapCtrl; }
virtual bool ICanHaveProxy( void ) { return false; } virtual bool ICanHaveProxy( void ) { return false; }
public: public:
@ -4713,7 +4713,7 @@ plLayerTex *plGUISkinComp::GetSkinBitmap( void )
plLayerTex *layer = (plLayerTex *)fCompPB->GetTexmap( kRefBitmap, 0 ); plLayerTex *layer = (plLayerTex *)fCompPB->GetTexmap( kRefBitmap, 0 );
if( layer == nil || layer->ClassID() != LAYER_TEX_CLASS_ID ) if( layer == nil || layer->ClassID() != LAYER_TEX_CLASS_ID )
{ {
layer = TRACKED_NEW plLayerTex; layer = new plLayerTex;
fCompPB->SetValue( kRefBitmap, 0, (Texmap *)layer ); fCompPB->SetValue( kRefBitmap, 0, (Texmap *)layer );
} }
@ -4758,7 +4758,7 @@ hsBool plGUISkinComp::PreConvert(plMaxNode *node, plErrorMsg *pErrMsg)
return true; return true;
} }
fConvertedSkin = TRACKED_NEW pfGUISkin(); fConvertedSkin = new pfGUISkin();
hsgResMgr::ResMgr()->NewKey( IGetUniqueName(node), fConvertedSkin, node->GetLocation() ); hsgResMgr::ResMgr()->NewKey( IGetUniqueName(node), fConvertedSkin, node->GetLocation() );
return true; return true;
@ -4791,7 +4791,7 @@ hsBool plGUISkinComp::Convert(plMaxNode *node, plErrorMsg *pErrMsg)
plBitmap *bMap = plLayerConverter::Instance().CreateSimpleTexture( texture->bi.Name(), fConvertedSkin->GetKey()->GetUoid().GetLocation(), 0, plMipmap::kForceNonCompressed | plMipmap::kAlphaChannelFlag | plMipmap::kNoMaxSize ); plBitmap *bMap = plLayerConverter::Instance().CreateSimpleTexture( texture->bi.Name(), fConvertedSkin->GetKey()->GetUoid().GetLocation(), 0, plMipmap::kForceNonCompressed | plMipmap::kAlphaChannelFlag | plMipmap::kNoMaxSize );
if( bMap != nil && plMipmap::ConvertNoRef( bMap ) != nil ) if( bMap != nil && plMipmap::ConvertNoRef( bMap ) != nil )
{ {
hsgResMgr::ResMgr()->AddViaNotify( bMap->GetKey(), TRACKED_NEW plGenRefMsg( fConvertedSkin->GetKey(), hsgResMgr::ResMgr()->AddViaNotify( bMap->GetKey(), new plGenRefMsg( fConvertedSkin->GetKey(),
plRefMsg::kOnCreate, -1, pfGUISkin::kRefMipmap ), plRefFlags::kActiveRef ); plRefMsg::kOnCreate, -1, pfGUISkin::kRefMipmap ), plRefFlags::kActiveRef );
} }
} }
@ -4903,7 +4903,7 @@ plGUIMenuComponent::plGUIMenuComponent() : plGUIDialogComponent( true )
pfGUIDialogMod *plGUIMenuComponent::IMakeDialog( void ) pfGUIDialogMod *plGUIMenuComponent::IMakeDialog( void )
{ {
return TRACKED_NEW pfGUIPopUpMenu(); return new pfGUIPopUpMenu();
} }
plKey plGUIMenuComponent::GetConvertedMenuKey( void ) const plKey plGUIMenuComponent::GetConvertedMenuKey( void ) const
@ -4975,7 +4975,7 @@ hsBool plGUIMenuComponent::Convert(plMaxNode *node, plErrorMsg *pErrMsg)
const plLocation &loc = menu->GetKey()->GetUoid().GetLocation(); const plLocation &loc = menu->GetKey()->GetUoid().GetLocation();
// Create the rendermod // Create the rendermod
plPostEffectMod *renderMod = TRACKED_NEW plPostEffectMod; plPostEffectMod *renderMod = new plPostEffectMod;
hsgResMgr::ResMgr()->NewKey( IGetUniqueName(node), renderMod, loc ); hsgResMgr::ResMgr()->NewKey( IGetUniqueName(node), renderMod, loc );
renderMod->SetHither( 0.5f ); renderMod->SetHither( 0.5f );
@ -4992,25 +4992,25 @@ hsBool plGUIMenuComponent::Convert(plMaxNode *node, plErrorMsg *pErrMsg)
renderMod->SetFovY( fovY * 180.f / M_PI ); renderMod->SetFovY( fovY * 180.f / M_PI );
hsgResMgr::ResMgr()->AddViaNotify( renderMod->GetKey(), TRACKED_NEW plNodeRefMsg( fConvertedNode, plRefMsg::kOnCreate, -1, plNodeRefMsg::kGeneric ), plRefFlags::kActiveRef ); hsgResMgr::ResMgr()->AddViaNotify( renderMod->GetKey(), new plNodeRefMsg( fConvertedNode, plRefMsg::kOnCreate, -1, plNodeRefMsg::kGeneric ), plRefFlags::kActiveRef );
hsgResMgr::ResMgr()->AddViaNotify( fConvertedNode, TRACKED_NEW plGenRefMsg( renderMod->GetKey(), plRefMsg::kOnCreate, 0, plPostEffectMod::kNodeRef ), plRefFlags::kPassiveRef ); hsgResMgr::ResMgr()->AddViaNotify( fConvertedNode, new plGenRefMsg( renderMod->GetKey(), plRefMsg::kOnCreate, 0, plPostEffectMod::kNodeRef ), plRefFlags::kPassiveRef );
menu->SetRenderMod( renderMod ); menu->SetRenderMod( renderMod );
menu->SetName( fCompPB->GetStr( kRefDialogName ) ); menu->SetName( fCompPB->GetStr( kRefDialogName ) );
// Create the dummy scene object to hold the menu // Create the dummy scene object to hold the menu
plSceneObject *newObj = TRACKED_NEW plSceneObject; plSceneObject *newObj = new plSceneObject;
hsgResMgr::ResMgr()->NewKey( IGetUniqueName(node), newObj, loc ); hsgResMgr::ResMgr()->NewKey( IGetUniqueName(node), newObj, loc );
// *#&$(*@&#$ need a coordIface... // *#&$(*@&#$ need a coordIface...
plCoordinateInterface *newCI = TRACKED_NEW plCoordinateInterface; plCoordinateInterface *newCI = new plCoordinateInterface;
hsgResMgr::ResMgr()->NewKey( IGetUniqueName(node), newCI, loc ); hsgResMgr::ResMgr()->NewKey( IGetUniqueName(node), newCI, loc );
hsgResMgr::ResMgr()->AddViaNotify( menu->GetKey(), TRACKED_NEW plObjRefMsg( newObj->GetKey(), plRefMsg::kOnCreate, -1, plObjRefMsg::kModifier ), plRefFlags::kActiveRef ); hsgResMgr::ResMgr()->AddViaNotify( menu->GetKey(), new plObjRefMsg( newObj->GetKey(), plRefMsg::kOnCreate, -1, plObjRefMsg::kModifier ), plRefFlags::kActiveRef );
hsgResMgr::ResMgr()->AddViaNotify( newCI->GetKey(), TRACKED_NEW plObjRefMsg( newObj->GetKey(), plRefMsg::kOnCreate, -1, plObjRefMsg::kInterface ), plRefFlags::kActiveRef ); hsgResMgr::ResMgr()->AddViaNotify( newCI->GetKey(), new plObjRefMsg( newObj->GetKey(), plRefMsg::kOnCreate, -1, plObjRefMsg::kInterface ), plRefFlags::kActiveRef );
hsgResMgr::ResMgr()->AddViaNotify( renderMod->GetKey(), TRACKED_NEW plObjRefMsg( newObj->GetKey(), plRefMsg::kOnCreate, -1, plObjRefMsg::kModifier ), plRefFlags::kActiveRef ); hsgResMgr::ResMgr()->AddViaNotify( renderMod->GetKey(), new plObjRefMsg( newObj->GetKey(), plRefMsg::kOnCreate, -1, plObjRefMsg::kModifier ), plRefFlags::kActiveRef );
newObj->SetSceneNode( fConvertedNode ); newObj->SetSceneNode( fConvertedNode );
menu->SetSceneNodeKey( fConvertedNode ); menu->SetSceneNodeKey( fConvertedNode );
@ -5056,7 +5056,7 @@ hsBool plGUIMenuComponent::PreConvert(plMaxNode *node, plErrorMsg *pErrMsg)
return false; return false;
} }
fConvertedMenu = TRACKED_NEW pfGUIPopUpMenu(); fConvertedMenu = new pfGUIPopUpMenu();
hsgResMgr::ResMgr()->NewKey( IGetUniqueName(node), fConvertedMenu, fConvertedNode->GetUoid().GetLocation() ); hsgResMgr::ResMgr()->NewKey( IGetUniqueName(node), fConvertedMenu, fConvertedNode->GetUoid().GetLocation() );
return true; return true;

6
Sources/Tools/MaxComponent/plGrassComponent.cpp

@ -236,7 +236,7 @@ plGrassComponent::plGrassComponent() : fShader(nil)
hsBool plGrassComponent::PreConvert(plMaxNode *node, plErrorMsg *pErrMsg) hsBool plGrassComponent::PreConvert(plMaxNode *node, plErrorMsg *pErrMsg)
{ {
fShader = TRACKED_NEW plGrassShaderMod(); fShader = new plGrassShaderMod();
plLoadMask loadMask; plLoadMask loadMask;
int qual = 1; int qual = 1;
@ -263,12 +263,12 @@ hsBool plGrassComponent::PreConvert(plMaxNode *node, plErrorMsg *pErrMsg)
hsBool plGrassComponent::Convert(plMaxNode *node, plErrorMsg *pErrMsg) hsBool plGrassComponent::Convert(plMaxNode *node, plErrorMsg *pErrMsg)
{ {
plObjRefMsg* refMsg = TRACKED_NEW plObjRefMsg(node->GetKey(), plRefMsg::kOnRequest, -1, plObjRefMsg::kModifier); plObjRefMsg* refMsg = new plObjRefMsg(node->GetKey(), plRefMsg::kOnRequest, -1, plObjRefMsg::kModifier);
hsgResMgr::ResMgr()->AddViaNotify(fShader->GetKey(), refMsg, plRefFlags::kActiveRef); hsgResMgr::ResMgr()->AddViaNotify(fShader->GetKey(), refMsg, plRefFlags::kActiveRef);
hsTArray<hsGMaterial*> mats; hsTArray<hsGMaterial*> mats;
hsMaterialConverter::Instance().CollectConvertedMaterials(hsMaterialConverter::Instance().GetBaseMtl(node), mats); hsMaterialConverter::Instance().CollectConvertedMaterials(hsMaterialConverter::Instance().GetBaseMtl(node), mats);
hsgResMgr::ResMgr()->SendRef(mats[0]->GetKey(), TRACKED_NEW plGenRefMsg(fShader->GetKey(), plRefMsg::kOnRequest, 0, plGrassShaderMod::kRefMaterial), plRefFlags::kActiveRef); hsgResMgr::ResMgr()->SendRef(mats[0]->GetKey(), new plGenRefMsg(fShader->GetKey(), plRefMsg::kOnRequest, 0, plGrassShaderMod::kRefMaterial), plRefFlags::kActiveRef);
return TRUE; return TRUE;
} }

4
Sources/Tools/MaxComponent/plIgnoreComponent.cpp

@ -403,14 +403,14 @@ hsBool plNoShowComponent::Convert(plMaxNode *node, plErrorMsg *pErrMsg)
{ {
if( fCompPB->GetInt(kAffectDraw) ) if( fCompPB->GetInt(kAffectDraw) )
{ {
plEnableMsg* eMsg = TRACKED_NEW plEnableMsg(nil, plEnableMsg::kDisable, plEnableMsg::kDrawable); plEnableMsg* eMsg = new plEnableMsg(nil, plEnableMsg::kDisable, plEnableMsg::kDrawable);
eMsg->AddReceiver(obj->GetKey()); eMsg->AddReceiver(obj->GetKey());
eMsg->Send(); eMsg->Send();
} }
if( fCompPB->GetInt(kAffectPhys) ) if( fCompPB->GetInt(kAffectPhys) )
{ {
hsAssert(0, "Who uses this?"); hsAssert(0, "Who uses this?");
// plEventGroupEnableMsg* pMsg = TRACKED_NEW plEventGroupEnableMsg; // plEventGroupEnableMsg* pMsg = new plEventGroupEnableMsg;
// pMsg->SetFlags(plEventGroupEnableMsg::kCollideOff | plEventGroupEnableMsg::kReportOff); // pMsg->SetFlags(plEventGroupEnableMsg::kCollideOff | plEventGroupEnableMsg::kReportOff);
// pMsg->AddReceiver(obj->GetKey()); // pMsg->AddReceiver(obj->GetKey());
// pMsg->Send(); // pMsg->Send();

6
Sources/Tools/MaxComponent/plImpactGadgetComponent.cpp

@ -169,15 +169,15 @@ OBSOLETE_CLASS(plImpactGadget, gImpactGadgetDesc, "Collision Sensor", "Collisio
// physNode = node; // physNode = node;
// //
// // Create remote detector // // Create remote detector
// plCollisionDetector* det = TRACKED_NEW plCollisionDetector; // plCollisionDetector* det = new plCollisionDetector;
// det->SetType(plCollisionDetector::kTypeBump); // det->SetType(plCollisionDetector::kTypeBump);
// //
// // Register the detector // // Register the detector
// plKey detKey = hsgResMgr::ResMgr()->NewKey(IGetUniqueName(node), det, loc); // plKey detKey = hsgResMgr::ResMgr()->NewKey(IGetUniqueName(node), det, loc);
// hsgResMgr::ResMgr()->AddViaNotify(detKey, TRACKED_NEW plObjRefMsg(physNode->GetSceneObject()->GetKey(), plRefMsg::kOnCreate, -1, plObjRefMsg::kModifier), plRefFlags::kActiveRef); // hsgResMgr::ResMgr()->AddViaNotify(detKey, new plObjRefMsg(physNode->GetSceneObject()->GetKey(), plRefMsg::kOnCreate, -1, plObjRefMsg::kModifier), plRefFlags::kActiveRef);
// //
// // create and register the CONDITIONS for the DETECTOR's Logic Modifier // // create and register the CONDITIONS for the DETECTOR's Logic Modifier
// plActivatorConditionalObject* activatorCond = TRACKED_NEW plActivatorConditionalObject; // plActivatorConditionalObject* activatorCond = new plActivatorConditionalObject;
// plKey activatorKey = hsgResMgr::ResMgr()->NewKey(IGetUniqueName(node), activatorCond, loc); // plKey activatorKey = hsgResMgr::ResMgr()->NewKey(IGetUniqueName(node), activatorCond, loc);
// //
// // link everything up: // // link everything up:

4
Sources/Tools/MaxComponent/plInventoryObjComponent.cpp

@ -186,11 +186,11 @@ hsBool plInventoryObjComponent::PreConvert(plMaxNode *node, plErrorMsg *pErrMsg)
plSceneObject *obj = node->GetSceneObject(); plSceneObject *obj = node->GetSceneObject();
// Create and register the ClickDrag's logic component // Create and register the ClickDrag's logic component
plLogicModifier *logic = TRACKED_NEW plLogicModifier; plLogicModifier *logic = new plLogicModifier;
char tmpName[256]; char tmpName[256];
sprintf(tmpName, "%s_%s_LogicModifier", obj->GetKeyName(), GetINode()->GetName()); sprintf(tmpName, "%s_%s_LogicModifier", obj->GetKeyName(), GetINode()->GetName());
plKey logicKey = hsgResMgr::ResMgr()->NewKey(tmpName, logic, node->GetLocation()); plKey logicKey = hsgResMgr::ResMgr()->NewKey(tmpName, logic, node->GetLocation());
hsgResMgr::ResMgr()->AddViaNotify(logicKey, TRACKED_NEW plObjRefMsg(obj->GetKey(), plRefMsg::kOnCreate, -1, plObjRefMsg::kModifier), plRefFlags::kActiveRef); hsgResMgr::ResMgr()->AddViaNotify(logicKey, new plObjRefMsg(obj->GetKey(), plRefMsg::kOnCreate, -1, plObjRefMsg::kModifier), plRefFlags::kActiveRef);
fLogicModKeys[node] = logicKey; fLogicModKeys[node] = logicKey;

4
Sources/Tools/MaxComponent/plLODFadeComponent.cpp

@ -630,7 +630,7 @@ hsBool plLOSFadeComponent::PreConvert(plMaxNode* node, plErrorMsg* pErrMsg)
hsBool plLOSFadeComponent::Convert(plMaxNode* node, plErrorMsg* pErrMsg) hsBool plLOSFadeComponent::Convert(plMaxNode* node, plErrorMsg* pErrMsg)
{ {
plFadeOpacityMod* fade = TRACKED_NEW plFadeOpacityMod; plFadeOpacityMod* fade = new plFadeOpacityMod;
if( fCompPB->GetInt(kBoundsCenter) ) if( fCompPB->GetInt(kBoundsCenter) )
fade->SetFlag(plFadeOpacityMod::kBoundsCenter); fade->SetFlag(plFadeOpacityMod::kBoundsCenter);
@ -724,7 +724,7 @@ hsBool plGZFadeComponent::PreConvert(plMaxNode* node, plErrorMsg* pErrMsg)
hsBool plGZFadeComponent::Convert(plMaxNode* node, plErrorMsg* pErrMsg) hsBool plGZFadeComponent::Convert(plMaxNode* node, plErrorMsg* pErrMsg)
{ {
plDistOpacityMod* fade = TRACKED_NEW plDistOpacityMod; plDistOpacityMod* fade = new plDistOpacityMod;
float opaq = fCompPB->GetFloat(kOpaque); float opaq = fCompPB->GetFloat(kOpaque);
float transp = fCompPB->GetFloat(kTransp); float transp = fCompPB->GetFloat(kTransp);

4
Sources/Tools/MaxComponent/plLightGrpComponent.cpp

@ -171,7 +171,7 @@ hsBool plLightGrpComponent::ISendItOff(plLightInfo* liInfo, plDrawableSpans* dra
if( !fCompPB->GetInt(kTest) ) if( !fCompPB->GetInt(kTest) )
{ {
uint8_t liMsgType = liInfo->GetProjection() ? plDrawable::kMsgPermaProjDI : plDrawable::kMsgPermaLightDI; uint8_t liMsgType = liInfo->GetProjection() ? plDrawable::kMsgPermaProjDI : plDrawable::kMsgPermaLightDI;
plGenRefMsg* refMsg = TRACKED_NEW plGenRefMsg(drawable->GetKey(), plRefMsg::kOnCreate, diIndex, liMsgType); plGenRefMsg* refMsg = new plGenRefMsg(drawable->GetKey(), plRefMsg::kOnCreate, diIndex, liMsgType);
hsgResMgr::ResMgr()->AddViaNotify(liInfo->GetKey(), refMsg, plRefFlags::kPassiveRef); hsgResMgr::ResMgr()->AddViaNotify(liInfo->GetKey(), refMsg, plRefFlags::kPassiveRef);
} }
else else
@ -186,7 +186,7 @@ hsBool plLightGrpComponent::ISendItOff(plLightInfo* liInfo, plDrawableSpans* dra
{ {
if( litSpans.IsBitSet(spans[i]) ) if( litSpans.IsBitSet(spans[i]) )
{ {
plGenRefMsg* refMsg = TRACKED_NEW plGenRefMsg(drawable->GetKey(), plRefMsg::kOnCreate, spans[i], liMsgType); plGenRefMsg* refMsg = new plGenRefMsg(drawable->GetKey(), plRefMsg::kOnCreate, spans[i], liMsgType);
hsgResMgr::ResMgr()->AddViaNotify(liInfo->GetKey(), refMsg, plRefFlags::kPassiveRef); hsgResMgr::ResMgr()->AddViaNotify(liInfo->GetKey(), refMsg, plRefFlags::kPassiveRef);
} }
} }

12
Sources/Tools/MaxComponent/plLineFollowComp.cpp

@ -276,7 +276,7 @@ hsBool plLineFollowComponent::IMakeLineMod(plMaxNode* pNode, plErrorMsg* pErrMsg
{ {
plLineFollowMod::FollowMode mode = plLineFollowMod::FollowMode(fCompPB->GetInt(kFollowModeRadio)); plLineFollowMod::FollowMode mode = plLineFollowMod::FollowMode(fCompPB->GetInt(kFollowModeRadio));
plLineFollowMod* lineMod = TRACKED_NEW plLineFollowMod; plLineFollowMod* lineMod = new plLineFollowMod;
hsgResMgr::ResMgr()->NewKey(IGetUniqueName(pNode), lineMod, pNode->GetLocation()); hsgResMgr::ResMgr()->NewKey(IGetUniqueName(pNode), lineMod, pNode->GetLocation());
if( plLineFollowMod::kFollowObject == mode ) if( plLineFollowMod::kFollowObject == mode )
@ -292,7 +292,7 @@ hsBool plLineFollowComponent::IMakeLineMod(plMaxNode* pNode, plErrorMsg* pErrMsg
plSceneObject* targObj = targNode->GetSceneObject(); plSceneObject* targObj = targNode->GetSceneObject();
if( targObj ) if( targObj )
{ {
plGenRefMsg* refMsg = TRACKED_NEW plGenRefMsg(lineMod->GetKey(), plRefMsg::kOnCreate, 0, plLineFollowMod::kRefObject); plGenRefMsg* refMsg = new plGenRefMsg(lineMod->GetKey(), plRefMsg::kOnCreate, 0, plLineFollowMod::kRefObject);
hsgResMgr::ResMgr()->AddViaNotify(targObj->GetKey(), refMsg, plRefFlags::kPassiveRef); hsgResMgr::ResMgr()->AddViaNotify(targObj->GetKey(), refMsg, plRefFlags::kPassiveRef);
lineMod->SetFollowMode(plLineFollowMod::kFollowObject); lineMod->SetFollowMode(plLineFollowMod::kFollowObject);
@ -328,7 +328,7 @@ hsBool plLineFollowComponent::IMakeLineMod(plMaxNode* pNode, plErrorMsg* pErrMsg
hsAffineParts initParts; hsAffineParts initParts;
AP_SET(initParts, ap); AP_SET(initParts, ap);
plAnimPath* animPath = TRACKED_NEW plAnimPath; plAnimPath* animPath = new plAnimPath;
animPath->SetController(tmc); animPath->SetController(tmc);
animPath->InitParts(initParts); animPath->InitParts(initParts);
@ -340,7 +340,7 @@ hsBool plLineFollowComponent::IMakeLineMod(plMaxNode* pNode, plErrorMsg* pErrMsg
plSceneObject* parObj = parNode->GetSceneObject(); plSceneObject* parObj = parNode->GetSceneObject();
if( parObj ) if( parObj )
{ {
plGenRefMsg* refMsg = TRACKED_NEW plGenRefMsg(lineMod->GetKey(), plRefMsg::kOnCreate, 0, plLineFollowMod::kRefParent); plGenRefMsg* refMsg = new plGenRefMsg(lineMod->GetKey(), plRefMsg::kOnCreate, 0, plLineFollowMod::kRefParent);
hsgResMgr::ResMgr()->AddViaNotify(parObj->GetKey(), refMsg, plRefFlags::kPassiveRef); hsgResMgr::ResMgr()->AddViaNotify(parObj->GetKey(), refMsg, plRefFlags::kPassiveRef);
} }
} }
@ -583,7 +583,7 @@ hsBool plStereizeComp::Bail(plMaxNode* node, const char* msg, plErrorMsg* pErrMs
hsBool plStereizeComp::Convert(plMaxNode* node, plErrorMsg* pErrMsg) hsBool plStereizeComp::Convert(plMaxNode* node, plErrorMsg* pErrMsg)
{ {
plStereizer* stereo = TRACKED_NEW plStereizer; plStereizer* stereo = new plStereizer;
stereo->SetAmbientDist(fCompPB->GetFloat(kAmbientDist)); stereo->SetAmbientDist(fCompPB->GetFloat(kAmbientDist));
stereo->SetTransition(fCompPB->GetFloat(kTransition)); stereo->SetTransition(fCompPB->GetFloat(kTransition));
@ -805,7 +805,7 @@ hsBool plSwivelComp::Bail(plMaxNode* node, const char* msg, plErrorMsg* pErrMsg)
hsBool plSwivelComp::Convert(plMaxNode* node, plErrorMsg* pErrMsg) hsBool plSwivelComp::Convert(plMaxNode* node, plErrorMsg* pErrMsg)
{ {
plViewFaceModifier* pMod = TRACKED_NEW plViewFaceModifier; plViewFaceModifier* pMod = new plViewFaceModifier;
pMod->SetOrigTransform(node->GetLocalToParent44(), node->GetParentToLocal44()); pMod->SetOrigTransform(node->GetLocalToParent44(), node->GetParentToLocal44());
node->AddModifier(pMod, IGetUniqueName(node)); node->AddModifier(pMod, IGetUniqueName(node));

16
Sources/Tools/MaxComponent/plMaxAnimUtils.cpp

@ -304,33 +304,33 @@ void GetSegment(const char *note, float time, SegmentMap *segMap, plErrorMsg *pE
} }
else else
{ {
char *nameCopy = TRACKED_NEW char[strlen(segName)+1]; char *nameCopy = new char[strlen(segName)+1];
strcpy(nameCopy, segName); strcpy(nameCopy, segName);
switch (type) switch (type)
{ {
case kNoteStartAnim: case kNoteStartAnim:
(*segMap)[nameCopy] = TRACKED_NEW SegmentSpec(time, -1, nameCopy, SegmentSpec::kAnim); (*segMap)[nameCopy] = new SegmentSpec(time, -1, nameCopy, SegmentSpec::kAnim);
break; break;
case kNoteStartLoop: case kNoteStartLoop:
(*segMap)[nameCopy] = TRACKED_NEW SegmentSpec(time, -1, nameCopy, SegmentSpec::kLoop); (*segMap)[nameCopy] = new SegmentSpec(time, -1, nameCopy, SegmentSpec::kLoop);
break; break;
case kNoteEndLoop: case kNoteEndLoop:
(*segMap)[nameCopy] = TRACKED_NEW SegmentSpec(-1, time, nameCopy, SegmentSpec::kLoop); (*segMap)[nameCopy] = new SegmentSpec(-1, time, nameCopy, SegmentSpec::kLoop);
break; break;
case kNoteMarker: case kNoteMarker:
(*segMap)[nameCopy] = TRACKED_NEW SegmentSpec(time, -1, nameCopy, SegmentSpec::kMarker); (*segMap)[nameCopy] = new SegmentSpec(time, -1, nameCopy, SegmentSpec::kMarker);
break; break;
case kNoteStopPoint: case kNoteStopPoint:
(*segMap)[nameCopy] = TRACKED_NEW SegmentSpec(time, -1, nameCopy, SegmentSpec::kStopPoint); (*segMap)[nameCopy] = new SegmentSpec(time, -1, nameCopy, SegmentSpec::kStopPoint);
break; break;
case kNoteSuppress: case kNoteSuppress:
(*segMap)[nameCopy] = TRACKED_NEW SegmentSpec(-1, -1, nameCopy, SegmentSpec::kSuppress); (*segMap)[nameCopy] = new SegmentSpec(-1, -1, nameCopy, SegmentSpec::kSuppress);
break; break;
default: default:
@ -351,7 +351,7 @@ SegmentMap * GetAnimSegmentMap(Animatable *anim, plErrorMsg *pErrMsg)
if (!anim->HasNoteTracks()) if (!anim->HasNoteTracks())
return nil; return nil;
SegmentMap *segMap = TRACKED_NEW SegmentMap(); SegmentMap *segMap = new SegmentMap();
int numTracks = anim->NumNoteTracks(); int numTracks = anim->NumNoteTracks();

2
Sources/Tools/MaxComponent/plMaxWaveUtils.cpp

@ -52,7 +52,7 @@ SegmentMap *GetWaveSegmentMap(const char *file, plErrorMsg *pErrMsg)
if (numMarkers == 0) if (numMarkers == 0)
return nil; return nil;
SegmentMap *segMap = TRACKED_NEW SegmentMap(); SegmentMap *segMap = new SegmentMap();
for (int i = 0; i < waveFile.GetNumMarkers(); i++) for (int i = 0; i < waveFile.GetNumMarkers(); i++)
{ {

22
Sources/Tools/MaxComponent/plMiscComponents.cpp

@ -174,7 +174,7 @@ plInterestingComponent::plInterestingComponent()
hsBool plInterestingComponent::Convert(plMaxNode *node, plErrorMsg *pErrMsg) hsBool plInterestingComponent::Convert(plMaxNode *node, plErrorMsg *pErrMsg)
{ {
plInterestingModifier* pMod = TRACKED_NEW plInterestingModifier; plInterestingModifier* pMod = new plInterestingModifier;
float loader = fCompPB->GetFloat(kCamInterestRadius); float loader = fCompPB->GetFloat(kCamInterestRadius);
pMod->SetInterestRadius(loader); pMod->SetInterestRadius(loader);
@ -806,7 +806,7 @@ plAgeDescription *plPageInfoUtils::GetAgeDesc( const char *ageName )
return nil; return nil;
// Create and read the age desc // Create and read the age desc
plAgeDescription *aged = TRACKED_NEW plAgeDescription; plAgeDescription *aged = new plAgeDescription;
aged->Read( &s ); aged->Read( &s );
s.Close(); s.Close();
@ -1109,7 +1109,7 @@ static hsBool FindMaxBounds(plMaxNode* node, hsBounds3Ext& bnd)
hsBool plViewFacingComponent::Convert(plMaxNode *node, plErrorMsg *pErrMsg) hsBool plViewFacingComponent::Convert(plMaxNode *node, plErrorMsg *pErrMsg)
{ {
plViewFaceModifier* pMod = TRACKED_NEW plViewFaceModifier; plViewFaceModifier* pMod = new plViewFaceModifier;
hsBounds3Ext maxBnd; hsBounds3Ext maxBnd;
if( FindMaxBounds(node, maxBnd) ) if( FindMaxBounds(node, maxBnd) )
@ -1201,7 +1201,7 @@ plSpriteComponent::plSpriteComponent()
hsBool plSpriteComponent::Convert(plMaxNode *node, plErrorMsg *pErrMsg) hsBool plSpriteComponent::Convert(plMaxNode *node, plErrorMsg *pErrMsg)
{ {
plViewFaceModifier* pMod = TRACKED_NEW plViewFaceModifier; plViewFaceModifier* pMod = new plViewFaceModifier;
hsBounds3Ext maxBnd; hsBounds3Ext maxBnd;
if( FindMaxBounds(node, maxBnd) ) if( FindMaxBounds(node, maxBnd) )
@ -1385,7 +1385,7 @@ hsBool plCamViewComponent::Convert(plMaxNode *node, plErrorMsg *pErrMsg)
return false; return false;
} }
plPostEffectMod* mod = TRACKED_NEW plPostEffectMod; plPostEffectMod* mod = new plPostEffectMod;
float hither = cam->GetEnvRange(timeVal, ENV_NEAR_RANGE); float hither = cam->GetEnvRange(timeVal, ENV_NEAR_RANGE);
if( hither < 0.5f ) if( hither < 0.5f )
@ -1635,7 +1635,7 @@ plFollowMod* plFollowComponent::IMakeFollowMod(plMaxNode* pNode, plErrorMsg* pEr
{ {
plFollowMod::FollowLeaderType lType = plFollowMod::FollowLeaderType(fCompPB->GetInt(kLeaderTypeRadio)); plFollowMod::FollowLeaderType lType = plFollowMod::FollowLeaderType(fCompPB->GetInt(kLeaderTypeRadio));
plFollowMod* follow = TRACKED_NEW plFollowMod; plFollowMod* follow = new plFollowMod;
hsgResMgr::ResMgr()->NewKey(IGetUniqueName(pNode), follow, pNode->GetLocation()); hsgResMgr::ResMgr()->NewKey(IGetUniqueName(pNode), follow, pNode->GetLocation());
@ -1650,7 +1650,7 @@ plFollowMod* plFollowComponent::IMakeFollowMod(plMaxNode* pNode, plErrorMsg* pEr
plSceneObject* targObj = targNode->GetSceneObject(); plSceneObject* targObj = targNode->GetSceneObject();
if( targObj ) if( targObj )
{ {
plGenRefMsg* refMsg = TRACKED_NEW plGenRefMsg(follow->GetKey(), plRefMsg::kOnCreate, 0, plFollowMod::kRefLeader); plGenRefMsg* refMsg = new plGenRefMsg(follow->GetKey(), plRefMsg::kOnCreate, 0, plFollowMod::kRefLeader);
hsgResMgr::ResMgr()->AddViaNotify(targObj->GetKey(), refMsg, plRefFlags::kPassiveRef); hsgResMgr::ResMgr()->AddViaNotify(targObj->GetKey(), refMsg, plRefFlags::kPassiveRef);
follow->SetType(plFollowMod::kObject); follow->SetType(plFollowMod::kObject);
@ -2398,7 +2398,7 @@ public:
case WM_COMMAND: case WM_COMMAND:
if( LOWORD( wParam ) == IDC_IMAGE_ADD ) if( LOWORD( wParam ) == IDC_IMAGE_ADD )
{ {
plLayerTex *newLayer = TRACKED_NEW plLayerTex; plLayerTex *newLayer = new plLayerTex;
if( newLayer->HandleBitmapSelection() ) if( newLayer->HandleBitmapSelection() )
{ {
@ -2497,7 +2497,7 @@ plLayerTex *pfImageLibComponent::GetBitmap( int idx )
plLayerTex *layer = (plLayerTex *)fCompPB->GetTexmap( (ParamID)kRefImageList, 0, idx ); plLayerTex *layer = (plLayerTex *)fCompPB->GetTexmap( (ParamID)kRefImageList, 0, idx );
if( layer == nil || layer->ClassID() != LAYER_TEX_CLASS_ID ) if( layer == nil || layer->ClassID() != LAYER_TEX_CLASS_ID )
{ {
layer = TRACKED_NEW plLayerTex; layer = new plLayerTex;
fCompPB->SetValue( (ParamID)kRefImageList, 0, (Texmap *)layer, idx ); fCompPB->SetValue( (ParamID)kRefImageList, 0, (Texmap *)layer, idx );
} }
@ -2539,7 +2539,7 @@ hsBool pfImageLibComponent::SetupProperties(plMaxNode *pNode, plErrorMsg *pErrM
hsBool pfImageLibComponent::Convert(plMaxNode *node, plErrorMsg *pErrMsg) hsBool pfImageLibComponent::Convert(plMaxNode *node, plErrorMsg *pErrMsg)
{ {
plImageLibMod *lib = TRACKED_NEW plImageLibMod; plImageLibMod *lib = new plImageLibMod;
node->AddModifier( lib, IGetUniqueName(node) ); node->AddModifier( lib, IGetUniqueName(node) );
int i; int i;
@ -2563,7 +2563,7 @@ hsBool pfImageLibComponent::Convert(plMaxNode *node, plErrorMsg *pErrMsg)
bMap = plLayerConverter::Instance().CreateSimpleTexture( texture->bi.Name(), lib->GetKey()->GetUoid().GetLocation(), 0, flags, true ); bMap = plLayerConverter::Instance().CreateSimpleTexture( texture->bi.Name(), lib->GetKey()->GetUoid().GetLocation(), 0, flags, true );
if( bMap != nil ) if( bMap != nil )
{ {
hsgResMgr::ResMgr()->AddViaNotify( bMap->GetKey(), TRACKED_NEW plGenRefMsg( lib->GetKey(), hsgResMgr::ResMgr()->AddViaNotify( bMap->GetKey(), new plGenRefMsg( lib->GetKey(),
plRefMsg::kOnCreate, lib->GetNumImages(), plImageLibMod::kRefImage ), plRefFlags::kActiveRef ); plRefMsg::kOnCreate, lib->GetNumImages(), plImageLibMod::kRefImage ), plRefFlags::kActiveRef );
} }
} }

6
Sources/Tools/MaxComponent/plMorphSeqComp.cpp

@ -304,7 +304,7 @@ hsBool plMorphSeqComp::Convert(plMaxNode* node, plErrorMsg* pErrMsg)
plMorphSequence* morphSeq = const_cast<plMorphSequence *>(plMorphSequence::ConvertNoRef(node->GetSceneObject()->GetModifierByType(plMorphSequence::Index()))); plMorphSequence* morphSeq = const_cast<plMorphSequence *>(plMorphSequence::ConvertNoRef(node->GetSceneObject()->GetModifierByType(plMorphSequence::Index())));
if (!morphSeq) if (!morphSeq)
{ {
morphSeq = TRACKED_NEW plMorphSequence; morphSeq = new plMorphSequence;
node->AddModifier(morphSeq, IGetUniqueName(node)); node->AddModifier(morphSeq, IGetUniqueName(node));
} }
@ -316,9 +316,9 @@ hsBool plMorphSeqComp::Convert(plMaxNode* node, plErrorMsg* pErrMsg)
// Error check we have some base geometry. // Error check we have some base geometry.
plMorphDataSet *set = TRACKED_NEW plMorphDataSet; plMorphDataSet *set = new plMorphDataSet;
hsgResMgr::ResMgr()->NewKey(IGetUniqueName(node), set, node->GetLocation()); hsgResMgr::ResMgr()->NewKey(IGetUniqueName(node), set, node->GetLocation());
hsgResMgr::ResMgr()->AddViaNotify(set->GetKey(), TRACKED_NEW plGenRefMsg(mesh->GetKey(), plRefMsg::kOnCreate, -1, -1), plRefFlags::kActiveRef); hsgResMgr::ResMgr()->AddViaNotify(set->GetKey(), new plGenRefMsg(mesh->GetKey(), plRefMsg::kOnCreate, -1, -1), plRefFlags::kActiveRef);
const int num = fCompPB->Count(kLayers); const int num = fCompPB->Count(kLayers);
int i; int i;

8
Sources/Tools/MaxComponent/plMultistageBehComponent.cpp

@ -189,7 +189,7 @@ void plMultistageBehComponent::IGetReceivers(plMaxNode* node, std::vector<plKey>
hsBool plMultistageBehComponent::PreConvert(plMaxNode *node, plErrorMsg *pErrMsg) hsBool plMultistageBehComponent::PreConvert(plMaxNode *node, plErrorMsg *pErrMsg)
{ {
//create the modifier here so that other components can find it //create the modifier here so that other components can find it
plMultistageBehMod *mod = TRACKED_NEW plMultistageBehMod; plMultistageBehMod *mod = new plMultistageBehMod;
hsgResMgr::ResMgr()->NewKey(IGetUniqueName(node), mod, node->GetLocation()); hsgResMgr::ResMgr()->NewKey(IGetUniqueName(node), mod, node->GetLocation());
fMods[node] = mod; fMods[node] = mod;
@ -199,7 +199,7 @@ hsBool plMultistageBehComponent::PreConvert(plMaxNode *node, plErrorMsg *pErrMsg
hsBool plMultistageBehComponent::Convert(plMaxNode *node, plErrorMsg *pErrMsg) hsBool plMultistageBehComponent::Convert(plMaxNode *node, plErrorMsg *pErrMsg)
{ {
// Create the stage vector // Create the stage vector
plAnimStageVec* animStages = TRACKED_NEW plAnimStageVec; plAnimStageVec* animStages = new plAnimStageVec;
int numStages = fStages.size(); int numStages = fStages.size();
animStages->reserve(numStages); animStages->reserve(numStages);
@ -349,7 +349,7 @@ BOOL plMultistageBehComponent::IDlgProc(HWND hDlg, UINT msg, WPARAM wParam, LPAR
if (LOWORD(wParam) == IDC_ADD) if (LOWORD(wParam) == IDC_ADD)
{ {
// Create the new stage and give it a default name. // Create the new stage and give it a default name.
plBaseStage* stage = TRACKED_NEW plStandardStage; plBaseStage* stage = new plStandardStage;
int count = fStages.size(); int count = fStages.size();
fStages.push_back(stage); fStages.push_back(stage);
char buf[64]; char buf[64];
@ -571,7 +571,7 @@ IOResult plMultistageBehComponent::Load(ILoad* iload)
break; break;
case kStandard: case kStandard:
stage = TRACKED_NEW plStandardStage; stage = new plStandardStage;
break; break;
} }

6
Sources/Tools/MaxComponent/plMultistageStage.cpp

@ -64,7 +64,7 @@ char* MyReadSafeString(hsStream* s)
hsAssert(numChars <= s->GetSizeLeft(), "Bad string"); hsAssert(numChars <= s->GetSizeLeft(), "Bad string");
if (numChars > 0) if (numChars > 0)
{ {
name = TRACKED_NEW char[numChars+1]; name = new char[numChars+1];
s->Read(numChars, name); s->Read(numChars, name);
name[numChars] = '\0'; name[numChars] = '\0';
} }
@ -456,7 +456,7 @@ void plStandardStage::IInitDlg()
plAnimStage* plStandardStage::CreateStage() plAnimStage* plStandardStage::CreateStage()
{ {
int loopCount = fLoopForever ? -1 : fNumLoops; int loopCount = fLoopForever ? -1 : fNumLoops;
plAnimStage* stage = TRACKED_NEW plAnimStage(fAnimName, plAnimStage* stage = new plAnimStage(fAnimName,
fNotify, fNotify,
(plAnimStage::ForwardType)fForward, (plAnimStage::ForwardType)fForward,
(plAnimStage::BackType)fBackward, (plAnimStage::BackType)fBackward,
@ -473,7 +473,7 @@ plAnimStage* plStandardStage::CreateStage()
plBaseStage* plStandardStage::Clone() plBaseStage* plStandardStage::Clone()
{ {
plStandardStage* clone = TRACKED_NEW plStandardStage; plStandardStage* clone = new plStandardStage;
clone->fAnimName = hsStrcpy(fAnimName); clone->fAnimName = hsStrcpy(fAnimName);
clone->fNumLoops = fNumLoops; clone->fNumLoops = fNumLoops;
clone->fLoopForever = fLoopForever; clone->fLoopForever = fLoopForever;

4
Sources/Tools/MaxComponent/plNPCSpawnComp.cpp

@ -186,7 +186,7 @@ hsBool plNPCSpawnComp::PreConvert(plMaxNode *node, plErrorMsg *pErrMsg)
const char *accountName = fCompPB->GetStr(kAccountName); const char *accountName = fCompPB->GetStr(kAccountName);
bool autoSpawn = fCompPB->GetInt(kAutoSpawn) ? true : false; bool autoSpawn = fCompPB->GetInt(kAutoSpawn) ? true : false;
plNPCSpawnMod *mod = TRACKED_NEW plNPCSpawnMod(modelName, accountName, autoSpawn); plNPCSpawnMod *mod = new plNPCSpawnMod(modelName, accountName, autoSpawn);
fMods[node] = mod; fMods[node] = mod;
// this is used by the python file modifier to figure out which component we're coming from // this is used by the python file modifier to figure out which component we're coming from
@ -210,7 +210,7 @@ hsBool plNPCSpawnComp::Convert(plMaxNode* node, plErrorMsg *pErrMsg)
// let's make a notification message that we'll use to notify interested parties // let's make a notification message that we'll use to notify interested parties
// when we actually do our spawn. // when we actually do our spawn.
plNotifyMsg *notify = TRACKED_NEW plNotifyMsg(); plNotifyMsg *notify = new plNotifyMsg();
hsTArray<plKey> receivers; hsTArray<plKey> receivers;
IGetReceivers(node, receivers); IGetReceivers(node, receivers);
notify->SetSender(mod->GetKey()); notify->SetSender(mod->GetKey());

2
Sources/Tools/MaxComponent/plNavigableComponents.cpp

@ -272,7 +272,7 @@ hsBool plAvLadderComponent::PreConvert(plMaxNode *node, plErrorMsg *pErrMsg)
int ladderType = fCompPB->GetInt(kTypeCombo); int ladderType = fCompPB->GetInt(kTypeCombo);
bool enabled = (fCompPB->GetInt(kEnabled) != 0); bool enabled = (fCompPB->GetInt(kEnabled) != 0);
plAvLadderMod* ladMod = TRACKED_NEW plAvLadderMod(goingUp, ladderType, loops, enabled, ladderView); plAvLadderMod* ladMod = new plAvLadderMod(goingUp, ladderType, loops, enabled, ladderView);
plKey modKey = node->AddModifier(ladMod, IGetUniqueName(node)); plKey modKey = node->AddModifier(ladMod, IGetUniqueName(node));
fKeys.Append(modKey); fKeys.Append(modKey);

2
Sources/Tools/MaxComponent/plObjectFlockerComponent.cpp

@ -229,7 +229,7 @@ hsBool plObjectFlockerComponent::PreConvert(plMaxNode *node, plErrorMsg *pErrMsg
if (fFlocker) if (fFlocker)
delete fFlocker; delete fFlocker;
fFlocker = TRACKED_NEW pfObjectFlocker; fFlocker = new pfObjectFlocker;
hsgResMgr::ResMgr()->NewKey( IGetUniqueName(node), fFlocker, node->GetLocation(), node->GetLoadMask()); hsgResMgr::ResMgr()->NewKey( IGetUniqueName(node), fFlocker, node->GetLocation(), node->GetLoadMask());
fFlocker->SetGoalWeight(fCompPB->GetFloat(ParamID(kGoalStrength))); fFlocker->SetGoalWeight(fCompPB->GetFloat(ParamID(kGoalStrength)));

2
Sources/Tools/MaxComponent/plOneShotComponent.cpp

@ -240,7 +240,7 @@ hsBool plOneShotComponent::PreConvert(plMaxNode *node, plErrorMsg *pErrMsg)
{ {
if (IsValid()) if (IsValid())
{ {
plOneShotMod *mod = TRACKED_NEW plOneShotMod; plOneShotMod *mod = new plOneShotMod;
hsgResMgr::ResMgr()->NewKey(IGetUniqueName(node), mod, node->GetLocation()); hsgResMgr::ResMgr()->NewKey(IGetUniqueName(node), mod, node->GetLocation());
fMods[node] = mod; fMods[node] = mod;
} }

88
Sources/Tools/MaxComponent/plParticleComponents.cpp

@ -152,9 +152,9 @@ hsBool plParticleCoreComponent::PreConvert(plMaxNode *pNode, plErrorMsg *pErrMsg
// Moving this from Convert so the DrawInterface will appear sooner. Other components expect // Moving this from Convert so the DrawInterface will appear sooner. Other components expect
// the interfaces to be fully set up by the Convert pass. // the interfaces to be fully set up by the Convert pass.
plSceneNode *sNode = plSceneNode::ConvertNoRef( pNode->GetRoomKey()->GetObjectPtr() ); plSceneNode *sNode = plSceneNode::ConvertNoRef( pNode->GetRoomKey()->GetObjectPtr() );
plDrawInterface *di = TRACKED_NEW plDrawInterface; plDrawInterface *di = new plDrawInterface;
hsgResMgr::ResMgr()->NewKey(IGetUniqueName(pNode), di, pNode->GetLocation(), pNode->GetLoadMask()); hsgResMgr::ResMgr()->NewKey(IGetUniqueName(pNode), di, pNode->GetLocation(), pNode->GetLoadMask());
hsgResMgr::ResMgr()->AddViaNotify( di->GetKey(), TRACKED_NEW plObjRefMsg(pNode->GetSceneObject()->GetKey(), plRefMsg::kOnCreate, 0, plObjRefMsg::kInterface ), plRefFlags::kActiveRef ); hsgResMgr::ResMgr()->AddViaNotify( di->GetKey(), new plObjRefMsg(pNode->GetSceneObject()->GetKey(), plRefMsg::kOnCreate, 0, plObjRefMsg::kInterface ), plRefFlags::kActiveRef );
pNode->SetDISceneNodeSpans(di, true); pNode->SetDISceneNodeSpans(di, true);
return true; return true;
@ -168,7 +168,7 @@ hsBool plParticleCoreComponent::Convert(plMaxNode *node, plErrorMsg *pErrMsg)
const char *objName = node->GetKey()->GetName(); const char *objName = node->GetKey()->GetName();
plSceneObject *sObj = node->GetSceneObject(); plSceneObject *sObj = node->GetSceneObject();
plParticleSystem *sys = TRACKED_NEW plParticleSystem(); plParticleSystem *sys = new plParticleSystem();
hsgResMgr::ResMgr()->NewKey(IGetUniqueName(node), sys, nodeLoc, node->GetLoadMask()); hsgResMgr::ResMgr()->NewKey(IGetUniqueName(node), sys, nodeLoc, node->GetLoadMask());
@ -231,7 +231,7 @@ hsBool plParticleCoreComponent::Convert(plMaxNode *node, plErrorMsg *pErrMsg)
float avgLife = (partLifeMax + partLifeMin) / 2; float avgLife = (partLifeMax + partLifeMin) / 2;
uint32_t count = node->NumAttachedComponents(); uint32_t count = node->NumAttachedComponents();
uint32_t lifeTicks = avgLife / frameDelta; uint32_t lifeTicks = avgLife / frameDelta;
float *birth = TRACKED_NEW float[lifeTicks]; float *birth = new float[lifeTicks];
// Find any anim components attached to the same node. // Find any anim components attached to the same node.
for (i = 0; i < count; i++) for (i = 0; i < count; i++)
@ -358,13 +358,13 @@ hsBool plParticleCoreComponent::Convert(plMaxNode *node, plErrorMsg *pErrMsg)
if (fUserInput.fGenType == kGenPoint) if (fUserInput.fGenType == kGenPoint)
{ {
sources = 1; sources = 1;
pitchArray = TRACKED_NEW float[sources]; pitchArray = new float[sources];
yawArray = TRACKED_NEW float[sources]; yawArray = new float[sources];
pointArray = TRACKED_NEW hsPoint3[sources]; pointArray = new hsPoint3[sources];
pitchArray[0] = pitch; pitchArray[0] = pitch;
yawArray[0] = yaw; yawArray[0] = yaw;
pointArray[0].Set(0, 0, 0); pointArray[0].Set(0, 0, 0);
plSimpleParticleGenerator *gen = TRACKED_NEW plSimpleParticleGenerator(); plSimpleParticleGenerator *gen = new plSimpleParticleGenerator();
gen->Init(genLife, partLifeMin, partLifeMax, pps, sources, pointArray, pitchArray, yawArray, angleRange, gen->Init(genLife, partLifeMin, partLifeMax, pps, sources, pointArray, pitchArray, yawArray, angleRange,
velMin, velMax, xSize, ySize, scaleMin, scaleMax, massRange, rotRange); velMin, velMax, xSize, ySize, scaleMin, scaleMax, massRange, rotRange);
generator = gen; generator = gen;
@ -375,16 +375,16 @@ hsBool plParticleCoreComponent::Convert(plMaxNode *node, plErrorMsg *pErrMsg)
hsTArray<hsPoint3> pos; hsTArray<hsPoint3> pos;
plMeshConverter::Instance().StuffPositionsAndNormals(node, &pos, &normals); plMeshConverter::Instance().StuffPositionsAndNormals(node, &pos, &normals);
sources = normals.GetCount(); sources = normals.GetCount();
pitchArray = TRACKED_NEW float[sources]; pitchArray = new float[sources];
yawArray = TRACKED_NEW float[sources]; yawArray = new float[sources];
pointArray = TRACKED_NEW hsPoint3[sources]; pointArray = new hsPoint3[sources];
int i; int i;
for (i = 0; i < sources; i++) for (i = 0; i < sources; i++)
{ {
plParticleGenerator::ComputePitchYaw(pitchArray[i], yawArray[i], normals.Get(i)); plParticleGenerator::ComputePitchYaw(pitchArray[i], yawArray[i], normals.Get(i));
pointArray[i] = pos.Get(i); pointArray[i] = pos.Get(i);
} }
plSimpleParticleGenerator *gen = TRACKED_NEW plSimpleParticleGenerator(); plSimpleParticleGenerator *gen = new plSimpleParticleGenerator();
gen->Init(genLife, partLifeMin, partLifeMax, pps, sources, pointArray, pitchArray, yawArray, angleRange, gen->Init(genLife, partLifeMin, partLifeMax, pps, sources, pointArray, pitchArray, yawArray, angleRange,
velMin, velMax, xSize, ySize, scaleMin, scaleMax, massRange, rotRange); velMin, velMax, xSize, ySize, scaleMin, scaleMax, massRange, rotRange);
generator = gen; generator = gen;
@ -396,8 +396,8 @@ hsBool plParticleCoreComponent::Convert(plMaxNode *node, plErrorMsg *pErrMsg)
plMeshConverter::Instance().StuffPositionsAndNormals(node, &pos, &normals); plMeshConverter::Instance().StuffPositionsAndNormals(node, &pos, &normals);
sources = normals.GetCount(); sources = normals.GetCount();
pointArray = TRACKED_NEW hsPoint3[sources]; pointArray = new hsPoint3[sources];
dirArray = TRACKED_NEW hsVector3[sources]; dirArray = new hsVector3[sources];
int i; int i;
for (i = 0; i < sources; i++) for (i = 0; i < sources; i++)
{ {
@ -405,7 +405,7 @@ hsBool plParticleCoreComponent::Convert(plMaxNode *node, plErrorMsg *pErrMsg)
pointArray[i] = pos.Get(i); pointArray[i] = pos.Get(i);
} }
plOneTimeParticleGenerator *gen = TRACKED_NEW plOneTimeParticleGenerator(); plOneTimeParticleGenerator *gen = new plOneTimeParticleGenerator();
gen->Init(sources, pointArray, dirArray, xSize, ySize, scaleMin, scaleMax, rotRange); gen->Init(sources, pointArray, dirArray, xSize, ySize, scaleMin, scaleMax, rotRange);
generator = gen; generator = gen;
maxTotalParticles = sources; maxTotalParticles = sources;
@ -415,8 +415,8 @@ hsBool plParticleCoreComponent::Convert(plMaxNode *node, plErrorMsg *pErrMsg)
// Init and attach to the scene object // Init and attach to the scene object
sys->Init(xTiles, yTiles, maxTotalParticles, maxEmitters, ambientCtl, diffuseCtl, opacityCtl, sys->Init(xTiles, yTiles, maxTotalParticles, maxEmitters, ambientCtl, diffuseCtl, opacityCtl,
widthCtl, heightCtl); widthCtl, heightCtl);
hsgResMgr::ResMgr()->AddViaNotify( particleMat->GetKey(), TRACKED_NEW plGenRefMsg( sys->GetKey(), plRefMsg::kOnCreate, 0, 0 ), plRefFlags::kActiveRef ); hsgResMgr::ResMgr()->AddViaNotify( particleMat->GetKey(), new plGenRefMsg( sys->GetKey(), plRefMsg::kOnCreate, 0, 0 ), plRefFlags::kActiveRef );
hsgResMgr::ResMgr()->AddViaNotify( sys->GetKey(), TRACKED_NEW plObjRefMsg( sObj->GetKey(), plRefMsg::kOnCreate, -1, plObjRefMsg::kModifier ), plRefFlags::kActiveRef ); hsgResMgr::ResMgr()->AddViaNotify( sys->GetKey(), new plObjRefMsg( sObj->GetKey(), plRefMsg::kOnCreate, -1, plObjRefMsg::kModifier ), plRefFlags::kActiveRef );
// Set up normals and orientation // Set up normals and orientation
uint32_t miscFlags = 0; uint32_t miscFlags = 0;
@ -493,9 +493,9 @@ hsBool plParticleCoreComponent::Convert(plMaxNode *node, plErrorMsg *pErrMsg)
if (fCompPB->GetInt(ParamID(kFollowSystem))) if (fCompPB->GetInt(ParamID(kFollowSystem)))
{ {
plParticleFollowSystemEffect *effect = TRACKED_NEW plParticleFollowSystemEffect; plParticleFollowSystemEffect *effect = new plParticleFollowSystemEffect;
hsgResMgr::ResMgr()->NewKey(IGetUniqueName(node), effect, node->GetLocation(), node->GetLoadMask()); hsgResMgr::ResMgr()->NewKey(IGetUniqueName(node), effect, node->GetLocation(), node->GetLoadMask());
hsgResMgr::ResMgr()->AddViaNotify( effect->GetKey(), TRACKED_NEW plGenRefMsg( sys->GetKey(), plRefMsg::kOnCreate, 0, plParticleSystem::kEffectMisc ), plRefFlags::kActiveRef ); hsgResMgr::ResMgr()->AddViaNotify( effect->GetKey(), new plGenRefMsg( sys->GetKey(), plRefMsg::kOnCreate, 0, plParticleSystem::kEffectMisc ), plRefFlags::kActiveRef );
} }
return true; return true;
@ -533,7 +533,7 @@ hsBool plParticleCoreComponent::AddToAnim(plAGAnim *anim, plMaxNode *node)
ctl = cc.MakeScalarController(GetParamBlock2Controller(fCompPB, ParamID(kLifeMin)), node, start, end); ctl = cc.MakeScalarController(GetParamBlock2Controller(fCompPB, ParamID(kLifeMin)), node, start, end);
if (ctl != nil) if (ctl != nil)
{ {
plParticleLifeMinApplicator *app = TRACKED_NEW plParticleLifeMinApplicator(); plParticleLifeMinApplicator *app = new plParticleLifeMinApplicator();
app->SetChannelName(node->GetName()); app->SetChannelName(node->GetName());
plAnimComponentBase::SetupCtl(anim, ctl, app, node); plAnimComponentBase::SetupCtl(anim, ctl, app, node);
result = true; result = true;
@ -542,7 +542,7 @@ hsBool plParticleCoreComponent::AddToAnim(plAGAnim *anim, plMaxNode *node)
ctl = cc.MakeScalarController(GetParamBlock2Controller(fCompPB, ParamID(kLifeMax)), node, start, end); ctl = cc.MakeScalarController(GetParamBlock2Controller(fCompPB, ParamID(kLifeMax)), node, start, end);
if (ctl != nil) if (ctl != nil)
{ {
plParticleLifeMaxApplicator *app = TRACKED_NEW plParticleLifeMaxApplicator(); plParticleLifeMaxApplicator *app = new plParticleLifeMaxApplicator();
app->SetChannelName(node->GetName()); app->SetChannelName(node->GetName());
plAnimComponentBase::SetupCtl(anim, ctl, app, node); plAnimComponentBase::SetupCtl(anim, ctl, app, node);
result = true; result = true;
@ -551,7 +551,7 @@ hsBool plParticleCoreComponent::AddToAnim(plAGAnim *anim, plMaxNode *node)
ctl = cc.MakeScalarController(GetParamBlock2Controller(fCompPB, ParamID(kPPS)), node, start, end); ctl = cc.MakeScalarController(GetParamBlock2Controller(fCompPB, ParamID(kPPS)), node, start, end);
if (ctl != nil) if (ctl != nil)
{ {
plParticlePPSApplicator *app = TRACKED_NEW plParticlePPSApplicator(); plParticlePPSApplicator *app = new plParticlePPSApplicator();
app->SetChannelName(node->GetName()); app->SetChannelName(node->GetName());
plAnimComponentBase::SetupCtl(anim, ctl, app, node); plAnimComponentBase::SetupCtl(anim, ctl, app, node);
result = true; result = true;
@ -560,7 +560,7 @@ hsBool plParticleCoreComponent::AddToAnim(plAGAnim *anim, plMaxNode *node)
ctl = cc.MakeScalarController(GetParamBlock2Controller(fCompPB, ParamID(kConeAngle)), node, start, end); ctl = cc.MakeScalarController(GetParamBlock2Controller(fCompPB, ParamID(kConeAngle)), node, start, end);
if (ctl != nil) if (ctl != nil)
{ {
plParticleAngleApplicator *app = TRACKED_NEW plParticleAngleApplicator(); plParticleAngleApplicator *app = new plParticleAngleApplicator();
app->SetChannelName(node->GetName()); app->SetChannelName(node->GetName());
plAnimComponentBase::SetupCtl(anim, ctl, app, node); plAnimComponentBase::SetupCtl(anim, ctl, app, node);
result = true; result = true;
@ -569,7 +569,7 @@ hsBool plParticleCoreComponent::AddToAnim(plAGAnim *anim, plMaxNode *node)
ctl = cc.MakeScalarController(GetParamBlock2Controller(fCompPB, ParamID(kVelocityMin)), node, start, end); ctl = cc.MakeScalarController(GetParamBlock2Controller(fCompPB, ParamID(kVelocityMin)), node, start, end);
if (ctl != nil) if (ctl != nil)
{ {
plParticleVelMinApplicator *app = TRACKED_NEW plParticleVelMinApplicator(); plParticleVelMinApplicator *app = new plParticleVelMinApplicator();
app->SetChannelName(node->GetName()); app->SetChannelName(node->GetName());
plAnimComponentBase::SetupCtl(anim, ctl, app, node); plAnimComponentBase::SetupCtl(anim, ctl, app, node);
result = true; result = true;
@ -578,7 +578,7 @@ hsBool plParticleCoreComponent::AddToAnim(plAGAnim *anim, plMaxNode *node)
ctl = cc.MakeScalarController(GetParamBlock2Controller(fCompPB, ParamID(kVelocityMax)), node, start, end); ctl = cc.MakeScalarController(GetParamBlock2Controller(fCompPB, ParamID(kVelocityMax)), node, start, end);
if (ctl != nil) if (ctl != nil)
{ {
plParticleVelMaxApplicator *app = TRACKED_NEW plParticleVelMaxApplicator(); plParticleVelMaxApplicator *app = new plParticleVelMaxApplicator();
app->SetChannelName(node->GetName()); app->SetChannelName(node->GetName());
plAnimComponentBase::SetupCtl(anim, ctl, app, node); plAnimComponentBase::SetupCtl(anim, ctl, app, node);
result = true; result = true;
@ -588,7 +588,7 @@ hsBool plParticleCoreComponent::AddToAnim(plAGAnim *anim, plMaxNode *node)
ctl = cc.MakeScalarController(GetParamBlock2Controller(fCompPB, ParamID(kGravity)), node, start, end); ctl = cc.MakeScalarController(GetParamBlock2Controller(fCompPB, ParamID(kGravity)), node, start, end);
if (ctl != nil) if (ctl != nil)
{ {
plParticleGravityApplicator *app = TRACKED_NEW plParticleGravityApplicator(); plParticleGravityApplicator *app = new plParticleGravityApplicator();
plAnimComponentBase::SetupCtl(anim, ctl, app, node); plAnimComponentBase::SetupCtl(anim, ctl, app, node);
result = true; result = true;
} }
@ -596,7 +596,7 @@ hsBool plParticleCoreComponent::AddToAnim(plAGAnim *anim, plMaxNode *node)
ctl = cc.MakeScalarController(GetParamBlock2Controller(fCompPB, ParamID(kDrag)), node, start, end); ctl = cc.MakeScalarController(GetParamBlock2Controller(fCompPB, ParamID(kDrag)), node, start, end);
if (ctl != nil) if (ctl != nil)
{ {
plParticleDragApplicator *app = TRACKED_NEW plParticleDragApplicator(); plParticleDragApplicator *app = new plParticleDragApplicator();
plAnimComponentBase::SetupCtl(anim, ctl, app, node); plAnimComponentBase::SetupCtl(anim, ctl, app, node);
result = true; result = true;
} }
@ -606,7 +606,7 @@ hsBool plParticleCoreComponent::AddToAnim(plAGAnim *anim, plMaxNode *node)
ctl = cc.MakeScalarController(GetParamBlock2Controller(fCompPB, ParamID(kScaleMin)), node, start, end); ctl = cc.MakeScalarController(GetParamBlock2Controller(fCompPB, ParamID(kScaleMin)), node, start, end);
if (ctl != nil) if (ctl != nil)
{ {
plParticleScaleMinApplicator *app = TRACKED_NEW plParticleScaleMinApplicator(); plParticleScaleMinApplicator *app = new plParticleScaleMinApplicator();
app->SetChannelName(node->GetName()); app->SetChannelName(node->GetName());
plAnimComponentBase::SetupCtl(anim, ctl, app, node); plAnimComponentBase::SetupCtl(anim, ctl, app, node);
result = true; result = true;
@ -615,7 +615,7 @@ hsBool plParticleCoreComponent::AddToAnim(plAGAnim *anim, plMaxNode *node)
ctl = cc.MakeScalarController(GetParamBlock2Controller(fCompPB, ParamID(kScaleMax)), node, start, end); ctl = cc.MakeScalarController(GetParamBlock2Controller(fCompPB, ParamID(kScaleMax)), node, start, end);
if (ctl != nil) if (ctl != nil)
{ {
plParticleScaleMaxApplicator *app = TRACKED_NEW plParticleScaleMaxApplicator(); plParticleScaleMaxApplicator *app = new plParticleScaleMaxApplicator();
app->SetChannelName(node->GetName()); app->SetChannelName(node->GetName());
plAnimComponentBase::SetupCtl(anim, ctl, app, node); plAnimComponentBase::SetupCtl(anim, ctl, app, node);
result = true; result = true;
@ -964,7 +964,7 @@ void plParticleFadeComponent::AddToParticleSystem(plParticleSystem *sys, plMaxNo
plParticleFadeVolumeEffect *effect = nil; plParticleFadeVolumeEffect *effect = nil;
if( !fEffect ) if( !fEffect )
{ {
effect = TRACKED_NEW plParticleFadeVolumeEffect(); effect = new plParticleFadeVolumeEffect();
hsgResMgr::ResMgr()->NewKey(IGetUniqueName(node), effect, node->GetLocation(), node->GetLoadMask()); hsgResMgr::ResMgr()->NewKey(IGetUniqueName(node), effect, node->GetLocation(), node->GetLoadMask());
effect->fLength = (float)fCompPB->GetInt(kFadeDistance); effect->fLength = (float)fCompPB->GetInt(kFadeDistance);
if (fCompPB->GetInt(kFadeZ)) if (fCompPB->GetInt(kFadeZ))
@ -977,7 +977,7 @@ void plParticleFadeComponent::AddToParticleSystem(plParticleSystem *sys, plMaxNo
effect = plParticleFadeVolumeEffect::ConvertNoRef(fEffect); effect = plParticleFadeVolumeEffect::ConvertNoRef(fEffect);
} }
hsAssert(effect, "Our effect pointer was wrong type?"); hsAssert(effect, "Our effect pointer was wrong type?");
hsgResMgr::ResMgr()->AddViaNotify( effect->GetKey(), TRACKED_NEW plGenRefMsg( sys->GetKey(), plRefMsg::kOnCreate, 0, plParticleSystem::kEffectMisc ), plRefFlags::kActiveRef ); hsgResMgr::ResMgr()->AddViaNotify( effect->GetKey(), new plGenRefMsg( sys->GetKey(), plRefMsg::kOnCreate, 0, plParticleSystem::kEffectMisc ), plRefFlags::kActiveRef );
} }
CLASS_DESC(plParticleFadeComponent, gParticleFadeDesc, "Fade Volume Effect", "Fade Volume Effect", COMP_TYPE_PARTICLE, PARTICLE_FADE_COMPONENT_CLASS_ID) CLASS_DESC(plParticleFadeComponent, gParticleFadeDesc, "Fade Volume Effect", "Fade Volume Effect", COMP_TYPE_PARTICLE, PARTICLE_FADE_COMPONENT_CLASS_ID)
@ -1050,10 +1050,10 @@ void plParticleVolumeComponent::BuildVolume(plMaxNode *node)
if (fBound != nil) if (fBound != nil)
return; // already converted it return; // already converted it
fBound = TRACKED_NEW plBoundInterface; fBound = new plBoundInterface;
hsgResMgr::ResMgr()->NewKey(node->GetName(), fBound, node->GetLocation(), node->GetLoadMask()); hsgResMgr::ResMgr()->NewKey(node->GetName(), fBound, node->GetLocation(), node->GetLoadMask());
fBound->Init(plMeshConverter::Instance().CreateConvexVolume(node)); fBound->Init(plMeshConverter::Instance().CreateConvexVolume(node));
hsgResMgr::ResMgr()->AddViaNotify(fBound->GetKey(), TRACKED_NEW plObjRefMsg(node->GetKey(), plRefMsg::kOnCreate, -1, plObjRefMsg::kInterface), plRefFlags::kActiveRef); hsgResMgr::ResMgr()->AddViaNotify(fBound->GetKey(), new plObjRefMsg(node->GetKey(), plRefMsg::kOnCreate, -1, plObjRefMsg::kInterface), plRefFlags::kActiveRef);
} }
@ -1072,14 +1072,14 @@ void plParticleVolumeComponent::AddToParticleSystem(plParticleSystem *sys, plMax
{ {
default: default:
case kImpDefault: case kImpDefault:
effect = TRACKED_NEW plParticleCollisionEffectBeat(); effect = new plParticleCollisionEffectBeat();
break; break;
case kImpDie: case kImpDie:
effect = TRACKED_NEW plParticleCollisionEffectDie(); effect = new plParticleCollisionEffectDie();
break; break;
case kImpBounce: case kImpBounce:
{ {
plParticleCollisionEffectBounce* bnc = TRACKED_NEW plParticleCollisionEffectBounce(); plParticleCollisionEffectBounce* bnc = new plParticleCollisionEffectBounce();
bnc->SetBounce(fCompPB->GetFloat(kBounceAmt) * 1.e-2f); bnc->SetBounce(fCompPB->GetFloat(kBounceAmt) * 1.e-2f);
bnc->SetFriction(fCompPB->GetFloat(kFrictionAmt) * 1.e-2f); bnc->SetFriction(fCompPB->GetFloat(kFrictionAmt) * 1.e-2f);
effect = bnc; effect = bnc;
@ -1089,7 +1089,7 @@ void plParticleVolumeComponent::AddToParticleSystem(plParticleSystem *sys, plMax
hsgResMgr::ResMgr()->NewKey(IGetUniqueName(node), effect, node->GetLocation(), node->GetLoadMask()); hsgResMgr::ResMgr()->NewKey(IGetUniqueName(node), effect, node->GetLocation(), node->GetLoadMask());
plSceneObject *sObj = source->GetSceneObject(); plSceneObject *sObj = source->GetSceneObject();
hsgResMgr::ResMgr()->AddViaNotify( sObj->GetKey(), TRACKED_NEW plGenRefMsg( effect->GetKey(), plRefMsg::kOnCreate, 0, 0 ), plRefFlags::kPassiveRef ); hsgResMgr::ResMgr()->AddViaNotify( sObj->GetKey(), new plGenRefMsg( effect->GetKey(), plRefMsg::kOnCreate, 0, 0 ), plRefFlags::kPassiveRef );
fEffect = effect; fEffect = effect;
} }
@ -1098,7 +1098,7 @@ void plParticleVolumeComponent::AddToParticleSystem(plParticleSystem *sys, plMax
effect = plParticleCollisionEffect::ConvertNoRef(fEffect); effect = plParticleCollisionEffect::ConvertNoRef(fEffect);
} }
hsAssert(effect, "Our effect pointer was wrong type?"); hsAssert(effect, "Our effect pointer was wrong type?");
hsgResMgr::ResMgr()->AddViaNotify( effect->GetKey(), TRACKED_NEW plGenRefMsg( sys->GetKey(), plRefMsg::kOnCreate, 0, plParticleSystem::kEffectConstraint ), plRefFlags::kActiveRef ); hsgResMgr::ResMgr()->AddViaNotify( effect->GetKey(), new plGenRefMsg( sys->GetKey(), plRefMsg::kOnCreate, 0, plParticleSystem::kEffectConstraint ), plRefFlags::kActiveRef );
} }
CLASS_DESC(plParticleVolumeComponent, gParticleVolumeDesc, "Collision Volume Effect", "Collision Volume Effect", COMP_TYPE_PARTICLE, PARTICLE_VOLUME_COMPONENT_CLASS_ID) CLASS_DESC(plParticleVolumeComponent, gParticleVolumeDesc, "Collision Volume Effect", "Collision Volume Effect", COMP_TYPE_PARTICLE, PARTICLE_VOLUME_COMPONENT_CLASS_ID)
@ -1190,7 +1190,7 @@ void plParticleWindComponent::AddToParticleSystem(plParticleSystem *sys, plMaxNo
plParticleLocalWind* effect = nil; plParticleLocalWind* effect = nil;
if( !fEffect ) if( !fEffect )
{ {
effect = TRACKED_NEW plParticleLocalWind(); effect = new plParticleLocalWind();
effect->SetScale(hsVector3(fCompPB->GetFloat(kScaleX), fCompPB->GetFloat(kScaleY), fCompPB->GetFloat(kScaleZ))); effect->SetScale(hsVector3(fCompPB->GetFloat(kScaleX), fCompPB->GetFloat(kScaleY), fCompPB->GetFloat(kScaleZ)));
effect->SetSpeed(fCompPB->GetFloat(kSpeed)); effect->SetSpeed(fCompPB->GetFloat(kSpeed));
@ -1210,7 +1210,7 @@ void plParticleWindComponent::AddToParticleSystem(plParticleSystem *sys, plMaxNo
effect = plParticleLocalWind::ConvertNoRef(fEffect); effect = plParticleLocalWind::ConvertNoRef(fEffect);
} }
hsAssert(effect, "Our effect pointer was wrong type?"); hsAssert(effect, "Our effect pointer was wrong type?");
hsgResMgr::ResMgr()->AddViaNotify( effect->GetKey(), TRACKED_NEW plGenRefMsg( sys->GetKey(), plRefMsg::kOnCreate, 0, plParticleSystem::kEffectForce ), plRefFlags::kActiveRef ); hsgResMgr::ResMgr()->AddViaNotify( effect->GetKey(), new plGenRefMsg( sys->GetKey(), plRefMsg::kOnCreate, 0, plParticleSystem::kEffectForce ), plRefFlags::kActiveRef );
} }
CLASS_DESC(plParticleWindComponent, gParticleWindDesc, "Wind Effect", "WindEffect", COMP_TYPE_PARTICLE, PARTICLE_WIND_COMPONENT_CLASS_ID) CLASS_DESC(plParticleWindComponent, gParticleWindDesc, "Wind Effect", "WindEffect", COMP_TYPE_PARTICLE, PARTICLE_WIND_COMPONENT_CLASS_ID)
@ -1311,7 +1311,7 @@ void plParticleUniWindComponent::AddToParticleSystem(plParticleSystem *sys, plMa
plParticleUniformWind* effect = nil; plParticleUniformWind* effect = nil;
if( !fEffect ) if( !fEffect )
{ {
effect = TRACKED_NEW plParticleUniformWind(); effect = new plParticleUniformWind();
hsgResMgr::ResMgr()->NewKey(IGetUniqueName(node), effect, node->GetLocation(), node->GetLoadMask()); hsgResMgr::ResMgr()->NewKey(IGetUniqueName(node), effect, node->GetLocation(), node->GetLoadMask());
effect->SetStrength(fCompPB->GetFloat(kStrength)); effect->SetStrength(fCompPB->GetFloat(kStrength));
@ -1331,7 +1331,7 @@ void plParticleUniWindComponent::AddToParticleSystem(plParticleSystem *sys, plMa
effect = plParticleUniformWind::ConvertNoRef(fEffect); effect = plParticleUniformWind::ConvertNoRef(fEffect);
} }
hsAssert(effect, "Our effect pointer was wrong type?"); hsAssert(effect, "Our effect pointer was wrong type?");
hsgResMgr::ResMgr()->AddViaNotify( effect->GetKey(), TRACKED_NEW plGenRefMsg( sys->GetKey(), plRefMsg::kOnCreate, 0, plParticleSystem::kEffectForce ), plRefFlags::kActiveRef ); hsgResMgr::ResMgr()->AddViaNotify( effect->GetKey(), new plGenRefMsg( sys->GetKey(), plRefMsg::kOnCreate, 0, plParticleSystem::kEffectForce ), plRefFlags::kActiveRef );
} }
CLASS_DESC(plParticleUniWindComponent, gParticleUniWindDesc, "Uniform Wind", "UniWind", COMP_TYPE_PARTICLE, PARTICLE_UNIWIND_COMPONENT_CLASS_ID) CLASS_DESC(plParticleUniWindComponent, gParticleUniWindDesc, "Uniform Wind", "UniWind", COMP_TYPE_PARTICLE, PARTICLE_UNIWIND_COMPONENT_CLASS_ID)
@ -1482,7 +1482,7 @@ void plParticleFlockComponent::AddToParticleSystem(plParticleSystem *sys, plMaxN
plParticleFlockEffect* effect = nil; plParticleFlockEffect* effect = nil;
if( !fEffect ) if( !fEffect )
{ {
effect = TRACKED_NEW plParticleFlockEffect(); effect = new plParticleFlockEffect();
hsgResMgr::ResMgr()->NewKey(IGetUniqueName(node), effect, node->GetLocation(), node->GetLoadMask()); hsgResMgr::ResMgr()->NewKey(IGetUniqueName(node), effect, node->GetLocation(), node->GetLoadMask());
hsPoint3 offset(fCompPB->GetFloat(ParamID(kOffsetX)), hsPoint3 offset(fCompPB->GetFloat(ParamID(kOffsetX)),
@ -1512,7 +1512,7 @@ void plParticleFlockComponent::AddToParticleSystem(plParticleSystem *sys, plMaxN
effect = plParticleFlockEffect::ConvertNoRef(fEffect); effect = plParticleFlockEffect::ConvertNoRef(fEffect);
} }
hsAssert(effect, "Our effect pointer was wrong type?"); hsAssert(effect, "Our effect pointer was wrong type?");
hsgResMgr::ResMgr()->AddViaNotify( effect->GetKey(), TRACKED_NEW plGenRefMsg( sys->GetKey(), plRefMsg::kOnCreate, 0, plParticleSystem::kEffectForce ), plRefFlags::kActiveRef ); hsgResMgr::ResMgr()->AddViaNotify( effect->GetKey(), new plGenRefMsg( sys->GetKey(), plRefMsg::kOnCreate, 0, plParticleSystem::kEffectForce ), plRefFlags::kActiveRef );
} }
CLASS_DESC(plParticleFlockComponent, gParticleFlockDesc, "Particle Flock", "Flock", COMP_TYPE_PARTICLE, PARTICLE_FLOCK_COMPONENT_CLASS_ID) CLASS_DESC(plParticleFlockComponent, gParticleFlockDesc, "Particle Flock", "Flock", COMP_TYPE_PARTICLE, PARTICLE_FLOCK_COMPONENT_CLASS_ID)

18
Sources/Tools/MaxComponent/plPhysConstraintComponents.cpp

@ -405,7 +405,7 @@ extern PlasmaToHavokQuat(Havok::Quaternion &a, hsQuat &b);
hsBool plPhysHingeConstraintComponent::Convert(plMaxNode *node, plErrorMsg *pErrMsg) hsBool plPhysHingeConstraintComponent::Convert(plMaxNode *node, plErrorMsg *pErrMsg)
{ {
plHingeConstraintMod* HMod = TRACKED_NEW plHingeConstraintMod; plHingeConstraintMod* HMod = new plHingeConstraintMod;
plMaxNode* ParentNode = (plMaxNode*)fCompPB->GetINode(kParent); plMaxNode* ParentNode = (plMaxNode*)fCompPB->GetINode(kParent);
@ -493,8 +493,8 @@ hsBool plPhysHingeConstraintComponent::Convert(plMaxNode *node, plErrorMsg *pErr
node->AddModifier(HMod, IGetUniqueName(node)); node->AddModifier(HMod, IGetUniqueName(node));
if(ParentKey) if(ParentKey)
hsgResMgr::ResMgr()->AddViaNotify( ParentKey, TRACKED_NEW plGenRefMsg( HMod->GetKey(), plRefMsg::kOnCreate, plHavokConstraintsMod::kParentIdx, 0 ), plRefFlags::kPassiveRef ); hsgResMgr::ResMgr()->AddViaNotify( ParentKey, new plGenRefMsg( HMod->GetKey(), plRefMsg::kOnCreate, plHavokConstraintsMod::kParentIdx, 0 ), plRefFlags::kPassiveRef );
hsgResMgr::ResMgr()->AddViaNotify( node->GetKey(), TRACKED_NEW plGenRefMsg( HMod->GetKey(), plRefMsg::kOnCreate, plHavokConstraintsMod::kChildIdx, 0 ), plRefFlags::kPassiveRef ); hsgResMgr::ResMgr()->AddViaNotify( node->GetKey(), new plGenRefMsg( HMod->GetKey(), plRefMsg::kOnCreate, plHavokConstraintsMod::kChildIdx, 0 ), plRefFlags::kPassiveRef );
@ -696,7 +696,7 @@ hsBool plPhysBridgeComponent::Convert(plMaxNode* node, plErrorMsg* errMsg)
if (!parent) if (!parent)
return false; return false;
plHingeConstraintMod* mod = TRACKED_NEW plHingeConstraintMod; plHingeConstraintMod* mod = new plHingeConstraintMod;
// mod->SetHCFriction(0, 1.f); // mod->SetHCFriction(0, 1.f);
mod->SetRR(fCompPB->GetFloat(kStrength));//1.f / sqrt(float(count))); mod->SetRR(fCompPB->GetFloat(kStrength));//1.f / sqrt(float(count)));
@ -724,8 +724,8 @@ hsBool plPhysBridgeComponent::Convert(plMaxNode* node, plErrorMsg* errMsg)
mod->SetRotationAxis(-1*hingeVector); mod->SetRotationAxis(-1*hingeVector);
node->AddModifier(mod, IGetUniqueName(node)); node->AddModifier(mod, IGetUniqueName(node));
hsgResMgr::ResMgr()->AddViaNotify(parent->GetKey(), TRACKED_NEW plGenRefMsg(mod->GetKey(), plRefMsg::kOnCreate, plHavokConstraintsMod::kParentIdx, 0), plRefFlags::kPassiveRef); hsgResMgr::ResMgr()->AddViaNotify(parent->GetKey(), new plGenRefMsg(mod->GetKey(), plRefMsg::kOnCreate, plHavokConstraintsMod::kParentIdx, 0), plRefFlags::kPassiveRef);
hsgResMgr::ResMgr()->AddViaNotify(node->GetKey(), TRACKED_NEW plGenRefMsg(mod->GetKey(), plRefMsg::kOnCreate, plHavokConstraintsMod::kChildIdx, 0), plRefFlags::kPassiveRef); hsgResMgr::ResMgr()->AddViaNotify(node->GetKey(), new plGenRefMsg(mod->GetKey(), plRefMsg::kOnCreate, plHavokConstraintsMod::kChildIdx, 0), plRefFlags::kPassiveRef);
return true; return true;
} }
@ -1042,7 +1042,7 @@ hsBool plStrongSpringConstraintComponent::SetupProperties(plMaxNode *pNode, plEr
hsBool plStrongSpringConstraintComponent::Convert(plMaxNode *node, plErrorMsg *pErrMsg) hsBool plStrongSpringConstraintComponent::Convert(plMaxNode *node, plErrorMsg *pErrMsg)
{ {
plStrongSpringConstraintMod* HMod = TRACKED_NEW plStrongSpringConstraintMod; plStrongSpringConstraintMod* HMod = new plStrongSpringConstraintMod;
HMod->SetDamp(fCompPB->GetFloat(kStrength)); HMod->SetDamp(fCompPB->GetFloat(kStrength));
HMod->SetRR(fCompPB->GetFloat(kRebound)); HMod->SetRR(fCompPB->GetFloat(kRebound));
@ -1081,8 +1081,8 @@ hsBool plStrongSpringConstraintComponent::Convert(plMaxNode *node, plErrorMsg *p
node->AddModifier(HMod, IGetUniqueName(node)); node->AddModifier(HMod, IGetUniqueName(node));
hsgResMgr::ResMgr()->AddViaNotify( ParentKey, TRACKED_NEW plGenRefMsg( HMod->GetKey(), plRefMsg::kOnCreate, plHavokConstraintsMod::kParentIdx, 0 ), plRefFlags::kPassiveRef ); hsgResMgr::ResMgr()->AddViaNotify( ParentKey, new plGenRefMsg( HMod->GetKey(), plRefMsg::kOnCreate, plHavokConstraintsMod::kParentIdx, 0 ), plRefFlags::kPassiveRef );
hsgResMgr::ResMgr()->AddViaNotify( node->GetKey(), TRACKED_NEW plGenRefMsg( HMod->GetKey(), plRefMsg::kOnCreate, plHavokConstraintsMod::kChildIdx, 0 ), plRefFlags::kPassiveRef ); hsgResMgr::ResMgr()->AddViaNotify( node->GetKey(), new plGenRefMsg( HMod->GetKey(), plRefMsg::kOnCreate, plHavokConstraintsMod::kChildIdx, 0 ), plRefFlags::kPassiveRef );

34
Sources/Tools/MaxComponent/plPhysicalComponents.cpp

@ -1324,19 +1324,19 @@ hsBool plSwim2DComponent::PreConvert(plMaxNode *node, plErrorMsg *pErrMsg)
{ {
case kCurrentSpiral: case kCurrentSpiral:
{ {
fSwimRegions[node] = TRACKED_NEW plSwimCircularCurrentRegion(); fSwimRegions[node] = new plSwimCircularCurrentRegion();
hsgResMgr::ResMgr()->NewKey(node->GetName(), fSwimRegions[node], node->GetLocation(), node->GetLoadMask()); hsgResMgr::ResMgr()->NewKey(node->GetName(), fSwimRegions[node], node->GetLocation(), node->GetLoadMask());
break; break;
} }
case kCurrentStraight: case kCurrentStraight:
{ {
fSwimRegions[node] = TRACKED_NEW plSwimStraightCurrentRegion(); fSwimRegions[node] = new plSwimStraightCurrentRegion();
hsgResMgr::ResMgr()->NewKey(node->GetName(), fSwimRegions[node], node->GetLocation(), node->GetLoadMask()); hsgResMgr::ResMgr()->NewKey(node->GetName(), fSwimRegions[node], node->GetLocation(), node->GetLoadMask());
break; break;
} }
default: default:
{ {
fSwimRegions[node] = TRACKED_NEW plSwimRegionInterface(); fSwimRegions[node] = new plSwimRegionInterface();
hsgResMgr::ResMgr()->NewKey(node->GetName(), fSwimRegions[node], node->GetLocation(), node->GetLoadMask()); hsgResMgr::ResMgr()->NewKey(node->GetName(), fSwimRegions[node], node->GetLocation(), node->GetLoadMask());
break; break;
} }
@ -1354,11 +1354,11 @@ hsBool plSwim2DComponent::Convert(plMaxNode *node, plErrorMsg *pErrMsg)
if (!detectorNode->GetSceneObject()->GetModifierByType(plSwimDetector::Index())) if (!detectorNode->GetSceneObject()->GetModifierByType(plSwimDetector::Index()))
{ {
plKey nilKey; plKey nilKey;
plSwimMsg *enterMsg = TRACKED_NEW plSwimMsg(detectorNode->GetKey(), nilKey, true, nil); plSwimMsg *enterMsg = new plSwimMsg(detectorNode->GetKey(), nilKey, true, nil);
plSwimMsg *exitMsg = TRACKED_NEW plSwimMsg(detectorNode->GetKey(), nilKey, false, nil); plSwimMsg *exitMsg = new plSwimMsg(detectorNode->GetKey(), nilKey, false, nil);
enterMsg->SetBCastFlag(plMessage::kPropagateToModifiers); enterMsg->SetBCastFlag(plMessage::kPropagateToModifiers);
exitMsg->SetBCastFlag(plMessage::kPropagateToModifiers); exitMsg->SetBCastFlag(plMessage::kPropagateToModifiers);
plSwimDetector *swimMod = TRACKED_NEW plSwimDetector(enterMsg, exitMsg); plSwimDetector *swimMod = new plSwimDetector(enterMsg, exitMsg);
detectorNode->AddModifier(swimMod, IGetUniqueName(node)); detectorNode->AddModifier(swimMod, IGetUniqueName(node));
// the mod doesn't have a valid key until AddModifier is called, so this comes last. // the mod doesn't have a valid key until AddModifier is called, so this comes last.
@ -1384,7 +1384,7 @@ hsBool plSwim2DComponent::Convert(plMaxNode *node, plErrorMsg *pErrMsg)
plMaxNode *currentNode = (plMaxNode *)fCompPB->GetINode(ParamID(kSwimCurrentNode)); plMaxNode *currentNode = (plMaxNode *)fCompPB->GetINode(ParamID(kSwimCurrentNode));
if (currentNode) if (currentNode)
{ {
plGenRefMsg *msg= TRACKED_NEW plGenRefMsg(circInt->GetKey(), plRefMsg::kOnCreate, -1, -1); plGenRefMsg *msg= new plGenRefMsg(circInt->GetKey(), plRefMsg::kOnCreate, -1, -1);
hsgResMgr::ResMgr()->AddViaNotify(currentNode->GetSceneObject()->GetKey(), msg, plRefFlags::kActiveRef); hsgResMgr::ResMgr()->AddViaNotify(currentNode->GetSceneObject()->GetKey(), msg, plRefFlags::kActiveRef);
} }
break; break;
@ -1400,7 +1400,7 @@ hsBool plSwim2DComponent::Convert(plMaxNode *node, plErrorMsg *pErrMsg)
plMaxNode *currentNode = (plMaxNode *)fCompPB->GetINode(ParamID(kSwimCurrentNode)); plMaxNode *currentNode = (plMaxNode *)fCompPB->GetINode(ParamID(kSwimCurrentNode));
if (currentNode) if (currentNode)
{ {
plGenRefMsg *msg= TRACKED_NEW plGenRefMsg(strInt->GetKey(), plRefMsg::kOnCreate, -1, -1); plGenRefMsg *msg= new plGenRefMsg(strInt->GetKey(), plRefMsg::kOnCreate, -1, -1);
hsgResMgr::ResMgr()->AddViaNotify(currentNode->GetSceneObject()->GetKey(), msg, plRefFlags::kActiveRef); hsgResMgr::ResMgr()->AddViaNotify(currentNode->GetSceneObject()->GetKey(), msg, plRefFlags::kActiveRef);
} }
break; break;
@ -1416,7 +1416,7 @@ hsBool plSwim2DComponent::Convert(plMaxNode *node, plErrorMsg *pErrMsg)
fSwimRegions[node]->fUpBuoyancy = fCompPB->GetFloat(ParamID(kSwimBuoyancyUp)) + 1; fSwimRegions[node]->fUpBuoyancy = fCompPB->GetFloat(ParamID(kSwimBuoyancyUp)) + 1;
fSwimRegions[node]->fMaxUpwardVel = fCompPB->GetFloat(ParamID(kSwimMaxUpVel)); fSwimRegions[node]->fMaxUpwardVel = fCompPB->GetFloat(ParamID(kSwimMaxUpVel));
hsgResMgr::ResMgr()->AddViaNotify(fSwimRegions[node]->GetKey(), TRACKED_NEW plObjRefMsg(node->GetKey(), plRefMsg::kOnCreate, -1, plObjRefMsg::kInterface), plRefFlags::kActiveRef); hsgResMgr::ResMgr()->AddViaNotify(fSwimRegions[node]->GetKey(), new plObjRefMsg(node->GetKey(), plRefMsg::kOnCreate, -1, plObjRefMsg::kInterface), plRefFlags::kActiveRef);
return true; return true;
} }
@ -1765,11 +1765,11 @@ hsBool plSubworldDetectorComponent::Convert(plMaxNode *node, plErrorMsg *pErrMsg
plSceneObject *obj = node->GetSceneObject(); plSceneObject *obj = node->GetSceneObject();
plLocation loc = node->GetLocation(); plLocation loc = node->GetLocation();
plSubworldRegionDetector *detector = TRACKED_NEW plSubworldRegionDetector; plSubworldRegionDetector *detector = new plSubworldRegionDetector;
// Register the detector // Register the detector
plKey detectorKey = hsgResMgr::ResMgr()->NewKey(IGetUniqueName(node), detector, loc); plKey detectorKey = hsgResMgr::ResMgr()->NewKey(IGetUniqueName(node), detector, loc);
hsgResMgr::ResMgr()->AddViaNotify(detectorKey, TRACKED_NEW plObjRefMsg(obj->GetKey(), plRefMsg::kOnCreate, -1, plObjRefMsg::kModifier), plRefFlags::kActiveRef); hsgResMgr::ResMgr()->AddViaNotify(detectorKey, new plObjRefMsg(obj->GetKey(), plRefMsg::kOnCreate, -1, plObjRefMsg::kModifier), plRefFlags::kActiveRef);
// need to get the key for the camera here... // need to get the key for the camera here...
plMaxNode* pSubNode = (plMaxNode*)fCompPB->GetINode(kSubworldTarget); plMaxNode* pSubNode = (plMaxNode*)fCompPB->GetINode(kSubworldTarget);
@ -1881,12 +1881,12 @@ hsBool plPanicLinkDetectorComponent::Convert(plMaxNode *node, plErrorMsg *pErrMs
plSceneObject *obj = node->GetSceneObject(); plSceneObject *obj = node->GetSceneObject();
plLocation loc = node->GetLocation(); plLocation loc = node->GetLocation();
plPanicLinkRegion *detector = TRACKED_NEW plPanicLinkRegion; plPanicLinkRegion *detector = new plPanicLinkRegion;
detector->fPlayLinkOutAnim = fCompPB->GetInt(ParamID(kPlayAnim)); detector->fPlayLinkOutAnim = fCompPB->GetInt(ParamID(kPlayAnim));
// Register the detector // Register the detector
plKey detectorKey = hsgResMgr::ResMgr()->NewKey(IGetUniqueName(node), detector, loc); plKey detectorKey = hsgResMgr::ResMgr()->NewKey(IGetUniqueName(node), detector, loc);
hsgResMgr::ResMgr()->AddViaNotify(detectorKey, TRACKED_NEW plObjRefMsg(obj->GetKey(), plRefMsg::kOnCreate, -1, plObjRefMsg::kModifier), plRefFlags::kActiveRef); hsgResMgr::ResMgr()->AddViaNotify(detectorKey, new plObjRefMsg(obj->GetKey(), plRefMsg::kOnCreate, -1, plObjRefMsg::kModifier), plRefFlags::kActiveRef);
return true; return true;
} }
@ -2002,14 +2002,14 @@ hsBool plRideAnimatedPhysicalComponent::Convert(plMaxNode *node, plErrorMsg *pEr
{ {
plSceneObject *obj = node->GetSceneObject(); plSceneObject *obj = node->GetSceneObject();
plLocation loc = node->GetLocation(); plLocation loc = node->GetLocation();
plRideAnimatedPhysMsg* enter = TRACKED_NEW plRideAnimatedPhysMsg(obj->GetKey(), nil, true, nil); plRideAnimatedPhysMsg* enter = new plRideAnimatedPhysMsg(obj->GetKey(), nil, true, nil);
enter->SetBCastFlag(plMessage::kPropagateToModifiers); enter->SetBCastFlag(plMessage::kPropagateToModifiers);
plRideAnimatedPhysMsg* exit = TRACKED_NEW plRideAnimatedPhysMsg(obj->GetKey(), nil, false, nil); plRideAnimatedPhysMsg* exit = new plRideAnimatedPhysMsg(obj->GetKey(), nil, false, nil);
exit->SetBCastFlag(plMessage::kPropagateToModifiers); exit->SetBCastFlag(plMessage::kPropagateToModifiers);
plRidingAnimatedPhysicalDetector *detector = TRACKED_NEW plRidingAnimatedPhysicalDetector(enter, exit); plRidingAnimatedPhysicalDetector *detector = new plRidingAnimatedPhysicalDetector(enter, exit);
// Register the detector // Register the detector
//node->AddModifier(detector, IGetUniqueName(node)); //node->AddModifier(detector, IGetUniqueName(node));
plKey detectorKey = hsgResMgr::ResMgr()->NewKey(IGetUniqueName(node), detector, loc); plKey detectorKey = hsgResMgr::ResMgr()->NewKey(IGetUniqueName(node), detector, loc);
hsgResMgr::ResMgr()->AddViaNotify(detectorKey, TRACKED_NEW plObjRefMsg(obj->GetKey(), plRefMsg::kOnCreate, -1, plObjRefMsg::kModifier), plRefFlags::kActiveRef); hsgResMgr::ResMgr()->AddViaNotify(detectorKey, new plObjRefMsg(obj->GetKey(), plRefMsg::kOnCreate, -1, plObjRefMsg::kModifier), plRefFlags::kActiveRef);
return true; return true;
} }

2
Sources/Tools/MaxComponent/plPickNodeBase.cpp

@ -179,7 +179,7 @@ void plPickNodeBase::IGetSelNode(HWND hList)
else else
{ {
int len = ListBox_GetTextLen(hList, sel); int len = ListBox_GetTextLen(hList, sel);
char* buf = TRACKED_NEW char[len+1]; char* buf = new char[len+1];
ListBox_GetText(hList, sel, buf); ListBox_GetText(hList, sel, buf);
/* if (!strcmp(buf, kUserTypeNone)) /* if (!strcmp(buf, kUserTypeNone))

6
Sources/Tools/MaxComponent/plPythonFileComponent.cpp

@ -265,7 +265,7 @@ hsBool plPythonFileComponent::PreConvert(plMaxNode *node, plErrorMsg *pErrMsg)
// if this is a multi-modifier python file component then is this the main (or first) maxnode // if this is a multi-modifier python file component then is this the main (or first) maxnode
bool mainMultiModierNode = false; bool mainMultiModierNode = false;
plPythonFileMod *mod = TRACKED_NEW plPythonFileMod; plPythonFileMod *mod = new plPythonFileMod;
// create the modifier key ourselves so that we can get the name of the modifier in the name // create the modifier key ourselves so that we can get the name of the modifier in the name
plSceneObject *obj = node->GetSceneObject(); plSceneObject *obj = node->GetSceneObject();
@ -316,7 +316,7 @@ hsBool plPythonFileComponent::PreConvert(plMaxNode *node, plErrorMsg *pErrMsg)
} }
// Create us a new sceneObject to attach to // Create us a new sceneObject to attach to
obj = TRACKED_NEW plSceneObject; obj = new plSceneObject;
const plLocation &globalLoc = plPluginResManager::ResMgr()->GetCommonPage( node->GetLocation(), plAgeDescription::kGlobal ); const plLocation &globalLoc = plPluginResManager::ResMgr()->GetCommonPage( node->GetLocation(), plAgeDescription::kGlobal );
hsAssert( globalLoc.IsValid(), "Invalid common page location!!!" ); hsAssert( globalLoc.IsValid(), "Invalid common page location!!!" );
@ -355,7 +355,7 @@ hsBool plPythonFileComponent::PreConvert(plMaxNode *node, plErrorMsg *pErrMsg)
modKey = hsgResMgr::ResMgr()->NewKey(IGetUniqueName(node), mod, node->GetLocation()); modKey = hsgResMgr::ResMgr()->NewKey(IGetUniqueName(node), mod, node->GetLocation());
} }
} }
hsgResMgr::ResMgr()->AddViaNotify(modKey, TRACKED_NEW plObjRefMsg(obj->GetKey(), plRefMsg::kOnCreate, -1, plObjRefMsg::kModifier), plRefFlags::kActiveRef); hsgResMgr::ResMgr()->AddViaNotify(modKey, new plObjRefMsg(obj->GetKey(), plRefMsg::kOnCreate, -1, plObjRefMsg::kModifier), plRefFlags::kActiveRef);
fModKeys[node] = modKey; fModKeys[node] = modKey;
// only let non-multimodifier or multimodifier then only the main node register for notifies // only let non-multimodifier or multimodifier then only the main node register for notifies

8
Sources/Tools/MaxComponent/plResponderAnim.cpp

@ -330,7 +330,7 @@ plMessage *plResponderCmdAnim::ICreateAnimMsg(plMaxNode* node, plErrorMsg *pErrM
if (!animKey) if (!animKey)
throw "Animation component didn't convert"; throw "Animation component didn't convert";
plAnimCmdMsg *msg = TRACKED_NEW plAnimCmdMsg; plAnimCmdMsg *msg = new plAnimCmdMsg;
msg->AddReceiver(animKey); msg->AddReceiver(animKey);
const char *tempAnimName = comp->GetAnimName(); const char *tempAnimName = comp->GetAnimName();
@ -409,7 +409,7 @@ plMessage* plResponderCmdAnim::ICreateSndMsg(plMaxNode* node, plErrorMsg *pErrMs
const plAudioInterface *ai = targNode->GetSceneObject()->GetAudioInterface(); const plAudioInterface *ai = targNode->GetSceneObject()->GetAudioInterface();
plKey key = ai->GetKey(); plKey key = ai->GetKey();
plSoundMsg* msg = TRACKED_NEW plSoundMsg; plSoundMsg* msg = new plSoundMsg;
msg->AddReceiver(key); msg->AddReceiver(key);
msg->fIndex = soundIdx; msg->fIndex = soundIdx;
@ -440,7 +440,7 @@ plMessage* plResponderCmdAnim::ICreateSndMsg(plMaxNode* node, plErrorMsg *pErrMs
plKey key = plAudioComp::GetRandomSoundKey(comp, targNode); plKey key = plAudioComp::GetRandomSoundKey(comp, targNode);
if (key) if (key)
{ {
plAnimCmdMsg *msg = TRACKED_NEW plAnimCmdMsg; plAnimCmdMsg *msg = new plAnimCmdMsg;
msg->AddReceiver(key); msg->AddReceiver(key);
if (type == kRespondPlayRndSound) if (type == kRespondPlayRndSound)
@ -502,7 +502,7 @@ void plResponderCmdAnim::CreateWait(plMaxNode* node, plErrorMsg* pErrMsg, IParam
if (soundMsg) if (soundMsg)
soundMsg->SetCmd(plSoundMsg::kAddCallbacks); soundMsg->SetCmd(plSoundMsg::kAddCallbacks);
plEventCallbackMsg *eventMsg = TRACKED_NEW plEventCallbackMsg; plEventCallbackMsg *eventMsg = new plEventCallbackMsg;
eventMsg->AddReceiver(waitInfo.receiver); eventMsg->AddReceiver(waitInfo.receiver);
eventMsg->fRepeats = 0; eventMsg->fRepeats = 0;
eventMsg->fUser = waitInfo.callbackUser; eventMsg->fUser = waitInfo.callbackUser;

4
Sources/Tools/MaxComponent/plResponderComponent.cpp

@ -338,9 +338,9 @@ hsBool plResponderComponent::PreConvert(plMaxNode *node,plErrorMsg *pErrMsg)
plLocation loc = node->GetLocation(); plLocation loc = node->GetLocation();
// Create and register the RESPONDER's logic component // Create and register the RESPONDER's logic component
plResponderModifier *responder = TRACKED_NEW plResponderModifier; plResponderModifier *responder = new plResponderModifier;
plKey responderKey = hsgResMgr::ResMgr()->NewKey(IGetUniqueName(node), responder, loc); plKey responderKey = hsgResMgr::ResMgr()->NewKey(IGetUniqueName(node), responder, loc);
hsgResMgr::ResMgr()->AddViaNotify(responderKey, TRACKED_NEW plObjRefMsg(rObj->GetKey(), plRefMsg::kOnCreate, -1, plObjRefMsg::kModifier), plRefFlags::kActiveRef); hsgResMgr::ResMgr()->AddViaNotify(responderKey, new plObjRefMsg(rObj->GetKey(), plRefMsg::kOnCreate, -1, plObjRefMsg::kModifier), plRefFlags::kActiveRef);
// Tell all the activators to notify us // Tell all the activators to notify us
for (int i = 0; i < fCompPB->Count(kResponderActivators); i++) for (int i = 0; i < fCompPB->Count(kResponderActivators); i++)

30
Sources/Tools/MaxComponent/plResponderLink.cpp

@ -249,7 +249,7 @@ plMessage *plResponderCmdLink::CreateMsg(plMaxNode* node, plErrorMsg *pErrMsg, I
if ( !ageLinkInAnimName ) if ( !ageLinkInAnimName )
ageLinkInAnimName = kDefaultLinkInAnimName; ageLinkInAnimName = kDefaultLinkInAnimName;
plLinkToAgeMsg *msg = TRACKED_NEW plLinkToAgeMsg; plLinkToAgeMsg *msg = new plLinkToAgeMsg;
msg->GetAgeLink()->SetLinkingRules( linkingRule ); msg->GetAgeLink()->SetLinkingRules( linkingRule );
msg->GetAgeLink()->SetSpawnPoint( plSpawnPointInfo( ageSpawnPtTitle, ageSpawnPtName ) ); msg->GetAgeLink()->SetSpawnPoint( plSpawnPointInfo( ageSpawnPtTitle, ageSpawnPtName ) );
msg->GetAgeLink()->GetAgeInfo()->SetAgeFilename( ageFilename ); msg->GetAgeLink()->GetAgeInfo()->SetAgeFilename( ageFilename );
@ -490,7 +490,7 @@ plMessage *plResponderCmdEnable::CreateMsg(plMaxNode* node, plErrorMsg *pErrMsg,
BOOL enable = pb->GetInt(kEnable); BOOL enable = pb->GetInt(kEnable);
plResponderEnableMsg *msg = TRACKED_NEW plResponderEnableMsg; plResponderEnableMsg *msg = new plResponderEnableMsg;
msg->fEnable = (enable != false); msg->fEnable = (enable != false);
plMaxNodeBase *respondNode = (plMaxNodeBase*)pb->GetReferenceTarget(kEnableNode); plMaxNodeBase *respondNode = (plMaxNodeBase*)pb->GetReferenceTarget(kEnableNode);
@ -559,7 +559,7 @@ plMessage *plResponderCmdPhysEnable::CreateMsg(plMaxNode* node, plErrorMsg *pErr
BOOL enable = pb->GetInt(kEnable); BOOL enable = pb->GetInt(kEnable);
plEnableMsg* enableMsg = TRACKED_NEW plEnableMsg; plEnableMsg* enableMsg = new plEnableMsg;
enableMsg->SetCmd(plEnableMsg::kPhysical); enableMsg->SetCmd(plEnableMsg::kPhysical);
enableMsg->SetCmd(enable ? plEnableMsg::kEnable : plEnableMsg::kDisable); enableMsg->SetCmd(enable ? plEnableMsg::kEnable : plEnableMsg::kDisable);
enableMsg->AddReceiver(physNode->GetKey()); enableMsg->AddReceiver(physNode->GetKey());
@ -672,7 +672,7 @@ plMessage *plResponderCmdOneShot::CreateMsg(plMaxNode* node, plErrorMsg *pErrMsg
if (!oneShotKey) if (!oneShotKey)
throw "One-shot component didn't convert"; throw "One-shot component didn't convert";
plOneShotMsg *msg = TRACKED_NEW plOneShotMsg; plOneShotMsg *msg = new plOneShotMsg;
msg->AddReceiver(oneShotKey); msg->AddReceiver(oneShotKey);
return msg; return msg;
} }
@ -715,7 +715,7 @@ ParamBlockDesc2 *plResponderCmdNotify::GetDesc()
plMessage *plResponderCmdNotify::CreateMsg(plMaxNode* node, plErrorMsg *pErrMsg, IParamBlock2 *pb) plMessage *plResponderCmdNotify::CreateMsg(plMaxNode* node, plErrorMsg *pErrMsg, IParamBlock2 *pb)
{ {
plNotifyMsg *msg = TRACKED_NEW plNotifyMsg; plNotifyMsg *msg = new plNotifyMsg;
msg->SetBCastFlag(plMessage::kNetPropagate, 0); msg->SetBCastFlag(plMessage::kNetPropagate, 0);
msg->SetState(1.0); // set to positive state msg->SetState(1.0); // set to positive state
msg->AddCallbackEvent(1); // create an event record with callback msg->AddCallbackEvent(1); // create an event record with callback
@ -825,7 +825,7 @@ plMessage *plResponderCmdDetectorEnable::CreateMsg(plMaxNode* node, plErrorMsg *
// Just stuffing this in here because I'm lazy // Just stuffing this in here because I'm lazy
if (comp->ClassID() == CAM_REGION_CID) if (comp->ClassID() == CAM_REGION_CID)
{ {
plEnableMsg* enableMsg = TRACKED_NEW plEnableMsg; plEnableMsg* enableMsg = new plEnableMsg;
enableMsg->SetCmd(plEnableMsg::kPhysical); enableMsg->SetCmd(plEnableMsg::kPhysical);
enableMsg->SetCmd(enable ? plEnableMsg::kEnable : plEnableMsg::kDisable); enableMsg->SetCmd(enable ? plEnableMsg::kEnable : plEnableMsg::kDisable);
@ -835,7 +835,7 @@ plMessage *plResponderCmdDetectorEnable::CreateMsg(plMaxNode* node, plErrorMsg *
return enableMsg; return enableMsg;
} }
plEnableMsg *msg = TRACKED_NEW plEnableMsg; plEnableMsg *msg = new plEnableMsg;
msg->SetCmd(enable ? plEnableMsg::kEnable : plEnableMsg::kDisable); msg->SetCmd(enable ? plEnableMsg::kEnable : plEnableMsg::kDisable);
hsTArray<plKey> keys; hsTArray<plKey> keys;
@ -1018,7 +1018,7 @@ plMessage *plResponderCmdXRegion::CreateMsg(plMaxNode* node, plErrorMsg *pErrMsg
{ {
plExcludeRegionComponent *xComp = (plExcludeRegionComponent*)comp; plExcludeRegionComponent *xComp = (plExcludeRegionComponent*)comp;
plExcludeRegionMsg *msg = TRACKED_NEW plExcludeRegionMsg; plExcludeRegionMsg *msg = new plExcludeRegionMsg;
int type = pb->GetInt(kXRegionType); int type = pb->GetInt(kXRegionType);
switch (type) switch (type)
@ -1115,7 +1115,7 @@ plMessage *plResponderCmdCamTransition::CreateMsg(plMaxNode* node, plErrorMsg *p
if (fail) if (fail)
throw "Invalid Camera Specified"; throw "Invalid Camera Specified";
plCameraMsg* pMsg = TRACKED_NEW plCameraMsg; plCameraMsg* pMsg = new plCameraMsg;
pMsg->SetBCastFlag(plMessage::kBCastByType); pMsg->SetBCastFlag(plMessage::kBCastByType);
if(pCamNode->CanConvert()) if(pCamNode->CanConvert())
@ -1185,7 +1185,7 @@ const char *plResponderCmdCamForce::GetInstanceName(IParamBlock2 *pb)
plMessage *plResponderCmdCamForce::CreateMsg(plMaxNode* node, plErrorMsg *pErrMsg, IParamBlock2 *pb) plMessage *plResponderCmdCamForce::CreateMsg(plMaxNode* node, plErrorMsg *pErrMsg, IParamBlock2 *pb)
{ {
plCameraMsg* msg = TRACKED_NEW plCameraMsg; plCameraMsg* msg = new plCameraMsg;
msg->SetBCastFlag(plMessage::kBCastByType); msg->SetBCastFlag(plMessage::kBCastByType);
msg->SetBCastFlag(plMessage::kNetPropagate, false); msg->SetBCastFlag(plMessage::kNetPropagate, false);
@ -1241,7 +1241,7 @@ plMessage *plResponderCmdDelay::CreateMsg(plMaxNode* node, plErrorMsg *pErrMsg,
{ {
float time = pb->GetFloat(kDelayTime); float time = pb->GetFloat(kDelayTime);
plTimerCallbackMsg *msg = TRACKED_NEW plTimerCallbackMsg; plTimerCallbackMsg *msg = new plTimerCallbackMsg;
msg->fTime = time; msg->fTime = time;
msg->fID = uint32_t(-1); msg->fID = uint32_t(-1);
@ -1380,7 +1380,7 @@ plMessage *plResponderCmdVisibility::CreateMsg(plMaxNode* node, plErrorMsg *pErr
plMaxNode* visNode = (plMaxNode*)pb->GetINode(kVisibilityNode); plMaxNode* visNode = (plMaxNode*)pb->GetINode(kVisibilityNode);
if (visNode) if (visNode)
{ {
plEnableMsg* msg = TRACKED_NEW plEnableMsg; plEnableMsg* msg = new plEnableMsg;
msg->SetCmd(plEnableMsg::kDrawable); msg->SetCmd(plEnableMsg::kDrawable);
int type = pb->GetInt(kVisibilityType); int type = pb->GetInt(kVisibilityType);
@ -1551,7 +1551,7 @@ plMessage *plResponderCmdSubWorld::CreateMsg(plMaxNode* node, plErrorMsg *pErrMs
break; break;
} }
plSubWorldMsg * swMsg = TRACKED_NEW plSubWorldMsg(nilKey, nilKey2, worldKey); plSubWorldMsg * swMsg = new plSubWorldMsg(nilKey, nilKey2, worldKey);
return swMsg; return swMsg;
} }
@ -1629,7 +1629,7 @@ const char *plResponderCmdFootSurface::GetInstanceName(IParamBlock2 *pb)
plMessage *plResponderCmdFootSurface::CreateMsg(plMaxNode* node, plErrorMsg *pErrMsg, IParamBlock2 *pb) plMessage *plResponderCmdFootSurface::CreateMsg(plMaxNode* node, plErrorMsg *pErrMsg, IParamBlock2 *pb)
{ {
plArmatureEffectStateMsg* msg = TRACKED_NEW plArmatureEffectStateMsg; plArmatureEffectStateMsg* msg = new plArmatureEffectStateMsg;
msg->SetBCastFlag(plMessage::kPropagateToModifiers); msg->SetBCastFlag(plMessage::kPropagateToModifiers);
msg->SetBCastFlag(plMessage::kNetPropagate); msg->SetBCastFlag(plMessage::kNetPropagate);
msg->fSurface = pb->GetInt(kSurface); msg->fSurface = pb->GetInt(kSurface);
@ -1729,7 +1729,7 @@ plMessage *plResponderCmdMultistage::CreateMsg(plMaxNode* node, plErrorMsg *pErr
plMaxNodeBase *targNode; plMaxNodeBase *targNode;
if (compNode.GetCompAndNode(comp, targNode)) if (compNode.GetCompAndNode(comp, targNode))
{ {
plNotifyMsg* msg = TRACKED_NEW plNotifyMsg; plNotifyMsg* msg = new plNotifyMsg;
msg->SetState(1.f); msg->SetState(1.f);
// Will actually be set to the player key at runtime // Will actually be set to the player key at runtime

4
Sources/Tools/MaxComponent/plResponderMtl.cpp

@ -374,7 +374,7 @@ plMessage *plResponderCmdMtl::CreateMsg(plMaxNode* node, plErrorMsg *pErrMsg, IP
throw "Material animation key(s) not found"; throw "Material animation key(s) not found";
} }
plAnimCmdMsg *msg = TRACKED_NEW plAnimCmdMsg; plAnimCmdMsg *msg = new plAnimCmdMsg;
msg->AddReceivers(keys); msg->AddReceivers(keys);
switch (pb->GetInt(kMtlType)) switch (pb->GetInt(kMtlType))
@ -462,7 +462,7 @@ void plResponderCmdMtl::CreateWait(plMaxNode* node, plErrorMsg* pErrMsg, IParamB
if (animMsg) if (animMsg)
animMsg->SetCmd(plAnimCmdMsg::kAddCallbacks); animMsg->SetCmd(plAnimCmdMsg::kAddCallbacks);
plEventCallbackMsg *eventMsg = TRACKED_NEW plEventCallbackMsg; plEventCallbackMsg *eventMsg = new plEventCallbackMsg;
eventMsg->AddReceiver(waitInfo.receiver); eventMsg->AddReceiver(waitInfo.receiver);
eventMsg->fRepeats = 0; eventMsg->fRepeats = 0;
eventMsg->fEvent = kStop; eventMsg->fEvent = kStop;

4
Sources/Tools/MaxComponent/plSeekPoint.cpp

@ -106,11 +106,11 @@ plSeekPointComponent::plSeekPointComponent()
hsBool plSeekPointComponent::Convert(plMaxNode *node, plErrorMsg *pErrMsg) hsBool plSeekPointComponent::Convert(plMaxNode *node, plErrorMsg *pErrMsg)
{ {
const char *objName = node->GetName(); const char *objName = node->GetName();
char *name = TRACKED_NEW char[strlen(objName) + 1]; char *name = new char[strlen(objName) + 1];
strcpy(name, objName); strcpy(name, objName);
plSeekPointMod* pointMod = TRACKED_NEW plSeekPointMod(name); plSeekPointMod* pointMod = new plSeekPointMod(name);
node->AddModifier(pointMod, IGetUniqueName(node)); node->AddModifier(pointMod, IGetUniqueName(node));
return true; return true;
} }

12
Sources/Tools/MaxComponent/plShadowComponents.cpp

@ -207,7 +207,7 @@ hsBool plShadowCastComponent::Convert(plMaxNode *node, plErrorMsg *pErrMsg)
const float kBoostPercentToAbs = 1.e-2f; const float kBoostPercentToAbs = 1.e-2f;
if( !fCaster ) if( !fCaster )
{ {
fCaster = TRACKED_NEW plShadowCaster; fCaster = new plShadowCaster;
plLoadMask lm(QualityBitToMask(fCompPB->GetInt(kQuality)), QualityBitToMask(0)); plLoadMask lm(QualityBitToMask(fCompPB->GetInt(kQuality)), QualityBitToMask(0));
hsgResMgr::ResMgr()->NewKey(IGetUniqueName(node), fCaster, node->GetLocation(), lm); hsgResMgr::ResMgr()->NewKey(IGetUniqueName(node), fCaster, node->GetLocation(), lm);
fCaster->SetSelfShadow(fCompPB->GetInt(kSelfShadow)); fCaster->SetSelfShadow(fCompPB->GetInt(kSelfShadow));
@ -260,7 +260,7 @@ hsBool plShadowCastComponent::AddShadowCastModifier(plSceneObject* so, plShadowC
} }
// Okay, we're clear, just add via notify. // Okay, we're clear, just add via notify.
hsgResMgr::ResMgr()->AddViaNotify(caster->GetKey(), TRACKED_NEW plObjRefMsg(so->GetKey(), plRefMsg::kOnCreate, -1, plObjRefMsg::kModifier), plRefFlags::kActiveRef); hsgResMgr::ResMgr()->AddViaNotify(caster->GetKey(), new plObjRefMsg(so->GetKey(), plRefMsg::kOnCreate, -1, plObjRefMsg::kModifier), plRefFlags::kActiveRef);
return true; return true;
} }
@ -415,7 +415,7 @@ hsBool plShadowLightComponent::Convert(plMaxNode *node, plErrorMsg *pErrMsg)
hsBool plShadowLightComponent::IAddDirectMaster(plMaxNode* node, plSceneObject* so) hsBool plShadowLightComponent::IAddDirectMaster(plMaxNode* node, plSceneObject* so)
{ {
plDirectShadowMaster* directMaster = TRACKED_NEW plDirectShadowMaster; plDirectShadowMaster* directMaster = new plDirectShadowMaster;
plLoadMask lm(QualityBitToMask(fCompPB->GetInt(kQuality)), QualityBitToMask(0)); plLoadMask lm(QualityBitToMask(fCompPB->GetInt(kQuality)), QualityBitToMask(0));
hsgResMgr::ResMgr()->NewKey(IGetUniqueName(node), directMaster, node->GetLocation(), lm); hsgResMgr::ResMgr()->NewKey(IGetUniqueName(node), directMaster, node->GetLocation(), lm);
@ -428,13 +428,13 @@ hsBool plShadowLightComponent::IAddDirectMaster(plMaxNode* node, plSceneObject*
directMaster->SetProperty(plShadowMaster::kSelfShadow, fCompPB->GetInt(kSelfShadow)); directMaster->SetProperty(plShadowMaster::kSelfShadow, fCompPB->GetInt(kSelfShadow));
hsgResMgr::ResMgr()->AddViaNotify(directMaster->GetKey(), TRACKED_NEW plObjRefMsg(so->GetKey(), plRefMsg::kOnCreate, -1, plObjRefMsg::kInterface), plRefFlags::kActiveRef); hsgResMgr::ResMgr()->AddViaNotify(directMaster->GetKey(), new plObjRefMsg(so->GetKey(), plRefMsg::kOnCreate, -1, plObjRefMsg::kInterface), plRefFlags::kActiveRef);
return true; return true;
} }
hsBool plShadowLightComponent::IAddPointMaster(plMaxNode* node, plSceneObject* so) hsBool plShadowLightComponent::IAddPointMaster(plMaxNode* node, plSceneObject* so)
{ {
plPointShadowMaster* pointMaster = TRACKED_NEW plPointShadowMaster; plPointShadowMaster* pointMaster = new plPointShadowMaster;
plLoadMask lm(QualityBitToMask(fCompPB->GetInt(kQuality)), QualityBitToMask(0)); plLoadMask lm(QualityBitToMask(fCompPB->GetInt(kQuality)), QualityBitToMask(0));
hsgResMgr::ResMgr()->NewKey(IGetUniqueName(node), pointMaster, node->GetLocation(), lm); hsgResMgr::ResMgr()->NewKey(IGetUniqueName(node), pointMaster, node->GetLocation(), lm);
@ -447,7 +447,7 @@ hsBool plShadowLightComponent::IAddPointMaster(plMaxNode* node, plSceneObject* s
pointMaster->SetProperty(plShadowMaster::kSelfShadow, fCompPB->GetInt(kSelfShadow)); pointMaster->SetProperty(plShadowMaster::kSelfShadow, fCompPB->GetInt(kSelfShadow));
hsgResMgr::ResMgr()->AddViaNotify(pointMaster->GetKey(), TRACKED_NEW plObjRefMsg(so->GetKey(), plRefMsg::kOnCreate, -1, plObjRefMsg::kInterface), plRefFlags::kActiveRef); hsgResMgr::ResMgr()->AddViaNotify(pointMaster->GetKey(), new plObjRefMsg(so->GetKey(), plRefMsg::kOnCreate, -1, plObjRefMsg::kInterface), plRefFlags::kActiveRef);
return true; return true;
} }

46
Sources/Tools/MaxComponent/plSoftVolumeComponent.cpp

@ -243,7 +243,7 @@ plSoftVolBaseComponent* plSoftVolBaseComponent::GetSoftComponent(plComponentBase
void plSoftVolBaseComponent::IAddSubVolume(plKey masterKey, plKey subKey) void plSoftVolBaseComponent::IAddSubVolume(plKey masterKey, plKey subKey)
{ {
if( masterKey && subKey ) if( masterKey && subKey )
hsgResMgr::ResMgr()->AddViaNotify(subKey, TRACKED_NEW plGenRefMsg(masterKey, plRefMsg::kOnCreate, 0, plSoftVolume::kSubVolume), plRefFlags::kActiveRef); hsgResMgr::ResMgr()->AddViaNotify(subKey, new plGenRefMsg(masterKey, plRefMsg::kOnCreate, 0, plSoftVolume::kSubVolume), plRefFlags::kActiveRef);
} }
plKey plSoftVolBaseComponent::ISetVolumeKey(plSoftVolume* vol) plKey plSoftVolBaseComponent::ISetVolumeKey(plSoftVolume* vol)
@ -265,7 +265,7 @@ plKey plSoftVolBaseComponent::IInvertVolume(plKey subKey)
if( !subKey ) if( !subKey )
return nil; return nil;
plSoftVolumeInvert* invert = TRACKED_NEW plSoftVolumeInvert; plSoftVolumeInvert* invert = new plSoftVolumeInvert;
plKey invertKey = ISetVolumeKey(invert); plKey invertKey = ISetVolumeKey(invert);
IAddSubVolume(invertKey, subKey); IAddSubVolume(invertKey, subKey);
@ -454,7 +454,7 @@ plKey plSoftVolComponent::ICreateSoftVolume()
return fSoftKey = ICreateFromNode(GetTarget(0)); return fSoftKey = ICreateFromNode(GetTarget(0));
} }
plSoftVolumeUnion* compound = TRACKED_NEW plSoftVolumeUnion; plSoftVolumeUnion* compound = new plSoftVolumeUnion;
fSoftKey = ISetVolumeKey(compound); fSoftKey = ISetVolumeKey(compound);
int i; int i;
@ -507,7 +507,7 @@ plKey plSoftVolComponent::ICreateFromDummyObject(plMaxNodeBase* pNode, Object* o
DummyObject* dummy = (DummyObject*)obj; DummyObject* dummy = (DummyObject*)obj;
Box3 bnd = dummy->GetBox(); Box3 bnd = dummy->GetBox();
plParallelIsect* isect = TRACKED_NEW plParallelIsect; plParallelIsect* isect = new plParallelIsect;
isect->SetNumPlanes(3); isect->SetNumPlanes(3);
hsMatrix44 v2l = pNode->GetVertToLocal44(); hsMatrix44 v2l = pNode->GetVertToLocal44();
@ -539,7 +539,7 @@ plKey plSoftVolComponent::ICreateFromTriObject(plMaxNodeBase* pNode, Object* obj
hsMatrix44 v2l = pNode->GetVertToLocal44(); hsMatrix44 v2l = pNode->GetVertToLocal44();
hsMatrix44 l2v = pNode->GetLocalToVert44(); hsMatrix44 l2v = pNode->GetLocalToVert44();
plConvexIsect* isect = TRACKED_NEW plConvexIsect; plConvexIsect* isect = new plConvexIsect;
int i; int i;
for( i = 0; i < mesh->getNumFaces(); i++ ) for( i = 0; i < mesh->getNumFaces(); i++ )
{ {
@ -574,7 +574,7 @@ plKey plSoftVolComponent::ISetFromIsect(plMaxNodeBase* pNode, plVolumeIsect* ise
{ {
isect->SetTransform(pNode->GetLocalToWorld44(), pNode->GetWorldToLocal44()); isect->SetTransform(pNode->GetLocalToWorld44(), pNode->GetWorldToLocal44());
plSoftVolumeSimple* simple = TRACKED_NEW plSoftVolumeSimple; plSoftVolumeSimple* simple = new plSoftVolumeSimple;
simple->SetVolume(isect); simple->SetVolume(isect);
simple->SetDistance(fCompPB->GetFloat(kSoftDistance)); simple->SetDistance(fCompPB->GetFloat(kSoftDistance));
@ -588,7 +588,7 @@ plKey plSoftVolComponent::ISetFromIsect(plMaxNodeBase* pNode, plVolumeIsect* ise
plKey retVal = ISetVolumeKey(simple); plKey retVal = ISetVolumeKey(simple);
hsgResMgr::ResMgr()->AddViaNotify(simple->GetKey(), TRACKED_NEW plObjRefMsg(sceneObj->GetKey(), plRefMsg::kOnCreate, -1, plObjRefMsg::kInterface), plRefFlags::kActiveRef); hsgResMgr::ResMgr()->AddViaNotify(simple->GetKey(), new plObjRefMsg(sceneObj->GetKey(), plRefMsg::kOnCreate, -1, plObjRefMsg::kInterface), plRefFlags::kActiveRef);
return retVal; return retVal;
} }
@ -732,7 +732,7 @@ plKey plSoftVolUnionComponent::ICreateSoftVolume()
if( numSubs < 2 ) if( numSubs < 2 )
return fSoftKey = plSoftVolBaseComponent::GetSoftComponent(fCompPB->GetINode(kSubVolumes, 0, 0))->GetSoftVolume(); return fSoftKey = plSoftVolBaseComponent::GetSoftComponent(fCompPB->GetINode(kSubVolumes, 0, 0))->GetSoftVolume();
plSoftVolumeUnion* compound = TRACKED_NEW plSoftVolumeUnion; plSoftVolumeUnion* compound = new plSoftVolumeUnion;
fSoftKey = ISetVolumeKey(compound); fSoftKey = ISetVolumeKey(compound);
int i; int i;
@ -893,7 +893,7 @@ plKey plSoftVolIsectComponent::ICreateSoftVolume()
if( numSubs < 2 ) if( numSubs < 2 )
return fSoftKey = plSoftVolBaseComponent::GetSoftComponent(fCompPB->GetINode(kSubVolumes, 0, 0))->GetSoftVolume(); return fSoftKey = plSoftVolBaseComponent::GetSoftComponent(fCompPB->GetINode(kSubVolumes, 0, 0))->GetSoftVolume();
plSoftVolumeIntersect* compound = TRACKED_NEW plSoftVolumeIntersect; plSoftVolumeIntersect* compound = new plSoftVolumeIntersect;
fSoftKey = ISetVolumeKey(compound); fSoftKey = ISetVolumeKey(compound);
int i; int i;
@ -1129,7 +1129,7 @@ hsBool plLightRegionComponent::Convert(plMaxNode *node, plErrorMsg *errMsg)
if( !softKey ) if( !softKey )
return true; return true;
hsgResMgr::ResMgr()->AddViaNotify(softKey, TRACKED_NEW plGenRefMsg(li->GetKey(), plRefMsg::kOnCreate, 0, plLightInfo::kSoftVolume), plRefFlags::kActiveRef); hsgResMgr::ResMgr()->AddViaNotify(softKey, new plGenRefMsg(li->GetKey(), plRefMsg::kOnCreate, 0, plLightInfo::kSoftVolume), plRefFlags::kActiveRef);
return true; return true;
} }
@ -1298,7 +1298,7 @@ void plVisRegionComponent::ICheckVisRegion(const plLocation& loc)
if( !softKey ) if( !softKey )
return; return;
fVisReg = TRACKED_NEW plVisRegion; fVisReg = new plVisRegion;
plKey key = hsgResMgr::ResMgr()->NewKey(GetINode()->GetName(), fVisReg, loc); plKey key = hsgResMgr::ResMgr()->NewKey(GetINode()->GetName(), fVisReg, loc);
@ -1309,7 +1309,7 @@ void plVisRegionComponent::ICheckVisRegion(const plLocation& loc)
fVisReg->SetProperty(plVisRegion::kReplaceNormal, true); fVisReg->SetProperty(plVisRegion::kReplaceNormal, true);
fVisReg->SetProperty(plVisRegion::kDisableNormal, disableNormal); fVisReg->SetProperty(plVisRegion::kDisableNormal, disableNormal);
plGenRefMsg* refMsg = TRACKED_NEW plGenRefMsg(fVisReg->GetKey(), plRefMsg::kOnCreate, 0, plVisRegion::kRefRegion); plGenRefMsg* refMsg = new plGenRefMsg(fVisReg->GetKey(), plRefMsg::kOnCreate, 0, plVisRegion::kRefRegion);
hsgResMgr::ResMgr()->SendRef(softKey, refMsg, plRefFlags::kActiveRef); hsgResMgr::ResMgr()->SendRef(softKey, refMsg, plRefFlags::kActiveRef);
} }
} }
@ -1338,21 +1338,21 @@ hsBool plVisRegionComponent::Convert(plMaxNode *node, plErrorMsg *errMsg)
return true; return true;
if( di ) if( di )
hsgResMgr::ResMgr()->AddViaNotify(fVisReg->GetKey(), TRACKED_NEW plGenRefMsg(di->GetKey(), plRefMsg::kOnCreate, 0, plDrawInterface::kRefVisRegion), plRefFlags::kActiveRef); hsgResMgr::ResMgr()->AddViaNotify(fVisReg->GetKey(), new plGenRefMsg(di->GetKey(), plRefMsg::kOnCreate, 0, plDrawInterface::kRefVisRegion), plRefFlags::kActiveRef);
if( occ ) if( occ )
{ {
hsgResMgr::ResMgr()->AddViaNotify(fVisReg->GetKey(), TRACKED_NEW plGenRefMsg(occ->GetKey(), plRefMsg::kOnCreate, 0, plOccluder::kRefVisRegion), plRefFlags::kActiveRef); hsgResMgr::ResMgr()->AddViaNotify(fVisReg->GetKey(), new plGenRefMsg(occ->GetKey(), plRefMsg::kOnCreate, 0, plOccluder::kRefVisRegion), plRefFlags::kActiveRef);
} }
if( li ) if( li )
{ {
hsgResMgr::ResMgr()->AddViaNotify(fVisReg->GetKey(), TRACKED_NEW plGenRefMsg(li->GetKey(), plRefMsg::kOnCreate, 0, plLightInfo::kVisRegion), plRefFlags::kActiveRef); hsgResMgr::ResMgr()->AddViaNotify(fVisReg->GetKey(), new plGenRefMsg(li->GetKey(), plRefMsg::kOnCreate, 0, plLightInfo::kVisRegion), plRefFlags::kActiveRef);
} }
if( !(di || occ || li) ) if( !(di || occ || li) )
{ {
hsgResMgr::ResMgr()->AddViaNotify(fVisReg->GetKey(), TRACKED_NEW plObjRefMsg(obj->GetKey(), plRefMsg::kOnCreate, -1, plObjRefMsg::kInterface), plRefFlags::kActiveRef); hsgResMgr::ResMgr()->AddViaNotify(fVisReg->GetKey(), new plObjRefMsg(obj->GetKey(), plRefMsg::kOnCreate, -1, plObjRefMsg::kInterface), plRefFlags::kActiveRef);
} }
return true; return true;
@ -1464,14 +1464,14 @@ hsBool plRelevanceRegionComponent::Convert(plMaxNode *node, plErrorMsg *errMsg)
if( !softKey ) if( !softKey )
return true; return true;
fRegion = TRACKED_NEW plRelevanceRegion; fRegion = new plRelevanceRegion;
plKey key = hsgResMgr::ResMgr()->NewKey(GetINode()->GetName(), fRegion, node->GetLocation()); plKey key = hsgResMgr::ResMgr()->NewKey(GetINode()->GetName(), fRegion, node->GetLocation());
plGenRefMsg* refMsg = TRACKED_NEW plGenRefMsg(fRegion->GetKey(), plRefMsg::kOnCreate, 0, 0); plGenRefMsg* refMsg = new plGenRefMsg(fRegion->GetKey(), plRefMsg::kOnCreate, 0, 0);
hsgResMgr::ResMgr()->SendRef(softKey, refMsg, plRefFlags::kActiveRef); hsgResMgr::ResMgr()->SendRef(softKey, refMsg, plRefFlags::kActiveRef);
} }
hsgResMgr::ResMgr()->AddViaNotify(fRegion->GetKey(), TRACKED_NEW plObjRefMsg(obj->GetKey(), plRefMsg::kOnCreate, 0, plObjRefMsg::kInterface), plRefFlags::kActiveRef); hsgResMgr::ResMgr()->AddViaNotify(fRegion->GetKey(), new plObjRefMsg(obj->GetKey(), plRefMsg::kOnCreate, 0, plObjRefMsg::kInterface), plRefFlags::kActiveRef);
return true; return true;
} }
@ -1532,16 +1532,16 @@ hsBool plEffVisSetComponent::Convert(plMaxNode *node, plErrorMsg *errMsg)
return false; return false;
if( di ) if( di )
hsgResMgr::ResMgr()->AddViaNotify(fVisReg->GetKey(), TRACKED_NEW plGenRefMsg(di->GetKey(), plRefMsg::kOnCreate, 0, plDrawInterface::kRefVisRegion), plRefFlags::kActiveRef); hsgResMgr::ResMgr()->AddViaNotify(fVisReg->GetKey(), new plGenRefMsg(di->GetKey(), plRefMsg::kOnCreate, 0, plDrawInterface::kRefVisRegion), plRefFlags::kActiveRef);
if( occ ) if( occ )
{ {
hsgResMgr::ResMgr()->AddViaNotify(fVisReg->GetKey(), TRACKED_NEW plGenRefMsg(occ->GetKey(), plRefMsg::kOnCreate, 0, plOccluder::kRefVisRegion), plRefFlags::kActiveRef); hsgResMgr::ResMgr()->AddViaNotify(fVisReg->GetKey(), new plGenRefMsg(occ->GetKey(), plRefMsg::kOnCreate, 0, plOccluder::kRefVisRegion), plRefFlags::kActiveRef);
} }
if( li ) if( li )
{ {
hsgResMgr::ResMgr()->AddViaNotify(fVisReg->GetKey(), TRACKED_NEW plGenRefMsg(li->GetKey(), plRefMsg::kOnCreate, 0, plLightInfo::kVisRegion), plRefFlags::kActiveRef); hsgResMgr::ResMgr()->AddViaNotify(fVisReg->GetKey(), new plGenRefMsg(li->GetKey(), plRefMsg::kOnCreate, 0, plLightInfo::kVisRegion), plRefFlags::kActiveRef);
} }
return true; return true;
@ -1560,7 +1560,7 @@ plVisRegion* plEffVisSetComponent::GetVisRegion(plMaxNode* node)
{ {
if( !fVisReg ) if( !fVisReg )
{ {
fVisReg = TRACKED_NEW plVisRegion; fVisReg = new plVisRegion;
plKey key = hsgResMgr::ResMgr()->NewKey(GetINode()->GetName(), fVisReg, node->GetLocation()); plKey key = hsgResMgr::ResMgr()->NewKey(GetINode()->GetName(), fVisReg, node->GetLocation());
fVisReg->SetProperty(plVisRegion::kIsNot, false); fVisReg->SetProperty(plVisRegion::kIsNot, false);

2
Sources/Tools/MaxComponent/plTemplateComponent.cpp

@ -224,7 +224,7 @@ hsBool plSpawnComponent::Convert(plMaxNode *node, plErrorMsg *pErrMsg)
if (!templateName) if (!templateName)
return false; return false;
plCloneSpawnModifier* mod = TRACKED_NEW plCloneSpawnModifier; plCloneSpawnModifier* mod = new plCloneSpawnModifier;
mod->SetExportTime(); mod->SetExportTime();
mod->SetTemplateName(templateName); mod->SetTemplateName(templateName);
node->AddModifier(mod, IGetUniqueName(node)); node->AddModifier(mod, IGetUniqueName(node));

8
Sources/Tools/MaxComponent/plTypesComponents.cpp

@ -113,7 +113,7 @@ hsBool plStartingPointComponent::SetupProperties(plMaxNode* node, plErrorMsg* pE
} }
hsBool plStartingPointComponent::Convert(plMaxNode *node, plErrorMsg *pErrMsg) hsBool plStartingPointComponent::Convert(plMaxNode *node, plErrorMsg *pErrMsg)
{ {
plSpawnModifier* pSpawn = TRACKED_NEW plSpawnModifier; plSpawnModifier* pSpawn = new plSpawnModifier;
node->AddModifier(pSpawn, IGetUniqueName(node)); node->AddModifier(pSpawn, IGetUniqueName(node));
return true; return true;
} }
@ -332,7 +332,7 @@ hsBool plVehicleComponent::PreConvert(plMaxNode *pNode, plErrorMsg *pErrMsg)
if (!IIsValid()) if (!IIsValid())
return false; return false;
fMod = TRACKED_NEW plVehicleModifier; fMod = new plVehicleModifier;
plKey modKey = pNode->AddModifier(fMod, IGetUniqueName(pNode)); plKey modKey = pNode->AddModifier(fMod, IGetUniqueName(pNode));
plMaxNode* detectorNode = (plMaxNode*)fCompPB->GetINode(kVehicleDriveDet); plMaxNode* detectorNode = (plMaxNode*)fCompPB->GetINode(kVehicleDriveDet);
@ -459,7 +459,7 @@ hsBool plMaintainersMarkerComponent::SetupProperties(plMaxNode* node, plErrorMsg
} }
hsBool plMaintainersMarkerComponent::Convert(plMaxNode *node, plErrorMsg *pErrMsg) hsBool plMaintainersMarkerComponent::Convert(plMaxNode *node, plErrorMsg *pErrMsg)
{ {
plMaintainersMarkerModifier* pSpawn = TRACKED_NEW plMaintainersMarkerModifier; plMaintainersMarkerModifier* pSpawn = new plMaintainersMarkerModifier;
pSpawn->SetCalibrated(fCompPB->GetInt(kCalibrated)); pSpawn->SetCalibrated(fCompPB->GetInt(kCalibrated));
node->AddModifier(pSpawn, IGetUniqueName(node)); node->AddModifier(pSpawn, IGetUniqueName(node));
return true; return true;
@ -735,7 +735,7 @@ plKey plGameMarkerComponent::IGetAnimKey(int nodeID, int compID)
hsBool plGameMarkerComponent::Convert(plMaxNode *node, plErrorMsg *pErrMsg) hsBool plGameMarkerComponent::Convert(plMaxNode *node, plErrorMsg *pErrMsg)
{ {
plGameMarkerModifier* markerMod = TRACKED_NEW plGameMarkerModifier; plGameMarkerModifier* markerMod = new plGameMarkerModifier;
plKey greenKey = IGetMtlAnimKey(kMarkerGreenAnim, node); plKey greenKey = IGetMtlAnimKey(kMarkerGreenAnim, node);
plKey redKey = IGetMtlAnimKey(kMarkerRedAnim, node); plKey redKey = IGetMtlAnimKey(kMarkerRedAnim, node);

18
Sources/Tools/MaxComponent/plVolumeGadgetComponent.cpp

@ -329,11 +329,11 @@ hsBool plVolumeGadgetComponent::PreConvert(plMaxNode *node, plErrorMsg *pErrMsg)
// Create and register the VolumeGadget's logic component // Create and register the VolumeGadget's logic component
if(fCompPB->GetInt(kVolumeGadgetEnter) || fCompPB->GetInt(kVolumeTriggerOnFacing)) if(fCompPB->GetInt(kVolumeGadgetEnter) || fCompPB->GetInt(kVolumeTriggerOnFacing))
{ {
plLogicModifier *logic = TRACKED_NEW plLogicModifier; plLogicModifier *logic = new plLogicModifier;
char tmpName[256]; char tmpName[256];
sprintf(tmpName, "%s_Enter", IGetUniqueName(node)); sprintf(tmpName, "%s_Enter", IGetUniqueName(node));
plKey logicKey = hsgResMgr::ResMgr()->NewKey(tmpName, logic, node->GetLocation()); plKey logicKey = hsgResMgr::ResMgr()->NewKey(tmpName, logic, node->GetLocation());
hsgResMgr::ResMgr()->AddViaNotify(logicKey, TRACKED_NEW plObjRefMsg(obj->GetKey(), plRefMsg::kOnCreate, -1, plObjRefMsg::kModifier), plRefFlags::kActiveRef); hsgResMgr::ResMgr()->AddViaNotify(logicKey, new plObjRefMsg(obj->GetKey(), plRefMsg::kOnCreate, -1, plObjRefMsg::kModifier), plRefFlags::kActiveRef);
fLogicModKeys[node] = logicKey; fLogicModKeys[node] = logicKey;
if (fCompPB->GetInt(kVolumeOneShot)) if (fCompPB->GetInt(kVolumeOneShot))
@ -344,11 +344,11 @@ hsBool plVolumeGadgetComponent::PreConvert(plMaxNode *node, plErrorMsg *pErrMsg)
if(fCompPB->GetInt(kVolumeGadgetExit)) if(fCompPB->GetInt(kVolumeGadgetExit))
{ {
plLogicModifier *logic = TRACKED_NEW plLogicModifier; plLogicModifier *logic = new plLogicModifier;
char tmpName[256]; char tmpName[256];
sprintf(tmpName, "%s_Exit", IGetUniqueName(node)); sprintf(tmpName, "%s_Exit", IGetUniqueName(node));
plKey logicKey = hsgResMgr::ResMgr()->NewKey(tmpName, logic, node->GetLocation()); plKey logicKey = hsgResMgr::ResMgr()->NewKey(tmpName, logic, node->GetLocation());
hsgResMgr::ResMgr()->AddViaNotify(logicKey, TRACKED_NEW plObjRefMsg(obj->GetKey(), plRefMsg::kOnCreate, -1, plObjRefMsg::kModifier), plRefFlags::kActiveRef); hsgResMgr::ResMgr()->AddViaNotify(logicKey, new plObjRefMsg(obj->GetKey(), plRefMsg::kOnCreate, -1, plObjRefMsg::kModifier), plRefFlags::kActiveRef);
fLogicModOutKeys[node] = logicKey; fLogicModOutKeys[node] = logicKey;
if (fCompPB->GetInt(kVolumeOneShot)) if (fCompPB->GetInt(kVolumeOneShot))
@ -385,7 +385,7 @@ void plVolumeGadgetComponent::ICreateConditions(plMaxNode* node, plErrorMsg* err
plDetectorModifier* detector = nil; plDetectorModifier* detector = nil;
if (enter && fCompPB->GetInt(kVolumeTriggerOnFacing)) if (enter && fCompPB->GetInt(kVolumeTriggerOnFacing))
{ {
plObjectInVolumeAndFacingDetector* newDetector = TRACKED_NEW plObjectInVolumeAndFacingDetector; plObjectInVolumeAndFacingDetector* newDetector = new plObjectInVolumeAndFacingDetector;
int deg = fCompPB->GetInt(kVolumeDegrees); int deg = fCompPB->GetInt(kVolumeDegrees);
if (deg > 180) if (deg > 180)
@ -398,7 +398,7 @@ void plVolumeGadgetComponent::ICreateConditions(plMaxNode* node, plErrorMsg* err
detector = newDetector; detector = newDetector;
} }
else else
detector = TRACKED_NEW plObjectInVolumeDetector; detector = new plObjectInVolumeDetector;
const char* prefix = "Exit"; const char* prefix = "Exit";
if (enter) if (enter)
@ -407,15 +407,15 @@ void plVolumeGadgetComponent::ICreateConditions(plMaxNode* node, plErrorMsg* err
// Register the detector // Register the detector
sprintf(tmpName, "%s_%s", IGetUniqueName(node), prefix); sprintf(tmpName, "%s_%s", IGetUniqueName(node), prefix);
plKey detectorKey = hsgResMgr::ResMgr()->NewKey(tmpName, detector, loc); plKey detectorKey = hsgResMgr::ResMgr()->NewKey(tmpName, detector, loc);
hsgResMgr::ResMgr()->AddViaNotify(detectorKey, TRACKED_NEW plObjRefMsg(obj->GetKey(), plRefMsg::kOnCreate, -1, plObjRefMsg::kModifier), plRefFlags::kActiveRef); hsgResMgr::ResMgr()->AddViaNotify(detectorKey, new plObjRefMsg(obj->GetKey(), plRefMsg::kOnCreate, -1, plObjRefMsg::kModifier), plRefFlags::kActiveRef);
plVolumeSensorConditionalObject* boxCond=nil; plVolumeSensorConditionalObject* boxCond=nil;
if((fCompPB->GetInt(kSkipServerArbitration)==0)) if((fCompPB->GetInt(kSkipServerArbitration)==0))
{//we want server arbitration {//we want server arbitration
boxCond = TRACKED_NEW plVolumeSensorConditionalObject; boxCond = new plVolumeSensorConditionalObject;
} }
else else
{ {
boxCond = TRACKED_NEW plVolumeSensorConditionalObjectNoArbitration; boxCond = new plVolumeSensorConditionalObjectNoArbitration;
} }
sprintf(tmpName, "%s_%s", IGetUniqueName(node), prefix); sprintf(tmpName, "%s_%s", IGetUniqueName(node), prefix);
plKey boxKey = hsgResMgr::ResMgr()->NewKey(tmpName, boxCond, loc); plKey boxKey = hsgResMgr::ResMgr()->NewKey(tmpName, boxCond, loc);

16
Sources/Tools/MaxComponent/plWaterComponent.cpp

@ -512,7 +512,7 @@ hsBool plWaterComponent::Convert(plMaxNode* node, plErrorMsg* pErrMsg)
if( !fWaveSet ) if( !fWaveSet )
return true; return true;
plObjRefMsg* refMsg = TRACKED_NEW plObjRefMsg(node->GetKey(), plRefMsg::kOnRequest, -1, plObjRefMsg::kModifier); plObjRefMsg* refMsg = new plObjRefMsg(node->GetKey(), plRefMsg::kOnRequest, -1, plObjRefMsg::kModifier);
hsgResMgr::ResMgr()->AddViaNotify(fWaveSet->GetKey(), refMsg, plRefFlags::kActiveRef); hsgResMgr::ResMgr()->AddViaNotify(fWaveSet->GetKey(), refMsg, plRefFlags::kActiveRef);
return true; return true;
@ -567,7 +567,7 @@ hsBool plWaterComponent::IReadEnvObject(plMaxNode* node, plErrorMsg* pErrMsg, pl
} }
size = uint32_t(1 << i); size = uint32_t(1 << i);
env = TRACKED_NEW plDynamicEnvMap(size, size, 32); env = new plDynamicEnvMap(size, size, 32);
hsgResMgr::ResMgr()->NewKey(ref->GetName(), env, node->GetLocation(), node->GetLoadMask()); hsgResMgr::ResMgr()->NewKey(ref->GetName(), env, node->GetLocation(), node->GetLoadMask());
Point3 pos = ref->GetNodeTM(TimeValue(0)).GetTrans(); Point3 pos = ref->GetNodeTM(TimeValue(0)).GetTrans();
@ -584,7 +584,7 @@ hsBool plWaterComponent::IReadEnvObject(plMaxNode* node, plErrorMsg* pErrMsg, pl
fWaveSet->SetEnvSize(env->GetWidth()); fWaveSet->SetEnvSize(env->GetWidth());
plGenRefMsg* refMsg = TRACKED_NEW plGenRefMsg(fWaveSet->GetKey(), plRefMsg::kOnCreate, -1, plWaveSet7::kRefEnvMap); plGenRefMsg* refMsg = new plGenRefMsg(fWaveSet->GetKey(), plRefMsg::kOnCreate, -1, plWaveSet7::kRefEnvMap);
hsgResMgr::ResMgr()->SendRef(env->GetKey(), refMsg, plRefFlags::kActiveRef); hsgResMgr::ResMgr()->SendRef(env->GetKey(), refMsg, plRefFlags::kActiveRef);
ws.fEnvRadius = fCompPB->GetFloat(kEnvRadius); ws.fEnvRadius = fCompPB->GetFloat(kEnvRadius);
@ -614,7 +614,7 @@ hsBool plWaterComponent::IMakeWaveSet(plMaxNode* node, plErrorMsg* pErrMsg)
{ {
// Go ahead and create the WaveSet modifier. There will be just // Go ahead and create the WaveSet modifier. There will be just
// one created by this component, everyone has to share. // one created by this component, everyone has to share.
fWaveSet = TRACKED_NEW plWaveSet7; fWaveSet = new plWaveSet7;
hsgResMgr::ResMgr()->NewKey( IGetUniqueName(node), fWaveSet, node->GetLocation(), node->GetLoadMask()); hsgResMgr::ResMgr()->NewKey( IGetUniqueName(node), fWaveSet, node->GetLocation(), node->GetLoadMask());
// Set up the parameters // Set up the parameters
@ -1285,9 +1285,9 @@ plRenderTarget* plEnvMapComponent::IGetMap()
plDynamicCamMap* cam = nil; plDynamicCamMap* cam = nil;
fMap = nil; fMap = nil;
if (fCompPB->GetInt((ParamID(kMapType))) == kMapCubic) if (fCompPB->GetInt((ParamID(kMapType))) == kMapCubic)
fMap = env = TRACKED_NEW plDynamicEnvMap(size, size, 32); fMap = env = new plDynamicEnvMap(size, size, 32);
else if (fCompPB->GetInt((ParamID(kMapType))) == kMapSingle) else if (fCompPB->GetInt((ParamID(kMapType))) == kMapSingle)
fMap = cam = TRACKED_NEW plDynamicCamMap(size, size, 32); fMap = cam = new plDynamicCamMap(size, size, 32);
// Need to assign the key before we call all the setup functions. // Need to assign the key before we call all the setup functions.
hsgResMgr::ResMgr()->NewKey(GetINode()->GetName(), fMap, firstTarg->GetLocation(), firstTarg->GetLoadMask()); hsgResMgr::ResMgr()->NewKey(GetINode()->GetName(), fMap, firstTarg->GetLocation(), firstTarg->GetLoadMask());
@ -1326,7 +1326,7 @@ plRenderTarget* plEnvMapComponent::IGetMap()
plVisRegion* effReg = effComp->GetVisRegion(firstTarg); plVisRegion* effReg = effComp->GetVisRegion(firstTarg);
if( effReg ) if( effReg )
{ {
plGenRefMsg* refMsg = TRACKED_NEW plGenRefMsg(fMap->GetKey(), plRefMsg::kOnCreate, -1, plDynamicEnvMap::kRefVisSet); plGenRefMsg* refMsg = new plGenRefMsg(fMap->GetKey(), plRefMsg::kOnCreate, -1, plDynamicEnvMap::kRefVisSet);
hsgResMgr::ResMgr()->SendRef(effReg->GetKey(), refMsg, plRefFlags::kPassiveRef); hsgResMgr::ResMgr()->SendRef(effReg->GetKey(), refMsg, plRefFlags::kPassiveRef);
visGot++; visGot++;
@ -1353,7 +1353,7 @@ plRenderTarget* plEnvMapComponent::IGetMap()
// Right now, the envMap doesn't use this, but I plan to make it do so, so I'm // Right now, the envMap doesn't use this, but I plan to make it do so, so I'm
// going ahead and adding the ref regardless of which type of map we made. // going ahead and adding the ref regardless of which type of map we made.
uint8_t refType = cam ? plDynamicCamMap::kRefRootNode : plDynamicEnvMap::kRefRootNode; uint8_t refType = cam ? plDynamicCamMap::kRefRootNode : plDynamicEnvMap::kRefRootNode;
hsgResMgr::ResMgr()->AddViaNotify(firstTarg->GetSceneObject()->GetKey(), TRACKED_NEW plGenRefMsg(fMap->GetKey(), plRefMsg::kOnCreate, -1, refType), plRefFlags::kPassiveRef); hsgResMgr::ResMgr()->AddViaNotify(firstTarg->GetSceneObject()->GetKey(), new plGenRefMsg(fMap->GetKey(), plRefMsg::kOnCreate, -1, refType), plRefFlags::kPassiveRef);
} }
return fMap; return fMap;
} }

8
Sources/Tools/MaxConvert/StringTokenizer.cpp

@ -53,10 +53,10 @@ StringTokenizer::StringTokenizer() {
StringTokenizer::StringTokenizer(const char *string, const char *seps) { StringTokenizer::StringTokenizer(const char *string, const char *seps) {
qAsTok = true; qAsTok = true;
inQuote = false; inQuote = false;
this->string = TRACKED_NEW char[strlen(string)+1]; this->string = new char[strlen(string)+1];
strcpy(this->string,string); strcpy(this->string,string);
numSeps = strlen(seps); numSeps = strlen(seps);
this->seps = TRACKED_NEW char[numSeps+1]; this->seps = new char[numSeps+1];
strcpy(this->seps,seps); strcpy(this->seps,seps);
this->tok = this->string; this->tok = this->string;
if (isSep(*tok)) next(); if (isSep(*tok)) next();
@ -93,11 +93,11 @@ hsBool StringTokenizer::isSep(char c) {
}; };
void StringTokenizer::reset(const char *string, const char *seps) { void StringTokenizer::reset(const char *string, const char *seps) {
if (this->string) delete this->string; if (this->string) delete this->string;
this->string = TRACKED_NEW char[strlen(string)+1]; this->string = new char[strlen(string)+1];
strcpy(this->string,string); strcpy(this->string,string);
if (this->seps) delete this->seps; if (this->seps) delete this->seps;
numSeps = strlen(seps); numSeps = strlen(seps);
this->seps = TRACKED_NEW char[numSeps+1]; this->seps = new char[numSeps+1];
strcpy(this->seps,seps); strcpy(this->seps,seps);
this->tok = this->string; this->tok = this->string;
if (isSep(*tok)) next(); if (isSep(*tok)) next();

2
Sources/Tools/MaxConvert/UserPropMgr.cpp

@ -754,7 +754,7 @@ void UserPropMgr::OpenQuickTable()
{ {
if (!fQuickTable) if (!fQuickTable)
{ {
fQuickTable = TRACKED_NEW hsHashTable<QuickPair>(kQuickSize); fQuickTable = new hsHashTable<QuickPair>(kQuickSize);
} }
fQuickNode = nil; fQuickNode = nil;
} }

32
Sources/Tools/MaxConvert/hsControlConverter.cpp

@ -133,8 +133,8 @@ void hsControlConverter::ReduceKeys(Control *control, float threshold)
IKeyControl *keyCont = GetKeyControlInterface(control); IKeyControl *keyCont = GetKeyControlInterface(control);
if (keyCont->GetNumKeys() > 2) if (keyCont->GetNumKeys() > 2)
{ {
IKey *key1 = (IKey*)TRACKED_NEW uint8_t[keyCont->GetKeySize()]; IKey *key1 = (IKey*)new uint8_t[keyCont->GetKeySize()];
IKey *key2 = (IKey*)TRACKED_NEW uint8_t[keyCont->GetKeySize()]; IKey *key2 = (IKey*)new uint8_t[keyCont->GetKeySize()];
keyCont->GetKey(0, key1); keyCont->GetKey(0, key1);
keyCont->GetKey(keyCont->GetNumKeys() - 1, key2); keyCont->GetKey(keyCont->GetNumKeys() - 1, key2);
@ -258,7 +258,7 @@ plLeafController* hsControlConverter::MakeMatrix44Controller(StdUVGen* uvGen, co
return nil; return nil;
} }
plLeafController* ctrl = TRACKED_NEW plLeafController; plLeafController* ctrl = new plLeafController;
ctrl->AllocKeys(kTimes.Count(), hsKeyFrame::kMatrix44KeyFrame); ctrl->AllocKeys(kTimes.Count(), hsKeyFrame::kMatrix44KeyFrame);
TimeValue resetTime = fConverterUtils.GetTime(fInterface); TimeValue resetTime = fConverterUtils.GetTime(fInterface);
for( i=0; i < kTimes.Count(); i++) for( i=0; i < kTimes.Count(); i++)
@ -309,7 +309,7 @@ plLeafController* hsControlConverter::MakeMatrix44Controller(Control* prsControl
return nil; return nil;
} }
plLeafController* ctrl = TRACKED_NEW plLeafController; plLeafController* ctrl = new plLeafController;
ctrl->AllocKeys(kTimes.Count(), hsKeyFrame::kMatrix44KeyFrame); ctrl->AllocKeys(kTimes.Count(), hsKeyFrame::kMatrix44KeyFrame);
TimeValue resetTime = fConverterUtils.GetTime(fInterface);; TimeValue resetTime = fConverterUtils.GetTime(fInterface);;
for( i=0; i < kTimes.Count(); i++) for( i=0; i < kTimes.Count(); i++)
@ -378,7 +378,7 @@ plController* hsControlConverter::MakePosController(Control* control, plMaxNode*
} }
else else
{ {
hsCont = TRACKED_NEW plCompoundController; hsCont = new plCompoundController;
fErrorMsg->Set(control->NumSubs()!=3, node->GetName(), "compound should have 3 subs").Check(); fErrorMsg->Set(control->NumSubs()!=3, node->GetName(), "compound should have 3 subs").Check();
if (control->ClassID() == Class_ID(POSITIONNOISE_CONTROL_CLASS_ID,0) ) if (control->ClassID() == Class_ID(POSITIONNOISE_CONTROL_CLASS_ID,0) )
@ -462,7 +462,7 @@ plController *hsControlConverter::MakeRotController(Control *control, plMaxNode
if (fErrorMsg->Set(control->NumSubs() != 3, node->GetName(), "Rot compound controller should have 3 subcontrollers").CheckAndAsk()) if (fErrorMsg->Set(control->NumSubs() != 3, node->GetName(), "Rot compound controller should have 3 subcontrollers").CheckAndAsk())
return nil; return nil;
plCompoundController* rc = TRACKED_NEW plCompoundController; plCompoundController* rc = new plCompoundController;
int i; int i;
for (i=0; i<3; i++) for (i=0; i<3; i++)
{ {
@ -616,7 +616,7 @@ plCompoundController *hsControlConverter::MakeTransformController(Control *contr
return NULL; return NULL;
} }
plCompoundController *tmc = TRACKED_NEW plCompoundController; plCompoundController *tmc = new plCompoundController;
for (int i=0; i<n; i++) for (int i=0; i<n; i++)
{ {
Control* sub = (Control*)control->SubAnim(i); Control* sub = (Control*)control->SubAnim(i);
@ -759,7 +759,7 @@ plLeafController* hsControlConverter::ICreateQuatController(plMaxNode* node, Con
} }
IKey* key=(IKey*)(new uint8_t[ikeys->GetKeySize()]); IKey* key=(IKey*)(new uint8_t[ikeys->GetKeySize()]);
plLeafController* pc = TRACKED_NEW plLeafController; plLeafController* pc = new plLeafController;
uint8_t compressLevel = node->GetAnimCompress(); uint8_t compressLevel = node->GetAnimCompress();
uint8_t keyType; uint8_t keyType;
@ -839,7 +839,7 @@ plLeafController* hsControlConverter::ICreateScaleValueController(plMaxNode* nod
} }
IKey* key=(IKey*)(new uint8_t [ikeys->GetKeySize()]); IKey* key=(IKey*)(new uint8_t [ikeys->GetKeySize()]);
plLeafController* pc = TRACKED_NEW plLeafController; plLeafController* pc = new plLeafController;
pc->AllocKeys(endIdx - startIdx + 1, GetKeyType(control)); pc->AllocKeys(endIdx - startIdx + 1, GetKeyType(control));
for(int i = startIdx; i <= endIdx; i++) for(int i = startIdx; i <= endIdx; i++)
{ {
@ -880,7 +880,7 @@ plLeafController* hsControlConverter::ICreateScalarController(plMaxNode* node, C
} }
IKey* key=(IKey*)(new uint8_t [ikeys->GetKeySize()]); IKey* key=(IKey*)(new uint8_t [ikeys->GetKeySize()]);
plLeafController* pc = TRACKED_NEW plLeafController; plLeafController* pc = new plLeafController;
pc->AllocKeys(endIdx - startIdx + 1, GetKeyType(control)); pc->AllocKeys(endIdx - startIdx + 1, GetKeyType(control));
for(int i = startIdx; i <= endIdx; i++) for(int i = startIdx; i <= endIdx; i++)
{ {
@ -922,7 +922,7 @@ plLeafController* hsControlConverter::ICreateSimplePosController(plMaxNode* node
} }
IKey* key=(IKey*)(new uint8_t [ikeys->GetKeySize()]); IKey* key=(IKey*)(new uint8_t [ikeys->GetKeySize()]);
plLeafController* pc = TRACKED_NEW plLeafController; plLeafController* pc = new plLeafController;
pc->AllocKeys(endIdx - startIdx + 1, GetKeyType(control)); pc->AllocKeys(endIdx - startIdx + 1, GetKeyType(control));
for(int i = startIdx; i <= endIdx; i++) for(int i = startIdx; i <= endIdx; i++)
{ {
@ -2088,7 +2088,7 @@ void hsControlConverter::IExportAnimatedCameraFOV(plMaxNode* node, hsTArray <hsG
break; break;
} }
plCameraMsg* pCamMsg = TRACKED_NEW plCameraMsg; plCameraMsg* pCamMsg = new plCameraMsg;
pCamMsg->SetCmd(plCameraMsg::kSetAnimated); pCamMsg->SetCmd(plCameraMsg::kSetAnimated);
pCamMsg->AddReceiver(pCamMod->GetKey()); pCamMsg->AddReceiver(pCamMod->GetKey());
plConvert::Instance().AddMessageToQueue(pCamMsg); plConvert::Instance().AddMessageToQueue(pCamMsg);
@ -2129,7 +2129,7 @@ void hsControlConverter::IExportAnimatedCameraFOV(plMaxNode* node, hsTArray <hsG
for (i=0; i < kfArray->Count(); i++) for (i=0; i < kfArray->Count(); i++)
{ {
plCameraMsg* pFOVMsg = TRACKED_NEW plCameraMsg; plCameraMsg* pFOVMsg = new plCameraMsg;
plCameraConfig* pCfg = pFOVMsg->GetConfig(); plCameraConfig* pCfg = pFOVMsg->GetConfig();
if (i == kfArray->Count() - 1) if (i == kfArray->Count() - 1)
@ -2149,12 +2149,12 @@ void hsControlConverter::IExportAnimatedCameraFOV(plMaxNode* node, hsTArray <hsG
pFOVMsg->SetCmd(plCameraMsg::kAddFOVKeyframe); pFOVMsg->SetCmd(plCameraMsg::kAddFOVKeyframe);
pFOVMsg->AddReceiver(pCamMod->GetKey()); pFOVMsg->AddReceiver(pCamMod->GetKey());
plEventCallbackMsg* pCall = TRACKED_NEW plEventCallbackMsg; plEventCallbackMsg* pCall = new plEventCallbackMsg;
pCall->fEvent = kTime; pCall->fEvent = kTime;
pCall->fEventTime = kfArray[0][i].fFrame / MAX_FRAMES_PER_SEC; pCall->fEventTime = kfArray[0][i].fFrame / MAX_FRAMES_PER_SEC;
pCall->fIndex = i; pCall->fIndex = i;
pCall->AddReceiver(pCamMod->GetKey()); pCall->AddReceiver(pCamMod->GetKey());
plAnimCmdMsg* pMsg = TRACKED_NEW plAnimCmdMsg; plAnimCmdMsg* pMsg = new plAnimCmdMsg;
pMsg->AddReceiver(pCamMod->GetKey()); pMsg->AddReceiver(pCamMod->GetKey());
pMsg->SetSender(pAnim->GetModKey(node)); pMsg->SetSender(pAnim->GetModKey(node));
pMsg->SetCmd(plAnimCmdMsg::kAddCallbacks); pMsg->SetCmd(plAnimCmdMsg::kAddCallbacks);
@ -2165,4 +2165,4 @@ void hsControlConverter::IExportAnimatedCameraFOV(plMaxNode* node, hsTArray <hsG
plConvert::Instance().AddMessageToQueue(pFOVMsg); plConvert::Instance().AddMessageToQueue(pFOVMsg);
plConvert::Instance().AddMessageToQueue(pMsg); plConvert::Instance().AddMessageToQueue(pMsg);
} }
} }

2
Sources/Tools/MaxConvert/hsConverterUtils.cpp

@ -525,7 +525,7 @@ void hsConverterUtils::CreateNodeSearchCache()
{ {
if (!fNodeSearchCache) if (!fNodeSearchCache)
{ {
fNodeSearchCache = TRACKED_NEW hsHashTable<CacheNode>(); fNodeSearchCache = new hsHashTable<CacheNode>();
} }
fNodeSearchCache->clear(); fNodeSearchCache->clear();

86
Sources/Tools/MaxConvert/hsMaterialConverter.cpp

@ -303,9 +303,9 @@ void AttachLinkMtlAnims(plMaxNode *node, hsGMaterial *mat)
char suff[10]; char suff[10];
sprintf(suff, "%d", k); sprintf(suff, "%d", k);
opaCtl = TRACKED_NEW plLeafController; opaCtl = new plLeafController;
opaCtl->QuickScalarController(numKeys, times, values, sizeof(float)); opaCtl->QuickScalarController(numKeys, times, values, sizeof(float));
animLayer = TRACKED_NEW plLayerLinkAnimation; animLayer = new plLayerLinkAnimation;
animLayer->SetLinkKey(node->GetAvatarSO()->GetKey()); animLayer->SetLinkKey(node->GetAvatarSO()->GetKey());
//animLayer->fLeavingAge = leaving[x]; //animLayer->fLeavingAge = leaving[x];
TSTR fullAnimName = TSTR(oldLayer->GetKeyName()) + TSTR("_") + TSTR(animName) + TSTR("_") + TSTR(suff); TSTR fullAnimName = TSTR(oldLayer->GetKeyName()) + TSTR("_") + TSTR(animName) + TSTR("_") + TSTR(suff);
@ -317,7 +317,7 @@ void AttachLinkMtlAnims(plMaxNode *node, hsGMaterial *mat)
animLayer->AttachViaNotify(currLayer); animLayer->AttachViaNotify(currLayer);
currLayer = animLayer; currLayer = animLayer;
plMatRefMsg* msg = TRACKED_NEW plMatRefMsg(mat->GetKey(), plRefMsg::kOnReplace, k, plMatRefMsg::kLayer); plMatRefMsg* msg = new plMatRefMsg(mat->GetKey(), plRefMsg::kOnReplace, k, plMatRefMsg::kLayer);
msg->SetOldRef(oldLayer); msg->SetOldRef(oldLayer);
msg->SetRef(currLayer); msg->SetRef(currLayer);
hsgResMgr::ResMgr()->AddViaNotify(msg, plRefFlags::kActiveRef); hsgResMgr::ResMgr()->AddViaNotify(msg, plRefFlags::kActiveRef);
@ -749,7 +749,7 @@ void hsMaterialConverter::GetNodesByMaterial(Mtl *mtl, hsTArray<plMaxNode*> &out
hsTArray<plExportMaterialData> * hsTArray<plExportMaterialData> *
hsMaterialConverter::CreateMaterialArray(Mtl *maxMaterial, plMaxNode *node, uint32_t multiIndex) hsMaterialConverter::CreateMaterialArray(Mtl *maxMaterial, plMaxNode *node, uint32_t multiIndex)
{ {
hsTArray<plExportMaterialData> *ourMaterials = TRACKED_NEW hsTArray<plExportMaterialData>; hsTArray<plExportMaterialData> *ourMaterials = new hsTArray<plExportMaterialData>;
const char* dbgNodeName = node->GetName(); const char* dbgNodeName = node->GetName();
@ -910,7 +910,7 @@ hsGMaterial* hsMaterialConverter::NonAlphaHackPrint(plMaxNode* node, Texmap* bas
// Search done materials for it // Search done materials for it
hsGMaterial* mat = TRACKED_NEW hsGMaterial; hsGMaterial* mat = new hsGMaterial;
hsgResMgr::ResMgr()->NewKey(name, mat, node->GetLocation()); hsgResMgr::ResMgr()->NewKey(name, mat, node->GetLocation());
// If plasmaLayer is nil, the artist has some other wierd (unsupported) layer type in the slot. // If plasmaLayer is nil, the artist has some other wierd (unsupported) layer type in the slot.
@ -953,7 +953,7 @@ hsGMaterial* hsMaterialConverter::AlphaHackPrint(plMaxNode* node, Texmap* baseTe
// Search done materials for it // Search done materials for it
hsGMaterial* mat = TRACKED_NEW hsGMaterial; hsGMaterial* mat = new hsGMaterial;
hsgResMgr::ResMgr()->NewKey(name, mat, node->GetLocation()); hsgResMgr::ResMgr()->NewKey(name, mat, node->GetLocation());
// If plasmaLayer is nil, the artist has some other wierd (unsupported) layer type in the slot. // If plasmaLayer is nil, the artist has some other wierd (unsupported) layer type in the slot.
@ -1153,7 +1153,7 @@ hsGMaterial *hsMaterialConverter::IProcessMaterial(Mtl *mtl, plMaxNode *node, co
} }
else if (IsHsMaxMat(mtl) || IsDecalMat(mtl) || IsBumpMtl( mtl ) ) else if (IsHsMaxMat(mtl) || IsDecalMat(mtl) || IsBumpMtl( mtl ) )
{ {
hMat = TRACKED_NEW hsGMaterial; hMat = new hsGMaterial;
hsgResMgr::ResMgr()->NewKey(name, hMat,nodeLoc); hsgResMgr::ResMgr()->NewKey(name, hMat,nodeLoc);
IProcessPlasmaMaterial(mtl, node, hMat, hMat->GetKey()->GetName()); IProcessPlasmaMaterial(mtl, node, hMat, hMat->GetKey()->GetName());
} }
@ -1185,7 +1185,7 @@ hsGMaterial *hsMaterialConverter::IProcessMaterial(Mtl *mtl, plMaxNode *node, co
if (fErrorMsg->Set((fWarned & kWarnedNoLayers) == 0, node->GetName(), "Material has no layers. (%s)", mtl->GetName()).CheckAndAsk()) if (fErrorMsg->Set((fWarned & kWarnedNoLayers) == 0, node->GetName(), "Material has no layers. (%s)", mtl->GetName()).CheckAndAsk())
fWarned |= kWarnedNoLayers; fWarned |= kWarnedNoLayers;
plLayer* hLay = TRACKED_NEW plLayer; plLayer* hLay = new plLayer;
hLay->InitToDefault(); hLay->InitToDefault();
hsgResMgr::ResMgr()->NewKey(TSTR(name) + TSTR("_DefLay"), hLay, nodeLoc); hsgResMgr::ResMgr()->NewKey(TSTR(name) + TSTR("_DefLay"), hLay, nodeLoc);
IAddLayerToMaterial(hMat, hLay); IAddLayerToMaterial(hMat, hLay);
@ -1336,10 +1336,10 @@ hsGMaterial *hsMaterialConverter::IAddDefaultMaterial(plMaxNode *node)
plLocation loc = node->GetLocation(); plLocation loc = node->GetLocation();
hsGMaterial *hMat = TRACKED_NEW hsGMaterial; hsGMaterial *hMat = new hsGMaterial;
hsgResMgr::ResMgr()->NewKey(TSTR(node->GetName()) + TSTR("_DefMat"), hMat, loc); hsgResMgr::ResMgr()->NewKey(TSTR(node->GetName()) + TSTR("_DefMat"), hMat, loc);
plLayer *layer = TRACKED_NEW plLayer; plLayer *layer = new plLayer;
layer->InitToDefault(); layer->InitToDefault();
hsgResMgr::ResMgr()->NewKey(TSTR(hMat->GetKeyName()) + TSTR("_DefLay"), layer, loc); hsgResMgr::ResMgr()->NewKey(TSTR(hMat->GetKeyName()) + TSTR("_DefLay"), layer, loc);
@ -1413,10 +1413,10 @@ void hsMaterialConverter::IInsertSingleBlendLayer(plMipmap *texture, hsGMaterial
mat->SetCompositeFlags(mat->GetCompositeFlags() | hsGMaterial::kCompNeedsBlendChannel); mat->SetCompositeFlags(mat->GetCompositeFlags() | hsGMaterial::kCompNeedsBlendChannel);
plLayer* layer = TRACKED_NEW plLayer; plLayer* layer = new plLayer;
layer->InitToDefault(); layer->InitToDefault();
hsgResMgr::ResMgr()->NewKey(TSTR(underLay->GetKeyName()) + TSTR("_AlphaBlend"), layer, node->GetLocation()); hsgResMgr::ResMgr()->NewKey(TSTR(underLay->GetKeyName()) + TSTR("_AlphaBlend"), layer, node->GetLocation());
hsgResMgr::ResMgr()->AddViaNotify(texture->GetKey(), TRACKED_NEW plLayRefMsg(layer->GetKey(), plRefMsg::kOnCreate, 0, plLayRefMsg::kTexture), plRefFlags::kActiveRef); hsgResMgr::ResMgr()->AddViaNotify(texture->GetKey(), new plLayRefMsg(layer->GetKey(), plRefMsg::kOnCreate, 0, plLayRefMsg::kTexture), plRefFlags::kActiveRef);
layer->SetAmbientColor(hsColorRGBA().Set(1.f, 1.f, 1.f, 1.f)); layer->SetAmbientColor(hsColorRGBA().Set(1.f, 1.f, 1.f, 1.f));
// layer->SetZFlags(hsGMatState::kZNoZWrite | hsGMatState::kZIncLayer); // layer->SetZFlags(hsGMatState::kZNoZWrite | hsGMatState::kZIncLayer);
// The inclayer prop probably wouldn't hurt here, because this layer should only get drawn as // The inclayer prop probably wouldn't hurt here, because this layer should only get drawn as
@ -1429,7 +1429,7 @@ void hsMaterialConverter::IInsertSingleBlendLayer(plMipmap *texture, hsGMaterial
layer->SetMiscFlags(0); layer->SetMiscFlags(0);
// Insert it in the right spot. // Insert it in the right spot.
hsgResMgr::ResMgr()->AddViaNotify(layer->GetKey(), TRACKED_NEW plMatRefMsg(mat->GetKey(), plRefMsg::kOnCreate, hsgResMgr::ResMgr()->AddViaNotify(layer->GetKey(), new plMatRefMsg(mat->GetKey(), plRefMsg::kOnCreate,
layerIdx, plMatRefMsg::kLayer | plMatRefMsg::kInsert), plRefFlags::kActiveRef); layerIdx, plMatRefMsg::kLayer | plMatRefMsg::kInsert), plRefFlags::kActiveRef);
} }
@ -1574,11 +1574,11 @@ hsGMaterial *hsMaterialConverter::IProcessCompositeMtl(Mtl *mtl, plMaxNode *node
{ {
if (!mtl || mtl->ClassID() != COMP_MTL_CLASS_ID) if (!mtl || mtl->ClassID() != COMP_MTL_CLASS_ID)
return nil; return nil;
uint32_t *layerCounts = TRACKED_NEW uint32_t[mtl->NumSubMtls()]; uint32_t *layerCounts = new uint32_t[mtl->NumSubMtls()];
IParamBlock2 *pb = mtl->GetParamBlockByID(plCompositeMtl::kBlkPasses); IParamBlock2 *pb = mtl->GetParamBlockByID(plCompositeMtl::kBlkPasses);
char suff[10]; char suff[10];
sprintf(suff, "_%d", subMtlFlags); sprintf(suff, "_%d", subMtlFlags);
hsGMaterial *mat = TRACKED_NEW hsGMaterial; hsGMaterial *mat = new hsGMaterial;
hsgResMgr::ResMgr()->NewKey(TSTR(name) + TSTR(suff), mat, node->GetLocation()); hsgResMgr::ResMgr()->NewKey(TSTR(name) + TSTR(suff), mat, node->GetLocation());
int multiIndex = IFindSubIndex(node, mtl); int multiIndex = IFindSubIndex(node, mtl);
@ -1678,8 +1678,8 @@ hsGMaterial *hsMaterialConverter::IProcessMultipassMtl(Mtl *mtl, plMaxNode *node
if (!mtl || mtl->ClassID() != MULTIMTL_CLASS_ID) if (!mtl || mtl->ClassID() != MULTIMTL_CLASS_ID)
return nil; return nil;
hsGMaterial *mat = TRACKED_NEW hsGMaterial; hsGMaterial *mat = new hsGMaterial;
uint32_t *layerCounts = TRACKED_NEW uint32_t[mtl->NumSubMtls()]; uint32_t *layerCounts = new uint32_t[mtl->NumSubMtls()];
hsgResMgr::ResMgr()->NewKey(name, mat, node->GetLocation()); hsgResMgr::ResMgr()->NewKey(name, mat, node->GetLocation());
IParamBlock2 *pb = mtl->GetParamBlockByID(plMultipassMtl::kBlkPasses); IParamBlock2 *pb = mtl->GetParamBlockByID(plMultipassMtl::kBlkPasses);
@ -1712,7 +1712,7 @@ hsGMaterial *hsMaterialConverter::IProcessParticleMtl(Mtl *mtl, plMaxNode *node,
plLocation nodeLoc = node->GetLocation(); plLocation nodeLoc = node->GetLocation();
char* dbgNodeName = node->GetName(); char* dbgNodeName = node->GetName();
hsGMaterial *mat = TRACKED_NEW hsGMaterial; hsGMaterial *mat = new hsGMaterial;
hsgResMgr::ResMgr()->NewKey(name, mat,nodeLoc); hsgResMgr::ResMgr()->NewKey(name, mat,nodeLoc);
@ -1826,7 +1826,7 @@ plLayerAnimation *IConvertNoteTrackAnims(plLayerAnimation *animLayer, SegmentMap
SegmentSpec *spec = it->second; SegmentSpec *spec = it->second;
if (spec->fType == SegmentSpec::kAnim) if (spec->fType == SegmentSpec::kAnim)
{ {
plLayerAnimation *noteAnim = TRACKED_NEW plLayerAnimation; plLayerAnimation *noteAnim = new plLayerAnimation;
TSTR animName = TSTR(name) + TSTR("_anim_") + TSTR(spec->fName); TSTR animName = TSTR(name) + TSTR("_anim_") + TSTR(spec->fName);
hsgResMgr::ResMgr()->NewKey(animName, noteAnim, node->GetLocation()); hsgResMgr::ResMgr()->NewKey(animName, noteAnim, node->GetLocation());
@ -2002,12 +2002,12 @@ static plLayerInterface* IProcessLayerMovie(plPassMtlBase* mtl, plLayerTex* layT
if (isBink) if (isBink)
{ {
movieLayer = TRACKED_NEW plLayerBink; movieLayer = new plLayerBink;
moviePostfix = "_bink"; moviePostfix = "_bink";
} }
else if (isAvi) else if (isAvi)
{ {
movieLayer = TRACKED_NEW plLayerAVI; movieLayer = new plLayerAVI;
moviePostfix = "_avi"; moviePostfix = "_avi";
} }
@ -2054,7 +2054,7 @@ plLayerInterface* IProcessLayerAnimation(plPassMtlBase* mtl, plLayerTex* layTex,
if( mtl->GetUseGlobal() ) if( mtl->GetUseGlobal() )
{ {
plLayerSDLAnimation *SDLLayer = TRACKED_NEW plLayerSDLAnimation; plLayerSDLAnimation *SDLLayer = new plLayerSDLAnimation;
TSTR animName = TSTR(name) + TSTR("_anim_") + TSTR(mtl->GetGlobalVarName()); TSTR animName = TSTR(name) + TSTR("_anim_") + TSTR(mtl->GetGlobalVarName());
hsgResMgr::ResMgr()->NewKey(animName, SDLLayer, node->GetLocation()); hsgResMgr::ResMgr()->NewKey(animName, SDLLayer, node->GetLocation());
@ -2075,7 +2075,7 @@ plLayerInterface* IProcessLayerAnimation(plPassMtlBase* mtl, plLayerTex* layTex,
{ {
plAnimStealthNode *stealth = mtl->GetStealth( i ); plAnimStealthNode *stealth = mtl->GetStealth( i );
plLayerAnimation *noteAnim = TRACKED_NEW plLayerAnimation; plLayerAnimation *noteAnim = new plLayerAnimation;
node->CheckSynchOptions(noteAnim); node->CheckSynchOptions(noteAnim);
const char *segName = stealth->GetSegmentName(); const char *segName = stealth->GetSegmentName();
@ -2154,7 +2154,7 @@ plLayerInterface* IProcessAnimation(plPassMtlBase *mtl, plMaxNode *node, const c
//if (!hsMaterialConverter::Instance().CheckValidityOfSDLVarAnim(mtl, mtl->GetGlobalVarName(), node)) //if (!hsMaterialConverter::Instance().CheckValidityOfSDLVarAnim(mtl, mtl->GetGlobalVarName(), node))
// return layerIFace; // return layerIFace;
plLayerSDLAnimation *SDLLayer = TRACKED_NEW plLayerSDLAnimation; plLayerSDLAnimation *SDLLayer = new plLayerSDLAnimation;
TSTR animName = TSTR(name) + TSTR("_anim_") + TSTR(mtl->GetGlobalVarName()); TSTR animName = TSTR(name) + TSTR("_anim_") + TSTR(mtl->GetGlobalVarName());
hsgResMgr::ResMgr()->NewKey(animName, SDLLayer, node->GetLocation()); hsgResMgr::ResMgr()->NewKey(animName, SDLLayer, node->GetLocation());
@ -2190,7 +2190,7 @@ plLayerInterface* IProcessAnimation(plPassMtlBase *mtl, plMaxNode *node, const c
{ {
plAnimStealthNode *stealth = mtl->GetStealth( i ); plAnimStealthNode *stealth = mtl->GetStealth( i );
plLayerAnimation *noteAnim = TRACKED_NEW plLayerAnimation; plLayerAnimation *noteAnim = new plLayerAnimation;
node->CheckSynchOptions(noteAnim); node->CheckSynchOptions(noteAnim);
const char *segName = stealth->GetSegmentName(); const char *segName = stealth->GetSegmentName();
@ -2627,7 +2627,7 @@ hsBool hsMaterialConverter::IProcessPlasmaMaterial(Mtl *mtl, plMaxNode *node, hs
void hsMaterialConverter::IAddLayerToMaterial(hsGMaterial *mat, plLayerInterface *layer) void hsMaterialConverter::IAddLayerToMaterial(hsGMaterial *mat, plLayerInterface *layer)
{ {
plMatRefMsg* msg = TRACKED_NEW plMatRefMsg(mat->GetKey(), plRefMsg::kOnCreate, -1, plMatRefMsg::kLayer); plMatRefMsg* msg = new plMatRefMsg(mat->GetKey(), plRefMsg::kOnCreate, -1, plMatRefMsg::kLayer);
hsgResMgr::ResMgr()->AddViaNotify(layer->GetKey(), msg, plRefFlags::kActiveRef); hsgResMgr::ResMgr()->AddViaNotify(layer->GetKey(), msg, plRefFlags::kActiveRef);
} }
@ -2792,9 +2792,9 @@ hsGMaterial *hsMaterialConverter::IWrapTextureInMaterial(Texmap *texMap, plMaxNo
return hMat; return hMat;
} }
hMat = TRACKED_NEW hsGMaterial; hMat = new hsGMaterial;
plLayer* hLay = TRACKED_NEW plLayer; plLayer* hLay = new plLayer;
hLay->InitToDefault(); hLay->InitToDefault();
hsgResMgr::ResMgr()->NewKey(txtFileName, hLay,nodeLoc); hsgResMgr::ResMgr()->NewKey(txtFileName, hLay,nodeLoc);
@ -3093,10 +3093,10 @@ void hsMaterialConverter::IAppendFunkyLayer(plMaxNode* node, Texmap* texMap, hsG
char name[512]; char name[512];
sprintf(name, "%s_funkRamp", prevLay->GetKey()->GetName()); sprintf(name, "%s_funkRamp", prevLay->GetKey()->GetName());
plLayer* layer = TRACKED_NEW plLayer; plLayer* layer = new plLayer;
layer->InitToDefault(); layer->InitToDefault();
hsgResMgr::ResMgr()->NewKey(name, layer, node->GetLocation()); hsgResMgr::ResMgr()->NewKey(name, layer, node->GetLocation());
hsgResMgr::ResMgr()->AddViaNotify(funkRamp->GetKey(), TRACKED_NEW plLayRefMsg(layer->GetKey(), plRefMsg::kOnCreate, 0, plLayRefMsg::kTexture), plRefFlags::kActiveRef); hsgResMgr::ResMgr()->AddViaNotify(funkRamp->GetKey(), new plLayRefMsg(layer->GetKey(), plRefMsg::kOnCreate, 0, plLayRefMsg::kTexture), plRefFlags::kActiveRef);
layer->SetAmbientColor(hsColorRGBA().Set(1.f, 1.f, 1.f, 1.f)); layer->SetAmbientColor(hsColorRGBA().Set(1.f, 1.f, 1.f, 1.f));
layer->SetPreshadeColor(hsColorRGBA().Set(0, 0, 0, 1.f)); layer->SetPreshadeColor(hsColorRGBA().Set(0, 0, 0, 1.f));
@ -3127,7 +3127,7 @@ void hsMaterialConverter::IAppendFunkyLayer(plMaxNode* node, Texmap* texMap, hsG
break; break;
} }
hsgResMgr::ResMgr()->AddViaNotify(layer->GetKey(), TRACKED_NEW plMatRefMsg(mat->GetKey(), plRefMsg::kOnCreate, hsgResMgr::ResMgr()->AddViaNotify(layer->GetKey(), new plMatRefMsg(mat->GetKey(), plRefMsg::kOnCreate,
-1, plMatRefMsg::kLayer), plRefFlags::kActiveRef); -1, plMatRefMsg::kLayer), plRefFlags::kActiveRef);
} }
@ -3239,13 +3239,13 @@ void hsMaterialConverter::IAppendWetLayer(plMaxNode* node, hsGMaterial* mat)
layer = plLayer::ConvertNoRef(key->GetObjectPtr()); layer = plLayer::ConvertNoRef(key->GetObjectPtr());
if( !layer ) if( !layer )
{ {
layer = TRACKED_NEW plLayer; layer = new plLayer;
layer->InitToDefault(); layer->InitToDefault();
hsgResMgr::ResMgr()->NewKey(name, layer, node->GetLocation()); hsgResMgr::ResMgr()->NewKey(name, layer, node->GetLocation());
plBitmap* funkRamp = IGetFunkyRamp(node, kFunkyUp); plBitmap* funkRamp = IGetFunkyRamp(node, kFunkyUp);
hsgResMgr::ResMgr()->AddViaNotify(funkRamp->GetKey(), TRACKED_NEW plLayRefMsg(layer->GetKey(), plRefMsg::kOnCreate, 0, plLayRefMsg::kTexture), plRefFlags::kActiveRef); hsgResMgr::ResMgr()->AddViaNotify(funkRamp->GetKey(), new plLayRefMsg(layer->GetKey(), plRefMsg::kOnCreate, 0, plLayRefMsg::kTexture), plRefFlags::kActiveRef);
} }
layer->SetAmbientColor(hsColorRGBA().Set(1.f, 1.f, 1.f, 1.f)); layer->SetAmbientColor(hsColorRGBA().Set(1.f, 1.f, 1.f, 1.f));
@ -3262,7 +3262,7 @@ void hsMaterialConverter::IAppendWetLayer(plMaxNode* node, hsGMaterial* mat)
layer->SetUVWSrc(plLayerInterface::kUVWNormal); layer->SetUVWSrc(plLayerInterface::kUVWNormal);
layer->SetMiscFlags(layer->GetMiscFlags() | hsGMatState::kMiscOrthoProjection); layer->SetMiscFlags(layer->GetMiscFlags() | hsGMatState::kMiscOrthoProjection);
hsgResMgr::ResMgr()->AddViaNotify(layer->GetKey(), TRACKED_NEW plMatRefMsg(mat->GetKey(), plRefMsg::kOnCreate, hsgResMgr::ResMgr()->AddViaNotify(layer->GetKey(), new plMatRefMsg(mat->GetKey(), plRefMsg::kOnCreate,
-1, plMatRefMsg::kLayer), plRefFlags::kActiveRef); -1, plMatRefMsg::kLayer), plRefFlags::kActiveRef);
} }
@ -3718,10 +3718,10 @@ plLayer* hsMaterialConverter::IMakeBumpLayer(plMaxNode* node, const char* nameBa
plMipmap* bumpLutTexture = IGetBumpLutTexture(node); plMipmap* bumpLutTexture = IGetBumpLutTexture(node);
plLayer* layer = TRACKED_NEW plLayer; plLayer* layer = new plLayer;
layer->InitToDefault(); layer->InitToDefault();
hsgResMgr::ResMgr()->NewKey(name, layer, node->GetLocation()); hsgResMgr::ResMgr()->NewKey(name, layer, node->GetLocation());
hsgResMgr::ResMgr()->AddViaNotify(bumpLutTexture->GetKey(), TRACKED_NEW plLayRefMsg(layer->GetKey(), plRefMsg::kOnCreate, 0, plLayRefMsg::kTexture), plRefFlags::kActiveRef); hsgResMgr::ResMgr()->AddViaNotify(bumpLutTexture->GetKey(), new plLayRefMsg(layer->GetKey(), plRefMsg::kOnCreate, 0, plLayRefMsg::kTexture), plRefFlags::kActiveRef);
layer->SetAmbientColor(hsColorRGBA().Set(1.f, 1.f, 1.f, 1.f)); layer->SetAmbientColor(hsColorRGBA().Set(1.f, 1.f, 1.f, 1.f));
layer->SetPreshadeColor(hsColorRGBA().Set(0, 0, 0, 1.f)); layer->SetPreshadeColor(hsColorRGBA().Set(0, 0, 0, 1.f));
@ -3797,11 +3797,11 @@ void hsMaterialConverter::IInsertBumpLayers(plMaxNode* node, hsGMaterial* mat, i
layerDu->SetBlendFlags((layerDu->GetBlendFlags() & ~hsGMatState::kBlendMask) | hsGMatState::kBlendAdd); layerDu->SetBlendFlags((layerDu->GetBlendFlags() & ~hsGMatState::kBlendMask) | hsGMatState::kBlendAdd);
// Insert it in the right spot. // Insert it in the right spot.
hsgResMgr::ResMgr()->AddViaNotify(layerDv->GetKey(), TRACKED_NEW plMatRefMsg(mat->GetKey(), plRefMsg::kOnCreate, hsgResMgr::ResMgr()->AddViaNotify(layerDv->GetKey(), new plMatRefMsg(mat->GetKey(), plRefMsg::kOnCreate,
bumpLayerIdx, plMatRefMsg::kLayer | plMatRefMsg::kInsert), plRefFlags::kActiveRef); bumpLayerIdx, plMatRefMsg::kLayer | plMatRefMsg::kInsert), plRefFlags::kActiveRef);
hsgResMgr::ResMgr()->AddViaNotify(layerDw->GetKey(), TRACKED_NEW plMatRefMsg(mat->GetKey(), plRefMsg::kOnCreate, hsgResMgr::ResMgr()->AddViaNotify(layerDw->GetKey(), new plMatRefMsg(mat->GetKey(), plRefMsg::kOnCreate,
bumpLayerIdx, plMatRefMsg::kLayer | plMatRefMsg::kInsert), plRefFlags::kActiveRef); bumpLayerIdx, plMatRefMsg::kLayer | plMatRefMsg::kInsert), plRefFlags::kActiveRef);
hsgResMgr::ResMgr()->AddViaNotify(layerDu->GetKey(), TRACKED_NEW plMatRefMsg(mat->GetKey(), plRefMsg::kOnCreate, hsgResMgr::ResMgr()->AddViaNotify(layerDu->GetKey(), new plMatRefMsg(mat->GetKey(), plRefMsg::kOnCreate,
bumpLayerIdx, plMatRefMsg::kLayer | plMatRefMsg::kInsert), plRefFlags::kActiveRef); bumpLayerIdx, plMatRefMsg::kLayer | plMatRefMsg::kInsert), plRefFlags::kActiveRef);
} }
@ -4533,7 +4533,7 @@ void hsMaterialConverter::CollectConvertedMaterials(Mtl *mtl, hsTArray<hsGMateri
plClothingItem *hsMaterialConverter::GenerateClothingItem(plClothingMtl *mtl, const plLocation &loc) plClothingItem *hsMaterialConverter::GenerateClothingItem(plClothingMtl *mtl, const plLocation &loc)
{ {
char clothKeyName[256]; char clothKeyName[256];
plClothingItem *cloth = TRACKED_NEW plClothingItem(); plClothingItem *cloth = new plClothingItem();
cloth->SetName(mtl->GetName()); cloth->SetName(mtl->GetName());
cloth->fSortOrder = (mtl->GetDefault() ? 0 : 1); cloth->fSortOrder = (mtl->GetDefault() ? 0 : 1);
@ -4553,7 +4553,7 @@ plClothingItem *hsMaterialConverter::GenerateClothingItem(plClothingMtl *mtl, co
sprintf(clothKeyName, "CItm_%s", cloth->fName); sprintf(clothKeyName, "CItm_%s", cloth->fName);
hsgResMgr::ResMgr()->NewKey(clothKeyName, cloth, loc); hsgResMgr::ResMgr()->NewKey(clothKeyName, cloth, loc);
plNodeRefMsg* nodeRefMsg = TRACKED_NEW plNodeRefMsg(plKeyFinder::Instance().FindSceneNodeKey(loc), plNodeRefMsg* nodeRefMsg = new plNodeRefMsg(plKeyFinder::Instance().FindSceneNodeKey(loc),
plNodeRefMsg::kOnRequest, -1, plNodeRefMsg::kGeneric); plNodeRefMsg::kOnRequest, -1, plNodeRefMsg::kGeneric);
hsgResMgr::ResMgr()->AddViaNotify(cloth->GetKey(), nodeRefMsg, plRefFlags::kActiveRef); hsgResMgr::ResMgr()->AddViaNotify(cloth->GetKey(), nodeRefMsg, plRefFlags::kActiveRef);
@ -4589,7 +4589,7 @@ plClothingItem *hsMaterialConverter::GenerateClothingItem(plClothingMtl *mtl, co
} }
continue; continue;
} }
plElementRefMsg *eMsg = TRACKED_NEW plElementRefMsg(cloth->GetKey(), plRefMsg::kOnCreate, i, -1, elementName, j); plElementRefMsg *eMsg = new plElementRefMsg(cloth->GetKey(), plRefMsg::kOnCreate, i, -1, elementName, j);
hsgResMgr::ResMgr()->AddViaNotify(tex->GetKey(), eMsg, plRefFlags::kActiveRef); hsgResMgr::ResMgr()->AddViaNotify(tex->GetKey(), eMsg, plRefFlags::kActiveRef);
} }
} }
@ -4606,7 +4606,7 @@ plClothingItem *hsMaterialConverter::GenerateClothingItem(plClothingMtl *mtl, co
} }
if (thumbnail != nil) if (thumbnail != nil)
{ {
plGenRefMsg *msg= TRACKED_NEW plGenRefMsg(cloth->GetKey(), plRefMsg::kOnCreate, -1, -1); plGenRefMsg *msg= new plGenRefMsg(cloth->GetKey(), plRefMsg::kOnCreate, -1, -1);
hsgResMgr::ResMgr()->AddViaNotify(thumbnail->GetKey(), msg, plRefFlags::kActiveRef); hsgResMgr::ResMgr()->AddViaNotify(thumbnail->GetKey(), msg, plRefFlags::kActiveRef);
} }
cloth->fDescription = hsStrcpy(mtl->GetDescription()); cloth->fDescription = hsStrcpy(mtl->GetDescription());

6
Sources/Tools/MaxConvert/hsVertexShader.cpp

@ -184,8 +184,8 @@ void hsVertexShader::IShadeSpan( plGeometrySpan *span, INode* node )
if( span->fNumVerts == 0 ) if( span->fNumVerts == 0 )
return; return;
fShadeColorTable = TRACKED_NEW hsColorRGBA[ span->fNumVerts ]; fShadeColorTable = new hsColorRGBA[ span->fNumVerts ];
fIllumColorTable = TRACKED_NEW hsColorRGBA[ span->fNumVerts ]; fIllumColorTable = new hsColorRGBA[ span->fNumVerts ];
translucent = IsTranslucent( span->fMaterial ); translucent = IsTranslucent( span->fMaterial );
@ -372,7 +372,7 @@ void hsVertexShader::IShadeVertices( plGeometrySpan *span, hsBitVector *dirtyVec
/// Allocate temp vertex array /// Allocate temp vertex array
vertices = TRACKED_NEW plTmpVertex3[ span->fNumVerts ]; vertices = new plTmpVertex3[ span->fNumVerts ];
for( index = 0; index < span->fNumVerts; index++ ) for( index = 0; index < span->fNumVerts; index++ )
{ {
span->ExtractVertex( index, &position, &normal, &color, &illum ); span->ExtractVertex( index, &position, &normal, &color, &illum );

10
Sources/Tools/MaxConvert/plBitmapCreator.cpp

@ -168,7 +168,7 @@ plMipmap *plBitmapCreator::ICreateBitmap(plBitmapData *bd)
// //
// Create a plMipmap // Create a plMipmap
// //
plMipmap *hBitmap = TRACKED_NEW plMipmap; plMipmap *hBitmap = new plMipmap;
if( (bm->Width() ^ (bm->Width() & -bm->Width())) if( (bm->Width() ^ (bm->Width() & -bm->Width()))
||(bm->Height() ^ (bm->Height() & -bm->Height())) ) ||(bm->Height() ^ (bm->Height() & -bm->Height())) )
{ {
@ -191,12 +191,12 @@ plMipmap *plBitmapCreator::ICreateBitmap(plBitmapData *bd)
plMipmap *hMipmap = nil; plMipmap *hMipmap = nil;
if (sigma > 0.f) if (sigma > 0.f)
{ {
hMipmap = TRACKED_NEW plMipmap(hBitmap, sigma, bd->createFlags, bd->detailDropoffStart, hMipmap = new plMipmap(hBitmap, sigma, bd->createFlags, bd->detailDropoffStart,
bd->detailDropoffStop, bd->detailMax, bd->detailMin); bd->detailDropoffStop, bd->detailMax, bd->detailMin);
} }
else else
{ {
hMipmap = TRACKED_NEW plMipmap(hBitmap, -1.f, bd->createFlags, bd->detailDropoffStart, hMipmap = new plMipmap(hBitmap, -1.f, bd->createFlags, bd->detailDropoffStart,
bd->detailDropoffStop, bd->detailMax, bd->detailMin); bd->detailDropoffStop, bd->detailMax, bd->detailMin);
} }
delete hBitmap; delete hBitmap;
@ -587,7 +587,7 @@ plBitmap *plBitmapCreator::ICreateTexture( plBitmapData *bd, const plLocation &l
// If it hasn't been used before, make a new texture // If it hasn't been used before, make a new texture
if( bd->isStaticCubicEnvMap ) if( bd->isStaticCubicEnvMap )
{ {
plCubicEnvironmap *cubic = TRACKED_NEW plCubicEnvironmap; plCubicEnvironmap *cubic = new plCubicEnvironmap;
plMipmap *face; plMipmap *face;
@ -685,7 +685,7 @@ plMipmap *plBitmapCreator::CreateBlankMipmap( uint32_t width, uint32_t height
return plMipmap::ConvertNoRef( key->GetObjectPtr() ); return plMipmap::ConvertNoRef( key->GetObjectPtr() );
// Create // Create
plMipmap *mip = TRACKED_NEW plMipmap( width, height, config, numLevels ); plMipmap *mip = new plMipmap( width, height, config, numLevels );
// Assign key // Assign key
hsgResMgr::ResMgr()->NewKey( keyName, mip, textureLoc ); hsgResMgr::ResMgr()->NewKey( keyName, mip, textureLoc );

14
Sources/Tools/MaxConvert/plClusterUtil.cpp

@ -104,7 +104,7 @@ plClusterUtil::~plClusterUtil()
plClusterGroup* plClusterUtil::CreateGroup(plMaxNode* templNode, const char* name) plClusterGroup* plClusterUtil::CreateGroup(plMaxNode* templNode, const char* name)
{ {
plClusterGroup* retVal = TRACKED_NEW plClusterGroup; plClusterGroup* retVal = new plClusterGroup;
char buff[256]; char buff[256];
sprintf(buff, "%s_%s_%d", name, templNode->GetName(), fIdx++); sprintf(buff, "%s_%s_%d", name, templNode->GetName(), fIdx++);
@ -113,7 +113,7 @@ plClusterGroup* plClusterUtil::CreateGroup(plMaxNode* templNode, const char* nam
plKey sceneNode = templNode->GetRoomKey(); plKey sceneNode = templNode->GetRoomKey();
retVal->SetSceneNode(sceneNode); retVal->SetSceneNode(sceneNode);
plNodeRefMsg* refMsg = TRACKED_NEW plNodeRefMsg(sceneNode, plRefMsg::kOnCreate, -1, plNodeRefMsg::kGeneric); plNodeRefMsg* refMsg = new plNodeRefMsg(sceneNode, plRefMsg::kOnCreate, -1, plNodeRefMsg::kGeneric);
hsgResMgr::ResMgr()->AddViaNotify(retVal->GetKey(), refMsg, plRefFlags::kActiveRef); hsgResMgr::ResMgr()->AddViaNotify(retVal->GetKey(), refMsg, plRefFlags::kActiveRef);
return retVal; return retVal;
@ -331,7 +331,7 @@ plSpanTemplateB* plClusterUtil::IAddTemplate(plMaxNode* templNode, plGeometrySpa
// STUB // STUB
// Create our blank template // Create our blank template
plSpanTemplateB* templ = TRACKED_NEW plSpanTemplateB(templNode); plSpanTemplateB* templ = new plSpanTemplateB(templNode);
templ->fRenderLevel = templNode->GetRenderLevel(!templNode->GetNoDeferDraw()); templ->fRenderLevel = templNode->GetRenderLevel(!templNode->GetNoDeferDraw());
@ -508,7 +508,7 @@ void plClusterUtil::IFindClustersRecur(plSpanTemplateB* templ, plL2WTab& src, pl
} }
else else
{ {
plL2WTab* tab = TRACKED_NEW plL2WTab(src); plL2WTab* tab = new plL2WTab(src);
dst.Append(1, &tab); dst.Append(1, &tab);
} }
} }
@ -692,7 +692,7 @@ void plClusterUtil::IAddInstsToCluster(plCluster* cluster, plSpanTemplateB* temp
int i; int i;
for( i = 0; i < insts.Count(); i++ ) for( i = 0; i < insts.Count(); i++ )
{ {
plSpanInstance* span = TRACKED_NEW plSpanInstance; plSpanInstance* span = new plSpanInstance;
span->Alloc(cluster->GetEncoding(), templ->NumVerts()); span->Alloc(cluster->GetEncoding(), templ->NumVerts());
span->SetLocalToWorld(plMaxNodeBase::Matrix3ToMatrix44(insts[i])); span->SetLocalToWorld(plMaxNodeBase::Matrix3ToMatrix44(insts[i]));
@ -754,7 +754,7 @@ void plClusterUtil::IDelPosAndColor(plSpanTemplateB* templ,
{ {
def->Begin(templ->GetSrcNode(), wBnd); def->Begin(templ->GetSrcNode(), wBnd);
delPos[i] = TRACKED_NEW plPoint3Tab; delPos[i] = new plPoint3Tab;
delPos[i]->SetCount(templ->NumVerts()); delPos[i]->SetCount(templ->NumVerts());
int j; int j;
for( j = 0; j < templ->NumVerts(); j++ ) for( j = 0; j < templ->NumVerts(); j++ )
@ -776,7 +776,7 @@ void plClusterUtil::IDelPosAndColor(plSpanTemplateB* templ,
{ {
shade->Begin(templ->GetSrcNode(), wBnd); shade->Begin(templ->GetSrcNode(), wBnd);
colors[i] = TRACKED_NEW plColorTab; colors[i] = new plColorTab;
colors[i]->SetCount(templ->NumVerts()); colors[i]->SetCount(templ->NumVerts());
int j; int j;
for( j = 0; j < templ->NumVerts(); j++ ) for( j = 0; j < templ->NumVerts(); j++ )

2
Sources/Tools/MaxConvert/plConvert.cpp

@ -395,7 +395,7 @@ void plConvert::DeInit()
// to work without loading in the entire age worth of reffing objects. - 5.30.2002 mcn // to work without loading in the entire age worth of reffing objects. - 5.30.2002 mcn
// plBitmapCreator::Instance().DeInit(); // plBitmapCreator::Instance().DeInit();
plNodeCleanupMsg *clean = TRACKED_NEW plNodeCleanupMsg(); plNodeCleanupMsg *clean = new plNodeCleanupMsg();
plgDispatch::MsgSend( clean ); plgDispatch::MsgSend( clean );
} }

8
Sources/Tools/MaxConvert/plDistributor.cpp

@ -969,7 +969,7 @@ BOOL plDistributor::IReadyRepNodes(plMeshCacheTab& cache) const
int iCache = cache.Count(); int iCache = cache.Count();
cache.SetCount(iCache + 1); cache.SetCount(iCache + 1);
cache[iCache].fMesh = TRACKED_NEW Mesh(*mesh); cache[iCache].fMesh = new Mesh(*mesh);
cache[iCache].fFlex = repNode->GetFlexibility(); cache[iCache].fFlex = repNode->GetFlexibility();
if( obj ) if( obj )
@ -1091,7 +1091,7 @@ BOOL plDistributor::IConformAll(Matrix3& l2w, int iRepNode, plMeshCacheTab& cach
iCache = cache.Count(); iCache = cache.Count();
cache.SetCount(iCache + 1); cache.SetCount(iCache + 1);
cache[iCache] = cache[iRepNode]; cache[iCache] = cache[iRepNode];
cache[iCache].fMesh = TRACKED_NEW Mesh(*mesh); cache[iCache].fMesh = new Mesh(*mesh);
mesh = cache[iCache].fMesh; mesh = cache[iCache].fMesh;
@ -1150,7 +1150,7 @@ BOOL plDistributor::IConformHeight(Matrix3& l2w, int iRepNode, plMeshCacheTab& c
iCache = cache.Count(); iCache = cache.Count();
cache.SetCount(iCache + 1); cache.SetCount(iCache + 1);
cache[iCache] = cache[iRepNode]; cache[iCache] = cache[iRepNode];
cache[iCache].fMesh = TRACKED_NEW Mesh(*mesh); cache[iCache].fMesh = new Mesh(*mesh);
mesh = cache[iCache].fMesh; mesh = cache[iCache].fMesh;
@ -1219,7 +1219,7 @@ BOOL plDistributor::IConformBase(Matrix3& l2w, int iRepNode, plMeshCacheTab& cac
iCache = cache.Count(); iCache = cache.Count();
cache.SetCount(iCache + 1); cache.SetCount(iCache + 1);
cache[iCache] = cache[iRepNode]; cache[iCache] = cache[iRepNode];
cache[iCache].fMesh = TRACKED_NEW Mesh(*mesh); cache[iCache].fMesh = new Mesh(*mesh);
mesh = cache[iCache].fMesh; mesh = cache[iCache].fMesh;

36
Sources/Tools/MaxConvert/plLayerConverter.cpp

@ -574,7 +574,7 @@ plLayerInterface *plLayerConverter::IConvertDynamicEnvLayer( plPlasmaMAXLayer
plBitmap *texture = (plBitmap *)IMakeCubicRenderTarget( texName, maxNode, anchor ); plBitmap *texture = (plBitmap *)IMakeCubicRenderTarget( texName, maxNode, anchor );
if( texture ) if( texture )
hsgResMgr::ResMgr()->AddViaNotify( texture->GetKey(), TRACKED_NEW plLayRefMsg( plasmaLayer->GetKey(), plRefMsg::kOnCreate, 0, plLayRefMsg::kTexture ), plRefFlags::kActiveRef ); hsgResMgr::ResMgr()->AddViaNotify( texture->GetKey(), new plLayRefMsg( plasmaLayer->GetKey(), plRefMsg::kOnCreate, 0, plLayRefMsg::kTexture ), plRefFlags::kActiveRef );
// Tag this layer as reflective cubic environmentmapping // Tag this layer as reflective cubic environmentmapping
if( bitmapPB->GetInt(plDynamicEnvLayer::kBmpRefract) ) if( bitmapPB->GetInt(plDynamicEnvLayer::kBmpRefract) )
@ -617,12 +617,12 @@ plLayerInterface *plLayerConverter::IConvertCameraLayer(plPlasmaMAXLayer *lay
{ {
plasmaLayer->SetUVWSrc(plLayerInterface::kUVWPosition); plasmaLayer->SetUVWSrc(plLayerInterface::kUVWPosition);
plasmaLayer->SetMiscFlags(hsGMatState::kMiscCam2Screen | hsGMatState::kMiscPerspProjection); plasmaLayer->SetMiscFlags(hsGMatState::kMiscCam2Screen | hsGMatState::kMiscPerspProjection);
hsgResMgr::ResMgr()->AddViaNotify(rootNode->GetSceneObject()->GetKey(), TRACKED_NEW plGenRefMsg(map->GetKey(), plRefMsg::kOnCreate, -1, plDynamicCamMap::kRefRootNode), plRefFlags::kActiveRef); hsgResMgr::ResMgr()->AddViaNotify(rootNode->GetSceneObject()->GetKey(), new plGenRefMsg(map->GetKey(), plRefMsg::kOnCreate, -1, plDynamicCamMap::kRefRootNode), plRefFlags::kActiveRef);
hsgResMgr::ResMgr()->AddViaNotify(plasmaLayer->GetKey(), TRACKED_NEW plGenRefMsg(map->GetKey(), plRefMsg::kOnCreate, -1, plDynamicCamMap::kRefMatLayer), plRefFlags::kActiveRef); hsgResMgr::ResMgr()->AddViaNotify(plasmaLayer->GetKey(), new plGenRefMsg(map->GetKey(), plRefMsg::kOnCreate, -1, plDynamicCamMap::kRefMatLayer), plRefFlags::kActiveRef);
if (!pb->GetInt(ParamID(plMAXCameraLayer::kForce))) if (!pb->GetInt(ParamID(plMAXCameraLayer::kForce)))
{ {
plBitmap *disableTexture = hsMaterialConverter::Instance().GetStaticColorTexture(pb->GetColor(ParamID(plMAXCameraLayer::kDisableColor)), loc); plBitmap *disableTexture = hsMaterialConverter::Instance().GetStaticColorTexture(pb->GetColor(ParamID(plMAXCameraLayer::kDisableColor)), loc);
hsgResMgr::ResMgr()->AddViaNotify(disableTexture->GetKey(), TRACKED_NEW plGenRefMsg(map->GetKey(), plRefMsg::kOnCreate, -1, plDynamicCamMap::kRefDisableTexture), plRefFlags::kActiveRef); hsgResMgr::ResMgr()->AddViaNotify(disableTexture->GetKey(), new plGenRefMsg(map->GetKey(), plRefMsg::kOnCreate, -1, plDynamicCamMap::kRefDisableTexture), plRefFlags::kActiveRef);
} }
} }
else else
@ -632,7 +632,7 @@ plLayerInterface *plLayerConverter::IConvertCameraLayer(plPlasmaMAXLayer *lay
{ {
const plCameraModifier1 *mod = plCameraModifier1::ConvertNoRef(camNode->GetSceneObject()->GetModifierByType(plCameraModifier1::Index())); const plCameraModifier1 *mod = plCameraModifier1::ConvertNoRef(camNode->GetSceneObject()->GetModifierByType(plCameraModifier1::Index()));
if (mod) if (mod)
hsgResMgr::ResMgr()->AddViaNotify(mod->GetKey(), TRACKED_NEW plGenRefMsg(map->GetKey(), plRefMsg::kOnCreate, -1, plDynamicCamMap::kRefCamera), plRefFlags::kActiveRef); hsgResMgr::ResMgr()->AddViaNotify(mod->GetKey(), new plGenRefMsg(map->GetKey(), plRefMsg::kOnCreate, -1, plDynamicCamMap::kRefCamera), plRefFlags::kActiveRef);
} }
plasmaLayer->SetUVWSrc(pb->GetInt(ParamID(plMAXCameraLayer::kUVSource))); plasmaLayer->SetUVWSrc(pb->GetInt(ParamID(plMAXCameraLayer::kUVSource)));
@ -643,9 +643,9 @@ plLayerInterface *plLayerConverter::IConvertCameraLayer(plPlasmaMAXLayer *lay
int i; int i;
for (i = 0; i < nodeList.GetCount(); i++) for (i = 0; i < nodeList.GetCount(); i++)
{ {
hsgResMgr::ResMgr()->AddViaNotify(nodeList[i]->GetSceneObject()->GetKey(), TRACKED_NEW plGenRefMsg(map->GetKey(), plRefMsg::kOnCreate, -1, plDynamicCamMap::kRefTargetNode), plRefFlags::kActiveRef); hsgResMgr::ResMgr()->AddViaNotify(nodeList[i]->GetSceneObject()->GetKey(), new plGenRefMsg(map->GetKey(), plRefMsg::kOnCreate, -1, plDynamicCamMap::kRefTargetNode), plRefFlags::kActiveRef);
} }
hsgResMgr::ResMgr()->AddViaNotify(map->GetKey(), TRACKED_NEW plLayRefMsg(plasmaLayer->GetKey(), plRefMsg::kOnCreate, -1, plLayRefMsg::kTexture), plRefFlags::kActiveRef); hsgResMgr::ResMgr()->AddViaNotify(map->GetKey(), new plLayRefMsg(plasmaLayer->GetKey(), plRefMsg::kOnCreate, -1, plLayRefMsg::kTexture), plRefFlags::kActiveRef);
} }
@ -700,7 +700,7 @@ plLayerInterface *plLayerConverter::IConvertDynamicTextLayer( plPlasmaMAXLaye
} }
// Add the texture in // Add the texture in
hsgResMgr::ResMgr()->AddViaNotify( texture->GetKey(), TRACKED_NEW plLayRefMsg( plasmaLayer->GetKey(), plRefMsg::kOnCreate, 0, plLayRefMsg::kTexture ), plRefFlags::kActiveRef ); hsgResMgr::ResMgr()->AddViaNotify( texture->GetKey(), new plLayRefMsg( plasmaLayer->GetKey(), plRefMsg::kOnCreate, 0, plLayRefMsg::kTexture ), plRefFlags::kActiveRef );
// All done! // All done!
return (plLayerInterface *)plasmaLayer; return (plLayerInterface *)plasmaLayer;
@ -728,7 +728,7 @@ uint32_t *plLayerConverter::IGetInitBitmapBuffer( plDynamicTextLayer *layer ) c
width = bitmapPB->GetInt( (ParamID)plDynamicTextLayer::kBmpExportWidth ); width = bitmapPB->GetInt( (ParamID)plDynamicTextLayer::kBmpExportWidth );
height = bitmapPB->GetInt( (ParamID)plDynamicTextLayer::kBmpExportHeight ); height = bitmapPB->GetInt( (ParamID)plDynamicTextLayer::kBmpExportHeight );
buffer = TRACKED_NEW uint32_t[ width * height ]; buffer = new uint32_t[ width * height ];
if( buffer == nil ) if( buffer == nil )
return nil; return nil;
@ -873,10 +873,10 @@ plLayer* plLayerConverter::ICreateAttenuationLayer(const char* name, plMaxNode *
} }
plBitmap* funkRamp = IGetAttenRamp(node, chanAdd, loClamp, hiClamp); plBitmap* funkRamp = IGetAttenRamp(node, chanAdd, loClamp, hiClamp);
plLayer* layer = TRACKED_NEW plLayer; plLayer* layer = new plLayer;
layer->InitToDefault(); layer->InitToDefault();
hsgResMgr::ResMgr()->NewKey(name, layer, node->GetLocation()); hsgResMgr::ResMgr()->NewKey(name, layer, node->GetLocation());
hsgResMgr::ResMgr()->AddViaNotify(funkRamp->GetKey(), TRACKED_NEW plLayRefMsg(layer->GetKey(), plRefMsg::kOnCreate, 0, plLayRefMsg::kTexture), plRefFlags::kActiveRef); hsgResMgr::ResMgr()->AddViaNotify(funkRamp->GetKey(), new plLayRefMsg(layer->GetKey(), plRefMsg::kOnCreate, 0, plLayRefMsg::kTexture), plRefFlags::kActiveRef);
layer->SetAmbientColor(hsColorRGBA().Set(1.f, 1.f, 1.f, 1.f)); layer->SetAmbientColor(hsColorRGBA().Set(1.f, 1.f, 1.f, 1.f));
layer->SetPreshadeColor(hsColorRGBA().Set(0, 0, 0, 1.f)); layer->SetPreshadeColor(hsColorRGBA().Set(0, 0, 0, 1.f));
@ -929,7 +929,7 @@ plLayer *plLayerConverter::ICreateLayer( const char *name, hsBool upperLayer
{ {
hsGuardBegin( "plPlasmaMAXLayer::ICreateLayer" ); hsGuardBegin( "plPlasmaMAXLayer::ICreateLayer" );
plLayer *layer = TRACKED_NEW plLayer; plLayer *layer = new plLayer;
layer->InitToDefault(); layer->InitToDefault();
hsgResMgr::ResMgr()->NewKey( name, layer, loc ); hsgResMgr::ResMgr()->NewKey( name, layer, loc );
@ -1013,7 +1013,7 @@ plDynamicTextMap *plLayerConverter::ICreateDynTextMap( const char *layerName,
} }
// Create // Create
map = TRACKED_NEW plDynamicTextMap(); map = new plDynamicTextMap();
map->SetNoCreate( width, height, includeAlphaChannel ); map->SetNoCreate( width, height, includeAlphaChannel );
/// Add a key for it /// Add a key for it
@ -1077,7 +1077,7 @@ plLayer *plLayerConverter::IAssignTexture( plBitmapData *bd, plMaxNode *maxNode,
} }
} }
else else
hsgResMgr::ResMgr()->AddViaNotify( texture->GetKey(), TRACKED_NEW plLayRefMsg( destLayer->GetKey(), plRefMsg::kOnCreate, 0, plLayRefMsg::kTexture ), plRefFlags::kActiveRef ); hsgResMgr::ResMgr()->AddViaNotify( texture->GetKey(), new plLayRefMsg( destLayer->GetKey(), plRefMsg::kOnCreate, 0, plLayRefMsg::kTexture ), plRefFlags::kActiveRef );
return destLayer; return destLayer;
} }
@ -1115,19 +1115,19 @@ plCubicRenderTarget *plLayerConverter::IMakeCubicRenderTarget( const char *name,
return nil; return nil;
/// Create /// Create
cubic = TRACKED_NEW plCubicRenderTarget( plRenderTarget::kIsTexture, 256, 256, 32 ); cubic = new plCubicRenderTarget( plRenderTarget::kIsTexture, 256, 256, 32 );
hsAssert( cubic != nil, "Cannot create cubic render target!" ); hsAssert( cubic != nil, "Cannot create cubic render target!" );
/// Add a key /// Add a key
key = hsgResMgr::ResMgr()->NewKey( name, cubic, node->GetLocation() ); key = hsgResMgr::ResMgr()->NewKey( name, cubic, node->GetLocation() );
/// Now make a modifier /// Now make a modifier
plCubicRenderTargetModifier *mod = TRACKED_NEW plCubicRenderTargetModifier(); plCubicRenderTargetModifier *mod = new plCubicRenderTargetModifier();
sprintf( modName, "%s_mod", name ); sprintf( modName, "%s_mod", name );
hsgResMgr::ResMgr()->NewKey( modName, mod, node->GetLocation() ); hsgResMgr::ResMgr()->NewKey( modName, mod, node->GetLocation() );
hsgResMgr::ResMgr()->AddViaNotify( cubic->GetKey(), TRACKED_NEW plGenRefMsg( mod->GetKey(), plRefMsg::kOnCreate, 0, 0 ), plRefFlags::kPassiveRef ); hsgResMgr::ResMgr()->AddViaNotify( cubic->GetKey(), new plGenRefMsg( mod->GetKey(), plRefMsg::kOnCreate, 0, 0 ), plRefFlags::kPassiveRef );
hsgResMgr::ResMgr()->AddViaNotify( mod->GetKey(), TRACKED_NEW plObjRefMsg( sObjKey, plRefMsg::kOnCreate, 0, plObjRefMsg::kModifier ), plRefFlags::kActiveRef ); hsgResMgr::ResMgr()->AddViaNotify( mod->GetKey(), new plObjRefMsg( sObjKey, plRefMsg::kOnCreate, 0, plObjRefMsg::kModifier ), plRefFlags::kActiveRef );
return cubic; return cubic;
} }

18
Sources/Tools/MaxConvert/plLightMapGen.cpp

@ -171,7 +171,7 @@ hsBool plLightMapGen::Open(Interface* ip, TimeValue t, bool forceRegen)
fInterface = ip; fInterface = ip;
fTime = t; fTime = t;
fRP = TRACKED_NEW RendParams; fRP = new RendParams;
fRP->SetRenderElementMgr(fInterface->GetRenderElementMgr(RS_Production)); fRP->SetRenderElementMgr(fInterface->GetRenderElementMgr(RS_Production));
#ifdef MF_NEW_RGC #ifdef MF_NEW_RGC
@ -239,7 +239,7 @@ hsBool plLightMapGen::Open(Interface* ip, TimeValue t, bool forceRegen)
#else MF_NEW_RGC #else MF_NEW_RGC
fRGC = TRACKED_NEW plRenderGlobalContext(fInterface, fTime); fRGC = new plRenderGlobalContext(fInterface, fTime);
fRGC->MakeRenderInstances((plMaxNode*)fInterface->GetRootNode(), fTime); fRGC->MakeRenderInstances((plMaxNode*)fInterface->GetRootNode(), fTime);
#endif // MF_NEW_RGC #endif // MF_NEW_RGC
@ -380,7 +380,7 @@ hsBool plLightMapGen::ICompressLightMaps()
if( orig == fCreatedLayers[j]->GetTexture() ) if( orig == fCreatedLayers[j]->GetTexture() )
{ {
fCreatedLayers[j]->GetKey()->Release(orig->GetKey()); fCreatedLayers[j]->GetKey()->Release(orig->GetKey());
hsgResMgr::ResMgr()->AddViaNotify(compressed->GetKey(), TRACKED_NEW plLayRefMsg(fCreatedLayers[j]->GetKey(), plRefMsg::kOnReplace, 0, plLayRefMsg::kTexture), plRefFlags::kActiveRef); hsgResMgr::ResMgr()->AddViaNotify(compressed->GetKey(), new plLayRefMsg(fCreatedLayers[j]->GetKey(), plRefMsg::kOnReplace, 0, plLayRefMsg::kTexture), plRefFlags::kActiveRef);
} }
} }
@ -569,7 +569,7 @@ plMipmap* plLightMapGen::IMakeAccumBitmap(plLayerInterface* lay) const
int height = dst->GetHeight(); int height = dst->GetHeight();
// Temporary mipmap here, so we don't have to worry about using plBitmapCreator // Temporary mipmap here, so we don't have to worry about using plBitmapCreator
plMipmap* bitmap = TRACKED_NEW plMipmap( width, height, plMipmap::kRGB32Config, 1 ); plMipmap* bitmap = new plMipmap( width, height, plMipmap::kRGB32Config, 1 );
HSMemory::Clear(bitmap->GetImage(), bitmap->GetHeight() * bitmap->GetRowBytes() ); HSMemory::Clear(bitmap->GetImage(), bitmap->GetHeight() * bitmap->GetRowBytes() );
return bitmap; return bitmap;
@ -1279,11 +1279,11 @@ plLayerInterface* plLightMapGen::IMakeLightMapLayer(plMaxNode* node, plGeometryS
} }
else else
{ {
objMat = TRACKED_NEW hsGMaterial; objMat = new hsGMaterial;
hsgResMgr::ResMgr()->NewKey(newMatName, objMat, nodeLoc); hsgResMgr::ResMgr()->NewKey(newMatName, objMat, nodeLoc);
for( i = 0; i < mat->GetNumLayers(); i++ ) for( i = 0; i < mat->GetNumLayers(); i++ )
hsgResMgr::ResMgr()->AddViaNotify(mat->GetLayer(i)->GetKey(), TRACKED_NEW plMatRefMsg(objMat->GetKey(), plRefMsg::kOnCreate, -1, plMatRefMsg::kLayer), plRefFlags::kActiveRef); hsgResMgr::ResMgr()->AddViaNotify(mat->GetLayer(i)->GetKey(), new plMatRefMsg(objMat->GetKey(), plRefMsg::kOnCreate, -1, plMatRefMsg::kLayer), plRefFlags::kActiveRef);
} }
objMat->SetCompositeFlags(objMat->GetCompositeFlags() | hsGMaterial::kCompIsLightMapped); objMat->SetCompositeFlags(objMat->GetCompositeFlags() | hsGMaterial::kCompIsLightMapped);
@ -1365,10 +1365,10 @@ plLayerInterface* plLightMapGen::IMakeLightMapLayer(plMaxNode* node, plGeometryS
} }
} }
plLayer* layer = TRACKED_NEW plLayer; plLayer* layer = new plLayer;
layer->InitToDefault(); layer->InitToDefault();
layKey = hsgResMgr::ResMgr()->NewKey(layName, layer, nodeLoc); layKey = hsgResMgr::ResMgr()->NewKey(layName, layer, nodeLoc);
hsgResMgr::ResMgr()->AddViaNotify(mipKey, TRACKED_NEW plLayRefMsg(layer->GetKey(), plRefMsg::kOnCreate, 0, plLayRefMsg::kTexture), plRefFlags::kActiveRef); hsgResMgr::ResMgr()->AddViaNotify(mipKey, new plLayRefMsg(layer->GetKey(), plRefMsg::kOnCreate, 0, plLayRefMsg::kTexture), plRefFlags::kActiveRef);
layer->SetAmbientColor(hsColorRGBA().Set(1.f, 1.f, 1.f, 1.f)); layer->SetAmbientColor(hsColorRGBA().Set(1.f, 1.f, 1.f, 1.f));
layer->SetZFlags(hsGMatState::kZNoZWrite); layer->SetZFlags(hsGMatState::kZNoZWrite);
layer->SetBlendFlags(hsGMatState::kBlendMult); layer->SetBlendFlags(hsGMatState::kBlendMult);
@ -1377,7 +1377,7 @@ plLayerInterface* plLightMapGen::IMakeLightMapLayer(plMaxNode* node, plGeometryS
layer->SetMiscFlags(hsGMatState::kMiscLightMap); layer->SetMiscFlags(hsGMatState::kMiscLightMap);
} }
hsgResMgr::ResMgr()->AddViaNotify(layKey, TRACKED_NEW plMatRefMsg(objMat->GetKey(), plRefMsg::kOnCreate, -1, plMatRefMsg::kPiggyBack), plRefFlags::kActiveRef); hsgResMgr::ResMgr()->AddViaNotify(layKey, new plMatRefMsg(objMat->GetKey(), plRefMsg::kOnCreate, -1, plMatRefMsg::kPiggyBack), plRefFlags::kActiveRef);
span.fMaterial = objMat; span.fMaterial = objMat;

26
Sources/Tools/MaxConvert/plMeshConverter.cpp

@ -188,7 +188,7 @@ class plMAXVertNormal
if( fNext ) if( fNext )
fNext->AddNormal( n, s ); fNext->AddNormal( n, s );
else else
fNext = TRACKED_NEW plMAXVertNormal( ::Normalize(n), s ); fNext = new plMAXVertNormal( ::Normalize(n), s );
} }
else else
{ {
@ -358,7 +358,7 @@ plConvexVolume *plMeshConverter::CreateConvexVolume(plMaxNode *node)
numFaces = mesh->getNumFaces(); numFaces = mesh->getNumFaces();
numVerts = mesh->getNumVerts(); numVerts = mesh->getNumVerts();
plConvexVolume *bounds = TRACKED_NEW plConvexVolume(); plConvexVolume *bounds = new plConvexVolume();
/// Get transforms /// Get transforms
l2wMatrix = node->GetLocalToWorld44(); l2wMatrix = node->GetLocalToWorld44();
@ -458,7 +458,7 @@ bool plMeshConverter::IValidateUVs(plMaxNode* node)
// Cache the original UV verts // Cache the original UV verts
int numVerts = mesh->getNumMapVerts(1); int numVerts = mesh->getNumMapVerts(1);
int vertBufSize = sizeof(UVVert)*numVerts; int vertBufSize = sizeof(UVVert)*numVerts;
UVVert* origVerts = TRACKED_NEW UVVert[vertBufSize]; UVVert* origVerts = new UVVert[vertBufSize];
memcpy(origVerts, mesh->mapVerts(1), vertBufSize); memcpy(origVerts, mesh->mapVerts(1), vertBufSize);
IDeleteTempGeometry(); IDeleteTempGeometry();
@ -646,7 +646,7 @@ hsBool plMeshConverter::CreateSpans( plMaxNode *node, hsTArray<plGeometrySpan *
{ {
if (mesh->vertCol != nil) if (mesh->vertCol != nil)
{ {
colorArray = TRACKED_NEW hsColorRGBA[ mesh->numCVerts ]; colorArray = new hsColorRGBA[ mesh->numCVerts ];
for( i = 0; i < mesh->numCVerts; i++ ) for( i = 0; i < mesh->numCVerts; i++ )
{ {
colorArray[i].Set(mesh->vertCol[ i ].x, mesh->vertCol[ i ].y, mesh->vertCol[ i ].z, 1.f); colorArray[i].Set(mesh->vertCol[ i ].x, mesh->vertCol[ i ].y, mesh->vertCol[ i ].z, 1.f);
@ -666,7 +666,7 @@ hsBool plMeshConverter::CreateSpans( plMaxNode *node, hsTArray<plGeometrySpan *
if (illumMap != nil) if (illumMap != nil)
{ {
// MF_HORSE CARNAGE // MF_HORSE CARNAGE
illumArray = TRACKED_NEW hsColorRGBA[numIllumVerts]; illumArray = new hsColorRGBA[numIllumVerts];
for( i = 0; i < numIllumVerts; i++ ) for( i = 0; i < numIllumVerts; i++ )
{ {
illumArray[i].Set(illumMap[ i ].x, illumMap[ i ].y, illumMap[ i ].z, 1.f); illumArray[i].Set(illumMap[ i ].x, illumMap[ i ].y, illumMap[ i ].z, 1.f);
@ -783,7 +783,7 @@ hsBool plMeshConverter::CreateSpans( plMaxNode *node, hsTArray<plGeometrySpan *
continue; continue;
} }
hsTArray<plMAXVertexAccumulator *> *currAccum = TRACKED_NEW hsTArray<plMAXVertexAccumulator *>; hsTArray<plMAXVertexAccumulator *> *currAccum = new hsTArray<plMAXVertexAccumulator *>;
int currNumSubMtls = ourMaterials[i]->GetCount(); int currNumSubMtls = ourMaterials[i]->GetCount();
currAccum->Reset(); currAccum->Reset();
ourAccumulators[i] = currAccum; ourAccumulators[i] = currAccum;
@ -873,8 +873,8 @@ hsBool plMeshConverter::CreateSpans( plMaxNode *node, hsTArray<plGeometrySpan *
for( i = 0; i < vertNormalCache.GetCount(); i++ ) for( i = 0; i < vertNormalCache.GetCount(); i++ )
vertNormalCache[ i ].Normalize(); vertNormalCache[ i ].Normalize();
vertDPosDuCache = TRACKED_NEW hsTArray<plMAXVertNormal>[numMaterials]; vertDPosDuCache = new hsTArray<plMAXVertNormal>[numMaterials];
vertDPosDvCache = TRACKED_NEW hsTArray<plMAXVertNormal>[numMaterials]; vertDPosDvCache = new hsTArray<plMAXVertNormal>[numMaterials];
hsTArray<int16_t> bumpLayIdx; hsTArray<int16_t> bumpLayIdx;
hsTArray<int16_t> bumpLayChan; hsTArray<int16_t> bumpLayChan;
@ -1189,7 +1189,7 @@ hsBool plMeshConverter::CreateSpans( plMaxNode *node, hsTArray<plGeometrySpan *
if (accum->GetVertexCount() == 0) if (accum->GetVertexCount() == 0)
continue; continue;
plGeometrySpan *span = TRACKED_NEW plGeometrySpan; plGeometrySpan *span = new plGeometrySpan;
span->BeginCreate( subMats->Get(j).fMaterial, l2wMatrix, ourFormat ); span->BeginCreate( subMats->Get(j).fMaterial, l2wMatrix, ourFormat );
span->fLocalToOBB = node->GetLocalToOBB44(); span->fLocalToOBB = node->GetLocalToOBB44();
@ -1429,7 +1429,7 @@ Mesh *plMeshConverter::IGetNodeMesh( plMaxNode *node )
Mesh* plMeshConverter::IDuplicate2Sided(plMaxNode* node, Mesh* mesh) Mesh* plMeshConverter::IDuplicate2Sided(plMaxNode* node, Mesh* mesh)
{ {
mesh = TRACKED_NEW Mesh(*mesh); mesh = new Mesh(*mesh);
Mtl* mtl = node->GetMtl(); Mtl* mtl = node->GetMtl();
@ -2032,7 +2032,7 @@ plMAXVertexAccumulator::plMAXVertexAccumulator( int numOrigPoints, int numChanne
fNumPoints = numOrigPoints; fNumPoints = numOrigPoints;
fNumChannels = numChannels; fNumChannels = numChannels;
fPointList = TRACKED_NEW plMAXVertexAccNodePtr[ fNumPoints ]; fPointList = new plMAXVertexAccNodePtr[ fNumPoints ];
memset( fPointList, 0, sizeof( plMAXVertexAccNode * ) * fNumPoints ); memset( fPointList, 0, sizeof( plMAXVertexAccNode * ) * fNumPoints );
fIndices.Reset(); fIndices.Reset();
@ -2084,7 +2084,7 @@ void plMAXVertexAccumulator::AddVertex( int index, hsPoint3 *point, hsVector3
/// Adding new /// Adding new
node = TRACKED_NEW plMAXVertexAccNode( point, normal, color, illum, fNumChannels, uvs, fNumVertices ); node = new plMAXVertexAccNode( point, normal, color, illum, fNumChannels, uvs, fNumVertices );
fInverseVertTable.Append( index ); fInverseVertTable.Append( index );
fIndices.Append( fNumVertices++ ); fIndices.Append( fNumVertices++ );
@ -2106,7 +2106,7 @@ void plMAXVertexAccumulator::StuffMyData( plMaxNode* maxNode, plGeometrySpan
TempWeightInfo *weights = nil; TempWeightInfo *weights = nil;
/// Precalculate the weights if necessary /// Precalculate the weights if necessary
weights = TRACKED_NEW TempWeightInfo[ fNumPoints ]; weights = new TempWeightInfo[ fNumPoints ];
if( skinData != nil ) if( skinData != nil )
{ {
for( i = 0; i < fNumPoints; i++ ) for( i = 0; i < fNumPoints; i++ )

2
Sources/Tools/MaxExport/SimpleExport.h

@ -91,7 +91,7 @@ class HSClassDesc2 : public ClassDesc
{ {
public: public:
int IsPublic() { return 1; } int IsPublic() { return 1; }
void * Create(BOOL loading = FALSE) { return TRACKED_NEW HSExport2; } void * Create(BOOL loading = FALSE) { return new HSExport2; }
const TCHAR * ClassName() { return "Plasma 2.0 Scene Exporter"; } const TCHAR * ClassName() { return "Plasma 2.0 Scene Exporter"; }
SClass_ID SuperClassID() { return SCENE_EXPORT_CLASS_ID; } SClass_ID SuperClassID() { return SCENE_EXPORT_CLASS_ID; }
#ifdef HS_DEBUGGING #ifdef HS_DEBUGGING

2
Sources/Tools/MaxMain/GlobalUtility.cpp

@ -301,7 +301,7 @@ DWORD PlasmaMax::Control(DWORD parameter)
} }
#ifdef MAXASS_AVAILABLE #ifdef MAXASS_AVAILABLE
jvArray<TexInfo>* textures = TRACKED_NEW jvArray<TexInfo>(texInfo.size()); jvArray<TexInfo>* textures = new jvArray<TexInfo>(texInfo.size());
for (int i = 0; i < texInfo.size(); i++) for (int i = 0; i < texInfo.size(); i++)
(*textures)[i] = texInfo[i]; (*textures)[i] = texInfo[i];
return DWORD(textures); return DWORD(textures);

4
Sources/Tools/MaxMain/main.cpp

@ -170,7 +170,7 @@ BOOL WINAPI DllMain(HINSTANCE hinstDLL,ULONG fdwReason,LPVOID lpvReserved)
} }
// Initialize the ResManager // Initialize the ResManager
plResManager* pRmgr = TRACKED_NEW plPluginResManager; plResManager* pRmgr = new plPluginResManager;
hsgResMgr::Init(pRmgr); hsgResMgr::Init(pRmgr);
} }
@ -238,7 +238,7 @@ class plGeneralAttribClassDesc : public ClassDesc2
{ {
public: public:
int IsPublic() { return 1; } int IsPublic() { return 1; }
void* Create(BOOL loading) { return TRACKED_NEW plGeneralAttrib; } void* Create(BOOL loading) { return new plGeneralAttrib; }
const TCHAR* ClassName() { return _T("Plasma Attrib"); } const TCHAR* ClassName() { return _T("Plasma Attrib"); }
SClass_ID SuperClassID() { return CUST_ATTRIB_CLASS_ID; } SClass_ID SuperClassID() { return CUST_ATTRIB_CLASS_ID; }
Class_ID ClassID() { return PL_GEN_ATTRIB_CLASS_ID; } Class_ID ClassID() { return PL_GEN_ATTRIB_CLASS_ID; }

8
Sources/Tools/MaxMain/plAgeDescInterface.cpp

@ -187,7 +187,7 @@ BOOL plAgeDescInterface::DlgProc(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lPar
#ifdef MAXASS_AVAILABLE #ifdef MAXASS_AVAILABLE
if( fAssetManIface == nil ) if( fAssetManIface == nil )
fAssetManIface = TRACKED_NEW MaxAssBranchAccess(); fAssetManIface = new MaxAssBranchAccess();
#endif #endif
// Make our bold font by getting the normal font and bolding // Make our bold font by getting the normal font and bolding
@ -853,7 +853,7 @@ void plAgeDescInterface::IGetAgeFiles(vector<plAgeFile*>& ageFiles)
{ {
ageFolder.GetPathAndName(agePath); ageFolder.GetPathAndName(agePath);
plAgeFile* age = TRACKED_NEW plAgeFile(plAgeFile::kLocalFile, agePath); plAgeFile* age = new plAgeFile(plAgeFile::kLocalFile, agePath);
ageFiles.push_back(age); ageFiles.push_back(age);
} }
} }
@ -873,7 +873,7 @@ void plAgeDescInterface::IGetAgeFiles(vector<plAgeFile*>& ageFiles)
{ {
if (assetMan->GetLatestVersionFile((*assets)[i], agePath, sizeof(agePath))) if (assetMan->GetLatestVersionFile((*assets)[i], agePath, sizeof(agePath)))
{ {
plAgeFile* age = TRACKED_NEW plAgeFile(plAgeFile::kAssetFile, agePath, (*assets)[i]); plAgeFile* age = new plAgeFile(plAgeFile::kAssetFile, agePath, (*assets)[i]);
int existing = IFindAge(age->fAgeName.c_str(), ageFiles); int existing = IFindAge(age->fAgeName.c_str(), ageFiles);
// Remove it from our "local" list if there, since it's a duplicate // Remove it from our "local" list if there, since it's a duplicate
@ -1092,7 +1092,7 @@ void plAgeDescInterface::INewPage()
int idx = ListBox_AddString(hPages, name); int idx = ListBox_AddString(hPages, name);
// Choose a new sequence suffix for it // Choose a new sequence suffix for it
plAgePage *newPage = TRACKED_NEW plAgePage( name, IGetFreePageSeqSuffix( hPages ), 0 ); plAgePage *newPage = new plAgePage( name, IGetFreePageSeqSuffix( hPages ), 0 );
ListBox_SetItemData( hPages, idx, (LPARAM)newPage ); ListBox_SetItemData( hPages, idx, (LPARAM)newPage );
fDirty = true; fDirty = true;

2
Sources/Tools/MaxMain/plCommonObjLib.cpp

@ -117,7 +117,7 @@ plCommonObjLib::plCommonObjLib()
{ {
// Make sure we have a list to add ourselves to // Make sure we have a list to add ourselves to
if( fLibList == nil ) if( fLibList == nil )
fLibList = TRACKED_NEW plCommonObjLibList(); fLibList = new plCommonObjLibList();
// Add ourselves to the list of libs // Add ourselves to the list of libs
fLibList->Add( this ); fLibList->Add( this );

2
Sources/Tools/MaxMain/plComponentDlg.cpp

@ -205,7 +205,7 @@ void plComponentDlg::IGetComment()
int len = GetWindowTextLength(GetDlgItem(fhDlg, IDC_COMMENTS))+1; int len = GetWindowTextLength(GetDlgItem(fhDlg, IDC_COMMENTS))+1;
if (len != 0) if (len != 0)
{ {
char *buf = TRACKED_NEW char[len]; char *buf = new char[len];
GetDlgItemText(fhDlg, IDC_COMMENTS, buf, len); GetDlgItemText(fhDlg, IDC_COMMENTS, buf, len);
fCommentNode->SetUserPropBuffer(buf); fCommentNode->SetUserPropBuffer(buf);
delete [] buf; delete [] buf;

8
Sources/Tools/MaxMain/plMaxMeshExtractor.cpp

@ -97,7 +97,7 @@ static bool MakeNormalMesh(plMaxNode *node, plMaxMeshExtractor::NeutralMesh& mes
int parity = fullTM.Parity(); int parity = fullTM.Parity();
mesh.fNumVerts = pMesh->numVerts; mesh.fNumVerts = pMesh->numVerts;
mesh.fVerts = TRACKED_NEW hsPoint3[mesh.fNumVerts]; mesh.fVerts = new hsPoint3[mesh.fNumVerts];
for (int i = 0; i < mesh.fNumVerts; i++) for (int i = 0; i < mesh.fNumVerts; i++)
{ {
@ -111,7 +111,7 @@ static bool MakeNormalMesh(plMaxNode *node, plMaxMeshExtractor::NeutralMesh& mes
} }
mesh.fNumFaces = pMesh->numFaces; mesh.fNumFaces = pMesh->numFaces;
mesh.fFaces = TRACKED_NEW uint16_t[mesh.fNumFaces*3]; mesh.fFaces = new uint16_t[mesh.fNumFaces*3];
for (int i = 0; i < mesh.fNumFaces; i++) for (int i = 0; i < mesh.fNumFaces; i++)
{ {
Face* pFace = &pMesh->faces[i]; Face* pFace = &pMesh->faces[i];
@ -135,8 +135,8 @@ static bool MakeNormalMesh(plMaxNode *node, plMaxMeshExtractor::NeutralMesh& mes
// MODIFIES *all* the input parameters. // MODIFIES *all* the input parameters.
static void MakeBoxMesh(plMaxNode* node, plMaxMeshExtractor::NeutralMesh& mesh, hsPoint3& minV, hsPoint3& maxV) static void MakeBoxMesh(plMaxNode* node, plMaxMeshExtractor::NeutralMesh& mesh, hsPoint3& minV, hsPoint3& maxV)
{ {
hsPoint3* newVerts = TRACKED_NEW hsPoint3[8]; hsPoint3* newVerts = new hsPoint3[8];
uint16_t* newFaces = TRACKED_NEW uint16_t[12 * 3]; uint16_t* newFaces = new uint16_t[12 * 3];
newVerts[0].Set(minV.fX, minV.fY, minV.fZ); newVerts[0].Set(minV.fX, minV.fY, minV.fZ);
newVerts[1].Set(maxV.fX, minV.fY, minV.fZ); newVerts[1].Set(maxV.fX, minV.fY, minV.fZ);

130
Sources/Tools/MaxMain/plMaxNode.cpp

@ -227,7 +227,7 @@ void plMaxBoneMap::SetBaseMatrixIndex(plDrawable *draw, uint32_t idx)
// you'll be hosed (duh). // you'll be hosed (duh).
void plMaxBoneMap::SortBones() void plMaxBoneMap::SortBones()
{ {
plMaxNodeBase **tempBones = TRACKED_NEW plMaxNodeBase*[fNumBones]; plMaxNodeBase **tempBones = new plMaxNodeBase*[fNumBones];
FillBoneArray(tempBones); FillBoneArray(tempBones);
// Look ma! An n^2 bubble sort! // Look ma! An n^2 bubble sort!
@ -263,7 +263,7 @@ plKey plMaxNode::AddModifier(plModifier *pMod, const char* name)
plKey modKey = pMod->GetKey(); plKey modKey = pMod->GetKey();
if (!modKey) if (!modKey)
modKey = hsgResMgr::ResMgr()->NewKey(name, pMod, GetLocation()); modKey = hsgResMgr::ResMgr()->NewKey(name, pMod, GetLocation());
hsgResMgr::ResMgr()->AddViaNotify(modKey, TRACKED_NEW plObjRefMsg(GetKey(), plRefMsg::kOnCreate, -1, plObjRefMsg::kModifier), plRefFlags::kActiveRef); hsgResMgr::ResMgr()->AddViaNotify(modKey, new plObjRefMsg(GetKey(), plRefMsg::kOnCreate, -1, plObjRefMsg::kModifier), plRefFlags::kActiveRef);
return modKey; return modKey;
} }
@ -538,7 +538,7 @@ hsBool plMaxNode::MakeSceneObject(plErrorMsg *pErrMsg, plConvertSettings *settin
plKey objKey; plKey objKey;
// Handle this as a SceneObject // Handle this as a SceneObject
pso = TRACKED_NEW plSceneObject; pso = new plSceneObject;
objKey = hsgResMgr::ResMgr()->NewKey(GetName(), pso, nodeLoc, GetLoadMask()); objKey = hsgResMgr::ResMgr()->NewKey(GetName(), pso, nodeLoc, GetLoadMask());
// Remember info in MaxNodeData block for later // Remember info in MaxNodeData block for later
@ -824,7 +824,7 @@ hsBool plMaxNode::MakePhysical(plErrorMsg *pErrMsg, plConvertSettings *settings)
// //
// Create the physical // Create the physical
// //
plPXPhysical* physical = TRACKED_NEW plPXPhysical; plPXPhysical* physical = new plPXPhysical;
// add the object to the resource manager, keyed to the new name // add the object to the resource manager, keyed to the new name
plLocation nodeLoc = GetKey()->GetUoid().GetLocation(); plLocation nodeLoc = GetKey()->GetUoid().GetLocation();
@ -860,14 +860,14 @@ hsBool plMaxNode::MakePhysical(plErrorMsg *pErrMsg, plConvertSettings *settings)
if(physProps->GetLOSSwimRegion()) if(physProps->GetLOSSwimRegion())
physical->AddLOSDB(plSimDefs::kLOSDBSwimRegion); physical->AddLOSDB(plSimDefs::kLOSDBSwimRegion);
plSimulationInterface* si = TRACKED_NEW plSimulationInterface; plSimulationInterface* si = new plSimulationInterface;
plKey pSiKey = hsgResMgr::ResMgr()->NewKey(objName, si, nodeLoc, GetLoadMask()); plKey pSiKey = hsgResMgr::ResMgr()->NewKey(objName, si, nodeLoc, GetLoadMask());
// link the simulation interface to the scene object // link the simulation interface to the scene object
hsgResMgr::ResMgr()->AddViaNotify(pSiKey, TRACKED_NEW plObjRefMsg(GetKey(), plRefMsg::kOnCreate, 0, plObjRefMsg::kInterface), plRefFlags::kActiveRef); hsgResMgr::ResMgr()->AddViaNotify(pSiKey, new plObjRefMsg(GetKey(), plRefMsg::kOnCreate, 0, plObjRefMsg::kInterface), plRefFlags::kActiveRef);
// add the physical to the simulation interface // add the physical to the simulation interface
hsgResMgr::ResMgr()->AddViaNotify(physKey , TRACKED_NEW plIntRefMsg(pSiKey, plRefMsg::kOnCreate, 0, plIntRefMsg::kPhysical), plRefFlags::kActiveRef); hsgResMgr::ResMgr()->AddViaNotify(physKey , new plIntRefMsg(pSiKey, plRefMsg::kOnCreate, 0, plIntRefMsg::kPhysical), plRefFlags::kActiveRef);
return true; return true;
} }
@ -909,9 +909,9 @@ hsBool plMaxNode::MakeCoordinateInterface(plErrorMsg *pErrMsg, plConvertSettings
hsMatrix44 loc2Par = GetLocalToParent44(); hsMatrix44 loc2Par = GetLocalToParent44();
hsMatrix44 par2Loc = GetParentToLocal44(); hsMatrix44 par2Loc = GetParentToLocal44();
if( GetFilterInherit() ) if( GetFilterInherit() )
ci = TRACKED_NEW plFilterCoordInterface; ci = new plFilterCoordInterface;
else else
ci = TRACKED_NEW plCoordinateInterface; ci = new plCoordinateInterface;
//------------------------- //-------------------------
// Get data from Node, then its key, then its name // Get data from Node, then its key, then its name
//------------------------- //-------------------------
@ -927,7 +927,7 @@ hsBool plMaxNode::MakeCoordinateInterface(plErrorMsg *pErrMsg, plConvertSettings
ci->SetProperty(plCoordinateInterface::kCanEverDelayTransform, !usesPhysics); ci->SetProperty(plCoordinateInterface::kCanEverDelayTransform, !usesPhysics);
ci->SetProperty(plCoordinateInterface::kDelayedTransformEval, !usesPhysics); ci->SetProperty(plCoordinateInterface::kDelayedTransformEval, !usesPhysics);
hsgResMgr::ResMgr()->AddViaNotify(pCiKey, TRACKED_NEW plObjRefMsg(pNodeKey, plRefMsg::kOnCreate, 0, plObjRefMsg::kInterface), plRefFlags::kActiveRef); hsgResMgr::ResMgr()->AddViaNotify(pCiKey, new plObjRefMsg(pNodeKey, plRefMsg::kOnCreate, 0, plObjRefMsg::kInterface), plRefFlags::kActiveRef);
} }
return true; return true;
} }
@ -950,7 +950,7 @@ hsBool plMaxNode::MakeModifiers(plErrorMsg *pErrMsg, plConvertSettings *settings
// mf horse hack testing ViewFace which is already obsolete // mf horse hack testing ViewFace which is already obsolete
if ( UserPropExists("ViewFacing") ) if ( UserPropExists("ViewFacing") )
{ {
plViewFaceModifier* pMod = TRACKED_NEW plViewFaceModifier; plViewFaceModifier* pMod = new plViewFaceModifier;
if( UserPropExists("VFPivotFavorY") ) if( UserPropExists("VFPivotFavorY") )
pMod->SetFlag(plViewFaceModifier::kPivotFavorY); pMod->SetFlag(plViewFaceModifier::kPivotFavorY);
else if( UserPropExists("VFPivotY") ) else if( UserPropExists("VFPivotY") )
@ -1011,12 +1011,12 @@ hsBool plMaxNode::MakeParentOrRoomConnection(plErrorMsg *pErrMsg, plConvertSetti
hsAssert(ci,"Missing CI"); hsAssert(ci,"Missing CI");
plIntRefMsg* msg = TRACKED_NEW plIntRefMsg(parKey, plRefMsg::kOnCreate, -1, plIntRefMsg::kChildObject); plIntRefMsg* msg = new plIntRefMsg(parKey, plRefMsg::kOnCreate, -1, plIntRefMsg::kChildObject);
msg->SetRef(pso); msg->SetRef(pso);
hsgResMgr::ResMgr()->AddViaNotify(msg, plRefFlags::kPassiveRef); hsgResMgr::ResMgr()->AddViaNotify(msg, plRefFlags::kPassiveRef);
} }
hsgResMgr::ResMgr()->AddViaNotify(pso->GetKey(), TRACKED_NEW plNodeRefMsg(GetRoomKey(), plRefMsg::kOnCreate, -1, plNodeRefMsg::kObject), plRefFlags::kActiveRef); hsgResMgr::ResMgr()->AddViaNotify(pso->GetKey(), new plNodeRefMsg(GetRoomKey(), plRefMsg::kOnCreate, -1, plNodeRefMsg::kObject), plRefFlags::kActiveRef);
return true; return true;
} }
@ -1168,10 +1168,10 @@ int IsGeoSpanConvex(plMaxNode* node, const plGeometrySpan* span)
if( numFaces <= kSmallNumFaces ) if( numFaces <= kSmallNumFaces )
return IsGeoSpanConvexExhaust(span); return IsGeoSpanConvexExhaust(span);
hsTArray<int>* vertList = TRACKED_NEW hsTArray<int> [numVerts]; hsTArray<int>* vertList = new hsTArray<int> [numVerts];
hsTArray<hsVector3>* normList = TRACKED_NEW hsTArray<hsVector3> [numVerts]; hsTArray<hsVector3>* normList = new hsTArray<hsVector3> [numVerts];
hsTArray<float>* distList = TRACKED_NEW hsTArray<float> [numVerts]; hsTArray<float>* distList = new hsTArray<float> [numVerts];
uint16_t* idx = span->fIndexData; uint16_t* idx = span->fIndexData;
@ -1301,12 +1301,12 @@ hsBool plMaxNode::MakeMesh(plErrorMsg *pErrMsg, plConvertSettings *settings)
// This node has no geometry on export, but will have some added at runtime, // This node has no geometry on export, but will have some added at runtime,
// so it needs a special drawInterface // so it needs a special drawInterface
plInstanceDrawInterface *newDI = TRACKED_NEW plInstanceDrawInterface; plInstanceDrawInterface *newDI = new plInstanceDrawInterface;
newDI->fTargetID = GetSwappableGeomTarget(); newDI->fTargetID = GetSwappableGeomTarget();
plKey pDiKey = hsgResMgr::ResMgr()->NewKey( GetKey()->GetName(), newDI, nodeLoc, GetLoadMask() ); plKey pDiKey = hsgResMgr::ResMgr()->NewKey( GetKey()->GetName(), newDI, nodeLoc, GetLoadMask() );
hsgResMgr::ResMgr()->AddViaNotify(pDiKey, TRACKED_NEW plObjRefMsg(GetKey(), plRefMsg::kOnCreate, 0, plObjRefMsg::kInterface), plRefFlags::kActiveRef); hsgResMgr::ResMgr()->AddViaNotify(pDiKey, new plObjRefMsg(GetKey(), plRefMsg::kOnCreate, 0, plObjRefMsg::kInterface), plRefFlags::kActiveRef);
plSwapSpansRefMsg *sMsg = TRACKED_NEW plSwapSpansRefMsg(pDiKey, plRefMsg::kOnCreate, -1, -1); plSwapSpansRefMsg *sMsg = new plSwapSpansRefMsg(pDiKey, plRefMsg::kOnCreate, -1, -1);
plDrawableSpans *drawable = IGetSceneNodeSpans(IGetDrawableSceneNode(pErrMsg), true, true); plDrawableSpans *drawable = IGetSceneNodeSpans(IGetDrawableSceneNode(pErrMsg), true, true);
hsgResMgr::ResMgr()->AddViaNotify(drawable->GetKey(), sMsg, plRefFlags::kActiveRef); hsgResMgr::ResMgr()->AddViaNotify(drawable->GetKey(), sMsg, plRefFlags::kActiveRef);
@ -1416,7 +1416,7 @@ hsBool plMaxNode::MakeMesh(plErrorMsg *pErrMsg, plConvertSettings *settings)
color.Set( 0.5, 0.5, 1, 1 ); color.Set( 0.5, 0.5, 1, 1 );
// Exp fog // Exp fog
myFog = TRACKED_NEW plFogEnvironment( plFogEnvironment::kExpFog, 700.f, 1.f, color ); myFog = new plFogEnvironment( plFogEnvironment::kExpFog, 700.f, 1.f, color );
myFogKey = hsgResMgr::ResMgr()->NewKey( "HACK_FOG", myFog, nodeLoc ); myFogKey = hsgResMgr::ResMgr()->NewKey( "HACK_FOG", myFog, nodeLoc );
hsgResMgr::ResMgr()->AddExportAlias( "HACK_FOG", plFogEnvironment::Index(), myFogKey ); hsgResMgr::ResMgr()->AddExportAlias( "HACK_FOG", plFogEnvironment::Index(), myFogKey );
} }
@ -1468,9 +1468,9 @@ hsBool plMaxNode::MakeMesh(plErrorMsg *pErrMsg, plConvertSettings *settings)
{ {
/// Make a new drawInterface (will assign stuff to it later) /// Make a new drawInterface (will assign stuff to it later)
newDI = TRACKED_NEW plDrawInterface; newDI = new plDrawInterface;
plKey pDiKey = hsgResMgr::ResMgr()->NewKey( GetKey()->GetName(), newDI, nodeLoc, GetLoadMask() ); plKey pDiKey = hsgResMgr::ResMgr()->NewKey( GetKey()->GetName(), newDI, nodeLoc, GetLoadMask() );
hsgResMgr::ResMgr()->AddViaNotify(pDiKey, TRACKED_NEW plObjRefMsg(GetKey(), plRefMsg::kOnCreate, 0, plObjRefMsg::kInterface), plRefFlags::kActiveRef); hsgResMgr::ResMgr()->AddViaNotify(pDiKey, new plObjRefMsg(GetKey(), plRefMsg::kOnCreate, 0, plObjRefMsg::kInterface), plRefFlags::kActiveRef);
/// Attach the processed spans to the DI (through drawables) /// Attach the processed spans to the DI (through drawables)
IAssignSpansToDrawables( spanArray, newDI, pErrMsg, settings ); IAssignSpansToDrawables( spanArray, newDI, pErrMsg, settings );
@ -1667,7 +1667,7 @@ void plMaxNode::ISetupBones(plDrawableSpans *drawable, hsTArray<plGeometrySpa
int baseMatrix, i; int baseMatrix, i;
uint8_t numBones = (boneMap ? boneMap->fNumBones : NumBones()) + 1; uint8_t numBones = (boneMap ? boneMap->fNumBones : NumBones()) + 1;
plMaxNodeBase **boneArray = TRACKED_NEW plMaxNodeBase*[numBones]; plMaxNodeBase **boneArray = new plMaxNodeBase*[numBones];
if (boneMap) if (boneMap)
boneMap->FillBoneArray(boneArray); boneMap->FillBoneArray(boneArray);
@ -1763,9 +1763,9 @@ void plMaxNode::ISetupBones(plDrawableSpans *drawable, hsTArray<plGeometrySpa
else else
{ {
plLocation nodeLoc = bone->GetLocation(); plLocation nodeLoc = bone->GetLocation();
di = TRACKED_NEW plDrawInterface; di = new plDrawInterface;
plKey diKey = hsgResMgr::ResMgr()->NewKey(GetKey()->GetName(), di, nodeLoc, GetLoadMask()); plKey diKey = hsgResMgr::ResMgr()->NewKey(GetKey()->GetName(), di, nodeLoc, GetLoadMask());
hsgResMgr::ResMgr()->AddViaNotify(diKey, TRACKED_NEW plObjRefMsg(obj->GetKey(), plRefMsg::kOnCreate, 0, plObjRefMsg::kInterface), plRefFlags::kActiveRef); hsgResMgr::ResMgr()->AddViaNotify(diKey, new plObjRefMsg(obj->GetKey(), plRefMsg::kOnCreate, 0, plObjRefMsg::kInterface), plRefFlags::kActiveRef);
} }
if( di->GetNumDrawables() <= iDraw ) if( di->GetNumDrawables() <= iDraw )
@ -1827,7 +1827,7 @@ hsBool plMaxNode::IMakeInstanceSpans( plMaxNode *node, hsTArray<plGeometrySpan
spanArray.ExpandAndZero( spanArray.GetCount() + disi.fIndices.GetCount() ); spanArray.ExpandAndZero( spanArray.GetCount() + disi.fIndices.GetCount() );
for( i = 0; i < disi.fIndices.GetCount(); i++ ) for( i = 0; i < disi.fIndices.GetCount(); i++ )
{ {
spanArray[ index ] = TRACKED_NEW plGeometrySpan; spanArray[ index ] = new plGeometrySpan;
spanArray[ index ]->MakeInstanceOf( dr->GetGeometrySpan( disi.fIndices[ i ] ) ); spanArray[ index ]->MakeInstanceOf( dr->GetGeometrySpan( disi.fIndices[ i ] ) );
if( setVisDists ) if( setVisDists )
@ -2243,12 +2243,12 @@ hsBool plMaxNode::ConvertToOccluder(plErrorMsg* pErrMsg, hsBool twoSided, hsBool
plMobileOccluder* mob = nil; plMobileOccluder* mob = nil;
if( moving ) if( moving )
{ {
mob = TRACKED_NEW plMobileOccluder; mob = new plMobileOccluder;
occ = mob; occ = mob;
} }
else else
{ {
occ = TRACKED_NEW plOccluder; occ = new plOccluder;
} }
occ->SetPolyList(polys); occ->SetPolyList(polys);
@ -2267,7 +2267,7 @@ hsBool plMaxNode::ConvertToOccluder(plErrorMsg* pErrMsg, hsBool twoSided, hsBool
} }
plKey key = hsgResMgr::ResMgr()->NewKey( tmpName, occ, nodeLoc, GetLoadMask() ); plKey key = hsgResMgr::ResMgr()->NewKey( tmpName, occ, nodeLoc, GetLoadMask() );
hsgResMgr::ResMgr()->AddViaNotify(occ->GetKey(), TRACKED_NEW plObjRefMsg(GetKey(), plRefMsg::kOnCreate, -1, plObjRefMsg::kInterface), plRefFlags::kActiveRef); hsgResMgr::ResMgr()->AddViaNotify(occ->GetKey(), new plObjRefMsg(GetKey(), plRefMsg::kOnCreate, -1, plObjRefMsg::kInterface), plRefFlags::kActiveRef);
} }
return true; return true;
@ -2310,7 +2310,7 @@ hsBool plMaxNode::MakeLight(plErrorMsg *pErrMsg, plConvertSettings *settings)
plKey key = hsgResMgr::ResMgr()->NewKey( GetKey()->GetName(), liInfo, nodeLoc, GetLoadMask() ); plKey key = hsgResMgr::ResMgr()->NewKey( GetKey()->GetName(), liInfo, nodeLoc, GetLoadMask() );
hsgResMgr::ResMgr()->AddViaNotify(liInfo->GetKey(), TRACKED_NEW plObjRefMsg(GetKey(), plRefMsg::kOnCreate, -1, plObjRefMsg::kInterface), plRefFlags::kActiveRef); hsgResMgr::ResMgr()->AddViaNotify(liInfo->GetKey(), new plObjRefMsg(GetKey(), plRefMsg::kOnCreate, -1, plObjRefMsg::kInterface), plRefFlags::kActiveRef);
// Only support projection for spots and dir lights for now. // Only support projection for spots and dir lights for now.
@ -2554,7 +2554,7 @@ plLightInfo* plMaxNode::IMakeSpot(plErrorMsg* pErrMsg, plConvertSettings* settin
return nil; return nil;
} }
plSpotLightInfo* spot = TRACKED_NEW plSpotLightInfo; plSpotLightInfo* spot = new plSpotLightInfo;
IGetLightColors(spot, light, ls); IGetLightColors(spot, light, ls);
@ -2583,7 +2583,7 @@ plLightInfo* plMaxNode::IMakeOmni(plErrorMsg* pErrMsg, plConvertSettings* settin
return nil; return nil;
} }
plOmniLightInfo* omni = TRACKED_NEW plOmniLightInfo; plOmniLightInfo* omni = new plOmniLightInfo;
IGetLightAttenuation(omni, light, ls); IGetLightAttenuation(omni, light, ls);
@ -2614,7 +2614,7 @@ plLightInfo* plMaxNode::IMakeDirectional(plErrorMsg* pErrMsg, plConvertSettings*
plLightInfo* plasLight = nil; plLightInfo* plasLight = nil;
if( light->GetProjMap() ) if( light->GetProjMap() )
{ {
plLimitedDirLightInfo* ldl = TRACKED_NEW plLimitedDirLightInfo; plLimitedDirLightInfo* ldl = new plLimitedDirLightInfo;
float sz = light->GetFallsize(timeVal, FOREVER); float sz = light->GetFallsize(timeVal, FOREVER);
float depth = 1000.f; float depth = 1000.f;
@ -2627,7 +2627,7 @@ plLightInfo* plMaxNode::IMakeDirectional(plErrorMsg* pErrMsg, plConvertSettings*
else else
{ {
plDirectionalLightInfo* direct = TRACKED_NEW plDirectionalLightInfo; plDirectionalLightInfo* direct = new plDirectionalLightInfo;
plasLight = direct; plasLight = direct;
} }
@ -2654,7 +2654,7 @@ plLightInfo* plMaxNode::IMakeRTSpot(plErrorMsg* pErrMsg, plConvertSettings* sett
} }
plSpotLightInfo* spot = TRACKED_NEW plSpotLightInfo; plSpotLightInfo* spot = new plSpotLightInfo;
if(!ThisObjPB->GetInt(plRTLightBase::kLightOn)) if(!ThisObjPB->GetInt(plRTLightBase::kLightOn))
spot->SetProperty(plLightInfo::kDisable, true); spot->SetProperty(plLightInfo::kDisable, true);
@ -2665,7 +2665,7 @@ plLightInfo* plMaxNode::IMakeRTSpot(plErrorMsg* pErrMsg, plConvertSettings* sett
IGetRTCone(spot, ThisObjPB); IGetRTCone(spot, ThisObjPB);
//plSpotModifier* liMod = TRACKED_NEW plSpotModifier; //plSpotModifier* liMod = new plSpotModifier;
//GetRTLightColAnim(ThisObjPB, liMod); //GetRTLightColAnim(ThisObjPB, liMod);
//GetRTLightAttenAnim(ThisObjPB, liMod); //GetRTLightAttenAnim(ThisObjPB, liMod);
@ -2689,7 +2689,7 @@ plLightInfo* plMaxNode::IMakeRTOmni(plErrorMsg* pErrMsg, plConvertSettings* sett
Object *ThisObj = ((INode*)this)->GetObjectRef(); Object *ThisObj = ((INode*)this)->GetObjectRef();
IParamBlock2* ThisObjPB = ThisObj->GetParamBlockByID(plRTLightBase::kBlkOmniLight); IParamBlock2* ThisObjPB = ThisObj->GetParamBlockByID(plRTLightBase::kBlkOmniLight);
plOmniLightInfo* omni = TRACKED_NEW plOmniLightInfo; plOmniLightInfo* omni = new plOmniLightInfo;
if(!ThisObjPB->GetInt(plRTLightBase::kLightOn)) if(!ThisObjPB->GetInt(plRTLightBase::kLightOn))
omni->SetProperty(plLightInfo::kDisable, true); omni->SetProperty(plLightInfo::kDisable, true);
@ -2698,7 +2698,7 @@ plLightInfo* plMaxNode::IMakeRTOmni(plErrorMsg* pErrMsg, plConvertSettings* sett
IGetRTLightColors(omni, ThisObjPB); IGetRTLightColors(omni, ThisObjPB);
//plOmniModifier* liMod = TRACKED_NEW plOmniModifier; //plOmniModifier* liMod = new plOmniModifier;
//GetRTLightColAnim(ThisObjPB, liMod); //GetRTLightColAnim(ThisObjPB, liMod);
//GetRTLightAttenAnim(ThisObjPB, liMod); //GetRTLightAttenAnim(ThisObjPB, liMod);
@ -2722,14 +2722,14 @@ plLightInfo* plMaxNode::IMakeRTDirectional(plErrorMsg* pErrMsg, plConvertSetting
IParamBlock2* ThisObjPB = ThisObj->GetParamBlockByID(plRTLightBase::kBlkTSpotLight); IParamBlock2* ThisObjPB = ThisObj->GetParamBlockByID(plRTLightBase::kBlkTSpotLight);
plDirectionalLightInfo* direct = TRACKED_NEW plDirectionalLightInfo; plDirectionalLightInfo* direct = new plDirectionalLightInfo;
if(!ThisObjPB->GetInt(plRTLightBase::kLightOn)) if(!ThisObjPB->GetInt(plRTLightBase::kLightOn))
direct->SetProperty(plLightInfo::kDisable, true); direct->SetProperty(plLightInfo::kDisable, true);
IGetRTLightColors(direct, ThisObjPB); IGetRTLightColors(direct, ThisObjPB);
//plLightModifier* liMod = TRACKED_NEW plLightModifier; //plLightModifier* liMod = new plLightModifier;
//GetRTLightColAnim(ThisObjPB, liMod); //GetRTLightColAnim(ThisObjPB, liMod);
@ -2755,7 +2755,7 @@ plLightInfo *plMaxNode::IMakeRTProjDirectional( plErrorMsg *pErrMsg, plConvertSe
IParamBlock2 *mainPB = ThisObj->GetParamBlockByID( plRTLightBase::kBlkMain ); IParamBlock2 *mainPB = ThisObj->GetParamBlockByID( plRTLightBase::kBlkMain );
IParamBlock2 *projPB = ThisObj->GetParamBlockByID( plRTProjDirLight::kBlkProj ); IParamBlock2 *projPB = ThisObj->GetParamBlockByID( plRTProjDirLight::kBlkProj );
plLimitedDirLightInfo *light = TRACKED_NEW plLimitedDirLightInfo; plLimitedDirLightInfo *light = new plLimitedDirLightInfo;
light->SetWidth( projPB->GetFloat( plRTProjDirLight::kWidth ) ); light->SetWidth( projPB->GetFloat( plRTProjDirLight::kWidth ) );
light->SetHeight( projPB->GetFloat( plRTProjDirLight::kHeight ) ); light->SetHeight( projPB->GetFloat( plRTProjDirLight::kHeight ) );
@ -2766,7 +2766,7 @@ plLightInfo *plMaxNode::IMakeRTProjDirectional( plErrorMsg *pErrMsg, plConvertSe
IGetRTLightColors( light, mainPB ); IGetRTLightColors( light, mainPB );
//plLightModifier *liMod = TRACKED_NEW plLightModifier; //plLightModifier *liMod = new plLightModifier;
//GetRTLightColAnim( mainPB, liMod ); //GetRTLightColAnim( mainPB, liMod );
@ -2860,7 +2860,7 @@ hsBool plMaxNode::IGetProjection(plLightInfo* li, plErrorMsg* pErrMsg)
break; break;
} }
hsgResMgr::ResMgr()->AddViaNotify(proj->GetKey(), TRACKED_NEW plGenRefMsg(li->GetKey(), plRefMsg::kOnCreate, 0, 0), plRefFlags::kActiveRef); hsgResMgr::ResMgr()->AddViaNotify(proj->GetKey(), new plGenRefMsg(li->GetKey(), plRefMsg::kOnCreate, 0, 0), plRefFlags::kActiveRef);
li->SetShadowCaster(false); li->SetShadowCaster(false);
@ -2997,9 +2997,9 @@ void plMaxNode::GetRTLightAttenAnim(IParamBlock2* ProperPB, plAGAnim *anim)
if( ProperPB->GetInt(plRTLightBase::kAttenTypeRadio, TimeValue(0)) == 2 ) if( ProperPB->GetInt(plRTLightBase::kAttenTypeRadio, TimeValue(0)) == 2 )
{ {
// Animation of a cutoff attenuation, which only needs a scalar channel // Animation of a cutoff attenuation, which only needs a scalar channel
plOmniCutoffApplicator *app = TRACKED_NEW plOmniCutoffApplicator(); plOmniCutoffApplicator *app = new plOmniCutoffApplicator();
app->SetChannelName(GetName()); app->SetChannelName(GetName());
plScalarControllerChannel *chan = TRACKED_NEW plScalarControllerChannel(subCtl); plScalarControllerChannel *chan = new plScalarControllerChannel(subCtl);
app->SetChannel(chan); app->SetChannel(chan);
anim->AddApplicator(app); anim->AddApplicator(app);
if (!strcmp(anim->GetName(), ENTIRE_ANIMATION_NAME)) if (!strcmp(anim->GetName(), ENTIRE_ANIMATION_NAME))
@ -3048,12 +3048,12 @@ void plMaxNode::GetRTLightAttenAnim(IParamBlock2* ProperPB, plAGAnim *anim)
} }
plAGApplicator *app; plAGApplicator *app;
if (distSq) if (distSq)
app = TRACKED_NEW plOmniSqApplicator; app = new plOmniSqApplicator;
else else
app = TRACKED_NEW plOmniApplicator; app = new plOmniApplicator;
app->SetChannelName(GetName()); app->SetChannelName(GetName());
plScalarControllerChannel *chan = TRACKED_NEW plScalarControllerChannel(subCtl); plScalarControllerChannel *chan = new plScalarControllerChannel(subCtl);
app->SetChannel(chan); app->SetChannel(chan);
anim->AddApplicator(app); anim->AddApplicator(app);
if (!strcmp(anim->GetName(), ENTIRE_ANIMATION_NAME)) if (!strcmp(anim->GetName(), ENTIRE_ANIMATION_NAME))
@ -3132,9 +3132,9 @@ void plMaxNode::GetRTLightColAnim(IParamBlock2* ProperPB, plAGAnim *anim)
if( ctl ) if( ctl )
{ {
plLightAmbientApplicator *app = TRACKED_NEW plLightAmbientApplicator(); plLightAmbientApplicator *app = new plLightAmbientApplicator();
app->SetChannelName(GetName()); app->SetChannelName(GetName());
chan = TRACKED_NEW plPointControllerChannel(ctl); chan = new plPointControllerChannel(ctl);
app->SetChannel(chan); app->SetChannel(chan);
anim->AddApplicator(app); anim->AddApplicator(app);
if (!strcmp(anim->GetName(), ENTIRE_ANIMATION_NAME)) if (!strcmp(anim->GetName(), ENTIRE_ANIMATION_NAME))
@ -3152,9 +3152,9 @@ void plMaxNode::GetRTLightColAnim(IParamBlock2* ProperPB, plAGAnim *anim)
if( ctl ) if( ctl )
{ {
IAdjustRTColorByIntensity(ctl, ProperPB); IAdjustRTColorByIntensity(ctl, ProperPB);
plLightDiffuseApplicator *app = TRACKED_NEW plLightDiffuseApplicator(); plLightDiffuseApplicator *app = new plLightDiffuseApplicator();
app->SetChannelName(GetName()); app->SetChannelName(GetName());
chan = TRACKED_NEW plPointControllerChannel(ctl); chan = new plPointControllerChannel(ctl);
app->SetChannel(chan); app->SetChannel(chan);
anim->AddApplicator(app); anim->AddApplicator(app);
if (!strcmp(anim->GetName(), ENTIRE_ANIMATION_NAME)) if (!strcmp(anim->GetName(), ENTIRE_ANIMATION_NAME))
@ -3171,9 +3171,9 @@ void plMaxNode::GetRTLightColAnim(IParamBlock2* ProperPB, plAGAnim *anim)
if( ctl ) if( ctl )
{ {
plLightSpecularApplicator *app = TRACKED_NEW plLightSpecularApplicator(); plLightSpecularApplicator *app = new plLightSpecularApplicator();
app->SetChannelName(GetName()); app->SetChannelName(GetName());
chan = TRACKED_NEW plPointControllerChannel(ctl); chan = new plPointControllerChannel(ctl);
app->SetChannel(chan); app->SetChannel(chan);
anim->AddApplicator(app); anim->AddApplicator(app);
if (!strcmp(anim->GetName(), ENTIRE_ANIMATION_NAME)) if (!strcmp(anim->GetName(), ENTIRE_ANIMATION_NAME))
@ -3198,9 +3198,9 @@ void plMaxNode::GetRTConeAnim(IParamBlock2* ProperPB, plAGAnim *anim)
if( ctl ) if( ctl )
{ {
plSpotInnerApplicator *app = TRACKED_NEW plSpotInnerApplicator(); plSpotInnerApplicator *app = new plSpotInnerApplicator();
app->SetChannelName(GetName()); app->SetChannelName(GetName());
chan = TRACKED_NEW plScalarControllerChannel(ctl); chan = new plScalarControllerChannel(ctl);
app->SetChannel(chan); app->SetChannel(chan);
anim->AddApplicator(app); anim->AddApplicator(app);
if (!strcmp(anim->GetName(), ENTIRE_ANIMATION_NAME)) if (!strcmp(anim->GetName(), ENTIRE_ANIMATION_NAME))
@ -3217,9 +3217,9 @@ void plMaxNode::GetRTConeAnim(IParamBlock2* ProperPB, plAGAnim *anim)
if( ctl ) if( ctl )
{ {
plSpotOuterApplicator *app = TRACKED_NEW plSpotOuterApplicator(); plSpotOuterApplicator *app = new plSpotOuterApplicator();
app->SetChannelName(GetName()); app->SetChannelName(GetName());
chan = TRACKED_NEW plScalarControllerChannel(ctl); chan = new plScalarControllerChannel(ctl);
app->SetChannel(chan); app->SetChannel(chan);
anim->AddApplicator(app); anim->AddApplicator(app);
if (!strcmp(anim->GetName(), ENTIRE_ANIMATION_NAME)) if (!strcmp(anim->GetName(), ENTIRE_ANIMATION_NAME))
@ -3339,7 +3339,7 @@ plDrawableSpans *plMaxNode::IGetSceneNodeSpans( plSceneNode *node, hsBool needBl
/// Couldn't find--create and return it /// Couldn't find--create and return it
spans = TRACKED_NEW plDrawableSpans; spans = new plDrawableSpans;
if( needBlending ) if( needBlending )
{ {
/// Blending (deferred) spans /// Blending (deferred) spans
@ -3690,12 +3690,12 @@ void plMaxNode::SetupBonesAliasesRecur(const char *rootName)
plUoid* uoid = hsgResMgr::ResMgr()->FindAlias(aliasName, plSceneObject::Index()); plUoid* uoid = hsgResMgr::ResMgr()->FindAlias(aliasName, plSceneObject::Index());
if( !uoid ) if( !uoid )
{ {
plAliasModifier* pAlMod = TRACKED_NEW plAliasModifier; plAliasModifier* pAlMod = new plAliasModifier;
pAlMod->SetAlias(aliasName); pAlMod->SetAlias(aliasName);
AddModifier(pAlMod); AddModifier(pAlMod);
} }
*/ */
plAGModifier *mod = TRACKED_NEW plAGModifier(nameToUse); plAGModifier *mod = new plAGModifier(nameToUse);
AddModifier(mod, GetName()); AddModifier(mod, GetName());
} }
} }
@ -3798,7 +3798,7 @@ void plMaxNode::SetupBoneHierarchyPalette(plMaxBoneMap *bones /* = nil */)
if (bones == nil) if (bones == nil)
{ {
bones = TRACKED_NEW plMaxBoneMap(); bones = new plMaxBoneMap();
bones->fOwner = this; bones->fOwner = this;
} }
@ -3924,7 +3924,7 @@ void plMaxNode::ISetCachedAlphaHackValue( int iSubMtl, int value )
hsTArray<int> *cache = pDat->GetAlphaHackLayersCache(); hsTArray<int> *cache = pDat->GetAlphaHackLayersCache();
if( cache == nil ) if( cache == nil )
{ {
cache = TRACKED_NEW hsTArray<int>; cache = new hsTArray<int>;
pDat->SetAlphaHackLayersCache( cache ); pDat->SetAlphaHackLayersCache( cache );
} }
@ -4107,10 +4107,10 @@ hsBool plMaxNode::MakeIfaceReferences(plErrorMsg *pErrMsg, plConvertSettings *se
// the list in a handy form // the list in a handy form
if (keys.Count()) if (keys.Count())
{ {
plInterfaceInfoModifier* pMod = TRACKED_NEW plInterfaceInfoModifier; plInterfaceInfoModifier* pMod = new plInterfaceInfoModifier;
plKey modifierKey = hsgResMgr::ResMgr()->NewKey(GetName(), pMod, GetLocation(), GetLoadMask()); plKey modifierKey = hsgResMgr::ResMgr()->NewKey(GetName(), pMod, GetLocation(), GetLoadMask());
hsgResMgr::ResMgr()->AddViaNotify(modifierKey, TRACKED_NEW plObjRefMsg(GetSceneObject()->GetKey(), plRefMsg::kOnCreate, -1, plObjRefMsg::kModifier), plRefFlags::kActiveRef); hsgResMgr::ResMgr()->AddViaNotify(modifierKey, new plObjRefMsg(GetSceneObject()->GetKey(), plRefMsg::kOnCreate, -1, plObjRefMsg::kModifier), plRefFlags::kActiveRef);
for(int i = 0; i < keys.Count(); i++) for(int i = 0; i < keys.Count(); i++)
pMod->AddRefdKey(keys[i]); pMod->AddRefdKey(keys[i]);

6
Sources/Tools/MaxMain/plMaxNodeData.h

@ -129,7 +129,7 @@ public:
DataBF() DataBF()
{ {
fBitVector = TRACKED_NEW hsBitVector; fBitVector = new hsBitVector;
fBitVector->SetBit(kDrawable); fBitVector->SetBit(kDrawable);
fBitVector->SetBit(kPhysical); fBitVector->SetBit(kPhysical);
} }
@ -142,13 +142,13 @@ public:
} }
DataBF(const DataBF& ot) DataBF(const DataBF& ot)
{ {
fBitVector = TRACKED_NEW hsBitVector; fBitVector = new hsBitVector;
*fBitVector = *ot.fBitVector; *fBitVector = *ot.fBitVector;
} }
void Init() void Init()
{ {
fBitVector = TRACKED_NEW hsBitVector; fBitVector = new hsBitVector;
fBitVector->SetBit(kDrawable); fBitVector->SetBit(kDrawable);
fBitVector->SetBit(kPhysical); fBitVector->SetBit(kPhysical);
} }

18
Sources/Tools/MaxMain/plPhysXCooking.cpp

@ -119,7 +119,7 @@ hsVectorStream* plPhysXCooking::CookTrimesh(int nVerts, hsPoint3* verts, int nFa
triDesc.triangles = faces; triDesc.triangles = faces;
triDesc.flags = NX_MF_16_BIT_INDICES; triDesc.flags = NX_MF_16_BIT_INDICES;
hsVectorStream* ram = TRACKED_NEW hsVectorStream; hsVectorStream* ram = new hsVectorStream;
plPXStream buf(ram); plPXStream buf(ram);
bool status = NxCookTriangleMesh(triDesc, buf); bool status = NxCookTriangleMesh(triDesc, buf);
hsAssert(status, "Trimesh failed to cook"); hsAssert(status, "Trimesh failed to cook");
@ -158,7 +158,7 @@ bool plPhysXCooking::TestIfConvex(NxConvexMesh* convexMesh, int nVerts, hsPoint3
NxConvexMeshDesc desc; NxConvexMeshDesc desc;
convexMesh->saveToDesc(desc); convexMesh->saveToDesc(desc);
hsPlane3* planes = TRACKED_NEW hsPlane3[desc.numTriangles]; hsPlane3* planes = new hsPlane3[desc.numTriangles];
int i; int i;
for ( i = 0; i < desc.numTriangles; i++) for ( i = 0; i < desc.numTriangles; i++)
@ -199,7 +199,7 @@ hsVectorStream* plPhysXCooking::CookHull(int nVerts, hsPoint3* verts, bool infla
convexDesc.flags|= NX_CF_INFLATE_CONVEX ; convexDesc.flags|= NX_CF_INFLATE_CONVEX ;
} }
hsVectorStream* ram = TRACKED_NEW hsVectorStream; hsVectorStream* ram = new hsVectorStream;
plPXStream buf(ram); plPXStream buf(ram);
bool status = NxCookConvexMesh(convexDesc, buf); bool status = NxCookConvexMesh(convexDesc, buf);
hsAssert(status, "Convex mesh failed to cook"); hsAssert(status, "Convex mesh failed to cook");
@ -219,11 +219,11 @@ hsVectorStream* plPhysXCooking::CookHull(int nVerts, hsPoint3* verts, bool infla
NxTriangleMesh* ReadExplicit(hsStream* stream) NxTriangleMesh* ReadExplicit(hsStream* stream)
{ {
const int nVertices = stream->ReadLE32(); const int nVertices = stream->ReadLE32();
hsPoint3* pVertices = TRACKED_NEW hsPoint3[nVertices]; hsPoint3* pVertices = new hsPoint3[nVertices];
stream->ReadLEScalar(nVertices*3, (float*)pVertices); stream->ReadLEScalar(nVertices*3, (float*)pVertices);
const int nFaces = stream->ReadLE32(); const int nFaces = stream->ReadLE32();
unsigned short* pTriangles = TRACKED_NEW unsigned short[nFaces * 3]; unsigned short* pTriangles = new unsigned short[nFaces * 3];
stream->ReadLE16(nFaces * 3, pTriangles); stream->ReadLE16(nFaces * 3, pTriangles);
NxTriangleMeshDesc triDesc; NxTriangleMeshDesc triDesc;
@ -257,7 +257,7 @@ NxTriangleMesh* ReadExplicit(hsStream* stream)
NxConvexMesh* ReadConvexHull(hsStream* stream) NxConvexMesh* ReadConvexHull(hsStream* stream)
{ {
const int nVertices = stream->ReadLE32(); const int nVertices = stream->ReadLE32();
hsPoint3* pVertices = TRACKED_NEW hsPoint3[nVertices]; hsPoint3* pVertices = new hsPoint3[nVertices];
stream->ReadLEScalar(nVertices*3, (float*)pVertices); stream->ReadLEScalar(nVertices*3, (float*)pVertices);
NxConvexMeshDesc convexDesc; NxConvexMeshDesc convexDesc;
@ -287,7 +287,7 @@ NxConvexMesh* ReadConvexHull(hsStream* stream)
void ReadBoxFromHull(hsStream* stream, NxBoxShapeDesc& box) void ReadBoxFromHull(hsStream* stream, NxBoxShapeDesc& box)
{ {
const int nVertices = stream->ReadLE32(); const int nVertices = stream->ReadLE32();
hsPoint3* pVertices = TRACKED_NEW hsPoint3[nVertices]; hsPoint3* pVertices = new hsPoint3[nVertices];
stream->ReadLEScalar(nVertices*3, (float*)pVertices); stream->ReadLEScalar(nVertices*3, (float*)pVertices);
float minX, minY, minZ, maxX, maxY, maxZ; float minX, minY, minZ, maxX, maxY, maxZ;
@ -385,7 +385,7 @@ hsVectorStream* plPhysXCooking::IMakePolytope(const plMaxMeshExtractor::NeutralM
hsPoint3 AABBMin(FLT_MAX,FLT_MAX,FLT_MAX); hsPoint3 AABBMin(FLT_MAX,FLT_MAX,FLT_MAX);
hsPoint3 AABBMax(-FLT_MAX,-FLT_MAX,-FLT_MAX); hsPoint3 AABBMax(-FLT_MAX,-FLT_MAX,-FLT_MAX);
//prep //prep
NxVec3* vectors = TRACKED_NEW NxVec3[26]; NxVec3* vectors = new NxVec3[26];
int curvec=0; int curvec=0;
for(int xcomp= -1;xcomp<2;xcomp++) for(int xcomp= -1;xcomp<2;xcomp++)
@ -503,7 +503,7 @@ hsVectorStream* plPhysXCooking::IMakePolytope(const plMaxMeshExtractor::NeutralM
offset=centroid; offset=centroid;
delete[] vectors; delete[] vectors;
hsPoint3* pointages=TRACKED_NEW hsPoint3[outCloud.size()]; hsPoint3* pointages=new hsPoint3[outCloud.size()];
for(int x=0;x<outCloud.size();x++)pointages[x]=outCloud[x]; for(int x=0;x<outCloud.size();x++)pointages[x]=outCloud[x];
hsVectorStream* vectorstrm; hsVectorStream* vectorstrm;
vectorstrm= CookHull(outCloud.size(),pointages,true); vectorstrm= CookHull(outCloud.size(),pointages,true);

2
Sources/Tools/MaxMain/plPluginResManager.cpp

@ -76,7 +76,7 @@ plKey plPluginResManager::NameToLoc(const char* age, const char* page, int32_t s
if (snKey == nil) if (snKey == nil)
{ {
// Not found, create a new one // Not found, create a new one
plSceneNode *newSceneNode = TRACKED_NEW plSceneNode; plSceneNode *newSceneNode = new plSceneNode;
snKey = NewKey(keyName, newSceneNode, pageNode->GetPageInfo().GetLocation()); snKey = NewKey(keyName, newSceneNode, pageNode->GetPageInfo().GetLocation());
// Call init after it gets a key // Call init after it gets a key

2
Sources/Tools/MaxMain/plPythonMgr.cpp

@ -288,7 +288,7 @@ bool plPythonMgr::IQueryPythonFile(char *fileName)
if (PyCallable_Check(getParamFunc)) if (PyCallable_Check(getParamFunc))
{ {
plAutoUIBlock *autoUI = TRACKED_NEW plAutoUIBlock(PythonFile::GetClassDesc(), blockID, className, version); plAutoUIBlock *autoUI = new plAutoUIBlock(PythonFile::GetClassDesc(), blockID, className, version);
// test to see if it is a multi-modifier type class // test to see if it is a multi-modifier type class
if (isMulti) if (isMulti)
autoUI->SetMultiModifierFlag(true); autoUI->SetMultiModifierFlag(true);

2
Sources/Tools/MaxMain/plSaveSelected.cpp

@ -317,7 +317,7 @@ void plMerge()
size += strlen(nodeNames[i]) + 1; size += strlen(nodeNames[i]) + 1;
// Put all the component names in a list and show it to the user // Put all the component names in a list and show it to the user
char *buf = TRACKED_NEW char[size+25]; char *buf = new char[size+25];
strcpy(buf, "Components Merged:\n\n"); strcpy(buf, "Components Merged:\n\n");
for (i = 0; i < nodeNames.Count(); i++) for (i = 0; i < nodeNames.Count(); i++)

4
Sources/Tools/MaxMain/plTextureExportLog.cpp

@ -93,7 +93,7 @@ plTextureExportLog::~plTextureExportLog()
void plTextureExportLog::IAddBMapNode( uint32_t rank, plBitmap *bMap ) void plTextureExportLog::IAddBMapNode( uint32_t rank, plBitmap *bMap )
{ {
plBMapNode *node = TRACKED_NEW plBMapNode, **nodeHdl; plBMapNode *node = new plBMapNode, **nodeHdl;
node->fBitmap = bMap; node->fBitmap = bMap;
@ -121,7 +121,7 @@ void plTextureExportLog::AddTexture( plBitmap *texture )
void plTextureExportLog::Write( void ) void plTextureExportLog::Write( void )
{ {
plBMapNode *node; plBMapNode *node;
hsUNIXStream *stream = TRACKED_NEW hsUNIXStream; hsUNIXStream *stream = new hsUNIXStream;
char str[ 128 ]; char str[ 128 ];
uint32_t size; uint32_t size;

6
Sources/Tools/MaxPlasmaLights/plRTProjDirLight.cpp

@ -178,12 +178,12 @@ plRTProjDirLight::plRTProjDirLight()
ObjLightDesc *plRTProjDirLight::CreateLightDesc( INode *n, BOOL forceShadowBuf ) ObjLightDesc *plRTProjDirLight::CreateLightDesc( INode *n, BOOL forceShadowBuf )
{ {
return TRACKED_NEW DirLight( n, forceShadowBuf ); return new DirLight( n, forceShadowBuf );
} }
RefTargetHandle plRTProjDirLight::Clone( RemapDir &remap ) RefTargetHandle plRTProjDirLight::Clone( RemapDir &remap )
{ {
plRTProjDirLight *obj = TRACKED_NEW plRTProjDirLight; plRTProjDirLight *obj = new plRTProjDirLight;
obj->ReplaceReference( kRefDirLight, fLightPB->Clone( remap ) ); obj->ReplaceReference( kRefDirLight, fLightPB->Clone( remap ) );
BaseClone( this, obj, remap ); BaseClone( this, obj, remap );
@ -287,7 +287,7 @@ Texmap *plRTProjDirLight::GetProjMap()
plLayerTex *layer = (plLayerTex *)fProjPB->GetTexmap( kTexmap, 0 ); plLayerTex *layer = (plLayerTex *)fProjPB->GetTexmap( kTexmap, 0 );
if( layer == nil || layer->ClassID() != LAYER_TEX_CLASS_ID ) if( layer == nil || layer->ClassID() != LAYER_TEX_CLASS_ID )
{ {
layer = TRACKED_NEW plLayerTex; layer = new plLayerTex;
fProjPB->SetValue( kTexmap, 0, (Texmap *)layer ); fProjPB->SetValue( kTexmap, 0, (Texmap *)layer );
IParamBlock2 *bitmapPB = layer->GetParamBlockByID( plLayerTex::kBlkBitmap ); IParamBlock2 *bitmapPB = layer->GetParamBlockByID( plLayerTex::kBlkBitmap );

2
Sources/Tools/MaxPlasmaLights/plRTProjDirLight.h

@ -122,7 +122,7 @@ class plRTProjDirLight : public plRTLightBase
SClass_ID SuperClassID( void ) { return LIGHT_CLASS_ID; } SClass_ID SuperClassID( void ) { return LIGHT_CLASS_ID; }
ObjLightDesc *CreateLightDesc( INode *n, BOOL forceShadowBuf = FALSE ); ObjLightDesc *CreateLightDesc( INode *n, BOOL forceShadowBuf = FALSE );
GenLight *NewLight( int type ) { return TRACKED_NEW plRTProjDirLight(); } GenLight *NewLight( int type ) { return new plRTProjDirLight(); }
RefTargetHandle Clone( RemapDir &remap ); RefTargetHandle Clone( RemapDir &remap );
int CanConvertToType( Class_ID obtype ) { return ( obtype == RTPDIR_LIGHT_CLASSID ) ? 1 : 0; } int CanConvertToType( Class_ID obtype ) { return ( obtype == RTPDIR_LIGHT_CLASSID ) ? 1 : 0; }

2
Sources/Tools/MaxPlasmaLights/plRTProjDirLightClassDesc.h

@ -62,7 +62,7 @@ class plRTProjDirLightDesc : public ClassDesc2
{ {
public: public:
int IsPublic() { return TRUE; } int IsPublic() { return TRUE; }
void* Create(BOOL loading) { return TRACKED_NEW plRTProjDirLight; } void* Create(BOOL loading) { return new plRTProjDirLight; }
const TCHAR* ClassName() { return GetString(IDS_DB_PROJDIR); } const TCHAR* ClassName() { return GetString(IDS_DB_PROJDIR); }
SClass_ID SuperClassID() { return LIGHT_CLASS_ID; } SClass_ID SuperClassID() { return LIGHT_CLASS_ID; }
Class_ID ClassID() { return RTPDIR_LIGHT_CLASSID; } Class_ID ClassID() { return RTPDIR_LIGHT_CLASSID; }

14
Sources/Tools/MaxPlasmaLights/plRealTimeLightBase.cpp

@ -447,7 +447,7 @@ TSTR plRTLightBase::SubAnimName(int i)
#if 0 #if 0
RefTargetHandle plRTSpotLight::Clone(RemapDir &remap) RefTargetHandle plRTSpotLight::Clone(RemapDir &remap)
{ {
plRTLightBase *obj = TRACKED_NEW plRTSpotLight; plRTLightBase *obj = new plRTSpotLight;
obj->GetParamBlock2->SetValue(kLightOn, t, fLightPB->GetInt(kLightOn, t)); obj->GetParamBlock2->SetValue(kLightOn, t, fLightPB->GetInt(kLightOn, t));
// obj->fLightPB->SetValue(kLightType, t, fLightPB->GetInt(kLightType, t)); // obj->fLightPB->SetValue(kLightType, t, fLightPB->GetInt(kLightType, t));
@ -475,7 +475,7 @@ RefTargetHandle plRTSpotLight::Clone(RemapDir &remap)
} }
obj->ReplaceReference(kRefSpotLight,fLightPB->Clone(remap)); obj->ReplaceReference(kRefSpotLight,fLightPB->Clone(remap));
/* /*
GeneralLight* newob = TRACKED_NEW GeneralLight(type); GeneralLight* newob = new GeneralLight(type);
newob->enable = enable; newob->enable = enable;
newob->coneDisplay = coneDisplay; newob->coneDisplay = coneDisplay;
newob->useLight = useLight; newob->useLight = useLight;
@ -841,7 +841,7 @@ void plRTLightBase::GetLocalBoundBox(TimeValue t, INode *node, ViewExp *vpt, Box
RefTargetHandle Clone(RemapDir &remap = NoRemap()) RefTargetHandle Clone(RemapDir &remap = NoRemap())
{ {
plRTLightBase* newOb = TRACKED_NEW plRTLightBase; plRTLightBase* newOb = new plRTLightBase;
newOb->fLightPB->SetValue(kLightOn, 0, this->fLightPB->GetInt(kLightOn, 0)); newOb->fLightPB->SetValue(kLightOn, 0, this->fLightPB->GetInt(kLightOn, 0));
newOb->fLightPB->SetValue(kLightColor, 0, this->fLightPB->GetValue(kLightColor, 0)); newOb->fLightPB->SetValue(kLightColor, 0, this->fLightPB->GetValue(kLightColor, 0));
newOb->fLightPB->SetValue(kLightExclude, 0, this->fLightPB->GetValue(kLightExclude, 0)); newOb->fLightPB->SetValue(kLightExclude, 0, this->fLightPB->GetValue(kLightExclude, 0));
@ -927,7 +927,7 @@ RefTargetHandle Clone(RemapDir &remap = NoRemap())
kUseProjectorBool, //Inserted in v1 kUseProjectorBool, //Inserted in v1
kProjMapTexButton2, //Inserted in v1 kProjMapTexButton2, //Inserted in v1
kTargetDist //Inserted in v1 kTargetDist //Inserted in v1
GeneralLight* newob = TRACKED_NEW GeneralLight(type); GeneralLight* newob = new GeneralLight(type);
newob->enable = enable; newob->enable = enable;
newob->coneDisplay = coneDisplay; newob->coneDisplay = coneDisplay;
newob->useLight = useLight; newob->useLight = useLight;
@ -1673,9 +1673,9 @@ BOOL plRTLightBase::GetConeDisplay(void)
void plRTLightBase::SetProjMap(BitmapInfo* pmap) void plRTLightBase::SetProjMap(BitmapInfo* pmap)
{ {
//plLayerTex* MyMap = TRACKED_NEW plLayerTex; //plLayerTex* MyMap = new plLayerTex;
if(!fTex) if(!fTex)
fTex = TRACKED_NEW plLayerTex; fTex = new plLayerTex;
fTex->SetBitmap(pmap); fTex->SetBitmap(pmap);
ReplaceReference(kRefProjMap,fTex); ReplaceReference(kRefProjMap,fTex);
@ -1979,7 +1979,7 @@ int TSpotCreationManager::proc(
createInterface->SelectNode( lgtNode ); createInterface->SelectNode( lgtNode );
// Create target object and node // Create target object and node
targObject = TRACKED_NEW TargetObject; targObject = new TargetObject;
assert(targObject); assert(targObject);
targNode = createInterface->CreateObjectNode( targObject); targNode = createInterface->CreateObjectNode( targObject);
assert(targNode); assert(targNode);

2
Sources/Tools/MaxPlasmaLights/plRealTimeLightBase.h

@ -345,7 +345,7 @@ public:
// plug-in mouse creation callback // plug-in mouse creation callback
CreateMouseCallBack* GetCreateMouseCallBack(); CreateMouseCallBack* GetCreateMouseCallBack();
RefTargetHandle Clone(RemapDir &remap = DEFAULTREMAP){ plRTLightBase* thisObj = TRACKED_NEW plRTLightBase(); BaseClone(this, thisObj, remap); return thisObj;} RefTargetHandle Clone(RemapDir &remap = DEFAULTREMAP){ plRTLightBase* thisObj = new plRTLightBase(); BaseClone(this, thisObj, remap); return thisObj;}
virtual void BeginEditParams(IObjParam *ip, ULONG flags, Animatable *prev); virtual void BeginEditParams(IObjParam *ip, ULONG flags, Animatable *prev);
virtual void EndEditParams(IObjParam *ip, ULONG flags, Animatable *next); virtual void EndEditParams(IObjParam *ip, ULONG flags, Animatable *next);

12
Sources/Tools/MaxPlasmaLights/plRealTimeLights.cpp

@ -433,14 +433,14 @@ plRTOmniLight::plRTOmniLight()
ObjLightDesc *plRTOmniLight::CreateLightDesc(INode *n, BOOL forceShadowBuf) ObjLightDesc *plRTOmniLight::CreateLightDesc(INode *n, BOOL forceShadowBuf)
{ {
return TRACKED_NEW OmniLight( n, forceShadowBuf ); return new OmniLight( n, forceShadowBuf );
} }
RefTargetHandle plRTOmniLight::Clone(RemapDir &remap) RefTargetHandle plRTOmniLight::Clone(RemapDir &remap)
{ {
plRTOmniLight *obj = TRACKED_NEW plRTOmniLight;//(plRTLightBase*) fClassDesc->Create(false); plRTOmniLight *obj = new plRTOmniLight;//(plRTLightBase*) fClassDesc->Create(false);
obj->ReplaceReference(kRefSpotLight, fLightPB->Clone(remap)); obj->ReplaceReference(kRefSpotLight, fLightPB->Clone(remap));
BaseClone(this, obj, remap); BaseClone(this, obj, remap);
@ -607,14 +607,14 @@ plRTSpotLight::plRTSpotLight()
ObjLightDesc *plRTSpotLight::CreateLightDesc(INode *n, BOOL forceShadowBuf) ObjLightDesc *plRTSpotLight::CreateLightDesc(INode *n, BOOL forceShadowBuf)
{ {
return TRACKED_NEW SpotLight( n, forceShadowBuf ); return new SpotLight( n, forceShadowBuf );
} }
RefTargetHandle plRTSpotLight::Clone(RemapDir &remap) RefTargetHandle plRTSpotLight::Clone(RemapDir &remap)
{ {
plRTSpotLight *obj = TRACKED_NEW plRTSpotLight;//(plRTLightBase*) fClassDesc->Create(false); plRTSpotLight *obj = new plRTSpotLight;//(plRTLightBase*) fClassDesc->Create(false);
obj->ReplaceReference(kRefSpotLight, fLightPB->Clone(remap)); obj->ReplaceReference(kRefSpotLight, fLightPB->Clone(remap));
BaseClone(this, obj, remap); BaseClone(this, obj, remap);
return obj; return obj;
@ -813,14 +813,14 @@ plRTDirLight::plRTDirLight()
ObjLightDesc *plRTDirLight::CreateLightDesc(INode *n, BOOL forceShadowBuf) ObjLightDesc *plRTDirLight::CreateLightDesc(INode *n, BOOL forceShadowBuf)
{ {
return TRACKED_NEW DirLight( n, forceShadowBuf ); return new DirLight( n, forceShadowBuf );
} }
RefTargetHandle plRTDirLight::Clone(RemapDir &remap) RefTargetHandle plRTDirLight::Clone(RemapDir &remap)
{ {
plRTDirLight *obj = TRACKED_NEW plRTDirLight;//(plRTLightBase*) fClassDesc->Create(false); plRTDirLight *obj = new plRTDirLight;//(plRTLightBase*) fClassDesc->Create(false);
obj->ReplaceReference(kRefDirLight, fLightPB->Clone(remap)); obj->ReplaceReference(kRefDirLight, fLightPB->Clone(remap));
BaseClone(this, obj, remap); BaseClone(this, obj, remap);
return obj; return obj;

12
Sources/Tools/MaxPlasmaLights/plRealTimeLights.h

@ -76,7 +76,7 @@ class plRTOmniLight : public plRTLightBase
plRTOmniLight(); plRTOmniLight();
ObjLightDesc *CreateLightDesc(INode *n, BOOL forceShadowBuf= FALSE); ObjLightDesc *CreateLightDesc(INode *n, BOOL forceShadowBuf= FALSE);
GenLight* NewLight(int type) {return TRACKED_NEW plRTOmniLight();} GenLight* NewLight(int type) {return new plRTOmniLight();}
RefTargetHandle Clone(RemapDir &remap); RefTargetHandle Clone(RemapDir &remap);
virtual void InitNodeName( TSTR &s ) { s = _T( "RTOmniLight" ); } virtual void InitNodeName( TSTR &s ) { s = _T( "RTOmniLight" ); }
@ -95,7 +95,7 @@ class plRTOmniLightDesc : public ClassDesc2
{ {
public: public:
int IsPublic() { return TRUE; } int IsPublic() { return TRUE; }
void* Create(BOOL loading) { return TRACKED_NEW plRTOmniLight; } void* Create(BOOL loading) { return new plRTOmniLight; }
const TCHAR* ClassName() { return GetString(IDS_DB_OMNI); } const TCHAR* ClassName() { return GetString(IDS_DB_OMNI); }
SClass_ID SuperClassID() { return LIGHT_CLASS_ID; } SClass_ID SuperClassID() { return LIGHT_CLASS_ID; }
Class_ID ClassID() { return RTOMNI_LIGHT_CLASSID; } Class_ID ClassID() { return RTOMNI_LIGHT_CLASSID; }
@ -127,7 +127,7 @@ class plRTSpotLight : public plRTLightBase
int CanConvertToType(Class_ID obtype) { return (obtype == RTSPOT_LIGHT_CLASSID ) ? 1 : 0; } int CanConvertToType(Class_ID obtype) { return (obtype == RTSPOT_LIGHT_CLASSID ) ? 1 : 0; }
ObjLightDesc *CreateLightDesc(INode *n, BOOL forceShadowBuf= FALSE); ObjLightDesc *CreateLightDesc(INode *n, BOOL forceShadowBuf= FALSE);
GenLight* NewLight(int type) {return TRACKED_NEW plRTSpotLight();} GenLight* NewLight(int type) {return new plRTSpotLight();}
RefTargetHandle Clone(RemapDir &remap); RefTargetHandle Clone(RemapDir &remap);
virtual Texmap *GetProjMap(); virtual Texmap *GetProjMap();
@ -150,7 +150,7 @@ class plRTSpotLightDesc : public ClassDesc2
{ {
public: public:
int IsPublic() { return TRUE; } int IsPublic() { return TRUE; }
void* Create(BOOL loading = FALSE) { return TRACKED_NEW plRTSpotLight; } void* Create(BOOL loading = FALSE) { return new plRTSpotLight; }
const TCHAR* ClassName() { return GetString(IDS_DB_FREE_SPOT); } const TCHAR* ClassName() { return GetString(IDS_DB_FREE_SPOT); }
SClass_ID SuperClassID() { return LIGHT_CLASS_ID; } SClass_ID SuperClassID() { return LIGHT_CLASS_ID; }
Class_ID ClassID() { return RTSPOT_LIGHT_CLASSID; } Class_ID ClassID() { return RTSPOT_LIGHT_CLASSID; }
@ -179,7 +179,7 @@ class plRTDirLight : public plRTLightBase
SClass_ID SuperClassID() { return LIGHT_CLASS_ID; } SClass_ID SuperClassID() { return LIGHT_CLASS_ID; }
ObjLightDesc *CreateLightDesc(INode *n, BOOL forceShadowBuf= FALSE); ObjLightDesc *CreateLightDesc(INode *n, BOOL forceShadowBuf= FALSE);
GenLight* NewLight(int type) {return TRACKED_NEW plRTDirLight();} GenLight* NewLight(int type) {return new plRTDirLight();}
RefTargetHandle Clone(RemapDir &remap); RefTargetHandle Clone(RemapDir &remap);
int CanConvertToType(Class_ID obtype) { return (obtype == RTDIR_LIGHT_CLASSID ) ? 1 : 0; } int CanConvertToType(Class_ID obtype) { return (obtype == RTDIR_LIGHT_CLASSID ) ? 1 : 0; }
@ -201,7 +201,7 @@ class plRTDirLightDesc : public ClassDesc2
{ {
public: public:
int IsPublic() { return TRUE; } int IsPublic() { return TRUE; }
void* Create(BOOL loading) { return TRACKED_NEW plRTDirLight; } void* Create(BOOL loading) { return new plRTDirLight; }
const TCHAR* ClassName() { return GetString(IDS_DB_DIRECTIONAL); } const TCHAR* ClassName() { return GetString(IDS_DB_DIRECTIONAL); }
SClass_ID SuperClassID() { return LIGHT_CLASS_ID; } SClass_ID SuperClassID() { return LIGHT_CLASS_ID; }
Class_ID ClassID() { return RTDIR_LIGHT_CLASSID; } Class_ID ClassID() { return RTDIR_LIGHT_CLASSID; }

4
Sources/Tools/MaxPlasmaMtls/Layers/plAngleAttenLayer.cpp

@ -53,7 +53,7 @@ class plAngleAttenLayerClassDesc : public ClassDesc2
{ {
public: public:
int IsPublic() { return TRUE; } int IsPublic() { return TRUE; }
void* Create(BOOL loading = FALSE) { return TRACKED_NEW plAngleAttenLayer(); } void* Create(BOOL loading = FALSE) { return new plAngleAttenLayer(); }
const TCHAR* ClassName() { return GetString(IDS_ANGLE_ATTEN_LAYER); } const TCHAR* ClassName() { return GetString(IDS_ANGLE_ATTEN_LAYER); }
SClass_ID SuperClassID() { return TEXMAP_CLASS_ID; } SClass_ID SuperClassID() { return TEXMAP_CLASS_ID; }
Class_ID ClassID() { return ANGLE_ATTEN_LAYER_CLASS_ID; } Class_ID ClassID() { return ANGLE_ATTEN_LAYER_CLASS_ID; }
@ -239,7 +239,7 @@ IParamBlock2* plAngleAttenLayer::GetParamBlockByID(BlockID id)
//From ReferenceTarget //From ReferenceTarget
RefTargetHandle plAngleAttenLayer::Clone(RemapDir &remap) RefTargetHandle plAngleAttenLayer::Clone(RemapDir &remap)
{ {
plAngleAttenLayer *mnew = TRACKED_NEW plAngleAttenLayer(); plAngleAttenLayer *mnew = new plAngleAttenLayer();
*((MtlBase*)mnew) = *((MtlBase*)this); // copy superclass stuff *((MtlBase*)mnew) = *((MtlBase*)this); // copy superclass stuff
mnew->ReplaceReference(kRefAngles, remap.CloneRef(fParmsPB)); mnew->ReplaceReference(kRefAngles, remap.CloneRef(fParmsPB));
BaseClone(this, mnew, remap); BaseClone(this, mnew, remap);

4
Sources/Tools/MaxPlasmaMtls/Layers/plDynamicEnvLayer.cpp

@ -72,7 +72,7 @@ class plDynamicEnvLayerClassDesc : public ClassDesc2
{ {
public: public:
int IsPublic() { return TRUE; } int IsPublic() { return TRUE; }
void* Create(BOOL loading = FALSE) { return TRACKED_NEW plDynamicEnvLayer(); } void* Create(BOOL loading = FALSE) { return new plDynamicEnvLayer(); }
const TCHAR* ClassName() { return GetString(IDS_DYNAMIC_ENVMAP_LAYER); } const TCHAR* ClassName() { return GetString(IDS_DYNAMIC_ENVMAP_LAYER); }
SClass_ID SuperClassID() { return TEXMAP_CLASS_ID; } SClass_ID SuperClassID() { return TEXMAP_CLASS_ID; }
Class_ID ClassID() { return DYNAMIC_ENV_LAYER_CLASS_ID; } Class_ID ClassID() { return DYNAMIC_ENV_LAYER_CLASS_ID; }
@ -226,7 +226,7 @@ IParamBlock2 *plDynamicEnvLayer::GetParamBlockByID( BlockID id )
RefTargetHandle plDynamicEnvLayer::Clone( RemapDir &remap ) RefTargetHandle plDynamicEnvLayer::Clone( RemapDir &remap )
{ {
plDynamicEnvLayer *mnew = TRACKED_NEW plDynamicEnvLayer(); plDynamicEnvLayer *mnew = new plDynamicEnvLayer();
*((MtlBase*)mnew) = *((MtlBase*)this); // copy superclass stuff *((MtlBase*)mnew) = *((MtlBase*)this); // copy superclass stuff
mnew->ReplaceReference(kRefBitmap, remap.CloneRef(fBitmapPB)); mnew->ReplaceReference(kRefBitmap, remap.CloneRef(fBitmapPB));
mnew->ReplaceReference(kRefUVGen, remap.CloneRef(fUVGen)); mnew->ReplaceReference(kRefUVGen, remap.CloneRef(fUVGen));

4
Sources/Tools/MaxPlasmaMtls/Layers/plDynamicTextLayer.cpp

@ -53,7 +53,7 @@ class plDynamicTextLayerClassDesc : public ClassDesc2
{ {
public: public:
int IsPublic() { return TRUE; } int IsPublic() { return TRUE; }
void* Create(BOOL loading = FALSE) { return TRACKED_NEW plDynamicTextLayer(); } void* Create(BOOL loading = FALSE) { return new plDynamicTextLayer(); }
const TCHAR* ClassName() { return GetString(IDS_DYN_TEXT_LAYER); } const TCHAR* ClassName() { return GetString(IDS_DYN_TEXT_LAYER); }
SClass_ID SuperClassID() { return TEXMAP_CLASS_ID; } SClass_ID SuperClassID() { return TEXMAP_CLASS_ID; }
Class_ID ClassID() { return DYN_TEXT_LAYER_CLASS_ID; } Class_ID ClassID() { return DYN_TEXT_LAYER_CLASS_ID; }
@ -216,7 +216,7 @@ IParamBlock2* plDynamicTextLayer::GetParamBlockByID(BlockID id)
//From ReferenceTarget //From ReferenceTarget
RefTargetHandle plDynamicTextLayer::Clone(RemapDir &remap) RefTargetHandle plDynamicTextLayer::Clone(RemapDir &remap)
{ {
plDynamicTextLayer *mnew = TRACKED_NEW plDynamicTextLayer(); plDynamicTextLayer *mnew = new plDynamicTextLayer();
*((MtlBase*)mnew) = *((MtlBase*)this); // copy superclass stuff *((MtlBase*)mnew) = *((MtlBase*)this); // copy superclass stuff
mnew->ReplaceReference(kRefBitmap, remap.CloneRef(fBitmapPB)); mnew->ReplaceReference(kRefBitmap, remap.CloneRef(fBitmapPB));
mnew->ReplaceReference(kRefUVGen, remap.CloneRef(fUVGen)); mnew->ReplaceReference(kRefUVGen, remap.CloneRef(fUVGen));

4
Sources/Tools/MaxPlasmaMtls/Layers/plLayerTex.cpp

@ -55,7 +55,7 @@ class plLayerTexClassDesc : public ClassDesc2
{ {
public: public:
int IsPublic() { return TRUE; } int IsPublic() { return TRUE; }
void* Create(BOOL loading = FALSE) { return TRACKED_NEW plLayerTex(); } void* Create(BOOL loading = FALSE) { return new plLayerTex(); }
const TCHAR* ClassName() { return GetString(IDS_LAYER); } const TCHAR* ClassName() { return GetString(IDS_LAYER); }
SClass_ID SuperClassID() { return TEXMAP_CLASS_ID; } SClass_ID SuperClassID() { return TEXMAP_CLASS_ID; }
Class_ID ClassID() { return LAYER_TEX_CLASS_ID; } Class_ID ClassID() { return LAYER_TEX_CLASS_ID; }
@ -244,7 +244,7 @@ IParamBlock2* plLayerTex::GetParamBlockByID(BlockID id)
//From ReferenceTarget //From ReferenceTarget
RefTargetHandle plLayerTex::Clone(RemapDir &remap) RefTargetHandle plLayerTex::Clone(RemapDir &remap)
{ {
plLayerTex *mnew = TRACKED_NEW plLayerTex(); plLayerTex *mnew = new plLayerTex();
*((MtlBase*)mnew) = *((MtlBase*)this); // copy superclass stuff *((MtlBase*)mnew) = *((MtlBase*)this); // copy superclass stuff
mnew->ReplaceReference(kRefBitmap, remap.CloneRef(fBitmapPB)); mnew->ReplaceReference(kRefBitmap, remap.CloneRef(fBitmapPB));
mnew->ReplaceReference(kRefUVGen, remap.CloneRef(fUVGen)); mnew->ReplaceReference(kRefUVGen, remap.CloneRef(fUVGen));

4
Sources/Tools/MaxPlasmaMtls/Layers/plLayerTexBitmapPB.cpp

@ -135,7 +135,7 @@ public:
GetClientRect( basis, &r ); GetClientRect( basis, &r );
MapWindowPoints( basis, dlg, (POINT *)&r, 2 ); MapWindowPoints( basis, dlg, (POINT *)&r, 2 );
ctrl = TRACKED_NEW plDetailCurveCtrl( dlg, IDC_DETAIL_CURVE_CTRL, &r ); ctrl = new plDetailCurveCtrl( dlg, IDC_DETAIL_CURVE_CTRL, &r );
} }
EnableWindow( GetDlgItem( dlg, IDC_DETAIL_CURVE_CTRL ), (BOOL)pblock->GetInt( kBmpUseDetail, t ) ); EnableWindow( GetDlgItem( dlg, IDC_DETAIL_CURVE_CTRL ), (BOOL)pblock->GetInt( kBmpUseDetail, t ) );
@ -217,7 +217,7 @@ public:
if (!pbbm->bm) if (!pbbm->bm)
pbbm->bm = TheManager->Load(&pbbm->bi); pbbm->bm = TheManager->Load(&pbbm->bi);
BMCropper *cropper = TRACKED_NEW BMCropper(pblock); BMCropper *cropper = new BMCropper(pblock);
pbbm->bm->Display("Specify Cropping/Placement", BMM_CN, FALSE, TRUE, cropper); pbbm->bm->Display("Specify Cropping/Placement", BMM_CN, FALSE, TRUE, cropper);
} }

4
Sources/Tools/MaxPlasmaMtls/Layers/plMAXCameraLayer.cpp

@ -54,7 +54,7 @@ class plMAXCameraLayerClassDesc : public ClassDesc2
{ {
public: public:
int IsPublic() { return TRUE; } int IsPublic() { return TRUE; }
void* Create(BOOL loading = FALSE) { return TRACKED_NEW plMAXCameraLayer(); } void* Create(BOOL loading = FALSE) { return new plMAXCameraLayer(); }
const TCHAR* ClassName() { return GetString(IDS_MAX_CAMERA_LAYER); } const TCHAR* ClassName() { return GetString(IDS_MAX_CAMERA_LAYER); }
SClass_ID SuperClassID() { return TEXMAP_CLASS_ID; } SClass_ID SuperClassID() { return TEXMAP_CLASS_ID; }
Class_ID ClassID() { return MAX_CAMERA_LAYER_CLASS_ID; } Class_ID ClassID() { return MAX_CAMERA_LAYER_CLASS_ID; }
@ -272,7 +272,7 @@ IParamBlock2* plMAXCameraLayer::GetParamBlockByID(BlockID id)
//From ReferenceTarget //From ReferenceTarget
RefTargetHandle plMAXCameraLayer::Clone(RemapDir &remap) RefTargetHandle plMAXCameraLayer::Clone(RemapDir &remap)
{ {
plMAXCameraLayer *mnew = TRACKED_NEW plMAXCameraLayer(); plMAXCameraLayer *mnew = new plMAXCameraLayer();
*((MtlBase*)mnew) = *((MtlBase*)this); // copy superclass stuff *((MtlBase*)mnew) = *((MtlBase*)this); // copy superclass stuff
mnew->ReplaceReference(kRefMain, remap.CloneRef(fParmsPB)); mnew->ReplaceReference(kRefMain, remap.CloneRef(fParmsPB));
BaseClone(this, mnew, remap); BaseClone(this, mnew, remap);

2
Sources/Tools/MaxPlasmaMtls/Layers/plPlasmaMAXLayer.cpp

@ -170,7 +170,7 @@ void plPlasmaMAXLayer::IAddConversionTarget( plLayerInterface *target )
if( fConversionTargets == nil ) if( fConversionTargets == nil )
{ {
// Create us a new container // Create us a new container
fConversionTargets = TRACKED_NEW plLayerTargetContainer; fConversionTargets = new plLayerTargetContainer;
fConversionTargets->GetKey()->RefObject(); fConversionTargets->GetKey()->RefObject();
} }

4
Sources/Tools/MaxPlasmaMtls/Layers/plStaticEnvLayer.cpp

@ -53,7 +53,7 @@ class plStaticEnvLayerClassDesc : public ClassDesc2
{ {
public: public:
int IsPublic() { return TRUE; } int IsPublic() { return TRUE; }
void* Create(BOOL loading = FALSE) { return TRACKED_NEW plStaticEnvLayer(); } void* Create(BOOL loading = FALSE) { return new plStaticEnvLayer(); }
const TCHAR* ClassName() { return GetString(IDS_STATIC_ENVMAP_LAYER); } const TCHAR* ClassName() { return GetString(IDS_STATIC_ENVMAP_LAYER); }
SClass_ID SuperClassID() { return TEXMAP_CLASS_ID; } SClass_ID SuperClassID() { return TEXMAP_CLASS_ID; }
Class_ID ClassID() { return STATIC_ENV_LAYER_CLASS_ID; } Class_ID ClassID() { return STATIC_ENV_LAYER_CLASS_ID; }
@ -223,7 +223,7 @@ IParamBlock2* plStaticEnvLayer::GetParamBlockByID(BlockID id)
//From ReferenceTarget //From ReferenceTarget
RefTargetHandle plStaticEnvLayer::Clone(RemapDir &remap) RefTargetHandle plStaticEnvLayer::Clone(RemapDir &remap)
{ {
plStaticEnvLayer *mnew = TRACKED_NEW plStaticEnvLayer(); plStaticEnvLayer *mnew = new plStaticEnvLayer();
*((MtlBase*)mnew) = *((MtlBase*)this); // copy superclass stuff *((MtlBase*)mnew) = *((MtlBase*)this); // copy superclass stuff
mnew->ReplaceReference(kRefBitmap, remap.CloneRef(fBitmapPB)); mnew->ReplaceReference(kRefBitmap, remap.CloneRef(fBitmapPB));
mnew->ReplaceReference(kRefUVGen, remap.CloneRef(fUVGen)); mnew->ReplaceReference(kRefUVGen, remap.CloneRef(fUVGen));

2
Sources/Tools/MaxPlasmaMtls/Materials/plAnimStealthNode.cpp

@ -69,7 +69,7 @@ class plStealthClassDesc : public ClassDesc2
{ {
public: public:
int IsPublic() { return FALSE; } int IsPublic() { return FALSE; }
void* Create(BOOL loading) { return TRACKED_NEW plAnimStealthNode(loading); } void* Create(BOOL loading) { return new plAnimStealthNode(loading); }
const TCHAR* ClassName() { return GetString( IDS_STEALTH_NAME ); } const TCHAR* ClassName() { return GetString( IDS_STEALTH_NAME ); }
SClass_ID SuperClassID() { return HELPER_CLASS_ID; } SClass_ID SuperClassID() { return HELPER_CLASS_ID; }
Class_ID ClassID() { return ANIMSTEALTH_CLASSID; } Class_ID ClassID() { return ANIMSTEALTH_CLASSID; }

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save