Browse Source

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

Darryl Pogue 13 years ago committed by Adam Johnson
parent
commit
5013a978eb
  1. 72
      Sources/Plasma/Apps/plClient/plClient.cpp
  2. 16
      Sources/Plasma/Apps/plClient/winmain.cpp
  3. 12
      Sources/Plasma/Apps/plClientPatcher/UruPlayer.cpp
  4. 2
      Sources/Plasma/Apps/plPageInfo/plPageInfo.cpp
  5. 4
      Sources/Plasma/Apps/plPageOptimizer/main.cpp
  6. 12
      Sources/Plasma/Apps/plUruLauncher/Main.cpp
  7. 4
      Sources/Plasma/Apps/plUruLauncher/SelfPatcher.cpp
  8. 8
      Sources/Plasma/CoreLib/hsBiExpander.h
  9. 6
      Sources/Plasma/CoreLib/hsBitVector.cpp
  10. 6
      Sources/Plasma/CoreLib/hsBitVector.h
  11. 6
      Sources/Plasma/CoreLib/hsBounds.cpp
  12. 2
      Sources/Plasma/CoreLib/hsExceptionStack.h
  13. 2
      Sources/Plasma/CoreLib/hsHashTable.h
  14. 3
      Sources/Plasma/CoreLib/hsMalloc.h
  15. 10
      Sources/Plasma/CoreLib/hsMemory.cpp
  16. 2
      Sources/Plasma/CoreLib/hsMemory.h
  17. 4
      Sources/Plasma/CoreLib/hsStlUtils.cpp
  18. 14
      Sources/Plasma/CoreLib/hsStream.cpp
  19. 4
      Sources/Plasma/CoreLib/hsTemplates.cpp
  20. 46
      Sources/Plasma/CoreLib/hsTemplates.h
  21. 4
      Sources/Plasma/CoreLib/hsUtils.cpp
  22. 12
      Sources/Plasma/FeatureLib/pfAnimation/pfObjectFlocker.cpp
  23. 2
      Sources/Plasma/FeatureLib/pfAnimation/pfObjectFlocker.h
  24. 2
      Sources/Plasma/FeatureLib/pfAnimation/plFollowMod.cpp
  25. 10
      Sources/Plasma/FeatureLib/pfAnimation/plLineFollowMod.cpp
  26. 2
      Sources/Plasma/FeatureLib/pfAnimation/plRandomCommandMod.cpp
  27. 4
      Sources/Plasma/FeatureLib/pfAnimation/plViewFaceModifier.cpp
  28. 8
      Sources/Plasma/FeatureLib/pfAudio/plListener.cpp
  29. 18
      Sources/Plasma/FeatureLib/pfAudio/plRandomSoundMod.cpp
  30. 24
      Sources/Plasma/FeatureLib/pfCamera/plCameraBrain.cpp
  31. 12
      Sources/Plasma/FeatureLib/pfCamera/plCameraModifier.cpp
  32. 2
      Sources/Plasma/FeatureLib/pfCamera/plInterestingModifier.cpp
  33. 50
      Sources/Plasma/FeatureLib/pfCamera/plVirtualCamNeu.cpp
  34. 16
      Sources/Plasma/FeatureLib/pfCharacter/pfMarkerInfo.cpp
  35. 6
      Sources/Plasma/FeatureLib/pfCharacter/pfMarkerMgr.cpp
  36. 26
      Sources/Plasma/FeatureLib/pfCharacter/plPlayerModifier.cpp
  37. 2
      Sources/Plasma/FeatureLib/pfConditional/plANDConditionalObject.cpp
  38. 4
      Sources/Plasma/FeatureLib/pfConditional/plAnimationEventConditionalObject.cpp
  39. 2
      Sources/Plasma/FeatureLib/pfConditional/plORConditionalObject.cpp
  40. 32
      Sources/Plasma/FeatureLib/pfConsole/pfAvatarConsoleCommands.cpp
  41. 8
      Sources/Plasma/FeatureLib/pfConsole/pfConsole.cpp
  42. 200
      Sources/Plasma/FeatureLib/pfConsole/pfConsoleCommands.cpp
  43. 2
      Sources/Plasma/FeatureLib/pfConsole/pfConsoleCommandsNet.cpp
  44. 2
      Sources/Plasma/FeatureLib/pfConsole/pfConsoleDirSrc.cpp
  45. 52
      Sources/Plasma/FeatureLib/pfConsole/pfGameConsoleCommands.cpp
  46. 4
      Sources/Plasma/FeatureLib/pfConsoleCore/pfConsoleCmd.cpp
  47. 14
      Sources/Plasma/FeatureLib/pfGameGUIMgr/pfGUIButtonMod.cpp
  48. 4
      Sources/Plasma/FeatureLib/pfGameGUIMgr/pfGUICheckBoxCtrl.cpp
  49. 12
      Sources/Plasma/FeatureLib/pfGameGUIMgr/pfGUIControlHandlers.cpp
  50. 22
      Sources/Plasma/FeatureLib/pfGameGUIMgr/pfGUIControlMod.cpp
  51. 66
      Sources/Plasma/FeatureLib/pfGameGUIMgr/pfGUICtrlGenerator.cpp
  52. 20
      Sources/Plasma/FeatureLib/pfGameGUIMgr/pfGUIDialogMod.cpp
  53. 2
      Sources/Plasma/FeatureLib/pfGameGUIMgr/pfGUIDialogNotifyProc.cpp
  54. 12
      Sources/Plasma/FeatureLib/pfGameGUIMgr/pfGUIDynDisplayCtrl.cpp
  55. 2
      Sources/Plasma/FeatureLib/pfGameGUIMgr/pfGUIEditBoxMod.cpp
  56. 4
      Sources/Plasma/FeatureLib/pfGameGUIMgr/pfGUIKnobCtrl.cpp
  57. 8
      Sources/Plasma/FeatureLib/pfGameGUIMgr/pfGUIListBoxMod.cpp
  58. 8
      Sources/Plasma/FeatureLib/pfGameGUIMgr/pfGUIListElement.cpp
  59. 4
      Sources/Plasma/FeatureLib/pfGameGUIMgr/pfGUIMenuItem.cpp
  60. 12
      Sources/Plasma/FeatureLib/pfGameGUIMgr/pfGUIMultiLineEditCtrl.cpp
  61. 58
      Sources/Plasma/FeatureLib/pfGameGUIMgr/pfGUIPopUpMenu.cpp
  62. 8
      Sources/Plasma/FeatureLib/pfGameGUIMgr/pfGUIProgressCtrl.cpp
  63. 4
      Sources/Plasma/FeatureLib/pfGameGUIMgr/pfGUIRadioGroupCtrl.cpp
  64. 4
      Sources/Plasma/FeatureLib/pfGameGUIMgr/pfGUITextBoxMod.cpp
  65. 6
      Sources/Plasma/FeatureLib/pfGameGUIMgr/pfGUIUpDownPairMod.cpp
  66. 18
      Sources/Plasma/FeatureLib/pfGameGUIMgr/pfGameGUIMgr.cpp
  67. 4
      Sources/Plasma/FeatureLib/pfGameMgr/pfGameMgr.cpp
  68. 10
      Sources/Plasma/FeatureLib/pfGameScoreMgr/pfGameScoreMgr.cpp
  69. 102
      Sources/Plasma/FeatureLib/pfJournalBook/pfJournalBook.cpp
  70. 6
      Sources/Plasma/FeatureLib/pfLocalizationMgr/pfLocalizationDataMgr.cpp
  71. 2
      Sources/Plasma/FeatureLib/pfLocalizationMgr/pfLocalizationMgr.cpp
  72. 2
      Sources/Plasma/FeatureLib/pfPython/Games/BlueSpiral/pyBlueSpiralGameGlue.cpp
  73. 2
      Sources/Plasma/FeatureLib/pfPython/Games/ClimbingWall/pyClimbingWallGameGlue.cpp
  74. 4
      Sources/Plasma/FeatureLib/pfPython/Games/Heek/pyHeekGameGlue.cpp
  75. 14
      Sources/Plasma/FeatureLib/pfPython/Games/Marker/pyMarkerGameGlue.cpp
  76. 2
      Sources/Plasma/FeatureLib/pfPython/Games/TicTacToe/pyTTTGameGlue.cpp
  77. 10
      Sources/Plasma/FeatureLib/pfPython/Games/VarSync/pyVarSyncGameGlue.cpp
  78. 2
      Sources/Plasma/FeatureLib/pfPython/Games/pyGameCliGlue.cpp
  79. 6
      Sources/Plasma/FeatureLib/pfPython/cyAccountManagementGlue.cpp
  80. 24
      Sources/Plasma/FeatureLib/pfPython/cyAnimation.cpp
  81. 24
      Sources/Plasma/FeatureLib/pfPython/cyAvatar.cpp
  82. 12
      Sources/Plasma/FeatureLib/pfPython/cyCamera.cpp
  83. 2
      Sources/Plasma/FeatureLib/pfPython/cyDraw.cpp
  84. 6
      Sources/Plasma/FeatureLib/pfPython/cyInputInterface.cpp
  85. 118
      Sources/Plasma/FeatureLib/pfPython/cyMisc.cpp
  86. 12
      Sources/Plasma/FeatureLib/pfPython/cyMiscGlue.cpp
  87. 2
      Sources/Plasma/FeatureLib/pfPython/cyMiscGlue2.cpp
  88. 4
      Sources/Plasma/FeatureLib/pfPython/cyMiscGlue3.cpp
  89. 4
      Sources/Plasma/FeatureLib/pfPython/cyMiscGlue4.cpp
  90. 2
      Sources/Plasma/FeatureLib/pfPython/cyParticleSys.cpp
  91. 32
      Sources/Plasma/FeatureLib/pfPython/cyPhysics.cpp
  92. 8
      Sources/Plasma/FeatureLib/pfPython/cyPythonInterface.cpp
  93. 14
      Sources/Plasma/FeatureLib/pfPython/plPythonFileMod.cpp
  94. 2
      Sources/Plasma/FeatureLib/pfPython/plPythonPack.cpp
  95. 2
      Sources/Plasma/FeatureLib/pfPython/plPythonParameter.h
  96. 2
      Sources/Plasma/FeatureLib/pfPython/pyAlarm.cpp
  97. 8
      Sources/Plasma/FeatureLib/pfPython/pyCritterBrainGlue.cpp
  98. 4
      Sources/Plasma/FeatureLib/pfPython/pyDniCoordinates.cpp
  99. 6
      Sources/Plasma/FeatureLib/pfPython/pyDrawControl.cpp
  100. 2
      Sources/Plasma/FeatureLib/pfPython/pyDynamicText.cpp
  101. Some files were not shown because too many files have changed in this diff Show More

72
Sources/Plasma/Apps/plClient/plClient.cpp

@ -222,11 +222,11 @@ plClient::plClient()
/// allow console commands to start working early /// allow console commands to start working early
// Create the console engine // Create the console engine
fConsoleEngine = TRACKED_NEW pfConsoleEngine(); fConsoleEngine = new pfConsoleEngine();
// create network mgr before console runs // create network mgr before console runs
plNetClientMgr::SetInstance(TRACKED_NEW plNetClientMgr); plNetClientMgr::SetInstance(new plNetClientMgr);
plAgeLoader::SetInstance(TRACKED_NEW plAgeLoader); plAgeLoader::SetInstance(new plAgeLoader);
// Use it to parse the init directory // Use it to parse the init directory
wchar_t initFolder[MAX_PATH]; wchar_t initFolder[MAX_PATH];
@ -274,7 +274,7 @@ hsBool plClient::Shutdown()
plBinkPlayer::DeInit(); plBinkPlayer::DeInit();
// //
// Get any proxies to commit suicide. // Get any proxies to commit suicide.
plProxyDrawMsg* nuke = TRACKED_NEW plProxyDrawMsg(plProxyDrawMsg::kAllTypes plProxyDrawMsg* nuke = new plProxyDrawMsg(plProxyDrawMsg::kAllTypes
| plProxyDrawMsg::kDestroy); | plProxyDrawMsg::kDestroy);
plgDispatch::MsgSend(nuke); plgDispatch::MsgSend(nuke);
@ -447,17 +447,17 @@ void plClient::InitAuxInits()
void plClient::InitInputs() void plClient::InitInputs()
{ {
hsStatusMessage("InitInputs client\n"); hsStatusMessage("InitInputs client\n");
fInputManager = TRACKED_NEW plInputManager( fWindowHndl ); fInputManager = new plInputManager( fWindowHndl );
fInputManager->CreateInterfaceMod(fPipeline); fInputManager->CreateInterfaceMod(fPipeline);
fInputManager->RegisterAs( kInput_KEY ); fInputManager->RegisterAs( kInput_KEY );
plgDispatch::Dispatch()->RegisterForExactType(plIMouseXEventMsg::Index(), fInputManager->GetKey()); plgDispatch::Dispatch()->RegisterForExactType(plIMouseXEventMsg::Index(), fInputManager->GetKey());
plgDispatch::Dispatch()->RegisterForExactType(plIMouseYEventMsg::Index(), fInputManager->GetKey()); plgDispatch::Dispatch()->RegisterForExactType(plIMouseYEventMsg::Index(), fInputManager->GetKey());
plgDispatch::Dispatch()->RegisterForExactType(plIMouseBEventMsg::Index(), fInputManager->GetKey()); plgDispatch::Dispatch()->RegisterForExactType(plIMouseBEventMsg::Index(), fInputManager->GetKey());
plgDispatch::Dispatch()->RegisterForExactType(plEvalMsg::Index(), fInputManager->GetKey()); plgDispatch::Dispatch()->RegisterForExactType(plEvalMsg::Index(), fInputManager->GetKey());
plInputDevice* pKeyboard = TRACKED_NEW plKeyboardDevice(); plInputDevice* pKeyboard = new plKeyboardDevice();
fInputManager->AddInputDevice(pKeyboard); fInputManager->AddInputDevice(pKeyboard);
plInputDevice* pMouse = TRACKED_NEW plMouseDevice(); plInputDevice* pMouse = new plMouseDevice();
fInputManager->AddInputDevice(pMouse); fInputManager->AddInputDevice(pMouse);
if( fWindowActive ) if( fWindowActive )
@ -792,7 +792,7 @@ hsBool plClient::MsgReceive(plMessage* msg)
plAudible* aud = plAudible::ConvertNoRef(callback->GetSender()->ObjectIsLoaded()); plAudible* aud = plAudible::ConvertNoRef(callback->GetSender()->ObjectIsLoaded());
if( simpMod ) if( simpMod )
{ {
plAnimCmdMsg* cmd = TRACKED_NEW plAnimCmdMsg; plAnimCmdMsg* cmd = new plAnimCmdMsg;
cmd->AddReceiver(simpMod->GetKey()); cmd->AddReceiver(simpMod->GetKey());
cmd->SetCmd(plAnimCmdMsg::kRemoveCallbacks); cmd->SetCmd(plAnimCmdMsg::kRemoveCallbacks);
cmd->AddCallback(callback); cmd->AddCallback(callback);
@ -801,7 +801,7 @@ hsBool plClient::MsgReceive(plMessage* msg)
} }
else if( aud ) else if( aud )
{ {
plSoundMsg* cmd = TRACKED_NEW plSoundMsg; plSoundMsg* cmd = new plSoundMsg;
cmd->AddReceiver(aud->GetKey()); cmd->AddReceiver(aud->GetKey());
cmd->SetCmd(plSoundMsg::kRemoveCallbacks); cmd->SetCmd(plSoundMsg::kRemoveCallbacks);
cmd->AddCallback(callback); cmd->AddCallback(callback);
@ -891,7 +891,7 @@ hsBool plClient::IHandleMovieMsg(plMovieMsg* mov)
if( i == fMovies.GetCount() ) if( i == fMovies.GetCount() )
{ {
fMovies.Append(TRACKED_NEW plBinkPlayer); fMovies.Append(new plBinkPlayer);
fMovies[i]->SetFileName(mov->GetFileName()); fMovies[i]->SetFileName(mov->GetFileName());
} }
@ -1010,7 +1010,7 @@ void plClient::IQueueRoomLoad(const std::vector<plLocation>& locs, bool hold)
continue; continue;
} }
fLoadRooms.push_back(TRACKED_NEW LoadRequest(loc, hold)); fLoadRooms.push_back(new LoadRequest(loc, hold));
if (!lastAgeName || hsStrEQ(info->GetAge(), lastAgeName)) if (!lastAgeName || hsStrEQ(info->GetAge(), lastAgeName))
lastAgeName = info->GetAge(); lastAgeName = info->GetAge();
@ -1050,7 +1050,7 @@ void plClient::ILoadNextRoom()
if (req) if (req)
{ {
plClientRefMsg* pRefMsg = TRACKED_NEW plClientRefMsg(GetKey(), plClientRefMsg* pRefMsg = new plClientRefMsg(GetKey(),
plRefMsg::kOnCreate, -1, plRefMsg::kOnCreate, -1,
req->hold ? plClientRefMsg::kLoadRoomHold : plClientRefMsg::kLoadRoom); req->hold ? plClientRefMsg::kLoadRoomHold : plClientRefMsg::kLoadRoom);
@ -1062,7 +1062,7 @@ void plClient::ILoadNextRoom()
delete req; delete req;
plClientMsg* nextRoom = TRACKED_NEW plClientMsg(plClientMsg::kLoadNextRoom); plClientMsg* nextRoom = new plClientMsg(plClientMsg::kLoadNextRoom);
nextRoom->Send(GetKey()); nextRoom->Send(GetKey());
} }
} }
@ -1236,7 +1236,7 @@ void plClient::IRoomLoaded(plSceneNode* node, bool hold)
// now tell all those who are interested that a room was loaded // now tell all those who are interested that a room was loaded
if (!hold) if (!hold)
{ {
plRoomLoadNotifyMsg* loadmsg = TRACKED_NEW plRoomLoadNotifyMsg; plRoomLoadNotifyMsg* loadmsg = new plRoomLoadNotifyMsg;
loadmsg->SetRoom(pRmKey); loadmsg->SetRoom(pRmKey);
loadmsg->SetWhatHappen(plRoomLoadNotifyMsg::kLoaded); loadmsg->SetWhatHappen(plRoomLoadNotifyMsg::kLoaded);
plgDispatch::MsgSend(loadmsg); plgDispatch::MsgSend(loadmsg);
@ -1272,7 +1272,7 @@ void plClient::IRoomUnloaded(plSceneNode* node)
plAgeLoader::GetInstance()->FinishedPagingOutRoom(&pRmKey, 1); plAgeLoader::GetInstance()->FinishedPagingOutRoom(&pRmKey, 1);
// tell all those who are interested that a room was unloaded // tell all those who are interested that a room was unloaded
plRoomLoadNotifyMsg* loadmsg = TRACKED_NEW plRoomLoadNotifyMsg; plRoomLoadNotifyMsg* loadmsg = new plRoomLoadNotifyMsg;
loadmsg->SetRoom(pRmKey); loadmsg->SetRoom(pRmKey);
loadmsg->SetWhatHappen(plRoomLoadNotifyMsg::kUnloaded); loadmsg->SetWhatHappen(plRoomLoadNotifyMsg::kUnloaded);
plgDispatch::MsgSend(loadmsg); plgDispatch::MsgSend(loadmsg);
@ -1472,7 +1472,7 @@ hsBool plClient::StartInit()
InitDLLs(); InitDLLs();
plGlobalVisMgr::Init(); plGlobalVisMgr::Init();
fPageMgr = TRACKED_NEW plPageTreeMgr; fPageMgr = new plPageTreeMgr;
plVisLOSMgr::Init(fPipeline, fPageMgr); plVisLOSMgr::Init(fPipeline, fPageMgr);
@ -1492,26 +1492,26 @@ hsBool plClient::StartInit()
/// Note: this can be done last because the console engine was inited first, and /// Note: this can be done last because the console engine was inited first, and
/// everything in code that works with the console does so through the console engine /// everything in code that works with the console does so through the console engine
fConsole = TRACKED_NEW pfConsole(); fConsole = new pfConsole();
pfConsole::SetPipeline( fPipeline ); pfConsole::SetPipeline( fPipeline );
fConsole->RegisterAs( kConsoleObject_KEY ); // fixedKey from plFixedKey.h fConsole->RegisterAs( kConsoleObject_KEY ); // fixedKey from plFixedKey.h
fConsole->Init( fConsoleEngine ); fConsole->Init( fConsoleEngine );
/// Init the font cache /// Init the font cache
fFontCache = TRACKED_NEW plFontCache(); fFontCache = new plFontCache();
/// Init the transition manager /// Init the transition manager
fTransitionMgr = TRACKED_NEW plTransitionMgr(); fTransitionMgr = new plTransitionMgr();
fTransitionMgr->RegisterAs( kTransitionMgr_KEY ); // fixedKey from plFixedKey.h fTransitionMgr->RegisterAs( kTransitionMgr_KEY ); // fixedKey from plFixedKey.h
fTransitionMgr->Init(); fTransitionMgr->Init();
// Init the Age Linking effects manager // Init the Age Linking effects manager
fLinkEffectsMgr = TRACKED_NEW plLinkEffectsMgr(); fLinkEffectsMgr = new plLinkEffectsMgr();
fLinkEffectsMgr->RegisterAs( kLinkEffectsMgr_KEY ); // fixedKey from plFixedKey.h fLinkEffectsMgr->RegisterAs( kLinkEffectsMgr_KEY ); // fixedKey from plFixedKey.h
fLinkEffectsMgr->Init(); fLinkEffectsMgr->Init();
/// Init the in-game GUI manager /// Init the in-game GUI manager
fGameGUIMgr = TRACKED_NEW pfGameGUIMgr(); fGameGUIMgr = new pfGameGUIMgr();
fGameGUIMgr->RegisterAs( kGameGUIMgr_KEY ); fGameGUIMgr->RegisterAs( kGameGUIMgr_KEY );
fGameGUIMgr->Init(); fGameGUIMgr->Init();
@ -1533,14 +1533,14 @@ hsBool plClient::StartInit()
plAgeLoader::GetInstance()->Init(); plAgeLoader::GetInstance()->Init();
pfSecurePreloader::GetInstance()->Init(); pfSecurePreloader::GetInstance()->Init();
plCmdIfaceModMsg* pModMsg2 = TRACKED_NEW plCmdIfaceModMsg; plCmdIfaceModMsg* pModMsg2 = new plCmdIfaceModMsg;
pModMsg2->SetBCastFlag(plMessage::kBCastByExactType); pModMsg2->SetBCastFlag(plMessage::kBCastByExactType);
pModMsg2->SetSender(fConsole->GetKey()); pModMsg2->SetSender(fConsole->GetKey());
pModMsg2->SetCmd(plCmdIfaceModMsg::kAdd); pModMsg2->SetCmd(plCmdIfaceModMsg::kAdd);
plgDispatch::MsgSend(pModMsg2); plgDispatch::MsgSend(pModMsg2);
// create new the virtual camera // create new the virtual camera
fNewCamera = TRACKED_NEW plVirtualCam1; fNewCamera = new plVirtualCam1;
fNewCamera->RegisterAs( kVirtualCamera1_KEY ); fNewCamera->RegisterAs( kVirtualCamera1_KEY );
fNewCamera->Init(); fNewCamera->Init();
fNewCamera->SetPipeline( GetPipeline() ); fNewCamera->SetPipeline( GetPipeline() );
@ -1554,7 +1554,7 @@ hsBool plClient::StartInit()
plInputManager::SetRecenterMouse(false); plInputManager::SetRecenterMouse(false);
// create the listener for the audio system: // create the listener for the audio system:
plListener* pLMod = TRACKED_NEW plListener; plListener* pLMod = new plListener;
pLMod->RegisterAs(kListenerMod_KEY ); pLMod->RegisterAs(kListenerMod_KEY );
plgDispatch::Dispatch()->RegisterForExactType(plEvalMsg::Index(), pLMod->GetKey()); plgDispatch::Dispatch()->RegisterForExactType(plEvalMsg::Index(), pLMod->GetKey());
@ -1564,7 +1564,7 @@ hsBool plClient::StartInit()
if (StrCmp(NetCommGetStartupAge()->ageDatasetName, "StartUp") == 0) if (StrCmp(NetCommGetStartupAge()->ageDatasetName, "StartUp") == 0)
{ {
plNetCommAuthMsg * msg = NEW(plNetCommAuthMsg); plNetCommAuthMsg * msg = new plNetCommAuthMsg();
msg->result = kNetSuccess; msg->result = kNetSuccess;
msg->param = nil; msg->param = nil;
msg->Send(); msg->Send();
@ -1748,18 +1748,18 @@ hsBool plClient::IUpdate()
// starting trouble during their update. So to get rid of this message, some // starting trouble during their update. So to get rid of this message, some
// other way of flushing the dispatch after NegClientMgr's update is needed. mf // other way of flushing the dispatch after NegClientMgr's update is needed. mf
plProfile_BeginTiming(TimeMsg); plProfile_BeginTiming(TimeMsg);
plTimeMsg* msg = TRACKED_NEW plTimeMsg(nil, nil, nil, nil); plTimeMsg* msg = new plTimeMsg(nil, nil, nil, nil);
plgDispatch::MsgSend(msg); plgDispatch::MsgSend(msg);
plProfile_EndTiming(TimeMsg); plProfile_EndTiming(TimeMsg);
plProfile_BeginTiming(EvalMsg); plProfile_BeginTiming(EvalMsg);
plEvalMsg* eval = TRACKED_NEW plEvalMsg(nil, nil, nil, nil); plEvalMsg* eval = new plEvalMsg(nil, nil, nil, nil);
plgDispatch::MsgSend(eval); plgDispatch::MsgSend(eval);
plProfile_EndTiming(EvalMsg); plProfile_EndTiming(EvalMsg);
char *xFormLap1 = "Main"; char *xFormLap1 = "Main";
plProfile_BeginLap(TransformMsg, xFormLap1); plProfile_BeginLap(TransformMsg, xFormLap1);
plTransformMsg* xform = TRACKED_NEW plTransformMsg(nil, nil, nil, nil); plTransformMsg* xform = new plTransformMsg(nil, nil, nil, nil);
plgDispatch::MsgSend(xform); plgDispatch::MsgSend(xform);
plProfile_EndLap(TransformMsg, xFormLap1); plProfile_EndLap(TransformMsg, xFormLap1);
@ -1777,7 +1777,7 @@ hsBool plClient::IUpdate()
{ {
char *xFormLap2 = "Simulation"; char *xFormLap2 = "Simulation";
plProfile_BeginLap(TransformMsg, xFormLap2); plProfile_BeginLap(TransformMsg, xFormLap2);
xform = TRACKED_NEW plTransformMsg(nil, nil, nil, nil); xform = new plTransformMsg(nil, nil, nil, nil);
plgDispatch::MsgSend(xform); plgDispatch::MsgSend(xform);
plProfile_EndLap(TransformMsg, xFormLap2); plProfile_EndLap(TransformMsg, xFormLap2);
} }
@ -1785,7 +1785,7 @@ hsBool plClient::IUpdate()
{ {
char *xFormLap3 = "Delayed"; char *xFormLap3 = "Delayed";
plProfile_BeginLap(TransformMsg, xFormLap3); plProfile_BeginLap(TransformMsg, xFormLap3);
xform = TRACKED_NEW plDelayedTransformMsg(nil, nil, nil, nil); xform = new plDelayedTransformMsg(nil, nil, nil, nil);
plgDispatch::MsgSend(xform); plgDispatch::MsgSend(xform);
plProfile_EndLap(TransformMsg, xFormLap3); plProfile_EndLap(TransformMsg, xFormLap3);
} }
@ -1793,7 +1793,7 @@ hsBool plClient::IUpdate()
plCoordinateInterface::SetTransformPhase(plCoordinateInterface::kTransformPhaseNormal); plCoordinateInterface::SetTransformPhase(plCoordinateInterface::kTransformPhaseNormal);
plProfile_BeginTiming(CameraMsg); plProfile_BeginTiming(CameraMsg);
plCameraMsg* cameras = TRACKED_NEW plCameraMsg; plCameraMsg* cameras = new plCameraMsg;
cameras->SetCmd(plCameraMsg::kUpdateCameras); cameras->SetCmd(plCameraMsg::kUpdateCameras);
cameras->SetBCastFlag(plMessage::kBCastByExactType); cameras->SetBCastFlag(plMessage::kBCastByExactType);
plgDispatch::MsgSend(cameras); plgDispatch::MsgSend(cameras);
@ -1866,11 +1866,11 @@ hsBool plClient::IDraw()
plProfile_EndTiming(VisEval); plProfile_EndTiming(VisEval);
plProfile_BeginTiming(RenderMsg); plProfile_BeginTiming(RenderMsg);
plRenderMsg* rendMsg = TRACKED_NEW plRenderMsg(fPipeline); plRenderMsg* rendMsg = new plRenderMsg(fPipeline);
plgDispatch::MsgSend(rendMsg); plgDispatch::MsgSend(rendMsg);
plProfile_EndTiming(RenderMsg); plProfile_EndTiming(RenderMsg);
plPreResourceMsg* preMsg = TRACKED_NEW plPreResourceMsg(fPipeline); plPreResourceMsg* preMsg = new plPreResourceMsg(fPipeline);
plgDispatch::MsgSend(preMsg); plgDispatch::MsgSend(preMsg);
// This might not be the ideal place for this, but it // This might not be the ideal place for this, but it
@ -2444,7 +2444,7 @@ void plClient::IOnAsyncInitComplete () {
pfMarkerMgr::Instance(); pfMarkerMgr::Instance();
fAnimDebugList = TRACKED_NEW plAnimDebugList(); fAnimDebugList = new plAnimDebugList();
/// Now parse final init files (*.fni). These are files just like ini files, only to be run /// Now parse final init files (*.fni). These are files just like ini files, only to be run
/// after all hell has broken loose in the client. /// after all hell has broken loose in the client.
@ -2476,7 +2476,7 @@ void plClient::IOnAsyncInitComplete () {
// Tell the transition manager to start faded out. This is so we don't // Tell the transition manager to start faded out. This is so we don't
// get a frame or two of non-faded drawing before we do our initial fade in // get a frame or two of non-faded drawing before we do our initial fade in
(void)(TRACKED_NEW plTransitionMsg( plTransitionMsg::kFadeOut, 0.0f, true ))->Send(); (void)(new plTransitionMsg( plTransitionMsg::kFadeOut, 0.0f, true ))->Send();
fFlags.SetBit(kFlagAsyncInitComplete); fFlags.SetBit(kFlagAsyncInitComplete);
if (fFlags.IsBitSet(kFlagGlobalDataLoaded)) if (fFlags.IsBitSet(kFlagGlobalDataLoaded))
@ -2494,7 +2494,7 @@ void plClient::ICompleteInit () {
hsStatusMessage("Client init complete."); hsStatusMessage("Client init complete.");
// Tell everyone we're ready to rock. // Tell everyone we're ready to rock.
plClientMsg* clientMsg = TRACKED_NEW plClientMsg(plClientMsg::kInitComplete); plClientMsg* clientMsg = new plClientMsg(plClientMsg::kInitComplete);
clientMsg->SetBCastFlag(plMessage::kBCastByType); clientMsg->SetBCastFlag(plMessage::kBCastByType);
clientMsg->Send(); clientMsg->Send();

16
Sources/Plasma/Apps/plClient/winmain.cpp

@ -302,7 +302,7 @@ static bool TGRunLoginDialog (LoginDialogParam *pLoginParam)
if (pWStr) if (pWStr)
Len += StrLen (pWStr) + 2; Len += StrLen (pWStr) + 2;
pTmpStr = TRACKED_NEW char[Len]; pTmpStr = new char[Len];
StrCopy (pTmpStr, pStr1, StrLen (pStr1)); StrCopy (pTmpStr, pStr1, StrLen (pStr1));
if (pStr2) if (pStr2)
{ {
@ -661,8 +661,8 @@ bool InitPhysX()
// launch the PhysX installer // launch the PhysX installer
STARTUPINFOW startupInfo; STARTUPINFOW startupInfo;
PROCESS_INFORMATION processInfo; PROCESS_INFORMATION processInfo;
ZERO(startupInfo); memset(&startupInfo, 0, sizeof(startupInfo));
ZERO(processInfo); memset(&processInfo, 0, sizeof(processInfo));
startupInfo.cb = sizeof(startupInfo); startupInfo.cb = sizeof(startupInfo);
if(!CreateProcessW(NULL, s_physXSetupExeName, NULL, NULL, FALSE, 0, NULL, NULL, &startupInfo, &processInfo)) if(!CreateProcessW(NULL, s_physXSetupExeName, NULL, NULL, FALSE, 0, NULL, NULL, &startupInfo, &processInfo))
{ {
@ -702,7 +702,7 @@ bool InitPhysX()
bool InitClient( HWND hWnd ) bool InitClient( HWND hWnd )
{ {
plResManager *resMgr = TRACKED_NEW plResManager; plResManager *resMgr = new plResManager;
resMgr->SetDataPath("dat"); resMgr->SetDataPath("dat");
hsgResMgr::Init(resMgr); hsgResMgr::Init(resMgr);
@ -713,7 +713,7 @@ bool InitClient( HWND hWnd )
} }
plClientResMgr::Instance().ILoadResources("resource.dat"); plClientResMgr::Instance().ILoadResources("resource.dat");
gClient = TRACKED_NEW plClient; gClient = new plClient;
if( gClient == nil ) if( gClient == nil )
return false; return false;
@ -939,7 +939,7 @@ BOOL CALLBACK UruTOSDialogProc( HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM l
char* eulaData = NULL; char* eulaData = NULL;
unsigned dataLen = stream.GetSizeLeft(); unsigned dataLen = stream.GetSizeLeft();
eulaData = TRACKED_NEW char[dataLen + 1]; eulaData = new char[dataLen + 1];
ZeroMemory(eulaData, dataLen + 1); ZeroMemory(eulaData, dataLen + 1);
stream.Read(dataLen, eulaData); stream.Read(dataLen, eulaData);
@ -1455,8 +1455,8 @@ int WINAPI WinMain(HINSTANCE hInst, HINSTANCE hPrevInst, LPSTR lpCmdLine, int nC
// if the client was started directly, run the patcher, and shutdown // if the client was started directly, run the patcher, and shutdown
STARTUPINFOW si; STARTUPINFOW si;
PROCESS_INFORMATION pi; PROCESS_INFORMATION pi;
ZERO(si); memset(&si, 0, sizeof(si));
ZERO(pi); memset(&pi, 0, sizeof(pi));
si.cb = sizeof(si); si.cb = sizeof(si);
wchar_t cmdLine[MAX_PATH]; wchar_t cmdLine[MAX_PATH];
const wchar_t ** addrs; const wchar_t ** addrs;

12
Sources/Plasma/Apps/plClientPatcher/UruPlayer.cpp

@ -361,7 +361,7 @@ static void RequestNextManifestFile () {
PathRemoveFilename(basePath, basePath, arrsize(basePath)); PathRemoveFilename(basePath, basePath, arrsize(basePath));
PathCreateDirectory(basePath, kPathCreateDirFlagEntireTree); PathCreateDirectory(basePath, kPathCreateDirFlagEntireTree);
ProgressStream *writer = NEW(ProgressStream); // optimization: dont delete and recreate. Doesn't seem to be working currently, ZLibStream is breaking ProgressStream *writer = new ProgressStream(); // optimization: dont delete and recreate. Doesn't seem to be working currently, ZLibStream is breaking
if(!writer->Open(path, "wb")) if(!writer->Open(path, "wb"))
{ {
writer->Close(); writer->Close();
@ -435,7 +435,7 @@ static void DownloadCallback (
#endif // PLASMA_EXTERNAL_RELEASE #endif // PLASMA_EXTERNAL_RELEASE
Shutdown(mf->info); Shutdown(mf->info);
} }
writer = NEW(ProgressStream); writer = new ProgressStream();
if (!writer->Open(path, "wb")) { if (!writer->Open(path, "wb")) {
#ifdef PLASMA_EXTERNAL_RELEASE #ifdef PLASMA_EXTERNAL_RELEASE
MessageBox(nil, s_fileOpenError, "URU Launcher", MB_ICONERROR); MessageBox(nil, s_fileOpenError, "URU Launcher", MB_ICONERROR);
@ -617,7 +617,7 @@ static void ProcessManifest (void * param) {
PathRemoveFilename(basePath, basePath, arrsize(basePath)); PathRemoveFilename(basePath, basePath, arrsize(basePath));
PathCreateDirectory(basePath, kPathCreateDirFlagEntireTree); PathCreateDirectory(basePath, kPathCreateDirFlagEntireTree);
ManifestFile * mf = NEW(ManifestFile)( ManifestFile * mf = new ManifestFile(
manifest[index].clientName, manifest[index].clientName,
manifest[index].downloadName, manifest[index].downloadName,
manifest[index].md5, manifest[index].md5,
@ -689,7 +689,7 @@ static void ManifestCallback (
return; return;
} }
ManifestResult * mr = NEW(ManifestResult); ManifestResult * mr = new ManifestResult();
StrCopy(mr->group, group, arrsize(mr->group)); StrCopy(mr->group, group, arrsize(mr->group));
mr->manifest.Set(manifest, entryCount); mr->manifest.Set(manifest, entryCount);
mr->info = info; mr->info = info;
@ -991,8 +991,8 @@ void UruStartProc (void * param) {
fprintf(stderr, "URUPlayer StartProc, running game process at dir:%ws, cmd:%ws for application:%ws\n", workDir, cmdLine, s_clientExeName); fprintf(stderr, "URUPlayer StartProc, running game process at dir:%ws, cmd:%ws for application:%ws\n", workDir, cmdLine, s_clientExeName);
STARTUPINFOW si; STARTUPINFOW si;
ZERO(si); memset(&si, 0, sizeof(si));
ZERO(s_pi); memset(&s_pi, 0, sizeof(s_pi));
si.cb = sizeof(si); si.cb = sizeof(si);
info->SetText("Launching URU..."); info->SetText("Launching URU...");

2
Sources/Plasma/Apps/plPageInfo/plPageInfo.cpp

@ -129,7 +129,7 @@ int main(int argc, char* argv[])
plResMgrSettings::Get().SetFilterNewerPageVersions(false); plResMgrSettings::Get().SetFilterNewerPageVersions(false);
plResMgrSettings::Get().SetFilterOlderPageVersions(false); plResMgrSettings::Get().SetFilterOlderPageVersions(false);
plResMgrSettings::Get().SetLoadPagesOnInit(false); plResMgrSettings::Get().SetLoadPagesOnInit(false);
gResMgr = TRACKED_NEW plResManager; gResMgr = new plResManager;
hsgResMgr::Init(gResMgr); hsgResMgr::Init(gResMgr);
gResMgr->AddSinglePage(pageFile); gResMgr->AddSinglePage(pageFile);

4
Sources/Plasma/Apps/plPageOptimizer/main.cpp

@ -63,12 +63,12 @@ int main(int argc, char* argv[])
try try
{ {
#endif #endif
plResManager* resMgr = TRACKED_NEW plResManager; plResManager* resMgr = new plResManager;
hsgResMgr::Init(resMgr); hsgResMgr::Init(resMgr);
// Setup all the crap that needs to be around to load // Setup all the crap that needs to be around to load
plSimulationMgr::Init(); plSimulationMgr::Init();
fontCache = TRACKED_NEW plFontCache; fontCache = new plFontCache;
plPythonFileMod::SetAtConvertTime(); plPythonFileMod::SetAtConvertTime();
#ifndef _DEBUG #ifndef _DEBUG
} catch (...) } catch (...)

12
Sources/Plasma/Apps/plUruLauncher/Main.cpp

@ -774,7 +774,7 @@ int __stdcall WinMain (
TGDoCiderDetection (); TGDoCiderDetection ();
s_hInstance = hInstance; s_hInstance = hInstance;
ZERO(s_launcherInfo); memset(&s_launcherInfo, 0, sizeof(s_launcherInfo));
StrPrintf(s_launcherInfo.cmdLine, arrsize(s_launcherInfo.cmdLine), appCmdLine); StrPrintf(s_launcherInfo.cmdLine, arrsize(s_launcherInfo.cmdLine), appCmdLine);
s_launcherInfo.returnCode = 0; s_launcherInfo.returnCode = 0;
@ -860,8 +860,8 @@ int __stdcall WinMain (
// launch new patcher // launch new patcher
STARTUPINFOW si; STARTUPINFOW si;
PROCESS_INFORMATION pi; PROCESS_INFORMATION pi;
ZERO(si); memset(&si, 0, sizeof(si));
ZERO(pi); memset(&pi, 0, sizeof(pi));
si.cb = sizeof(si); si.cb = sizeof(si);
wchar_t cmdline[MAX_PATH]; wchar_t cmdline[MAX_PATH];
@ -990,7 +990,7 @@ void SetReturnCode (DWORD retCode) {
//============================================================================ //============================================================================
void SetProgress (unsigned progress) { void SetProgress (unsigned progress) {
SetProgressEvent *event = NEW(SetProgressEvent); SetProgressEvent *event = new SetProgressEvent();
event->type = kEventSetProgress; event->type = kEventSetProgress;
event->progress = progress; event->progress = progress;
PostEvent(event); PostEvent(event);
@ -998,7 +998,7 @@ void SetProgress (unsigned progress) {
//============================================================================ //============================================================================
void SetText (const char text[]) { void SetText (const char text[]) {
SetTextEvent *event = NEW(SetTextEvent); SetTextEvent *event = new SetTextEvent();
event->type = kEventSetText; event->type = kEventSetText;
StrCopy(event->text, text, arrsize(event->text)); StrCopy(event->text, text, arrsize(event->text));
PostEvent(event); PostEvent(event);
@ -1006,7 +1006,7 @@ void SetText (const char text[]) {
//============================================================================ //============================================================================
void SetStatusText (const char text[]) { void SetStatusText (const char text[]) {
SetTextEvent *event = NEW(SetTextEvent); SetTextEvent *event = new SetTextEvent();
event->type = kEventSetStatusText; event->type = kEventSetStatusText;
StrCopy(event->text, text, arrsize(event->text)); StrCopy(event->text, text, arrsize(event->text));
PostEvent(event); PostEvent(event);

4
Sources/Plasma/Apps/plUruLauncher/SelfPatcher.cpp

@ -263,8 +263,8 @@ static bool SelfPatcherProc (bool * abort, plLauncherInfo *info) {
// launch new patcher // launch new patcher
STARTUPINFOW si; STARTUPINFOW si;
PROCESS_INFORMATION pi; PROCESS_INFORMATION pi;
ZERO(si); memset(&si, 0, sizeof(si));
ZERO(pi); memset(&pi, 0, sizeof(pi));
si.cb = sizeof(si); si.cb = sizeof(si);
wchar_t cmdline[MAX_PATH]; wchar_t cmdline[MAX_PATH];

8
Sources/Plasma/CoreLib/hsBiExpander.h

@ -127,7 +127,7 @@ void hsExpander<T>::IExpand(int newSize)
newPostAlloc++; newPostAlloc++;
while( newPostAlloc <= newSize ) while( newPostAlloc <= newSize )
newPostAlloc = fGrowBy ? newPostAlloc + fGrowBy : newPostAlloc << 1; newPostAlloc = fGrowBy ? newPostAlloc + fGrowBy : newPostAlloc << 1;
T* newArray = TRACKED_NEW T[newPostAlloc]; T* newArray = new T[newPostAlloc];
int i; int i;
for( i = 0; i < fNumPost; i++ ) for( i = 0; i < fNumPost; i++ )
newArray[i] = fArray[i]; newArray[i] = fArray[i];
@ -145,7 +145,7 @@ hsExpander<T>::hsExpander(int32_t minSize, int32_t growBy)
fMinSize = minSize+1; fMinSize = minSize+1;
fGrowBy = growBy; fGrowBy = growBy;
fArray = TRACKED_NEW T[fMinSize]; fArray = new T[fMinSize];
fNumPostAlloc = fMinSize; fNumPostAlloc = fMinSize;
fNumPost = 0; fNumPost = 0;
@ -339,7 +339,7 @@ void hsBiExpander<T>::IExpand(int newSize, hsBool towardEnd)
while( newPreAlloc <= newSize ) while( newPreAlloc <= newSize )
newPreAlloc = fGrowBy ? newPreAlloc + fGrowBy : newPreAlloc << 1; newPreAlloc = fGrowBy ? newPreAlloc + fGrowBy : newPreAlloc << 1;
} }
T* newArray = TRACKED_NEW T[newPreAlloc + newPostAlloc]; T* newArray = new T[newPreAlloc + newPostAlloc];
newArray += newPreAlloc; newArray += newPreAlloc;
int i; int i;
for( i = -fNumPre; i < fNumPost; i++ ) for( i = -fNumPre; i < fNumPost; i++ )
@ -361,7 +361,7 @@ hsBiExpander<T>::hsBiExpander(int32_t minSize, int32_t growBy)
fMinSize = minSize+1; fMinSize = minSize+1;
fGrowBy = growBy; fGrowBy = growBy;
fArray = TRACKED_NEW T[fMinSize << 1]; fArray = new T[fMinSize << 1];
fNumPreAlloc = fNumPostAlloc = fMinSize; fNumPreAlloc = fNumPostAlloc = fMinSize;
fArray += fNumPreAlloc; fArray += fNumPreAlloc;

6
Sources/Plasma/CoreLib/hsBitVector.cpp

@ -73,7 +73,7 @@ void hsBitVector::IGrow(uint32_t newNumBitVectors)
{ {
hsAssert(newNumBitVectors > fNumBitVectors, "Growing smaller"); hsAssert(newNumBitVectors > fNumBitVectors, "Growing smaller");
uint32_t *old = fBitVectors; uint32_t *old = fBitVectors;
fBitVectors = TRACKED_NEW uint32_t[newNumBitVectors]; fBitVectors = new uint32_t[newNumBitVectors];
int i; int i;
for( i = 0; i < fNumBitVectors; i++ ) for( i = 0; i < fNumBitVectors; i++ )
fBitVectors[i] = old[i]; fBitVectors[i] = old[i];
@ -96,7 +96,7 @@ hsBitVector& hsBitVector::Compact()
if( hiVec >= 0 ) if( hiVec >= 0 )
{ {
uint32_t *old = fBitVectors; uint32_t *old = fBitVectors;
fBitVectors = TRACKED_NEW uint32_t[++hiVec]; fBitVectors = new uint32_t[++hiVec];
int i; int i;
for( i = 0; i < hiVec; i++ ) for( i = 0; i < hiVec; i++ )
fBitVectors[i] = old[i]; fBitVectors[i] = old[i];
@ -119,7 +119,7 @@ void hsBitVector::Read(hsStream* s)
if( fNumBitVectors ) if( fNumBitVectors )
{ {
delete [] fBitVectors; delete [] fBitVectors;
fBitVectors = TRACKED_NEW uint32_t[fNumBitVectors]; fBitVectors = new uint32_t[fNumBitVectors];
int i; int i;
for( i = 0; i < fNumBitVectors; i++ ) for( i = 0; i < fNumBitVectors; i++ )
s->LogReadLE(&fBitVectors[i],"BitVector"); s->LogReadLE(&fBitVectors[i],"BitVector");

6
Sources/Plasma/CoreLib/hsBitVector.h

@ -102,7 +102,7 @@ public:
// integer level access // integer level access
uint32_t GetNumBitVectors() const { return fNumBitVectors; } uint32_t GetNumBitVectors() const { return fNumBitVectors; }
uint32_t GetBitVector(int i) const { return fBitVectors[i]; } uint32_t GetBitVector(int i) const { return fBitVectors[i]; }
void SetNumBitVectors(uint32_t n) { Reset(); fNumBitVectors=n; fBitVectors = TRACKED_NEW uint32_t[n]; } void SetNumBitVectors(uint32_t n) { Reset(); fNumBitVectors=n; fBitVectors = new uint32_t[n]; }
void SetBitVector(int i, uint32_t val) { fBitVectors[i]=val; } void SetBitVector(int i, uint32_t val) { fBitVectors[i]=val; }
// Do dst.SetCount(0), then add each set bit's index into dst, returning dst. // Do dst.SetCount(0), then add each set bit's index into dst, returning dst.
@ -118,7 +118,7 @@ inline hsBitVector::hsBitVector(const hsBitVector& other)
{ {
if( 0 != (fNumBitVectors = other.fNumBitVectors) ) if( 0 != (fNumBitVectors = other.fNumBitVectors) )
{ {
fBitVectors = TRACKED_NEW uint32_t[fNumBitVectors]; fBitVectors = new uint32_t[fNumBitVectors];
int i; int i;
for( i = 0; i < fNumBitVectors; i++ ) for( i = 0; i < fNumBitVectors; i++ )
fBitVectors[i] = other.fBitVectors[i]; fBitVectors[i] = other.fBitVectors[i];
@ -160,7 +160,7 @@ inline hsBitVector& hsBitVector::operator=(const hsBitVector& other)
{ {
Reset(); Reset();
fNumBitVectors = other.fNumBitVectors; fNumBitVectors = other.fNumBitVectors;
fBitVectors = TRACKED_NEW uint32_t[fNumBitVectors]; fBitVectors = new uint32_t[fNumBitVectors];
} }
else else
{ {

6
Sources/Plasma/CoreLib/hsBounds.cpp

@ -554,7 +554,7 @@ hsBool hsBoundsOriented::IsInside(const hsPoint3* pos) const
void hsBoundsOriented::SetNumberPlanes(uint32_t n) void hsBoundsOriented::SetNumberPlanes(uint32_t n)
{ {
delete [] fPlanes; delete [] fPlanes;
fPlanes = TRACKED_NEW hsPlane3[fNumPlanes = n]; fPlanes = new hsPlane3[fNumPlanes = n];
} }
void hsBoundsOriented::SetPlane(uint32_t i, hsPlane3 *pln) void hsBoundsOriented::SetPlane(uint32_t i, hsPlane3 *pln)
@ -562,7 +562,7 @@ void hsBoundsOriented::SetPlane(uint32_t i, hsPlane3 *pln)
fType = kBoundsNormal; fType = kBoundsNormal;
if( i >= fNumPlanes ) if( i >= fNumPlanes )
{ {
hsPlane3 *newPlanes = TRACKED_NEW hsPlane3[i+1]; hsPlane3 *newPlanes = new hsPlane3[i+1];
if( fPlanes ) if( fPlanes )
{ {
int k; int k;
@ -633,7 +633,7 @@ void hsBoundsOriented::Read(hsStream *stream)
fNumPlanes = stream->ReadLE32(); fNumPlanes = stream->ReadLE32();
if (fPlanes) if (fPlanes)
delete [] fPlanes; delete [] fPlanes;
fPlanes = TRACKED_NEW hsPlane3[fNumPlanes]; fPlanes = new hsPlane3[fNumPlanes];
int i; int i;
for( i = 0; i < fNumPlanes; i++ ) for( i = 0; i < fNumPlanes; i++ )
{ {

2
Sources/Plasma/CoreLib/hsExceptionStack.h

@ -83,7 +83,7 @@ inline hsExceptionStack& hsExceptionStack::Instance()
{ {
if (!fExceptionStack) if (!fExceptionStack)
{ {
fExceptionStack = TRACKED_NEW hsExceptionStack; fExceptionStack = new hsExceptionStack;
} }
return *fExceptionStack; return *fExceptionStack;

2
Sources/Plasma/CoreLib/hsHashTable.h

@ -116,7 +116,7 @@ fCollisionStep(step),
fCollisionCount(0) fCollisionCount(0)
{ {
fItemList.SetCount(1); fItemList.SetCount(1);
fHashTable = TRACKED_NEW uint32_t[fSize]; fHashTable = new uint32_t[fSize];
memset(fHashTable,0,fSize*sizeof(uint32_t)); memset(fHashTable,0,fSize*sizeof(uint32_t));
} }

3
Sources/Plasma/CoreLib/hsMalloc.h

@ -145,7 +145,6 @@ inline void CDECL operator delete (void * ptr, const char [], unsigned)
{ return MemFree(ptr, 0); } { return MemFree(ptr, 0); }
inline void CDECL operator delete [](void * ptr, const char [], unsigned) inline void CDECL operator delete [](void * ptr, const char [], unsigned)
{ return MemFree(ptr, 0); } { return MemFree(ptr, 0); }
#define TRACKED_NEW new(__FILE__, __LINE__)
// placement new // placement new
@ -165,11 +164,9 @@ inline void CDECL operator delete (void *, void *) {}
***/ ***/
#define ALLOCZERO(b) MemAlloc(b, kMemZero, __FILE__, __LINE__) #define ALLOCZERO(b) MemAlloc(b, kMemZero, __FILE__, __LINE__)
#define ZERO(s) MemSet(&s, 0, sizeof(s))
#ifdef __cplusplus #ifdef __cplusplus
#define NEW(t) new(MemAlloc(sizeof(t), 0, __FILE__, __LINE__)) t
#define NEWZERO(t) new(MemAlloc(sizeof(t), kMemZero, __FILE__, __LINE__)) t #define NEWZERO(t) new(MemAlloc(sizeof(t), kMemZero, __FILE__, __LINE__)) t
#endif // __cplusplus #endif // __cplusplus

10
Sources/Plasma/CoreLib/hsMemory.cpp

@ -67,7 +67,7 @@ hsBool HSMemory::EqualBlocks(const void* block1, const void* block2, uint32_t le
void* HSMemory::New(uint32_t size) void* HSMemory::New(uint32_t size)
{ {
return TRACKED_NEW uint32_t[(size + 3) >> 2]; return new uint32_t[(size + 3) >> 2];
} }
void HSMemory::Delete(void* block) void HSMemory::Delete(void* block)
@ -113,7 +113,7 @@ void HSMemory::Clear(void* m, uint32_t byteLen)
template <class T> T* hsSoftNew(T*& obj) template <class T> T* hsSoftNew(T*& obj)
{ {
try { try {
obj = TRACKED_NEW T; obj = new T;
} }
catch (...) { catch (...) {
obj = nil; obj = nil;
@ -124,7 +124,7 @@ template <class T> T* hsSoftNew(T*& obj)
inline template <class T> T* hsSoftNew(T*& obj, unsigned count) inline template <class T> T* hsSoftNew(T*& obj, unsigned count)
{ {
try { try {
obj = TRACKED_NEW T[count]; obj = new T[count];
} }
catch (...) { catch (...) {
obj = nil; obj = nil;
@ -138,7 +138,7 @@ void* HSMemory::SoftNew(uint32_t size)
uint32_t* p; uint32_t* p;
hsTry { hsTry {
p = TRACKED_NEW uint32_t[(size + 3) >> 2]; p = new uint32_t[(size + 3) >> 2];
} hsCatch(...) { } hsCatch(...) {
p = nil; p = nil;
} }
@ -736,7 +736,7 @@ static _CrtMemBlockHeader *cmbh_last; // Remember this header for next increme
long totsize= 0; // Track Total Bytes long totsize= 0; // Track Total Bytes
long normsize = 0; // Track total of NORMAL Blocks long normsize = 0; // Track total of NORMAL Blocks
looktbl *ltb = TRACKED_NEW looktbl[LTBLMAX]; looktbl *ltb = new looktbl[LTBLMAX];
long tblEnd=1; // first is "NULL"; long tblEnd=1; // first is "NULL";
memset((void *)ltb,0,sizeof(looktbl) * LTBLMAX); // clear table area memset((void *)ltb,0,sizeof(looktbl) * LTBLMAX); // clear table area

2
Sources/Plasma/CoreLib/hsMemory.h

@ -90,7 +90,7 @@ public:
if (length > fLength) if (length > fLength)
{ if (fMem != fMemBuffer) { if (fMem != fMemBuffer)
delete[] fMem; delete[] fMem;
fMem = TRACKED_NEW uint8_t[length]; fMem = new uint8_t[length];
fLength = length; fLength = length;
} }
return fMem; return fMem;

4
Sources/Plasma/CoreLib/hsStlUtils.cpp

@ -262,7 +262,7 @@ bool formatv(std::string & out, const char * fmt, va_list args)
{ {
if (pbuf!=buf) if (pbuf!=buf)
delete [] pbuf; delete [] pbuf;
pbuf = TRACKED_NEW char[kBufSz+kBufSz*attempts]; pbuf = new char[kBufSz+kBufSz*attempts];
} }
} }
while (!success && attempts<kMaxAttempts); while (!success && attempts<kMaxAttempts);
@ -314,7 +314,7 @@ bool formatv(std::wstring & out, const wchar_t * fmt, va_list args)
{ {
if (pbuf!=buf) if (pbuf!=buf)
delete [] pbuf; delete [] pbuf;
pbuf = TRACKED_NEW wchar_t[kBufSz+kBufSz*attempts]; pbuf = new wchar_t[kBufSz+kBufSz*attempts];
} }
} }
while (!success && attempts<kMaxAttempts); while (!success && attempts<kMaxAttempts);

14
Sources/Plasma/CoreLib/hsStream.cpp

@ -143,7 +143,7 @@ uint32_t hsStream::WriteSafeStringLong(const char *string)
WriteLE32(len); WriteLE32(len);
if (len > 0) if (len > 0)
{ {
char *buff = TRACKED_NEW char[len+1]; char *buff = new char[len+1];
int i; int i;
for (i = 0; i < len; i++) for (i = 0; i < len; i++)
{ {
@ -181,7 +181,7 @@ char *hsStream::ReadSafeStringLong()
uint32_t numChars = ReadLE32(); uint32_t numChars = ReadLE32();
if (numChars > 0 && numChars <= GetSizeLeft()) if (numChars > 0 && numChars <= GetSizeLeft())
{ {
name = TRACKED_NEW char[numChars+1]; name = new char[numChars+1];
Read(numChars, name); Read(numChars, name);
name[numChars] = '\0'; name[numChars] = '\0';
@ -203,7 +203,7 @@ wchar_t *hsStream::ReadSafeWStringLong()
uint32_t numChars = ReadLE32(); uint32_t numChars = ReadLE32();
if (numChars > 0 && numChars <= (GetSizeLeft()/2)) // divide by two because each char is two bytes if (numChars > 0 && numChars <= (GetSizeLeft()/2)) // divide by two because each char is two bytes
{ {
retVal = TRACKED_NEW wchar_t[numChars+1]; retVal = new wchar_t[numChars+1];
int i; int i;
for (i=0; i<numChars; i++) for (i=0; i<numChars; i++)
retVal[i] = (wchar_t)ReadLE16(); retVal[i] = (wchar_t)ReadLE16();
@ -229,7 +229,7 @@ uint32_t hsStream::WriteSafeString(const char *string)
WriteLE16(len | 0xf000); WriteLE16(len | 0xf000);
if (len > 0) if (len > 0)
{ {
char *buff = TRACKED_NEW char[len+1]; char *buff = new char[len+1];
int i; int i;
for (i = 0; i < len; i++) for (i = 0; i < len; i++)
{ {
@ -280,7 +280,7 @@ char *hsStream::ReadSafeString()
hsAssert(numChars <= GetSizeLeft(), "Bad string"); hsAssert(numChars <= GetSizeLeft(), "Bad string");
if (numChars > 0 && numChars <= GetSizeLeft()) if (numChars > 0 && numChars <= GetSizeLeft())
{ {
name = TRACKED_NEW char[numChars+1]; name = new char[numChars+1];
Read(numChars, name); Read(numChars, name);
name[numChars] = '\0'; name[numChars] = '\0';
@ -305,7 +305,7 @@ wchar_t *hsStream::ReadSafeWString()
hsAssert(numChars <= GetSizeLeft()/2, "Bad string"); hsAssert(numChars <= GetSizeLeft()/2, "Bad string");
if (numChars > 0 && numChars <= (GetSizeLeft()/2)) // divide by two because each char is two bytes if (numChars > 0 && numChars <= (GetSizeLeft()/2)) // divide by two because each char is two bytes
{ {
retVal = TRACKED_NEW wchar_t[numChars+1]; retVal = new wchar_t[numChars+1];
int i; int i;
for (i=0; i<numChars; i++) for (i=0; i<numChars; i++)
retVal[i] = (wchar_t)ReadLE16(); retVal[i] = (wchar_t)ReadLE16();
@ -1211,7 +1211,7 @@ hsQueueStream::hsQueueStream(int32_t size) :
fReadCursor(0), fReadCursor(0),
fWriteCursor(0) fWriteCursor(0)
{ {
fQueue = TRACKED_NEW char[fSize]; fQueue = new char[fSize];
} }
hsQueueStream::~hsQueueStream() hsQueueStream::~hsQueueStream()

4
Sources/Plasma/CoreLib/hsTemplates.cpp

@ -261,7 +261,7 @@ int hsTArrayBase::GetSizeOf(void) { return 0; }
hsTArrayBase::hsTArrayBase():fUseCount(0), fTotalCount(0) hsTArrayBase::hsTArrayBase():fUseCount(0), fTotalCount(0)
{ {
self = TRACKED_NEW hsDlistNode(this); self = new hsDlistNode(this);
} }
hsTArrayBase::~hsTArrayBase() hsTArrayBase::~hsTArrayBase()
@ -280,7 +280,7 @@ int hsLargeArrayBase::GetSizeOf(void) { return 0; }
hsLargeArrayBase::hsLargeArrayBase():fUseCount(0), fTotalCount(0) hsLargeArrayBase::hsLargeArrayBase():fUseCount(0), fTotalCount(0)
{ {
self = TRACKED_NEW hsDlistNode(this); self = new hsDlistNode(this);
} }
hsLargeArrayBase::~hsLargeArrayBase() hsLargeArrayBase::~hsLargeArrayBase()

46
Sources/Plasma/CoreLib/hsTemplates.h

@ -130,10 +130,10 @@ template <class T> class hsTempArray {
uint32_t fCount; uint32_t fCount;
hsTempArray<T>& operator=(const hsTempArray<T>&); hsTempArray<T>& operator=(const hsTempArray<T>&);
public: public:
hsTempArray(long count) : fArray(TRACKED_NEW T[count]), fCount(count) hsTempArray(long count) : fArray(new T[count]), fCount(count)
{ {
} }
hsTempArray(long count, T initValue) : fArray(TRACKED_NEW T[count]), fCount(count) hsTempArray(long count, T initValue) : fArray(new T[count]), fCount(count)
{ {
for (int i = 0; i < count; i++) for (int i = 0; i < count; i++)
fArray[i] = initValue; fArray[i] = initValue;
@ -156,7 +156,7 @@ public:
if (count > fCount) if (count > fCount)
{ delete[] fArray; { delete[] fArray;
fCount = count; fCount = count;
fArray = TRACKED_NEW T[count]; fArray = new T[count];
} }
} }
}; };
@ -279,7 +279,7 @@ template <class T>
fCount = count; fCount = count;
fArray = nil; fArray = nil;
if (count) if (count)
fArray = TRACKED_NEW T[ count ]; fArray = new T[ count ];
} }
template <class T> template <class T>
@ -295,7 +295,7 @@ void hsDynamicArray<T>::SetCount(int32_t count)
{ if (count == 0) { if (count == 0)
this->Reset(); this->Reset();
else else
{ T* newArray = TRACKED_NEW T[count]; { T* newArray = new T[count];
if (fArray) if (fArray)
{ int copyCount = hsMinimum(count, fCount); { int copyCount = hsMinimum(count, fCount);
@ -358,7 +358,7 @@ void hsDynamicArray<T>::Remove(int32_t index)
if (--fCount > 0) if (--fCount > 0)
{ {
int i; int i;
T* newList = TRACKED_NEW T[fCount]; T* newList = new T[fCount];
for(i = 0 ; i < index;i++) for(i = 0 ; i < index;i++)
newList[i] = fArray[i]; newList[i] = fArray[i];
for (i = index; i < fCount; i++) for (i = index; i < fCount; i++)
@ -388,7 +388,7 @@ int32_t hsDynamicArray<T>::Push(const T& obj)
{ {
if (fArray) if (fArray)
{ {
T* newList = TRACKED_NEW T[fCount+1]; T* newList = new T[fCount+1];
for(int i = 0 ; i < fCount; i++) for(int i = 0 ; i < fCount; i++)
newList[i+1] = fArray[i]; newList[i+1] = fArray[i];
newList[0] = obj; newList[0] = obj;
@ -397,7 +397,7 @@ int32_t hsDynamicArray<T>::Push(const T& obj)
} }
else else
{ hsAssert(fCount == 0, "mismatch"); { hsAssert(fCount == 0, "mismatch");
fArray = TRACKED_NEW T[1]; fArray = new T[1];
fArray[0] = obj; fArray[0] = obj;
} }
return ++fCount; return ++fCount;
@ -407,7 +407,7 @@ template <class T>
int32_t hsDynamicArray<T>::Append(const T& obj) int32_t hsDynamicArray<T>::Append(const T& obj)
{ {
if (fArray) if (fArray)
{ T* newList = TRACKED_NEW T[fCount + 1]; { T* newList = new T[fCount + 1];
for (int i = 0; i < fCount; i++) for (int i = 0; i < fCount; i++)
newList[i] = fArray[i]; newList[i] = fArray[i];
@ -417,7 +417,7 @@ int32_t hsDynamicArray<T>::Append(const T& obj)
} }
else else
{ hsAssert(fCount == 0, "mismatch"); { hsAssert(fCount == 0, "mismatch");
fArray = TRACKED_NEW T[1]; fArray = new T[1];
fArray[0] = obj; fArray[0] = obj;
} }
return ++fCount; return ++fCount;
@ -430,7 +430,7 @@ int32_t hsDynamicArray<T>::InsertAtIndex(uint32_t index, const T& obj)
if (fArray) if (fArray)
{ {
hsAssert(uint32_t(fCount) >= index, "Index too large for array"); hsAssert(uint32_t(fCount) >= index, "Index too large for array");
T* newList = TRACKED_NEW T[fCount + 1]; T* newList = new T[fCount + 1];
unsigned i; unsigned i;
for ( i = 0; i < index; i++) for ( i = 0; i < index; i++)
newList[i] = fArray[i]; newList[i] = fArray[i];
@ -445,7 +445,7 @@ int32_t hsDynamicArray<T>::InsertAtIndex(uint32_t index, const T& obj)
{ {
hsAssert(fCount == 0, "mismatch"); hsAssert(fCount == 0, "mismatch");
hsAssert(index ==0,"Can't insert at non zero index in empty array"); hsAssert(index ==0,"Can't insert at non zero index in empty array");
fArray = TRACKED_NEW T[1]; fArray = new T[1];
fArray[0] = obj; fArray[0] = obj;
} }
return ++fCount; return ++fCount;
@ -464,7 +464,7 @@ template <class T>
hsDynamicArray<T>* hsDynamicArray<T>::Copy(hsDynamicArray<T>* dst) const hsDynamicArray<T>* hsDynamicArray<T>::Copy(hsDynamicArray<T>* dst) const
{ {
if (dst == nil) if (dst == nil)
dst = TRACKED_NEW hsDynamicArray<T>; dst = new hsDynamicArray<T>;
else else
dst->Reset(); dst->Reset();
@ -659,7 +659,7 @@ template <class T> hsTArray<T>::hsTArray(int count) : fArray(nil)
hsTArray_ValidateCount(count); hsTArray_ValidateCount(count);
fUseCount = fTotalCount = count; fUseCount = fTotalCount = count;
if (count > 0) if (count > 0)
fArray = TRACKED_NEW T[count]; fArray = new T[count];
} }
template <class T> hsTArray<T>::hsTArray(const hsTArray<T>& src) : fArray(nil) template <class T> hsTArray<T>::hsTArray(const hsTArray<T>& src) : fArray(nil)
@ -669,7 +669,7 @@ template <class T> hsTArray<T>::hsTArray(const hsTArray<T>& src) : fArray(nil)
if (count > 0) if (count > 0)
{ {
fArray = TRACKED_NEW T[count]; fArray = new T[count];
hsTArray_CopyForward(src.fArray, fArray, count); hsTArray_CopyForward(src.fArray, fArray, count);
} }
} }
@ -759,7 +759,7 @@ template <class T> void hsTArray<T>::SetCount(int count)
{ {
if (fArray) if (fArray)
delete[] fArray; delete[] fArray;
fArray = TRACKED_NEW T[count]; fArray = new T[count];
fUseCount = fTotalCount = count; fUseCount = fTotalCount = count;
} }
fUseCount = count; fUseCount = count;
@ -770,7 +770,7 @@ template <class T> void hsTArray<T>::Expand(int NewCount) // New Count is Absolu
hsTArray_ValidateCount(NewCount); hsTArray_ValidateCount(NewCount);
if (NewCount > fTotalCount) // This is Expand not Shrink if (NewCount > fTotalCount) // This is Expand not Shrink
{ {
T* newArray = TRACKED_NEW T[NewCount]; T* newArray = new T[NewCount];
if (fArray != nil) if (fArray != nil)
{ hsTArray_CopyForward(fArray, newArray, fUseCount); { hsTArray_CopyForward(fArray, newArray, fUseCount);
@ -846,7 +846,7 @@ template <class T> void hsTArray<T>::IncCount(int index, int count)
fTotalCount = newCount; fTotalCount = newCount;
GrowArraySize(newCount); // Sets new fTotalCount GrowArraySize(newCount); // Sets new fTotalCount
T* newArray = TRACKED_NEW T[fTotalCount]; T* newArray = new T[fTotalCount];
if (fArray != nil) if (fArray != nil)
{ hsTArray_CopyForward(fArray, newArray, index); { hsTArray_CopyForward(fArray, newArray, index);
@ -1056,7 +1056,7 @@ template <class T> hsLargeArray<T>::hsLargeArray(int count) : fArray(nil)
hsLargeArray_ValidateCount(count); hsLargeArray_ValidateCount(count);
fUseCount = fTotalCount = count; fUseCount = fTotalCount = count;
if (count > 0) if (count > 0)
fArray = TRACKED_NEW T[count]; fArray = new T[count];
} }
template <class T> hsLargeArray<T>::hsLargeArray(const hsLargeArray<T>& src) : fArray(nil) template <class T> hsLargeArray<T>::hsLargeArray(const hsLargeArray<T>& src) : fArray(nil)
@ -1066,7 +1066,7 @@ template <class T> hsLargeArray<T>::hsLargeArray(const hsLargeArray<T>& src) : f
if (count > 0) if (count > 0)
{ {
fArray = TRACKED_NEW T[count]; fArray = new T[count];
hsLargeArray_CopyForward(src.fArray, fArray, count); hsLargeArray_CopyForward(src.fArray, fArray, count);
} }
} }
@ -1128,7 +1128,7 @@ template <class T> void hsLargeArray<T>::SetCount(int count)
{ {
if (fArray) if (fArray)
delete[] fArray; delete[] fArray;
fArray = TRACKED_NEW T[count]; fArray = new T[count];
fUseCount = fTotalCount = count; fUseCount = fTotalCount = count;
} }
fUseCount = count; fUseCount = count;
@ -1139,7 +1139,7 @@ template <class T> void hsLargeArray<T>::Expand(int NewCount) // New Count is Ab
hsLargeArray_ValidateCount(NewCount); hsLargeArray_ValidateCount(NewCount);
if (NewCount > fTotalCount) // This is Expand not Shrink if (NewCount > fTotalCount) // This is Expand not Shrink
{ {
T* newArray = TRACKED_NEW T[NewCount]; T* newArray = new T[NewCount];
if (fArray != nil) if (fArray != nil)
{ hsLargeArray_CopyForward(fArray, newArray, fUseCount); { hsLargeArray_CopyForward(fArray, newArray, fUseCount);
@ -1215,7 +1215,7 @@ template <class T> void hsLargeArray<T>::IncCount(int index, int count)
fTotalCount = newCount; fTotalCount = newCount;
GrowArraySize(newCount); // Sets new fTotalCount GrowArraySize(newCount); // Sets new fTotalCount
T* newArray = TRACKED_NEW T[fTotalCount]; T* newArray = new T[fTotalCount];
if (fArray != nil) if (fArray != nil)
{ hsLargeArray_CopyForward(fArray, newArray, index); { hsLargeArray_CopyForward(fArray, newArray, index);

4
Sources/Plasma/CoreLib/hsUtils.cpp

@ -328,7 +328,7 @@ wchar_t *hsStringToWString( const char *str )
{ {
// convert the char string to a wchar_t string // convert the char string to a wchar_t string
int len = strlen(str); int len = strlen(str);
wchar_t *wideString = TRACKED_NEW wchar_t[len+1]; wchar_t *wideString = new wchar_t[len+1];
for (int i=0; i<len; i++) for (int i=0; i<len; i++)
wideString[i] = btowc(str[i]); wideString[i] = btowc(str[i]);
wideString[len] = L'\0'; wideString[len] = L'\0';
@ -342,7 +342,7 @@ char *hsWStringToString( const wchar_t *str )
{ {
// convert the wchar_t string to a char string // convert the wchar_t string to a char string
int len = wcslen(str); int len = wcslen(str);
char *sStr = TRACKED_NEW char[len+1]; char *sStr = new char[len+1];
int i; int i;
for (i = 0; i < len; i++) for (i = 0; i < len; i++)

12
Sources/Plasma/FeatureLib/pfAnimation/pfObjectFlocker.cpp

@ -496,7 +496,7 @@ pfBoid::~pfBoid()
// delete this boid's token in the proximity database // delete this boid's token in the proximity database
delete fProximityToken; delete fProximityToken;
plLoadCloneMsg* msg = TRACKED_NEW plLoadCloneMsg(fObjKey, fFlockerPtr->GetKey(), 0, false); plLoadCloneMsg* msg = new plLoadCloneMsg(fObjKey, fFlockerPtr->GetKey(), 0, false);
msg->Send(); msg->Send();
} }
@ -790,7 +790,7 @@ fMaxForce(10.0f),
fMaxSpeed(5.0f), fMaxSpeed(5.0f),
fMinSpeed(4.0f) fMinSpeed(4.0f)
{ {
fDatabase = TRACKED_NEW pfBasicProximityDatabase<pfVehicle*>(); fDatabase = new pfBasicProximityDatabase<pfVehicle*>();
} }
pfFlock::~pfFlock() pfFlock::~pfFlock()
@ -886,7 +886,7 @@ void pfFlock::Update(plSceneObject *goal, float deltaTime)
void pfFlock::AddBoid(pfObjectFlocker *flocker, plKey &key, hsPoint3 &pos) void pfFlock::AddBoid(pfObjectFlocker *flocker, plKey &key, hsPoint3 &pos)
{ {
pfBoid *newBoid = TRACKED_NEW pfBoid(*fDatabase, flocker, key, pos); pfBoid *newBoid = new pfBoid(*fDatabase, flocker, key, pos);
newBoid->SetGoalWeight(fGoalWeight); newBoid->SetGoalWeight(fGoalWeight);
newBoid->SetWanderWeight(fRandomWeight); newBoid->SetWanderWeight(fRandomWeight);
@ -934,7 +934,7 @@ hsBool pfObjectFlocker::MsgReceive(plMessage* msg)
plInitialAgeStateLoadedMsg* loadMsg = plInitialAgeStateLoadedMsg::ConvertNoRef(msg); plInitialAgeStateLoadedMsg* loadMsg = plInitialAgeStateLoadedMsg::ConvertNoRef(msg);
if (loadMsg) if (loadMsg)
{ {
plEnableMsg* pMsg = TRACKED_NEW plEnableMsg; plEnableMsg* pMsg = new plEnableMsg;
pMsg->AddReceiver(fBoidKey); pMsg->AddReceiver(fBoidKey);
pMsg->SetCmd(plEnableMsg::kDrawable); pMsg->SetCmd(plEnableMsg::kDrawable);
pMsg->AddType(plEnableMsg::kDrawable); pMsg->AddType(plEnableMsg::kDrawable);
@ -945,7 +945,7 @@ hsBool pfObjectFlocker::MsgReceive(plMessage* msg)
hsPoint3 pos(fTarget->GetLocalToWorld().GetTranslate()); hsPoint3 pos(fTarget->GetLocalToWorld().GetTranslate());
for (int i = 0; i < fNumBoids; i++) for (int i = 0; i < fNumBoids; i++)
{ {
plLoadCloneMsg* cloneMsg = TRACKED_NEW plLoadCloneMsg(fBoidKey->GetUoid(), GetKey(), 0); plLoadCloneMsg* cloneMsg = new plLoadCloneMsg(fBoidKey->GetUoid(), GetKey(), 0);
plKey newKey = cloneMsg->GetCloneKey(); plKey newKey = cloneMsg->GetCloneKey();
cloneMsg->Send(); cloneMsg->Send();
@ -966,7 +966,7 @@ hsBool pfObjectFlocker::MsgReceive(plMessage* msg)
{ {
if (fRandomizeAnimationStart) if (fRandomizeAnimationStart)
{ {
plAnimCmdMsg* pMsg = TRACKED_NEW plAnimCmdMsg; plAnimCmdMsg* pMsg = new plAnimCmdMsg;
pMsg->SetSender(GetKey()); pMsg->SetSender(GetKey());
pMsg->SetBCastFlag(plMessage::kPropagateToModifiers | plMessage::kPropagateToChildren); pMsg->SetBCastFlag(plMessage::kPropagateToModifiers | plMessage::kPropagateToChildren);
pMsg->AddReceiver( lcMsg->GetCloneKey() ); pMsg->AddReceiver( lcMsg->GetCloneKey() );

2
Sources/Plasma/FeatureLib/pfAnimation/pfObjectFlocker.h

@ -126,7 +126,7 @@ public:
virtual ~pfBasicProximityDatabase() {} virtual ~pfBasicProximityDatabase() {}
// allocate a token to represent a given client object in this database // allocate a token to represent a given client object in this database
tokenType *MakeToken(T parentObject) {return TRACKED_NEW tokenType(parentObject, fGroup);} tokenType *MakeToken(T parentObject) {return new tokenType(parentObject, fGroup);}
// return the number of tokens currently in the database // return the number of tokens currently in the database
int Size(void) {return fGroup.size();} int Size(void) {return fGroup.size();}

2
Sources/Plasma/FeatureLib/pfAnimation/plFollowMod.cpp

@ -281,7 +281,7 @@ void plFollowMod::Read(hsStream* stream, hsResMgr* mgr)
fLeaderType = FollowLeaderType(stream->ReadByte()); fLeaderType = FollowLeaderType(stream->ReadByte());
fMode = stream->ReadByte(); fMode = stream->ReadByte();
mgr->ReadKeyNotifyMe(stream, TRACKED_NEW plGenRefMsg(GetKey(), plRefMsg::kOnCreate, 0, kRefLeader), plRefFlags::kActiveRef); mgr->ReadKeyNotifyMe(stream, new plGenRefMsg(GetKey(), plRefMsg::kOnCreate, 0, kRefLeader), plRefFlags::kActiveRef);
// If active? // If active?
Activate(); Activate();

10
Sources/Plasma/FeatureLib/pfAnimation/plLineFollowMod.cpp

@ -155,14 +155,14 @@ void plLineFollowMod::Read(hsStream* stream, hsResMgr* mgr)
fPath = plAnimPath::ConvertNoRef(mgr->ReadCreatable(stream)); fPath = plAnimPath::ConvertNoRef(mgr->ReadCreatable(stream));
mgr->ReadKeyNotifyMe(stream, TRACKED_NEW plGenRefMsg(GetKey(), plRefMsg::kOnCreate, 0, kRefParent), plRefFlags::kPassiveRef); mgr->ReadKeyNotifyMe(stream, new plGenRefMsg(GetKey(), plRefMsg::kOnCreate, 0, kRefParent), plRefFlags::kPassiveRef);
mgr->ReadKeyNotifyMe(stream, TRACKED_NEW plGenRefMsg(GetKey(), plRefMsg::kOnCreate, 0, kRefObject), plRefFlags::kPassiveRef); mgr->ReadKeyNotifyMe(stream, new plGenRefMsg(GetKey(), plRefMsg::kOnCreate, 0, kRefObject), plRefFlags::kPassiveRef);
int n = stream->ReadLE32(); int n = stream->ReadLE32();
while(n--) while(n--)
{ {
mgr->ReadKeyNotifyMe(stream, TRACKED_NEW plGenRefMsg(GetKey(), plRefMsg::kOnCreate, 0, kRefStereizer), plRefFlags::kPassiveRef); mgr->ReadKeyNotifyMe(stream, new plGenRefMsg(GetKey(), plRefMsg::kOnCreate, 0, kRefStereizer), plRefFlags::kPassiveRef);
} }
uint32_t f = stream->ReadLE32(); uint32_t f = stream->ReadLE32();
@ -616,12 +616,12 @@ void plLineFollowMod::RemoveTarget(plSceneObject* so)
void plLineFollowMod::AddStereizer(const plKey& key) void plLineFollowMod::AddStereizer(const plKey& key)
{ {
hsgResMgr::ResMgr()->SendRef(plKey(key), TRACKED_NEW plGenRefMsg(GetKey(), plRefMsg::kOnCreate, 0, kRefStereizer), plRefFlags::kPassiveRef); hsgResMgr::ResMgr()->SendRef(plKey(key), new plGenRefMsg(GetKey(), plRefMsg::kOnCreate, 0, kRefStereizer), plRefFlags::kPassiveRef);
} }
void plLineFollowMod::RemoveStereizer(const plKey& key) void plLineFollowMod::RemoveStereizer(const plKey& key)
{ {
hsgResMgr::ResMgr()->SendRef(plKey(key), TRACKED_NEW plGenRefMsg(GetKey(), plRefMsg::kOnRemove, 0, kRefStereizer), plRefFlags::kPassiveRef); hsgResMgr::ResMgr()->SendRef(plKey(key), new plGenRefMsg(GetKey(), plRefMsg::kOnRemove, 0, kRefStereizer), plRefFlags::kPassiveRef);
} }
// derived version of this class for rail cameras // derived version of this class for rail cameras

2
Sources/Plasma/FeatureLib/pfAnimation/plRandomCommandMod.cpp

@ -300,7 +300,7 @@ void plRandomCommandMod::IRetry(float secs)
double t = hsTimer::GetSysSeconds() + secs; double t = hsTimer::GetSysSeconds() + secs;
plAnimCmdMsg* msg = TRACKED_NEW plAnimCmdMsg(nil, GetKey(), &t); plAnimCmdMsg* msg = new plAnimCmdMsg(nil, GetKey(), &t);
msg->SetCmd(plAnimCmdMsg::kContinue); msg->SetCmd(plAnimCmdMsg::kContinue);
plgDispatch::MsgSend(msg); plgDispatch::MsgSend(msg);
} }

4
Sources/Plasma/FeatureLib/pfAnimation/plViewFaceModifier.cpp

@ -86,7 +86,7 @@ void plViewFaceModifier::Read(hsStream* s, hsResMgr* mgr)
fOrigParentToLocal.Read(s); fOrigParentToLocal.Read(s);
if( HasFlag(kFaceObj) ) if( HasFlag(kFaceObj) )
mgr->ReadKeyNotifyMe(s, TRACKED_NEW plGenRefMsg(GetKey(), plRefMsg::kOnCreate, 0, kRefFaceObj), plRefFlags::kPassiveRef); mgr->ReadKeyNotifyMe(s, new plGenRefMsg(GetKey(), plRefMsg::kOnCreate, 0, kRefFaceObj), plRefFlags::kPassiveRef);
fOffset.Read(s); fOffset.Read(s);
@ -390,7 +390,7 @@ void plViewFaceModifier::IOnRemove(plGenRefMsg* refMsg)
void plViewFaceModifier::ISetObject(plKey soKey) void plViewFaceModifier::ISetObject(plKey soKey)
{ {
hsgResMgr::ResMgr()->SendRef(soKey, TRACKED_NEW plGenRefMsg(GetKey(), plRefMsg::kOnRequest, 0, kRefFaceObj), plRefFlags::kPassiveRef); hsgResMgr::ResMgr()->SendRef(soKey, new plGenRefMsg(GetKey(), plRefMsg::kOnRequest, 0, kRefFaceObj), plRefFlags::kPassiveRef);
} }
void plViewFaceModifier::SetFollowMode(FollowMode m, plKey soKey) void plViewFaceModifier::SetFollowMode(FollowMode m, plKey soKey)

8
Sources/Plasma/FeatureLib/pfAudio/plListener.cpp

@ -170,7 +170,7 @@ hsBool plListener::IEval(double secs, float del, uint32_t dirty)
} }
// Got the params, now construct and send out the message, as well as update the audio system // Got the params, now construct and send out the message, as well as update the audio system
plListenerMsg* msg = TRACKED_NEW plListenerMsg; plListenerMsg* msg = new plListenerMsg;
msg->SetDirection( dir ); msg->SetDirection( dir );
msg->SetUp( up ); msg->SetUp( up );
msg->SetPosition( position ); msg->SetPosition( position );
@ -207,7 +207,7 @@ hsBool plListener::IEval(double secs, float del, uint32_t dirty)
void plListener::ISetRef( const plKey &ref, hsBool binding, int type ) void plListener::ISetRef( const plKey &ref, hsBool binding, int type )
{ {
if( binding ) if( binding )
hsgResMgr::ResMgr()->AddViaNotify( ref, TRACKED_NEW plGenRefMsg( GetKey(), plGenRefMsg::kOnReplace, -1, type ), plRefFlags::kPassiveRef ); hsgResMgr::ResMgr()->AddViaNotify( ref, new plGenRefMsg( GetKey(), plGenRefMsg::kOnReplace, -1, type ), plRefFlags::kPassiveRef );
else else
GetKey()->Release( ref ); GetKey()->Release( ref );
} }
@ -293,9 +293,9 @@ hsBool plListener::MsgReceive(plMessage* msg)
if( fInitMe ) if( fInitMe )
{ {
// By default, position and orientation are camera based // By default, position and orientation are camera based
plSetListenerMsg *set = TRACKED_NEW plSetListenerMsg( plSetListenerMsg::kVCam | plSetListenerMsg::kFacing, nil, true ); plSetListenerMsg *set = new plSetListenerMsg( plSetListenerMsg::kVCam | plSetListenerMsg::kFacing, nil, true );
set->Send(); set->Send();
set = TRACKED_NEW plSetListenerMsg( plSetListenerMsg::kVCam | plSetListenerMsg::kPosition, nil, true ); set = new plSetListenerMsg( plSetListenerMsg::kVCam | plSetListenerMsg::kPosition, nil, true );
set->Send(); set->Send();
fInitMe = false; fInitMe = false;

18
Sources/Plasma/FeatureLib/pfAudio/plRandomSoundMod.cpp

@ -66,7 +66,7 @@ void plRandomSoundModGroup::Read(hsStream *s)
{ {
fNumSounds = s->ReadLE16(); fNumSounds = s->ReadLE16();
fGroupedIdx = s->ReadLE16(); fGroupedIdx = s->ReadLE16();
fIndices = TRACKED_NEW uint16_t[fNumSounds]; fIndices = new uint16_t[fNumSounds];
int i; int i;
for (i = 0; i < fNumSounds; i++) for (i = 0; i < fNumSounds; i++)
@ -119,7 +119,7 @@ void plRandomSoundMod::IStop()
if( fGroups != nil && fGroups[ fCurrentGroup ].fGroupedIdx != -1 ) if( fGroups != nil && fGroups[ fCurrentGroup ].fGroupedIdx != -1 )
{ {
plSoundMsg *msg = TRACKED_NEW plSoundMsg(); plSoundMsg *msg = new plSoundMsg();
msg->SetCmd(plSoundMsg::kStop); msg->SetCmd(plSoundMsg::kStop);
msg->fIndex = fGroups[ fCurrentGroup ].fIndices[ fCurrent ]; msg->fIndex = fGroups[ fCurrentGroup ].fIndices[ fCurrent ];
plgDispatch::MsgSend(msg); plgDispatch::MsgSend(msg);
@ -128,7 +128,7 @@ void plRandomSoundMod::IStop()
{ {
if(fCurrent == -1) return; if(fCurrent == -1) return;
uint16_t currentSndIdx = ( fGroups != nil ) ? fGroups[fCurrentGroup].fIndices[fCurrent] : fActiveList[fCurrent]; uint16_t currentSndIdx = ( fGroups != nil ) ? fGroups[fCurrentGroup].fIndices[fCurrent] : fActiveList[fCurrent];
plSoundMsg* snd = TRACKED_NEW plSoundMsg(GetKey(), GetTarget()->GetKey(), nil); plSoundMsg* snd = new plSoundMsg(GetKey(), GetTarget()->GetKey(), nil);
snd->SetCmd(plSoundMsg::kStop); snd->SetCmd(plSoundMsg::kStop);
snd->fIndex = currentSndIdx; snd->fIndex = currentSndIdx;
plgDispatch::MsgSend(snd); plgDispatch::MsgSend(snd);
@ -188,7 +188,7 @@ void plRandomSoundMod::IPlayNext()
float delay = IGetDelay(0); float delay = IGetDelay(0);
double t = hsTimer::GetSysSeconds() + delay; double t = hsTimer::GetSysSeconds() + delay;
plAnimCmdMsg* anim = TRACKED_NEW plAnimCmdMsg(GetKey(), GetKey(), &t); plAnimCmdMsg* anim = new plAnimCmdMsg(GetKey(), GetKey(), &t);
anim->SetCmd(plAnimCmdMsg::kContinue); anim->SetCmd(plAnimCmdMsg::kContinue);
plgDispatch::MsgSend(anim); plgDispatch::MsgSend(anim);
return; return;
@ -217,13 +217,13 @@ void plRandomSoundMod::IPlayNext()
sound->SetLocalOnly(true); sound->SetLocalOnly(true);
// Send msg to the grouped sound to switch sounds // Send msg to the grouped sound to switch sounds
plSoundMsg *snd = TRACKED_NEW plSoundMsg(); plSoundMsg *snd = new plSoundMsg();
snd->SetCmd( plSoundMsg::kSelectFromGroup ); snd->SetCmd( plSoundMsg::kSelectFromGroup );
snd->fIndex = currentSndIdx; snd->fIndex = currentSndIdx;
snd->Send( sound->GetKey() ); snd->Send( sound->GetKey() );
// Now tell the audio interface to play the sound (probably should change this....) // Now tell the audio interface to play the sound (probably should change this....)
snd = TRACKED_NEW plSoundMsg(GetKey(), GetTarget()->GetKey(), nil); snd = new plSoundMsg(GetKey(), GetTarget()->GetKey(), nil);
snd->SetCmd(plSoundMsg::kGoToTime); snd->SetCmd(plSoundMsg::kGoToTime);
snd->fTime = (0); snd->fTime = (0);
snd->SetCmd(plSoundMsg::kStop); snd->SetCmd(plSoundMsg::kStop);
@ -266,7 +266,7 @@ void plRandomSoundMod::IPlayNext()
double t = hsTimer::GetSysSeconds() + delay; double t = hsTimer::GetSysSeconds() + delay;
plAnimCmdMsg* anim = TRACKED_NEW plAnimCmdMsg(GetKey(), GetKey(), &t); plAnimCmdMsg* anim = new plAnimCmdMsg(GetKey(), GetKey(), &t);
anim->SetCmd(plAnimCmdMsg::kContinue); anim->SetCmd(plAnimCmdMsg::kContinue);
plgDispatch::MsgSend(anim); plgDispatch::MsgSend(anim);
} }
@ -297,7 +297,7 @@ void plRandomSoundMod::Read(hsStream *s, hsResMgr *mgr)
fNumGroups = s->ReadLE16(); fNumGroups = s->ReadLE16();
if (fNumGroups > 0) if (fNumGroups > 0)
{ {
fGroups = TRACKED_NEW plRandomSoundModGroup[fNumGroups]; fGroups = new plRandomSoundModGroup[fNumGroups];
int i; int i;
for (i = 0; i < fNumGroups; i++) for (i = 0; i < fNumGroups; i++)
fGroups[i].Read(s); fGroups[i].Read(s);
@ -428,4 +428,4 @@ plSound *plRandomSoundMod::IGetSoundPtr()
pSound = ai->GetSound( currentSndIdx ); pSound = ai->GetSound( currentSndIdx );
return pSound; return pSound;
} }

24
Sources/Plasma/FeatureLib/pfCamera/plCameraBrain.cpp

@ -487,10 +487,10 @@ void plCameraBrain1::Read(hsStream* stream, hsResMgr* mgr)
{ {
hsKeyedObject::Read(stream, mgr); hsKeyedObject::Read(stream, mgr);
fPOAOffset.Read(stream); fPOAOffset.Read(stream);
plGenRefMsg* msg = TRACKED_NEW plGenRefMsg(GetKey(), plRefMsg::kOnRequest, 0, kSubject ); // SceneObject plGenRefMsg* msg = new plGenRefMsg(GetKey(), plRefMsg::kOnRequest, 0, kSubject ); // SceneObject
mgr->ReadKeyNotifyMe( stream, msg, plRefFlags::kActiveRef ); mgr->ReadKeyNotifyMe( stream, msg, plRefFlags::kActiveRef );
plGenRefMsg* msg2 = TRACKED_NEW plGenRefMsg( GetKey(), plRefMsg::kOnRequest, 0, kRailComponent ); // SceneObject plGenRefMsg* msg2 = new plGenRefMsg( GetKey(), plRefMsg::kOnRequest, 0, kRailComponent ); // SceneObject
mgr->ReadKeyNotifyMe( stream, msg2, plRefFlags::kActiveRef ); mgr->ReadKeyNotifyMe( stream, msg2, plRefFlags::kActiveRef );
fFlags.Read(stream); fFlags.Read(stream);
@ -613,7 +613,7 @@ hsBool plCameraBrain1::MsgReceive(plMessage* msg)
} }
else else
{ {
plGenRefMsg* msg = TRACKED_NEW plGenRefMsg(GetKey(), plRefMsg::kOnRequest, 0, kSubject ); // SceneObject plGenRefMsg* msg = new plGenRefMsg(GetKey(), plRefMsg::kOnRequest, 0, kSubject ); // SceneObject
hsgResMgr::ResMgr()->AddViaNotify(pPMsg->fPlayer, msg, plRefFlags::kPassiveRef); hsgResMgr::ResMgr()->AddViaNotify(pPMsg->fPlayer, msg, plRefFlags::kPassiveRef);
fFlags.SetBit(kCutPosOnce); fFlags.SetBit(kCutPosOnce);
@ -973,7 +973,7 @@ plCameraBrain1_Avatar::~plCameraBrain1_Avatar()
if (fFaded) if (fFaded)
{ {
plCameraTargetFadeMsg* pMsg = TRACKED_NEW plCameraTargetFadeMsg; plCameraTargetFadeMsg* pMsg = new plCameraTargetFadeMsg;
pMsg->SetFadeOut(false); pMsg->SetFadeOut(false);
pMsg->SetSubjectKey(plNetClientMgr::GetInstance()->GetLocalPlayerKey()); pMsg->SetSubjectKey(plNetClientMgr::GetInstance()->GetLocalPlayerKey());
pMsg->SetBCastFlag(plMessage::kBCastByExactType); pMsg->SetBCastFlag(plMessage::kBCastByExactType);
@ -1102,7 +1102,7 @@ void plCameraBrain1_Avatar::CalculatePosition()
// check LOS // check LOS
if (GetCamera()->GetKey() && fFlags.IsBitSet(kMaintainLOS) && (plVirtualCam1::Instance()->GetCurrentStackCamera() == GetCamera())) if (GetCamera()->GetKey() && fFlags.IsBitSet(kMaintainLOS) && (plVirtualCam1::Instance()->GetCurrentStackCamera() == GetCamera()))
{ {
plLOSRequestMsg* pMsg = TRACKED_NEW plLOSRequestMsg( GetCamera()->GetKey(), fPOAGoal, fGoal, plSimDefs::kLOSDBCameraBlockers, plLOSRequestMsg* pMsg = new plLOSRequestMsg( GetCamera()->GetKey(), fPOAGoal, fGoal, plSimDefs::kLOSDBCameraBlockers,
plLOSRequestMsg::kTestClosest, plLOSRequestMsg::kReportHitOrMiss); plLOSRequestMsg::kTestClosest, plLOSRequestMsg::kReportHitOrMiss);
plgDispatch::MsgSend( pMsg ); plgDispatch::MsgSend( pMsg );
} }
@ -1148,7 +1148,7 @@ void plCameraBrain1_Avatar::ISendFadeMsg(hsBool fade)
else else
plVirtualCam1::AddMsgToLog("current camera sending Fade In message to Avatar"); plVirtualCam1::AddMsgToLog("current camera sending Fade In message to Avatar");
plCameraTargetFadeMsg* pMsg = TRACKED_NEW plCameraTargetFadeMsg; plCameraTargetFadeMsg* pMsg = new plCameraTargetFadeMsg;
pMsg->SetFadeOut(fade); pMsg->SetFadeOut(fade);
pMsg->SetSubjectKey(GetSubject()->GetKey()); pMsg->SetSubjectKey(GetSubject()->GetKey());
pMsg->SetBCastFlag(plMessage::kBCastByExactType); pMsg->SetBCastFlag(plMessage::kBCastByExactType);
@ -1397,7 +1397,7 @@ void plCameraBrain1_FirstPerson::CalculatePosition()
// check LOS // check LOS
if (GetCamera()->GetKey() && fFlags.IsBitSet(kMaintainLOS) && (plVirtualCam1::Instance()->GetCurrentStackCamera() == GetCamera())) if (GetCamera()->GetKey() && fFlags.IsBitSet(kMaintainLOS) && (plVirtualCam1::Instance()->GetCurrentStackCamera() == GetCamera()))
{ {
plLOSRequestMsg* pMsg = TRACKED_NEW plLOSRequestMsg( GetCamera()->GetKey(), fPOAGoal, fGoal, plSimDefs::kLOSDBCameraBlockers, plLOSRequestMsg* pMsg = new plLOSRequestMsg( GetCamera()->GetKey(), fPOAGoal, fGoal, plSimDefs::kLOSDBCameraBlockers,
plLOSRequestMsg::kTestClosest, plLOSRequestMsg::kReportHitOrMiss); plLOSRequestMsg::kTestClosest, plLOSRequestMsg::kReportHitOrMiss);
plgDispatch::MsgSend( pMsg ); plgDispatch::MsgSend( pMsg );
} }
@ -1436,7 +1436,7 @@ void plCameraBrain1_FirstPerson::Push(hsBool recenter)
if (plCameraBrain1_FirstPerson::fDontFade) if (plCameraBrain1_FirstPerson::fDontFade)
return; return;
plEnableMsg* pMsg = TRACKED_NEW plEnableMsg; plEnableMsg* pMsg = new plEnableMsg;
pMsg->SetCmd(plEnableMsg::kDisable); pMsg->SetCmd(plEnableMsg::kDisable);
pMsg->AddType(plEnableMsg::kDrawable); pMsg->AddType(plEnableMsg::kDrawable);
pMsg->SetBCastFlag(plMessage::kPropagateToModifiers); pMsg->SetBCastFlag(plMessage::kPropagateToModifiers);
@ -1481,7 +1481,7 @@ plCameraBrain1_Fixed::~plCameraBrain1_Fixed()
void plCameraBrain1_Fixed::Read(hsStream* stream, hsResMgr* mgr) void plCameraBrain1_Fixed::Read(hsStream* stream, hsResMgr* mgr)
{ {
plCameraBrain1::Read(stream, mgr); plCameraBrain1::Read(stream, mgr);
mgr->ReadKeyNotifyMe( stream, TRACKED_NEW plGenRefMsg(GetKey(), plRefMsg::kOnRequest, 0, 99), plRefFlags::kPassiveRef); mgr->ReadKeyNotifyMe( stream, new plGenRefMsg(GetKey(), plRefMsg::kOnRequest, 0, 99), plRefFlags::kPassiveRef);
} }
void plCameraBrain1_Fixed::Write(hsStream* stream, hsResMgr* mgr) void plCameraBrain1_Fixed::Write(hsStream* stream, hsResMgr* mgr)
@ -1783,9 +1783,9 @@ void plCameraBrain1_Circle::Read(hsStream* stream, hsResMgr* mgr)
fCenter.Read(stream); fCenter.Read(stream);
SetRadius(stream->ReadLEScalar()); SetRadius(stream->ReadLEScalar());
plGenRefMsg* msg = TRACKED_NEW plGenRefMsg(GetKey(), plRefMsg::kOnRequest, 0, kCircleTarget ); // SceneObject plGenRefMsg* msg = new plGenRefMsg(GetKey(), plRefMsg::kOnRequest, 0, kCircleTarget ); // SceneObject
mgr->ReadKeyNotifyMe( stream, msg, plRefFlags::kActiveRef ); mgr->ReadKeyNotifyMe( stream, msg, plRefFlags::kActiveRef );
plGenRefMsg* msg2 = TRACKED_NEW plGenRefMsg( GetKey(), plRefMsg::kOnRequest, 0, kPOAObject ); // SceneObject plGenRefMsg* msg2 = new plGenRefMsg( GetKey(), plRefMsg::kOnRequest, 0, kPOAObject ); // SceneObject
mgr->ReadKeyNotifyMe( stream, msg2, plRefFlags::kActiveRef ); mgr->ReadKeyNotifyMe( stream, msg2, plRefFlags::kActiveRef );
fCirPerSec = stream->ReadLEScalar(); fCirPerSec = stream->ReadLEScalar();
plgDispatch::Dispatch()->RegisterForExactType(plEvalMsg::Index(), GetKey()); plgDispatch::Dispatch()->RegisterForExactType(plEvalMsg::Index(), GetKey());
@ -1842,7 +1842,7 @@ hsBool plCameraBrain1_Circle::MsgReceive(plMessage* msg)
} }
if (fFlags.IsBitSet(kFollowLocalAvatar)) if (fFlags.IsBitSet(kFollowLocalAvatar))
{ {
plGenRefMsg* msg = TRACKED_NEW plGenRefMsg(GetKey(), plRefMsg::kOnRequest, 0, kSubject ); // SceneObject plGenRefMsg* msg = new plGenRefMsg(GetKey(), plRefMsg::kOnRequest, 0, kSubject ); // SceneObject
hsgResMgr::ResMgr()->AddViaNotify(pPMsg->fPlayer, msg, plRefFlags::kPassiveRef); hsgResMgr::ResMgr()->AddViaNotify(pPMsg->fPlayer, msg, plRefFlags::kPassiveRef);
fFlags.SetBit(kCutPosOnce); fFlags.SetBit(kCutPosOnce);

12
Sources/Plasma/FeatureLib/pfCamera/plCameraModifier.cpp

@ -323,7 +323,7 @@ void plCameraModifier1::Read(hsStream* stream, hsResMgr* mgr)
{ {
hsKeyedObject::Read(stream, mgr); hsKeyedObject::Read(stream, mgr);
fBrain = nil; fBrain = nil;
mgr->ReadKeyNotifyMe(stream, TRACKED_NEW plGenRefMsg(GetKey(), plRefMsg::kOnCreate, 0, kRefBrain), plRefFlags::kActiveRef); mgr->ReadKeyNotifyMe(stream, new plGenRefMsg(GetKey(), plRefMsg::kOnCreate, 0, kRefBrain), plRefFlags::kActiveRef);
int count = stream->ReadLE32(); int count = stream->ReadLE32();
int i; int i;
for (i = 0; i < count; i++) for (i = 0; i < count; i++)
@ -340,7 +340,7 @@ void plCameraModifier1::Read(hsStream* stream, hsResMgr* mgr)
float pA = stream->ReadLEScalar(); float pA = stream->ReadLEScalar();
float pD = stream->ReadLEScalar(); float pD = stream->ReadLEScalar();
CamTrans* camTrans = TRACKED_NEW CamTrans(key); CamTrans* camTrans = new CamTrans(key);
camTrans->fAccel = a; camTrans->fAccel = a;
camTrans->fDecel = d; camTrans->fDecel = d;
camTrans->fVelocity = v; camTrans->fVelocity = v;
@ -364,7 +364,7 @@ void plCameraModifier1::Read(hsStream* stream, hsResMgr* mgr)
} }
for(i = 0; i < n; i++ ) for(i = 0; i < n; i++ )
{ {
mgr->ReadKeyNotifyMe(stream, TRACKED_NEW plGenRefMsg(GetKey(), plRefMsg::kOnCreate, i, kRefCallbackMsg), plRefFlags::kActiveRef); mgr->ReadKeyNotifyMe(stream, new plGenRefMsg(GetKey(), plRefMsg::kOnCreate, i, kRefCallbackMsg), plRefFlags::kActiveRef);
} }
n = stream->ReadLE32(); n = stream->ReadLE32();
@ -430,7 +430,7 @@ void plCameraModifier1::Push(hsBool recenter)
{ {
if (fStartAnimOnPush) if (fStartAnimOnPush)
{ {
plAnimCmdMsg* pMsg = TRACKED_NEW plAnimCmdMsg; plAnimCmdMsg* pMsg = new plAnimCmdMsg;
pMsg->SetCmd(plAnimCmdMsg::kRunForward); pMsg->SetCmd(plAnimCmdMsg::kRunForward);
pMsg->SetBCastFlag(plMessage::kPropagateToModifiers); pMsg->SetBCastFlag(plMessage::kPropagateToModifiers);
pMsg->AddReceiver(GetTarget()->GetKey()); pMsg->AddReceiver(GetTarget()->GetKey());
@ -455,7 +455,7 @@ void plCameraModifier1::Pop()
{ {
if (fStopAnimOnPop) if (fStopAnimOnPop)
{ {
plAnimCmdMsg* pMsg = TRACKED_NEW plAnimCmdMsg; plAnimCmdMsg* pMsg = new plAnimCmdMsg;
pMsg->SetCmd(plAnimCmdMsg::kStop); pMsg->SetCmd(plAnimCmdMsg::kStop);
pMsg->SetBCastFlag(plMessage::kPropagateToModifiers); pMsg->SetBCastFlag(plMessage::kPropagateToModifiers);
pMsg->AddReceiver(GetTarget()->GetKey()); pMsg->AddReceiver(GetTarget()->GetKey());
@ -465,7 +465,7 @@ void plCameraModifier1::Pop()
} }
if (fResetAnimOnPop) if (fResetAnimOnPop)
{ {
plAnimCmdMsg* pMsg = TRACKED_NEW plAnimCmdMsg; plAnimCmdMsg* pMsg = new plAnimCmdMsg;
pMsg->SetCmd(plAnimCmdMsg::kGoToBegin); pMsg->SetCmd(plAnimCmdMsg::kGoToBegin);
pMsg->SetBCastFlag(plMessage::kPropagateToModifiers); pMsg->SetBCastFlag(plMessage::kPropagateToModifiers);
pMsg->AddReceiver(GetTarget()->GetKey()); pMsg->AddReceiver(GetTarget()->GetKey());

2
Sources/Plasma/FeatureLib/pfCamera/plInterestingModifier.cpp

@ -65,7 +65,7 @@ hsBool plInterestingModifier::IEval(double secs, float del, uint32_t dirty)
const hsBounds3Ext& targBnd = GetTarget(i)->GetDrawInterface()->GetWorldBounds(); const hsBounds3Ext& targBnd = GetTarget(i)->GetDrawInterface()->GetWorldBounds();
if( targBnd.GetType() == kBoundsNormal ) if( targBnd.GetType() == kBoundsNormal )
{ {
plInterestingModMsg* pMsg = TRACKED_NEW plInterestingModMsg; plInterestingModMsg* pMsg = new plInterestingModMsg;
pMsg->fPos= GetTarget(i)->GetDrawInterface()->GetWorldBounds().GetCenter(); pMsg->fPos= GetTarget(i)->GetDrawInterface()->GetWorldBounds().GetCenter();
pMsg->fSize = GetTarget(i)->GetDrawInterface()->GetWorldBounds().GetMaxDim(); pMsg->fSize = GetTarget(i)->GetDrawInterface()->GetWorldBounds().GetMaxDim();
pMsg->fRadius = fInterestRadius; pMsg->fRadius = fInterestRadius;

50
Sources/Plasma/FeatureLib/pfCamera/plVirtualCamNeu.cpp

@ -148,7 +148,7 @@ plVirtualCam1::plVirtualCam1()
fThirdPersonCam = nil; fThirdPersonCam = nil;
fTransPos = POS_TRANS_OFF; fTransPos = POS_TRANS_OFF;
fPrevCam = nil; fPrevCam = nil;
fTransitionCamera = TRACKED_NEW plCameraModifier1; fTransitionCamera = new plCameraModifier1;
fTransitionCamera->RegisterAs(kTransitionCamera_KEY); fTransitionCamera->RegisterAs(kTransitionCamera_KEY);
// set initial view position // set initial view position
fOutputPos.Set(100,100,100); fOutputPos.Set(100,100,100);
@ -164,8 +164,8 @@ plVirtualCam1::plVirtualCam1()
fCameraDriveInterface = plDebugInputInterface::GetInstance(); fCameraDriveInterface = plDebugInputInterface::GetInstance();
hsRefCnt_SafeRef( fCameraDriveInterface ); hsRefCnt_SafeRef( fCameraDriveInterface );
fDriveCamera = TRACKED_NEW plCameraModifier1; fDriveCamera = new plCameraModifier1;
plCameraBrain1* pDriveBrain = TRACKED_NEW plCameraBrain1_Drive(fDriveCamera); plCameraBrain1* pDriveBrain = new plCameraBrain1_Drive(fDriveCamera);
PushCamera(fDriveCamera); PushCamera(fDriveCamera);
fForceCutOnce=false; fForceCutOnce=false;
@ -262,7 +262,7 @@ void plVirtualCam1::RebuildStack(const plKey& key)
} }
if (!HasFlags(kFirstPersonAtLinkOut)) if (!HasFlags(kFirstPersonAtLinkOut))
{ {
plEnableMsg* pMsg = TRACKED_NEW plEnableMsg; plEnableMsg* pMsg = new plEnableMsg;
pMsg->SetSender(GetKey()); pMsg->SetSender(GetKey());
pMsg->SetCmd(plEnableMsg::kEnable); pMsg->SetCmd(plEnableMsg::kEnable);
pMsg->AddType(plEnableMsg::kDrawable); pMsg->AddType(plEnableMsg::kDrawable);
@ -824,7 +824,7 @@ void plVirtualCam1::Output()
fFadeCounter-=1; fFadeCounter-=1;
if (fFadeCounter == 0 && fFirstPersonOverride == nil) if (fFadeCounter == 0 && fFirstPersonOverride == nil)
{ {
plEnableMsg* pMsg = TRACKED_NEW plEnableMsg; plEnableMsg* pMsg = new plEnableMsg;
pMsg->SetSender(GetKey()); pMsg->SetSender(GetKey());
pMsg->SetCmd(plEnableMsg::kEnable); pMsg->SetCmd(plEnableMsg::kEnable);
pMsg->AddType(plEnableMsg::kDrawable); pMsg->AddType(plEnableMsg::kDrawable);
@ -888,7 +888,7 @@ void plVirtualCam1::Init()
plgDispatch::Dispatch()->RegisterForExactType(plPlayerPageMsg::Index(), GetKey()); plgDispatch::Dispatch()->RegisterForExactType(plPlayerPageMsg::Index(), GetKey());
// register for control messages // register for control messages
plCmdIfaceModMsg* pModMsg = TRACKED_NEW plCmdIfaceModMsg; plCmdIfaceModMsg* pModMsg = new plCmdIfaceModMsg;
pModMsg->SetBCastFlag(plMessage::kBCastByExactType); pModMsg->SetBCastFlag(plMessage::kBCastByExactType);
pModMsg->SetSender(GetKey()); pModMsg->SetSender(GetKey());
pModMsg->SetCmd(plCmdIfaceModMsg::kAdd); pModMsg->SetCmd(plCmdIfaceModMsg::kAdd);
@ -1238,7 +1238,7 @@ hsBool plVirtualCam1::MsgReceive(plMessage* msg)
fPythonOverride->Push(!HasFlags(kAvatarWalking)); fPythonOverride->Push(!HasFlags(kAvatarWalking));
CamTrans* pTrans = TRACKED_NEW CamTrans(fPythonOverride->GetKey()); CamTrans* pTrans = new CamTrans(fPythonOverride->GetKey());
if (pCam->Cmd(plCameraMsg::kPythonOverridePushCut)) if (pCam->Cmd(plCameraMsg::kPythonOverridePushCut))
pTrans->fCutPOA = pTrans->fCutPos = true; pTrans->fCutPOA = pTrans->fCutPos = true;
StartTransition(pTrans); StartTransition(pTrans);
@ -1302,7 +1302,7 @@ hsBool plVirtualCam1::MsgReceive(plMessage* msg)
if (HasFlags(kJustLinkedIn)) if (HasFlags(kJustLinkedIn))
{ {
ClearFlags(kJustLinkedIn); ClearFlags(kJustLinkedIn);
plCameraTargetFadeMsg* pMsg = TRACKED_NEW plCameraTargetFadeMsg; plCameraTargetFadeMsg* pMsg = new plCameraTargetFadeMsg;
pMsg->SetFadeOut(true); pMsg->SetFadeOut(true);
pMsg->SetSubjectKey(plNetClientMgr::GetInstance()->GetLocalPlayerKey()); pMsg->SetSubjectKey(plNetClientMgr::GetInstance()->GetLocalPlayerKey());
pMsg->SetBCastFlag(plMessage::kBCastByExactType); pMsg->SetBCastFlag(plMessage::kBCastByExactType);
@ -1420,17 +1420,17 @@ void plVirtualCam1::CreateDefaultCamera(plSceneObject* subject)
if (mod->GetSubject() == subject) if (mod->GetSubject() == subject)
return; return;
plGenRefMsg* msg = TRACKED_NEW plGenRefMsg(mod->GetKey(), plRefMsg::kOnReplace, 0, plCameraBrain1::kSubject ); plGenRefMsg* msg = new plGenRefMsg(mod->GetKey(), plRefMsg::kOnReplace, 0, plCameraBrain1::kSubject );
msg->SetOldRef(mod->GetSubject()); msg->SetOldRef(mod->GetSubject());
hsgResMgr::ResMgr()->AddViaNotify(subject->GetKey(), msg, plRefFlags::kPassiveRef); hsgResMgr::ResMgr()->AddViaNotify(subject->GetKey(), msg, plRefFlags::kPassiveRef);
} }
else else
{ {
plCameraModifier1* pMod = TRACKED_NEW plCameraModifier1; plCameraModifier1* pMod = new plCameraModifier1;
plCameraBrain1_FirstPerson* pBrain = TRACKED_NEW plCameraBrain1_FirstPerson(pMod); plCameraBrain1_FirstPerson* pBrain = new plCameraBrain1_FirstPerson(pMod);
pMod->RegisterAs( kDefaultCameraMod1_KEY ); pMod->RegisterAs( kDefaultCameraMod1_KEY );
//pBrain->SetSubject(subject); //pBrain->SetSubject(subject);
plGenRefMsg* msg = TRACKED_NEW plGenRefMsg(pMod->GetKey(), plRefMsg::kOnCreate, 0, plCameraBrain1::kSubject ); // SceneObject plGenRefMsg* msg = new plGenRefMsg(pMod->GetKey(), plRefMsg::kOnCreate, 0, plCameraBrain1::kSubject ); // SceneObject
hsgResMgr::ResMgr()->AddViaNotify(subject->GetKey(), msg, plRefFlags::kPassiveRef); hsgResMgr::ResMgr()->AddViaNotify(subject->GetKey(), msg, plRefFlags::kPassiveRef);
plgDispatch::Dispatch()->RegisterForExactType(plEvalMsg::Index(), pMod->GetKey()); plgDispatch::Dispatch()->RegisterForExactType(plEvalMsg::Index(), pMod->GetKey());
@ -1459,16 +1459,16 @@ void plVirtualCam1::CreateDefaultCamera(plSceneObject* subject)
if (mod->GetSubject() == subject) if (mod->GetSubject() == subject)
return; return;
plGenRefMsg* msg = TRACKED_NEW plGenRefMsg(mod->GetKey(), plRefMsg::kOnReplace, 0, plCameraBrain1::kSubject ); plGenRefMsg* msg = new plGenRefMsg(mod->GetKey(), plRefMsg::kOnReplace, 0, plCameraBrain1::kSubject );
msg->SetOldRef(mod->GetSubject()); msg->SetOldRef(mod->GetSubject());
hsgResMgr::ResMgr()->AddViaNotify(subject->GetKey(), msg, plRefFlags::kPassiveRef); hsgResMgr::ResMgr()->AddViaNotify(subject->GetKey(), msg, plRefFlags::kPassiveRef);
} }
else else
{ {
plCameraModifier1* pModx = TRACKED_NEW plCameraModifier1; plCameraModifier1* pModx = new plCameraModifier1;
plCameraBrain1_Avatar* pBrainx = TRACKED_NEW plCameraBrain1_Avatar(pModx); plCameraBrain1_Avatar* pBrainx = new plCameraBrain1_Avatar(pModx);
pModx->RegisterAs( kBuiltIn3rdPersonCamera_KEY ); pModx->RegisterAs( kBuiltIn3rdPersonCamera_KEY );
plGenRefMsg* msgx = TRACKED_NEW plGenRefMsg(pModx->GetKey(), plRefMsg::kOnCreate, 0, plCameraBrain1::kSubject ); // SceneObject plGenRefMsg* msgx = new plGenRefMsg(pModx->GetKey(), plRefMsg::kOnCreate, 0, plCameraBrain1::kSubject ); // SceneObject
hsgResMgr::ResMgr()->AddViaNotify(subject->GetKey(), msgx, plRefFlags::kPassiveRef); hsgResMgr::ResMgr()->AddViaNotify(subject->GetKey(), msgx, plRefFlags::kPassiveRef);
plgDispatch::Dispatch()->RegisterForExactType(plEvalMsg::Index(), pModx->GetKey()); plgDispatch::Dispatch()->RegisterForExactType(plEvalMsg::Index(), pModx->GetKey());
@ -1503,7 +1503,7 @@ void plVirtualCam1::AddCameraToStack(plCameraModifier1* pCam)
} }
if (pCam->GetKey()) if (pCam->GetKey())
hsgResMgr::ResMgr()->AddViaNotify(pCam->GetKey(), TRACKED_NEW plGenRefMsg(GetKey(), plRefMsg::kOnCreate, 0, kRefCamera), plRefFlags::kPassiveRef); hsgResMgr::ResMgr()->AddViaNotify(pCam->GetKey(), new plGenRefMsg(GetKey(), plRefMsg::kOnCreate, 0, kRefCamera), plRefFlags::kPassiveRef);
} }
void plVirtualCam1::PushCamera(plCameraModifier1* pCam, hsBool bDefault) void plVirtualCam1::PushCamera(plCameraModifier1* pCam, hsBool bDefault)
@ -1570,7 +1570,7 @@ void plVirtualCam1::PushCamera(plCameraModifier1* pCam, hsBool bDefault)
if (!pCam->SetFaded(true)) if (!pCam->SetFaded(true))
{ {
// new camera doesn't support fading, fade him back in // new camera doesn't support fading, fade him back in
plCameraTargetFadeMsg* pMsg = TRACKED_NEW plCameraTargetFadeMsg; plCameraTargetFadeMsg* pMsg = new plCameraTargetFadeMsg;
pMsg->SetFadeOut(false); pMsg->SetFadeOut(false);
pMsg->SetSubjectKey(GetCurrentStackCamera()->GetBrain()->GetSubject()->GetKey()); pMsg->SetSubjectKey(GetCurrentStackCamera()->GetBrain()->GetSubject()->GetKey());
pMsg->SetBCastFlag(plMessage::kBCastByExactType); pMsg->SetBCastFlag(plMessage::kBCastByExactType);
@ -1628,7 +1628,7 @@ void plVirtualCam1::PushCamera(plCameraModifier1* pCam, hsBool bDefault)
// do a track transition here; // do a track transition here;
fPrevCam = GetCurrentStackCamera(); fPrevCam = GetCurrentStackCamera();
AddCameraToStack(pCam); AddCameraToStack(pCam);
pTrans = TRACKED_NEW CamTrans(pCam->GetKey()); pTrans = new CamTrans(pCam->GetKey());
StartTransition(pTrans); StartTransition(pTrans);
delete(pTrans); delete(pTrans);
#ifdef STATUS_LOG #ifdef STATUS_LOG
@ -1639,7 +1639,7 @@ void plVirtualCam1::PushCamera(plCameraModifier1* pCam, hsBool bDefault)
{ {
// both fixed brains, cut between them // both fixed brains, cut between them
AddCameraToStack(pCam); AddCameraToStack(pCam);
pTrans = TRACKED_NEW CamTrans(pCam->GetKey()); pTrans = new CamTrans(pCam->GetKey());
pTrans->fCutPOA = true; pTrans->fCutPOA = true;
pTrans->fCutPos = true; pTrans->fCutPos = true;
StartTransition(pTrans); StartTransition(pTrans);
@ -1747,7 +1747,7 @@ void plVirtualCam1::PopCamera(plCameraModifier1* pCam)
if (!GetCurrentStackCamera()->SetFaded(true)) if (!GetCurrentStackCamera()->SetFaded(true))
{ {
// new camera doesn't support fading, fade him back in // new camera doesn't support fading, fade him back in
plCameraTargetFadeMsg* pMsg = TRACKED_NEW plCameraTargetFadeMsg; plCameraTargetFadeMsg* pMsg = new plCameraTargetFadeMsg;
pMsg->SetFadeOut(false); pMsg->SetFadeOut(false);
pMsg->SetSubjectKey(pCam->GetBrain()->GetSubject()->GetKey()); pMsg->SetSubjectKey(pCam->GetBrain()->GetSubject()->GetKey());
pMsg->SetBCastFlag(plMessage::kBCastByExactType); pMsg->SetBCastFlag(plMessage::kBCastByExactType);
@ -1781,14 +1781,14 @@ void plVirtualCam1::PopCamera(plCameraModifier1* pCam)
{ {
// do a track transition here; // do a track transition here;
fPrevCam = pCam; fPrevCam = pCam;
pTrans = TRACKED_NEW CamTrans(GetCurrentStackCamera()->GetKey()); pTrans = new CamTrans(GetCurrentStackCamera()->GetKey());
StartTransition(pTrans); StartTransition(pTrans);
delete(pTrans); delete(pTrans);
} }
else else
{ {
fPrevCam = pCam; fPrevCam = pCam;
pTrans = TRACKED_NEW CamTrans(GetCurrentStackCamera()->GetKey()); pTrans = new CamTrans(GetCurrentStackCamera()->GetKey());
pTrans->fCutPOA = true; pTrans->fCutPOA = true;
pTrans->fCutPos = true; pTrans->fCutPos = true;
StartTransition(pTrans); StartTransition(pTrans);
@ -1867,7 +1867,7 @@ void plVirtualCam1::StartTransition(CamTrans* transition)
if ( (fPythonOverride && plCameraBrain1_Avatar::ConvertNoRef(fPythonOverride->GetBrain())) || if ( (fPythonOverride && plCameraBrain1_Avatar::ConvertNoRef(fPythonOverride->GetBrain())) ||
(plCameraBrain1_Avatar::ConvertNoRef(pCam->GetBrain()) && !fPythonOverride) ) (plCameraBrain1_Avatar::ConvertNoRef(pCam->GetBrain()) && !fPythonOverride) )
{ {
plCameraBrain1_Avatar* pAvBrain = TRACKED_NEW plCameraBrain1_Avatar; plCameraBrain1_Avatar* pAvBrain = new plCameraBrain1_Avatar;
pAvBrain->SetOffset(((plCameraBrain1_Avatar*)pCam->GetBrain())->GetOffset()); pAvBrain->SetOffset(((plCameraBrain1_Avatar*)pCam->GetBrain())->GetOffset());
pAvBrain->SetPOAOffset(pCam->GetBrain()->GetPOAOffset()); pAvBrain->SetPOAOffset(pCam->GetBrain()->GetPOAOffset());
@ -1888,7 +1888,7 @@ void plVirtualCam1::StartTransition(CamTrans* transition)
} }
else else
{ {
pBrain = TRACKED_NEW plCameraBrain1; pBrain = new plCameraBrain1;
} }
pBrain->SetFlags(plCameraBrain1::kIsTransitionCamera); pBrain->SetFlags(plCameraBrain1::kIsTransitionCamera);

16
Sources/Plasma/FeatureLib/pfCharacter/pfMarkerInfo.cpp

@ -67,7 +67,7 @@ void pfMarkerInfo::Init()
plResManager* resMgr = (plResManager*)hsgResMgr::ResMgr(); plResManager* resMgr = (plResManager*)hsgResMgr::ResMgr();
// Force the client to keep the GlobalMarkers keys loaded, so we don't load them every time we clone // Force the client to keep the GlobalMarkers keys loaded, so we don't load them every time we clone
plClientMsg* loadAgeKeysMsg = TRACKED_NEW plClientMsg(plClientMsg::kLoadAgeKeys); plClientMsg* loadAgeKeysMsg = new plClientMsg(plClientMsg::kLoadAgeKeys);
loadAgeKeysMsg->SetAgeName("GlobalMarkers"); loadAgeKeysMsg->SetAgeName("GlobalMarkers");
loadAgeKeysMsg->Send(resMgr->FindKey(kClient_KEY)); loadAgeKeysMsg->Send(resMgr->FindKey(kClient_KEY));
@ -112,7 +112,7 @@ void pfMarkerInfo::Spawn(MarkerType type)
fType = type; fType = type;
fLastChange = 0; fLastChange = 0;
plLoadCloneMsg* cloneMsg = TRACKED_NEW plLoadCloneMsg(fMarkerUoid, pfMarkerMgr::Instance()->GetKey(), 0); plLoadCloneMsg* cloneMsg = new plLoadCloneMsg(fMarkerUoid, pfMarkerMgr::Instance()->GetKey(), 0);
cloneMsg->SetBCastFlag(plMessage::kNetPropagate, false); cloneMsg->SetBCastFlag(plMessage::kNetPropagate, false);
fKey = cloneMsg->GetCloneKey(); fKey = cloneMsg->GetCloneKey();
@ -133,7 +133,7 @@ void pfMarkerInfo::InitSpawned(plKey markerKey)
hsMatrix44 pos; hsMatrix44 pos;
pos.Reset(); pos.Reset();
pos.SetTranslate(&fPosition); pos.SetTranslate(&fPosition);
plWarpMsg* warpMsg = TRACKED_NEW plWarpMsg(pfMarkerMgr::Instance()->GetKey(), fKey, plWarpMsg::kFlushTransform, pos); plWarpMsg* warpMsg = new plWarpMsg(pfMarkerMgr::Instance()->GetKey(), fKey, plWarpMsg::kFlushTransform, pos);
warpMsg->Send(); warpMsg->Send();
// update its state // update its state
@ -148,7 +148,7 @@ void pfMarkerInfo::Show(bool show)
fVisible = show; fVisible = show;
if (fSpawned) { if (fSpawned) {
plEnableMsg* msg = TRACKED_NEW plEnableMsg; plEnableMsg* msg = new plEnableMsg;
msg->SetBCastFlag(plMessage::kPropagateToChildren); msg->SetBCastFlag(plMessage::kPropagateToChildren);
msg->SetCmd(plEnableMsg::kDrawable); msg->SetCmd(plEnableMsg::kDrawable);
msg->SetCmd(plEnableMsg::kPhysical); msg->SetCmd(plEnableMsg::kPhysical);
@ -183,7 +183,7 @@ void pfMarkerInfo::Remove()
{ {
if (fKey) if (fKey)
{ {
plLoadCloneMsg* cloneMsg = TRACKED_NEW plLoadCloneMsg(fKey, pfMarkerMgr::Instance()->GetKey(), 0, false); plLoadCloneMsg* cloneMsg = new plLoadCloneMsg(fKey, pfMarkerMgr::Instance()->GetKey(), 0, false);
cloneMsg->SetBCastFlag(plMessage::kNetPropagate, false); cloneMsg->SetBCastFlag(plMessage::kNetPropagate, false);
cloneMsg->Send(); cloneMsg->Send();
@ -210,7 +210,7 @@ void pfMarkerInfo::IPlayBounce(bool play)
if (fMod && fSpawned) if (fMod && fSpawned)
{ {
// Send anim start/stop msg // Send anim start/stop msg
plAnimCmdMsg* animMsg = TRACKED_NEW plAnimCmdMsg; plAnimCmdMsg* animMsg = new plAnimCmdMsg;
animMsg->SetCmd(play ? plAnimCmdMsg::kContinue : plAnimCmdMsg::kStop); animMsg->SetCmd(play ? plAnimCmdMsg::kContinue : plAnimCmdMsg::kStop);
animMsg->SetCmd(plAnimCmdMsg::kSetLooping); animMsg->SetCmd(plAnimCmdMsg::kSetLooping);
animMsg->SetCmd(plAnimCmdMsg::kGoToBegin); animMsg->SetCmd(plAnimCmdMsg::kGoToBegin);
@ -242,7 +242,7 @@ void pfMarkerInfo::IPlayColor(bool play)
break; break;
} }
plAnimCmdMsg* animMsg = TRACKED_NEW plAnimCmdMsg; plAnimCmdMsg* animMsg = new plAnimCmdMsg;
animMsg->SetCmd(play ? plAnimCmdMsg::kContinue : plAnimCmdMsg::kStop); animMsg->SetCmd(play ? plAnimCmdMsg::kContinue : plAnimCmdMsg::kStop);
animMsg->SetCmd(plAnimCmdMsg::kSetLooping); animMsg->SetCmd(plAnimCmdMsg::kSetLooping);
animMsg->SetCmd(plAnimCmdMsg::kGoToBegin); animMsg->SetCmd(plAnimCmdMsg::kGoToBegin);
@ -258,7 +258,7 @@ void pfMarkerInfo::IPlaySound(bool place)
{ {
const plAudioInterface* ai = fMod->GetTarget()->GetAudioInterface(); const plAudioInterface* ai = fMod->GetTarget()->GetAudioInterface();
plSoundMsg* msg = TRACKED_NEW plSoundMsg; plSoundMsg* msg = new plSoundMsg;
msg->fIndex = place ? fMod->fPlaceSndIdx : fMod->fHitSndIdx; msg->fIndex = place ? fMod->fPlaceSndIdx : fMod->fHitSndIdx;
msg->SetCmd(plSoundMsg::kPlay); msg->SetCmd(plSoundMsg::kPlay);
msg->SetSender(pfMarkerMgr::Instance()->GetKey()); msg->SetSender(pfMarkerMgr::Instance()->GetKey());

6
Sources/Plasma/FeatureLib/pfCharacter/pfMarkerMgr.cpp

@ -62,7 +62,7 @@ pfMarkerMgr* pfMarkerMgr::Instance()
{ {
if (!pfMarkerMgr::fInstance) if (!pfMarkerMgr::fInstance)
{ {
pfMarkerMgr::fInstance = TRACKED_NEW pfMarkerMgr; pfMarkerMgr::fInstance = new pfMarkerMgr;
pfMarkerMgr::fInstance->IInit(); pfMarkerMgr::fInstance->IInit();
} }
@ -153,7 +153,7 @@ void pfMarkerMgr::IMarkerHit(plKey markerKey, plKey playerKey)
return; // marker frozen, abort return; // marker frozen, abort
// tell people about it // tell people about it
pfMarkerMsg* msg = TRACKED_NEW pfMarkerMsg; pfMarkerMsg* msg = new pfMarkerMsg;
msg->fType = pfMarkerMsg::kMarkerCaptured; msg->fType = pfMarkerMsg::kMarkerCaptured;
msg->fMarkerID = id; msg->fMarkerID = id;
msg->Send(); msg->Send();
@ -169,7 +169,7 @@ void pfMarkerMgr::AddMarker(double x, double y, double z, uint32_t id, bool just
} }
hsPoint3 pos((float)x, (float)y, (float)z); hsPoint3 pos((float)x, (float)y, (float)z);
fMarkers[id] = TRACKED_NEW pfMarkerInfo(pos, justCreated); fMarkers[id] = new pfMarkerInfo(pos, justCreated);
fMarkers[id]->Spawn(pfMarkerInfo::kMarkerOpen); fMarkers[id]->Spawn(pfMarkerInfo::kMarkerOpen);
} }

26
Sources/Plasma/FeatureLib/pfCharacter/plPlayerModifier.cpp

@ -107,15 +107,15 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
//{ //{
// if( fTarget && fTarget->IsLocallyOwned()==plSynchedObject::kYes ) // if( fTarget && fTarget->IsLocallyOwned()==plSynchedObject::kYes )
// { // {
// plCameraMsg* pMsg = TRACKED_NEW plCameraMsg; // plCameraMsg* pMsg = new plCameraMsg;
// pMsg->SetCmd(plCameraMsg::kSetSubject); // pMsg->SetCmd(plCameraMsg::kSetSubject);
// pMsg->SetSubject(nil); // pMsg->SetSubject(nil);
// pMsg->SetBCastFlag( plMessage::kBCastByExactType ); // pMsg->SetBCastFlag( plMessage::kBCastByExactType );
// plgDispatch::MsgSend(pMsg); // plgDispatch::MsgSend(pMsg);
// //
// plAudioSysMsg* pAudMsg1 = TRACKED_NEW plAudioSysMsg(plAudioSysMsg::kSetListenerCoordinateRefCamera); // plAudioSysMsg* pAudMsg1 = new plAudioSysMsg(plAudioSysMsg::kSetListenerCoordinateRefCamera);
// plAudioSysMsg* pAudMsg2 = TRACKED_NEW plAudioSysMsg(plAudioSysMsg::kSetListenerVelocityRefCamera); // plAudioSysMsg* pAudMsg2 = new plAudioSysMsg(plAudioSysMsg::kSetListenerVelocityRefCamera);
// plAudioSysMsg* pAudMsg3 = TRACKED_NEW plAudioSysMsg(plAudioSysMsg::kSetListenerFacingRefCamera); // plAudioSysMsg* pAudMsg3 = new plAudioSysMsg(plAudioSysMsg::kSetListenerFacingRefCamera);
// plgDispatch::MsgSend(pAudMsg1); // plgDispatch::MsgSend(pAudMsg1);
// plgDispatch::MsgSend(pAudMsg2); // plgDispatch::MsgSend(pAudMsg2);
// plgDispatch::MsgSend(pAudMsg3); // plgDispatch::MsgSend(pAudMsg3);
@ -152,14 +152,14 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
// //
//void plPlayerModifier::IDoLocalSetup(plSceneObject* so) //void plPlayerModifier::IDoLocalSetup(plSceneObject* so)
//{ //{
// plCameraMsg* pMsg = TRACKED_NEW plCameraMsg; // plCameraMsg* pMsg = new plCameraMsg;
// pMsg->SetCmd(plCameraMsg::kSetSubject); // pMsg->SetCmd(plCameraMsg::kSetSubject);
// pMsg->SetSubject(so); // pMsg->SetSubject(so);
// pMsg->SetBCastFlag( plMessage::kBCastByExactType ); // pMsg->SetBCastFlag( plMessage::kBCastByExactType );
// plgDispatch::MsgSend(pMsg); // plgDispatch::MsgSend(pMsg);
// //
// // this is to solve the problem of physical vs nonphysical players... // // this is to solve the problem of physical vs nonphysical players...
//// plCameraMsg* pMsg2 = TRACKED_NEW plCameraMsg; //// plCameraMsg* pMsg2 = new plCameraMsg;
//// pMsg2->SetBCastFlag(plMessage::kBCastByExactType); //// pMsg2->SetBCastFlag(plMessage::kBCastByExactType);
//// pMsg2->SetCmd(plCameraMsg::kSetOffset); //// pMsg2->SetCmd(plCameraMsg::kSetOffset);
//// pMsg2->SetCmd(plCameraMsg::kEntering); //// pMsg2->SetCmd(plCameraMsg::kEntering);
@ -172,11 +172,11 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
//void plPlayerModifier::IMakeUsListener( plSceneObject *so ) //void plPlayerModifier::IMakeUsListener( plSceneObject *so )
//{ //{
// // set the listener to use us... // // set the listener to use us...
// plAudioSysMsg* pAudMsg1 = TRACKED_NEW plAudioSysMsg(plAudioSysMsg::kSetListenerFacingRef); // plAudioSysMsg* pAudMsg1 = new plAudioSysMsg(plAudioSysMsg::kSetListenerFacingRef);
// pAudMsg1->SetSceneObject(so->GetKey()); // pAudMsg1->SetSceneObject(so->GetKey());
// plAudioSysMsg* pAudMsg2 = TRACKED_NEW plAudioSysMsg(plAudioSysMsg::kSetListenerCoordinateRef); // plAudioSysMsg* pAudMsg2 = new plAudioSysMsg(plAudioSysMsg::kSetListenerCoordinateRef);
// pAudMsg2->SetSceneObject(so->GetKey()); // pAudMsg2->SetSceneObject(so->GetKey());
// plAudioSysMsg* pAudMsg3 = TRACKED_NEW plAudioSysMsg(plAudioSysMsg::kSetListenerVelocityRef); // plAudioSysMsg* pAudMsg3 = new plAudioSysMsg(plAudioSysMsg::kSetListenerVelocityRef);
// pAudMsg3->SetSceneObject(so->GetKey()); // pAudMsg3->SetSceneObject(so->GetKey());
// plgDispatch::MsgSend(pAudMsg1); // plgDispatch::MsgSend(pAudMsg1);
// plgDispatch::MsgSend(pAudMsg2); // plgDispatch::MsgSend(pAudMsg2);
@ -209,7 +209,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
// plSpawnModMsg* pSpawn = plSpawnModMsg::ConvertNoRef(msg); // plSpawnModMsg* pSpawn = plSpawnModMsg::ConvertNoRef(msg);
// if (pSpawn && HasFlag(kWantsToSpawn)) // if (pSpawn && HasFlag(kWantsToSpawn))
// { // {
// spawnPt* pt = TRACKED_NEW spawnPt; // spawnPt* pt = new spawnPt;
// pt->pt = pSpawn->fPos; // pt->pt = pSpawn->fPos;
// //
// hsVector3 temp(fTarget->GetCoordinateInterface()->GetLocalToWorld().GetTranslate() - pt->pt); // hsVector3 temp(fTarget->GetCoordinateInterface()->GetLocalToWorld().GetTranslate() - pt->pt);
@ -260,7 +260,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
//{ //{
// if (b != bMoving) // if (b != bMoving)
// { // {
// plPlayerMsg* pMsg = TRACKED_NEW plPlayerMsg; // plPlayerMsg* pMsg = new plPlayerMsg;
// //
// if (b) // if (b)
// pMsg->SetCmd( plPlayerMsg::kMovementStarted ); // pMsg->SetCmd( plPlayerMsg::kMovementStarted );
@ -330,7 +330,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
// fSpawnPoints[fSpawnPoints.Count()-1]->pt : fSpawnPoints[netID]->pt; // fSpawnPoints[fSpawnPoints.Count()-1]->pt : fSpawnPoints[netID]->pt;
//#endif //#endif
// // Send msg for net synchronization // // Send msg for net synchronization
// plWarpMsg* warpMsg = TRACKED_NEW plWarpMsg; // plWarpMsg* warpMsg = new plWarpMsg;
// warpMsg->fPos = warpPoint; // warpMsg->fPos = warpPoint;
// warpMsg->AddReceiver( fTarget->GetKey() ); // warpMsg->AddReceiver( fTarget->GetKey() );
// warpMsg->SetWarpFlags(warpMsg->GetWarpFlags() | plWarpMsg::kFlushTransform | plWarpMsg::kZeroVelocity ); // warpMsg->SetWarpFlags(warpMsg->GetWarpFlags() | plWarpMsg::kFlushTransform | plWarpMsg::kZeroVelocity );
@ -350,7 +350,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
// } // }
// else // else
// { // {
// plSpawnRequestMsg* pMsg = TRACKED_NEW plSpawnRequestMsg; // plSpawnRequestMsg* pMsg = new plSpawnRequestMsg;
// pMsg->SetSender(GetKey()); // pMsg->SetSender(GetKey());
// plgDispatch::MsgSend( pMsg ); // plgDispatch::MsgSend( pMsg );
// } // }

2
Sources/Plasma/FeatureLib/pfConditional/plANDConditionalObject.cpp

@ -107,7 +107,7 @@ void plANDConditionalObject::Read(hsStream* stream, hsResMgr* mgr)
fChildren.SetCountAndZero(n); fChildren.SetCountAndZero(n);
for(int i = 0; i < n; i++ ) for(int i = 0; i < n; i++ )
{ {
refMsg = TRACKED_NEW plCondRefMsg(GetKey(), i); refMsg = new plCondRefMsg(GetKey(), i);
mgr->ReadKeyNotifyMe(stream,refMsg, plRefFlags::kActiveRef); mgr->ReadKeyNotifyMe(stream,refMsg, plRefFlags::kActiveRef);
} }
} }

4
Sources/Plasma/FeatureLib/pfConditional/plAnimationEventConditionalObject.cpp

@ -69,11 +69,11 @@ hsBool plAnimationEventConditionalObject::MsgReceive(plMessage* msg)
void plAnimationEventConditionalObject::SetEvent(const CallbackEvent b, float time) void plAnimationEventConditionalObject::SetEvent(const CallbackEvent b, float time)
{ {
plAnimCmdMsg* pMsg = TRACKED_NEW plAnimCmdMsg; plAnimCmdMsg* pMsg = new plAnimCmdMsg;
pMsg->AddReceiver(fTarget); pMsg->AddReceiver(fTarget);
pMsg->SetSender( GetKey() ); pMsg->SetSender( GetKey() );
plEventCallbackMsg* cb = TRACKED_NEW plEventCallbackMsg(GetKey(), b, 0, time); plEventCallbackMsg* cb = new plEventCallbackMsg(GetKey(), b, 0, time);
pMsg->AddCallback( cb ); pMsg->AddCallback( cb );
hsRefCnt_SafeUnRef(cb); hsRefCnt_SafeUnRef(cb);

2
Sources/Plasma/FeatureLib/pfConditional/plORConditionalObject.cpp

@ -112,7 +112,7 @@ void plORConditionalObject::Read(hsStream* stream, hsResMgr* mgr)
fChildren.SetCountAndZero(n); fChildren.SetCountAndZero(n);
for(int i = 0; i < n; i++ ) for(int i = 0; i < n; i++ )
{ {
refMsg = TRACKED_NEW plCondRefMsg(GetKey(), i); refMsg = new plCondRefMsg(GetKey(), i);
mgr->ReadKeyNotifyMe(stream,refMsg, plRefFlags::kActiveRef); mgr->ReadKeyNotifyMe(stream,refMsg, plRefFlags::kActiveRef);
} }
} }

32
Sources/Plasma/FeatureLib/pfConsole/pfAvatarConsoleCommands.cpp

@ -358,14 +358,14 @@ PF_CONSOLE_CMD( Avatar_Multistage, Trigger, "string multiComp", "Triggers the na
if (key) if (key)
{ {
plNotifyMsg *msg = TRACKED_NEW plNotifyMsg; plNotifyMsg *msg = new plNotifyMsg;
msg->fType = plNotifyMsg::kActivator; msg->fType = plNotifyMsg::kActivator;
msg->fState = 1; // Triggered msg->fState = 1; // Triggered
// Setup the event data in case this is a OneShot responder that needs it // Setup the event data in case this is a OneShot responder that needs it
plKey playerKey = plAvatarMgr::GetInstance()->GetLocalAvatar()->GetKey(); plKey playerKey = plAvatarMgr::GetInstance()->GetLocalAvatar()->GetKey();
proPickedEventData *ed = TRACKED_NEW proPickedEventData; proPickedEventData *ed = new proPickedEventData;
ed->fPicker = playerKey; ed->fPicker = playerKey;
ed->fPicked = key; // ??? ed->fPicked = key; // ???
msg->AddEvent(ed); msg->AddEvent(ed);
@ -385,7 +385,7 @@ PF_CONSOLE_CMD( Avatar_Multistage, Advance, "", "Advances the avatar's current m
{ {
plKey avKey = avatar->GetKey(); plKey avKey = avatar->GetKey();
plAvBrainGenericMsg *msg = TRACKED_NEW plAvBrainGenericMsg(nil, avKey, plAvBrainGenericMsg::kNextStage, 0, true, 0.5f); plAvBrainGenericMsg *msg = new plAvBrainGenericMsg(nil, avKey, plAvBrainGenericMsg::kNextStage, 0, true, 0.5f);
msg->Send(); msg->Send();
} }
} }
@ -399,7 +399,7 @@ PF_CONSOLE_CMD( Avatar_Multistage, Regress, "", "Regresses the avatar's current
{ {
plKey avKey = avatar->GetKey(); plKey avKey = avatar->GetKey();
plAvBrainGenericMsg *msg = TRACKED_NEW plAvBrainGenericMsg(nil, avKey, plAvBrainGenericMsg::kPrevStage, 0, true, 0.5f); plAvBrainGenericMsg *msg = new plAvBrainGenericMsg(nil, avKey, plAvBrainGenericMsg::kPrevStage, 0, true, 0.5f);
msg->Send(); msg->Send();
} }
} }
@ -503,7 +503,7 @@ PF_CONSOLE_CMD( Avatar, SeekPoint, "string seekpoint", "Move to the given seekpo
plKey avKey = avatar->GetKey(); plKey avKey = avatar->GetKey();
float unused = 0.0f; float unused = 0.0f;
plAvSeekMsg *msg = TRACKED_NEW plAvSeekMsg(nil, avKey, targetKey, unused, false); plAvSeekMsg *msg = new plAvSeekMsg(nil, avKey, targetKey, unused, false);
plgDispatch::MsgSend(msg); plgDispatch::MsgSend(msg);
} }
@ -525,7 +525,7 @@ PF_CONSOLE_CMD( Avatar,
if (avMod) if (avMod)
{ {
plArmatureEffectStateMsg *msg = TRACKED_NEW plArmatureEffectStateMsg(); plArmatureEffectStateMsg *msg = new plArmatureEffectStateMsg();
msg->AddReceiver(avMod->GetArmatureEffects()->GetKey()); msg->AddReceiver(avMod->GetArmatureEffects()->GetKey());
msg->fSurface = (int)params[0]; msg->fSurface = (int)params[0];
plgDispatch::MsgSend(msg); plgDispatch::MsgSend(msg);
@ -542,7 +542,7 @@ PF_CONSOLE_CMD( Avatar, SetStealthMode, "int mode", "Set the stealth mode of you
int level = mode==plAvatarStealthModeMsg::kStealthVisible ? 0 : 1; int level = mode==plAvatarStealthModeMsg::kStealthVisible ? 0 : 1;
// send msg to make myself invisible locally // send msg to make myself invisible locally
plAvatarStealthModeMsg *msg = TRACKED_NEW plAvatarStealthModeMsg(); plAvatarStealthModeMsg *msg = new plAvatarStealthModeMsg();
msg->SetSender(avKey); msg->SetSender(avKey);
msg->fMode = mode; msg->fMode = mode;
msg->fLevel = level; msg->fLevel = level;
@ -551,7 +551,7 @@ PF_CONSOLE_CMD( Avatar, SetStealthMode, "int mode", "Set the stealth mode of you
// send net msg to other players to synch them up // send net msg to other players to synch them up
// the msg will go to their NetClientMgr who will decide whether they see // the msg will go to their NetClientMgr who will decide whether they see
// our avatar as total or semi-invisible based on the invis level. // our avatar as total or semi-invisible based on the invis level.
plCCRInvisibleMsg *invisMsg = TRACKED_NEW plCCRInvisibleMsg; // ctor sets flags and receiver plCCRInvisibleMsg *invisMsg = new plCCRInvisibleMsg; // ctor sets flags and receiver
invisMsg->fInvisLevel=level; invisMsg->fInvisLevel=level;
invisMsg->fAvKey=avKey; invisMsg->fAvKey=avKey;
invisMsg->Send(); invisMsg->Send();
@ -594,7 +594,7 @@ PF_CONSOLE_CMD( Avatar, FakeLinkToObj, "string objName", "Pseudo-Link the avatar
PrintString("Can't find object with that name, fake link failed."); PrintString("Can't find object with that name, fake link failed.");
return; return;
} }
plPseudoLinkEffectMsg* msg = TRACKED_NEW plPseudoLinkEffectMsg; plPseudoLinkEffectMsg* msg = new plPseudoLinkEffectMsg;
msg->fAvatarKey = plNetClientMgr::GetInstance()->GetLocalPlayerKey(); msg->fAvatarKey = plNetClientMgr::GetInstance()->GetLocalPlayerKey();
msg->fLinkObjKey = seekKey; msg->fLinkObjKey = seekKey;
plgDispatch::MsgSend(msg); plgDispatch::MsgSend(msg);
@ -616,7 +616,7 @@ PF_CONSOLE_CMD( Avatar_Physics, TogglePhysical, "", "Disable/enable physics on t
if(avatar) if(avatar)
{ {
plControlEventMsg* pMsg = TRACKED_NEW plControlEventMsg; plControlEventMsg* pMsg = new plControlEventMsg;
pMsg->SetControlActivated(true); pMsg->SetControlActivated(true);
pMsg->SetControlCode(B_CONTROL_TOGGLE_PHYSICAL); pMsg->SetControlCode(B_CONTROL_TOGGLE_PHYSICAL);
@ -779,7 +779,7 @@ PF_CONSOLE_CMD( Avatar_Climb, Start, "string direction", "Specify initial mount
mode = plAvBrainClimb::kMountingLeft; mode = plAvBrainClimb::kMountingLeft;
else if(stricmp(dirStr, "right") == 0) else if(stricmp(dirStr, "right") == 0)
mode = plAvBrainClimb::kMountingRight; mode = plAvBrainClimb::kMountingRight;
plAvBrainClimb *brain = TRACKED_NEW plAvBrainClimb(mode); plAvBrainClimb *brain = new plAvBrainClimb(mode);
avMod->PushBrain(brain); avMod->PushBrain(brain);
} }
} }
@ -801,7 +801,7 @@ PF_CONSOLE_CMD( Avatar_Climb, EnableDismount, "string direction", "Let the avata
dir = plClimbMsg::kLeft; dir = plClimbMsg::kLeft;
else if(stricmp(dirStr, "right") == 0) else if(stricmp(dirStr, "right") == 0)
dir = plClimbMsg::kRight; dir = plClimbMsg::kRight;
plClimbMsg *msg = TRACKED_NEW plClimbMsg(mgr, avKey, plClimbMsg::kEnableDismount, dir, true); plClimbMsg *msg = new plClimbMsg(mgr, avKey, plClimbMsg::kEnableDismount, dir, true);
msg->Send(); msg->Send();
} }
} }
@ -824,7 +824,7 @@ PF_CONSOLE_CMD( Avatar_Climb, EnableClimb, "string direction, int onOff", "Allow
else if(stricmp(dirStr, "right") == 0) else if(stricmp(dirStr, "right") == 0)
dir = plClimbMsg::kRight; dir = plClimbMsg::kRight;
hsBool enable = static_cast<int>(params[1]) ? true : false; hsBool enable = static_cast<int>(params[1]) ? true : false;
plClimbMsg *msg = TRACKED_NEW plClimbMsg(mgr, avKey, plClimbMsg::kEnableClimb, dir, enable); plClimbMsg *msg = new plClimbMsg(mgr, avKey, plClimbMsg::kEnableClimb, dir, enable);
msg->Send(); msg->Send();
} }
} }
@ -836,7 +836,7 @@ PF_CONSOLE_CMD( Avatar_Climb, Release, "", "")
{ {
plKey mgr = plAvatarMgr::GetInstance()->GetKey(); plKey mgr = plAvatarMgr::GetInstance()->GetKey();
plKey avKey = avMod->GetKey(); plKey avKey = avMod->GetKey();
plClimbMsg *msg = TRACKED_NEW plClimbMsg(mgr, avKey, plClimbMsg::kRelease); plClimbMsg *msg = new plClimbMsg(mgr, avKey, plClimbMsg::kRelease);
msg->Send(); msg->Send();
} }
} }
@ -848,7 +848,7 @@ PF_CONSOLE_CMD( Avatar_Climb, FallOff, "", "")
{ {
plKey mgr = plAvatarMgr::GetInstance()->GetKey(); plKey mgr = plAvatarMgr::GetInstance()->GetKey();
plKey avKey = avMod->GetKey(); plKey avKey = avMod->GetKey();
plClimbMsg *msg = TRACKED_NEW plClimbMsg(mgr, avKey, plClimbMsg::kFallOff); plClimbMsg *msg = new plClimbMsg(mgr, avKey, plClimbMsg::kFallOff);
msg->Send(); msg->Send();
} }
} }
@ -868,7 +868,7 @@ PF_CONSOLE_CMD( Avatar_Swim, Start, "", "")
plArmatureMod *avMod = const_cast<plArmatureMod*>(plAvatarMgr::GetInstance()->GetLocalAvatar()); plArmatureMod *avMod = const_cast<plArmatureMod*>(plAvatarMgr::GetInstance()->GetLocalAvatar());
if(avMod) if(avMod)
{ {
plAvBrainSwim * brayne = TRACKED_NEW plAvBrainSwim(); plAvBrainSwim * brayne = new plAvBrainSwim();
avMod->PushBrain(brayne); avMod->PushBrain(brayne);
} }
} }

8
Sources/Plasma/FeatureLib/pfConsole/pfConsole.cpp

@ -185,7 +185,7 @@ pfConsole::~pfConsole()
{ {
if( fInputInterface != nil ) if( fInputInterface != nil )
{ {
plInputIfaceMgrMsg *msg = TRACKED_NEW plInputIfaceMgrMsg( plInputIfaceMgrMsg::kRemoveInterface ); plInputIfaceMgrMsg *msg = new plInputIfaceMgrMsg( plInputIfaceMgrMsg::kRemoveInterface );
msg->SetIFace( fInputInterface ); msg->SetIFace( fInputInterface );
plgDispatch::MsgSend( msg ); plgDispatch::MsgSend( msg );
@ -218,7 +218,7 @@ pfConsole * pfConsole::GetInstance () {
void pfConsole::Init( pfConsoleEngine *engine ) void pfConsole::Init( pfConsoleEngine *engine )
{ {
fDisplayBuffer = TRACKED_NEW char[ fNumDisplayLines * kMaxCharsWide ]; fDisplayBuffer = new char[ fNumDisplayLines * kMaxCharsWide ];
memset( fDisplayBuffer, 0, fNumDisplayLines * kMaxCharsWide ); memset( fDisplayBuffer, 0, fNumDisplayLines * kMaxCharsWide );
memset( fWorkingLine, 0, sizeof( fWorkingLine ) ); memset( fWorkingLine, 0, sizeof( fWorkingLine ) );
@ -239,8 +239,8 @@ void pfConsole::Init( pfConsoleEngine *engine )
memset( fLastHelpMsg, 0, sizeof( fLastHelpMsg ) ); memset( fLastHelpMsg, 0, sizeof( fLastHelpMsg ) );
fEngine = engine; fEngine = engine;
fInputInterface = TRACKED_NEW pfConsoleInputInterface( this ); fInputInterface = new pfConsoleInputInterface( this );
plInputIfaceMgrMsg *msg = TRACKED_NEW plInputIfaceMgrMsg( plInputIfaceMgrMsg::kAddInterface ); plInputIfaceMgrMsg *msg = new plInputIfaceMgrMsg( plInputIfaceMgrMsg::kAddInterface );
msg->SetIFace( fInputInterface ); msg->SetIFace( fInputInterface );
plgDispatch::MsgSend( msg ); plgDispatch::MsgSend( msg );

200
Sources/Plasma/FeatureLib/pfConsole/pfConsoleCommands.cpp

@ -443,13 +443,13 @@ PF_CONSOLE_BASE_CMD( SampleCmd3, "int, ...", "Sample command #3" )
PF_CONSOLE_BASE_CMD( FadeIn, "float len, bool hold", "Sample command #1" ) PF_CONSOLE_BASE_CMD( FadeIn, "float len, bool hold", "Sample command #1" )
{ {
plTransitionMsg *msg = TRACKED_NEW plTransitionMsg( plTransitionMsg::kFadeIn, (float)params[ 0 ], (bool)params[ 1 ] ); plTransitionMsg *msg = new plTransitionMsg( plTransitionMsg::kFadeIn, (float)params[ 0 ], (bool)params[ 1 ] );
plgDispatch::MsgSend( msg ); plgDispatch::MsgSend( msg );
} }
PF_CONSOLE_BASE_CMD( FadeOut, "float len, bool hold", "Sample command #1" ) PF_CONSOLE_BASE_CMD( FadeOut, "float len, bool hold", "Sample command #1" )
{ {
plTransitionMsg *msg = TRACKED_NEW plTransitionMsg( plTransitionMsg::kFadeOut, (float)params[ 0 ], (bool)params[ 1 ] ); plTransitionMsg *msg = new plTransitionMsg( plTransitionMsg::kFadeOut, (float)params[ 0 ], (bool)params[ 1 ] );
plgDispatch::MsgSend( msg ); plgDispatch::MsgSend( msg );
} }
@ -896,13 +896,13 @@ PF_CONSOLE_CMD( Console, ClearAllVars, "", "Wipes the global console variable co
PF_CONSOLE_CMD( Console, ExecuteFile, "string filename", "Runs the given file as if it were an .ini or .fni file" ) PF_CONSOLE_CMD( Console, ExecuteFile, "string filename", "Runs the given file as if it were an .ini or .fni file" )
{ {
plConsoleMsg *cMsg = TRACKED_NEW plConsoleMsg( plConsoleMsg::kExecuteFile, params[ 0 ] ); plConsoleMsg *cMsg = new plConsoleMsg( plConsoleMsg::kExecuteFile, params[ 0 ] );
cMsg->Send(); cMsg->Send();
} }
PF_CONSOLE_CMD( Console, ExecuteFileDelayed, "string filename, float timeInSecs", "Runs the given file as if it were an .ini or .fni file, but at some given point in the future" ) PF_CONSOLE_CMD( Console, ExecuteFileDelayed, "string filename, float timeInSecs", "Runs the given file as if it were an .ini or .fni file, but at some given point in the future" )
{ {
plConsoleMsg *cMsg = TRACKED_NEW plConsoleMsg( plConsoleMsg::kExecuteFile, params[ 0 ] ); plConsoleMsg *cMsg = new plConsoleMsg( plConsoleMsg::kExecuteFile, params[ 0 ] );
cMsg->SetTimeStamp( hsTimer::GetSysSeconds() + (float)params[ 1 ] ); cMsg->SetTimeStamp( hsTimer::GetSysSeconds() + (float)params[ 1 ] );
cMsg->Send(); cMsg->Send();
} }
@ -1746,10 +1746,10 @@ PF_CONSOLE_CMD( Graphics_Renderer, GenerateReflectMaps, "string baseObject, stri
hsAssert( pfConsole::GetPipeline() != nil, "Cannot use this command before pipeline initialization" ); hsAssert( pfConsole::GetPipeline() != nil, "Cannot use this command before pipeline initialization" );
// First, create the renderTarget for the renderRequests // First, create the renderTarget for the renderRequests
plRenderTarget *target = TRACKED_NEW plRenderTarget( plRenderTarget::kIsProjected | plRenderTarget::kIsTexture, plRenderTarget *target = new plRenderTarget( plRenderTarget::kIsProjected | plRenderTarget::kIsTexture,
params[ 2 ], params[ 2 ], 32, 24, 0 ); params[ 2 ], params[ 2 ], 32, 24, 0 );
// plMipmap *newMip = TRACKED_NEW plMipmap( size, size, plMipmap::kARGB32Config, 1 ); // plMipmap *newMip = new plMipmap( size, size, plMipmap::kARGB32Config, 1 );
c.Set( params[ 0 ], params[ 1 ], params[ 2 ], 1.0f ); c.Set( params[ 0 ], params[ 1 ], params[ 2 ], 1.0f );
@ -1873,7 +1873,7 @@ PF_CONSOLE_CMD( Graphics_Show, Bounds, "", "Toggle object bounds display")
PF_CONSOLE_CMD( Graphics_Show, Sound, "", "Toggle sound fields visible") PF_CONSOLE_CMD( Graphics_Show, Sound, "", "Toggle sound fields visible")
{ {
static hsBool on = false; static hsBool on = false;
plProxyDrawMsg* msg = TRACKED_NEW plProxyDrawMsg(plProxyDrawMsg::kAudible | ((on = !on) ? plProxyDrawMsg::kCreate : plProxyDrawMsg::kDestroy)); plProxyDrawMsg* msg = new plProxyDrawMsg(plProxyDrawMsg::kAudible | ((on = !on) ? plProxyDrawMsg::kCreate : plProxyDrawMsg::kDestroy));
plgDispatch::MsgSend(msg); plgDispatch::MsgSend(msg);
if( on ) if( on )
pfConsole::GetPipeline()->SetDrawableTypeMask(pfConsole::GetPipeline()->GetDrawableTypeMask() | plDrawableSpans::kAudibleProxy); pfConsole::GetPipeline()->SetDrawableTypeMask(pfConsole::GetPipeline()->GetDrawableTypeMask() | plDrawableSpans::kAudibleProxy);
@ -1910,7 +1910,7 @@ PF_CONSOLE_CMD( Graphics_Show, SingleSound,
} }
plKey aiKey = ai->GetKey(); plKey aiKey = ai->GetKey();
plProxyDrawMsg* msg = TRACKED_NEW plProxyDrawMsg( plProxyDrawMsg::kAudible | plProxyDrawMsg::kToggle ); plProxyDrawMsg* msg = new plProxyDrawMsg( plProxyDrawMsg::kAudible | plProxyDrawMsg::kToggle );
msg->SetBCastFlag( plMessage::kBCastByExactType, false ); msg->SetBCastFlag( plMessage::kBCastByExactType, false );
msg->AddReceiver( aiKey ); msg->AddReceiver( aiKey );
plgDispatch::MsgSend( msg ); plgDispatch::MsgSend( msg );
@ -1928,7 +1928,7 @@ PF_CONSOLE_CMD( Graphics_Show, SingleSound,
PF_CONSOLE_CMD( Graphics_Show, SoundOnly, "", "Toggle only sound fields visible") PF_CONSOLE_CMD( Graphics_Show, SoundOnly, "", "Toggle only sound fields visible")
{ {
static hsBool on = false; static hsBool on = false;
plProxyDrawMsg* msg = TRACKED_NEW plProxyDrawMsg(plProxyDrawMsg::kAudible | ((on = !on) ? plProxyDrawMsg::kCreate : plProxyDrawMsg::kDestroy)); plProxyDrawMsg* msg = new plProxyDrawMsg(plProxyDrawMsg::kAudible | ((on = !on) ? plProxyDrawMsg::kCreate : plProxyDrawMsg::kDestroy));
plgDispatch::MsgSend(msg); plgDispatch::MsgSend(msg);
static uint32_t oldMask = plDrawableSpans::kNormal; static uint32_t oldMask = plDrawableSpans::kNormal;
if( on ) if( on )
@ -1982,7 +1982,7 @@ PF_CONSOLE_CMD( Graphics_Show, OccSnapOnly, "", "Take snapshot of current occlus
PF_CONSOLE_CMD( Graphics_Show, Occluders, "", "Toggle occluder geometry visible") PF_CONSOLE_CMD( Graphics_Show, Occluders, "", "Toggle occluder geometry visible")
{ {
static hsBool on = false; static hsBool on = false;
plProxyDrawMsg* msg = TRACKED_NEW plProxyDrawMsg(plProxyDrawMsg::kOccluder | ((on = !on) ? plProxyDrawMsg::kCreate : plProxyDrawMsg::kDestroy)); plProxyDrawMsg* msg = new plProxyDrawMsg(plProxyDrawMsg::kOccluder | ((on = !on) ? plProxyDrawMsg::kCreate : plProxyDrawMsg::kDestroy));
plgDispatch::MsgSend(msg); plgDispatch::MsgSend(msg);
if( on ) if( on )
@ -1998,7 +1998,7 @@ PF_CONSOLE_CMD( Graphics_Show, Occluders, "", "Toggle occluder geometry visible"
PF_CONSOLE_CMD( Graphics_Show, OccludersOnly, "", "Toggle only occluder geometry visible") PF_CONSOLE_CMD( Graphics_Show, OccludersOnly, "", "Toggle only occluder geometry visible")
{ {
static hsBool on = false; static hsBool on = false;
plProxyDrawMsg* msg = TRACKED_NEW plProxyDrawMsg(plProxyDrawMsg::kOccluder | ((on = !on) ? plProxyDrawMsg::kCreate : plProxyDrawMsg::kDestroy)); plProxyDrawMsg* msg = new plProxyDrawMsg(plProxyDrawMsg::kOccluder | ((on = !on) ? plProxyDrawMsg::kCreate : plProxyDrawMsg::kDestroy));
plgDispatch::MsgSend(msg); plgDispatch::MsgSend(msg);
static uint32_t oldMask = plDrawableSpans::kNormal; static uint32_t oldMask = plDrawableSpans::kNormal;
if( on ) if( on )
@ -2018,7 +2018,7 @@ PF_CONSOLE_CMD( Graphics_Show, OccludersOnly, "", "Toggle only occluder geometry
PF_CONSOLE_CMD( Graphics_Show, Physicals, "", "Toggle Physical geometry visible") PF_CONSOLE_CMD( Graphics_Show, Physicals, "", "Toggle Physical geometry visible")
{ {
static hsBool on = false; static hsBool on = false;
plProxyDrawMsg* msg = TRACKED_NEW plProxyDrawMsg(plProxyDrawMsg::kPhysical | ((on = !on) ? plProxyDrawMsg::kCreate : plProxyDrawMsg::kDestroy)); plProxyDrawMsg* msg = new plProxyDrawMsg(plProxyDrawMsg::kPhysical | ((on = !on) ? plProxyDrawMsg::kCreate : plProxyDrawMsg::kDestroy));
plgDispatch::MsgSend(msg); plgDispatch::MsgSend(msg);
if( on ) if( on )
pfConsole::GetPipeline()->SetDrawableTypeMask(pfConsole::GetPipeline()->GetDrawableTypeMask() | plDrawableSpans::kPhysicalProxy); pfConsole::GetPipeline()->SetDrawableTypeMask(pfConsole::GetPipeline()->GetDrawableTypeMask() | plDrawableSpans::kPhysicalProxy);
@ -2033,7 +2033,7 @@ PF_CONSOLE_CMD( Graphics_Show, Physicals, "", "Toggle Physical geometry visible"
PF_CONSOLE_CMD( Graphics_Show, PhysicalsOnly, "", "Toggle only Physical geometry visible") PF_CONSOLE_CMD( Graphics_Show, PhysicalsOnly, "", "Toggle only Physical geometry visible")
{ {
static hsBool on = false; static hsBool on = false;
plProxyDrawMsg* msg = TRACKED_NEW plProxyDrawMsg(plProxyDrawMsg::kPhysical | ((on = !on) ? plProxyDrawMsg::kCreate : plProxyDrawMsg::kDestroy)); plProxyDrawMsg* msg = new plProxyDrawMsg(plProxyDrawMsg::kPhysical | ((on = !on) ? plProxyDrawMsg::kCreate : plProxyDrawMsg::kDestroy));
plgDispatch::MsgSend(msg); plgDispatch::MsgSend(msg);
static uint32_t oldMask = plDrawableSpans::kNormal; static uint32_t oldMask = plDrawableSpans::kNormal;
if( on ) if( on )
@ -2084,7 +2084,7 @@ PF_CONSOLE_CMD( Graphics_Show, NormalOnly, "", "Toggle only normal geometry visi
PF_CONSOLE_CMD( Graphics_Show, Lights, "", "Toggle visible proxies for lights") PF_CONSOLE_CMD( Graphics_Show, Lights, "", "Toggle visible proxies for lights")
{ {
static hsBool on = false; static hsBool on = false;
plProxyDrawMsg* msg = TRACKED_NEW plProxyDrawMsg(plProxyDrawMsg::kLight | ((on = !on) ? plProxyDrawMsg::kCreate : plProxyDrawMsg::kDestroy)); plProxyDrawMsg* msg = new plProxyDrawMsg(plProxyDrawMsg::kLight | ((on = !on) ? plProxyDrawMsg::kCreate : plProxyDrawMsg::kDestroy));
plgDispatch::MsgSend(msg); plgDispatch::MsgSend(msg);
if( on ) if( on )
pfConsole::GetPipeline()->SetDrawableTypeMask(pfConsole::GetPipeline()->GetDrawableTypeMask() | plDrawableSpans::kLightProxy); pfConsole::GetPipeline()->SetDrawableTypeMask(pfConsole::GetPipeline()->GetDrawableTypeMask() | plDrawableSpans::kLightProxy);
@ -2099,7 +2099,7 @@ PF_CONSOLE_CMD( Graphics_Show, Lights, "", "Toggle visible proxies for lights")
PF_CONSOLE_CMD( Graphics_Show, LightsOnly, "", "Toggle visible proxies for lights and everything else invisible") PF_CONSOLE_CMD( Graphics_Show, LightsOnly, "", "Toggle visible proxies for lights and everything else invisible")
{ {
static hsBool on = false; static hsBool on = false;
plProxyDrawMsg* msg = TRACKED_NEW plProxyDrawMsg(plProxyDrawMsg::kLight | ((on = !on) ? plProxyDrawMsg::kCreate : plProxyDrawMsg::kDestroy)); plProxyDrawMsg* msg = new plProxyDrawMsg(plProxyDrawMsg::kLight | ((on = !on) ? plProxyDrawMsg::kCreate : plProxyDrawMsg::kDestroy));
plgDispatch::MsgSend(msg); plgDispatch::MsgSend(msg);
static uint32_t oldMask = plDrawableSpans::kNormal; static uint32_t oldMask = plDrawableSpans::kNormal;
if( on ) if( on )
@ -2119,7 +2119,7 @@ PF_CONSOLE_CMD( Graphics_Show, LightsOnly, "", "Toggle visible proxies for light
PF_CONSOLE_CMD( Graphics_Show, Clicks, "", "Toggle visible proxies for clicks") PF_CONSOLE_CMD( Graphics_Show, Clicks, "", "Toggle visible proxies for clicks")
{ {
static hsBool on = false; static hsBool on = false;
plProxyDrawMsg* msg = TRACKED_NEW plProxyDrawMsg(plProxyDrawMsg::kCamera | ((on = !on) ? plProxyDrawMsg::kCreate : plProxyDrawMsg::kDestroy)); plProxyDrawMsg* msg = new plProxyDrawMsg(plProxyDrawMsg::kCamera | ((on = !on) ? plProxyDrawMsg::kCreate : plProxyDrawMsg::kDestroy));
plgDispatch::MsgSend(msg); plgDispatch::MsgSend(msg);
if( on ) if( on )
pfConsole::GetPipeline()->SetDrawableTypeMask(pfConsole::GetPipeline()->GetDrawableTypeMask() | plDrawableSpans::kCameraProxy); pfConsole::GetPipeline()->SetDrawableTypeMask(pfConsole::GetPipeline()->GetDrawableTypeMask() | plDrawableSpans::kCameraProxy);
@ -2135,7 +2135,7 @@ PF_CONSOLE_CMD( Graphics_Show, Clicks, "", "Toggle visible proxies for clicks")
PF_CONSOLE_CMD( Graphics_Show, ClickOnly, "", "Toggle visible proxies for click points") PF_CONSOLE_CMD( Graphics_Show, ClickOnly, "", "Toggle visible proxies for click points")
{ {
static hsBool on = false; static hsBool on = false;
plProxyDrawMsg* msg = TRACKED_NEW plProxyDrawMsg(plProxyDrawMsg::kCamera | ((on = !on) ? plProxyDrawMsg::kCreate : plProxyDrawMsg::kDestroy)); plProxyDrawMsg* msg = new plProxyDrawMsg(plProxyDrawMsg::kCamera | ((on = !on) ? plProxyDrawMsg::kCreate : plProxyDrawMsg::kDestroy));
plgDispatch::MsgSend(msg); plgDispatch::MsgSend(msg);
static uint32_t oldMask = plDrawableSpans::kNormal; static uint32_t oldMask = plDrawableSpans::kNormal;
if( on ) if( on )
@ -2252,7 +2252,7 @@ PF_CONSOLE_CMD( App,
return; return;
} }
plAnimCmdMsg* cmd = TRACKED_NEW plAnimCmdMsg; plAnimCmdMsg* cmd = new plAnimCmdMsg;
cmd->SetSender(plClient::GetInstance()->GetKey()); cmd->SetSender(plClient::GetInstance()->GetKey());
cmd->SetCmd(plAnimCmdMsg::kAddCallbacks); cmd->SetCmd(plAnimCmdMsg::kAddCallbacks);
#if 1 #if 1
@ -2288,7 +2288,7 @@ PF_CONSOLE_CMD( App,
} }
reps--; reps--;
plEventCallbackMsg* callback = TRACKED_NEW plEventCallbackMsg(plClient::GetInstance()->GetKey(), event, 0, secs, reps); plEventCallbackMsg* callback = new plEventCallbackMsg(plClient::GetInstance()->GetKey(), event, 0, secs, reps);
cmd->AddCallback(callback); cmd->AddCallback(callback);
hsRefCnt_SafeUnRef(callback); hsRefCnt_SafeUnRef(callback);
plgDispatch::MsgSend(cmd); plgDispatch::MsgSend(cmd);
@ -2312,7 +2312,7 @@ PF_CONSOLE_CMD( App,
PrintString(str); PrintString(str);
plSoundMsg* cmd = TRACKED_NEW plSoundMsg; plSoundMsg* cmd = new plSoundMsg;
cmd->SetSender(plClient::GetInstance()->GetKey()); cmd->SetSender(plClient::GetInstance()->GetKey());
cmd->SetCmd(plSoundMsg::kAddCallbacks); cmd->SetCmd(plSoundMsg::kAddCallbacks);
cmd->AddReceiver(key); cmd->AddReceiver(key);
@ -2343,7 +2343,7 @@ PF_CONSOLE_CMD( App,
} }
reps--; reps--;
plEventCallbackMsg* callback = TRACKED_NEW plEventCallbackMsg(plClient::GetInstance()->GetKey(), event, 0, secs, reps); plEventCallbackMsg* callback = new plEventCallbackMsg(plClient::GetInstance()->GetKey(), event, 0, secs, reps);
cmd->AddCallback(callback); cmd->AddCallback(callback);
hsRefCnt_SafeUnRef(callback); hsRefCnt_SafeUnRef(callback);
plgDispatch::MsgSend(cmd); plgDispatch::MsgSend(cmd);
@ -2385,7 +2385,7 @@ PF_CONSOLE_CMD( App,
} }
strcpy(str, name); strcpy(str, name);
plAnimCmdMsg* cmd = TRACKED_NEW plAnimCmdMsg(nil, obj->GetModifier(i)->GetKey(), nil); plAnimCmdMsg* cmd = new plAnimCmdMsg(nil, obj->GetModifier(i)->GetKey(), nil);
if( numParams > 1 ) if( numParams > 1 )
{ {
@ -3001,7 +3001,7 @@ PF_CONSOLE_CMD( Camera, SwitchTo, "string cameraName", "Switch to the named came
if (key) if (key)
{ {
plCameraMsg* pMsg = TRACKED_NEW plCameraMsg; plCameraMsg* pMsg = new plCameraMsg;
pMsg->SetCmd(plCameraMsg::kResponderTrigger); pMsg->SetCmd(plCameraMsg::kResponderTrigger);
pMsg->SetCmd(plCameraMsg::kRegionPushCamera); pMsg->SetCmd(plCameraMsg::kRegionPushCamera);
pMsg->SetNewCam(key); pMsg->SetNewCam(key);
@ -3160,7 +3160,7 @@ PF_CONSOLE_CMD(Logic, EnableDetector, "string detectorComp, bool enable", "Enabl
plLogicModBase *mod = FindLogicMod((const char*)params[0]); plLogicModBase *mod = FindLogicMod((const char*)params[0]);
if (mod) if (mod)
{ {
plEnableMsg* enableMsg = TRACKED_NEW plEnableMsg; plEnableMsg* enableMsg = new plEnableMsg;
enableMsg->SetCmd(params[1] ? plEnableMsg::kEnable : plEnableMsg::kDisable); enableMsg->SetCmd(params[1] ? plEnableMsg::kEnable : plEnableMsg::kDisable);
enableMsg->SetCmd(plEnableMsg::kAll); enableMsg->SetCmd(plEnableMsg::kAll);
enableMsg->Send(mod->GetKey()); enableMsg->Send(mod->GetKey());
@ -3169,7 +3169,7 @@ PF_CONSOLE_CMD(Logic, EnableDetector, "string detectorComp, bool enable", "Enabl
static void ResponderSendTrigger(plKey responderKey, int responderState, bool fastForward = false) static void ResponderSendTrigger(plKey responderKey, int responderState, bool fastForward = false)
{ {
plNotifyMsg *msg = TRACKED_NEW plNotifyMsg; plNotifyMsg *msg = new plNotifyMsg;
if (fastForward) if (fastForward)
{ {
@ -3579,7 +3579,7 @@ PF_CONSOLE_CMD( Audio, SetVolume,
const plAudioInterface *ai = obj->GetAudioInterface(); const plAudioInterface *ai = obj->GetAudioInterface();
plKey aiKey = ai->GetKey(); plKey aiKey = ai->GetKey();
plSoundMsg* cmd = TRACKED_NEW plSoundMsg; plSoundMsg* cmd = new plSoundMsg;
cmd->SetSender( plClient::GetInstance()->GetKey() ); cmd->SetSender( plClient::GetInstance()->GetKey() );
cmd->SetCmd( plSoundMsg::kSetVolume ); cmd->SetCmd( plSoundMsg::kSetVolume );
cmd->fVolume = params[ 1 ]; cmd->fVolume = params[ 1 ];
@ -3621,10 +3621,10 @@ PF_CONSOLE_CMD( Audio, IsolateSound,
return; return;
} }
asMsg = TRACKED_NEW plAudioSysMsg( plAudioSysMsg::kMuteAll ); asMsg = new plAudioSysMsg( plAudioSysMsg::kMuteAll );
plgDispatch::MsgSend( asMsg ); plgDispatch::MsgSend( asMsg );
asMsg = TRACKED_NEW plAudioSysMsg( plAudioSysMsg::kUnmuteAll ); asMsg = new plAudioSysMsg( plAudioSysMsg::kUnmuteAll );
asMsg->AddReceiver( ai->GetKey() ); asMsg->AddReceiver( ai->GetKey() );
asMsg->SetBCastFlag( plMessage::kBCastByExactType, false ); asMsg->SetBCastFlag( plMessage::kBCastByExactType, false );
plgDispatch::MsgSend( asMsg ); plgDispatch::MsgSend( asMsg );
@ -3702,19 +3702,19 @@ PF_CONSOLE_CMD( Listener, ShowDebugInfo, "bool show", "Shows or hides debugging
PF_CONSOLE_CMD( Listener, UseCameraOrientation, "", "Use the camera's orientation to orient the listener") PF_CONSOLE_CMD( Listener, UseCameraOrientation, "", "Use the camera's orientation to orient the listener")
{ {
plSetListenerMsg *set = TRACKED_NEW plSetListenerMsg( plSetListenerMsg::kVCam | plSetListenerMsg::kFacing, nil, true ); plSetListenerMsg *set = new plSetListenerMsg( plSetListenerMsg::kVCam | plSetListenerMsg::kFacing, nil, true );
set->Send(); set->Send();
} }
PF_CONSOLE_CMD( Listener, UseCameraPosition, "", "Use the canera's position to position the listener") PF_CONSOLE_CMD( Listener, UseCameraPosition, "", "Use the canera's position to position the listener")
{ {
plSetListenerMsg *set = TRACKED_NEW plSetListenerMsg( plSetListenerMsg::kVCam | plSetListenerMsg::kPosition, nil, true ); plSetListenerMsg *set = new plSetListenerMsg( plSetListenerMsg::kVCam | plSetListenerMsg::kPosition, nil, true );
set->Send(); set->Send();
} }
PF_CONSOLE_CMD( Listener, UseCameraVelocity, "", "Use the camera's velocity to set the listener velocity") PF_CONSOLE_CMD( Listener, UseCameraVelocity, "", "Use the camera's velocity to set the listener velocity")
{ {
plSetListenerMsg *set = TRACKED_NEW plSetListenerMsg( plSetListenerMsg::kVCam | plSetListenerMsg::kVelocity, nil, true ); plSetListenerMsg *set = new plSetListenerMsg( plSetListenerMsg::kVCam | plSetListenerMsg::kVelocity, nil, true );
set->Send(); set->Send();
} }
@ -3723,7 +3723,7 @@ PF_CONSOLE_CMD( Listener, UsePlayerOrientation, "", "Use the player's orientatio
plKey pKey = plNetClientMgr::GetInstance()->GetLocalPlayerKey(); plKey pKey = plNetClientMgr::GetInstance()->GetLocalPlayerKey();
if( pKey ) if( pKey )
{ {
plSetListenerMsg *set = TRACKED_NEW plSetListenerMsg( plSetListenerMsg::kFacing, pKey, true ); plSetListenerMsg *set = new plSetListenerMsg( plSetListenerMsg::kFacing, pKey, true );
set->Send(); set->Send();
} }
} }
@ -3732,7 +3732,7 @@ PF_CONSOLE_CMD( Listener, UsePlayerPosition, "", "Use the player's position to p
plKey pKey = plNetClientMgr::GetInstance()->GetLocalPlayerKey(); plKey pKey = plNetClientMgr::GetInstance()->GetLocalPlayerKey();
if (pKey) if (pKey)
{ {
plSetListenerMsg *set = TRACKED_NEW plSetListenerMsg( plSetListenerMsg::kPosition, pKey, true ); plSetListenerMsg *set = new plSetListenerMsg( plSetListenerMsg::kPosition, pKey, true );
set->Send(); set->Send();
} }
} }
@ -3742,7 +3742,7 @@ PF_CONSOLE_CMD( Listener, UsePlayerVelocity, "", "Use the player's velocity to s
plKey pKey = plNetClientMgr::GetInstance()->GetLocalPlayerKey(); plKey pKey = plNetClientMgr::GetInstance()->GetLocalPlayerKey();
if (pKey) if (pKey)
{ {
plSetListenerMsg *set = TRACKED_NEW plSetListenerMsg( plSetListenerMsg::kVelocity, pKey, true ); plSetListenerMsg *set = new plSetListenerMsg( plSetListenerMsg::kVelocity, pKey, true );
set->Send(); set->Send();
} }
} }
@ -3775,13 +3775,13 @@ PF_CONSOLE_CMD( Listener, XMode, "bool b", "Sets velocity and position to avatar
plStatusLog::AddLineS("audio.log", "XMode on"); plStatusLog::AddLineS("audio.log", "XMode on");
plSetListenerMsg *set = TRACKED_NEW plSetListenerMsg( plSetListenerMsg::kVCam | plSetListenerMsg::kFacing, nil, true ); plSetListenerMsg *set = new plSetListenerMsg( plSetListenerMsg::kVCam | plSetListenerMsg::kFacing, nil, true );
set->Send(); set->Send();
if (pKey) if (pKey)
{ {
set = TRACKED_NEW plSetListenerMsg( plSetListenerMsg::kVelocity, pKey, true ); set = new plSetListenerMsg( plSetListenerMsg::kVelocity, pKey, true );
set->Send(); set->Send();
set = TRACKED_NEW plSetListenerMsg( plSetListenerMsg::kPosition, pKey, true ); set = new plSetListenerMsg( plSetListenerMsg::kPosition, pKey, true );
set->Send(); set->Send();
} }
} }
@ -3789,32 +3789,32 @@ PF_CONSOLE_CMD( Listener, XMode, "bool b", "Sets velocity and position to avatar
{ {
if(oldPosType == plListener::kCamera) if(oldPosType == plListener::kCamera)
{ {
plSetListenerMsg *set = TRACKED_NEW plSetListenerMsg( plSetListenerMsg::kVCam | plSetListenerMsg::kPosition, nil, true ); plSetListenerMsg *set = new plSetListenerMsg( plSetListenerMsg::kVCam | plSetListenerMsg::kPosition, nil, true );
set->Send(); set->Send();
} }
else else
{ {
set = TRACKED_NEW plSetListenerMsg( plSetListenerMsg::kPosition, pKey, true ); set = new plSetListenerMsg( plSetListenerMsg::kPosition, pKey, true );
set->Send(); set->Send();
} }
if(oldFacingType == plListener::kCamera) if(oldFacingType == plListener::kCamera)
{ {
set = TRACKED_NEW plSetListenerMsg( plSetListenerMsg::kVCam | plSetListenerMsg::kFacing, nil, true ); set = new plSetListenerMsg( plSetListenerMsg::kVCam | plSetListenerMsg::kFacing, nil, true );
set->Send(); set->Send();
} }
else else
{ {
set = TRACKED_NEW plSetListenerMsg( plSetListenerMsg::kFacing, pKey, true ); set = new plSetListenerMsg( plSetListenerMsg::kFacing, pKey, true );
set->Send(); set->Send();
} }
if(oldVelType == plListener::kCamera) if(oldVelType == plListener::kCamera)
{ {
set = TRACKED_NEW plSetListenerMsg( plSetListenerMsg::kVCam | plSetListenerMsg::kVelocity, nil, true ); set = new plSetListenerMsg( plSetListenerMsg::kVCam | plSetListenerMsg::kVelocity, nil, true );
set->Send(); set->Send();
} }
else else
{ {
set = TRACKED_NEW plSetListenerMsg( plSetListenerMsg::kVelocity, pKey, true ); set = new plSetListenerMsg( plSetListenerMsg::kVelocity, pKey, true );
set->Send(); set->Send();
} }
plStatusLog::AddLineS("audio.log", "%s, %d, %d, %d", "XMode off", oldPosType, oldFacingType, oldVelType); plStatusLog::AddLineS("audio.log", "%s, %d, %d, %d", "XMode off", oldPosType, oldFacingType, oldVelType);
@ -3841,7 +3841,7 @@ PF_CONSOLE_CMD( DInput, UseDInput, "bool on", "Turns off DirectInput")
PF_CONSOLE_CMD( DInput, Config, "", "Launch DInput configuration screen") PF_CONSOLE_CMD( DInput, Config, "", "Launch DInput configuration screen")
{ {
plgAudioSys::Activate(false); plgAudioSys::Activate(false);
plInputEventMsg* pMsg = TRACKED_NEW plInputEventMsg; plInputEventMsg* pMsg = new plInputEventMsg;
pMsg->fEvent = plInputEventMsg::kConfigure; pMsg->fEvent = plInputEventMsg::kConfigure;
pMsg->AddReceiver( plInputManager::GetInstance()->GetKey() ); pMsg->AddReceiver( plInputManager::GetInstance()->GetKey() );
pMsg->SetBCastFlag(plMessage::kBCastByType, false); pMsg->SetBCastFlag(plMessage::kBCastByType, false);
@ -3972,7 +3972,7 @@ PF_CONSOLE_CMD( Nav, PageInNode, // Group name, Function name
"Pages in a scene node." ) // Help string "Pages in a scene node." ) // Help string
{ {
plSynchEnabler ps(false); // disable dirty tracking while paging in plSynchEnabler ps(false); // disable dirty tracking while paging in
plClientMsg* pMsg1 = TRACKED_NEW plClientMsg(plClientMsg::kLoadRoom); plClientMsg* pMsg1 = new plClientMsg(plClientMsg::kLoadRoom);
pMsg1->AddReceiver( plClient::GetInstance()->GetKey() ); pMsg1->AddReceiver( plClient::GetInstance()->GetKey() );
pMsg1->AddRoomLoc(plKeyFinder::Instance().FindLocation(nil, params[0])); pMsg1->AddRoomLoc(plKeyFinder::Instance().FindLocation(nil, params[0]));
plgDispatch::MsgSend(pMsg1); plgDispatch::MsgSend(pMsg1);
@ -3990,7 +3990,7 @@ PF_CONSOLE_CMD( Nav, PageInNodeList, // Group name, Function name
pageInNodesStr += "*.prx"; pageInNodesStr += "*.prx";
hsFolderIterator pageInNodesIter(pageInNodesStr.data(), true); hsFolderIterator pageInNodesIter(pageInNodesStr.data(), true);
plClientMsg* pMsg1 = TRACKED_NEW plClientMsg(plClientMsg::kLoadRoom); plClientMsg* pMsg1 = new plClientMsg(plClientMsg::kLoadRoom);
while (pageInNodesIter.NextFile()) while (pageInNodesIter.NextFile())
{ {
char nodeName[255]; char nodeName[255];
@ -4009,7 +4009,7 @@ PF_CONSOLE_CMD( Nav, PageOutNode, // Group name, Function name
"pages out a scene node." ) // Help string "pages out a scene node." ) // Help string
{ {
plSynchEnabler ps(false); // disable dirty tracking while paging out plSynchEnabler ps(false); // disable dirty tracking while paging out
plClientMsg* pMsg1 = TRACKED_NEW plClientMsg(plClientMsg::kUnloadRoom); plClientMsg* pMsg1 = new plClientMsg(plClientMsg::kUnloadRoom);
pMsg1->AddReceiver( plClient::GetInstance()->GetKey() ); pMsg1->AddReceiver( plClient::GetInstance()->GetKey() );
pMsg1->AddRoomLoc(plKeyFinder::Instance().FindLocation(nil, params[0])); pMsg1->AddRoomLoc(plKeyFinder::Instance().FindLocation(nil, params[0]));
plgDispatch::MsgSend(pMsg1); plgDispatch::MsgSend(pMsg1);
@ -4048,7 +4048,7 @@ PF_CONSOLE_CMD( Nav, MovePlayer, // Group name, Function name
if( !nodeKey ) if( !nodeKey )
return; return;
plNodeChangeMsg* msg = TRACKED_NEW plNodeChangeMsg(nil, playerKey, nodeKey); plNodeChangeMsg* msg = new plNodeChangeMsg(nil, playerKey, nodeKey);
plgDispatch::MsgSend(msg); plgDispatch::MsgSend(msg);
sprintf(str, "%s moved to %s", (char*)params[0], (char*)params[1]); sprintf(str, "%s moved to %s", (char*)params[0], (char*)params[1]);
PrintString(str); PrintString(str);
@ -4083,11 +4083,11 @@ PF_CONSOLE_CMD( Movie,
"Start of movie with this filename" ) "Start of movie with this filename" )
{ {
char* filename = params[0]; char* filename = params[0];
plMovieMsg* mov = TRACKED_NEW plMovieMsg(filename, plMovieMsg::kStart); plMovieMsg* mov = new plMovieMsg(filename, plMovieMsg::kStart);
//#define MF_TEST_MOVIECALLBACKS //#define MF_TEST_MOVIECALLBACKS
#ifdef MF_TEST_MOVIECALLBACKS #ifdef MF_TEST_MOVIECALLBACKS
plMovieMsg* cb = TRACKED_NEW plMovieMsg("avi/intro0.bik", plMovieMsg::kStart); plMovieMsg* cb = new plMovieMsg("avi/intro0.bik", plMovieMsg::kStart);
mov->AddCallback(cb); mov->AddCallback(cb);
mov->SetCmd(mov->GetCmd() | plMovieMsg::kAddCallbacks); mov->SetCmd(mov->GetCmd() | plMovieMsg::kAddCallbacks);
#endif // MF_TEST_MOVIECALLBACKS #endif // MF_TEST_MOVIECALLBACKS
@ -4103,7 +4103,7 @@ PF_CONSOLE_CMD( Movie,
"Stop movie with this filename" ) "Stop movie with this filename" )
{ {
char* filename = params[0]; char* filename = params[0];
plMovieMsg* mov = TRACKED_NEW plMovieMsg(filename, plMovieMsg::kStop); plMovieMsg* mov = new plMovieMsg(filename, plMovieMsg::kStop);
mov->Send(); mov->Send();
PrintStringF(PrintString, "%s now stopping", filename); PrintStringF(PrintString, "%s now stopping", filename);
@ -4115,7 +4115,7 @@ PF_CONSOLE_CMD( Movie,
"Pause movie with this filename" ) "Pause movie with this filename" )
{ {
char* filename = params[0]; char* filename = params[0];
plMovieMsg* mov = TRACKED_NEW plMovieMsg(filename, plMovieMsg::kPause); plMovieMsg* mov = new plMovieMsg(filename, plMovieMsg::kPause);
mov->Send(); mov->Send();
PrintStringF(PrintString, "%s now pausing", filename); PrintStringF(PrintString, "%s now pausing", filename);
@ -4127,7 +4127,7 @@ PF_CONSOLE_CMD( Movie,
"Resume movie with this filename" ) "Resume movie with this filename" )
{ {
char* filename = params[0]; char* filename = params[0];
plMovieMsg* mov = TRACKED_NEW plMovieMsg(filename, plMovieMsg::kResume); plMovieMsg* mov = new plMovieMsg(filename, plMovieMsg::kResume);
mov->Send(); mov->Send();
PrintStringF(PrintString, "%s now resuming", filename); PrintStringF(PrintString, "%s now resuming", filename);
@ -4139,7 +4139,7 @@ PF_CONSOLE_CMD( Movie,
"Move center of movie with this filename to x,y" ) "Move center of movie with this filename to x,y" )
{ {
char* filename = params[0]; char* filename = params[0];
plMovieMsg* mov = TRACKED_NEW plMovieMsg(filename, plMovieMsg::kMove); plMovieMsg* mov = new plMovieMsg(filename, plMovieMsg::kMove);
float x = params[1]; float x = params[1];
float y = params[2]; float y = params[2];
mov->SetCenter(x, y); mov->SetCenter(x, y);
@ -4154,7 +4154,7 @@ PF_CONSOLE_CMD( Movie,
"Scale movie with this filename by x,y" ) "Scale movie with this filename by x,y" )
{ {
char* filename = params[0]; char* filename = params[0];
plMovieMsg* mov = TRACKED_NEW plMovieMsg(filename, plMovieMsg::kScale); plMovieMsg* mov = new plMovieMsg(filename, plMovieMsg::kScale);
float x = params[1]; float x = params[1];
float y = params[2]; float y = params[2];
mov->SetScale(x, y); mov->SetScale(x, y);
@ -4169,7 +4169,7 @@ PF_CONSOLE_CMD( Movie,
"Set opacity of movie with this filename to a" ) "Set opacity of movie with this filename to a" )
{ {
char* filename = params[0]; char* filename = params[0];
plMovieMsg* mov = TRACKED_NEW plMovieMsg(filename, plMovieMsg::kOpacity); plMovieMsg* mov = new plMovieMsg(filename, plMovieMsg::kOpacity);
float a = params[1]; float a = params[1];
mov->SetOpacity(a); mov->SetOpacity(a);
mov->Send(); mov->Send();
@ -4183,7 +4183,7 @@ PF_CONSOLE_CMD( Movie,
"Color movie with this filename as r,g,b" ) "Color movie with this filename as r,g,b" )
{ {
char* filename = params[0]; char* filename = params[0];
plMovieMsg* mov = TRACKED_NEW plMovieMsg(filename, plMovieMsg::kColor); plMovieMsg* mov = new plMovieMsg(filename, plMovieMsg::kColor);
float r = params[1]; float r = params[1];
float g = params[2]; float g = params[2];
float b = params[3]; float b = params[3];
@ -4199,7 +4199,7 @@ PF_CONSOLE_CMD( Movie,
"Set volume of movie with this filename to v" ) "Set volume of movie with this filename to v" )
{ {
char* filename = params[0]; char* filename = params[0];
plMovieMsg* mov = TRACKED_NEW plMovieMsg(filename, plMovieMsg::kVolume); plMovieMsg* mov = new plMovieMsg(filename, plMovieMsg::kVolume);
float v = params[1]; float v = params[1];
mov->SetVolume(v); mov->SetVolume(v);
mov->Send(); mov->Send();
@ -4213,7 +4213,7 @@ PF_CONSOLE_CMD( Movie,
"Fade in movie with this filename from r,g,b,a over secs seconds" ) "Fade in movie with this filename from r,g,b,a over secs seconds" )
{ {
char* filename = params[0]; char* filename = params[0];
plMovieMsg* mov = TRACKED_NEW plMovieMsg(filename, plMovieMsg::kFadeIn); plMovieMsg* mov = new plMovieMsg(filename, plMovieMsg::kFadeIn);
float secs = params[1]; float secs = params[1];
float r = params[2]; float r = params[2];
float g = params[3]; float g = params[3];
@ -4232,7 +4232,7 @@ PF_CONSOLE_CMD( Movie,
"Fade out movie with this filename to r,g,b,a over secs seconds" ) "Fade out movie with this filename to r,g,b,a over secs seconds" )
{ {
char* filename = params[0]; char* filename = params[0];
plMovieMsg* mov = TRACKED_NEW plMovieMsg(filename, plMovieMsg::kFadeOut); plMovieMsg* mov = new plMovieMsg(filename, plMovieMsg::kFadeOut);
float secs = params[1]; float secs = params[1];
float r = params[2]; float r = params[2];
float g = params[3]; float g = params[3];
@ -4635,13 +4635,13 @@ PF_CONSOLE_CMD( Access,
float fadeUp = params[1]; float fadeUp = params[1];
float fadeDown = params[2]; float fadeDown = params[2];
plFadeOpacityMod* mod = TRACKED_NEW plFadeOpacityMod; plFadeOpacityMod* mod = new plFadeOpacityMod;
mod->SetFadeUp(fadeUp); mod->SetFadeUp(fadeUp);
mod->SetFadeDown(fadeDown); mod->SetFadeDown(fadeDown);
hsgResMgr::ResMgr()->NewKey(obj->GetKey()->GetName(), mod, obj->GetKey()->GetUoid().GetLocation()); hsgResMgr::ResMgr()->NewKey(obj->GetKey()->GetName(), mod, obj->GetKey()->GetUoid().GetLocation());
hsgResMgr::ResMgr()->AddViaNotify(mod->GetKey(), TRACKED_NEW plObjRefMsg(obj->GetKey(), plRefMsg::kOnCreate, -1, plObjRefMsg::kModifier), plRefFlags::kActiveRef); hsgResMgr::ResMgr()->AddViaNotify(mod->GetKey(), new plObjRefMsg(obj->GetKey(), plRefMsg::kOnCreate, -1, plObjRefMsg::kModifier), plRefFlags::kActiveRef);
} }
@ -4782,7 +4782,7 @@ PF_CONSOLE_CMD( Access,
float range = gunRange; float range = gunRange;
plBulletMsg* bull = TRACKED_NEW plBulletMsg(nil, nil, nil); plBulletMsg* bull = new plBulletMsg(nil, nil, nil);
bull->FireShot(pos, dir, radius, range); bull->FireShot(pos, dir, radius, range);
bull->Send(); bull->Send();
@ -4811,7 +4811,7 @@ PF_CONSOLE_CMD( Access,
float range = gunRange; float range = gunRange;
plBulletMsg* bull = TRACKED_NEW plBulletMsg(nil, nil, nil); plBulletMsg* bull = new plBulletMsg(nil, nil, nil);
bull->FireShot(pos, dir, radius, range); bull->FireShot(pos, dir, radius, range);
bull->Send(); bull->Send();
@ -4839,7 +4839,7 @@ PF_CONSOLE_CMD( Access,
PrintString("Psys not found"); PrintString("Psys not found");
return; return;
} }
hsgResMgr::ResMgr()->AddViaNotify(sysKey, TRACKED_NEW plGenRefMsg(bullKey, plRefMsg::kOnCreate, 0, plDynaBulletMgr::kRefPartyObject), plRefFlags::kPassiveRef); hsgResMgr::ResMgr()->AddViaNotify(sysKey, new plGenRefMsg(bullKey, plRefMsg::kOnCreate, 0, plDynaBulletMgr::kRefPartyObject), plRefFlags::kPassiveRef);
PrintString("sys added"); PrintString("sys added");
} }
@ -5521,7 +5521,7 @@ PF_CONSOLE_CMD( SceneObject_SetEnable, Drawable, // Group name, Function name
bool enable = params[1]; bool enable = params[1];
plEnableMsg* pEMsg = TRACKED_NEW plEnableMsg; plEnableMsg* pEMsg = new plEnableMsg;
pEMsg->SetCmd( enable ? plEnableMsg::kEnable : plEnableMsg::kDisable ); pEMsg->SetCmd( enable ? plEnableMsg::kEnable : plEnableMsg::kDisable );
pEMsg->SetCmd( plEnableMsg::kDrawable ); pEMsg->SetCmd( plEnableMsg::kDrawable );
pEMsg->AddReceiver( key ); pEMsg->AddReceiver( key );
@ -5540,7 +5540,7 @@ PF_CONSOLE_CMD( SceneObject_SetEnable, Physical, // Group name, Function name
bool enable = params[1]; bool enable = params[1];
plEnableMsg* pEMsg = TRACKED_NEW plEnableMsg; plEnableMsg* pEMsg = new plEnableMsg;
pEMsg->SetCmd( enable ? plEnableMsg::kEnable : plEnableMsg::kDisable ); pEMsg->SetCmd( enable ? plEnableMsg::kEnable : plEnableMsg::kDisable );
pEMsg->SetCmd( plEnableMsg::kPhysical ); pEMsg->SetCmd( plEnableMsg::kPhysical );
pEMsg->AddReceiver( key ); pEMsg->AddReceiver( key );
@ -5559,7 +5559,7 @@ PF_CONSOLE_CMD( SceneObject_SetEnable, PhysicalT, // Group name, Function name
bool enable = params[1]; bool enable = params[1];
plEventGroupEnableMsg* pMsg = TRACKED_NEW plEventGroupEnableMsg; plEventGroupEnableMsg* pMsg = new plEventGroupEnableMsg;
if( enable ) if( enable )
pMsg->SetFlags(plEventGroupEnableMsg::kCollideOn | plEventGroupEnableMsg::kReportOn); pMsg->SetFlags(plEventGroupEnableMsg::kCollideOn | plEventGroupEnableMsg::kReportOn);
else else
@ -5582,7 +5582,7 @@ PF_CONSOLE_CMD( SceneObject_SetEnable, Audible, // Group name, Function name
bool enable = params[1]; bool enable = params[1];
plEnableMsg* pEMsg = TRACKED_NEW plEnableMsg; plEnableMsg* pEMsg = new plEnableMsg;
pEMsg->SetCmd( enable ? plEnableMsg::kEnable : plEnableMsg::kDisable ); pEMsg->SetCmd( enable ? plEnableMsg::kEnable : plEnableMsg::kDisable );
pEMsg->SetCmd( plEnableMsg::kAudible ); pEMsg->SetCmd( plEnableMsg::kAudible );
pEMsg->AddReceiver( key ); pEMsg->AddReceiver( key );
@ -5601,7 +5601,7 @@ PF_CONSOLE_CMD( SceneObject_SetEnable, All, // Group name, Function name
bool enable = params[1]; bool enable = params[1];
plEnableMsg* pEMsg = TRACKED_NEW plEnableMsg; plEnableMsg* pEMsg = new plEnableMsg;
pEMsg->SetCmd( enable ? plEnableMsg::kEnable : plEnableMsg::kDisable ); pEMsg->SetCmd( enable ? plEnableMsg::kEnable : plEnableMsg::kDisable );
pEMsg->SetCmd( plEnableMsg::kAll ); pEMsg->SetCmd( plEnableMsg::kAll );
pEMsg->AddReceiver( key ); pEMsg->AddReceiver( key );
@ -5638,7 +5638,7 @@ PF_CONSOLE_CMD( SceneObject, Attach, // Group name, Function name
return; return;
} }
plAttachMsg* attMsg = TRACKED_NEW plAttachMsg(parentKey, child, plRefMsg::kOnRequest, nil); plAttachMsg* attMsg = new plAttachMsg(parentKey, child, plRefMsg::kOnRequest, nil);
plgDispatch::MsgSend(attMsg); plgDispatch::MsgSend(attMsg);
sprintf(str, "%s now child of %s", childName, parentName); sprintf(str, "%s now child of %s", childName, parentName);
@ -5674,7 +5674,7 @@ PF_CONSOLE_CMD( SceneObject, Detach, // Group name, Function name
&& child->GetCoordinateInterface()->GetParent()->GetOwner() ) && child->GetCoordinateInterface()->GetParent()->GetOwner() )
{ {
plKey parentKey = child->GetCoordinateInterface()->GetParent()->GetOwner()->GetKey(); plKey parentKey = child->GetCoordinateInterface()->GetParent()->GetOwner()->GetKey();
plAttachMsg* attMsg = TRACKED_NEW plAttachMsg(parentKey, child, plRefMsg::kOnRemove, nil); plAttachMsg* attMsg = new plAttachMsg(parentKey, child, plRefMsg::kOnRemove, nil);
plgDispatch::MsgSend(attMsg); plgDispatch::MsgSend(attMsg);
sprintf(str, "%s detached from %s", childName, parentKey->GetName()); sprintf(str, "%s detached from %s", childName, parentKey->GetName());
@ -5780,7 +5780,7 @@ PF_CONSOLE_CMD( Physics, ApplyForce, "string Object, float x, float y, float z",
if(key) if(key)
{ {
hsVector3 force(params[1], params[2], params[3]); hsVector3 force(params[1], params[2], params[3]);
plForceMsg *m = TRACKED_NEW plForceMsg(nil, key, force); plForceMsg *m = new plForceMsg(nil, key, force);
plgDispatch::MsgSend(m); plgDispatch::MsgSend(m);
} }
} }
@ -5793,7 +5793,7 @@ PF_CONSOLE_CMD( Physics, ApplyForceAtPoint, "string Object, float forceX, float
{ {
hsVector3 force(params[1], params[2], params[3]); hsVector3 force(params[1], params[2], params[3]);
hsPoint3 point(params[4], params[5], params[6]); hsPoint3 point(params[4], params[5], params[6]);
plOffsetForceMsg *m = TRACKED_NEW plOffsetForceMsg(nil, key, force, point); plOffsetForceMsg *m = new plOffsetForceMsg(nil, key, force, point);
plgDispatch::MsgSend(m); plgDispatch::MsgSend(m);
} }
} }
@ -5805,7 +5805,7 @@ PF_CONSOLE_CMD( Physics, ApplyTorque, "string Object, float axisX, float axisY,
if(key) if(key)
{ {
hsVector3 torque(params[1], params[2], params[3]); hsVector3 torque(params[1], params[2], params[3]);
plTorqueMsg *m = TRACKED_NEW plTorqueMsg(nil, key, torque); plTorqueMsg *m = new plTorqueMsg(nil, key, torque);
plgDispatch::MsgSend(m); plgDispatch::MsgSend(m);
} }
} }
@ -5817,7 +5817,7 @@ PF_CONSOLE_CMD( Physics, ApplyImpulse, "string Object, float x, float y, float z
if(key) if(key)
{ {
hsVector3 impulse(params[1], params[2], params[3]); hsVector3 impulse(params[1], params[2], params[3]);
plImpulseMsg *m = TRACKED_NEW plImpulseMsg(nil, key, impulse); plImpulseMsg *m = new plImpulseMsg(nil, key, impulse);
plgDispatch::MsgSend(m); plgDispatch::MsgSend(m);
} }
} }
@ -5830,7 +5830,7 @@ PF_CONSOLE_CMD( Physics, ApplyImpulseAtPoint, "string Object, float impulseX, fl
{ {
hsVector3 impulse(params[1], params[2], params[3]); hsVector3 impulse(params[1], params[2], params[3]);
hsPoint3 point(params[4], params[5], params[6]); hsPoint3 point(params[4], params[5], params[6]);
plOffsetImpulseMsg *m = TRACKED_NEW plOffsetImpulseMsg(nil, key, impulse, point); plOffsetImpulseMsg *m = new plOffsetImpulseMsg(nil, key, impulse, point);
plgDispatch::MsgSend(m); plgDispatch::MsgSend(m);
} }
} }
@ -5842,7 +5842,7 @@ PF_CONSOLE_CMD( Physics, ApplyAngularImpulse, "string Object, float x, float y,
if(key) if(key)
{ {
hsVector3 impulse(params[1], params[2], params[3]); hsVector3 impulse(params[1], params[2], params[3]);
plAngularImpulseMsg *m = TRACKED_NEW plAngularImpulseMsg(nil, key, impulse); plAngularImpulseMsg *m = new plAngularImpulseMsg(nil, key, impulse);
plgDispatch::MsgSend(m); plgDispatch::MsgSend(m);
} }
} }
@ -5854,7 +5854,7 @@ PF_CONSOLE_CMD( Physics, ApplyDamping, "string Object, float dampFactor", "Reduc
if(key) if(key)
{ {
float dampFactor = params[1]; float dampFactor = params[1];
plDampMsg *m = TRACKED_NEW plDampMsg(nil, key, dampFactor); plDampMsg *m = new plDampMsg(nil, key, dampFactor);
plgDispatch::MsgSend(m); plgDispatch::MsgSend(m);
} }
} }
@ -5866,7 +5866,7 @@ PF_CONSOLE_CMD( Physics, ShiftMass, "string Object, float x, float y, float z",
if(key) if(key)
{ {
hsVector3 offset(params[1], params[2], params[3]); hsVector3 offset(params[1], params[2], params[3]);
plShiftMassMsg *m = TRACKED_NEW plShiftMassMsg(nil, key, offset); plShiftMassMsg *m = new plShiftMassMsg(nil, key, offset);
plgDispatch::MsgSend(m); plgDispatch::MsgSend(m);
} }
} }
@ -5879,7 +5879,7 @@ PF_CONSOLE_CMD( Physics, Suppress, "string Object, int doSuppress", "Remove(true
int iDoSuppress = params[1]; int iDoSuppress = params[1];
bool doSuppress = iDoSuppress ? true : false; bool doSuppress = iDoSuppress ? true : false;
plSimSuppressMsg *msg = TRACKED_NEW plSimSuppressMsg(nil, key, doSuppress); plSimSuppressMsg *msg = new plSimSuppressMsg(nil, key, doSuppress);
msg->Send(); msg->Send();
} }
} }
@ -5891,7 +5891,7 @@ PF_CONSOLE_CMD( Physics, SetEventGroup, "string Object, int group, int status, i
if(key) if(key)
{ {
int group = params[1], status = params[2], clearOthers = params[3]; int group = params[1], status = params[2], clearOthers = params[3];
plEventGroupMsg *m = TRACKED_NEW plEventGroupMsg(nil, key, group, status, clearOthers); plEventGroupMsg *m = new plEventGroupMsg(nil, key, group, status, clearOthers);
plgDispatch::MsgSend(m); plgDispatch::MsgSend(m);
} }
} }
@ -5904,7 +5904,7 @@ PF_CONSOLE_CMD( Physics, Freeze, "string Object, int status", "Immobilize the gi
{ {
int status = params[1]; int status = params[1];
plFreezeMsg *m = TRACKED_NEW plFreezeMsg(nil, key, nil, status); plFreezeMsg *m = new plFreezeMsg(nil, key, nil, status);
plgDispatch::MsgSend(m); plgDispatch::MsgSend(m);
} }
@ -6254,7 +6254,7 @@ void UpdateParticleParam(char *objName, int32_t paramID, float value, void (*Pri
const plParticleSystem *sys = plParticleSystem::ConvertNoRef(so->GetModifier(i)); const plParticleSystem *sys = plParticleSystem::ConvertNoRef(so->GetModifier(i));
if (sys != nil) if (sys != nil)
{ {
plgDispatch::MsgSend(TRACKED_NEW plParticleUpdateMsg(nil, sys->GetKey(), nil, paramID, value)); plgDispatch::MsgSend(new plParticleUpdateMsg(nil, sys->GetKey(), nil, paramID, value));
PrintString("Particle system successfully updated."); PrintString("Particle system successfully updated.");
return; return;
} }
@ -6374,7 +6374,7 @@ PF_CONSOLE_CMD( ParticleSystem,
plArmatureMod *avMod = plAvatarMgr::GetInstance()->GetLocalAvatar(); plArmatureMod *avMod = plAvatarMgr::GetInstance()->GetLocalAvatar();
if (avMod) if (avMod)
(TRACKED_NEW plParticleTransferMsg(nil, avMod->GetKey(), 0, so->GetKey(), (int)params[1]))->Send(); (new plParticleTransferMsg(nil, avMod->GetKey(), 0, so->GetKey(), (int)params[1]))->Send();
} }
PF_CONSOLE_CMD( ParticleSystem, PF_CONSOLE_CMD( ParticleSystem,
@ -6395,7 +6395,7 @@ PF_CONSOLE_CMD( ParticleSystem,
if (sys != nil) if (sys != nil)
{ {
uint8_t flags = (params[3] ? plParticleKillMsg::kParticleKillPercentage : 0); uint8_t flags = (params[3] ? plParticleKillMsg::kParticleKillPercentage : 0);
(TRACKED_NEW plParticleKillMsg(nil, sys->GetKey(), 0, params[2], params[1], flags))->Send(); (new plParticleKillMsg(nil, sys->GetKey(), 0, params[2], params[1], flags))->Send();
} }
} }
@ -6433,7 +6433,7 @@ PF_CONSOLE_CMD( ParticleSystem_Flock,
plParticleEffect *flock = FindFlock(params[0]); plParticleEffect *flock = FindFlock(params[0]);
if (flock) if (flock)
{ {
(TRACKED_NEW plParticleFlockMsg(nil, flock->GetKey(), 0, plParticleFlockMsg::kFlockCmdSetOffset, params[1], params[2], params[3]))->Send(); (new plParticleFlockMsg(nil, flock->GetKey(), 0, plParticleFlockMsg::kFlockCmdSetOffset, params[1], params[2], params[3]))->Send();
} }
} }
@ -6445,7 +6445,7 @@ PF_CONSOLE_CMD( ParticleSystem_Flock,
plParticleEffect *flock = FindFlock(params[0]); plParticleEffect *flock = FindFlock(params[0]);
if (flock) if (flock)
{ {
(TRACKED_NEW plParticleFlockMsg(nil, flock->GetKey(), 0, plParticleFlockMsg::kFlockCmdSetDissentPoint, params[1], params[2], params[3]))->Send(); (new plParticleFlockMsg(nil, flock->GetKey(), 0, plParticleFlockMsg::kFlockCmdSetDissentPoint, params[1], params[2], params[3]))->Send();
} }
} }
@ -6599,7 +6599,7 @@ PF_CONSOLE_CMD( Animation, // Group name
"string objName, string animName", // Params "string objName, string animName", // Params
"Start the animation" ) // Help string "Start the animation" ) // Help string
{ {
plAnimCmdMsg *msg = TRACKED_NEW plAnimCmdMsg(); plAnimCmdMsg *msg = new plAnimCmdMsg();
msg->SetCmd(plAnimCmdMsg::kContinue); msg->SetCmd(plAnimCmdMsg::kContinue);
msg->SetAnimName(nil); msg->SetAnimName(nil);
msg->SetBCastFlag(plMessage::kPropagateToModifiers); msg->SetBCastFlag(plMessage::kPropagateToModifiers);
@ -6611,7 +6611,7 @@ PF_CONSOLE_CMD( Animation, // Group name
"string objName, string animName", // Params "string objName, string animName", // Params
"Stop the animation" ) // Help string "Stop the animation" ) // Help string
{ {
plAnimCmdMsg *msg = TRACKED_NEW plAnimCmdMsg(); plAnimCmdMsg *msg = new plAnimCmdMsg();
msg->SetCmd(plAnimCmdMsg::kStop); msg->SetCmd(plAnimCmdMsg::kStop);
msg->SetAnimName(nil); msg->SetAnimName(nil);
msg->SetBCastFlag(plMessage::kPropagateToModifiers); msg->SetBCastFlag(plMessage::kPropagateToModifiers);
@ -6623,7 +6623,7 @@ PF_CONSOLE_CMD( Animation, // Group name
"string objName, string animName, float blend, float rate", // Params "string objName, string animName, float blend, float rate", // Params
"Set the animation's blend value and rate to change" ) // Help string "Set the animation's blend value and rate to change" ) // Help string
{ {
plAGCmdMsg *msg = TRACKED_NEW plAGCmdMsg(); plAGCmdMsg *msg = new plAGCmdMsg();
msg->SetCmd(plAGCmdMsg::kSetBlend); msg->SetCmd(plAGCmdMsg::kSetBlend);
msg->fBlend = params[2]; msg->fBlend = params[2];
msg->fBlendRate = params[3]; msg->fBlendRate = params[3];
@ -6637,7 +6637,7 @@ PF_CONSOLE_CMD( Animation, // Group name
"string objName, string animName, float amp, float rate", // Params "string objName, string animName, float amp, float rate", // Params
"Set the amplitude of this animation and rate to change" ) // Help string "Set the amplitude of this animation and rate to change" ) // Help string
{ {
plAGCmdMsg *msg = TRACKED_NEW plAGCmdMsg(); plAGCmdMsg *msg = new plAGCmdMsg();
msg->SetCmd(plAGCmdMsg::kSetAmp); msg->SetCmd(plAGCmdMsg::kSetAmp);
msg->fAmp = params[2]; msg->fAmp = params[2];
msg->fAmpRate = params[3]; msg->fAmpRate = params[3];
@ -6651,7 +6651,7 @@ PF_CONSOLE_CMD( Animation, // Group name
"string objName, string animName, float speed, float rate", // Params "string objName, string animName, float speed, float rate", // Params
"Set the speed of this animation and rate to change" ) // Help string "Set the speed of this animation and rate to change" ) // Help string
{ {
plAnimCmdMsg *msg = TRACKED_NEW plAnimCmdMsg(); plAnimCmdMsg *msg = new plAnimCmdMsg();
msg->SetCmd(plAnimCmdMsg::kSetSpeed); msg->SetCmd(plAnimCmdMsg::kSetSpeed);
msg->fSpeed = params[2]; msg->fSpeed = params[2];
msg->fSpeedChangeRate = params[3]; msg->fSpeedChangeRate = params[3];
@ -6904,7 +6904,7 @@ PF_CONSOLE_CMD( KI, // Group name
"Upgrade KI to new level." ) // Help string "Upgrade KI to new level." ) // Help string
{ {
// create the mesage to send // create the mesage to send
pfKIMsg *msg = TRACKED_NEW pfKIMsg( pfKIMsg::kUpgradeKILevel ); pfKIMsg *msg = new pfKIMsg( pfKIMsg::kUpgradeKILevel );
msg->SetIntValue((int) params[0]); msg->SetIntValue((int) params[0]);
@ -6918,7 +6918,7 @@ PF_CONSOLE_CMD( KI, // Group name
"Downgrade KI level to next lower level." ) // Help string "Downgrade KI level to next lower level." ) // Help string
{ {
// create the mesage to send // create the mesage to send
pfKIMsg *msg = TRACKED_NEW pfKIMsg( pfKIMsg::kDowngradeKILevel ); pfKIMsg *msg = new pfKIMsg( pfKIMsg::kDowngradeKILevel );
msg->SetIntValue((int) params[0]); msg->SetIntValue((int) params[0]);
@ -6932,7 +6932,7 @@ PF_CONSOLE_CMD( KI, // Group name
"All the phased functionality turned on." ) // Help string "All the phased functionality turned on." ) // Help string
{ {
// create the mesage to send // create the mesage to send
pfKIMsg *msg = TRACKED_NEW pfKIMsg( pfKIMsg::kKIPhasedAllOn ); pfKIMsg *msg = new pfKIMsg( pfKIMsg::kKIPhasedAllOn );
// send it off // send it off
plgDispatch::MsgSend( msg ); plgDispatch::MsgSend( msg );
@ -6944,7 +6944,7 @@ PF_CONSOLE_CMD( KI, // Group name
"All the phased functionality turned off." ) // Help string "All the phased functionality turned off." ) // Help string
{ {
// create the mesage to send // create the mesage to send
pfKIMsg *msg = TRACKED_NEW pfKIMsg( pfKIMsg::kKIPhasedAllOff ); pfKIMsg *msg = new pfKIMsg( pfKIMsg::kKIPhasedAllOff );
// send it off // send it off
plgDispatch::MsgSend( msg ); plgDispatch::MsgSend( msg );
@ -6956,7 +6956,7 @@ PF_CONSOLE_CMD( KI, // Group name
"Add the journal to the Blackbar." ) // Help string "Add the journal to the Blackbar." ) // Help string
{ {
// create the message to send // create the message to send
pfKIMsg *msg = TRACKED_NEW pfKIMsg( pfKIMsg::kAddJournalBook ); pfKIMsg *msg = new pfKIMsg( pfKIMsg::kAddJournalBook );
// send if off // send if off
plgDispatch::MsgSend( msg ); plgDispatch::MsgSend( msg );
@ -6968,7 +6968,7 @@ PF_CONSOLE_CMD( KI, // Group name
"Removes the journal from the Blackbar." ) // Help string "Removes the journal from the Blackbar." ) // Help string
{ {
// create the message to send // create the message to send
pfKIMsg *msg = TRACKED_NEW pfKIMsg( pfKIMsg::kRemoveJournalBook ); pfKIMsg *msg = new pfKIMsg( pfKIMsg::kRemoveJournalBook );
// send if off // send if off
plgDispatch::MsgSend( msg ); plgDispatch::MsgSend( msg );
@ -7045,7 +7045,7 @@ PF_CONSOLE_CMD( Python,
const char* extraParms = ""; const char* extraParms = "";
if (numParams > 1) if (numParams > 1)
extraParms = params[1]; extraParms = params[1];
pfBackdoorMsg *msg = TRACKED_NEW pfBackdoorMsg( params[0],extraParms ); pfBackdoorMsg *msg = new pfBackdoorMsg( params[0],extraParms );
// send it off // send it off
plgDispatch::MsgSend( msg ); plgDispatch::MsgSend( msg );
} }

2
Sources/Plasma/FeatureLib/pfConsole/pfConsoleCommandsNet.cpp

@ -237,7 +237,7 @@ PF_CONSOLE_CMD( Net, // groupName
text += (char*)params[i]; text += (char*)params[i];
text += " "; text += " ";
} }
plConsoleMsg *cMsg = TRACKED_NEW plConsoleMsg( plConsoleMsg::kAddLine, text.c_str() ); plConsoleMsg *cMsg = new plConsoleMsg( plConsoleMsg::kAddLine, text.c_str() );
cMsg->SetBCastFlag(plMessage::kNetPropagate | plMessage::kNetForce); cMsg->SetBCastFlag(plMessage::kNetPropagate | plMessage::kNetForce);
cMsg->SetBCastFlag(plMessage::kLocalPropagate, 0); cMsg->SetBCastFlag(plMessage::kLocalPropagate, 0);
plgDispatch::MsgSend( cMsg ); plgDispatch::MsgSend( cMsg );

2
Sources/Plasma/FeatureLib/pfConsole/pfConsoleDirSrc.cpp

@ -152,5 +152,5 @@ hsBool pfConsoleDirSrc::AlreadyProcessedFile(const std::wstring& path, const std
void pfConsoleDirSrc::AddProcessedFile(const std::wstring& path, const std::wstring& file) void pfConsoleDirSrc::AddProcessedFile(const std::wstring& path, const std::wstring& file)
{ {
fProcessedFiles.push_back(TRACKED_NEW FileName(path, file)); fProcessedFiles.push_back(new FileName(path, file));
} }

52
Sources/Plasma/FeatureLib/pfConsole/pfGameConsoleCommands.cpp

@ -167,7 +167,7 @@ PF_CONSOLE_CMD( Game, LoadDialog, "string dlgName", "Loads the given GUI dialog
plKey mgrKey = hsgResMgr::ResMgr()->FindKey( lu ); plKey mgrKey = hsgResMgr::ResMgr()->FindKey( lu );
if( mgrKey ) if( mgrKey )
{ {
pfGameGUIMsg *msg = TRACKED_NEW pfGameGUIMsg( mgrKey, pfGameGUIMsg::kLoadDialog ); pfGameGUIMsg *msg = new pfGameGUIMsg( mgrKey, pfGameGUIMsg::kLoadDialog );
msg->SetString( params[ 0 ] ); msg->SetString( params[ 0 ] );
plgDispatch::MsgSend( msg ); plgDispatch::MsgSend( msg );
} }
@ -179,7 +179,7 @@ PF_CONSOLE_CMD( Game, LoadLocalDialog, "string ageName, string dlgName", "Loads
plKey mgrKey = hsgResMgr::ResMgr()->FindKey( lu ); plKey mgrKey = hsgResMgr::ResMgr()->FindKey( lu );
if( mgrKey ) if( mgrKey )
{ {
pfGameGUIMsg *msg = TRACKED_NEW pfGameGUIMsg( mgrKey, pfGameGUIMsg::kLoadDialog ); pfGameGUIMsg *msg = new pfGameGUIMsg( mgrKey, pfGameGUIMsg::kLoadDialog );
msg->SetString( params[ 1 ] ); msg->SetString( params[ 1 ] );
msg->SetAge( params[ 0 ] ); msg->SetAge( params[ 0 ] );
plgDispatch::MsgSend( msg ); plgDispatch::MsgSend( msg );
@ -192,7 +192,7 @@ PF_CONSOLE_CMD( Game, ShowDialog, "string dlgName", "Shows the given GUI dialog"
plKey mgrKey = hsgResMgr::ResMgr()->FindKey( lu ); plKey mgrKey = hsgResMgr::ResMgr()->FindKey( lu );
if( mgrKey ) if( mgrKey )
{ {
pfGameGUIMsg *msg = TRACKED_NEW pfGameGUIMsg( mgrKey, pfGameGUIMsg::kShowDialog ); pfGameGUIMsg *msg = new pfGameGUIMsg( mgrKey, pfGameGUIMsg::kShowDialog );
msg->SetString( params[ 0 ] ); msg->SetString( params[ 0 ] );
plgDispatch::MsgSend( msg ); plgDispatch::MsgSend( msg );
} }
@ -204,7 +204,7 @@ PF_CONSOLE_CMD( Game, HideDialog, "string dlgName", "Hides the given GUI dialog"
plKey mgrKey = hsgResMgr::ResMgr()->FindKey( lu ); plKey mgrKey = hsgResMgr::ResMgr()->FindKey( lu );
if( mgrKey ) if( mgrKey )
{ {
pfGameGUIMsg *msg = TRACKED_NEW pfGameGUIMsg( mgrKey, pfGameGUIMsg::kHideDialog ); pfGameGUIMsg *msg = new pfGameGUIMsg( mgrKey, pfGameGUIMsg::kHideDialog );
msg->SetString( params[ 0 ] ); msg->SetString( params[ 0 ] );
plgDispatch::MsgSend( msg ); plgDispatch::MsgSend( msg );
} }
@ -218,11 +218,11 @@ PF_CONSOLE_CMD( Game, SwitchDialog, "string olddlgName, string newdlgName", "Hid
plKey mgrKey = hsgResMgr::ResMgr()->FindKey( lu ); plKey mgrKey = hsgResMgr::ResMgr()->FindKey( lu );
if( mgrKey ) if( mgrKey )
{ {
pfGameGUIMsg *msg = TRACKED_NEW pfGameGUIMsg( mgrKey, pfGameGUIMsg::kHideDialog ); pfGameGUIMsg *msg = new pfGameGUIMsg( mgrKey, pfGameGUIMsg::kHideDialog );
msg->SetString( params[ 0 ] ); msg->SetString( params[ 0 ] );
plgDispatch::MsgSend( msg ); plgDispatch::MsgSend( msg );
pfGameGUIMsg *msg2 = TRACKED_NEW pfGameGUIMsg( mgrKey, pfGameGUIMsg::kShowDialog ); pfGameGUIMsg *msg2 = new pfGameGUIMsg( mgrKey, pfGameGUIMsg::kShowDialog );
msg2->SetString( params[ 1 ] ); msg2->SetString( params[ 1 ] );
plgDispatch::MsgSend( msg2 ); plgDispatch::MsgSend( msg2 );
} }
@ -275,116 +275,116 @@ PF_CONSOLE_CMD( Game_GUI, CreateDialog, "string name", "" )
PF_CONSOLE_CMD( Game, EnterChatMode, "", "Enters in-game chat mode" ) PF_CONSOLE_CMD( Game, EnterChatMode, "", "Enters in-game chat mode" )
{ {
pfKIMsg* msg = TRACKED_NEW pfKIMsg(pfKIMsg::kEnterChatMode); pfKIMsg* msg = new pfKIMsg(pfKIMsg::kEnterChatMode);
plgDispatch::MsgSend( msg ); plgDispatch::MsgSend( msg );
} }
PF_CONSOLE_CMD( Game, KIToggleMini, "", "Toggle between mini and big KI" ) PF_CONSOLE_CMD( Game, KIToggleMini, "", "Toggle between mini and big KI" )
{ {
pfKIMsg* msg = TRACKED_NEW pfKIMsg(pfKIMsg::kMiniBigKIToggle); pfKIMsg* msg = new pfKIMsg(pfKIMsg::kMiniBigKIToggle);
plgDispatch::MsgSend( msg ); plgDispatch::MsgSend( msg );
} }
PF_CONSOLE_CMD( Game, KIPutAway, "", "Put KI completely away" ) PF_CONSOLE_CMD( Game, KIPutAway, "", "Put KI completely away" )
{ {
pfKIMsg* msg = TRACKED_NEW pfKIMsg(pfKIMsg::kKIPutAway); pfKIMsg* msg = new pfKIMsg(pfKIMsg::kKIPutAway);
plgDispatch::MsgSend( msg ); plgDispatch::MsgSend( msg );
} }
PF_CONSOLE_CMD( Game, KIChatPageUp, "", "Scroll chat display one page up" ) PF_CONSOLE_CMD( Game, KIChatPageUp, "", "Scroll chat display one page up" )
{ {
pfKIMsg* msg = TRACKED_NEW pfKIMsg(pfKIMsg::kChatAreaPageUp); pfKIMsg* msg = new pfKIMsg(pfKIMsg::kChatAreaPageUp);
plgDispatch::MsgSend( msg ); plgDispatch::MsgSend( msg );
} }
PF_CONSOLE_CMD( Game, KIChatPageDown, "", "Scroll chat display one page down" ) PF_CONSOLE_CMD( Game, KIChatPageDown, "", "Scroll chat display one page down" )
{ {
pfKIMsg* msg = TRACKED_NEW pfKIMsg(pfKIMsg::kChatAreaPageDown); pfKIMsg* msg = new pfKIMsg(pfKIMsg::kChatAreaPageDown);
plgDispatch::MsgSend( msg ); plgDispatch::MsgSend( msg );
} }
PF_CONSOLE_CMD( Game, KIChatToStart, "", "Scroll chat display to top of buffer" ) PF_CONSOLE_CMD( Game, KIChatToStart, "", "Scroll chat display to top of buffer" )
{ {
pfKIMsg* msg = TRACKED_NEW pfKIMsg(pfKIMsg::kChatAreaGoToBegin); pfKIMsg* msg = new pfKIMsg(pfKIMsg::kChatAreaGoToBegin);
plgDispatch::MsgSend( msg ); plgDispatch::MsgSend( msg );
} }
PF_CONSOLE_CMD( Game, KIChatToEnd, "", "Scroll chat display to bottom of buffer" ) PF_CONSOLE_CMD( Game, KIChatToEnd, "", "Scroll chat display to bottom of buffer" )
{ {
pfKIMsg* msg = TRACKED_NEW pfKIMsg(pfKIMsg::kChatAreaGoToEnd); pfKIMsg* msg = new pfKIMsg(pfKIMsg::kChatAreaGoToEnd);
plgDispatch::MsgSend( msg ); plgDispatch::MsgSend( msg );
} }
PF_CONSOLE_CMD( Game, KITakePicture, "", "Take picture with KI" ) PF_CONSOLE_CMD( Game, KITakePicture, "", "Take picture with KI" )
{ {
pfKIMsg* msg = TRACKED_NEW pfKIMsg(pfKIMsg::kKITakePicture); pfKIMsg* msg = new pfKIMsg(pfKIMsg::kKITakePicture);
plgDispatch::MsgSend( msg ); plgDispatch::MsgSend( msg );
} }
PF_CONSOLE_CMD( Game, KICreateJournal, "", "Create journal note entry" ) PF_CONSOLE_CMD( Game, KICreateJournal, "", "Create journal note entry" )
{ {
pfKIMsg* msg = TRACKED_NEW pfKIMsg(pfKIMsg::kKICreateJournalNote); pfKIMsg* msg = new pfKIMsg(pfKIMsg::kKICreateJournalNote);
plgDispatch::MsgSend( msg ); plgDispatch::MsgSend( msg );
} }
PF_CONSOLE_CMD( Game, KIChatToggleFaded, "", "Toggle fade of chat display" ) PF_CONSOLE_CMD( Game, KIChatToggleFaded, "", "Toggle fade of chat display" )
{ {
pfKIMsg* msg = TRACKED_NEW pfKIMsg(pfKIMsg::kKIToggleFade); pfKIMsg* msg = new pfKIMsg(pfKIMsg::kKIToggleFade);
plgDispatch::MsgSend( msg ); plgDispatch::MsgSend( msg );
} }
PF_CONSOLE_CMD( Game, KIChatToggleFadeEnable, "", "Toggle enable of chat fade" ) PF_CONSOLE_CMD( Game, KIChatToggleFadeEnable, "", "Toggle enable of chat fade" )
{ {
pfKIMsg* msg = TRACKED_NEW pfKIMsg(pfKIMsg::kKIToggleFadeEnable); pfKIMsg* msg = new pfKIMsg(pfKIMsg::kKIToggleFadeEnable);
plgDispatch::MsgSend( msg ); plgDispatch::MsgSend( msg );
} }
PF_CONSOLE_CMD( Game, KIUpSizeFont, "", "Up size the KI font (chatarea)" ) PF_CONSOLE_CMD( Game, KIUpSizeFont, "", "Up size the KI font (chatarea)" )
{ {
pfKIMsg* msg = TRACKED_NEW pfKIMsg(pfKIMsg::kKIUpSizeFont); pfKIMsg* msg = new pfKIMsg(pfKIMsg::kKIUpSizeFont);
plgDispatch::MsgSend( msg ); plgDispatch::MsgSend( msg );
} }
PF_CONSOLE_CMD( Game, KIDownSizeFont, "", "Down size the KI font (chatarea)" ) PF_CONSOLE_CMD( Game, KIDownSizeFont, "", "Down size the KI font (chatarea)" )
{ {
pfKIMsg* msg = TRACKED_NEW pfKIMsg(pfKIMsg::kKIDownSizeFont); pfKIMsg* msg = new pfKIMsg(pfKIMsg::kKIDownSizeFont);
plgDispatch::MsgSend( msg ); plgDispatch::MsgSend( msg );
} }
PF_CONSOLE_CMD( Game, KIOpenYeeshaBook, "", "Open the player's Yeesha book" ) PF_CONSOLE_CMD( Game, KIOpenYeeshaBook, "", "Open the player's Yeesha book" )
{ {
pfKIMsg* msg = TRACKED_NEW pfKIMsg(pfKIMsg::kKIOpenYeehsaBook); pfKIMsg* msg = new pfKIMsg(pfKIMsg::kKIOpenYeehsaBook);
plgDispatch::MsgSend( msg ); plgDispatch::MsgSend( msg );
} }
PF_CONSOLE_CMD( Game, KIOpenKI, "", "Open the KI a little at a time" ) PF_CONSOLE_CMD( Game, KIOpenKI, "", "Open the KI a little at a time" )
{ {
pfKIMsg* msg = TRACKED_NEW pfKIMsg(pfKIMsg::kKIOpenKI); pfKIMsg* msg = new pfKIMsg(pfKIMsg::kKIOpenKI);
plgDispatch::MsgSend( msg ); plgDispatch::MsgSend( msg );
} }
PF_CONSOLE_CMD( Game, KIHelp, "", "Open the CCR help dialog" ) PF_CONSOLE_CMD( Game, KIHelp, "", "Open the CCR help dialog" )
{ {
pfKIMsg* msg = TRACKED_NEW pfKIMsg(pfKIMsg::kKIShowCCRHelp); pfKIMsg* msg = new pfKIMsg(pfKIMsg::kKIShowCCRHelp);
plgDispatch::MsgSend( msg ); plgDispatch::MsgSend( msg );
} }
PF_CONSOLE_CMD( Game, KICreateMarker, "", "Create marker in the working marker folder" ) PF_CONSOLE_CMD( Game, KICreateMarker, "", "Create marker in the working marker folder" )
{ {
pfKIMsg* msg = TRACKED_NEW pfKIMsg(pfKIMsg::kKICreateMarker); pfKIMsg* msg = new pfKIMsg(pfKIMsg::kKICreateMarker);
plgDispatch::MsgSend( msg ); plgDispatch::MsgSend( msg );
} }
PF_CONSOLE_CMD( Game, KICreateMarkerFolder, "", "Create marker folder in current Age's journal folder" ) PF_CONSOLE_CMD( Game, KICreateMarkerFolder, "", "Create marker folder in current Age's journal folder" )
{ {
pfKIMsg* msg = TRACKED_NEW pfKIMsg(pfKIMsg::kKICreateMarkerFolder); pfKIMsg* msg = new pfKIMsg(pfKIMsg::kKICreateMarkerFolder);
plgDispatch::MsgSend( msg ); plgDispatch::MsgSend( msg );
} }
PF_CONSOLE_CMD( Game, SetChatFadeDelay, "float delayInSecs", "Sets the time in seconds before the chat text disappears" ) PF_CONSOLE_CMD( Game, SetChatFadeDelay, "float delayInSecs", "Sets the time in seconds before the chat text disappears" )
{ {
// pfKI::GetInstance()->SetChatFadeDelay( params[ 0 ] ); // pfKI::GetInstance()->SetChatFadeDelay( params[ 0 ] );
pfKIMsg* msg = TRACKED_NEW pfKIMsg(pfKIMsg::kSetChatFadeDelay); pfKIMsg* msg = new pfKIMsg(pfKIMsg::kSetChatFadeDelay);
msg->SetDelay( params[0] ); msg->SetDelay( params[0] );
plgDispatch::MsgSend( msg ); plgDispatch::MsgSend( msg );
} }
@ -448,7 +448,7 @@ PF_CONSOLE_CMD( Game_Emote, Sit, "", "")
PF_CONSOLE_CMD( Game, SetLocalClientAsAdmin, "bool enable", "Makes chat messages from this client appear as admin messages" ) PF_CONSOLE_CMD( Game, SetLocalClientAsAdmin, "bool enable", "Makes chat messages from this client appear as admin messages" )
{ {
// pfKI::GetInstance()->SetTextChatAdminMode( (bool)params[ 0 ] ); // pfKI::GetInstance()->SetTextChatAdminMode( (bool)params[ 0 ] );
pfKIMsg* msg = TRACKED_NEW pfKIMsg(pfKIMsg::kSetTextChatAdminMode); pfKIMsg* msg = new pfKIMsg(pfKIMsg::kSetTextChatAdminMode);
msg->SetFlags( params[0] ? pfKIMsg::kAdminMsg : 0 ); msg->SetFlags( params[0] ? pfKIMsg::kAdminMsg : 0 );
plgDispatch::MsgSend( msg ); plgDispatch::MsgSend( msg );
} }

4
Sources/Plasma/FeatureLib/pfConsoleCore/pfConsoleCmd.cpp

@ -106,7 +106,7 @@ pfConsoleCmdGroup *pfConsoleCmdGroup::GetBaseGroup( void )
if( fBaseCmdGroup == nil ) if( fBaseCmdGroup == nil )
{ {
/// Initialize base group /// Initialize base group
fBaseCmdGroup = TRACKED_NEW pfConsoleCmdGroup( nil, nil ); fBaseCmdGroup = new pfConsoleCmdGroup( nil, nil );
} }
return fBaseCmdGroup; return fBaseCmdGroup;
@ -226,7 +226,7 @@ pfConsoleCmdGroup *pfConsoleCmdGroup::FindSubGroupRecurse( const char *name )
static char seps[] = " ._"; static char seps[] = " ._";
string = TRACKED_NEW char[ strlen( name ) + 1 ]; string = new char[ strlen( name ) + 1 ];
hsAssert( string != nil, "Cannot allocate string in FindSubGroupRecurse()" ); hsAssert( string != nil, "Cannot allocate string in FindSubGroupRecurse()" );
strcpy( string, name ); strcpy( string, name );

14
Sources/Plasma/FeatureLib/pfGameGUIMgr/pfGUIButtonMod.cpp

@ -142,7 +142,7 @@ void pfGUIButtonMod::StartDragging( void )
fOrigHandler = fDraggable->GetHandler(); fOrigHandler = fDraggable->GetHandler();
fDraggable->SetVisible( true ); fDraggable->SetVisible( true );
fDraggable->SetHandler( TRACKED_NEW pfGUIButtonDragProc( this, fDraggable, fOrigHandler, fOrigReportedDrag ) ); fDraggable->SetHandler( new pfGUIButtonDragProc( this, fDraggable, fOrigHandler, fOrigReportedDrag ) );
fDraggable->HandleMouseDown( fOrigMouseDownPt, 0 ); fDraggable->HandleMouseDown( fOrigMouseDownPt, 0 );
} }
@ -213,7 +213,7 @@ void pfGUIButtonMod::Read( hsStream *s, hsResMgr *mgr )
fMouseOverAnimName = s->ReadSafeString(); fMouseOverAnimName = s->ReadSafeString();
fNotifyType = s->ReadLE32(); fNotifyType = s->ReadLE32();
mgr->ReadKeyNotifyMe( s, TRACKED_NEW plGenRefMsg( GetKey(), plRefMsg::kOnCreate, -1, kRefDraggable ), plRefFlags::kActiveRef ); mgr->ReadKeyNotifyMe( s, new plGenRefMsg( GetKey(), plRefMsg::kOnCreate, -1, kRefDraggable ), plRefFlags::kActiveRef );
} }
void pfGUIButtonMod::Write( hsStream *s, hsResMgr *mgr ) void pfGUIButtonMod::Write( hsStream *s, hsResMgr *mgr )
@ -254,7 +254,7 @@ void pfGUIButtonMod::HandleMouseDown( hsPoint3 &mousePt, uint8_t modifiers )
fClicking = true; fClicking = true;
if( fAnimationKeys.GetCount() > 0 ) if( fAnimationKeys.GetCount() > 0 )
{ {
plAnimCmdMsg *msg = TRACKED_NEW plAnimCmdMsg(); plAnimCmdMsg *msg = new plAnimCmdMsg();
msg->SetCmd( plAnimCmdMsg::kContinue ); msg->SetCmd( plAnimCmdMsg::kContinue );
msg->SetCmd( plAnimCmdMsg::kSetForewards ); msg->SetCmd( plAnimCmdMsg::kSetForewards );
msg->SetCmd( plAnimCmdMsg::kGoToBegin ); msg->SetCmd( plAnimCmdMsg::kGoToBegin );
@ -284,7 +284,7 @@ void pfGUIButtonMod::HandleMouseUp( hsPoint3 &mousePt, uint8_t modifiers )
fClicking = false; fClicking = false;
if( fAnimationKeys.GetCount() > 0 ) if( fAnimationKeys.GetCount() > 0 )
{ {
plAnimCmdMsg *msg = TRACKED_NEW plAnimCmdMsg(); plAnimCmdMsg *msg = new plAnimCmdMsg();
msg->SetCmd( plAnimCmdMsg::kContinue ); msg->SetCmd( plAnimCmdMsg::kContinue );
msg->SetCmd( plAnimCmdMsg::kSetBackwards ); msg->SetCmd( plAnimCmdMsg::kSetBackwards );
msg->SetCmd( plAnimCmdMsg::kGoToEnd ); msg->SetCmd( plAnimCmdMsg::kGoToEnd );
@ -351,7 +351,7 @@ void pfGUIButtonMod::SetInteresting( hsBool i )
if( fMouseOverAnimKeys.GetCount() ) if( fMouseOverAnimKeys.GetCount() )
{ {
plAnimCmdMsg *msg = TRACKED_NEW plAnimCmdMsg(); plAnimCmdMsg *msg = new plAnimCmdMsg();
msg->SetCmd( plAnimCmdMsg::kContinue ); msg->SetCmd( plAnimCmdMsg::kContinue );
msg->SetCmd( fInteresting ? plAnimCmdMsg::kSetForewards : plAnimCmdMsg::kSetBackwards ); msg->SetCmd( fInteresting ? plAnimCmdMsg::kSetForewards : plAnimCmdMsg::kSetBackwards );
msg->SetAnimName( fMouseOverAnimName ); msg->SetAnimName( fMouseOverAnimName );
@ -372,7 +372,7 @@ void pfGUIButtonMod::SetAnimationKeys( hsTArray<plKey> &keys, const char *nam
delete [] fAnimName; delete [] fAnimName;
if( name != nil ) if( name != nil )
{ {
fAnimName = TRACKED_NEW char[ strlen( name ) + 1 ]; fAnimName = new char[ strlen( name ) + 1 ];
strcpy( fAnimName, name ); strcpy( fAnimName, name );
} }
else else
@ -385,7 +385,7 @@ void pfGUIButtonMod::SetMouseOverAnimKeys( hsTArray<plKey> &keys, const char
delete [] fMouseOverAnimName; delete [] fMouseOverAnimName;
if( name != nil ) if( name != nil )
{ {
fMouseOverAnimName = TRACKED_NEW char[ strlen( name ) + 1 ]; fMouseOverAnimName = new char[ strlen( name ) + 1 ];
strcpy( fMouseOverAnimName, name ); strcpy( fMouseOverAnimName, name );
} }
else else

4
Sources/Plasma/FeatureLib/pfGameGUIMgr/pfGUICheckBoxCtrl.cpp

@ -162,7 +162,7 @@ void pfGUICheckBoxCtrl::SetChecked( hsBool checked, hsBool immediate /*= fals
fChecked = checked; fChecked = checked;
if( fAnimationKeys.GetCount() > 0 ) if( fAnimationKeys.GetCount() > 0 )
{ {
plAnimCmdMsg *msg = TRACKED_NEW plAnimCmdMsg(); plAnimCmdMsg *msg = new plAnimCmdMsg();
if( fChecked ) if( fChecked )
{ {
// Moving to true // Moving to true
@ -203,7 +203,7 @@ void pfGUICheckBoxCtrl::SetAnimationKeys( hsTArray<plKey> &keys, const char *
delete [] fAnimName; delete [] fAnimName;
if( name != nil ) if( name != nil )
{ {
fAnimName = TRACKED_NEW char[ strlen( name ) + 1 ]; fAnimName = new char[ strlen( name ) + 1 ];
strcpy( fAnimName, name ); strcpy( fAnimName, name );
} }
else else

12
Sources/Plasma/FeatureLib/pfGameGUIMgr/pfGUIControlHandlers.cpp

@ -77,15 +77,15 @@ pfGUICtrlProcWriteableObject *pfGUICtrlProcWriteableObject::Read( hsStream *s )
switch( type ) switch( type )
{ {
case kConsoleCmd: case kConsoleCmd:
obj = TRACKED_NEW pfGUIConsoleCmdProc; obj = new pfGUIConsoleCmdProc;
break; break;
case kPythonScript: case kPythonScript:
obj = TRACKED_NEW pfGUIPythonScriptProc; obj = new pfGUIPythonScriptProc;
break; break;
case kCloseDlg: case kCloseDlg:
obj = TRACKED_NEW pfGUICloseDlgProc; obj = new pfGUICloseDlgProc;
break; break;
case kNull: case kNull:
@ -128,7 +128,7 @@ void pfGUIConsoleCmdProc::IRead( hsStream *s )
int i = s->ReadLE32(); int i = s->ReadLE32();
if( i > 0 ) if( i > 0 )
{ {
fCommand = TRACKED_NEW char[ i + 1 ]; fCommand = new char[ i + 1 ];
memset( fCommand, 0, i + 1 ); memset( fCommand, 0, i + 1 );
s->Read( i, fCommand ); s->Read( i, fCommand );
} }
@ -151,7 +151,7 @@ void pfGUIConsoleCmdProc::DoSomething( pfGUIControlMod *ctrl )
{ {
if( fCommand != nil ) if( fCommand != nil )
{ {
plConsoleMsg *cMsg = TRACKED_NEW plConsoleMsg( plConsoleMsg::kExecuteLine, fCommand ); plConsoleMsg *cMsg = new plConsoleMsg( plConsoleMsg::kExecuteLine, fCommand );
plgDispatch::MsgSend( cMsg ); plgDispatch::MsgSend( cMsg );
} }
} }
@ -164,7 +164,7 @@ void pfGUIConsoleCmdProc::SetCommand( const char *cmd )
fCommand = nil; fCommand = nil;
else else
{ {
fCommand = TRACKED_NEW char[ strlen( cmd ) + 1 ]; fCommand = new char[ strlen( cmd ) + 1 ];
memset( fCommand, 0, strlen( cmd ) + 1 ); memset( fCommand, 0, strlen( cmd ) + 1 );
strcpy( fCommand, cmd ); strcpy( fCommand, cmd );
} }

22
Sources/Plasma/FeatureLib/pfGameGUIMgr/pfGUIControlMod.cpp

@ -246,7 +246,7 @@ static hsBool CreateConvexHull( hsPoint3 *inPoints, int &numPoints )
// Step 2: Sort all the in points by the angle to the X axis (vector <1,0>). // Step 2: Sort all the in points by the angle to the X axis (vector <1,0>).
// Step A: Calculate all the angles // Step A: Calculate all the angles
angles = TRACKED_NEW float[ numPoints ]; angles = new float[ numPoints ];
hsPoint3 xAxisPoint( avgPoint.fX + 1, avgPoint.fY, avgPoint.fZ ); hsPoint3 xAxisPoint( avgPoint.fX + 1, avgPoint.fY, avgPoint.fZ );
for( i = 0; i < numPoints; i++ ) for( i = 0; i < numPoints; i++ )
angles[ i ] = GetVectorAngle( avgPoint, inPoints[ i ], xAxisPoint ); angles[ i ] = GetVectorAngle( avgPoint, inPoints[ i ], xAxisPoint );
@ -737,8 +737,8 @@ void pfGUIControlMod::SetColorScheme( pfGUIColorScheme *newScheme )
void pfGUIControlMod::SetDynTextMap( plLayerInterface *layer, plDynamicTextMap *dynText ) void pfGUIControlMod::SetDynTextMap( plLayerInterface *layer, plDynamicTextMap *dynText )
{ {
hsgResMgr::ResMgr()->AddViaNotify( layer->GetKey(), TRACKED_NEW plGenRefMsg( GetKey(), plRefMsg::kOnCreate, -1, pfGUIControlMod::kRefDynTextLayer ), plRefFlags::kActiveRef ); hsgResMgr::ResMgr()->AddViaNotify( layer->GetKey(), new plGenRefMsg( GetKey(), plRefMsg::kOnCreate, -1, pfGUIControlMod::kRefDynTextLayer ), plRefFlags::kActiveRef );
hsgResMgr::ResMgr()->AddViaNotify( dynText->GetKey(), TRACKED_NEW plGenRefMsg( GetKey(), plRefMsg::kOnCreate, -1, pfGUIControlMod::kRefDynTextMap ), plRefFlags::kActiveRef ); hsgResMgr::ResMgr()->AddViaNotify( dynText->GetKey(), new plGenRefMsg( GetKey(), plRefMsg::kOnCreate, -1, pfGUIControlMod::kRefDynTextMap ), plRefFlags::kActiveRef );
} }
//// SetEnabled ////////////////////////////////////////////////////////////// //// SetEnabled //////////////////////////////////////////////////////////////
@ -788,7 +788,7 @@ void pfGUIControlMod::SetVisible( hsBool vis )
fVisible = vis; fVisible = vis;
if (fTarget) if (fTarget)
{ {
plEnableMsg *msg = TRACKED_NEW plEnableMsg(); plEnableMsg *msg = new plEnableMsg();
msg->SetCmd( fVisible ? plEnableMsg::kEnable : plEnableMsg::kDisable ); msg->SetCmd( fVisible ? plEnableMsg::kEnable : plEnableMsg::kDisable );
msg->SetCmd( plEnableMsg::kDrawable ); msg->SetCmd( plEnableMsg::kDrawable );
msg->AddReceiver( fTarget->GetKey() ); msg->AddReceiver( fTarget->GetKey() );
@ -818,8 +818,8 @@ void pfGUIControlMod::Read( hsStream *s, hsResMgr *mgr )
// Read in the dynTextMap if there is one // Read in the dynTextMap if there is one
if( s->ReadBool() ) if( s->ReadBool() )
{ {
mgr->ReadKeyNotifyMe( s, TRACKED_NEW plGenRefMsg( GetKey(), plRefMsg::kOnCreate, -1, kRefDynTextLayer ), plRefFlags::kActiveRef ); mgr->ReadKeyNotifyMe( s, new plGenRefMsg( GetKey(), plRefMsg::kOnCreate, -1, kRefDynTextLayer ), plRefFlags::kActiveRef );
mgr->ReadKeyNotifyMe( s, TRACKED_NEW plGenRefMsg( GetKey(), plRefMsg::kOnCreate, -1, kRefDynTextMap ), plRefFlags::kActiveRef ); mgr->ReadKeyNotifyMe( s, new plGenRefMsg( GetKey(), plRefMsg::kOnCreate, -1, kRefDynTextMap ), plRefFlags::kActiveRef );
} }
else else
{ {
@ -830,7 +830,7 @@ void pfGUIControlMod::Read( hsStream *s, hsResMgr *mgr )
if( s->ReadBool() ) if( s->ReadBool() )
{ {
SetColorScheme( nil ); SetColorScheme( nil );
fColorScheme = TRACKED_NEW pfGUIColorScheme(); fColorScheme = new pfGUIColorScheme();
fColorScheme->Read( s ); fColorScheme->Read( s );
} }
@ -846,9 +846,9 @@ void pfGUIControlMod::Read( hsStream *s, hsResMgr *mgr )
} }
if( HasFlag( kHasProxy ) ) if( HasFlag( kHasProxy ) )
mgr->ReadKeyNotifyMe( s, TRACKED_NEW plGenRefMsg( GetKey(), plRefMsg::kOnCreate, -1, kRefProxy ), plRefFlags::kActiveRef ); mgr->ReadKeyNotifyMe( s, new plGenRefMsg( GetKey(), plRefMsg::kOnCreate, -1, kRefProxy ), plRefFlags::kActiveRef );
mgr->ReadKeyNotifyMe( s, TRACKED_NEW plGenRefMsg( GetKey(), plRefMsg::kOnCreate, -1, kRefSkin ), plRefFlags::kActiveRef ); mgr->ReadKeyNotifyMe( s, new plGenRefMsg( GetKey(), plRefMsg::kOnCreate, -1, kRefSkin ), plRefFlags::kActiveRef );
} }
void pfGUIControlMod::Write( hsStream *s, hsResMgr *mgr ) void pfGUIControlMod::Write( hsStream *s, hsResMgr *mgr )
@ -984,7 +984,7 @@ void pfGUIControlMod::IPlaySound( uint8_t guiCtrlEvent, hsBool loop /* = fals
if( GetTarget() == nil || GetTarget()->GetAudioInterface() == nil ) if( GetTarget() == nil || GetTarget()->GetAudioInterface() == nil )
return; return;
plSoundMsg *msg = TRACKED_NEW plSoundMsg; plSoundMsg *msg = new plSoundMsg;
msg->fIndex = fSoundIndices[ guiCtrlEvent ] - 1; msg->fIndex = fSoundIndices[ guiCtrlEvent ] - 1;
msg->SetCmd( plSoundMsg::kGoToTime ); msg->SetCmd( plSoundMsg::kGoToTime );
msg->fTime = 0.f; msg->fTime = 0.f;
@ -1005,7 +1005,7 @@ void pfGUIControlMod::IStopSound(uint8_t guiCtrlEvent)
if (GetTarget() == nil || GetTarget()->GetAudioInterface() == nil ) if (GetTarget() == nil || GetTarget()->GetAudioInterface() == nil )
return; return;
plSoundMsg *msg = TRACKED_NEW plSoundMsg; plSoundMsg *msg = new plSoundMsg;
msg->fIndex = fSoundIndices[guiCtrlEvent] - 1; msg->fIndex = fSoundIndices[guiCtrlEvent] - 1;
msg->SetCmd(plSoundMsg::kStop); msg->SetCmd(plSoundMsg::kStop);
msg->Send(GetTarget()->GetAudioInterface()->GetKey()); msg->Send(GetTarget()->GetAudioInterface()->GetKey());

66
Sources/Plasma/FeatureLib/pfGameGUIMgr/pfGUICtrlGenerator.cpp

@ -158,7 +158,7 @@ hsGMaterial *pfGUICtrlGenerator::ICreateSolidMaterial( hsColorRGBA &color )
// Create a material with a simple blank layer, fully ambient // Create a material with a simple blank layer, fully ambient
hsGMaterial *material = TRACKED_NEW hsGMaterial; hsGMaterial *material = new hsGMaterial;
IAddKey( material, "GUIMaterial" ); IAddKey( material, "GUIMaterial" );
plLayer *lay = material->MakeBaseLayer(); plLayer *lay = material->MakeBaseLayer();
@ -187,11 +187,11 @@ hsGMaterial *pfGUICtrlGenerator::ICreateTextMaterial( const char *text, hsColorR
pixHeight = (uint16_t)(objHeight * 64.f); pixHeight = (uint16_t)(objHeight * 64.f);
// Create blank mipmap // Create blank mipmap
plMipmap *bitmap = TRACKED_NEW plMipmap( 1, 1, plMipmap::kRGB32Config, 1 ); plMipmap *bitmap = new plMipmap( 1, 1, plMipmap::kRGB32Config, 1 );
IAddKey( bitmap, "GUIMipmap" ); IAddKey( bitmap, "GUIMipmap" );
// Create textGen to write string with // Create textGen to write string with
plTextGenerator *textGen = TRACKED_NEW plTextGenerator( bitmap, pixWidth, pixHeight ); plTextGenerator *textGen = new plTextGenerator( bitmap, pixWidth, pixHeight );
textGen->SetFont( fFontFace, (uint16_t)fFontSize ); textGen->SetFont( fFontFace, (uint16_t)fFontSize );
textGen->ClearToColor( bgColor ); textGen->ClearToColor( bgColor );
textGen->SetTextColor( textColor ); textGen->SetTextColor( textColor );
@ -201,7 +201,7 @@ hsGMaterial *pfGUICtrlGenerator::ICreateTextMaterial( const char *text, hsColorR
fTextGens.Append( textGen ); fTextGens.Append( textGen );
// Create a material with a simple blank layer, fully ambient // Create a material with a simple blank layer, fully ambient
hsGMaterial *material = TRACKED_NEW hsGMaterial; hsGMaterial *material = new hsGMaterial;
IAddKey( material, "GUIMaterial" ); IAddKey( material, "GUIMaterial" );
plLayer *lay = material->MakeBaseLayer(); plLayer *lay = material->MakeBaseLayer();
@ -212,7 +212,7 @@ hsGMaterial *pfGUICtrlGenerator::ICreateTextMaterial( const char *text, hsColorR
lay->SetPreshadeColor( black ); lay->SetPreshadeColor( black );
lay->SetAmbientColor( white ); lay->SetAmbientColor( white );
hsgResMgr::ResMgr()->AddViaNotify( bitmap->GetKey(), TRACKED_NEW plLayRefMsg( lay->GetKey(), plRefMsg::kOnCreate, 0, plLayRefMsg::kTexture ), plRefFlags::kActiveRef ); hsgResMgr::ResMgr()->AddViaNotify( bitmap->GetKey(), new plLayRefMsg( lay->GetKey(), plRefMsg::kOnCreate, 0, plLayRefMsg::kTexture ), plRefFlags::kActiveRef );
// lay->SetTexture( bitmap ); // lay->SetTexture( bitmap );
lay->SetTransform( textGen->GetLayerTransform() ); lay->SetTransform( textGen->GetLayerTransform() );
@ -235,20 +235,20 @@ plSceneObject *pfGUICtrlGenerator::IGenSceneObject( pfGUIDialogMod *dlg, plDra
if( snKey == nil ) if( snKey == nil )
snKey = fDynDlgNodes.Peek()->GetKey(); snKey = fDynDlgNodes.Peek()->GetKey();
hsgResMgr::ResMgr()->SendRef( myDraw->GetKey(), TRACKED_NEW plNodeRefMsg( snKey, plRefMsg::kOnCreate, 0, plNodeRefMsg::kDrawable ), plRefFlags::kActiveRef ); hsgResMgr::ResMgr()->SendRef( myDraw->GetKey(), new plNodeRefMsg( snKey, plRefMsg::kOnCreate, 0, plNodeRefMsg::kDrawable ), plRefFlags::kActiveRef );
plDrawInterface *newDI = TRACKED_NEW plDrawInterface; plDrawInterface *newDI = new plDrawInterface;
IAddKey( newDI, "GUIDrawIFace" ); IAddKey( newDI, "GUIDrawIFace" );
plSceneObject *newObj = TRACKED_NEW plSceneObject; plSceneObject *newObj = new plSceneObject;
IAddKey( newObj, "GUISceneObject" ); IAddKey( newObj, "GUISceneObject" );
plCoordinateInterface *newCI = TRACKED_NEW plCoordinateInterface; plCoordinateInterface *newCI = new plCoordinateInterface;
IAddKey( newCI, "GUICoordIFace" ); IAddKey( newCI, "GUICoordIFace" );
hsgResMgr::ResMgr()->SendRef( newCI->GetKey(), TRACKED_NEW plObjRefMsg( newObj->GetKey(), plRefMsg::kOnCreate, 0, plObjRefMsg::kInterface ), plRefFlags::kActiveRef ); hsgResMgr::ResMgr()->SendRef( newCI->GetKey(), new plObjRefMsg( newObj->GetKey(), plRefMsg::kOnCreate, 0, plObjRefMsg::kInterface ), plRefFlags::kActiveRef );
hsgResMgr::ResMgr()->SendRef( newDI->GetKey(), TRACKED_NEW plObjRefMsg( newObj->GetKey(), plRefMsg::kOnCreate, 0, plObjRefMsg::kInterface ), plRefFlags::kActiveRef ); hsgResMgr::ResMgr()->SendRef( newDI->GetKey(), new plObjRefMsg( newObj->GetKey(), plRefMsg::kOnCreate, 0, plObjRefMsg::kInterface ), plRefFlags::kActiveRef );
hsgResMgr::ResMgr()->SendRef( myDraw->GetKey(), TRACKED_NEW plIntRefMsg( newDI->GetKey(), plRefMsg::kOnCreate, 0, plIntRefMsg::kDrawable ), plRefFlags::kActiveRef ); hsgResMgr::ResMgr()->SendRef( myDraw->GetKey(), new plIntRefMsg( newDI->GetKey(), plRefMsg::kOnCreate, 0, plIntRefMsg::kDrawable ), plRefFlags::kActiveRef );
if( parent == nil ) if( parent == nil )
{ {
@ -258,8 +258,8 @@ plSceneObject *pfGUICtrlGenerator::IGenSceneObject( pfGUIDialogMod *dlg, plDra
} }
if( parent != nil ) if( parent != nil )
// hsgResMgr::ResMgr()->SendRef( newCI->GetKey(), TRACKED_NEW plIntRefMsg( parent->GetKey(), plRefMsg::kOnCreate, 0, plIntRefMsg::kChild ), plRefFlags::kActiveRef ); // hsgResMgr::ResMgr()->SendRef( newCI->GetKey(), new plIntRefMsg( parent->GetKey(), plRefMsg::kOnCreate, 0, plIntRefMsg::kChild ), plRefFlags::kActiveRef );
hsgResMgr::ResMgr()->SendRef( newCI->GetKey(), TRACKED_NEW plAttachMsg( parent->GetKey(), nil, plRefMsg::kOnRequest ), plRefFlags::kActiveRef ); hsgResMgr::ResMgr()->SendRef( newCI->GetKey(), new plAttachMsg( parent->GetKey(), nil, plRefMsg::kOnRequest ), plRefFlags::kActiveRef );
newObj->SetSceneNode( snKey ); newObj->SetSceneNode( snKey );
@ -289,7 +289,7 @@ pfGUIButtonMod *pfGUICtrlGenerator::GenerateRectButton( const char *title, floa
pfGUIButtonMod *but = CreateRectButton( dlgToAddTo, title, x, y, width, height, material ); pfGUIButtonMod *but = CreateRectButton( dlgToAddTo, title, x, y, width, height, material );
if( but != nil ) if( but != nil )
but->SetHandler( TRACKED_NEW pfGUIConsoleCmdProc( consoleCmd ) ); but->SetHandler( new pfGUIConsoleCmdProc( consoleCmd ) );
return but; return but;
} }
@ -329,11 +329,11 @@ pfGUIButtonMod *pfGUICtrlGenerator::CreateRectButton( pfGUIDialogMod *parent, c
plSceneObject *newObj = IGenSceneObject( parent, myDraw ); plSceneObject *newObj = IGenSceneObject( parent, myDraw );
pfGUIButtonMod *newBtn = asMenuItem ? TRACKED_NEW pfGUIMenuItem : TRACKED_NEW pfGUIButtonMod; pfGUIButtonMod *newBtn = asMenuItem ? new pfGUIMenuItem : new pfGUIButtonMod;
IAddKey( newBtn, "GUIButton" ); IAddKey( newBtn, "GUIButton" );
hsgResMgr::ResMgr()->SendRef( newBtn->GetKey(), TRACKED_NEW plObjRefMsg( newObj->GetKey(), plRefMsg::kOnCreate, 0, plObjRefMsg::kModifier ), plRefFlags::kActiveRef ); hsgResMgr::ResMgr()->SendRef( newBtn->GetKey(), new plObjRefMsg( newObj->GetKey(), plRefMsg::kOnCreate, 0, plObjRefMsg::kModifier ), plRefFlags::kActiveRef );
parent->AddControl( newBtn ); parent->AddControl( newBtn );
hsgResMgr::ResMgr()->AddViaNotify( newBtn->GetKey(), TRACKED_NEW plGenRefMsg( parent->GetKey(), plRefMsg::kOnCreate, parent->GetNumControls() - 1, pfGUIDialogMod::kControlRef ), plRefFlags::kActiveRef ); hsgResMgr::ResMgr()->AddViaNotify( newBtn->GetKey(), new plGenRefMsg( parent->GetKey(), plRefMsg::kOnCreate, parent->GetNumControls() - 1, pfGUIDialogMod::kControlRef ), plRefFlags::kActiveRef );
return newBtn; return newBtn;
} }
@ -373,10 +373,10 @@ pfGUIButtonMod *pfGUICtrlGenerator::GenerateSphereButton( float x, float y, flo
plSceneObject *newObj = IGenSceneObject( dlgToAddTo, myDraw );//, nil, &l2w, &w2l ); plSceneObject *newObj = IGenSceneObject( dlgToAddTo, myDraw );//, nil, &l2w, &w2l );
pfGUIButtonMod *newBtn = TRACKED_NEW pfGUIButtonMod; pfGUIButtonMod *newBtn = new pfGUIButtonMod;
IAddKey( newBtn, "GUIButton" ); IAddKey( newBtn, "GUIButton" );
newBtn->SetHandler( TRACKED_NEW pfGUIConsoleCmdProc( consoleCmd ) ); newBtn->SetHandler( new pfGUIConsoleCmdProc( consoleCmd ) );
hsgResMgr::ResMgr()->AddViaNotify( newBtn->GetKey(), TRACKED_NEW plObjRefMsg( newObj->GetKey(), plRefMsg::kOnCreate, 0, plObjRefMsg::kModifier ), plRefFlags::kActiveRef ); hsgResMgr::ResMgr()->AddViaNotify( newBtn->GetKey(), new plObjRefMsg( newObj->GetKey(), plRefMsg::kOnCreate, 0, plObjRefMsg::kModifier ), plRefFlags::kActiveRef );
dlgToAddTo->AddControl( newBtn ); dlgToAddTo->AddControl( newBtn );
return newBtn; return newBtn;
@ -420,9 +420,9 @@ pfGUIDragBarCtrl *pfGUICtrlGenerator::GenerateDragBar( float x, float y, float w
fDynDragBars[ fDynDragBars.GetCount() - 1 ] = newObj; fDynDragBars[ fDynDragBars.GetCount() - 1 ] = newObj;
pfGUIDragBarCtrl *newBtn = TRACKED_NEW pfGUIDragBarCtrl; pfGUIDragBarCtrl *newBtn = new pfGUIDragBarCtrl;
IAddKey( newBtn, "GUIDragBar" ); IAddKey( newBtn, "GUIDragBar" );
hsgResMgr::ResMgr()->AddViaNotify( newBtn->GetKey(), TRACKED_NEW plObjRefMsg( newObj->GetKey(), plRefMsg::kOnCreate, 0, plObjRefMsg::kModifier ), plRefFlags::kActiveRef ); hsgResMgr::ResMgr()->AddViaNotify( newBtn->GetKey(), new plObjRefMsg( newObj->GetKey(), plRefMsg::kOnCreate, 0, plObjRefMsg::kModifier ), plRefFlags::kActiveRef );
dlgToAddTo->AddControl( newBtn ); dlgToAddTo->AddControl( newBtn );
/* vec.Set( -x, y, 100 ); /* vec.Set( -x, y, 100 );
@ -456,7 +456,7 @@ pfGUIDialogMod *pfGUICtrlGenerator::IGenerateDialog( const char *name, float sc
// Create the rendermod // Create the rendermod
plPostEffectMod *renderMod = TRACKED_NEW plPostEffectMod; plPostEffectMod *renderMod = new plPostEffectMod;
IAddKey( renderMod, "GUIRenderMod" ); IAddKey( renderMod, "GUIRenderMod" );
renderMod->SetHither( 0.5f ); renderMod->SetHither( 0.5f );
@ -470,27 +470,27 @@ pfGUIDialogMod *pfGUICtrlGenerator::IGenerateDialog( const char *name, float sc
renderMod->SetFovY( fovY * 180.f / M_PI ); renderMod->SetFovY( fovY * 180.f / M_PI );
// Create the sceneNode to go with it // Create the sceneNode to go with it
node = TRACKED_NEW plSceneNode; node = new plSceneNode;
IAddKey( node, "GUISceneNode" ); IAddKey( node, "GUISceneNode" );
node->GetKey()->RefObject(); node->GetKey()->RefObject();
fDynDlgNodes.Append( node ); fDynDlgNodes.Append( node );
fDynDragBars.Append( nil ); fDynDragBars.Append( nil );
hsgResMgr::ResMgr()->AddViaNotify( node->GetKey(), TRACKED_NEW plGenRefMsg( renderMod->GetKey(), plRefMsg::kOnCreate, 0, plPostEffectMod::kNodeRef ), plRefFlags::kPassiveRef ); hsgResMgr::ResMgr()->AddViaNotify( node->GetKey(), new plGenRefMsg( renderMod->GetKey(), plRefMsg::kOnCreate, 0, plPostEffectMod::kNodeRef ), plRefFlags::kPassiveRef );
// Create the dialog // Create the dialog
dialog = TRACKED_NEW pfGUIDialogMod; dialog = new pfGUIDialogMod;
IAddKey( dialog, "GUIDialog" ); IAddKey( dialog, "GUIDialog" );
dialog->SetRenderMod( renderMod ); dialog->SetRenderMod( renderMod );
dialog->SetName( name ); dialog->SetName( name );
// Create the dummy scene object to hold the dialog // Create the dummy scene object to hold the dialog
plSceneObject *newObj = TRACKED_NEW plSceneObject; plSceneObject *newObj = new plSceneObject;
IAddKey( newObj, "GUISceneObject" ); IAddKey( newObj, "GUISceneObject" );
// *#&$(*@&#$ need a coordIface... // *#&$(*@&#$ need a coordIface...
plCoordinateInterface *newCI = TRACKED_NEW plCoordinateInterface; plCoordinateInterface *newCI = new plCoordinateInterface;
IAddKey( newCI, "GUICoordIFace" ); IAddKey( newCI, "GUICoordIFace" );
hsMatrix44 l2w, w2l; hsMatrix44 l2w, w2l;
@ -501,13 +501,13 @@ pfGUIDialogMod *pfGUICtrlGenerator::IGenerateDialog( const char *name, float sc
// Using SendRef here because AddViaNotify will queue the messages up, which doesn't do us any good // Using SendRef here because AddViaNotify will queue the messages up, which doesn't do us any good
// if we need these refs right away // if we need these refs right away
hsgResMgr::ResMgr()->SendRef( dialog->GetKey(), TRACKED_NEW plObjRefMsg( newObj->GetKey(), plRefMsg::kOnCreate, 0, plObjRefMsg::kModifier ), plRefFlags::kActiveRef ); hsgResMgr::ResMgr()->SendRef( dialog->GetKey(), new plObjRefMsg( newObj->GetKey(), plRefMsg::kOnCreate, 0, plObjRefMsg::kModifier ), plRefFlags::kActiveRef );
hsgResMgr::ResMgr()->AddViaNotify( newCI->GetKey(), TRACKED_NEW plObjRefMsg( newObj->GetKey(), plRefMsg::kOnCreate, 0, plObjRefMsg::kInterface ), plRefFlags::kActiveRef ); hsgResMgr::ResMgr()->AddViaNotify( newCI->GetKey(), new plObjRefMsg( newObj->GetKey(), plRefMsg::kOnCreate, 0, plObjRefMsg::kInterface ), plRefFlags::kActiveRef );
hsgResMgr::ResMgr()->AddViaNotify( renderMod->GetKey(), TRACKED_NEW plObjRefMsg( newObj->GetKey(), plRefMsg::kOnCreate, 0, plObjRefMsg::kModifier ), plRefFlags::kActiveRef ); hsgResMgr::ResMgr()->AddViaNotify( renderMod->GetKey(), new plObjRefMsg( newObj->GetKey(), plRefMsg::kOnCreate, 0, plObjRefMsg::kModifier ), plRefFlags::kActiveRef );
// Add the dialog to the GUI mgr // Add the dialog to the GUI mgr
plGenRefMsg *refMsg = TRACKED_NEW plGenRefMsg( pfGameGUIMgr::GetInstance()->GetKey(), plGenRefMsg *refMsg = new plGenRefMsg( pfGameGUIMgr::GetInstance()->GetKey(),
plRefMsg::kOnCreate, 0, pfGameGUIMgr::kDlgModRef ); plRefMsg::kOnCreate, 0, pfGameGUIMgr::kDlgModRef );
hsgResMgr::ResMgr()->AddViaNotify( dialog->GetKey(), refMsg, plRefFlags::kActiveRef ); hsgResMgr::ResMgr()->AddViaNotify( dialog->GetKey(), refMsg, plRefFlags::kActiveRef );

20
Sources/Plasma/FeatureLib/pfGameGUIMgr/pfGUIDialogMod.cpp

@ -88,7 +88,7 @@ pfGUIDialogMod::pfGUIDialogMod() : fRenderMod( nil ), fNext( nil ), fPrevPtr( ni
fDragTarget = nil; fDragTarget = nil;
fProcReceiver = nil; fProcReceiver = nil;
fColorScheme = TRACKED_NEW pfGUIColorScheme(); fColorScheme = new pfGUIColorScheme();
} }
pfGUIDialogMod::~pfGUIDialogMod() pfGUIDialogMod::~pfGUIDialogMod()
@ -102,7 +102,7 @@ pfGUIDialogMod::~pfGUIDialogMod()
plKey mgrKey = hsgResMgr::ResMgr()->FindKey( lu ); plKey mgrKey = hsgResMgr::ResMgr()->FindKey( lu );
if( mgrKey ) if( mgrKey )
{ {
plGenRefMsg *refMsg = TRACKED_NEW plGenRefMsg( mgrKey, plRefMsg::kOnRemove, 0, pfGameGUIMgr::kDlgModRef ); plGenRefMsg *refMsg = new plGenRefMsg( mgrKey, plRefMsg::kOnRemove, 0, pfGameGUIMgr::kDlgModRef );
refMsg->SetRef( this ); refMsg->SetRef( this );
plgDispatch::MsgSend( refMsg ); plgDispatch::MsgSend( refMsg );
} }
@ -163,14 +163,14 @@ hsBool pfGUIDialogMod::MsgReceive( plMessage *msg )
if( fEnabled ) if( fEnabled )
{ {
plAnimCmdMsg *animMsg = TRACKED_NEW plAnimCmdMsg( GetKey(), fRenderMod->GetKey(), nil ); plAnimCmdMsg *animMsg = new plAnimCmdMsg( GetKey(), fRenderMod->GetKey(), nil );
animMsg->SetCmd( plAnimCmdMsg::kContinue ); animMsg->SetCmd( plAnimCmdMsg::kContinue );
plgDispatch::MsgSend( animMsg ); plgDispatch::MsgSend( animMsg );
} }
} }
else if( ref->GetContext() & ( plRefMsg::kOnRemove | plRefMsg::kOnDestroy ) ) else if( ref->GetContext() & ( plRefMsg::kOnRemove | plRefMsg::kOnDestroy ) )
{ {
plAnimCmdMsg *animMsg = TRACKED_NEW plAnimCmdMsg( GetKey(), fRenderMod->GetKey(), nil ); plAnimCmdMsg *animMsg = new plAnimCmdMsg( GetKey(), fRenderMod->GetKey(), nil );
animMsg->SetCmd( plAnimCmdMsg::kStop ); animMsg->SetCmd( plAnimCmdMsg::kStop );
plgDispatch::MsgSend( animMsg ); plgDispatch::MsgSend( animMsg );
@ -235,7 +235,7 @@ void pfGUIDialogMod::AddControl( pfGUIControlMod *ctrl )
void pfGUIDialogMod::AddControlOnExport( pfGUIControlMod *ctrl ) void pfGUIDialogMod::AddControlOnExport( pfGUIControlMod *ctrl )
{ {
fControls.Append( ctrl ); fControls.Append( ctrl );
hsgResMgr::ResMgr()->AddViaNotify( ctrl->GetKey(), TRACKED_NEW plGenRefMsg( GetKey(), plRefMsg::kOnCreate, fControls.GetCount() - 1, pfGUIDialogMod::kControlRef ), plRefFlags::kActiveRef ); hsgResMgr::ResMgr()->AddViaNotify( ctrl->GetKey(), new plGenRefMsg( GetKey(), plRefMsg::kOnCreate, fControls.GetCount() - 1, pfGUIDialogMod::kControlRef ), plRefFlags::kActiveRef );
} }
//// SetEnabled ////////////////////////////////////////////////////////////// //// SetEnabled //////////////////////////////////////////////////////////////
@ -271,7 +271,7 @@ void pfGUIDialogMod::SetEnabled( hsBool e )
if( fRenderMod != nil ) if( fRenderMod != nil )
{ {
plAnimCmdMsg *animMsg = TRACKED_NEW plAnimCmdMsg( GetKey(), fRenderMod->GetKey(), nil ); plAnimCmdMsg *animMsg = new plAnimCmdMsg( GetKey(), fRenderMod->GetKey(), nil );
if( fEnabled ) if( fEnabled )
{ {
animMsg->SetCmd( plAnimCmdMsg::kContinue ); animMsg->SetCmd( plAnimCmdMsg::kContinue );
@ -292,21 +292,21 @@ void pfGUIDialogMod::Read( hsStream *s, hsResMgr *mgr )
{ {
plSingleModifier::Read(s, mgr); plSingleModifier::Read(s, mgr);
mgr->ReadKeyNotifyMe( s, TRACKED_NEW plGenRefMsg( GetKey(), plRefMsg::kOnCreate, -1, kRenderModRef ), plRefFlags::kActiveRef ); mgr->ReadKeyNotifyMe( s, new plGenRefMsg( GetKey(), plRefMsg::kOnCreate, -1, kRenderModRef ), plRefFlags::kActiveRef );
s->Read( sizeof( fName ), fName ); s->Read( sizeof( fName ), fName );
uint32_t i, count = s->ReadLE32(); uint32_t i, count = s->ReadLE32();
fControls.SetCountAndZero( count ); fControls.SetCountAndZero( count );
for( i = 0; i < count; i++ ) for( i = 0; i < count; i++ )
mgr->ReadKeyNotifyMe( s, TRACKED_NEW plGenRefMsg( GetKey(), plRefMsg::kOnCreate, i, kControlRef ), plRefFlags::kActiveRef ); mgr->ReadKeyNotifyMe( s, new plGenRefMsg( GetKey(), plRefMsg::kOnCreate, i, kControlRef ), plRefFlags::kActiveRef );
// Register us with the Game GUI manager // Register us with the Game GUI manager
plUoid lu( kGameGUIMgr_KEY ); plUoid lu( kGameGUIMgr_KEY );
plKey mgrKey = hsgResMgr::ResMgr()->FindKey( lu ); plKey mgrKey = hsgResMgr::ResMgr()->FindKey( lu );
if( mgrKey ) if( mgrKey )
{ {
plGenRefMsg *refMsg = TRACKED_NEW plGenRefMsg( mgrKey, plRefMsg::kOnCreate, 0, pfGameGUIMgr::kDlgModRef ); plGenRefMsg *refMsg = new plGenRefMsg( mgrKey, plRefMsg::kOnCreate, 0, pfGameGUIMgr::kDlgModRef );
hsgResMgr::ResMgr()->AddViaNotify( GetKey(), refMsg, plRefFlags::kPassiveRef ); hsgResMgr::ResMgr()->AddViaNotify( GetKey(), refMsg, plRefFlags::kPassiveRef );
} }
@ -314,7 +314,7 @@ void pfGUIDialogMod::Read( hsStream *s, hsResMgr *mgr )
fProcReceiver = mgr->ReadKey( s ); fProcReceiver = mgr->ReadKey( s );
if( fProcReceiver != nil ) if( fProcReceiver != nil )
SetHandler( TRACKED_NEW pfGUIDialogNotifyProc( fProcReceiver ) ); SetHandler( new pfGUIDialogNotifyProc( fProcReceiver ) );
s->ReadLE( &fVersion ); s->ReadLE( &fVersion );

2
Sources/Plasma/FeatureLib/pfGameGUIMgr/pfGUIDialogNotifyProc.cpp

@ -75,7 +75,7 @@ pfGUIDialogNotifyProc::pfGUIDialogNotifyProc( plKey &r )
void pfGUIDialogNotifyProc::ISendNotify( plKey ctrlKey, uint32_t event ) void pfGUIDialogNotifyProc::ISendNotify( plKey ctrlKey, uint32_t event )
{ {
pfGUINotifyMsg *notify = TRACKED_NEW pfGUINotifyMsg( fDialog->GetKey(), fReceiver, nil ); pfGUINotifyMsg *notify = new pfGUINotifyMsg( fDialog->GetKey(), fReceiver, nil );
notify->SetEvent( ctrlKey, event ); notify->SetEvent( ctrlKey, event );
plgDispatch::MsgSend( notify ); plgDispatch::MsgSend( notify );
} }

12
Sources/Plasma/FeatureLib/pfGameGUIMgr/pfGUIDynDisplayCtrl.cpp

@ -124,17 +124,17 @@ void pfGUIDynDisplayCtrl::Read( hsStream *s, hsResMgr *mgr )
count = s->ReadLE32(); count = s->ReadLE32();
fTextMaps.SetCountAndZero( count ); fTextMaps.SetCountAndZero( count );
for( i = 0; i < count; i++ ) for( i = 0; i < count; i++ )
mgr->ReadKeyNotifyMe( s, TRACKED_NEW plGenRefMsg( GetKey(), plRefMsg::kOnCreate, i, kRefTextMap ), plRefFlags::kActiveRef ); mgr->ReadKeyNotifyMe( s, new plGenRefMsg( GetKey(), plRefMsg::kOnCreate, i, kRefTextMap ), plRefFlags::kActiveRef );
count = s->ReadLE32(); count = s->ReadLE32();
fLayers.SetCountAndZero( count ); fLayers.SetCountAndZero( count );
for( i = 0; i < count; i++ ) for( i = 0; i < count; i++ )
mgr->ReadKeyNotifyMe( s, TRACKED_NEW plGenRefMsg( GetKey(), plRefMsg::kOnCreate, i, kRefLayer ), plRefFlags::kActiveRef ); mgr->ReadKeyNotifyMe( s, new plGenRefMsg( GetKey(), plRefMsg::kOnCreate, i, kRefLayer ), plRefFlags::kActiveRef );
count = s->ReadLE32(); count = s->ReadLE32();
fMaterials.SetCountAndZero( count ); fMaterials.SetCountAndZero( count );
for( i = 0; i < count; i++ ) for( i = 0; i < count; i++ )
mgr->ReadKeyNotifyMe( s, TRACKED_NEW plGenRefMsg( GetKey(), plRefMsg::kOnCreate, i, kRefMaterial ), plRefFlags::kActiveRef ); mgr->ReadKeyNotifyMe( s, new plGenRefMsg( GetKey(), plRefMsg::kOnCreate, i, kRefMaterial ), plRefFlags::kActiveRef );
} }
void pfGUIDynDisplayCtrl::Write( hsStream *s, hsResMgr *mgr ) void pfGUIDynDisplayCtrl::Write( hsStream *s, hsResMgr *mgr )
@ -163,7 +163,7 @@ void pfGUIDynDisplayCtrl::Write( hsStream *s, hsResMgr *mgr )
void pfGUIDynDisplayCtrl::AddMap( plDynamicTextMap *map ) void pfGUIDynDisplayCtrl::AddMap( plDynamicTextMap *map )
{ {
fTextMaps.Append( map ); fTextMaps.Append( map );
hsgResMgr::ResMgr()->AddViaNotify( map->GetKey(), TRACKED_NEW plGenRefMsg( GetKey(), plRefMsg::kOnCreate, fTextMaps.GetCount() - 1, kRefTextMap ), plRefFlags::kActiveRef ); hsgResMgr::ResMgr()->AddViaNotify( map->GetKey(), new plGenRefMsg( GetKey(), plRefMsg::kOnCreate, fTextMaps.GetCount() - 1, kRefTextMap ), plRefFlags::kActiveRef );
} }
//// AddLayer //////////////////////////////////////////////////////////////// //// AddLayer ////////////////////////////////////////////////////////////////
@ -172,7 +172,7 @@ void pfGUIDynDisplayCtrl::AddMap( plDynamicTextMap *map )
void pfGUIDynDisplayCtrl::AddLayer( plLayerInterface *layer ) void pfGUIDynDisplayCtrl::AddLayer( plLayerInterface *layer )
{ {
fLayers.Append( layer ); fLayers.Append( layer );
hsgResMgr::ResMgr()->AddViaNotify( layer->GetKey(), TRACKED_NEW plGenRefMsg( GetKey(), plRefMsg::kOnCreate, fLayers.GetCount() - 1, kRefLayer ), plRefFlags::kActiveRef ); hsgResMgr::ResMgr()->AddViaNotify( layer->GetKey(), new plGenRefMsg( GetKey(), plRefMsg::kOnCreate, fLayers.GetCount() - 1, kRefLayer ), plRefFlags::kActiveRef );
} }
//// AddMaterial ///////////////////////////////////////////////////////////// //// AddMaterial /////////////////////////////////////////////////////////////
@ -181,5 +181,5 @@ void pfGUIDynDisplayCtrl::AddLayer( plLayerInterface *layer )
void pfGUIDynDisplayCtrl::AddMaterial( hsGMaterial *material ) void pfGUIDynDisplayCtrl::AddMaterial( hsGMaterial *material )
{ {
fMaterials.Append( material ); fMaterials.Append( material );
hsgResMgr::ResMgr()->AddViaNotify( material->GetKey(), TRACKED_NEW plGenRefMsg( GetKey(), plRefMsg::kOnCreate, fMaterials.GetCount() - 1, kRefMaterial ), plRefFlags::kActiveRef ); hsgResMgr::ResMgr()->AddViaNotify( material->GetKey(), new plGenRefMsg( GetKey(), plRefMsg::kOnCreate, fMaterials.GetCount() - 1, kRefMaterial ), plRefFlags::kActiveRef );
} }

2
Sources/Plasma/FeatureLib/pfGameGUIMgr/pfGUIEditBoxMod.cpp

@ -477,7 +477,7 @@ void pfGUIEditBoxMod::SetBufferSize( uint32_t size )
fBufferSize = size; fBufferSize = size;
if( size > 0 ) if( size > 0 )
{ {
fBuffer = TRACKED_NEW wchar_t[ size + 1 ]; fBuffer = new wchar_t[ size + 1 ];
memset( fBuffer, 0, (size + 1) * sizeof(wchar_t) ); memset( fBuffer, 0, (size + 1) * sizeof(wchar_t) );
} }
else else

4
Sources/Plasma/FeatureLib/pfGameGUIMgr/pfGUIKnobCtrl.cpp

@ -268,7 +268,7 @@ void pfGUIKnobCtrl::SetAnimationKeys( hsTArray<plKey> &keys, const char *name
delete [] fAnimName; delete [] fAnimName;
if( name != nil ) if( name != nil )
{ {
fAnimName = TRACKED_NEW char[ strlen( name ) + 1 ]; fAnimName = new char[ strlen( name ) + 1 ];
strcpy( fAnimName, name ); strcpy( fAnimName, name );
} }
else else
@ -353,7 +353,7 @@ void pfGUIKnobCtrl::SetCurrValue( float v )
else else
newTime = ( ( fValue - fMin ) / ( fMax - fMin ) ) * tLength + fAnimBegin; newTime = ( ( fValue - fMin ) / ( fMax - fMin ) ) * tLength + fAnimBegin;
} }
plAnimCmdMsg *msg = TRACKED_NEW plAnimCmdMsg(); plAnimCmdMsg *msg = new plAnimCmdMsg();
msg->SetCmd( plAnimCmdMsg::kGoToTime ); msg->SetCmd( plAnimCmdMsg::kGoToTime );
msg->SetAnimName( fAnimName ); msg->SetAnimName( fAnimName );
msg->fTime = newTime; msg->fTime = newTime;

8
Sources/Plasma/FeatureLib/pfGameGUIMgr/pfGUIListBoxMod.cpp

@ -516,9 +516,9 @@ void pfGUIListBoxMod::Read( hsStream *s, hsResMgr *mgr )
fScrollControl = nil; fScrollControl = nil;
if( s->ReadBool() ) if( s->ReadBool() )
{ {
fScrollProc = TRACKED_NEW pfScrollProc( this ); fScrollProc = new pfScrollProc( this );
fScrollProc->IncRef(); fScrollProc->IncRef();
mgr->ReadKeyNotifyMe( s, TRACKED_NEW plGenRefMsg( GetKey(), plRefMsg::kOnCreate, -1, kRefScrollCtrl ), plRefFlags::kActiveRef ); mgr->ReadKeyNotifyMe( s, new plGenRefMsg( GetKey(), plRefMsg::kOnCreate, -1, kRefScrollCtrl ), plRefFlags::kActiveRef );
} }
if( HasFlag( kDisableSelection ) ) if( HasFlag( kDisableSelection ) )
@ -1154,12 +1154,12 @@ void pfGUIListBoxMod::ClearAllElements( void )
uint16_t pfGUIListBoxMod::AddString( const char *string ) uint16_t pfGUIListBoxMod::AddString( const char *string )
{ {
return AddElement( TRACKED_NEW pfGUIListText( string ) ); return AddElement( new pfGUIListText( string ) );
} }
uint16_t pfGUIListBoxMod::AddString( const wchar_t *string ) uint16_t pfGUIListBoxMod::AddString( const wchar_t *string )
{ {
return AddElement( TRACKED_NEW pfGUIListText( string ) ); return AddElement( new pfGUIListText( string ) );
} }
int16_t pfGUIListBoxMod::FindString( const char *toCompareTo ) int16_t pfGUIListBoxMod::FindString( const char *toCompareTo )

8
Sources/Plasma/FeatureLib/pfGameGUIMgr/pfGUIListElement.cpp

@ -91,7 +91,7 @@ pfGUIListText::pfGUIListText( const char *text ) : pfGUIListElement( kText )
pfGUIListText::pfGUIListText( const wchar_t *text ) : pfGUIListElement( kText ) pfGUIListText::pfGUIListText( const wchar_t *text ) : pfGUIListElement( kText )
{ {
fText = TRACKED_NEW wchar_t[ wcslen( text ) + 1 ]; fText = new wchar_t[ wcslen( text ) + 1 ];
wcscpy( fText, text ); wcscpy( fText, text );
fJustify = kLeftJustify; fJustify = kLeftJustify;
} }
@ -173,7 +173,7 @@ void pfGUIListText::SetText( const wchar_t *text )
delete [] fText; delete [] fText;
if( text != nil ) if( text != nil )
{ {
fText = TRACKED_NEW wchar_t[ wcslen( text ) + 1 ]; fText = new wchar_t[ wcslen( text ) + 1 ];
wcscpy( fText, text ); wcscpy( fText, text );
} }
else else
@ -309,7 +309,7 @@ pfGUIListTreeRoot::pfGUIListTreeRoot( const char *text ) : pfGUIListElement( kTr
pfGUIListTreeRoot::pfGUIListTreeRoot( const wchar_t *text ) : pfGUIListElement( kTreeRoot ) pfGUIListTreeRoot::pfGUIListTreeRoot( const wchar_t *text ) : pfGUIListElement( kTreeRoot )
{ {
fText = TRACKED_NEW wchar_t[ wcslen( text ) + 1 ]; fText = new wchar_t[ wcslen( text ) + 1 ];
wcscpy( fText, text ); wcscpy( fText, text );
} }
@ -432,7 +432,7 @@ void pfGUIListTreeRoot::SetTitle( const wchar_t *text )
delete [] fText; delete [] fText;
if( text != nil ) if( text != nil )
{ {
fText = TRACKED_NEW wchar_t[ wcslen( text ) + 1 ]; fText = new wchar_t[ wcslen( text ) + 1 ];
wcscpy( fText, text ); wcscpy( fText, text );
} }
else else

4
Sources/Plasma/FeatureLib/pfGameGUIMgr/pfGUIMenuItem.cpp

@ -89,7 +89,7 @@ void pfGUIMenuItem::SetName( const wchar_t *name )
delete [] fName; delete [] fName;
if (name != nil) if (name != nil)
{ {
fName = TRACKED_NEW wchar_t[wcslen(name)+1]; fName = new wchar_t[wcslen(name)+1];
wcscpy(fName,name); wcscpy(fName,name);
} }
else else
@ -107,7 +107,7 @@ void pfGUIMenuItem::SetSkin( pfGUISkin *skin, HowToSkin s )
GetKey()->Release( fSkin->GetKey() ); GetKey()->Release( fSkin->GetKey() );
if( skin != nil ) if( skin != nil )
hsgResMgr::ResMgr()->SendRef( skin->GetKey(), TRACKED_NEW plGenRefMsg( GetKey(), plRefMsg::kOnCreate, -1, kRefSkin ), plRefFlags::kActiveRef ); hsgResMgr::ResMgr()->SendRef( skin->GetKey(), new plGenRefMsg( GetKey(), plRefMsg::kOnCreate, -1, kRefSkin ), plRefFlags::kActiveRef );
fHowToSkin = s; fHowToSkin = s;

12
Sources/Plasma/FeatureLib/pfGameGUIMgr/pfGUIMultiLineEditCtrl.cpp

@ -649,9 +649,9 @@ void pfGUIMultiLineEditCtrl::Read( hsStream *s, hsResMgr *mgr )
fScrollControl = nil; fScrollControl = nil;
if( s->ReadBool() ) if( s->ReadBool() )
{ {
fScrollProc = TRACKED_NEW pfMLScrollProc( this ); fScrollProc = new pfMLScrollProc( this );
fScrollProc->IncRef(); fScrollProc->IncRef();
mgr->ReadKeyNotifyMe( s, TRACKED_NEW plGenRefMsg( GetKey(), plRefMsg::kOnCreate, -1, kRefScrollCtrl ), plRefFlags::kActiveRef ); mgr->ReadKeyNotifyMe( s, new plGenRefMsg( GetKey(), plRefMsg::kOnCreate, -1, kRefScrollCtrl ), plRefFlags::kActiveRef );
} }
} }
@ -1460,7 +1460,7 @@ wchar_t *pfGUIMultiLineEditCtrl::ICopyRange( int32_t start, int32_t end ) const
} }
// Our string... // Our string...
string = TRACKED_NEW wchar_t[ stringSize + 1 ]; string = new wchar_t[ stringSize + 1 ];
// Now actually copy the characters // Now actually copy the characters
for( stringSize = 0, pos = start; pos < end; pos = pos + IOffsetToNextChar( fBuffer[ pos ] ) ) for( stringSize = 0, pos = start; pos < end; pos = pos + IOffsetToNextChar( fBuffer[ pos ] ) )
@ -1508,7 +1508,7 @@ void pfGUIMultiLineEditCtrl::SetBuffer( const wchar_t *asciiText )
void pfGUIMultiLineEditCtrl::SetBuffer( const uint8_t *codedText, uint32_t length ) void pfGUIMultiLineEditCtrl::SetBuffer( const uint8_t *codedText, uint32_t length )
{ {
// convert to uint16_t and set // convert to uint16_t and set
uint16_t *convertedText = TRACKED_NEW uint16_t[ length ]; uint16_t *convertedText = new uint16_t[ length ];
for( int32_t curChar = 0; curChar < length; curChar++ ) for( int32_t curChar = 0; curChar < length; curChar++ )
convertedText[ curChar ] = (uint16_t)codedText[ curChar ]; convertedText[ curChar ] = (uint16_t)codedText[ curChar ];
SetBuffer(convertedText,length); SetBuffer(convertedText,length);
@ -1584,7 +1584,7 @@ uint8_t *pfGUIMultiLineEditCtrl::GetCodedBuffer( uint32_t &length ) const
length = fBuffer.GetCount() - 1; length = fBuffer.GetCount() - 1;
// convert to uint8_t and return // convert to uint8_t and return
uint8_t *buffer = TRACKED_NEW uint8_t[ length ]; uint8_t *buffer = new uint8_t[ length ];
for (int32_t curChar = 0; curChar < length; curChar++) for (int32_t curChar = 0; curChar < length; curChar++)
{ {
@ -1609,7 +1609,7 @@ uint16_t *pfGUIMultiLineEditCtrl::GetCodedBufferW( uint32_t &length ) const
{ {
length = fBuffer.GetCount() - 1; length = fBuffer.GetCount() - 1;
uint16_t *buffer = TRACKED_NEW uint16_t[ length ]; uint16_t *buffer = new uint16_t[ length ];
// AcquireArray() isn't const... // AcquireArray() isn't const...
memcpy( buffer, &fBuffer[ 0 ], length * sizeof(uint16_t) ); memcpy( buffer, &fBuffer[ 0 ], length * sizeof(uint16_t) );

58
Sources/Plasma/FeatureLib/pfGameGUIMgr/pfGUIPopUpMenu.cpp

@ -236,7 +236,7 @@ void pfGUIPopUpMenu::Read( hsStream *s, hsResMgr *mgr )
pfGUIDialogMod::Read( s, mgr ); pfGUIDialogMod::Read( s, mgr );
// In case we need it... // In case we need it...
fKeyGen = TRACKED_NEW pfPopUpKeyGenerator( GetName(), GetKey()->GetUoid().GetLocation() ); fKeyGen = new pfPopUpKeyGenerator( GetName(), GetKey()->GetUoid().GetLocation() );
fOriginX = fOriginY = -1.f; fOriginX = fOriginY = -1.f;
@ -254,12 +254,12 @@ void pfGUIPopUpMenu::Read( hsStream *s, hsResMgr *mgr )
fMenuItems[ i ].fHandler = pfGUICtrlProcWriteableObject::Read( s ); fMenuItems[ i ].fHandler = pfGUICtrlProcWriteableObject::Read( s );
mgr->ReadKeyNotifyMe( s, TRACKED_NEW plGenRefMsg( GetKey(), plRefMsg::kOnCreate, i, kRefSubMenu ), plRefFlags::kActiveRef ); mgr->ReadKeyNotifyMe( s, new plGenRefMsg( GetKey(), plRefMsg::kOnCreate, i, kRefSubMenu ), plRefFlags::kActiveRef );
} }
mgr->ReadKeyNotifyMe( s, TRACKED_NEW plGenRefMsg( GetKey(), plRefMsg::kOnCreate, -1, kRefSkin ), plRefFlags::kActiveRef ); mgr->ReadKeyNotifyMe( s, new plGenRefMsg( GetKey(), plRefMsg::kOnCreate, -1, kRefSkin ), plRefFlags::kActiveRef );
mgr->ReadKeyNotifyMe( s, TRACKED_NEW plGenRefMsg( GetKey(), plRefMsg::kOnCreate, -1, kRefOriginAnchor ), plRefFlags::kPassiveRef ); mgr->ReadKeyNotifyMe( s, new plGenRefMsg( GetKey(), plRefMsg::kOnCreate, -1, kRefOriginAnchor ), plRefFlags::kPassiveRef );
mgr->ReadKeyNotifyMe( s, TRACKED_NEW plGenRefMsg( GetKey(), plRefMsg::kOnCreate, -1, kRefOriginContext ), plRefFlags::kPassiveRef ); mgr->ReadKeyNotifyMe( s, new plGenRefMsg( GetKey(), plRefMsg::kOnCreate, -1, kRefOriginContext ), plRefFlags::kPassiveRef );
fAlignment = (Alignment)s->ReadByte(); fAlignment = (Alignment)s->ReadByte();
@ -306,8 +306,8 @@ void pfGUIPopUpMenu::SetOriginAnchor( plSceneObject *anchor, pfGUIDialogMod *
{ {
fOriginAnchor = anchor; fOriginAnchor = anchor;
fOriginContext = context; fOriginContext = context;
hsgResMgr::ResMgr()->AddViaNotify( fOriginAnchor->GetKey(), TRACKED_NEW plGenRefMsg( GetKey(), plRefMsg::kOnCreate, -1, kRefOriginAnchor ), plRefFlags::kPassiveRef ); hsgResMgr::ResMgr()->AddViaNotify( fOriginAnchor->GetKey(), new plGenRefMsg( GetKey(), plRefMsg::kOnCreate, -1, kRefOriginAnchor ), plRefFlags::kPassiveRef );
hsgResMgr::ResMgr()->AddViaNotify( fOriginContext->GetKey(), TRACKED_NEW plGenRefMsg( GetKey(), plRefMsg::kOnCreate, -1, kRefOriginContext ), plRefFlags::kPassiveRef ); hsgResMgr::ResMgr()->AddViaNotify( fOriginContext->GetKey(), new plGenRefMsg( GetKey(), plRefMsg::kOnCreate, -1, kRefOriginContext ), plRefFlags::kPassiveRef );
} }
//// SetEnabled ////////////////////////////////////////////////////////////// //// SetEnabled //////////////////////////////////////////////////////////////
@ -438,7 +438,7 @@ hsBool pfGUIPopUpMenu::IBuildMenu( void )
if( fWaitingForSkin && fSkin == nil ) if( fWaitingForSkin && fSkin == nil )
return false; // Still waiting to get our skin before building return false; // Still waiting to get our skin before building
pfGUIColorScheme *scheme = TRACKED_NEW pfGUIColorScheme(); pfGUIColorScheme *scheme = new pfGUIColorScheme();
scheme->fForeColor.Set( 0, 0, 0, 1 ); scheme->fForeColor.Set( 0, 0, 0, 1 );
scheme->fBackColor.Set( 1, 1, 1, 1 ); scheme->fBackColor.Set( 1, 1, 1, 1 );
@ -473,7 +473,7 @@ hsBool pfGUIPopUpMenu::IBuildMenu( void )
// The PROBLEM is that we can't do that unless we have a friggin surface on // The PROBLEM is that we can't do that unless we have a friggin surface on
// which to calculate the text extents! So sadly, we're going to have to create // which to calculate the text extents! So sadly, we're going to have to create
// a whole new DTMap and use it to calculate some stuff // a whole new DTMap and use it to calculate some stuff
plDynamicTextMap *scratch = TRACKED_NEW plDynamicTextMap( 8, 8, false ); plDynamicTextMap *scratch = new plDynamicTextMap( 8, 8, false );
scratch->SetFont( scheme->fFontFace, scheme->fFontSize, scheme->fFontFlags, true ); scratch->SetFont( scheme->fFontFace, scheme->fFontSize, scheme->fFontFlags, true );
for( i = 0; i < fMenuItems.GetCount(); i++ ) for( i = 0; i < fMenuItems.GetCount(); i++ )
{ {
@ -561,7 +561,7 @@ hsBool pfGUIPopUpMenu::IBuildMenu( void )
{ {
button->SetColorScheme( scheme ); button->SetColorScheme( scheme );
button->SetName( fMenuItems[ i ].fName.c_str() ); button->SetName( fMenuItems[ i ].fName.c_str() );
button->SetHandler( TRACKED_NEW pfGUIMenuItemProc( this, i ) ); button->SetHandler( new pfGUIMenuItemProc( this, i ) );
// make the tag ID the position in the menu list // make the tag ID the position in the menu list
button->SetTagID(i); button->SetTagID(i);
button->SetDynTextMap( mat->GetLayer( 0 ), plDynamicTextMap::ConvertNoRef( mat->GetLayer( 0 )->GetTexture() ) ); button->SetDynTextMap( mat->GetLayer( 0 ), plDynamicTextMap::ConvertNoRef( mat->GetLayer( 0 )->GetTexture() ) );
@ -704,11 +704,11 @@ hsGMaterial *pfGUIPopUpMenu::ICreateDynMaterial( void )
// Create the new dynTextMap // Create the new dynTextMap
plDynamicTextMap *textMap = TRACKED_NEW plDynamicTextMap(); plDynamicTextMap *textMap = new plDynamicTextMap();
fKeyGen->CreateKey( textMap ); fKeyGen->CreateKey( textMap );
// Create the material // Create the material
hsGMaterial *material = TRACKED_NEW hsGMaterial; hsGMaterial *material = new hsGMaterial;
fKeyGen->CreateKey( material ); fKeyGen->CreateKey( material );
// Create the layer and attach // Create the layer and attach
@ -722,7 +722,7 @@ hsGMaterial *pfGUIPopUpMenu::ICreateDynMaterial( void )
lay->SetClampFlags( hsGMatState::kClampTexture ); lay->SetClampFlags( hsGMatState::kClampTexture );
// Do sendRef here, since we're going to need it set pretty darned quick // Do sendRef here, since we're going to need it set pretty darned quick
hsgResMgr::ResMgr()->SendRef( textMap->GetKey(), TRACKED_NEW plLayRefMsg( lay->GetKey(), plRefMsg::kOnCreate, 0, plLayRefMsg::kTexture ), plRefFlags::kActiveRef ); hsgResMgr::ResMgr()->SendRef( textMap->GetKey(), new plLayRefMsg( lay->GetKey(), plRefMsg::kOnCreate, 0, plLayRefMsg::kTexture ), plRefFlags::kActiveRef );
return material; return material;
@ -739,8 +739,8 @@ pfGUIPopUpMenu *pfGUIPopUpMenu::Build( const char *name, pfGUIDialogMod *parent
// Create the menu and give it a key gen // Create the menu and give it a key gen
pfGUIPopUpMenu *menu = TRACKED_NEW pfGUIPopUpMenu(); pfGUIPopUpMenu *menu = new pfGUIPopUpMenu();
menu->fKeyGen = TRACKED_NEW pfPopUpKeyGenerator( name, destLoc ); menu->fKeyGen = new pfPopUpKeyGenerator( name, destLoc );
menu->fKeyGen->CreateKey( menu ); menu->fKeyGen->CreateKey( menu );
menu->fOriginX = x; menu->fOriginX = x;
@ -750,7 +750,7 @@ pfGUIPopUpMenu *pfGUIPopUpMenu::Build( const char *name, pfGUIDialogMod *parent
if( parent != nil && ( (pfGUIPopUpMenu *)parent )->fSkin != nil ) if( parent != nil && ( (pfGUIPopUpMenu *)parent )->fSkin != nil )
{ {
menu->fWaitingForSkin = true; menu->fWaitingForSkin = true;
hsgResMgr::ResMgr()->SendRef( ( (pfGUIPopUpMenu *)parent )->fSkin->GetKey(), TRACKED_NEW plGenRefMsg( menu->GetKey(), plRefMsg::kOnCreate, -1, pfGUIPopUpMenu::kRefSkin ), plRefFlags::kActiveRef ); hsgResMgr::ResMgr()->SendRef( ( (pfGUIPopUpMenu *)parent )->fSkin->GetKey(), new plGenRefMsg( menu->GetKey(), plRefMsg::kOnCreate, -1, pfGUIPopUpMenu::kRefSkin ), plRefFlags::kActiveRef );
} }
// HACK for now: create us a temp skin to use // HACK for now: create us a temp skin to use
@ -761,12 +761,12 @@ pfGUIPopUpMenu *pfGUIPopUpMenu::Build( const char *name, pfGUIDialogMod *parent
loc.Set( 0x1425 ); loc.Set( 0x1425 );
plKey skinKey = hsgResMgr::ResMgr()->FindKey( plUoid( loc, pfGUISkin::Index(), "GUISkin01_GUISkin" ) ); plKey skinKey = hsgResMgr::ResMgr()->FindKey( plUoid( loc, pfGUISkin::Index(), "GUISkin01_GUISkin" ) );
menu->fWaitingForSkin = true; menu->fWaitingForSkin = true;
hsgResMgr::ResMgr()->AddViaNotify( skinKey, TRACKED_NEW plGenRefMsg( menu->GetKey(), plRefMsg::kOnCreate, -1, pfGUIPopUpMenu::kRefSkin ), plRefFlags::kActiveRef ); hsgResMgr::ResMgr()->AddViaNotify( skinKey, new plGenRefMsg( menu->GetKey(), plRefMsg::kOnCreate, -1, pfGUIPopUpMenu::kRefSkin ), plRefFlags::kActiveRef );
} }
*/ */
// Create the rendermod // Create the rendermod
plPostEffectMod *renderMod = TRACKED_NEW plPostEffectMod; plPostEffectMod *renderMod = new plPostEffectMod;
menu->fKeyGen->CreateKey( renderMod ); menu->fKeyGen->CreateKey( renderMod );
renderMod->SetHither( 0.5f ); renderMod->SetHither( 0.5f );
@ -782,22 +782,22 @@ pfGUIPopUpMenu *pfGUIPopUpMenu::Build( const char *name, pfGUIDialogMod *parent
renderMod->SetFovY( fovY * 180.f / M_PI ); renderMod->SetFovY( fovY * 180.f / M_PI );
// Create the sceneNode to go with it // Create the sceneNode to go with it
menu->fParentNode= TRACKED_NEW plSceneNode; menu->fParentNode= new plSceneNode;
menu->fKeyGen->CreateKey( menu->fParentNode ); menu->fKeyGen->CreateKey( menu->fParentNode );
// menu->fParentNode->GetKey()->RefObject(); // menu->fParentNode->GetKey()->RefObject();
hsgResMgr::ResMgr()->SendRef( menu->fParentNode->GetKey(), TRACKED_NEW plGenRefMsg( menu->GetKey(), plRefMsg::kOnCreate, 0, kRefParentNode ), plRefFlags::kActiveRef ); hsgResMgr::ResMgr()->SendRef( menu->fParentNode->GetKey(), new plGenRefMsg( menu->GetKey(), plRefMsg::kOnCreate, 0, kRefParentNode ), plRefFlags::kActiveRef );
hsgResMgr::ResMgr()->AddViaNotify( menu->fParentNode->GetKey(), TRACKED_NEW plGenRefMsg( renderMod->GetKey(), plRefMsg::kOnCreate, 0, plPostEffectMod::kNodeRef ), plRefFlags::kPassiveRef ); hsgResMgr::ResMgr()->AddViaNotify( menu->fParentNode->GetKey(), new plGenRefMsg( renderMod->GetKey(), plRefMsg::kOnCreate, 0, plPostEffectMod::kNodeRef ), plRefFlags::kPassiveRef );
menu->SetRenderMod( renderMod ); menu->SetRenderMod( renderMod );
menu->SetName( name ); menu->SetName( name );
// 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;
menu->fKeyGen->CreateKey( newObj ); menu->fKeyGen->CreateKey( newObj );
// *#&$(*@&#$ need a coordIface... // *#&$(*@&#$ need a coordIface...
plCoordinateInterface *newCI = TRACKED_NEW plCoordinateInterface; plCoordinateInterface *newCI = new plCoordinateInterface;
menu->fKeyGen->CreateKey( newCI ); menu->fKeyGen->CreateKey( newCI );
hsMatrix44 l2w, w2l; hsMatrix44 l2w, w2l;
@ -806,15 +806,15 @@ pfGUIPopUpMenu *pfGUIPopUpMenu::Build( const char *name, pfGUIDialogMod *parent
// Using SendRef here because AddViaNotify will queue the messages up, which doesn't do us any good // Using SendRef here because AddViaNotify will queue the messages up, which doesn't do us any good
// if we need these refs right away // if we need these refs right away
hsgResMgr::ResMgr()->SendRef( newCI->GetKey(), TRACKED_NEW plObjRefMsg( newObj->GetKey(), plRefMsg::kOnCreate, 0, plObjRefMsg::kInterface ), plRefFlags::kActiveRef ); hsgResMgr::ResMgr()->SendRef( newCI->GetKey(), new plObjRefMsg( newObj->GetKey(), plRefMsg::kOnCreate, 0, plObjRefMsg::kInterface ), plRefFlags::kActiveRef );
hsgResMgr::ResMgr()->SendRef( renderMod->GetKey(), TRACKED_NEW plObjRefMsg( newObj->GetKey(), plRefMsg::kOnCreate, 0, plObjRefMsg::kModifier ), plRefFlags::kActiveRef ); hsgResMgr::ResMgr()->SendRef( renderMod->GetKey(), new plObjRefMsg( newObj->GetKey(), plRefMsg::kOnCreate, 0, plObjRefMsg::kModifier ), plRefFlags::kActiveRef );
newObj->SetSceneNode( menu->fParentNode->GetKey() ); newObj->SetSceneNode( menu->fParentNode->GetKey() );
newObj->SetTransform( l2w, w2l ); newObj->SetTransform( l2w, w2l );
hsgResMgr::ResMgr()->SendRef( menu->GetKey(), TRACKED_NEW plObjRefMsg( newObj->GetKey(), plRefMsg::kOnCreate, 0, plObjRefMsg::kModifier ), plRefFlags::kActiveRef ); hsgResMgr::ResMgr()->SendRef( menu->GetKey(), new plObjRefMsg( newObj->GetKey(), plRefMsg::kOnCreate, 0, plObjRefMsg::kModifier ), plRefFlags::kActiveRef );
// Add the menu to the GUI mgr // Add the menu to the GUI mgr
plGenRefMsg *refMsg = TRACKED_NEW plGenRefMsg( pfGameGUIMgr::GetInstance()->GetKey(), plGenRefMsg *refMsg = new plGenRefMsg( pfGameGUIMgr::GetInstance()->GetKey(),
plRefMsg::kOnCreate, 0, pfGameGUIMgr::kDlgModRef ); plRefMsg::kOnCreate, 0, pfGameGUIMgr::kDlgModRef );
hsgResMgr::ResMgr()->AddViaNotify( menu->GetKey(), refMsg, plRefFlags::kActiveRef ); hsgResMgr::ResMgr()->AddViaNotify( menu->GetKey(), refMsg, plRefFlags::kActiveRef );
@ -833,7 +833,7 @@ void pfGUIPopUpMenu::SetSkin( pfGUISkin *skin )
if( skin != nil ) if( skin != nil )
{ {
hsgResMgr::ResMgr()->SendRef( skin->GetKey(), TRACKED_NEW plGenRefMsg( GetKey(), plRefMsg::kOnCreate, -1, kRefSkin ), plRefFlags::kActiveRef ); hsgResMgr::ResMgr()->SendRef( skin->GetKey(), new plGenRefMsg( GetKey(), plRefMsg::kOnCreate, -1, kRefSkin ), plRefFlags::kActiveRef );
fWaitingForSkin = true; fWaitingForSkin = true;
} }
else else
@ -904,7 +904,7 @@ void pfGUISkin::Read( hsStream *s, hsResMgr *mgr )
for( ; i < kNumElements; i++ ) for( ; i < kNumElements; i++ )
fElements[ i ].Empty(); fElements[ i ].Empty();
mgr->ReadKeyNotifyMe( s, TRACKED_NEW plGenRefMsg( GetKey(), plRefMsg::kOnCreate, -1, kRefMipmap ), plRefFlags::kActiveRef ); mgr->ReadKeyNotifyMe( s, new plGenRefMsg( GetKey(), plRefMsg::kOnCreate, -1, kRefMipmap ), plRefFlags::kActiveRef );
} }
void pfGUISkin::Write( hsStream *s, hsResMgr *mgr ) void pfGUISkin::Write( hsStream *s, hsResMgr *mgr )

8
Sources/Plasma/FeatureLib/pfGameGUIMgr/pfGUIProgressCtrl.cpp

@ -147,7 +147,7 @@ void pfGUIProgressCtrl::SetAnimationKeys( hsTArray<plKey> &keys, const char *
delete [] fAnimName; delete [] fAnimName;
if( name != nil ) if( name != nil )
{ {
fAnimName = TRACKED_NEW char[ strlen( name ) + 1 ]; fAnimName = new char[ strlen( name ) + 1 ];
strcpy( fAnimName, name ); strcpy( fAnimName, name );
} }
else else
@ -231,7 +231,7 @@ void pfGUIProgressCtrl::SetCurrValue( float v )
else else
newTime = ( ( fValue - fMin ) / ( fMax - fMin ) ) * tLength + fAnimBegin; newTime = ( ( fValue - fMin ) / ( fMax - fMin ) ) * tLength + fAnimBegin;
plAnimCmdMsg *msg = TRACKED_NEW plAnimCmdMsg(); plAnimCmdMsg *msg = new plAnimCmdMsg();
msg->SetCmd( plAnimCmdMsg::kGoToTime ); msg->SetCmd( plAnimCmdMsg::kGoToTime );
msg->SetAnimName( fAnimName ); msg->SetAnimName( fAnimName );
msg->fTime = newTime; msg->fTime = newTime;
@ -249,7 +249,7 @@ void pfGUIProgressCtrl::AnimateToPercentage( float percent )
if( fAnimationKeys.GetCount() > 0 ) if( fAnimationKeys.GetCount() > 0 )
{ {
plAnimCmdMsg *msg = TRACKED_NEW plAnimCmdMsg(); plAnimCmdMsg *msg = new plAnimCmdMsg();
msg->SetCmd( plAnimCmdMsg::kPlayToPercentage ); msg->SetCmd( plAnimCmdMsg::kPlayToPercentage );
msg->SetAnimName( fAnimName ); msg->SetAnimName( fAnimName );
msg->fTime = percent; msg->fTime = percent;
@ -263,7 +263,7 @@ void pfGUIProgressCtrl::AnimateToPercentage( float percent )
// setup a timer to call back when we finish animating // setup a timer to call back when we finish animating
float elapsedTime = (fAnimEnd - fAnimBegin) * percent; float elapsedTime = (fAnimEnd - fAnimBegin) * percent;
plTimerCallbackMsg *timerMsg = TRACKED_NEW plTimerCallbackMsg(GetKey(), fStopSoundTimer); plTimerCallbackMsg *timerMsg = new plTimerCallbackMsg(GetKey(), fStopSoundTimer);
plgTimerCallbackMgr::NewTimer(elapsedTime, timerMsg); plgTimerCallbackMgr::NewTimer(elapsedTime, timerMsg);
} }
} }

4
Sources/Plasma/FeatureLib/pfGameGUIMgr/pfGUIRadioGroupCtrl.cpp

@ -124,7 +124,7 @@ class pfGroupProc : public pfGUICtrlProcObject
pfGUIRadioGroupCtrl::pfGUIRadioGroupCtrl() pfGUIRadioGroupCtrl::pfGUIRadioGroupCtrl()
{ {
fButtonProc = TRACKED_NEW pfGroupProc( this ); fButtonProc = new pfGroupProc( this );
fButtonProc->IncRef(); fButtonProc->IncRef();
SetFlag( kIntangible ); SetFlag( kIntangible );
} }
@ -180,7 +180,7 @@ void pfGUIRadioGroupCtrl::Read( hsStream *s, hsResMgr *mgr )
for( i = 0; i < count; i++ ) for( i = 0; i < count; i++ )
{ {
mgr->ReadKeyNotifyMe( s, TRACKED_NEW plGenRefMsg( GetKey(), plRefMsg::kOnCreate, i, kRefControl ), plRefFlags::kActiveRef ); mgr->ReadKeyNotifyMe( s, new plGenRefMsg( GetKey(), plRefMsg::kOnCreate, i, kRefControl ), plRefFlags::kActiveRef );
} }
fValue = fDefaultValue = s->ReadLE16(); fValue = fDefaultValue = s->ReadLE16();

4
Sources/Plasma/FeatureLib/pfGameGUIMgr/pfGUITextBoxMod.cpp

@ -157,7 +157,7 @@ void pfGUITextBoxMod::Read( hsStream *s, hsResMgr *mgr )
uint32_t len = s->ReadLE32(); uint32_t len = s->ReadLE32();
if( len > 0 ) if( len > 0 )
{ {
char *text = TRACKED_NEW char[ len + 1 ]; char *text = new char[ len + 1 ];
s->Read( len, text ); s->Read( len, text );
text[ len ] = 0; text[ len ] = 0;
@ -232,7 +232,7 @@ void pfGUITextBoxMod::SetText( const wchar_t *text )
delete [] fText; delete [] fText;
if (text) if (text)
{ {
fText = TRACKED_NEW wchar_t[wcslen(text)+1]; fText = new wchar_t[wcslen(text)+1];
wcscpy(fText,text); wcscpy(fText,text);
} }
else else

6
Sources/Plasma/FeatureLib/pfGameGUIMgr/pfGUIUpDownPairMod.cpp

@ -106,7 +106,7 @@ pfGUIUpDownPairMod::pfGUIUpDownPairMod()
fDownControl = nil; fDownControl = nil;
fValue = fMin = fMax = fStep = 0.f; fValue = fMin = fMax = fStep = 0.f;
fButtonProc = TRACKED_NEW pfUpDownBtnProc( nil, nil, this ); fButtonProc = new pfUpDownBtnProc( nil, nil, this );
fButtonProc->IncRef(); fButtonProc->IncRef();
SetFlag( kIntangible ); SetFlag( kIntangible );
} }
@ -205,8 +205,8 @@ void pfGUIUpDownPairMod::Read( hsStream *s, hsResMgr *mgr )
fUpControl = nil; fUpControl = nil;
fDownControl = nil; fDownControl = nil;
mgr->ReadKeyNotifyMe( s, TRACKED_NEW plGenRefMsg( GetKey(), plRefMsg::kOnCreate, -1, kRefUpControl ), plRefFlags::kActiveRef ); mgr->ReadKeyNotifyMe( s, new plGenRefMsg( GetKey(), plRefMsg::kOnCreate, -1, kRefUpControl ), plRefFlags::kActiveRef );
mgr->ReadKeyNotifyMe( s, TRACKED_NEW plGenRefMsg( GetKey(), plRefMsg::kOnCreate, -1, kRefDownControl ), plRefFlags::kActiveRef ); mgr->ReadKeyNotifyMe( s, new plGenRefMsg( GetKey(), plRefMsg::kOnCreate, -1, kRefDownControl ), plRefFlags::kActiveRef );
s->ReadLE( &fMin ); s->ReadLE( &fMin );
s->ReadLE( &fMax ); s->ReadLE( &fMax );

18
Sources/Plasma/FeatureLib/pfGameGUIMgr/pfGameGUIMgr.cpp

@ -324,7 +324,7 @@ void pfGameGUIMgr::LoadDialog( const char *name, plKey recvrKey, const char *
} }
if (!alreadyLoaded) if (!alreadyLoaded)
{ {
pfDialogNameSetKey* pDNSK = TRACKED_NEW pfDialogNameSetKey(name,recvrKey); pfDialogNameSetKey* pDNSK = new pfDialogNameSetKey(name,recvrKey);
fDialogToSetKeyOf.Append(pDNSK); fDialogToSetKeyOf.Append(pDNSK);
} }
} }
@ -333,13 +333,13 @@ void pfGameGUIMgr::LoadDialog( const char *name, plKey recvrKey, const char *
plKey clientKey = hsgResMgr::ResMgr()->FindKey( kClient_KEY ); plKey clientKey = hsgResMgr::ResMgr()->FindKey( kClient_KEY );
plClientMsg *msg = TRACKED_NEW plClientMsg( plClientMsg::kLoadRoomHold ); plClientMsg *msg = new plClientMsg( plClientMsg::kLoadRoomHold );
msg->AddReceiver( clientKey ); msg->AddReceiver( clientKey );
msg->AddRoomLoc(plKeyFinder::Instance().FindLocation(ageName ? ageName : "GUI", name)); msg->AddRoomLoc(plKeyFinder::Instance().FindLocation(ageName ? ageName : "GUI", name));
msg->Send(); msg->Send();
// Now add this dialog to a list of pending loads (will remove it once it's fully loaded) // Now add this dialog to a list of pending loads (will remove it once it's fully loaded)
// fDlgsPendingLoad.Append( TRACKED_NEW pfDialogNameSetKey( name, nil ) ); // fDlgsPendingLoad.Append( new pfDialogNameSetKey( name, nil ) );
} }
//// IShowDialog ///////////////////////////////////////////////////////////// //// IShowDialog /////////////////////////////////////////////////////////////
@ -434,7 +434,7 @@ void pfGameGUIMgr::UnloadDialog( pfGUIDialogMod *dlg )
// IRemoveDlgFromList( dlg ); // IRemoveDlgFromList( dlg );
// Add the name to our list of dialogs pending unload // Add the name to our list of dialogs pending unload
// fDlgsPendingUnload.Append( TRACKED_NEW pfDialogNameSetKey( dlg->GetName(), nil ) ); // fDlgsPendingUnload.Append( new pfDialogNameSetKey( dlg->GetName(), nil ) );
plKey sceneNodeKey = dlg->GetSceneNodeKey(); plKey sceneNodeKey = dlg->GetSceneNodeKey();
if( sceneNodeKey == nil ) if( sceneNodeKey == nil )
@ -448,7 +448,7 @@ void pfGameGUIMgr::UnloadDialog( pfGUIDialogMod *dlg )
{ {
plKey clientKey = hsgResMgr::ResMgr()->FindKey( kClient_KEY ); plKey clientKey = hsgResMgr::ResMgr()->FindKey( kClient_KEY );
plClientMsg *msg = TRACKED_NEW plClientMsg( plClientMsg::kUnloadRoom ); plClientMsg *msg = new plClientMsg( plClientMsg::kUnloadRoom );
msg->AddReceiver( clientKey ); msg->AddReceiver( clientKey );
// msg->SetProgressBarSuppression( true ); // msg->SetProgressBarSuppression( true );
msg->AddRoomLoc(sceneNodeKey->GetUoid().GetLocation()); msg->AddRoomLoc(sceneNodeKey->GetUoid().GetLocation());
@ -523,7 +523,7 @@ void pfGameGUIMgr::SetDialogToNotify(const char *name, plKey recvrKey)
// //
void pfGameGUIMgr::SetDialogToNotify(pfGUIDialogMod *dlg, plKey recvrKey) void pfGameGUIMgr::SetDialogToNotify(pfGUIDialogMod *dlg, plKey recvrKey)
{ {
pfGUIDialogNotifyProc* handler = TRACKED_NEW pfGUIDialogNotifyProc(recvrKey); pfGUIDialogNotifyProc* handler = new pfGUIDialogNotifyProc(recvrKey);
dlg->SetHandler(handler); dlg->SetHandler(handler);
handler->OnInit(); handler->OnInit();
} }
@ -540,14 +540,14 @@ void pfGameGUIMgr::IActivateGUI( hsBool activate )
if( activate ) if( activate )
{ {
fInputConfig = TRACKED_NEW pfGameUIInputInterface( this ); fInputConfig = new pfGameUIInputInterface( this );
plInputIfaceMgrMsg *msg = TRACKED_NEW plInputIfaceMgrMsg( plInputIfaceMgrMsg::kAddInterface ); plInputIfaceMgrMsg *msg = new plInputIfaceMgrMsg( plInputIfaceMgrMsg::kAddInterface );
msg->SetIFace( fInputConfig ); msg->SetIFace( fInputConfig );
plgDispatch::MsgSend( msg ); plgDispatch::MsgSend( msg );
} }
else else
{ {
plInputIfaceMgrMsg *msg = TRACKED_NEW plInputIfaceMgrMsg( plInputIfaceMgrMsg::kRemoveInterface ); plInputIfaceMgrMsg *msg = new plInputIfaceMgrMsg( plInputIfaceMgrMsg::kRemoveInterface );
msg->SetIFace( fInputConfig ); msg->SetIFace( fInputConfig );
plgDispatch::MsgSend( msg ); plgDispatch::MsgSend( msg );

4
Sources/Plasma/FeatureLib/pfGameMgr/pfGameMgr.cpp

@ -382,7 +382,7 @@ void pfGameMgr::JoinGame (
unsigned gameId unsigned gameId
) { ) {
Cli2Srv_GameMgr_JoinGame msg; Cli2Srv_GameMgr_JoinGame msg;
ZERO(msg); memset(&msg, 0, sizeof(msg));
msg.messageId = kCli2Srv_GameMgr_JoinGame; msg.messageId = kCli2Srv_GameMgr_JoinGame;
msg.recvGameId = 0; // send to GameMgr on server msg.recvGameId = 0; // send to GameMgr on server
@ -655,7 +655,7 @@ void GameMgrSend (GameMsgHeader * msg, void * param) {
if (param) { if (param) {
msg->transId = INextTransId(); msg->transId = INextTransId();
(void)NEW(TransState)(msg->transId, param); (void)new TransState(msg->transId, param);
} }
else { else {
msg->transId = 0; msg->transId = 0;

10
Sources/Plasma/FeatureLib/pfGameScoreMgr/pfGameScoreMgr.cpp

@ -101,7 +101,7 @@ void pfGameScoreMgr::AddCachedScore(pfGameScore * score)
GameScoreLink * scoreLink = fScores.Find(score->scoreId); GameScoreLink * scoreLink = fScores.Find(score->scoreId);
if (scoreLink == nil) if (scoreLink == nil)
{ {
GameScoreLink * link = TRACKED_NEW GameScoreLink(score); GameScoreLink * link = new GameScoreLink(score);
fScores.Add(link); fScores.Add(link);
} }
else else
@ -240,11 +240,11 @@ static void GetScoresCallback(
op->result = result; op->result = result;
if (IS_NET_SUCCESS(result)) { if (IS_NET_SUCCESS(result)) {
*(op->scores) = TRACKED_NEW pfGameScore*[scoreCount]; *(op->scores) = new pfGameScore*[scoreCount];
*(op->scoreCount) = scoreCount; *(op->scoreCount) = scoreCount;
for (int i = 0; i < scoreCount; ++i) { for (int i = 0; i < scoreCount; ++i) {
pfGameScore* score = TRACKED_NEW pfGameScore(); pfGameScore* score = new pfGameScore();
score->IncRef(); score->IncRef();
char tempGameName[kMaxGameScoreNameLength]; char tempGameName[kMaxGameScoreNameLength];
@ -414,11 +414,11 @@ static void GetRanksCallback(
op->result = result; op->result = result;
if (IS_NET_SUCCESS(result)) { if (IS_NET_SUCCESS(result)) {
*(op->ranks) = TRACKED_NEW NetGameRank*[rankCount]; *(op->ranks) = new NetGameRank*[rankCount];
*(op->rankCount) = rankCount; *(op->rankCount) = rankCount;
for (int i = 0; i < rankCount; ++i) { for (int i = 0; i < rankCount; ++i) {
NetGameRank * rank = TRACKED_NEW NetGameRank; NetGameRank * rank = new NetGameRank;
rank->rank = ranks[i].rank; rank->rank = ranks[i].rank;
rank->score = ranks[i].score; rank->score = ranks[i].score;

102
Sources/Plasma/FeatureLib/pfJournalBook/pfJournalBook.cpp

@ -589,10 +589,10 @@ void pfBookData::IInitTemplate(pfGUIDialogMod *templateDlg)
hsAssert(templateDlg != nil, "Nil template in pfBookData::IInitTemplate()!"); hsAssert(templateDlg != nil, "Nil template in pfBookData::IInitTemplate()!");
// Init and ref our fDialog pointer // Init and ref our fDialog pointer
hsgResMgr::ResMgr()->SendRef(templateDlg->GetKey(), TRACKED_NEW plGenRefMsg(GetKey(), plRefMsg::kOnCreate, -1, kRefDialog), plRefFlags::kPassiveRef); hsgResMgr::ResMgr()->SendRef(templateDlg->GetKey(), new plGenRefMsg(GetKey(), plRefMsg::kOnCreate, -1, kRefDialog), plRefFlags::kPassiveRef);
// Hijack the dialog proc with our own // Hijack the dialog proc with our own
templateDlg->SetHandlerForAll(TRACKED_NEW pfJournalDlgProc(this)); templateDlg->SetHandlerForAll(new pfJournalDlgProc(this));
// Find our animation keys // Find our animation keys
@ -620,7 +620,7 @@ void pfBookData::IInitTemplate(pfGUIDialogMod *templateDlg)
// Grab and ref the default cover mipmap // Grab and ref the default cover mipmap
plLayer *lay = plLayer::ConvertNoRef(fCoverLayer); plLayer *lay = plLayer::ConvertNoRef(fCoverLayer);
if((lay != nil)&&(lay->GetTexture() != nil)) if((lay != nil)&&(lay->GetTexture() != nil))
hsgResMgr::ResMgr()->AddViaNotify(lay->GetTexture()->GetKey(), TRACKED_NEW plGenRefMsg(GetKey(), plRefMsg::kOnCreate, -1, kRefDefaultCover), plRefFlags::kPassiveRef); hsgResMgr::ResMgr()->AddViaNotify(lay->GetTexture()->GetKey(), new plGenRefMsg(GetKey(), plRefMsg::kOnCreate, -1, kRefDefaultCover), plRefFlags::kPassiveRef);
fLeftPageMap->SetFlag(pfGUIClickMapCtrl::kReportHovering); fLeftPageMap->SetFlag(pfGUIClickMapCtrl::kReportHovering);
fRightPageMap->SetFlag(pfGUIClickMapCtrl::kReportHovering); fRightPageMap->SetFlag(pfGUIClickMapCtrl::kReportHovering);
@ -656,7 +656,7 @@ void pfBookData::IInitTemplate(pfGUIDialogMod *templateDlg)
{ {
fEditable = true; fEditable = true;
fLeftEditCtrl->SetNext(fRightEditCtrl); fLeftEditCtrl->SetNext(fRightEditCtrl);
fLeftEditCtrl->SetEventProc(TRACKED_NEW pfBookMultiLineEditProc(this)); fLeftEditCtrl->SetEventProc(new pfBookMultiLineEditProc(this));
fTurnFrontEditCtrl->SetNext(fTurnBackEditCtrl); // these are always back to back fTurnFrontEditCtrl->SetNext(fTurnBackEditCtrl); // these are always back to back
} }
} }
@ -844,7 +844,7 @@ void pfBookData::IFillUncoveringPage(hsBool rightSide)
} }
// create a timer so we can hide the old left or right turn page right before the animation finishes to prevent flicker // create a timer so we can hide the old left or right turn page right before the animation finishes to prevent flicker
plTimerCallbackMsg* pTimerMsg = TRACKED_NEW plTimerCallbackMsg(GetKey(),id); plTimerCallbackMsg* pTimerMsg = new plTimerCallbackMsg(GetKey(),id);
plgTimerCallbackMgr::NewTimer( .5, pTimerMsg ); // .5 found by trial and error plgTimerCallbackMgr::NewTimer( .5, pTimerMsg ); // .5 found by trial and error
return; // the gui controls render everything for us, so ignoring this request return; // the gui controls render everything for us, so ignoring this request
} }
@ -869,7 +869,7 @@ void pfBookData::ITriggerPageFlip(hsBool flipBackwards, hsBool immediate)
const hsTArray<plKey> &keys = fTurnPageButton->GetAnimationKeys(); const hsTArray<plKey> &keys = fTurnPageButton->GetAnimationKeys();
const char *animName = fTurnPageButton->GetAnimationName(); const char *animName = fTurnPageButton->GetAnimationName();
plAnimCmdMsg *msg = TRACKED_NEW plAnimCmdMsg(); plAnimCmdMsg *msg = new plAnimCmdMsg();
if (immediate) if (immediate)
{ {
msg->SetCmd(plAnimCmdMsg::kGoToEnd); msg->SetCmd(plAnimCmdMsg::kGoToEnd);
@ -884,7 +884,7 @@ void pfBookData::ITriggerPageFlip(hsBool flipBackwards, hsBool immediate)
// Here's the whole reason why we're not just checking the checkbox: so we can attach a callback // Here's the whole reason why we're not just checking the checkbox: so we can attach a callback
// so we know when the animation completes. Pretty sad, huh? Poor checkbox. // so we know when the animation completes. Pretty sad, huh? Poor checkbox.
plEventCallbackMsg *eventMsg = TRACKED_NEW plEventCallbackMsg; plEventCallbackMsg *eventMsg = new plEventCallbackMsg;
eventMsg->AddReceiver(GetKey()); eventMsg->AddReceiver(GetKey());
eventMsg->fRepeats = 0; eventMsg->fRepeats = 0;
if (immediate) if (immediate)
@ -905,7 +905,7 @@ void pfBookData::ITriggerPageFlip(hsBool flipBackwards, hsBool immediate)
// We want a second callback to tell us when, indeed, the page has started turning // We want a second callback to tell us when, indeed, the page has started turning
// and is thus visible and thus we can actually, really, honestly, safely fill in the // and is thus visible and thus we can actually, really, honestly, safely fill in the
// page behind it // page behind it
eventMsg = TRACKED_NEW plEventCallbackMsg; eventMsg = new plEventCallbackMsg;
eventMsg->AddReceiver(GetKey()); eventMsg->AddReceiver(GetKey());
eventMsg->fRepeats = 0; eventMsg->fRepeats = 0;
eventMsg->fUser = !flipBackwards ? (0x04 | 0x01) : 0x04; eventMsg->fUser = !flipBackwards ? (0x04 | 0x01) : 0x04;
@ -1140,7 +1140,7 @@ std::map<std::string,pfBookData*> pfJournalBook::fBookGUIs;
void pfJournalBook::SingletonInit( void ) void pfJournalBook::SingletonInit( void )
{ {
fBookGUIs["BkBook"] = TRACKED_NEW pfBookData(); // load the default book data object fBookGUIs["BkBook"] = new pfBookData(); // load the default book data object
hsgResMgr::ResMgr()->NewKey("BkBook",fBookGUIs["BkBook"],pfGameGUIMgr::GetInstance()->GetKey()->GetUoid().GetLocation()); hsgResMgr::ResMgr()->NewKey("BkBook",fBookGUIs["BkBook"],pfGameGUIMgr::GetInstance()->GetKey()->GetUoid().GetLocation());
fBookGUIs["BkBook"]->LoadGUI(); fBookGUIs["BkBook"]->LoadGUI();
} }
@ -1162,7 +1162,7 @@ void pfJournalBook::LoadGUI( const char *guiName )
{ {
if (fBookGUIs.find(guiName) == fBookGUIs.end()) // is it already loaded? if (fBookGUIs.find(guiName) == fBookGUIs.end()) // is it already loaded?
{ // nope, load it { // nope, load it
fBookGUIs[guiName] = TRACKED_NEW pfBookData(guiName); fBookGUIs[guiName] = new pfBookData(guiName);
hsgResMgr::ResMgr()->NewKey(guiName,fBookGUIs[guiName],pfGameGUIMgr::GetInstance()->GetKey()->GetUoid().GetLocation()); hsgResMgr::ResMgr()->NewKey(guiName,fBookGUIs[guiName],pfGameGUIMgr::GetInstance()->GetKey()->GetUoid().GetLocation());
fBookGUIs[guiName]->LoadGUI(); fBookGUIs[guiName]->LoadGUI();
} }
@ -1210,7 +1210,7 @@ pfJournalBook::pfJournalBook( const char *esHTMLSource, plKey coverImageKey, plK
fCurBookGUI = "BkBook"; fCurBookGUI = "BkBook";
if (fBookGUIs.find(fCurBookGUI) == fBookGUIs.end()) if (fBookGUIs.find(fCurBookGUI) == fBookGUIs.end())
{ {
fBookGUIs[fCurBookGUI] = TRACKED_NEW pfBookData(fCurBookGUI.c_str()); fBookGUIs[fCurBookGUI] = new pfBookData(fCurBookGUI.c_str());
hsgResMgr::ResMgr()->NewKey(fCurBookGUI.c_str(),fBookGUIs[fCurBookGUI],pfGameGUIMgr::GetInstance()->GetKey()->GetUoid().GetLocation()); hsgResMgr::ResMgr()->NewKey(fCurBookGUI.c_str(),fBookGUIs[fCurBookGUI],pfGameGUIMgr::GetInstance()->GetKey()->GetUoid().GetLocation());
fBookGUIs[fCurBookGUI]->LoadGUI(); fBookGUIs[fCurBookGUI]->LoadGUI();
} }
@ -1246,7 +1246,7 @@ pfJournalBook::pfJournalBook( const wchar_t *esHTMLSource, plKey coverImageKey,
fCurBookGUI = "BkBook"; fCurBookGUI = "BkBook";
if (fBookGUIs.find(fCurBookGUI) == fBookGUIs.end()) if (fBookGUIs.find(fCurBookGUI) == fBookGUIs.end())
{ {
fBookGUIs[fCurBookGUI] = TRACKED_NEW pfBookData(fCurBookGUI.c_str()); fBookGUIs[fCurBookGUI] = new pfBookData(fCurBookGUI.c_str());
hsgResMgr::ResMgr()->NewKey(fCurBookGUI.c_str(),fBookGUIs[fCurBookGUI],pfGameGUIMgr::GetInstance()->GetKey()->GetUoid().GetLocation()); hsgResMgr::ResMgr()->NewKey(fCurBookGUI.c_str(),fBookGUIs[fCurBookGUI],pfGameGUIMgr::GetInstance()->GetKey()->GetUoid().GetLocation());
fBookGUIs[fCurBookGUI]->LoadGUI(); fBookGUIs[fCurBookGUI]->LoadGUI();
} }
@ -1329,7 +1329,7 @@ void pfJournalBook::Show( hsBool startOpened /*= false */)
{ {
// it's a cover movie, not a decal, so we make a layer, thinking it's at 0,0 and a left map (which gives us the results we want) // it's a cover movie, not a decal, so we make a layer, thinking it's at 0,0 and a left map (which gives us the results we want)
plLayerBink *movieLayer = IMakeMovieLayer(fCoverDecals[i],0,0,mip,pfJournalDlgProc::kTagLeftDTMap,false); plLayerBink *movieLayer = IMakeMovieLayer(fCoverDecals[i],0,0,mip,pfJournalDlgProc::kTagLeftDTMap,false);
loadedMovie *movie = TRACKED_NEW loadedMovie; loadedMovie *movie = new loadedMovie;
movie->movieLayer = movieLayer; movie->movieLayer = movieLayer;
movie->movieChunk = fCoverDecals[i]; movie->movieChunk = fCoverDecals[i];
fLoadedMovies.Append(movie); fLoadedMovies.Append(movie);
@ -1476,7 +1476,7 @@ void pfJournalBook::ITriggerCloseWithNotify( hsBool closeNotOpen, hsBool imme
const hsTArray<plKey> &keys = fBookGUIs[fCurBookGUI]->CoverButton()->GetAnimationKeys(); const hsTArray<plKey> &keys = fBookGUIs[fCurBookGUI]->CoverButton()->GetAnimationKeys();
const char *animName = fBookGUIs[fCurBookGUI]->CoverButton()->GetAnimationName(); const char *animName = fBookGUIs[fCurBookGUI]->CoverButton()->GetAnimationName();
plAnimCmdMsg *msg = TRACKED_NEW plAnimCmdMsg(); plAnimCmdMsg *msg = new plAnimCmdMsg();
if( !immediate ) if( !immediate )
{ {
msg->SetCmd( plAnimCmdMsg::kContinue ); msg->SetCmd( plAnimCmdMsg::kContinue );
@ -1490,7 +1490,7 @@ void pfJournalBook::ITriggerCloseWithNotify( hsBool closeNotOpen, hsBool imme
msg->SetAnimName( animName ); msg->SetAnimName( animName );
msg->AddReceivers( keys ); msg->AddReceivers( keys );
plEventCallbackMsg *eventMsg = TRACKED_NEW plEventCallbackMsg; plEventCallbackMsg *eventMsg = new plEventCallbackMsg;
eventMsg->AddReceiver( fBookGUIs[fCurBookGUI]->GetKey() ); eventMsg->AddReceiver( fBookGUIs[fCurBookGUI]->GetKey() );
eventMsg->fRepeats = 0; eventMsg->fRepeats = 0;
eventMsg->fUser = 0x08 | ( closeNotOpen ? 0x00 : 0x01 ); // So we know which this is for eventMsg->fUser = 0x08 | ( closeNotOpen ? 0x00 : 0x01 ); // So we know which this is for
@ -1817,7 +1817,7 @@ hsBool pfJournalBook::ICompileSource( const wchar_t *source, const plLocation &
IFreeSource(); IFreeSource();
pfEsHTMLChunk *chunk, *lastParChunk = TRACKED_NEW pfEsHTMLChunk( nil ); pfEsHTMLChunk *chunk, *lastParChunk = new pfEsHTMLChunk( nil );
const wchar_t *c, *start; const wchar_t *c, *start;
wchar_t name[ 128 ], option[ 256 ]; wchar_t name[ 128 ], option[ 256 ];
float bookWidth=1.0, bookHeight=1.0; float bookWidth=1.0, bookHeight=1.0;
@ -1845,7 +1845,7 @@ hsBool pfJournalBook::ICompileSource( const wchar_t *source, const plLocation &
{ {
uint32_t count = ((uint32_t)c - (uint32_t)start)/2; // wchar_t is 2 bytes uint32_t count = ((uint32_t)c - (uint32_t)start)/2; // wchar_t is 2 bytes
wchar_t *temp = TRACKED_NEW wchar_t[ count + 1 ]; wchar_t *temp = new wchar_t[ count + 1 ];
wcsncpy( temp, start, count ); wcsncpy( temp, start, count );
temp[count] = L'\0'; temp[count] = L'\0';
lastParChunk->fText = temp; lastParChunk->fText = temp;
@ -1863,7 +1863,7 @@ hsBool pfJournalBook::ICompileSource( const wchar_t *source, const plLocation &
{ {
case pfEsHTMLChunk::kParagraph: case pfEsHTMLChunk::kParagraph:
c += 2; c += 2;
chunk = TRACKED_NEW pfEsHTMLChunk( nil ); chunk = new pfEsHTMLChunk( nil );
chunk->fFlags = IFindLastAlignment(); chunk->fFlags = IFindLastAlignment();
while( IGetNextOption( c, name, option ) ) while( IGetNextOption( c, name, option ) )
{ {
@ -1883,7 +1883,7 @@ hsBool pfJournalBook::ICompileSource( const wchar_t *source, const plLocation &
case pfEsHTMLChunk::kImage: case pfEsHTMLChunk::kImage:
c += 4; c += 4;
chunk = TRACKED_NEW pfEsHTMLChunk( nil, 0 ); chunk = new pfEsHTMLChunk( nil, 0 );
while( IGetNextOption( c, name, option ) ) while( IGetNextOption( c, name, option ) )
{ {
if( wcsicmp( name, L"align" ) == 0 ) if( wcsicmp( name, L"align" ) == 0 )
@ -1994,7 +1994,7 @@ hsBool pfJournalBook::ICompileSource( const wchar_t *source, const plLocation &
else else
delete chunk; delete chunk;
// Start new paragraph chunk after this one // Start new paragraph chunk after this one
lastParChunk = TRACKED_NEW pfEsHTMLChunk( nil ); lastParChunk = new pfEsHTMLChunk( nil );
lastParChunk->fFlags = IFindLastAlignment(); lastParChunk->fFlags = IFindLastAlignment();
break; break;
@ -2026,25 +2026,25 @@ hsBool pfJournalBook::ICompileSource( const wchar_t *source, const plLocation &
} }
} }
// Still gotta create a new par chunk // Still gotta create a new par chunk
lastParChunk = TRACKED_NEW pfEsHTMLChunk( nil ); lastParChunk = new pfEsHTMLChunk( nil );
lastParChunk->fFlags = IFindLastAlignment(); lastParChunk->fFlags = IFindLastAlignment();
break; break;
case pfEsHTMLChunk::kPageBreak: case pfEsHTMLChunk::kPageBreak:
c += 3; c += 3;
chunk = TRACKED_NEW pfEsHTMLChunk(); chunk = new pfEsHTMLChunk();
while( IGetNextOption( c, name, option ) ) while( IGetNextOption( c, name, option ) )
{ {
} }
fHTMLSource.Append( chunk ); fHTMLSource.Append( chunk );
// Start new paragraph chunk after this one // Start new paragraph chunk after this one
lastParChunk = TRACKED_NEW pfEsHTMLChunk( nil ); lastParChunk = new pfEsHTMLChunk( nil );
lastParChunk->fFlags = IFindLastAlignment(); lastParChunk->fFlags = IFindLastAlignment();
break; break;
case pfEsHTMLChunk::kFontChange: case pfEsHTMLChunk::kFontChange:
c += 5; c += 5;
chunk = TRACKED_NEW pfEsHTMLChunk( nil, 0, 0 ); chunk = new pfEsHTMLChunk( nil, 0, 0 );
while( IGetNextOption( c, name, option ) ) while( IGetNextOption( c, name, option ) )
{ {
if( wcsicmp( name, L"style" ) == 0 ) if( wcsicmp( name, L"style" ) == 0 )
@ -2120,7 +2120,7 @@ hsBool pfJournalBook::ICompileSource( const wchar_t *source, const plLocation &
} }
fHTMLSource.Append( chunk ); fHTMLSource.Append( chunk );
// Start new paragraph chunk after this one // Start new paragraph chunk after this one
lastParChunk = TRACKED_NEW pfEsHTMLChunk( nil ); lastParChunk = new pfEsHTMLChunk( nil );
lastParChunk->fFlags = IFindLastAlignment(); lastParChunk->fFlags = IFindLastAlignment();
break; break;
@ -2146,7 +2146,7 @@ hsBool pfJournalBook::ICompileSource( const wchar_t *source, const plLocation &
fBookGUIs[fCurBookGUI]->GetEditCtrl(pfJournalDlgProc::kTagTurnBackEditCtrl)->SetMargins(fPageTMargin,fPageLMargin,fPageBMargin,fPageRMargin); fBookGUIs[fCurBookGUI]->GetEditCtrl(pfJournalDlgProc::kTagTurnBackEditCtrl)->SetMargins(fPageTMargin,fPageLMargin,fPageBMargin,fPageRMargin);
} }
// Start a new paragraph chunk after this one // Start a new paragraph chunk after this one
lastParChunk = TRACKED_NEW pfEsHTMLChunk(nil); lastParChunk = new pfEsHTMLChunk(nil);
lastParChunk->fFlags = IFindLastAlignment(); lastParChunk->fFlags = IFindLastAlignment();
break; break;
@ -2172,13 +2172,13 @@ hsBool pfJournalBook::ICompileSource( const wchar_t *source, const plLocation &
fWidthScale = 1.f - bookWidth; fWidthScale = 1.f - bookWidth;
// Still gotta create a new par chunk // Still gotta create a new par chunk
lastParChunk = TRACKED_NEW pfEsHTMLChunk( nil ); lastParChunk = new pfEsHTMLChunk( nil );
lastParChunk->fFlags = IFindLastAlignment(); lastParChunk->fFlags = IFindLastAlignment();
break; break;
case pfEsHTMLChunk::kDecal: case pfEsHTMLChunk::kDecal:
c += 6; c += 6;
chunk = TRACKED_NEW pfEsHTMLChunk( nil, 0 ); chunk = new pfEsHTMLChunk( nil, 0 );
chunk->fType = pfEsHTMLChunk::kDecal; chunk->fType = pfEsHTMLChunk::kDecal;
while( IGetNextOption( c, name, option ) ) while( IGetNextOption( c, name, option ) )
{ {
@ -2227,13 +2227,13 @@ hsBool pfJournalBook::ICompileSource( const wchar_t *source, const plLocation &
else else
delete chunk; delete chunk;
// Start new paragraph chunk after this one // Start new paragraph chunk after this one
lastParChunk = TRACKED_NEW pfEsHTMLChunk( nil ); lastParChunk = new pfEsHTMLChunk( nil );
lastParChunk->fFlags = IFindLastAlignment(); lastParChunk->fFlags = IFindLastAlignment();
break; break;
case pfEsHTMLChunk::kMovie: case pfEsHTMLChunk::kMovie:
c += 6; c += 6;
chunk = TRACKED_NEW pfEsHTMLChunk( nil, 0 ); chunk = new pfEsHTMLChunk( nil, 0 );
chunk->fType = pfEsHTMLChunk::kMovie; chunk->fType = pfEsHTMLChunk::kMovie;
while( IGetNextOption( c, name, option ) ) while( IGetNextOption( c, name, option ) )
{ {
@ -2302,20 +2302,20 @@ hsBool pfJournalBook::ICompileSource( const wchar_t *source, const plLocation &
delete chunk; delete chunk;
} }
// Start new paragraph chunk after this one // Start new paragraph chunk after this one
lastParChunk = TRACKED_NEW pfEsHTMLChunk( nil ); lastParChunk = new pfEsHTMLChunk( nil );
lastParChunk->fFlags = IFindLastAlignment(); lastParChunk->fFlags = IFindLastAlignment();
break; break;
case pfEsHTMLChunk::kEditable: case pfEsHTMLChunk::kEditable:
c += 9; c += 9;
SetEditable(true); SetEditable(true);
chunk = TRACKED_NEW pfEsHTMLChunk(); chunk = new pfEsHTMLChunk();
while( IGetNextOption( c, name, option ) ) while( IGetNextOption( c, name, option ) )
{ {
} }
fHTMLSource.Append( chunk ); fHTMLSource.Append( chunk );
// Start new paragraph chunk after this one // Start new paragraph chunk after this one
lastParChunk = TRACKED_NEW pfEsHTMLChunk( nil ); lastParChunk = new pfEsHTMLChunk( nil );
lastParChunk->fFlags = IFindLastAlignment(); lastParChunk->fFlags = IFindLastAlignment();
break; break;
} }
@ -2340,7 +2340,7 @@ hsBool pfJournalBook::ICompileSource( const wchar_t *source, const plLocation &
{ {
uint32_t count = (uint32_t)c - (uint32_t)start; uint32_t count = (uint32_t)c - (uint32_t)start;
wchar_t *temp = TRACKED_NEW wchar_t[ count + 1 ]; wchar_t *temp = new wchar_t[ count + 1 ];
wcsncpy( temp, start, count + 1 ); wcsncpy( temp, start, count + 1 );
lastParChunk->fText = temp; lastParChunk->fText = temp;
delete [] temp; delete [] temp;
@ -2603,7 +2603,7 @@ void pfJournalBook::IRenderPage( uint32_t page, uint32_t whichDTMap, hsBool s
plLayerBink *bink = plLayerBink::ConvertNoRef(matLayer); plLayerBink *bink = plLayerBink::ConvertNoRef(matLayer);
if (bink) // if it was a bink layer if (bink) // if it was a bink layer
{ {
plMatRefMsg* refMsg = TRACKED_NEW plMatRefMsg(material->GetKey(), plRefMsg::kOnRemove, i, plMatRefMsg::kLayer); // remove it plMatRefMsg* refMsg = new plMatRefMsg(material->GetKey(), plRefMsg::kOnRemove, i, plMatRefMsg::kLayer); // remove it
hsgResMgr::ResMgr()->SendRef(material->GetLayer(i)->GetKey(), refMsg, plRefFlags::kActiveRef); hsgResMgr::ResMgr()->SendRef(material->GetLayer(i)->GetKey(), refMsg, plRefFlags::kActiveRef);
} }
} }
@ -2681,12 +2681,12 @@ void pfJournalBook::IRenderPage( uint32_t page, uint32_t whichDTMap, hsBool s
// cache, but that's ok 'cause if we're doing this, it's probably invalid (or empty) // cache, but that's ok 'cause if we're doing this, it's probably invalid (or empty)
// anyway // anyway
int fTextLen = chunk->fText.length(); int fTextLen = chunk->fText.length();
wchar_t *s = TRACKED_NEW wchar_t[fTextLen+1]; wchar_t *s = new wchar_t[fTextLen+1];
wcscpy(s,chunk->fText.c_str()); wcscpy(s,chunk->fText.c_str());
s[fTextLen] = L'\0'; s[fTextLen] = L'\0';
// Note: Makes a copy of the string // Note: Makes a copy of the string
pfEsHTMLChunk *c2 = TRACKED_NEW pfEsHTMLChunk( &s[ lastChar ] ); pfEsHTMLChunk *c2 = new pfEsHTMLChunk( &s[ lastChar ] );
c2->fFlags = chunk->fFlags; c2->fFlags = chunk->fFlags;
fHTMLSource.Insert( idx + 1, c2 ); fHTMLSource.Insert( idx + 1, c2 );
@ -2825,7 +2825,7 @@ void pfJournalBook::IRenderPage( uint32_t page, uint32_t whichDTMap, hsBool s
} }
if (!movieAlreadyLoaded) // if the movie wasn't already cached, cache it if (!movieAlreadyLoaded) // if the movie wasn't already cached, cache it
{ {
movie = TRACKED_NEW loadedMovie; movie = new loadedMovie;
movie->movieLayer = movieLayer; // save the layer and chunk data movie->movieLayer = movieLayer; // save the layer and chunk data
movie->movieChunk = chunk; movie->movieChunk = chunk;
fLoadedMovies.Append(movie); fLoadedMovies.Append(movie);
@ -2872,7 +2872,7 @@ void pfJournalBook::IMoveMovies( hsGMaterial *source, hsGMaterial *dest )
plLayerBink *bink = plLayerBink::ConvertNoRef(matLayer); plLayerBink *bink = plLayerBink::ConvertNoRef(matLayer);
if (bink) // if it was a bink layer if (bink) // if it was a bink layer
{ {
plMatRefMsg* refMsg = TRACKED_NEW plMatRefMsg(source->GetKey(), plRefMsg::kOnRemove, i, plMatRefMsg::kLayer); // remove it plMatRefMsg* refMsg = new plMatRefMsg(source->GetKey(), plRefMsg::kOnRemove, i, plMatRefMsg::kLayer); // remove it
hsgResMgr::ResMgr()->SendRef(source->GetLayer(i)->GetKey(), refMsg, plRefFlags::kActiveRef); hsgResMgr::ResMgr()->SendRef(source->GetLayer(i)->GetKey(), refMsg, plRefFlags::kActiveRef);
moviesOnPage.Append(bink); moviesOnPage.Append(bink);
} }
@ -2884,7 +2884,7 @@ void pfJournalBook::IMoveMovies( hsGMaterial *source, hsGMaterial *dest )
plLayerBink *bink = plLayerBink::ConvertNoRef(matLayer); plLayerBink *bink = plLayerBink::ConvertNoRef(matLayer);
if (bink) // if it was a bink layer if (bink) // if it was a bink layer
{ {
plMatRefMsg* refMsg = TRACKED_NEW plMatRefMsg(dest->GetKey(), plRefMsg::kOnRemove, i, plMatRefMsg::kLayer); // remove it plMatRefMsg* refMsg = new plMatRefMsg(dest->GetKey(), plRefMsg::kOnRemove, i, plMatRefMsg::kLayer); // remove it
hsgResMgr::ResMgr()->SendRef(dest->GetLayer(i)->GetKey(), refMsg, plRefFlags::kActiveRef); hsgResMgr::ResMgr()->SendRef(dest->GetLayer(i)->GetKey(), refMsg, plRefFlags::kActiveRef);
} }
} }
@ -2900,7 +2900,7 @@ void pfJournalBook::IMoveMovies( hsGMaterial *source, hsGMaterial *dest )
void pfJournalBook::IDrawMipmap( pfEsHTMLChunk *chunk, uint16_t x, uint16_t y, plMipmap *mip, plDynamicTextMap *dtMap, uint32_t whichDTMap, hsBool dontRender ) void pfJournalBook::IDrawMipmap( pfEsHTMLChunk *chunk, uint16_t x, uint16_t y, plMipmap *mip, plDynamicTextMap *dtMap, uint32_t whichDTMap, hsBool dontRender )
{ {
plMipmap *copy = TRACKED_NEW plMipmap(); plMipmap *copy = new plMipmap();
copy->CopyFrom(mip); copy->CopyFrom(mip);
if (chunk->fNoResizeImg) if (chunk->fNoResizeImg)
{ {
@ -3045,11 +3045,11 @@ plLayerBink *pfJournalBook::IMakeMovieLayer(pfEsHTMLChunk *chunk, uint16_t x, ui
char buff[256]; char buff[256];
sprintf(buff, "%s_%d_ml", GetKey()->GetName(), uniqueSuffix); sprintf(buff, "%s_%d_ml", GetKey()->GetName(), uniqueSuffix);
layer = TRACKED_NEW plLayer; layer = new plLayer;
hsgResMgr::ResMgr()->NewKey(buff, layer, GetKey()->GetUoid().GetLocation()); hsgResMgr::ResMgr()->NewKey(buff, layer, GetKey()->GetUoid().GetLocation());
sprintf(buff, "%s_%d_m", GetKey()->GetName(), uniqueSuffix++); sprintf(buff, "%s_%d_m", GetKey()->GetName(), uniqueSuffix++);
movieLayer = TRACKED_NEW plLayerBink; movieLayer = new plLayerBink;
hsgResMgr::ResMgr()->NewKey(buff, movieLayer, GetKey()->GetUoid().GetLocation()); hsgResMgr::ResMgr()->NewKey(buff, movieLayer, GetKey()->GetUoid().GetLocation());
movieLayer->GetKey()->RefObject(); // we want to own a ref so we can nuke it at will movieLayer->GetKey()->RefObject(); // we want to own a ref so we can nuke it at will
@ -3194,7 +3194,7 @@ plLayerInterface *pfJournalBook::IMakeBaseLayer(plMipmap *image)
char buff[256]; char buff[256];
sprintf(buff, "%s_%d", GetKey()->GetName(), uniqueSuffix++); sprintf(buff, "%s_%d", GetKey()->GetName(), uniqueSuffix++);
plLayer* layer = TRACKED_NEW plLayer; plLayer* layer = new plLayer;
hsgResMgr::ResMgr()->NewKey(buff, layer, GetKey()->GetUoid().GetLocation()); hsgResMgr::ResMgr()->NewKey(buff, layer, GetKey()->GetUoid().GetLocation());
// Initialize it. // Initialize it.
@ -3234,7 +3234,7 @@ plLayerInterface *pfJournalBook::IMakeBaseLayer(plMipmap *image)
layer->SetTransform(xfm); layer->SetTransform(xfm);
// Set the texture (assumes mipmap is non-nil). // Set the texture (assumes mipmap is non-nil).
plLayRefMsg* refMsg = TRACKED_NEW plLayRefMsg(layer->GetKey(), plRefMsg::kOnCreate, 0, plLayRefMsg::kTexture); plLayRefMsg* refMsg = new plLayRefMsg(layer->GetKey(), plRefMsg::kOnCreate, 0, plLayRefMsg::kTexture);
hsgResMgr::ResMgr()->SendRef(image->GetKey(), refMsg, plRefFlags::kActiveRef); hsgResMgr::ResMgr()->SendRef(image->GetKey(), refMsg, plRefFlags::kActiveRef);
return plLayerInterface::ConvertNoRef(layer); return plLayerInterface::ConvertNoRef(layer);
@ -3249,7 +3249,7 @@ plLayerInterface *pfJournalBook::IMakeDecalLayer(pfEsHTMLChunk *decalChunk, plMi
char buff[256]; char buff[256];
sprintf(buff, "%s_%d_d", GetKey()->GetName(), uniqueSuffix++); sprintf(buff, "%s_%d_d", GetKey()->GetName(), uniqueSuffix++);
plLayer* layer = TRACKED_NEW plLayer; plLayer* layer = new plLayer;
hsgResMgr::ResMgr()->NewKey(buff, layer, GetKey()->GetUoid().GetLocation()); hsgResMgr::ResMgr()->NewKey(buff, layer, GetKey()->GetUoid().GetLocation());
// Initialize it. // Initialize it.
@ -3322,7 +3322,7 @@ plLayerInterface *pfJournalBook::IMakeDecalLayer(pfEsHTMLChunk *decalChunk, plMi
layer->SetTransform(xfm); layer->SetTransform(xfm);
// Set the texture (assumes mipmap is non-nil). // Set the texture (assumes mipmap is non-nil).
plLayRefMsg* refMsg = TRACKED_NEW plLayRefMsg(layer->GetKey(), plRefMsg::kOnCreate, 0, plLayRefMsg::kTexture); plLayRefMsg* refMsg = new plLayRefMsg(layer->GetKey(), plRefMsg::kOnCreate, 0, plLayRefMsg::kTexture);
hsgResMgr::ResMgr()->SendRef(decal->GetKey(), refMsg, plRefFlags::kActiveRef); hsgResMgr::ResMgr()->SendRef(decal->GetKey(), refMsg, plRefFlags::kActiveRef);
return plLayerInterface::ConvertNoRef(layer); return plLayerInterface::ConvertNoRef(layer);
@ -3334,7 +3334,7 @@ void pfJournalBook::ISetDecalLayers(hsGMaterial *material,hsTArray<plLayerInterf
int i; int i;
for( i = material->GetNumLayers()-1; i >= 0; i-- ) for( i = material->GetNumLayers()-1; i >= 0; i-- )
{ {
plMatRefMsg* refMsg = TRACKED_NEW plMatRefMsg(material->GetKey(), plRefMsg::kOnRemove, i, plMatRefMsg::kLayer); plMatRefMsg* refMsg = new plMatRefMsg(material->GetKey(), plRefMsg::kOnRemove, i, plMatRefMsg::kLayer);
hsgResMgr::ResMgr()->SendRef(material->GetLayer(i)->GetKey(), refMsg, plRefFlags::kActiveRef); hsgResMgr::ResMgr()->SendRef(material->GetLayer(i)->GetKey(), refMsg, plRefFlags::kActiveRef);
} }
@ -3478,7 +3478,7 @@ void pfJournalBook::ISendNotify( uint32_t type, uint32_t linkID )
{ {
if( fCallbackKey != nil ) if( fCallbackKey != nil )
{ {
plNotifyMsg *pMsg = TRACKED_NEW plNotifyMsg; plNotifyMsg *pMsg = new plNotifyMsg;
pMsg->AddBookEvent( type, linkID ); pMsg->AddBookEvent( type, linkID );
pMsg->SetBCastFlag( plMessage::kNetPropagate, false ); // don't deliver networked! pMsg->SetBCastFlag( plMessage::kNetPropagate, false ); // don't deliver networked!
pMsg->Send( fCallbackKey ); pMsg->Send( fCallbackKey );
@ -3513,7 +3513,7 @@ void pfJournalBook::ILoadAllImages( hsBool unload )
fBookGUIs[fCurBookGUI]->GetKey()->Release( fCoverMipKey ); fBookGUIs[fCurBookGUI]->GetKey()->Release( fCoverMipKey );
else else
{ {
plGenRefMsg *ref = TRACKED_NEW plGenRefMsg( fBookGUIs[fCurBookGUI]->GetKey(), plRefMsg::kOnCreate, -1, kRefImage ); plGenRefMsg *ref = new plGenRefMsg( fBookGUIs[fCurBookGUI]->GetKey(), plRefMsg::kOnCreate, -1, kRefImage );
hsgResMgr::ResMgr()->AddViaNotify( fCoverMipKey, ref, plRefFlags::kActiveRef ); hsgResMgr::ResMgr()->AddViaNotify( fCoverMipKey, ref, plRefFlags::kActiveRef );
} }
} }
@ -3526,7 +3526,7 @@ void pfJournalBook::ILoadAllImages( hsBool unload )
fBookGUIs[fCurBookGUI]->GetKey()->Release( fHTMLSource[ i ]->fImageKey ); fBookGUIs[fCurBookGUI]->GetKey()->Release( fHTMLSource[ i ]->fImageKey );
else else
{ {
plGenRefMsg *ref = TRACKED_NEW plGenRefMsg( fBookGUIs[fCurBookGUI]->GetKey(), plRefMsg::kOnCreate, -1, kRefImage ); plGenRefMsg *ref = new plGenRefMsg( fBookGUIs[fCurBookGUI]->GetKey(), plRefMsg::kOnCreate, -1, kRefImage );
hsgResMgr::ResMgr()->AddViaNotify( fHTMLSource[ i ]->fImageKey, ref, plRefFlags::kActiveRef ); hsgResMgr::ResMgr()->AddViaNotify( fHTMLSource[ i ]->fImageKey, ref, plRefFlags::kActiveRef );
} }
} }

6
Sources/Plasma/FeatureLib/pfLocalizationMgr/pfLocalizationDataMgr.cpp

@ -993,7 +993,7 @@ void pfLocalizationDataMgr::IConvertAge(LocAgeInfo *ageInfo, const std::wstring
char *pfLocalizationDataMgr::IConvertToByteStream(const std::wstring & data, uint32_t &len) char *pfLocalizationDataMgr::IConvertToByteStream(const std::wstring & data, uint32_t &len)
{ {
len = data.length() * 2 + 2; // each wchar_t is two chars and add two bytes for the header len = data.length() * 2 + 2; // each wchar_t is two chars and add two bytes for the header
char *retVal = TRACKED_NEW char[len]; // we don't add an extra byte for the 0 because the parser doesn't need it char *retVal = new char[len]; // we don't add an extra byte for the 0 because the parser doesn't need it
char lowByte = 0, highByte = 0; char lowByte = 0, highByte = 0;
retVal[0] = (char)0xFF; // insert FFFE for little-endian UTF-16 (big-endian would be FEFF) retVal[0] = (char)0xFF; // insert FFFE for little-endian UTF-16 (big-endian would be FEFF)
retVal[1] = (char)0xFE; retVal[1] = (char)0xFE;
@ -1080,7 +1080,7 @@ void pfLocalizationDataMgr::Initialize(const std::string & path)
if (fInstance) if (fInstance)
return; return;
fInstance = TRACKED_NEW pfLocalizationDataMgr(path); fInstance = new pfLocalizationDataMgr(path);
fLog = plStatusLogMgr::GetInstance().CreateStatusLog(30, "LocalizationDataMgr.log", fLog = plStatusLogMgr::GetInstance().CreateStatusLog(30, "LocalizationDataMgr.log",
plStatusLog::kFilledBackground | plStatusLog::kAlignToTop | plStatusLog::kTimestamp); plStatusLog::kFilledBackground | plStatusLog::kAlignToTop | plStatusLog::kTimestamp);
fInstance->SetupData(); fInstance->SetupData();
@ -1110,7 +1110,7 @@ void pfLocalizationDataMgr::SetupData()
if (fDatabase) if (fDatabase)
delete fDatabase; delete fDatabase;
fDatabase = TRACKED_NEW LocalizationDatabase(); fDatabase = new LocalizationDatabase();
fDatabase->Parse(fDataPath); fDatabase->Parse(fDataPath);
char *temp = hsWStringToString(fDatabase->GetOutput().c_str()); char *temp = hsWStringToString(fDatabase->GetOutput().c_str());

2
Sources/Plasma/FeatureLib/pfLocalizationMgr/pfLocalizationMgr.cpp

@ -78,7 +78,7 @@ void pfLocalizationMgr::Initialize(const std::string & dataPath)
if (fInstance) if (fInstance)
return; return;
fInstance = TRACKED_NEW pfLocalizationMgr(); fInstance = new pfLocalizationMgr();
pfLocalizationDataMgr::Initialize(dataPath); // set up the data manager pfLocalizationDataMgr::Initialize(dataPath); // set up the data manager
} }

2
Sources/Plasma/FeatureLib/pfPython/Games/BlueSpiral/pyBlueSpiralGameGlue.cpp

@ -67,7 +67,7 @@ PYTHON_GLOBAL_METHOD_DEFINITION(PtIsBlueSpiralGame, args, "Params: typeID\nRetur
if (PyUnicode_Check(textObj)) if (PyUnicode_Check(textObj))
{ {
int strLen = PyUnicode_GetSize(textObj); int strLen = PyUnicode_GetSize(textObj);
wchar_t* text = TRACKED_NEW wchar_t[strLen + 1]; wchar_t* text = new wchar_t[strLen + 1];
PyUnicode_AsWideChar((PyUnicodeObject*)textObj, text, strLen); PyUnicode_AsWideChar((PyUnicodeObject*)textObj, text, strLen);
text[strLen] = L'\0'; text[strLen] = L'\0';
bool retVal = pyBlueSpiralGame::IsBlueSpiralGame(text); bool retVal = pyBlueSpiralGame::IsBlueSpiralGame(text);

2
Sources/Plasma/FeatureLib/pfPython/Games/ClimbingWall/pyClimbingWallGameGlue.cpp

@ -67,7 +67,7 @@ PYTHON_GLOBAL_METHOD_DEFINITION(PtIsClimbingWallGame, args, "Params: typeID\nRet
if (PyUnicode_Check(textObj)) if (PyUnicode_Check(textObj))
{ {
int strLen = PyUnicode_GetSize(textObj); int strLen = PyUnicode_GetSize(textObj);
wchar_t* text = TRACKED_NEW wchar_t[strLen + 1]; wchar_t* text = new wchar_t[strLen + 1];
PyUnicode_AsWideChar((PyUnicodeObject*)textObj, text, strLen); PyUnicode_AsWideChar((PyUnicodeObject*)textObj, text, strLen);
text[strLen] = L'\0'; text[strLen] = L'\0';
bool retVal = pyClimbingWallGame::IsClimbingWallGame(text); bool retVal = pyClimbingWallGame::IsClimbingWallGame(text);

4
Sources/Plasma/FeatureLib/pfPython/Games/Heek/pyHeekGameGlue.cpp

@ -67,7 +67,7 @@ PYTHON_GLOBAL_METHOD_DEFINITION(PtIsHeekGame, args, "Params: typeID\nReturns tru
if (PyUnicode_Check(textObj)) if (PyUnicode_Check(textObj))
{ {
int strLen = PyUnicode_GetSize(textObj); int strLen = PyUnicode_GetSize(textObj);
wchar_t* text = TRACKED_NEW wchar_t[strLen + 1]; wchar_t* text = new wchar_t[strLen + 1];
PyUnicode_AsWideChar((PyUnicodeObject*)textObj, text, strLen); PyUnicode_AsWideChar((PyUnicodeObject*)textObj, text, strLen);
text[strLen] = L'\0'; text[strLen] = L'\0';
bool retVal = pyHeekGame::IsHeekGame(text); bool retVal = pyHeekGame::IsHeekGame(text);
@ -122,7 +122,7 @@ PYTHON_METHOD_DEFINITION(ptHeekGame, playGame, args)
if (PyUnicode_Check(textObj)) if (PyUnicode_Check(textObj))
{ {
int strLen = PyUnicode_GetSize(textObj); int strLen = PyUnicode_GetSize(textObj);
wchar_t* temp = TRACKED_NEW wchar_t[strLen + 1]; wchar_t* temp = new wchar_t[strLen + 1];
PyUnicode_AsWideChar((PyUnicodeObject*)textObj, temp, strLen); PyUnicode_AsWideChar((PyUnicodeObject*)textObj, temp, strLen);
temp[strLen] = L'\0'; temp[strLen] = L'\0';
self->fThis->PlayGame(position, points, temp); self->fThis->PlayGame(position, points, temp);

14
Sources/Plasma/FeatureLib/pfPython/Games/Marker/pyMarkerGameGlue.cpp

@ -67,7 +67,7 @@ PYTHON_GLOBAL_METHOD_DEFINITION(PtIsMarkerGame, args, "Params: typeID\nReturns t
if (PyUnicode_Check(textObj)) if (PyUnicode_Check(textObj))
{ {
int strLen = PyUnicode_GetSize(textObj); int strLen = PyUnicode_GetSize(textObj);
wchar_t* text = TRACKED_NEW wchar_t[strLen + 1]; wchar_t* text = new wchar_t[strLen + 1];
PyUnicode_AsWideChar((PyUnicodeObject*)textObj, text, strLen); PyUnicode_AsWideChar((PyUnicodeObject*)textObj, text, strLen);
text[strLen] = L'\0'; text[strLen] = L'\0';
bool retVal = pyMarkerGame::IsMarkerGame(text); bool retVal = pyMarkerGame::IsMarkerGame(text);
@ -117,7 +117,7 @@ PYTHON_GLOBAL_METHOD_DEFINITION_WKEY(PtCreateMarkerGame, args, keywords, "Params
if (PyUnicode_Check(gameNameObj)) if (PyUnicode_Check(gameNameObj))
{ {
int strLen = PyUnicode_GetSize(gameNameObj); int strLen = PyUnicode_GetSize(gameNameObj);
wchar_t* text = TRACKED_NEW wchar_t[strLen + 1]; wchar_t* text = new wchar_t[strLen + 1];
PyUnicode_AsWideChar((PyUnicodeObject*)gameNameObj, text, strLen); PyUnicode_AsWideChar((PyUnicodeObject*)gameNameObj, text, strLen);
text[strLen] = L'\0'; text[strLen] = L'\0';
name = text; name = text;
@ -142,7 +142,7 @@ PYTHON_GLOBAL_METHOD_DEFINITION_WKEY(PtCreateMarkerGame, args, keywords, "Params
if (PyUnicode_Check(templateIdObj)) if (PyUnicode_Check(templateIdObj))
{ {
int strLen = PyUnicode_GetSize(templateIdObj); int strLen = PyUnicode_GetSize(templateIdObj);
wchar_t* text = TRACKED_NEW wchar_t[strLen + 1]; wchar_t* text = new wchar_t[strLen + 1];
PyUnicode_AsWideChar((PyUnicodeObject*)templateIdObj, text, strLen); PyUnicode_AsWideChar((PyUnicodeObject*)templateIdObj, text, strLen);
text[strLen] = L'\0'; text[strLen] = L'\0';
templateId = text; templateId = text;
@ -181,7 +181,7 @@ PYTHON_METHOD_DEFINITION(ptMarkerGame, changeGameName, args)
if (PyUnicode_Check(textObj)) if (PyUnicode_Check(textObj))
{ {
int strLen = PyUnicode_GetSize(textObj); int strLen = PyUnicode_GetSize(textObj);
wchar_t* text = TRACKED_NEW wchar_t[strLen + 1]; wchar_t* text = new wchar_t[strLen + 1];
PyUnicode_AsWideChar((PyUnicodeObject*)textObj, text, strLen); PyUnicode_AsWideChar((PyUnicodeObject*)textObj, text, strLen);
text[strLen] = L'\0'; text[strLen] = L'\0';
self->fThis->ChangeGameName(text); self->fThis->ChangeGameName(text);
@ -236,7 +236,7 @@ PYTHON_METHOD_DEFINITION_WKEY(ptMarkerGame, addMarker, args, keywords)
if (PyUnicode_Check(nameObj)) if (PyUnicode_Check(nameObj))
{ {
int strLen = PyUnicode_GetSize(nameObj); int strLen = PyUnicode_GetSize(nameObj);
wchar_t* text = TRACKED_NEW wchar_t[strLen + 1]; wchar_t* text = new wchar_t[strLen + 1];
PyUnicode_AsWideChar((PyUnicodeObject*)nameObj, text, strLen); PyUnicode_AsWideChar((PyUnicodeObject*)nameObj, text, strLen);
text[strLen] = L'\0'; text[strLen] = L'\0';
name = text; name = text;
@ -261,7 +261,7 @@ PYTHON_METHOD_DEFINITION_WKEY(ptMarkerGame, addMarker, args, keywords)
if (PyUnicode_Check(ageObj)) if (PyUnicode_Check(ageObj))
{ {
int strLen = PyUnicode_GetSize(ageObj); int strLen = PyUnicode_GetSize(ageObj);
wchar_t* text = TRACKED_NEW wchar_t[strLen + 1]; wchar_t* text = new wchar_t[strLen + 1];
PyUnicode_AsWideChar((PyUnicodeObject*)ageObj, text, strLen); PyUnicode_AsWideChar((PyUnicodeObject*)ageObj, text, strLen);
text[strLen] = L'\0'; text[strLen] = L'\0';
age = text; age = text;
@ -309,7 +309,7 @@ PYTHON_METHOD_DEFINITION(ptMarkerGame, changeMarkerName, args)
if (PyUnicode_Check(nameObj)) if (PyUnicode_Check(nameObj))
{ {
int strLen = PyUnicode_GetSize(nameObj); int strLen = PyUnicode_GetSize(nameObj);
wchar_t* text = TRACKED_NEW wchar_t[strLen + 1]; wchar_t* text = new wchar_t[strLen + 1];
PyUnicode_AsWideChar((PyUnicodeObject*)nameObj, text, strLen); PyUnicode_AsWideChar((PyUnicodeObject*)nameObj, text, strLen);
text[strLen] = L'\0'; text[strLen] = L'\0';
self->fThis->ChangeMarkerName(markerId, text); self->fThis->ChangeMarkerName(markerId, text);

2
Sources/Plasma/FeatureLib/pfPython/Games/TicTacToe/pyTTTGameGlue.cpp

@ -67,7 +67,7 @@ PYTHON_GLOBAL_METHOD_DEFINITION(PtIsTTTGame, args, "Params: typeID\nReturns true
if (PyUnicode_Check(textObj)) if (PyUnicode_Check(textObj))
{ {
int strLen = PyUnicode_GetSize(textObj); int strLen = PyUnicode_GetSize(textObj);
wchar_t* text = TRACKED_NEW wchar_t[strLen + 1]; wchar_t* text = new wchar_t[strLen + 1];
PyUnicode_AsWideChar((PyUnicodeObject*)textObj, text, strLen); PyUnicode_AsWideChar((PyUnicodeObject*)textObj, text, strLen);
text[strLen] = L'\0'; text[strLen] = L'\0';
bool retVal = pyTTTGame::IsTTTGame(text); bool retVal = pyTTTGame::IsTTTGame(text);

10
Sources/Plasma/FeatureLib/pfPython/Games/VarSync/pyVarSyncGameGlue.cpp

@ -67,7 +67,7 @@ PYTHON_GLOBAL_METHOD_DEFINITION(PtIsVarSyncGame, args, "Params: typeID\nReturns
if (PyUnicode_Check(textObj)) if (PyUnicode_Check(textObj))
{ {
int strLen = PyUnicode_GetSize(textObj); int strLen = PyUnicode_GetSize(textObj);
wchar_t* text = TRACKED_NEW wchar_t[strLen + 1]; wchar_t* text = new wchar_t[strLen + 1];
PyUnicode_AsWideChar((PyUnicodeObject*)textObj, text, strLen); PyUnicode_AsWideChar((PyUnicodeObject*)textObj, text, strLen);
text[strLen] = L'\0'; text[strLen] = L'\0';
bool retVal = pyVarSyncGame::IsVarSyncGame(text); bool retVal = pyVarSyncGame::IsVarSyncGame(text);
@ -121,7 +121,7 @@ PYTHON_METHOD_DEFINITION(ptVarSyncGame, setStringVar, args)
if (PyUnicode_Check(valueObj)) if (PyUnicode_Check(valueObj))
{ {
int strLen = PyUnicode_GetSize(valueObj); int strLen = PyUnicode_GetSize(valueObj);
wchar_t* text = TRACKED_NEW wchar_t[strLen + 1]; wchar_t* text = new wchar_t[strLen + 1];
PyUnicode_AsWideChar((PyUnicodeObject*)valueObj, text, strLen); PyUnicode_AsWideChar((PyUnicodeObject*)valueObj, text, strLen);
text[strLen] = L'\0'; text[strLen] = L'\0';
self->fThis->SetStringVar(id, text); self->fThis->SetStringVar(id, text);
@ -187,7 +187,7 @@ PYTHON_METHOD_DEFINITION(ptVarSyncGame, createStringVar, args)
if (PyUnicode_Check(varNameObj)) if (PyUnicode_Check(varNameObj))
{ {
int strLen = PyUnicode_GetSize(varNameObj); int strLen = PyUnicode_GetSize(varNameObj);
wchar_t* text = TRACKED_NEW wchar_t[strLen + 1]; wchar_t* text = new wchar_t[strLen + 1];
PyUnicode_AsWideChar((PyUnicodeObject*)varNameObj, text, strLen); PyUnicode_AsWideChar((PyUnicodeObject*)varNameObj, text, strLen);
text[strLen] = L'\0'; text[strLen] = L'\0';
varName = text; varName = text;
@ -211,7 +211,7 @@ PYTHON_METHOD_DEFINITION(ptVarSyncGame, createStringVar, args)
if (PyUnicode_Check(valueObj)) if (PyUnicode_Check(valueObj))
{ {
int strLen = PyUnicode_GetSize(valueObj); int strLen = PyUnicode_GetSize(valueObj);
wchar_t* text = TRACKED_NEW wchar_t[strLen + 1]; wchar_t* text = new wchar_t[strLen + 1];
PyUnicode_AsWideChar((PyUnicodeObject*)valueObj, text, strLen); PyUnicode_AsWideChar((PyUnicodeObject*)valueObj, text, strLen);
text[strLen] = L'\0'; text[strLen] = L'\0';
val = text; val = text;
@ -249,7 +249,7 @@ PYTHON_METHOD_DEFINITION(ptVarSyncGame, createNumericVar, args)
if (PyUnicode_Check(varNameObj)) if (PyUnicode_Check(varNameObj))
{ {
int strLen = PyUnicode_GetSize(varNameObj); int strLen = PyUnicode_GetSize(varNameObj);
wchar_t* text = TRACKED_NEW wchar_t[strLen + 1]; wchar_t* text = new wchar_t[strLen + 1];
PyUnicode_AsWideChar((PyUnicodeObject*)varNameObj, text, strLen); PyUnicode_AsWideChar((PyUnicodeObject*)varNameObj, text, strLen);
text[strLen] = L'\0'; text[strLen] = L'\0';
varName = text; varName = text;

2
Sources/Plasma/FeatureLib/pfPython/Games/pyGameCliGlue.cpp

@ -87,7 +87,7 @@ PYTHON_GLOBAL_METHOD_DEFINITION(PtGetGameNameByTypeID, args, "Params: guid\nRetu
if (PyUnicode_Check(textObj)) if (PyUnicode_Check(textObj))
{ {
int strLen = PyUnicode_GetSize(textObj); int strLen = PyUnicode_GetSize(textObj);
wchar_t* text = TRACKED_NEW wchar_t[strLen + 1]; wchar_t* text = new wchar_t[strLen + 1];
PyUnicode_AsWideChar((PyUnicodeObject*)textObj, text, strLen); PyUnicode_AsWideChar((PyUnicodeObject*)textObj, text, strLen);
text[strLen] = L'\0'; text[strLen] = L'\0';
std::wstring retVal = pyGameCli::GetGameNameByTypeID(text); std::wstring retVal = pyGameCli::GetGameNameByTypeID(text);

6
Sources/Plasma/FeatureLib/pfPython/cyAccountManagementGlue.cpp

@ -93,7 +93,7 @@ PYTHON_GLOBAL_METHOD_DEFINITION(PtCreatePlayerW, args, "Params: playerName, avat
if (PyUnicode_Check(playerNameObj)) if (PyUnicode_Check(playerNameObj))
{ {
int strLen = PyUnicode_GetSize(playerNameObj); int strLen = PyUnicode_GetSize(playerNameObj);
wchar_t* text = TRACKED_NEW wchar_t[strLen + 1]; wchar_t* text = new wchar_t[strLen + 1];
PyUnicode_AsWideChar((PyUnicodeObject*)playerNameObj, text, strLen); PyUnicode_AsWideChar((PyUnicodeObject*)playerNameObj, text, strLen);
text[strLen] = L'\0'; text[strLen] = L'\0';
playerName = text; playerName = text;
@ -116,7 +116,7 @@ PYTHON_GLOBAL_METHOD_DEFINITION(PtCreatePlayerW, args, "Params: playerName, avat
if (PyUnicode_Check(avatarShapeObj)) if (PyUnicode_Check(avatarShapeObj))
{ {
int strLen = PyUnicode_GetSize(avatarShapeObj); int strLen = PyUnicode_GetSize(avatarShapeObj);
wchar_t* text = TRACKED_NEW wchar_t[strLen + 1]; wchar_t* text = new wchar_t[strLen + 1];
PyUnicode_AsWideChar((PyUnicodeObject*)avatarShapeObj, text, strLen); PyUnicode_AsWideChar((PyUnicodeObject*)avatarShapeObj, text, strLen);
text[strLen] = L'\0'; text[strLen] = L'\0';
avatarShape = text; avatarShape = text;
@ -139,7 +139,7 @@ PYTHON_GLOBAL_METHOD_DEFINITION(PtCreatePlayerW, args, "Params: playerName, avat
if (PyUnicode_Check(invitationObj)) if (PyUnicode_Check(invitationObj))
{ {
int strLen = PyUnicode_GetSize(invitationObj); int strLen = PyUnicode_GetSize(invitationObj);
wchar_t* text = TRACKED_NEW wchar_t[strLen + 1]; wchar_t* text = new wchar_t[strLen + 1];
PyUnicode_AsWideChar((PyUnicodeObject*)invitationObj, text, strLen); PyUnicode_AsWideChar((PyUnicodeObject*)invitationObj, text, strLen);
text[strLen] = L'\0'; text[strLen] = L'\0';
invitation = text; invitation = text;

24
Sources/Plasma/FeatureLib/pfPython/cyAnimation.cpp

@ -131,7 +131,7 @@ void cyAnimation::Play()
if ( fRecvr.Count() > 0 ) if ( fRecvr.Count() > 0 )
{ {
// create message // create message
plAnimCmdMsg* pMsg = TRACKED_NEW plAnimCmdMsg; plAnimCmdMsg* pMsg = new plAnimCmdMsg;
// check if this needs to be network forced to all clients // check if this needs to be network forced to all clients
if (fNetForce ) if (fNetForce )
{ {
@ -174,7 +174,7 @@ void cyAnimation::Stop()
if ( fRecvr.Count() > 0 ) if ( fRecvr.Count() > 0 )
{ {
// create message // create message
plAnimCmdMsg* pMsg = TRACKED_NEW plAnimCmdMsg; plAnimCmdMsg* pMsg = new plAnimCmdMsg;
// check if this needs to be network forced to all clients // check if this needs to be network forced to all clients
if (fNetForce ) if (fNetForce )
{ {
@ -212,7 +212,7 @@ void cyAnimation::Resume()
if ( fRecvr.Count() > 0 ) if ( fRecvr.Count() > 0 )
{ {
// create message // create message
plAnimCmdMsg* pMsg = TRACKED_NEW plAnimCmdMsg; plAnimCmdMsg* pMsg = new plAnimCmdMsg;
// check if this needs to be network forced to all clients // check if this needs to be network forced to all clients
if (fNetForce ) if (fNetForce )
{ {
@ -264,7 +264,7 @@ void cyAnimation::PlayToTime(float time)
if ( fRecvr.Count() > 0 ) if ( fRecvr.Count() > 0 )
{ {
// create message // create message
plAnimCmdMsg* pMsg = TRACKED_NEW plAnimCmdMsg; plAnimCmdMsg* pMsg = new plAnimCmdMsg;
// check if this needs to be network forced to all clients // check if this needs to be network forced to all clients
if (fNetForce ) if (fNetForce )
{ {
@ -303,7 +303,7 @@ void cyAnimation::PlayToPercentage(float zeroToOne)
if ( fRecvr.Count() > 0 ) if ( fRecvr.Count() > 0 )
{ {
// create message // create message
plAnimCmdMsg* pMsg = TRACKED_NEW plAnimCmdMsg; plAnimCmdMsg* pMsg = new plAnimCmdMsg;
// check if this needs to be network forced to all clients // check if this needs to be network forced to all clients
if (fNetForce ) if (fNetForce )
{ {
@ -343,7 +343,7 @@ void cyAnimation::SkipToTime(float time)
if ( fRecvr.Count() > 0 ) if ( fRecvr.Count() > 0 )
{ {
// create message // create message
plAnimCmdMsg* pMsg = TRACKED_NEW plAnimCmdMsg; plAnimCmdMsg* pMsg = new plAnimCmdMsg;
// check if this needs to be network forced to all clients // check if this needs to be network forced to all clients
if (fNetForce ) if (fNetForce )
{ {
@ -382,7 +382,7 @@ void cyAnimation::Looped(hsBool looped)
if ( fRecvr.Count() > 0 ) if ( fRecvr.Count() > 0 )
{ {
// create message // create message
plAnimCmdMsg* pMsg = TRACKED_NEW plAnimCmdMsg; plAnimCmdMsg* pMsg = new plAnimCmdMsg;
// check if this needs to be network forced to all clients // check if this needs to be network forced to all clients
if (fNetForce ) if (fNetForce )
{ {
@ -423,7 +423,7 @@ void cyAnimation::Backwards(hsBool backwards)
if ( fRecvr.Count() > 0 ) if ( fRecvr.Count() > 0 )
{ {
// create message // create message
plAnimCmdMsg* pMsg = TRACKED_NEW plAnimCmdMsg; plAnimCmdMsg* pMsg = new plAnimCmdMsg;
// check if this needs to be network forced to all clients // check if this needs to be network forced to all clients
if (fNetForce ) if (fNetForce )
{ {
@ -464,7 +464,7 @@ void cyAnimation::SetLoopStart(float start)
if ( fRecvr.Count() > 0 ) if ( fRecvr.Count() > 0 )
{ {
// create message // create message
plAnimCmdMsg* pMsg = TRACKED_NEW plAnimCmdMsg; plAnimCmdMsg* pMsg = new plAnimCmdMsg;
// check if this needs to be network forced to all clients // check if this needs to be network forced to all clients
if (fNetForce ) if (fNetForce )
{ {
@ -496,7 +496,7 @@ void cyAnimation::SetLoopEnd(float end)
if ( fRecvr.Count() > 0 ) if ( fRecvr.Count() > 0 )
{ {
// create message // create message
plAnimCmdMsg* pMsg = TRACKED_NEW plAnimCmdMsg; plAnimCmdMsg* pMsg = new plAnimCmdMsg;
// check if this needs to be network forced to all clients // check if this needs to be network forced to all clients
if (fNetForce ) if (fNetForce )
{ {
@ -538,7 +538,7 @@ void cyAnimation::Speed(float speed)
if ( fRecvr.Count() > 0 ) if ( fRecvr.Count() > 0 )
{ {
// create message // create message
plAnimCmdMsg* pMsg = TRACKED_NEW plAnimCmdMsg; plAnimCmdMsg* pMsg = new plAnimCmdMsg;
// check if this needs to be network forced to all clients // check if this needs to be network forced to all clients
if (fNetForce ) if (fNetForce )
{ {
@ -571,7 +571,7 @@ void cyAnimation::IRunOneCmd(int cmd)
if ( fRecvr.Count() > 0 ) if ( fRecvr.Count() > 0 )
{ {
// create message // create message
plAnimCmdMsg* pMsg = TRACKED_NEW plAnimCmdMsg; plAnimCmdMsg* pMsg = new plAnimCmdMsg;
// check if this needs to be network forced to all clients // check if this needs to be network forced to all clients
if (fNetForce ) if (fNetForce )
{ {

24
Sources/Plasma/FeatureLib/pfPython/cyAvatar.cpp

@ -179,7 +179,7 @@ void cyAvatar::OneShot(pyKey &seekKey, float duration, hsBool usePhysics,
if ( fRecvr.Count() > 0 ) if ( fRecvr.Count() > 0 )
{ {
// create message // create message
plAvOneShotMsg* pMsg = TRACKED_NEW plAvOneShotMsg( plAvOneShotMsg* pMsg = new plAvOneShotMsg(
(plKey )fSender, (plKey )fSender,
nil, nil,
seekKey.getKey(), // Mark D told me to do it ...paulg seekKey.getKey(), // Mark D told me to do it ...paulg
@ -226,7 +226,7 @@ void cyAvatar::RunBehavior(pyKey &behKey, hsBool netForce, hsBool netProp)
if ( plOneShotMod::ConvertNoRef(behKey.getKey()->GetObjectPtr()) != nil ) if ( plOneShotMod::ConvertNoRef(behKey.getKey()->GetObjectPtr()) != nil )
{ {
// create a message OneShotMessage // create a message OneShotMessage
plOneShotMsg* pMsg = TRACKED_NEW plOneShotMsg; plOneShotMsg* pMsg = new plOneShotMsg;
// check if this needs to be network forced to all clients // check if this needs to be network forced to all clients
if (netProp) if (netProp)
{ {
@ -267,7 +267,7 @@ void cyAvatar::RunBehavior(pyKey &behKey, hsBool netForce, hsBool netProp)
{ {
// its a multistage thingy... need to send it a plNotifyMsg // its a multistage thingy... need to send it a plNotifyMsg
// create new notify message to do the actual send with // create new notify message to do the actual send with
plNotifyMsg* pNMsg = TRACKED_NEW plNotifyMsg; plNotifyMsg* pNMsg = new plNotifyMsg;
// set whether this should be forced over the network (ignoring net-cascading) // set whether this should be forced over the network (ignoring net-cascading)
if (netProp) if (netProp)
@ -320,7 +320,7 @@ void cyAvatar::RunBehaviorAndReply(pyKey& behKey, pyKey& replyKey, hsBool netFor
{ {
// its a multistage thingy... need to send it a plNotifyMsg // its a multistage thingy... need to send it a plNotifyMsg
// create new notify message to do the actual send with // create new notify message to do the actual send with
plNotifyMsg* pNMsg = TRACKED_NEW plNotifyMsg; plNotifyMsg* pNMsg = new plNotifyMsg;
// set whether this should be forced over the network (ignoring net-cascading) // set whether this should be forced over the network (ignoring net-cascading)
if (netProp) if (netProp)
@ -385,7 +385,7 @@ void cyAvatar::NextStage(pyKey &behKey, float transTime, hsBool setTime, float n
if ( avKey ) if ( avKey )
{ {
// create the message // create the message
plAvBrainGenericMsg* pMsg = TRACKED_NEW plAvBrainGenericMsg((plKey)fSender, avKey, plAvBrainGenericMsg* pMsg = new plAvBrainGenericMsg((plKey)fSender, avKey,
plAvBrainGenericMsg::kNextStage, 0, setTime, newTime, plAvBrainGenericMsg::kNextStage, 0, setTime, newTime,
setDirection, (bool)isForward, transTime); setDirection, (bool)isForward, transTime);
@ -424,7 +424,7 @@ void cyAvatar::PreviousStage(pyKey &behKey, float transTime, hsBool setTime, flo
if ( avKey ) if ( avKey )
{ {
// create the message // create the message
plAvBrainGenericMsg* pMsg = TRACKED_NEW plAvBrainGenericMsg((plKey)fSender, avKey, plAvBrainGenericMsg* pMsg = new plAvBrainGenericMsg((plKey)fSender, avKey,
plAvBrainGenericMsg::kPrevStage, 0, setTime, newTime, plAvBrainGenericMsg::kPrevStage, 0, setTime, newTime,
setDirection, (bool)isForward, transTime); setDirection, (bool)isForward, transTime);
@ -464,7 +464,7 @@ void cyAvatar::GoToStage(pyKey &behKey, int32_t stage, float transTime, hsBool s
if ( avKey ) if ( avKey )
{ {
// create the message // create the message
plAvBrainGenericMsg* pMsg = TRACKED_NEW plAvBrainGenericMsg((plKey)fSender, avKey, plAvBrainGenericMsg* pMsg = new plAvBrainGenericMsg((plKey)fSender, avKey,
plAvBrainGenericMsg::kGotoStage, stage, setTime, newTime, plAvBrainGenericMsg::kGotoStage, stage, setTime, newTime,
setDirection, isForward, transTime); setDirection, isForward, transTime);
@ -484,7 +484,7 @@ void cyAvatar::SetLoopCount(pyKey &behKey, int32_t stage, int32_t loopCount, hsB
// if it is a Multistage guy // if it is a Multistage guy
if ( plMultistageBehMod::ConvertNoRef(behKey.getKey()->GetObjectPtr()) != nil ) if ( plMultistageBehMod::ConvertNoRef(behKey.getKey()->GetObjectPtr()) != nil )
{ {
plMultistageModMsg* pMsg = TRACKED_NEW plMultistageModMsg((plKey)nil, behKey.getKey()); plMultistageModMsg* pMsg = new plMultistageModMsg((plKey)nil, behKey.getKey());
pMsg->SetCommand(plMultistageModMsg::kSetLoopCount); pMsg->SetCommand(plMultistageModMsg::kSetLoopCount);
pMsg->fStageNum = (uint8_t)stage; pMsg->fStageNum = (uint8_t)stage;
pMsg->fNumLoops = (uint8_t)loopCount; pMsg->fNumLoops = (uint8_t)loopCount;
@ -513,7 +513,7 @@ void cyAvatar::Seek(pyKey &seekKey, float duration, hsBool usePhysics)
if ( fRecvr.Count() > 0 ) if ( fRecvr.Count() > 0 )
{ {
// create message // create message
plAvSeekMsg* pMsg = TRACKED_NEW plAvSeekMsg( plAvSeekMsg* pMsg = new plAvSeekMsg(
(plKey)fSender,nil, seekKey.getKey(),duration,usePhysics); (plKey)fSender,nil, seekKey.getKey(),duration,usePhysics);
// check if this needs to be network forced to all clients // check if this needs to be network forced to all clients
@ -1546,7 +1546,7 @@ void cyAvatar::EnterSubWorld(pySceneObject& object)
plKey subWorldKey = SOkey; plKey subWorldKey = SOkey;
plKey physKey = avatar->GetKey(); plKey physKey = avatar->GetKey();
plKey nilKey; // sorry plKey nilKey; // sorry
plSubWorldMsg *swMsg = TRACKED_NEW plSubWorldMsg(nilKey, physKey, subWorldKey); plSubWorldMsg *swMsg = new plSubWorldMsg(nilKey, physKey, subWorldKey);
swMsg->Send(); swMsg->Send();
} }
} }
@ -1573,7 +1573,7 @@ void cyAvatar::ExitSubWorld()
plKey subWorldKey; // we're going to the nil subworld plKey subWorldKey; // we're going to the nil subworld
plKey physKey = avatar->GetKey(); plKey physKey = avatar->GetKey();
plKey nilKey; // sorry plKey nilKey; // sorry
plSubWorldMsg *swMsg = TRACKED_NEW plSubWorldMsg(nilKey, physKey, subWorldKey); plSubWorldMsg *swMsg = new plSubWorldMsg(nilKey, physKey, subWorldKey);
swMsg->Send(); swMsg->Send();
} }
} }
@ -1949,7 +1949,7 @@ bool IExitTopmostGenericMode()
{ {
plArmatureMod *avatar = plAvatarMgr::GetInstance()->GetLocalAvatar(); plArmatureMod *avatar = plAvatarMgr::GetInstance()->GetLocalAvatar();
plAvBrainGenericMsg* pMsg = TRACKED_NEW plAvBrainGenericMsg(nil, avatar->GetKey(), plAvBrainGenericMsg* pMsg = new plAvBrainGenericMsg(nil, avatar->GetKey(),
plAvBrainGenericMsg::kGotoStage, 2, false, 0.0, plAvBrainGenericMsg::kGotoStage, 2, false, 0.0,
false, false, 0.0); false, false, 0.0);

12
Sources/Plasma/FeatureLib/pfPython/cyCamera.cpp

@ -83,7 +83,7 @@ void cyCamera::SetSender(plKey &sender)
void cyCamera::Push(pyKey& newCamKey) void cyCamera::Push(pyKey& newCamKey)
{ {
// create message // create message
plCameraMsg* pMsg = TRACKED_NEW plCameraMsg; plCameraMsg* pMsg = new plCameraMsg;
if ( fSender ) if ( fSender )
pMsg->SetSender(fSender); pMsg->SetSender(fSender);
@ -113,7 +113,7 @@ void cyCamera::Push(pyKey& newCamKey)
void cyCamera::Pop(pyKey& oldCamKey) void cyCamera::Pop(pyKey& oldCamKey)
{ {
// create message // create message
plCameraMsg* pMsg = TRACKED_NEW plCameraMsg; plCameraMsg* pMsg = new plCameraMsg;
if ( fSender ) if ( fSender )
pMsg->SetSender(fSender); pMsg->SetSender(fSender);
@ -145,7 +145,7 @@ void cyCamera::ControlKey(int32_t controlKey, hsBool activated)
// make sure that we have a virtual camera to send this to // make sure that we have a virtual camera to send this to
if ( fTheCam ) if ( fTheCam )
{ {
plControlEventMsg* pMsg = TRACKED_NEW plControlEventMsg; plControlEventMsg* pMsg = new plControlEventMsg;
// set sender if there is one // set sender if there is one
if ( fSender ) if ( fSender )
pMsg->SetSender(fSender); pMsg->SetSender(fSender);
@ -173,7 +173,7 @@ void cyCamera::ControlKey(int32_t controlKey, hsBool activated)
void cyCamera::TransitionTo(pyKey& newCamKey, double time, hsBool save) void cyCamera::TransitionTo(pyKey& newCamKey, double time, hsBool save)
{ {
// create message // create message
plCameraMsg* pMsg = TRACKED_NEW plCameraMsg; plCameraMsg* pMsg = new plCameraMsg;
if ( fSender ) if ( fSender )
pMsg->SetSender(fSender); pMsg->SetSender(fSender);
// must have a receiver! // must have a receiver!
@ -200,7 +200,7 @@ void cyCamera::SetEnableFirstPersonOverride(hsBool state)
if ( fTheCam ) if ( fTheCam )
{ {
// create message // create message
plCameraMsg* pMsg = TRACKED_NEW plCameraMsg; plCameraMsg* pMsg = new plCameraMsg;
if ( fSender ) if ( fSender )
pMsg->SetSender(fSender); pMsg->SetSender(fSender);
@ -218,7 +218,7 @@ void cyCamera::SetEnableFirstPersonOverride(hsBool state)
void cyCamera::UndoFirstPerson() void cyCamera::UndoFirstPerson()
{ {
// create message // create message
plCameraMsg* pMsg = TRACKED_NEW plCameraMsg; plCameraMsg* pMsg = new plCameraMsg;
if ( fSender ) if ( fSender )
pMsg->SetSender(fSender); pMsg->SetSender(fSender);
// must have a receiver! // must have a receiver!

2
Sources/Plasma/FeatureLib/pfPython/cyDraw.cpp

@ -78,7 +78,7 @@ void cyDraw::EnableT(hsBool state)
if ( fRecvr.Count() > 0 ) if ( fRecvr.Count() > 0 )
{ {
// create message // create message
plEnableMsg* pMsg = TRACKED_NEW plEnableMsg; plEnableMsg* pMsg = new plEnableMsg;
// check if this needs to be network forced to all clients // check if this needs to be network forced to all clients
if (fNetForce ) if (fNetForce )
{ {

6
Sources/Plasma/FeatureLib/pfPython/cyInputInterface.cpp

@ -70,8 +70,8 @@ void cyInputInterface::PushTelescopeInterface()
{ {
if (!fTelescopeInterface) if (!fTelescopeInterface)
{ {
fTelescopeInterface = TRACKED_NEW plTelescopeInputInterface; fTelescopeInterface = new plTelescopeInputInterface;
plInputIfaceMgrMsg* pMsg = TRACKED_NEW plInputIfaceMgrMsg(plInputIfaceMgrMsg::kAddInterface); plInputIfaceMgrMsg* pMsg = new plInputIfaceMgrMsg(plInputIfaceMgrMsg::kAddInterface);
pMsg->SetIFace(fTelescopeInterface); pMsg->SetIFace(fTelescopeInterface);
pMsg->Send(); pMsg->Send();
} }
@ -88,7 +88,7 @@ void cyInputInterface::PopTelescope()
{ {
if (fTelescopeInterface) if (fTelescopeInterface)
{ {
plInputIfaceMgrMsg* pMsg = TRACKED_NEW plInputIfaceMgrMsg(plInputIfaceMgrMsg::kRemoveInterface); plInputIfaceMgrMsg* pMsg = new plInputIfaceMgrMsg(plInputIfaceMgrMsg::kRemoveInterface);
pMsg->SetIFace(fTelescopeInterface); pMsg->SetIFace(fTelescopeInterface);
pMsg->Send(); pMsg->Send();
hsRefCnt_SafeUnRef( fTelescopeInterface ); hsRefCnt_SafeUnRef( fTelescopeInterface );

118
Sources/Plasma/FeatureLib/pfPython/cyMisc.cpp

@ -158,7 +158,7 @@ void cyMisc::Console(const char* command)
if ( command != nil ) if ( command != nil )
{ {
// create message to send to the console // create message to send to the console
plControlEventMsg* pMsg = TRACKED_NEW plControlEventMsg; plControlEventMsg* pMsg = new plControlEventMsg;
pMsg->SetBCastFlag(plMessage::kBCastByType); pMsg->SetBCastFlag(plMessage::kBCastByType);
pMsg->SetControlCode(B_CONTROL_CONSOLE_COMMAND); pMsg->SetControlCode(B_CONTROL_CONSOLE_COMMAND);
pMsg->SetControlActivated(true); pMsg->SetControlActivated(true);
@ -172,7 +172,7 @@ void cyMisc::ConsoleNet(const char* command, hsBool netForce)
if ( command != nil ) if ( command != nil )
{ {
// create message to send to the console // create message to send to the console
plControlEventMsg* pMsg = TRACKED_NEW plControlEventMsg; plControlEventMsg* pMsg = new plControlEventMsg;
pMsg->SetBCastFlag(plMessage::kBCastByType); pMsg->SetBCastFlag(plMessage::kBCastByType);
pMsg->SetBCastFlag(plMessage::kNetPropagate); pMsg->SetBCastFlag(plMessage::kNetPropagate);
if ( netForce ) if ( netForce )
@ -250,13 +250,13 @@ void cyMisc::PopUpConsole(const char* command)
if ( command != nil ) if ( command != nil )
{ {
// create message to send to the console // create message to send to the console
plControlEventMsg* pMsg1 = TRACKED_NEW plControlEventMsg; plControlEventMsg* pMsg1 = new plControlEventMsg;
pMsg1->SetBCastFlag(plMessage::kBCastByType); pMsg1->SetBCastFlag(plMessage::kBCastByType);
pMsg1->SetControlCode(B_SET_CONSOLE_MODE); pMsg1->SetControlCode(B_SET_CONSOLE_MODE);
pMsg1->SetControlActivated(true); pMsg1->SetControlActivated(true);
plgDispatch::MsgSend( pMsg1 ); // whoosh... off it goes plgDispatch::MsgSend( pMsg1 ); // whoosh... off it goes
// create message to send to the console // create message to send to the console
plControlEventMsg* pMsg2 = TRACKED_NEW plControlEventMsg; plControlEventMsg* pMsg2 = new plControlEventMsg;
pMsg2->SetBCastFlag(plMessage::kBCastByType); pMsg2->SetBCastFlag(plMessage::kBCastByType);
pMsg2->SetControlCode(B_CONTROL_CONSOLE_COMMAND); pMsg2->SetControlCode(B_CONTROL_CONSOLE_COMMAND);
pMsg2->SetControlActivated(true); pMsg2->SetControlActivated(true);
@ -275,7 +275,7 @@ void cyMisc::PopUpConsole(const char* command)
void cyMisc::TimerCallback(pyKey& selfkey, float time, uint32_t id) void cyMisc::TimerCallback(pyKey& selfkey, float time, uint32_t id)
{ {
// setup the message to come back to whoever the pyKey is pointing to // setup the message to come back to whoever the pyKey is pointing to
plTimerCallbackMsg* pTimerMsg = TRACKED_NEW plTimerCallbackMsg(selfkey.getKey(),id); plTimerCallbackMsg* pTimerMsg = new plTimerCallbackMsg(selfkey.getKey(),id);
plgTimerCallbackMgr::NewTimer( time, pTimerMsg ); plgTimerCallbackMgr::NewTimer( time, pTimerMsg );
} }
@ -308,7 +308,7 @@ void cyMisc::AttachObject(pyKey& ckey, pyKey& pkey)
if ( childKey ) if ( childKey )
{ {
// create the attach message to attach the child // create the attach message to attach the child
plAttachMsg* pMsg = TRACKED_NEW plAttachMsg(parentKey, childKey->GetObjectPtr(), plRefMsg::kOnRequest); plAttachMsg* pMsg = new plAttachMsg(parentKey, childKey->GetObjectPtr(), plRefMsg::kOnRequest);
plgDispatch::MsgSend( pMsg ); plgDispatch::MsgSend( pMsg );
} }
} }
@ -321,7 +321,7 @@ void cyMisc::AttachObjectSO(pySceneObject& cobj, pySceneObject& pobj)
if ( childKey ) if ( childKey )
{ {
// create the attach message to attach the child // create the attach message to attach the child
plAttachMsg* pMsg = TRACKED_NEW plAttachMsg(parentKey, childKey->GetObjectPtr(), plRefMsg::kOnRequest); plAttachMsg* pMsg = new plAttachMsg(parentKey, childKey->GetObjectPtr(), plRefMsg::kOnRequest);
plgDispatch::MsgSend( pMsg ); plgDispatch::MsgSend( pMsg );
} }
} }
@ -344,7 +344,7 @@ void cyMisc::DetachObject(pyKey& ckey, pyKey& pkey)
if ( childKey ) if ( childKey )
{ {
// create the attach message to detach the child // create the attach message to detach the child
plAttachMsg* pMsg = TRACKED_NEW plAttachMsg(parentKey, childKey->GetObjectPtr(), plRefMsg::kOnRemove); plAttachMsg* pMsg = new plAttachMsg(parentKey, childKey->GetObjectPtr(), plRefMsg::kOnRemove);
plgDispatch::MsgSend( pMsg ); plgDispatch::MsgSend( pMsg );
} }
} }
@ -357,7 +357,7 @@ void cyMisc::DetachObjectSO(pySceneObject& cobj, pySceneObject& pobj)
if ( childKey ) if ( childKey )
{ {
// create the attach message to detach the child // create the attach message to detach the child
plAttachMsg* pMsg = TRACKED_NEW plAttachMsg(parentKey, childKey->GetObjectPtr(), plRefMsg::kOnRemove); plAttachMsg* pMsg = new plAttachMsg(parentKey, childKey->GetObjectPtr(), plRefMsg::kOnRemove);
plgDispatch::MsgSend( pMsg ); plgDispatch::MsgSend( pMsg );
} }
} }
@ -688,7 +688,7 @@ time_t cyMisc::ConvertGMTtoDni(time_t gtime)
// //
void cyMisc::ExcludeRegionSet(pyKey& sender, pyKey& exKey, uint16_t state) void cyMisc::ExcludeRegionSet(pyKey& sender, pyKey& exKey, uint16_t state)
{ {
plExcludeRegionMsg *msg = TRACKED_NEW plExcludeRegionMsg; plExcludeRegionMsg *msg = new plExcludeRegionMsg;
switch (state) switch (state)
{ {
@ -706,7 +706,7 @@ void cyMisc::ExcludeRegionSet(pyKey& sender, pyKey& exKey, uint16_t state)
void cyMisc::ExcludeRegionSetNow(pyKey& sender, pyKey& exKey, uint16_t state) void cyMisc::ExcludeRegionSetNow(pyKey& sender, pyKey& exKey, uint16_t state)
{ {
plExcludeRegionMsg *msg = TRACKED_NEW plExcludeRegionMsg; plExcludeRegionMsg *msg = new plExcludeRegionMsg;
switch (state) switch (state)
{ {
@ -1083,7 +1083,7 @@ float cyMisc::GetMaxListenDistSq()
uint32_t cyMisc::SendRTChat(pyPlayer& from, const std::vector<pyPlayer*> & tolist, const char* message, uint32_t flags) uint32_t cyMisc::SendRTChat(pyPlayer& from, const std::vector<pyPlayer*> & tolist, const char* message, uint32_t flags)
{ {
// create the messge that will contain the chat message // create the messge that will contain the chat message
pfKIMsg *msg = TRACKED_NEW pfKIMsg( pfKIMsg::kHACKChatMsg ); pfKIMsg *msg = new pfKIMsg( pfKIMsg::kHACKChatMsg );
msg->SetString( message ); msg->SetString( message );
msg->SetUser( from.GetPlayerName(), from.GetPlayerID() ); msg->SetUser( from.GetPlayerName(), from.GetPlayerID() );
msg->SetFlags( flags ); msg->SetFlags( flags );
@ -1117,7 +1117,7 @@ uint32_t cyMisc::SendRTChat(pyPlayer& from, const std::vector<pyPlayer*> & tolis
uint32_t cyMisc::SendRTChat(pyPlayer& from, const std::vector<pyPlayer*> & tolist, const wchar_t* message, uint32_t flags) uint32_t cyMisc::SendRTChat(pyPlayer& from, const std::vector<pyPlayer*> & tolist, const wchar_t* message, uint32_t flags)
{ {
// create the messge that will contain the chat message // create the messge that will contain the chat message
pfKIMsg *msg = TRACKED_NEW pfKIMsg( pfKIMsg::kHACKChatMsg ); pfKIMsg *msg = new pfKIMsg( pfKIMsg::kHACKChatMsg );
msg->SetString( message ); msg->SetString( message );
msg->SetUser( from.GetPlayerName(), from.GetPlayerID() ); msg->SetUser( from.GetPlayerName(), from.GetPlayerID() );
msg->SetFlags( flags ); msg->SetFlags( flags );
@ -1160,7 +1160,7 @@ uint32_t cyMisc::SendRTChat(pyPlayer& from, const std::vector<pyPlayer*> & tolis
void cyMisc::SendKIMessage(uint32_t command, float value) void cyMisc::SendKIMessage(uint32_t command, float value)
{ {
// create the mesage to send // create the mesage to send
pfKIMsg *msg = TRACKED_NEW pfKIMsg( (uint8_t)command ); pfKIMsg *msg = new pfKIMsg( (uint8_t)command );
// check to see if the value makes any sense // check to see if the value makes any sense
if ( command == pfKIMsg::kSetChatFadeDelay ) if ( command == pfKIMsg::kSetChatFadeDelay )
@ -1188,7 +1188,7 @@ void cyMisc::SendKIMessage(uint32_t command, float value)
void cyMisc::SendKIMessageS(uint32_t command, const wchar_t* value) void cyMisc::SendKIMessageS(uint32_t command, const wchar_t* value)
{ {
// create the mesage to send // create the mesage to send
pfKIMsg *msg = TRACKED_NEW pfKIMsg( (uint8_t)command ); pfKIMsg *msg = new pfKIMsg( (uint8_t)command );
msg->SetString( value ); msg->SetString( value );
@ -1209,7 +1209,7 @@ void cyMisc::SendKIMessageS(uint32_t command, const wchar_t* value)
void cyMisc::SendKIMessageI(uint32_t command, int32_t value) void cyMisc::SendKIMessageI(uint32_t command, int32_t value)
{ {
// create the mesage to send // create the mesage to send
pfKIMsg *msg = TRACKED_NEW pfKIMsg( (uint8_t)command ); pfKIMsg *msg = new pfKIMsg( (uint8_t)command );
msg->SetIntValue(value); msg->SetIntValue(value);
@ -1230,7 +1230,7 @@ void cyMisc::SendKIMessageI(uint32_t command, int32_t value)
void cyMisc::SendKIGZMarkerMsg(int32_t markerNumber, pyKey& sender) void cyMisc::SendKIGZMarkerMsg(int32_t markerNumber, pyKey& sender)
{ {
// create the mesage to send // create the mesage to send
pfKIMsg *msg = TRACKED_NEW pfKIMsg( pfKIMsg::kGZInRange ); pfKIMsg *msg = new pfKIMsg( pfKIMsg::kGZInRange );
msg->SetIntValue(markerNumber); msg->SetIntValue(markerNumber);
msg->SetSender(sender.getKey()); msg->SetSender(sender.getKey());
@ -1241,7 +1241,7 @@ void cyMisc::SendKIGZMarkerMsg(int32_t markerNumber, pyKey& sender)
void cyMisc::SendKIRegisterImagerMsg(const char* imagerName, pyKey& sender) void cyMisc::SendKIRegisterImagerMsg(const char* imagerName, pyKey& sender)
{ {
pfKIMsg *msg = TRACKED_NEW pfKIMsg(pfKIMsg::kRegisterImager); pfKIMsg *msg = new pfKIMsg(pfKIMsg::kRegisterImager);
msg->SetString(imagerName); msg->SetString(imagerName);
msg->SetSender(sender.getKey()); msg->SetSender(sender.getKey());
@ -1263,7 +1263,7 @@ void cyMisc::SendKIRegisterImagerMsg(const char* imagerName, pyKey& sender)
void cyMisc::YesNoDialog(pyKey& sender, const char* thestring) void cyMisc::YesNoDialog(pyKey& sender, const char* thestring)
{ {
// create the mesage to send // create the mesage to send
pfKIMsg *msg = TRACKED_NEW pfKIMsg( pfKIMsg::kYesNoDialog ); pfKIMsg *msg = new pfKIMsg( pfKIMsg::kYesNoDialog );
msg->SetSender(sender.getKey()); msg->SetSender(sender.getKey());
msg->SetString(thestring); msg->SetString(thestring);
@ -1292,7 +1292,7 @@ void cyMisc::YesNoDialog(pyKey& sender, std::wstring thestring)
void cyMisc::RateIt(const char* chronicleName, const char* thestring, hsBool onceFlag) void cyMisc::RateIt(const char* chronicleName, const char* thestring, hsBool onceFlag)
{ {
// create the mesage to send // create the mesage to send
pfKIMsg *msg = TRACKED_NEW pfKIMsg( pfKIMsg::kRateIt ); pfKIMsg *msg = new pfKIMsg( pfKIMsg::kRateIt );
msg->SetUser(chronicleName,0); msg->SetUser(chronicleName,0);
msg->SetString(thestring); msg->SetString(thestring);
@ -1315,7 +1315,7 @@ void cyMisc::SetPrivateChatList(const std::vector<pyPlayer*> & tolist)
{ {
if (tolist.size() > 0) if (tolist.size() > 0)
{ {
plNetVoiceListMsg* pMsg = TRACKED_NEW plNetVoiceListMsg(plNetVoiceListMsg::kForcedListenerMode); plNetVoiceListMsg* pMsg = new plNetVoiceListMsg(plNetVoiceListMsg::kForcedListenerMode);
for (int i=0 ; i<tolist.size() ; i++ ) for (int i=0 ; i<tolist.size() ; i++ )
pMsg->GetClientList()->Append(tolist[i]->GetPlayerID()); pMsg->GetClientList()->Append(tolist[i]->GetPlayerID());
@ -1335,7 +1335,7 @@ void cyMisc::SetPrivateChatList(const std::vector<pyPlayer*> & tolist)
// //
void cyMisc::ClearPrivateChatList(pyKey& member) void cyMisc::ClearPrivateChatList(pyKey& member)
{ {
plNetVoiceListMsg* pMsg = TRACKED_NEW plNetVoiceListMsg(plNetVoiceListMsg::kDistanceMode); plNetVoiceListMsg* pMsg = new plNetVoiceListMsg(plNetVoiceListMsg::kDistanceMode);
pMsg->SetRemovedKey( member.getKey() ); pMsg->SetRemovedKey( member.getKey() );
pMsg->Send(); pMsg->Send();
} }
@ -1371,7 +1371,7 @@ void cyMisc::SendPetitionToCCR(const char* message)
void cyMisc::SendPetitionToCCRI(const char* message, uint8_t reason,const char* title) void cyMisc::SendPetitionToCCRI(const char* message, uint8_t reason,const char* title)
{ {
// create the mesage to send // create the mesage to send
plCCRPetitionMsg *msg = TRACKED_NEW plCCRPetitionMsg(); plCCRPetitionMsg *msg = new plCCRPetitionMsg();
msg->SetNote(message); msg->SetNote(message);
msg->SetType(reason); msg->SetType(reason);
if (title) if (title)
@ -1391,7 +1391,7 @@ void cyMisc::SendPetitionToCCRI(const char* message, uint8_t reason,const char*
void cyMisc::SendChatToCCR(const char* message,int32_t CCRPlayerID) void cyMisc::SendChatToCCR(const char* message,int32_t CCRPlayerID)
{ {
// create the mesage to send // create the mesage to send
plCCRCommunicationMsg *msg = TRACKED_NEW plCCRCommunicationMsg(); plCCRCommunicationMsg *msg = new plCCRCommunicationMsg();
msg->SetMessage(message); msg->SetMessage(message);
msg->SetType(plCCRCommunicationMsg::kReturnChatMsg); msg->SetType(plCCRCommunicationMsg::kReturnChatMsg);
msg->SetBCastFlag(plMessage::kNetAllowInterAge); msg->SetBCastFlag(plMessage::kNetAllowInterAge);
@ -1426,7 +1426,7 @@ void cyMisc::PageInNodes(const std::vector<std::string> & nodeNames, const char*
if (hsgResMgr::ResMgr()) if (hsgResMgr::ResMgr())
{ {
plSynchEnabler ps(false); // disable dirty tracking while paging in plSynchEnabler ps(false); // disable dirty tracking while paging in
plClientMsg* msg = TRACKED_NEW plClientMsg(plClientMsg::kLoadRoom); plClientMsg* msg = new plClientMsg(plClientMsg::kLoadRoom);
plKey clientKey = hsgResMgr::ResMgr()->FindKey(kClient_KEY); plKey clientKey = hsgResMgr::ResMgr()->FindKey(kClient_KEY);
msg->AddReceiver(clientKey); msg->AddReceiver(clientKey);
@ -1443,7 +1443,7 @@ void cyMisc::PageOutNode(const char* nodeName)
if ( hsgResMgr::ResMgr() ) if ( hsgResMgr::ResMgr() )
{ {
plSynchEnabler ps(false); // disable dirty tracking while paging out plSynchEnabler ps(false); // disable dirty tracking while paging out
plClientMsg* pMsg1 = TRACKED_NEW plClientMsg(plClientMsg::kUnloadRoom); plClientMsg* pMsg1 = new plClientMsg(plClientMsg::kUnloadRoom);
plKey clientKey = hsgResMgr::ResMgr()->FindKey( kClient_KEY ); plKey clientKey = hsgResMgr::ResMgr()->FindKey( kClient_KEY );
pMsg1->AddReceiver( clientKey ); pMsg1->AddReceiver( clientKey );
pMsg1->AddRoomLoc(plKeyFinder::Instance().FindLocation(nil, nodeName)); pMsg1->AddRoomLoc(plKeyFinder::Instance().FindLocation(nil, nodeName));
@ -1526,7 +1526,7 @@ void cyMisc::SetClearColor(float red, float green, float blue)
char command[256]; char command[256];
sprintf(command,"Graphics.Renderer.SetClearColor %f %f %f",red,green,blue); sprintf(command,"Graphics.Renderer.SetClearColor %f %f %f",red,green,blue);
// create message to send to the console // create message to send to the console
plControlEventMsg* pMsg = TRACKED_NEW plControlEventMsg; plControlEventMsg* pMsg = new plControlEventMsg;
pMsg->SetBCastFlag(plMessage::kBCastByType); pMsg->SetBCastFlag(plMessage::kBCastByType);
pMsg->SetControlCode(B_CONTROL_CONSOLE_COMMAND); pMsg->SetControlCode(B_CONTROL_CONSOLE_COMMAND);
pMsg->SetControlActivated(true); pMsg->SetControlActivated(true);
@ -1547,7 +1547,7 @@ void cyMisc::EnableAvatarCursorFade()
plNetClientMgr* nmgr = plNetClientMgr::GetInstance(); plNetClientMgr* nmgr = plNetClientMgr::GetInstance();
if (nmgr) if (nmgr)
{ {
plIfaceFadeAvatarMsg* iMsg = TRACKED_NEW plIfaceFadeAvatarMsg; plIfaceFadeAvatarMsg* iMsg = new plIfaceFadeAvatarMsg;
iMsg->SetSubjectKey(nmgr->GetLocalPlayerKey()); iMsg->SetSubjectKey(nmgr->GetLocalPlayerKey());
iMsg->SetBCastFlag(plMessage::kBCastByExactType); iMsg->SetBCastFlag(plMessage::kBCastByExactType);
iMsg->SetBCastFlag(plMessage::kNetPropagate, FALSE); iMsg->SetBCastFlag(plMessage::kNetPropagate, FALSE);
@ -1561,7 +1561,7 @@ void cyMisc::DisableAvatarCursorFade()
plNetClientMgr* nmgr = plNetClientMgr::GetInstance(); plNetClientMgr* nmgr = plNetClientMgr::GetInstance();
if (nmgr) if (nmgr)
{ {
plIfaceFadeAvatarMsg* iMsg = TRACKED_NEW plIfaceFadeAvatarMsg; plIfaceFadeAvatarMsg* iMsg = new plIfaceFadeAvatarMsg;
iMsg->SetSubjectKey(nmgr->GetLocalPlayerKey()); iMsg->SetSubjectKey(nmgr->GetLocalPlayerKey());
iMsg->SetBCastFlag(plMessage::kBCastByExactType); iMsg->SetBCastFlag(plMessage::kBCastByExactType);
iMsg->SetBCastFlag(plMessage::kNetPropagate, FALSE); iMsg->SetBCastFlag(plMessage::kNetPropagate, FALSE);
@ -1575,7 +1575,7 @@ void cyMisc::FadeLocalPlayer(hsBool fade)
plNetClientMgr* nmgr = plNetClientMgr::GetInstance(); plNetClientMgr* nmgr = plNetClientMgr::GetInstance();
if (nmgr) if (nmgr)
{ {
plCameraTargetFadeMsg* pMsg = TRACKED_NEW plCameraTargetFadeMsg; plCameraTargetFadeMsg* pMsg = new plCameraTargetFadeMsg;
pMsg->SetFadeOut(fade); pMsg->SetFadeOut(fade);
pMsg->SetSubjectKey(nmgr->GetLocalPlayerKey()); pMsg->SetSubjectKey(nmgr->GetLocalPlayerKey());
pMsg->SetBCastFlag(plMessage::kBCastByExactType); pMsg->SetBCastFlag(plMessage::kBCastByExactType);
@ -1595,7 +1595,7 @@ void cyMisc::FadeLocalPlayer(hsBool fade)
void cyMisc::EnableOfferBookMode(pyKey& selfkey, const char* ageFilename, const char* ageInstanceName) void cyMisc::EnableOfferBookMode(pyKey& selfkey, const char* ageFilename, const char* ageInstanceName)
{ {
plInputIfaceMgrMsg* pMsg = TRACKED_NEW plInputIfaceMgrMsg(plInputIfaceMgrMsg::kSetOfferBookMode); plInputIfaceMgrMsg* pMsg = new plInputIfaceMgrMsg(plInputIfaceMgrMsg::kSetOfferBookMode);
pMsg->SetSender(selfkey.getKey()); pMsg->SetSender(selfkey.getKey());
pMsg->SetAgeFileName(ageFilename); pMsg->SetAgeFileName(ageFilename);
pMsg->SetAgeName(ageInstanceName); pMsg->SetAgeName(ageInstanceName);
@ -1604,13 +1604,13 @@ void cyMisc::EnableOfferBookMode(pyKey& selfkey, const char* ageFilename, const
void cyMisc::DisableOfferBookMode() void cyMisc::DisableOfferBookMode()
{ {
plInputIfaceMgrMsg* pMsg = TRACKED_NEW plInputIfaceMgrMsg(plInputIfaceMgrMsg::kClearOfferBookMode); plInputIfaceMgrMsg* pMsg = new plInputIfaceMgrMsg(plInputIfaceMgrMsg::kClearOfferBookMode);
pMsg->Send(); pMsg->Send();
} }
void cyMisc::NotifyOffererPublicLinkCompleted(uint32_t offerer) void cyMisc::NotifyOffererPublicLinkCompleted(uint32_t offerer)
{ {
plInputIfaceMgrMsg* pMsg = TRACKED_NEW plInputIfaceMgrMsg(plInputIfaceMgrMsg::kNotifyOfferCompleted, plNetClientMgr::GetInstance()->GetPlayerID()); plInputIfaceMgrMsg* pMsg = new plInputIfaceMgrMsg(plInputIfaceMgrMsg::kNotifyOfferCompleted, plNetClientMgr::GetInstance()->GetPlayerID());
pMsg->SetSender(plNetClientMgr::GetInstance()->GetLocalPlayerKey()); pMsg->SetSender(plNetClientMgr::GetInstance()->GetLocalPlayerKey());
if (offerer != plNetClientMgr::GetInstance()->GetPlayerID()) if (offerer != plNetClientMgr::GetInstance()->GetPlayerID())
{ {
@ -1625,7 +1625,7 @@ void cyMisc::NotifyOffererPublicLinkCompleted(uint32_t offerer)
void cyMisc::NotifyOffererPublicLinkRejected(uint32_t offerer) void cyMisc::NotifyOffererPublicLinkRejected(uint32_t offerer)
{ {
plInputIfaceMgrMsg* pMsg = TRACKED_NEW plInputIfaceMgrMsg(plInputIfaceMgrMsg::kNotifyOfferRejected); plInputIfaceMgrMsg* pMsg = new plInputIfaceMgrMsg(plInputIfaceMgrMsg::kNotifyOfferRejected);
pMsg->SetSender(plNetClientMgr::GetInstance()->GetLocalPlayerKey()); pMsg->SetSender(plNetClientMgr::GetInstance()->GetLocalPlayerKey());
if (offerer != plNetClientMgr::GetInstance()->GetPlayerID()) if (offerer != plNetClientMgr::GetInstance()->GetPlayerID())
{ {
@ -1641,7 +1641,7 @@ void cyMisc::NotifyOffererPublicLinkRejected(uint32_t offerer)
void cyMisc::NotifyOffererPublicLinkAccepted(uint32_t offerer) void cyMisc::NotifyOffererPublicLinkAccepted(uint32_t offerer)
{ {
plInputIfaceMgrMsg* pMsg = TRACKED_NEW plInputIfaceMgrMsg(plInputIfaceMgrMsg::kNotifyOfferAccepted); plInputIfaceMgrMsg* pMsg = new plInputIfaceMgrMsg(plInputIfaceMgrMsg::kNotifyOfferAccepted);
pMsg->SetSender(plNetClientMgr::GetInstance()->GetLocalPlayerKey()); pMsg->SetSender(plNetClientMgr::GetInstance()->GetLocalPlayerKey());
if (offerer != plNetClientMgr::GetInstance()->GetPlayerID()) if (offerer != plNetClientMgr::GetInstance()->GetPlayerID())
{ {
@ -1658,9 +1658,9 @@ void cyMisc::ToggleAvatarClickability(hsBool on)
{ {
plInputIfaceMgrMsg* pMsg = 0; plInputIfaceMgrMsg* pMsg = 0;
if (on) if (on)
pMsg = TRACKED_NEW plInputIfaceMgrMsg(plInputIfaceMgrMsg::kGUIEnableAvatarClickable); pMsg = new plInputIfaceMgrMsg(plInputIfaceMgrMsg::kGUIEnableAvatarClickable);
else else
pMsg = TRACKED_NEW plInputIfaceMgrMsg(plInputIfaceMgrMsg::kGUIDisableAvatarClickable); pMsg = new plInputIfaceMgrMsg(plInputIfaceMgrMsg::kGUIDisableAvatarClickable);
pMsg->SetAvKey(plNetClientMgr::GetInstance()->GetLocalPlayerKey()); pMsg->SetAvKey(plNetClientMgr::GetInstance()->GetLocalPlayerKey());
pMsg->SetBCastFlag(plMessage::kNetPropagate); pMsg->SetBCastFlag(plMessage::kNetPropagate);
pMsg->SetBCastFlag(plMessage::kNetForce); pMsg->SetBCastFlag(plMessage::kNetForce);
@ -1670,7 +1670,7 @@ void cyMisc::ToggleAvatarClickability(hsBool on)
void cyMisc::SetShareSpawnPoint(const char* spawnPoint) void cyMisc::SetShareSpawnPoint(const char* spawnPoint)
{ {
plInputIfaceMgrMsg* pMsg = TRACKED_NEW plInputIfaceMgrMsg(plInputIfaceMgrMsg::kSetShareSpawnPoint); plInputIfaceMgrMsg* pMsg = new plInputIfaceMgrMsg(plInputIfaceMgrMsg::kSetShareSpawnPoint);
pMsg->SetSender(plNetClientMgr::GetInstance()->GetLocalPlayerKey()); pMsg->SetSender(plNetClientMgr::GetInstance()->GetLocalPlayerKey());
pMsg->SetSpawnPoint(spawnPoint); pMsg->SetSpawnPoint(spawnPoint);
pMsg->Send(); pMsg->Send();
@ -1678,7 +1678,7 @@ void cyMisc::SetShareSpawnPoint(const char* spawnPoint)
void cyMisc::SetShareAgeInstanceGuid(const Uuid& guid) void cyMisc::SetShareAgeInstanceGuid(const Uuid& guid)
{ {
plInputIfaceMgrMsg* pMsg = TRACKED_NEW plInputIfaceMgrMsg(plInputIfaceMgrMsg::kSetShareAgeInstanceGuid); plInputIfaceMgrMsg* pMsg = new plInputIfaceMgrMsg(plInputIfaceMgrMsg::kSetShareAgeInstanceGuid);
pMsg->SetSender(plNetClientMgr::GetInstance()->GetLocalPlayerKey()); pMsg->SetSender(plNetClientMgr::GetInstance()->GetLocalPlayerKey());
pMsg->SetAgeInstanceGuid(guid); pMsg->SetAgeInstanceGuid(guid);
pMsg->Send(); pMsg->Send();
@ -1778,7 +1778,7 @@ void cyMisc::TransferParticlesToKey(pyKey& fromKey, pyKey& toKey, int numParticl
plArmatureMod *avMod = plAvatarMgr::GetInstance()->GetLocalAvatar(); plArmatureMod *avMod = plAvatarMgr::GetInstance()->GetLocalAvatar();
plParticleTransferMsg* pMsg = TRACKED_NEW plParticleTransferMsg(nil, avMod->GetKey(), 0, frKey, numParticles); plParticleTransferMsg* pMsg = new plParticleTransferMsg(nil, avMod->GetKey(), 0, frKey, numParticles);
pMsg->SetBCastFlag(plMessage::kNetPropagate); pMsg->SetBCastFlag(plMessage::kNetPropagate);
pMsg->SetBCastFlag(plMessage::kNetForce); pMsg->SetBCastFlag(plMessage::kNetForce);
pMsg->Send(); pMsg->Send();
@ -1813,7 +1813,7 @@ void cyMisc::SetParticleDissentPoint(float x, float y, float z, pyKey& particles
plParticleEffect *flock = sys->GetEffect(plParticleFlockEffect::Index()); plParticleEffect *flock = sys->GetEffect(plParticleFlockEffect::Index());
if (flock) if (flock)
{ {
(TRACKED_NEW plParticleFlockMsg(nil, flock->GetKey(), 0, plParticleFlockMsg::kFlockCmdSetDissentPoint, x, y, z))->Send(); (new plParticleFlockMsg(nil, flock->GetKey(), 0, plParticleFlockMsg::kFlockCmdSetDissentPoint, x, y, z))->Send();
} }
} }
@ -1847,7 +1847,7 @@ void cyMisc::SetParticleOffset(float x, float y, float z, pyKey& particles)
plParticleEffect *flock = sys->GetEffect(plParticleFlockEffect::Index()); plParticleEffect *flock = sys->GetEffect(plParticleFlockEffect::Index());
if (flock) if (flock)
{ {
(TRACKED_NEW plParticleFlockMsg(nil, flock->GetKey(), 0, plParticleFlockMsg::kFlockCmdSetOffset, x, y, z))->Send(); (new plParticleFlockMsg(nil, flock->GetKey(), 0, plParticleFlockMsg::kFlockCmdSetOffset, x, y, z))->Send();
} }
} }
@ -1880,7 +1880,7 @@ void cyMisc::KillParticles(float time, float pct, pyKey& particles)
plParticleEffect *flock = sys->GetEffect(plParticleFlockEffect::Index()); plParticleEffect *flock = sys->GetEffect(plParticleFlockEffect::Index());
if (flock) if (flock)
{ {
plParticleKillMsg* pMsg = TRACKED_NEW plParticleKillMsg(nil, frKey, 0, pct, time, plParticleKillMsg::kParticleKillPercentage | plParticleKillMsg::kParticleKillImmortalOnly); plParticleKillMsg* pMsg = new plParticleKillMsg(nil, frKey, 0, pct, time, plParticleKillMsg::kParticleKillPercentage | plParticleKillMsg::kParticleKillImmortalOnly);
pMsg->SetBCastFlag(plMessage::kNetPropagate); pMsg->SetBCastFlag(plMessage::kNetPropagate);
pMsg->SetBCastFlag(plMessage::kNetForce); pMsg->SetBCastFlag(plMessage::kNetForce);
pMsg->SetBCastFlag(plMessage::kPropagateToChildren); pMsg->SetBCastFlag(plMessage::kPropagateToChildren);
@ -1997,12 +1997,12 @@ void cyMisc::SetLightAnimationOn(pyKey& light, std::string lightName, hsBool sta
} }
if (pIface) if (pIface)
{ {
plEnableMsg* enableMsg = TRACKED_NEW plEnableMsg; plEnableMsg* enableMsg = new plEnableMsg;
enableMsg->AddReceiver(pIface->GetKey()); enableMsg->AddReceiver(pIface->GetKey());
enableMsg->SetBCastFlag(plMessage::kNetPropagate); enableMsg->SetBCastFlag(plMessage::kNetPropagate);
enableMsg->SetBCastFlag(plMessage::kNetForce); enableMsg->SetBCastFlag(plMessage::kNetForce);
plAnimCmdMsg* animMsg = TRACKED_NEW plAnimCmdMsg; plAnimCmdMsg* animMsg = new plAnimCmdMsg;
animMsg->AddReceiver(pIface->GetOwnerKey()); animMsg->AddReceiver(pIface->GetOwnerKey());
animMsg->SetBCastFlag(plMessage::kPropagateToModifiers); animMsg->SetBCastFlag(plMessage::kPropagateToModifiers);
animMsg->SetBCastFlag(plMessage::kNetPropagate); animMsg->SetBCastFlag(plMessage::kNetPropagate);
@ -2034,7 +2034,7 @@ void cyMisc::SetLightAnimationOn(pyKey& light, std::string lightName, hsBool sta
void cyMisc::RegisterForControlEventMessages(hsBool on, pyKey& k) void cyMisc::RegisterForControlEventMessages(hsBool on, pyKey& k)
{ {
plCmdIfaceModMsg* pMsg = TRACKED_NEW plCmdIfaceModMsg; plCmdIfaceModMsg* pMsg = new plCmdIfaceModMsg;
pMsg->SetSender(k.getKey()); pMsg->SetSender(k.getKey());
if (on) if (on)
pMsg->SetCmd(plCmdIfaceModMsg::kAdd); pMsg->SetCmd(plCmdIfaceModMsg::kAdd);
@ -2074,17 +2074,17 @@ bool cyMisc::RequestLOSScreen(pyKey &selfkey, int32_t ID, float xPos, float yPos
switch (what) switch (what)
{ {
case kClickables: case kClickables:
pMsg = TRACKED_NEW plLOSRequestMsg( selfkey.getKey(), startPos, endPos, plSimDefs::kLOSDBUIItems, plLOSRequestMsg::kTestClosest ); pMsg = new plLOSRequestMsg( selfkey.getKey(), startPos, endPos, plSimDefs::kLOSDBUIItems, plLOSRequestMsg::kTestClosest );
pMsg->SetCullDB(plSimDefs::kLOSDBUIBlockers); pMsg->SetCullDB(plSimDefs::kLOSDBUIBlockers);
break; break;
case kCameraBlockers: case kCameraBlockers:
pMsg = TRACKED_NEW plLOSRequestMsg( selfkey.getKey(), startPos, endPos, plSimDefs::kLOSDBCameraBlockers, plLOSRequestMsg::kTestClosest ); pMsg = new plLOSRequestMsg( selfkey.getKey(), startPos, endPos, plSimDefs::kLOSDBCameraBlockers, plLOSRequestMsg::kTestClosest );
break; break;
case kCustom: case kCustom:
pMsg = TRACKED_NEW plLOSRequestMsg( selfkey.getKey(), startPos, endPos, plSimDefs::kLOSDBCustom, plLOSRequestMsg::kTestClosest ); pMsg = new plLOSRequestMsg( selfkey.getKey(), startPos, endPos, plSimDefs::kLOSDBCustom, plLOSRequestMsg::kTestClosest );
break; break;
case kShootable: case kShootable:
pMsg = TRACKED_NEW plLOSRequestMsg( selfkey.getKey(), startPos, endPos, plSimDefs::kLOSDBShootableItems, plLOSRequestMsg::kTestClosest ); pMsg = new plLOSRequestMsg( selfkey.getKey(), startPos, endPos, plSimDefs::kLOSDBShootableItems, plLOSRequestMsg::kTestClosest );
break; break;
} }
@ -2221,7 +2221,7 @@ void cyMisc::ShootBulletFromScreen(pyKey &selfkey, float xPos, float yPos, float
view.Normalize(); view.Normalize();
startPos = startPos + (view * 1.5f); startPos = startPos + (view * 1.5f);
plBulletMsg* bull = TRACKED_NEW plBulletMsg( selfkey.getKey(), nil, nil ); plBulletMsg* bull = new plBulletMsg( selfkey.getKey(), nil, nil );
bull->FireShot(startPos, view, radius, range); bull->FireShot(startPos, view, radius, range);
bull->Send(); bull->Send();
} }
@ -2246,7 +2246,7 @@ void cyMisc::ShootBulletFromObject(pyKey &selfkey, pySceneObject* sobj, float ra
dir.Normalize(); dir.Normalize();
hsPoint3 pos = l2w.GetTranslate(); hsPoint3 pos = l2w.GetTranslate();
plBulletMsg* bull = TRACKED_NEW plBulletMsg(selfkey.getKey(), nil, nil); plBulletMsg* bull = new plBulletMsg(selfkey.getKey(), nil, nil);
bull->FireShot(pos, dir, radius, range); bull->FireShot(pos, dir, radius, range);
bull->Send(); bull->Send();
@ -2521,7 +2521,7 @@ void cyMisc::PyClearCameraStack()
void cyMisc::RecenterCamera() void cyMisc::RecenterCamera()
{ {
plCameraMsg* pCam = TRACKED_NEW plCameraMsg; plCameraMsg* pCam = new plCameraMsg;
pCam->SetBCastFlag(plMessage::kBCastByExactType); pCam->SetBCastFlag(plMessage::kBCastByExactType);
pCam->SetCmd(plCameraMsg::kResetPanning); pCam->SetCmd(plCameraMsg::kResetPanning);
pCam->Send(); pCam->Send();
@ -2531,19 +2531,19 @@ void cyMisc::RecenterCamera()
void cyMisc::FadeIn(float lenTime, bool holdFlag, bool noSound) void cyMisc::FadeIn(float lenTime, bool holdFlag, bool noSound)
{ {
plTransitionMsg *msg = TRACKED_NEW plTransitionMsg( noSound ? plTransitionMsg::kFadeInNoSound : plTransitionMsg::kFadeIn, lenTime, holdFlag ); plTransitionMsg *msg = new plTransitionMsg( noSound ? plTransitionMsg::kFadeInNoSound : plTransitionMsg::kFadeIn, lenTime, holdFlag );
plgDispatch::MsgSend( msg ); plgDispatch::MsgSend( msg );
} }
void cyMisc::FadeOut(float lenTime, bool holdFlag, bool noSound) void cyMisc::FadeOut(float lenTime, bool holdFlag, bool noSound)
{ {
plTransitionMsg *msg = TRACKED_NEW plTransitionMsg( noSound ? plTransitionMsg::kFadeOutNoSound : plTransitionMsg::kFadeOut, lenTime, holdFlag ); plTransitionMsg *msg = new plTransitionMsg( noSound ? plTransitionMsg::kFadeOutNoSound : plTransitionMsg::kFadeOut, lenTime, holdFlag );
plgDispatch::MsgSend( msg ); plgDispatch::MsgSend( msg );
} }
void cyMisc::SetClickability(hsBool b) void cyMisc::SetClickability(hsBool b)
{ {
plInputIfaceMgrMsg* msg = TRACKED_NEW plInputIfaceMgrMsg(b ? plInputIfaceMgrMsg::kEnableClickables : plInputIfaceMgrMsg::kDisableClickables ); plInputIfaceMgrMsg* msg = new plInputIfaceMgrMsg(b ? plInputIfaceMgrMsg::kEnableClickables : plInputIfaceMgrMsg::kDisableClickables );
plgDispatch::MsgSend(msg); plgDispatch::MsgSend(msg);
} }
@ -2665,7 +2665,7 @@ void cyMisc::WearDefaultClothingType(pyKey& key, uint32_t type)
void cyMisc::FakeLinkToObject(pyKey& avatar, pyKey& object) void cyMisc::FakeLinkToObject(pyKey& avatar, pyKey& object)
{ {
plPseudoLinkEffectMsg* msg = TRACKED_NEW plPseudoLinkEffectMsg; plPseudoLinkEffectMsg* msg = new plPseudoLinkEffectMsg;
msg->fAvatarKey = avatar.getKey(); msg->fAvatarKey = avatar.getKey();
msg->fLinkObjKey = object.getKey(); msg->fLinkObjKey = object.getKey();
plgDispatch::MsgSend(msg); plgDispatch::MsgSend(msg);
@ -2681,7 +2681,7 @@ void cyMisc::FakeLinkToObjectNamed(const char* name)
if (!key) if (!key)
return; return;
plPseudoLinkEffectMsg* msg = TRACKED_NEW plPseudoLinkEffectMsg; plPseudoLinkEffectMsg* msg = new plPseudoLinkEffectMsg;
msg->fAvatarKey = plNetClientMgr::GetInstance()->GetLocalPlayerKey(); msg->fAvatarKey = plNetClientMgr::GetInstance()->GetLocalPlayerKey();
msg->fLinkObjKey = key; msg->fLinkObjKey = key;
plgDispatch::MsgSend(msg); plgDispatch::MsgSend(msg);
@ -2758,7 +2758,7 @@ void cyMisc::SetGraphicsOptions(int Width, int Height, int ColorDepth, hsBool Wi
// This has to send a message to plClient because python is loaded in the max plugins // This has to send a message to plClient because python is loaded in the max plugins
plKey clientKey = hsgResMgr::ResMgr()->FindKey( kClient_KEY ); plKey clientKey = hsgResMgr::ResMgr()->FindKey( kClient_KEY );
plClientMsg* clientMsg = TRACKED_NEW plClientMsg(plClientMsg::kResetGraphicsDevice); plClientMsg* clientMsg = new plClientMsg(plClientMsg::kResetGraphicsDevice);
clientMsg->AddReceiver(clientKey); clientMsg->AddReceiver(clientKey);
//clientMsg->SetBCastFlag(plMessage::kBCastByType); //clientMsg->SetBCastFlag(plMessage::kBCastByType);
clientMsg->fGraphicsSettings.fWidth = Width; clientMsg->fGraphicsSettings.fWidth = Width;

12
Sources/Plasma/FeatureLib/pfPython/cyMiscGlue.cpp

@ -256,7 +256,7 @@ PYTHON_GLOBAL_METHOD_DEFINITION(PtSendRTChat, args, "Params: fromPlayer,toPlayer
else if (PyUnicode_Check(message)) else if (PyUnicode_Check(message))
{ {
int size = PyUnicode_GetSize(message); int size = PyUnicode_GetSize(message);
wchar_t* msg = TRACKED_NEW wchar_t[size + 1]; msg[size] = 0; wchar_t* msg = new wchar_t[size + 1]; msg[size] = 0;
PyUnicode_AsWideChar((PyUnicodeObject*)message, msg, size); PyUnicode_AsWideChar((PyUnicodeObject*)message, msg, size);
uint32_t retval = cyMisc::SendRTChat(*fromPlayer, toPlayerList, msg, msgFlags); uint32_t retval = cyMisc::SendRTChat(*fromPlayer, toPlayerList, msg, msgFlags);
delete msg; delete msg;
@ -289,7 +289,7 @@ PYTHON_GLOBAL_METHOD_DEFINITION(PtSendKIMessage, args, "Params: command,value\nS
else if (PyUnicode_Check(val)) else if (PyUnicode_Check(val))
{ {
int len = PyUnicode_GetSize(val); int len = PyUnicode_GetSize(val);
wchar_t* buffer = TRACKED_NEW wchar_t[len + 1]; wchar_t* buffer = new wchar_t[len + 1];
PyUnicode_AsWideChar((PyUnicodeObject*)val, buffer, len); PyUnicode_AsWideChar((PyUnicodeObject*)val, buffer, len);
buffer[len] = L'\0'; buffer[len] = L'\0';
cyMisc::SendKIMessageS(command, buffer); cyMisc::SendKIMessageS(command, buffer);
@ -352,7 +352,7 @@ PYTHON_GLOBAL_METHOD_DEFINITION(PtLoadAvatarModel, args, "Params: modelName, spa
if (PyUnicode_Check(userStrObj)) if (PyUnicode_Check(userStrObj))
{ {
int len = PyUnicode_GetSize(userStrObj); int len = PyUnicode_GetSize(userStrObj);
wchar_t* buffer = TRACKED_NEW wchar_t[len + 1]; wchar_t* buffer = new wchar_t[len + 1];
PyUnicode_AsWideChar((PyUnicodeObject*)userStrObj, buffer, len); PyUnicode_AsWideChar((PyUnicodeObject*)userStrObj, buffer, len);
buffer[len] = L'\0'; buffer[len] = L'\0';
char* temp = hsWStringToString(buffer); char* temp = hsWStringToString(buffer);
@ -412,7 +412,7 @@ PYTHON_GLOBAL_METHOD_DEFINITION(PtGetLocalizedString, args, "Params: name, argum
if (PyUnicode_Check(nameObj)) if (PyUnicode_Check(nameObj))
{ {
int len = PyUnicode_GetSize(nameObj); int len = PyUnicode_GetSize(nameObj);
wchar_t* buffer = TRACKED_NEW wchar_t[len + 1]; wchar_t* buffer = new wchar_t[len + 1];
PyUnicode_AsWideChar((PyUnicodeObject*)nameObj, buffer, len); PyUnicode_AsWideChar((PyUnicodeObject*)nameObj, buffer, len);
buffer[len] = L'\0'; buffer[len] = L'\0';
name = buffer; name = buffer;
@ -450,7 +450,7 @@ PYTHON_GLOBAL_METHOD_DEFINITION(PtGetLocalizedString, args, "Params: name, argum
else if (PyUnicode_Check(item)) else if (PyUnicode_Check(item))
{ {
int strLen = PyUnicode_GetSize(item); int strLen = PyUnicode_GetSize(item);
wchar_t* buffer = TRACKED_NEW wchar_t[strLen + 1]; wchar_t* buffer = new wchar_t[strLen + 1];
PyUnicode_AsWideChar((PyUnicodeObject*)item, buffer, strLen); PyUnicode_AsWideChar((PyUnicodeObject*)item, buffer, strLen);
buffer[strLen] = L'\0'; buffer[strLen] = L'\0';
arg = buffer; arg = buffer;
@ -485,7 +485,7 @@ PYTHON_GLOBAL_METHOD_DEFINITION(PtDumpLogs, args, "Params: folder\nDumps all cur
if (PyUnicode_Check(folderObj)) if (PyUnicode_Check(folderObj))
{ {
int len = PyUnicode_GetSize(folderObj); int len = PyUnicode_GetSize(folderObj);
wchar_t* buffer = TRACKED_NEW wchar_t[len + 1]; wchar_t* buffer = new wchar_t[len + 1];
PyUnicode_AsWideChar((PyUnicodeObject*)folderObj, buffer, len); PyUnicode_AsWideChar((PyUnicodeObject*)folderObj, buffer, len);
buffer[len] = L'\0'; buffer[len] = L'\0';
bool retVal = cyMisc::DumpLogs(buffer); bool retVal = cyMisc::DumpLogs(buffer);

2
Sources/Plasma/FeatureLib/pfPython/cyMiscGlue2.cpp

@ -73,7 +73,7 @@ PYTHON_GLOBAL_METHOD_DEFINITION(PtYesNoDialog, args, "Params: selfkey,dialogMess
if (PyUnicode_Check(dialogMsgObj)) if (PyUnicode_Check(dialogMsgObj))
{ {
int len = PyUnicode_GetSize(dialogMsgObj); int len = PyUnicode_GetSize(dialogMsgObj);
wchar_t* text = TRACKED_NEW wchar_t[len + 1]; wchar_t* text = new wchar_t[len + 1];
PyUnicode_AsWideChar((PyUnicodeObject*)dialogMsgObj, text, len); PyUnicode_AsWideChar((PyUnicodeObject*)dialogMsgObj, text, len);
text[len] = L'\0'; text[len] = L'\0';
cyMisc::YesNoDialog(*key, text); cyMisc::YesNoDialog(*key, text);

4
Sources/Plasma/FeatureLib/pfPython/cyMiscGlue3.cpp

@ -629,7 +629,7 @@ PYTHON_GLOBAL_METHOD_DEFINITION(PtFileExists, args, "Params: filename\nReturns t
if (PyUnicode_Check(filenameObj)) if (PyUnicode_Check(filenameObj))
{ {
int strLen = PyUnicode_GetSize(filenameObj); int strLen = PyUnicode_GetSize(filenameObj);
wchar_t* text = TRACKED_NEW wchar_t[strLen + 1]; wchar_t* text = new wchar_t[strLen + 1];
PyUnicode_AsWideChar((PyUnicodeObject*)filenameObj, text, strLen); PyUnicode_AsWideChar((PyUnicodeObject*)filenameObj, text, strLen);
text[strLen] = L'\0'; text[strLen] = L'\0';
bool retVal = cyMisc::FileExists(text); bool retVal = cyMisc::FileExists(text);
@ -664,7 +664,7 @@ PYTHON_GLOBAL_METHOD_DEFINITION(PtCreateDir, args, "Params: directory\nCreates t
if (PyUnicode_Check(directoryObj)) if (PyUnicode_Check(directoryObj))
{ {
int strLen = PyUnicode_GetSize(directoryObj); int strLen = PyUnicode_GetSize(directoryObj);
wchar_t* text = TRACKED_NEW wchar_t[strLen + 1]; wchar_t* text = new wchar_t[strLen + 1];
PyUnicode_AsWideChar((PyUnicodeObject*)directoryObj, text, strLen); PyUnicode_AsWideChar((PyUnicodeObject*)directoryObj, text, strLen);
text[strLen] = L'\0'; text[strLen] = L'\0';
bool retVal = cyMisc::CreateDir(text); bool retVal = cyMisc::CreateDir(text);

4
Sources/Plasma/FeatureLib/pfPython/cyMiscGlue4.cpp

@ -145,7 +145,7 @@ PYTHON_GLOBAL_METHOD_DEFINITION(PtSetLightValue, args, "Params: key,name,r,g,b,a
if (PyUnicode_Check(nameObj)) if (PyUnicode_Check(nameObj))
{ {
int strLen = PyUnicode_GetSize(nameObj); int strLen = PyUnicode_GetSize(nameObj);
wchar_t* text = TRACKED_NEW wchar_t[strLen + 1]; wchar_t* text = new wchar_t[strLen + 1];
PyUnicode_AsWideChar((PyUnicodeObject*)nameObj, text, strLen); PyUnicode_AsWideChar((PyUnicodeObject*)nameObj, text, strLen);
text[strLen] = L'\0'; text[strLen] = L'\0';
char* cText = hsWStringToString(text); char* cText = hsWStringToString(text);
@ -188,7 +188,7 @@ PYTHON_GLOBAL_METHOD_DEFINITION(PtSetLightAnimStart, args, "Params: key,name,sta
if (PyUnicode_Check(nameObj)) if (PyUnicode_Check(nameObj))
{ {
int strLen = PyUnicode_GetSize(nameObj); int strLen = PyUnicode_GetSize(nameObj);
wchar_t* text = TRACKED_NEW wchar_t[strLen + 1]; wchar_t* text = new wchar_t[strLen + 1];
PyUnicode_AsWideChar((PyUnicodeObject*)nameObj, text, strLen); PyUnicode_AsWideChar((PyUnicodeObject*)nameObj, text, strLen);
text[strLen] = L'\0'; text[strLen] = L'\0';
char* cText = hsWStringToString(text); char* cText = hsWStringToString(text);

2
Sources/Plasma/FeatureLib/pfPython/cyParticleSys.cpp

@ -81,7 +81,7 @@ void cyParticleSys::SetNetForce(hsBool state)
// //
void cyParticleSys::ISendParticleSysMsg(uint32_t param, float value) void cyParticleSys::ISendParticleSysMsg(uint32_t param, float value)
{ {
plParticleUpdateMsg* pMsg = TRACKED_NEW plParticleUpdateMsg(fSender, nil, nil, param, value); plParticleUpdateMsg* pMsg = new plParticleUpdateMsg(fSender, nil, nil, param, value);
// check if this needs to be network forced to all clients // check if this needs to be network forced to all clients
if (fNetForce ) if (fNetForce )
{ {

32
Sources/Plasma/FeatureLib/pfPython/cyPhysics.cpp

@ -95,7 +95,7 @@ void cyPhysics::EnableT(hsBool state)
if ( fRecvr.Count() > 0 ) if ( fRecvr.Count() > 0 )
{ {
// create message // create message
plEnableMsg* pMsg = TRACKED_NEW plEnableMsg; plEnableMsg* pMsg = new plEnableMsg;
// check if this needs to be network forced to all clients // check if this needs to be network forced to all clients
if (fNetForce ) if (fNetForce )
{ {
@ -150,7 +150,7 @@ void cyPhysics::EnableCollision()
// must have a receiver! // must have a receiver!
if ( fRecvr.Count() > 0 ) if ( fRecvr.Count() > 0 )
{ {
plEventGroupEnableMsg* pMsg = TRACKED_NEW plEventGroupEnableMsg; plEventGroupEnableMsg* pMsg = new plEventGroupEnableMsg;
if (fNetForce ) if (fNetForce )
{ {
// set the network propagate flag to make sure it gets to the other clients // set the network propagate flag to make sure it gets to the other clients
@ -179,7 +179,7 @@ void cyPhysics::DisableCollision()
// must have a receiver! // must have a receiver!
if ( fRecvr.Count() > 0 ) if ( fRecvr.Count() > 0 )
{ {
plEventGroupEnableMsg* pMsg = TRACKED_NEW plEventGroupEnableMsg; plEventGroupEnableMsg* pMsg = new plEventGroupEnableMsg;
if (fNetForce ) if (fNetForce )
{ {
// set the network propagate flag to make sure it gets to the other clients // set the network propagate flag to make sure it gets to the other clients
@ -251,7 +251,7 @@ void cyPhysics::WarpMat(pyMatrix44& mat)
if ( fRecvr.Count() > 0 ) if ( fRecvr.Count() > 0 )
{ {
// create message // create message
plWarpMsg* pMsg = TRACKED_NEW plWarpMsg(mat.fMatrix); plWarpMsg* pMsg = new plWarpMsg(mat.fMatrix);
pMsg->SetWarpFlags(plWarpMsg::kFlushTransform); pMsg->SetWarpFlags(plWarpMsg::kFlushTransform);
// check if this needs to be network forced to all clients // check if this needs to be network forced to all clients
if (fNetForce ) if (fNetForce )
@ -310,7 +310,7 @@ void cyPhysics::Move(pyVector3& direction, float distance)
if ( si ) if ( si )
{ {
// create message for each receiver // create message for each receiver
plWarpMsg* pMsg = TRACKED_NEW plWarpMsg(target_matrix); plWarpMsg* pMsg = new plWarpMsg(target_matrix);
// check if this needs to be network forced to all clients // check if this needs to be network forced to all clients
if (fNetForce ) if (fNetForce )
{ {
@ -380,7 +380,7 @@ void cyPhysics::Rotate(float rad, pyVector3& axis)
if ( si ) if ( si )
{ {
// create message for each receiver // create message for each receiver
plWarpMsg* pMsg = TRACKED_NEW plWarpMsg(target_matrix); plWarpMsg* pMsg = new plWarpMsg(target_matrix);
// check if this needs to be network forced to all clients // check if this needs to be network forced to all clients
if (fNetForce ) if (fNetForce )
{ {
@ -427,7 +427,7 @@ void cyPhysics::Force(pyVector3& force)
/* if ( fRecvr.Count() > 0 ) /* if ( fRecvr.Count() > 0 )
{ {
// create message // create message
plForceMsg* pMsg = TRACKED_NEW plForceMsg; plForceMsg* pMsg = new plForceMsg;
// check if this needs to be network forced to all clients // check if this needs to be network forced to all clients
if (fNetForce ) if (fNetForce )
{ {
@ -466,7 +466,7 @@ void cyPhysics::ForceWithOffset(pyVector3& force, pyPoint3& offset)
/* if ( fRecvr.Count() > 0 ) /* if ( fRecvr.Count() > 0 )
{ {
// create message // create message
plOffsetForceMsg* pMsg = TRACKED_NEW plOffsetForceMsg; plOffsetForceMsg* pMsg = new plOffsetForceMsg;
// check if this needs to be network forced to all clients // check if this needs to be network forced to all clients
if (fNetForce ) if (fNetForce )
{ {
@ -506,7 +506,7 @@ void cyPhysics::Torque(pyVector3& torque)
/* if ( fRecvr.Count() > 0 ) /* if ( fRecvr.Count() > 0 )
{ {
// create message // create message
plTorqueMsg* pMsg = TRACKED_NEW plTorqueMsg; plTorqueMsg* pMsg = new plTorqueMsg;
// check if this needs to be network forced to all clients // check if this needs to be network forced to all clients
if (fNetForce ) if (fNetForce )
{ {
@ -544,7 +544,7 @@ void cyPhysics::Impulse(pyVector3& impulse)
/* if ( fRecvr.Count() > 0 ) /* if ( fRecvr.Count() > 0 )
{ {
// create message // create message
plImpulseMsg* pMsg = TRACKED_NEW plImpulseMsg; plImpulseMsg* pMsg = new plImpulseMsg;
// check if this needs to be network forced to all clients // check if this needs to be network forced to all clients
if (fNetForce ) if (fNetForce )
{ {
@ -583,7 +583,7 @@ void cyPhysics::ImpulseWithOffset(pyVector3& impulse, pyPoint3& offset)
/* if ( fRecvr.Count() > 0 ) /* if ( fRecvr.Count() > 0 )
{ {
// create message // create message
plOffsetImpulseMsg* pMsg = TRACKED_NEW plOffsetImpulseMsg; plOffsetImpulseMsg* pMsg = new plOffsetImpulseMsg;
// check if this needs to be network forced to all clients // check if this needs to be network forced to all clients
if (fNetForce ) if (fNetForce )
{ {
@ -622,7 +622,7 @@ void cyPhysics::AngularImpulse(pyVector3& impulse)
/* if ( fRecvr.Count() > 0 ) /* if ( fRecvr.Count() > 0 )
{ {
// create message // create message
plAngularImpulseMsg* pMsg = TRACKED_NEW plAngularImpulseMsg; plAngularImpulseMsg* pMsg = new plAngularImpulseMsg;
// check if this needs to be network forced to all clients // check if this needs to be network forced to all clients
if (fNetForce ) if (fNetForce )
{ {
@ -662,7 +662,7 @@ void cyPhysics::Damp(float damp)
/* if ( fRecvr.Count() > 0 ) /* if ( fRecvr.Count() > 0 )
{ {
// create message // create message
plDampMsg* pMsg = TRACKED_NEW plDampMsg; plDampMsg* pMsg = new plDampMsg;
// check if this needs to be network forced to all clients // check if this needs to be network forced to all clients
if (fNetForce ) if (fNetForce )
{ {
@ -701,7 +701,7 @@ void cyPhysics::ShiftMass(pyVector3& offset)
/* if ( fRecvr.Count() > 0 ) /* if ( fRecvr.Count() > 0 )
{ {
// create message // create message
plShiftMassMsg* pMsg = TRACKED_NEW plShiftMassMsg; plShiftMassMsg* pMsg = new plShiftMassMsg;
// check if this needs to be network forced to all clients // check if this needs to be network forced to all clients
if (fNetForce ) if (fNetForce )
{ {
@ -752,7 +752,7 @@ void cyPhysics::SetLinearVelocity(pyVector3& velocity)
if ( fRecvr.Count() > 0 ) if ( fRecvr.Count() > 0 )
{ {
// create message // create message
plLinearVelocityMsg* pMsg = TRACKED_NEW plLinearVelocityMsg; plLinearVelocityMsg* pMsg = new plLinearVelocityMsg;
// check if this needs to be network forced to all clients // check if this needs to be network forced to all clients
if (fNetForce ) if (fNetForce )
{ {
@ -779,7 +779,7 @@ void cyPhysics::SetAngularVelocity(pyVector3& angVel)
if ( fRecvr.Count() > 0 ) if ( fRecvr.Count() > 0 )
{ {
// create message // create message
plAngularVelocityMsg* pMsg = TRACKED_NEW plAngularVelocityMsg; plAngularVelocityMsg* pMsg = new plAngularVelocityMsg;
// check if this needs to be network forced to all clients // check if this needs to be network forced to all clients
if (fNetForce ) if (fNetForce )
{ {

8
Sources/Plasma/FeatureLib/pfPython/cyPythonInterface.cpp

@ -661,7 +661,7 @@ PYTHON_METHOD_DEFINITION(ptOutputRedirector, write, args)
if (PyUnicode_Check(textObj)) if (PyUnicode_Check(textObj))
{ {
int strLen = PyUnicode_GetSize(textObj); int strLen = PyUnicode_GetSize(textObj);
wchar_t* text = TRACKED_NEW wchar_t[strLen + 1]; wchar_t* text = new wchar_t[strLen + 1];
PyUnicode_AsWideChar((PyUnicodeObject*)textObj, text, strLen); PyUnicode_AsWideChar((PyUnicodeObject*)textObj, text, strLen);
text[strLen] = L'\0'; text[strLen] = L'\0';
self->fThis->Write(text); self->fThis->Write(text);
@ -787,7 +787,7 @@ PYTHON_METHOD_DEFINITION(ptErrorRedirector, write, args)
if (PyUnicode_Check(textObj)) if (PyUnicode_Check(textObj))
{ {
int strLen = PyUnicode_GetSize(textObj); int strLen = PyUnicode_GetSize(textObj);
wchar_t* text = TRACKED_NEW wchar_t[strLen + 1]; wchar_t* text = new wchar_t[strLen + 1];
PyUnicode_AsWideChar((PyUnicodeObject*)textObj, text, strLen); PyUnicode_AsWideChar((PyUnicodeObject*)textObj, text, strLen);
text[strLen] = L'\0'; text[strLen] = L'\0';
self->fThis->Write(text); self->fThis->Write(text);
@ -1164,7 +1164,7 @@ void PythonInterface::initPython()
AddPlasmaMethods(methods); AddPlasmaMethods(methods);
// now copy the data to our real method definition structure // now copy the data to our real method definition structure
plasmaMethods = TRACKED_NEW PyMethodDef[methods.size() + 1]; plasmaMethods = new PyMethodDef[methods.size() + 1];
for (int curMethod = 0; curMethod < methods.size(); curMethod++) for (int curMethod = 0; curMethod < methods.size(); curMethod++)
plasmaMethods[curMethod] = methods[curMethod]; plasmaMethods[curMethod] = methods[curMethod];
PyMethodDef terminator = {NULL}; PyMethodDef terminator = {NULL};
@ -1290,7 +1290,7 @@ void PythonInterface::initPython()
AddPlasmaGameMethods(methods); AddPlasmaGameMethods(methods);
// now copy the data to our real method definition structure // now copy the data to our real method definition structure
plasmaGameMethods = TRACKED_NEW PyMethodDef[methods.size() + 1]; plasmaGameMethods = new PyMethodDef[methods.size() + 1];
for (int curMethod = 0; curMethod < methods.size(); curMethod++) for (int curMethod = 0; curMethod < methods.size(); curMethod++)
plasmaGameMethods[curMethod] = methods[curMethod]; plasmaGameMethods[curMethod] = methods[curMethod];
plasmaGameMethods[methods.size()] = terminator; // add the terminator plasmaGameMethods[methods.size()] = terminator; // add the terminator

14
Sources/Plasma/FeatureLib/pfPython/plPythonFileMod.cpp

@ -558,7 +558,7 @@ void plPythonFileMod::AddTarget(plSceneObject* sobj)
if (sceneObj) if (sceneObj)
{ {
hsAssert(!fSDLMod, "Python SDL modifier already created"); hsAssert(!fSDLMod, "Python SDL modifier already created");
fSDLMod = TRACKED_NEW plPythonSDLModifier(this); fSDLMod = new plPythonSDLModifier(this);
sceneObj->AddModifier(fSDLMod); sceneObj->AddModifier(fSDLMod);
} }
} }
@ -634,7 +634,7 @@ void plPythonFileMod::AddTarget(plSceneObject* sobj)
NamedComponent comp; NamedComponent comp;
comp.isActivator = (isNamedAttr == 1); comp.isActivator = (isNamedAttr == 1);
comp.id = parameter.fID; comp.id = parameter.fID;
comp.name = TRACKED_NEW char[strlen(parameter.datarecord.fString) + 1]; comp.name = new char[strlen(parameter.datarecord.fString) + 1];
strcpy(comp.name, parameter.datarecord.fString); strcpy(comp.name, parameter.datarecord.fString);
fNamedCompQueue.Append(comp); fNamedCompQueue.Append(comp);
@ -779,7 +779,7 @@ void plPythonFileMod::AddTarget(plSceneObject* sobj)
{ {
// create the callback object // create the callback object
// Set the callback for the vault thingy // Set the callback for the vault thingy
fVaultCallback = TRACKED_NEW PythonVaultCallback( this, kfunc_VaultEvent ); fVaultCallback = new PythonVaultCallback( this, kfunc_VaultEvent );
VaultRegisterCallback(fVaultCallback); VaultRegisterCallback(fVaultCallback);
} }
@ -787,7 +787,7 @@ void plPythonFileMod::AddTarget(plSceneObject* sobj)
if ( fPyFunctionInstances[kfunc_OnDefaultKeyCaught] != nil ) if ( fPyFunctionInstances[kfunc_OnDefaultKeyCaught] != nil )
{ {
// Make us a key catcher // Make us a key catcher
fKeyCatcher = TRACKED_NEW pfPythonKeyCatcher( this ); fKeyCatcher = new pfPythonKeyCatcher( this );
// Tell the input interface manager to use our catcher // Tell the input interface manager to use our catcher
plInputInterfaceMgr::GetInstance()->SetDefaultKeyCatcher( fKeyCatcher ); plInputInterfaceMgr::GetInstance()->SetDefaultKeyCatcher( fKeyCatcher );
@ -1112,7 +1112,7 @@ void plPythonFileMod::IFindActivatorAndAdd(const char *activatorName, int32_t id
{ {
// setup a ref notify when it does get loaded // setup a ref notify when it does get loaded
hsgResMgr::ResMgr()->AddViaNotify(keylist[i], hsgResMgr::ResMgr()->AddViaNotify(keylist[i],
TRACKED_NEW plGenRefMsg(GetKey(), plRefMsg::kOnCreate, kAddNotify, 0), new plGenRefMsg(GetKey(), plRefMsg::kOnCreate, kAddNotify, 0),
plRefFlags::kPassiveRef); plRefFlags::kPassiveRef);
} }
} }
@ -2902,7 +2902,7 @@ void plPythonFileMod::EnableControlKeyEvents()
if ( fPyFunctionInstances[kfunc_OnKeyEvent] != nil ) if ( fPyFunctionInstances[kfunc_OnKeyEvent] != nil )
{ {
// register for key events // register for key events
plCmdIfaceModMsg* pModMsg = TRACKED_NEW plCmdIfaceModMsg; plCmdIfaceModMsg* pModMsg = new plCmdIfaceModMsg;
pModMsg->SetBCastFlag(plMessage::kBCastByExactType); pModMsg->SetBCastFlag(plMessage::kBCastByExactType);
pModMsg->SetSender(GetKey()); pModMsg->SetSender(GetKey());
pModMsg->SetCmd(plCmdIfaceModMsg::kAdd); pModMsg->SetCmd(plCmdIfaceModMsg::kAdd);
@ -2921,7 +2921,7 @@ void plPythonFileMod::EnableControlKeyEvents()
void plPythonFileMod::DisableControlKeyEvents() void plPythonFileMod::DisableControlKeyEvents()
{ {
// unregister for key events // unregister for key events
plCmdIfaceModMsg* pModMsg = TRACKED_NEW plCmdIfaceModMsg; plCmdIfaceModMsg* pModMsg = new plCmdIfaceModMsg;
pModMsg->SetBCastFlag(plMessage::kBCastByExactType); pModMsg->SetBCastFlag(plMessage::kBCastByExactType);
pModMsg->SetSender(GetKey()); pModMsg->SetSender(GetKey());
pModMsg->SetCmd(plCmdIfaceModMsg::kRemove); pModMsg->SetCmd(plCmdIfaceModMsg::kRemove);

2
Sources/Plasma/FeatureLib/pfPython/plPythonPack.cpp

@ -212,7 +212,7 @@ PyObject* plPythonPack::OpenPacked(const char* fileName)
int32_t size = fPackStream->ReadLE32(); int32_t size = fPackStream->ReadLE32();
if (size > 0) if (size > 0)
{ {
char *buf = TRACKED_NEW char[size]; char *buf = new char[size];
uint32_t readSize = fPackStream->Read(size, buf); uint32_t readSize = fPackStream->Read(size, buf);
hsAssert(readSize <= size, xtl::format("Python PackFile %s: Incorrect amount of data, read %d instead of %d", hsAssert(readSize <= size, xtl::format("Python PackFile %s: Incorrect amount of data, read %d instead of %d",
fileName, readSize, size).c_str()); fileName, readSize, size).c_str());

2
Sources/Plasma/FeatureLib/pfPython/plPythonParameter.h

@ -380,7 +380,7 @@ public:
count = stream->ReadLE32(); count = stream->ReadLE32();
if ( count != 0 ) if ( count != 0 )
{ {
datarecord.fString = TRACKED_NEW char[count+1]; datarecord.fString = new char[count+1];
stream->ReadLE(count,datarecord.fString); stream->ReadLE(count,datarecord.fString);
} }
else else

2
Sources/Plasma/FeatureLib/pfPython/pyAlarm.cpp

@ -130,7 +130,7 @@ void pyAlarmMgr::Update( double secs )
void pyAlarmMgr::SetAlarm( float secs, PyObject * cb, uint32_t cbContext ) void pyAlarmMgr::SetAlarm( float secs, PyObject * cb, uint32_t cbContext )
{ {
double start = hsTimer::GetSysSeconds(); double start = hsTimer::GetSysSeconds();
fAlarms.push_back( TRACKED_NEW pyAlarm( start, secs, cb, cbContext ) ); fAlarms.push_back( new pyAlarm( start, secs, cb, cbContext ) );
} }
void pyAlarmMgr::Clear() void pyAlarmMgr::Clear()

8
Sources/Plasma/FeatureLib/pfPython/pyCritterBrainGlue.cpp

@ -173,7 +173,7 @@ PYTHON_METHOD_DEFINITION_WKEY(ptCritterBrain, addBehavior, args, keywords)
if (PyUnicode_Check(animNameObj)) if (PyUnicode_Check(animNameObj))
{ {
int strLen = PyUnicode_GetSize(animNameObj); int strLen = PyUnicode_GetSize(animNameObj);
wchar_t* text = TRACKED_NEW wchar_t[strLen + 1]; wchar_t* text = new wchar_t[strLen + 1];
PyUnicode_AsWideChar((PyUnicodeObject*)animNameObj, text, strLen); PyUnicode_AsWideChar((PyUnicodeObject*)animNameObj, text, strLen);
text[strLen] = L'\0'; text[strLen] = L'\0';
char* cText = hsWStringToString(text); char* cText = hsWStringToString(text);
@ -193,7 +193,7 @@ PYTHON_METHOD_DEFINITION_WKEY(ptCritterBrain, addBehavior, args, keywords)
if (PyUnicode_Check(behNameObj)) if (PyUnicode_Check(behNameObj))
{ {
int strLen = PyUnicode_GetSize(behNameObj); int strLen = PyUnicode_GetSize(behNameObj);
wchar_t* text = TRACKED_NEW wchar_t[strLen + 1]; wchar_t* text = new wchar_t[strLen + 1];
PyUnicode_AsWideChar((PyUnicodeObject*)behNameObj, text, strLen); PyUnicode_AsWideChar((PyUnicodeObject*)behNameObj, text, strLen);
text[strLen] = L'\0'; text[strLen] = L'\0';
char* cText = hsWStringToString(text); char* cText = hsWStringToString(text);
@ -228,7 +228,7 @@ PYTHON_METHOD_DEFINITION_WKEY(ptCritterBrain, startBehavior, args, keywords)
if (PyUnicode_Check(behNameObj)) if (PyUnicode_Check(behNameObj))
{ {
int strLen = PyUnicode_GetSize(behNameObj); int strLen = PyUnicode_GetSize(behNameObj);
wchar_t* text = TRACKED_NEW wchar_t[strLen + 1]; wchar_t* text = new wchar_t[strLen + 1];
PyUnicode_AsWideChar((PyUnicodeObject*)behNameObj, text, strLen); PyUnicode_AsWideChar((PyUnicodeObject*)behNameObj, text, strLen);
text[strLen] = L'\0'; text[strLen] = L'\0';
char* cText = hsWStringToString(text); char* cText = hsWStringToString(text);
@ -260,7 +260,7 @@ PYTHON_METHOD_DEFINITION(ptCritterBrain, runningBehavior, args)
if (PyUnicode_Check(behNameObj)) if (PyUnicode_Check(behNameObj))
{ {
int strLen = PyUnicode_GetSize(behNameObj); int strLen = PyUnicode_GetSize(behNameObj);
wchar_t* text = TRACKED_NEW wchar_t[strLen + 1]; wchar_t* text = new wchar_t[strLen + 1];
PyUnicode_AsWideChar((PyUnicodeObject*)behNameObj, text, strLen); PyUnicode_AsWideChar((PyUnicodeObject*)behNameObj, text, strLen);
text[strLen] = L'\0'; text[strLen] = L'\0';
char* cText = hsWStringToString(text); char* cText = hsWStringToString(text);

4
Sources/Plasma/FeatureLib/pfPython/pyDniCoordinates.cpp

@ -48,7 +48,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
pyDniCoordinates::pyDniCoordinates(plDniCoordinateInfo* coord) pyDniCoordinates::pyDniCoordinates(plDniCoordinateInfo* coord)
{ {
fCoords = TRACKED_NEW plDniCoordinateInfo; fCoords = new plDniCoordinateInfo;
if (coord) { if (coord) {
// copy their coords into our copy // copy their coords into our copy
fCoords->SetTorans(coord->GetTorans()); fCoords->SetTorans(coord->GetTorans());
@ -60,7 +60,7 @@ pyDniCoordinates::pyDniCoordinates(plDniCoordinateInfo* coord)
pyDniCoordinates::pyDniCoordinates() pyDniCoordinates::pyDniCoordinates()
{ {
fCoords = TRACKED_NEW plDniCoordinateInfo; fCoords = new plDniCoordinateInfo;
fCoords->SetTorans(0); fCoords->SetTorans(0);
fCoords->SetHSpans(0); fCoords->SetHSpans(0);
fCoords->SetVSpans(0); fCoords->SetVSpans(0);

6
Sources/Plasma/FeatureLib/pfPython/pyDrawControl.cpp

@ -64,7 +64,7 @@ void pyDrawControl::SetGamma2(float gamma)
char command[256]; char command[256];
sprintf(command,"Graphics.Renderer.Gamma2 %f",gamma); sprintf(command,"Graphics.Renderer.Gamma2 %f",gamma);
// create message to send to the console // create message to send to the console
plControlEventMsg* pMsg = TRACKED_NEW plControlEventMsg; plControlEventMsg* pMsg = new plControlEventMsg;
pMsg->SetBCastFlag(plMessage::kBCastByType); pMsg->SetBCastFlag(plMessage::kBCastByType);
pMsg->SetControlCode(B_CONTROL_CONSOLE_COMMAND); pMsg->SetControlCode(B_CONTROL_CONSOLE_COMMAND);
pMsg->SetControlActivated(true); pMsg->SetControlActivated(true);
@ -131,7 +131,7 @@ void pyDrawControl::DisableRenderScene()
{ {
#ifndef BUILDING_PYPLASMA #ifndef BUILDING_PYPLASMA
plKey clientKey = hsgResMgr::ResMgr()->FindKey( kClient_KEY ); plKey clientKey = hsgResMgr::ResMgr()->FindKey( kClient_KEY );
plClientMsg* msg = TRACKED_NEW plClientMsg(plClientMsg::kDisableRenderScene); plClientMsg* msg = new plClientMsg(plClientMsg::kDisableRenderScene);
msg->AddReceiver( clientKey ); msg->AddReceiver( clientKey );
msg->Send(); msg->Send();
#endif #endif
@ -141,7 +141,7 @@ void pyDrawControl::EnableRenderScene()
{ {
#ifndef BUILDING_PYPLASMA #ifndef BUILDING_PYPLASMA
plKey clientKey = hsgResMgr::ResMgr()->FindKey( kClient_KEY ); plKey clientKey = hsgResMgr::ResMgr()->FindKey( kClient_KEY );
plClientMsg* msg = TRACKED_NEW plClientMsg(plClientMsg::kEnableRenderScene); plClientMsg* msg = new plClientMsg(plClientMsg::kEnableRenderScene);
msg->AddReceiver( clientKey ); msg->AddReceiver( clientKey );
msg->Send(); msg->Send();
#endif #endif

2
Sources/Plasma/FeatureLib/pfPython/pyDynamicText.cpp

@ -120,7 +120,7 @@ plDynamicTextMsg* pyDynamicText::ICreateDTMsg()
// must have a receiver! // must have a receiver!
if ( fReceivers.Count() > 0 ) if ( fReceivers.Count() > 0 )
{ {
plDynamicTextMsg* pMsg = TRACKED_NEW plDynamicTextMsg; plDynamicTextMsg* pMsg = new plDynamicTextMsg;
if ( fSenderKey ) if ( fSenderKey )
pMsg->SetSender(fSenderKey); pMsg->SetSender(fSenderKey);
if ( fNetPropagate ) if ( fNetPropagate )

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

Loading…
Cancel
Save