2
3
mirror of https://foundry.openuru.org/gitblit/r/CWE-ou-minkata.git synced 2025-07-14 14:37:41 +00:00

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

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

View File

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

View File

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

View File

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

View File

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

View File

@ -158,7 +158,7 @@ hsGMaterial *pfGUICtrlGenerator::ICreateSolidMaterial( hsColorRGBA &color )
// Create a material with a simple blank layer, fully ambient
hsGMaterial *material = TRACKED_NEW hsGMaterial;
hsGMaterial *material = new hsGMaterial;
IAddKey( material, "GUIMaterial" );
plLayer *lay = material->MakeBaseLayer();
@ -187,11 +187,11 @@ hsGMaterial *pfGUICtrlGenerator::ICreateTextMaterial( const char *text, hsColorR
pixHeight = (uint16_t)(objHeight * 64.f);
// 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" );
// 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->ClearToColor( bgColor );
textGen->SetTextColor( textColor );
@ -201,7 +201,7 @@ hsGMaterial *pfGUICtrlGenerator::ICreateTextMaterial( const char *text, hsColorR
fTextGens.Append( textGen );
// Create a material with a simple blank layer, fully ambient
hsGMaterial *material = TRACKED_NEW hsGMaterial;
hsGMaterial *material = new hsGMaterial;
IAddKey( material, "GUIMaterial" );
plLayer *lay = material->MakeBaseLayer();
@ -212,7 +212,7 @@ hsGMaterial *pfGUICtrlGenerator::ICreateTextMaterial( const char *text, hsColorR
lay->SetPreshadeColor( black );
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->SetTransform( textGen->GetLayerTransform() );
@ -235,20 +235,20 @@ plSceneObject *pfGUICtrlGenerator::IGenSceneObject( pfGUIDialogMod *dlg, plDra
if( snKey == nil )
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" );
plSceneObject *newObj = TRACKED_NEW plSceneObject;
plSceneObject *newObj = new plSceneObject;
IAddKey( newObj, "GUISceneObject" );
plCoordinateInterface *newCI = TRACKED_NEW plCoordinateInterface;
plCoordinateInterface *newCI = new plCoordinateInterface;
IAddKey( newCI, "GUICoordIFace" );
hsgResMgr::ResMgr()->SendRef( newCI->GetKey(), TRACKED_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( myDraw->GetKey(), TRACKED_NEW plIntRefMsg( newDI->GetKey(), plRefMsg::kOnCreate, 0, plIntRefMsg::kDrawable ), plRefFlags::kActiveRef );
hsgResMgr::ResMgr()->SendRef( newCI->GetKey(), 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(), new plIntRefMsg( newDI->GetKey(), plRefMsg::kOnCreate, 0, plIntRefMsg::kDrawable ), plRefFlags::kActiveRef );
if( parent == nil )
{
@ -258,8 +258,8 @@ plSceneObject *pfGUICtrlGenerator::IGenSceneObject( pfGUIDialogMod *dlg, plDra
}
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(), TRACKED_NEW plAttachMsg( parent->GetKey(), nil, plRefMsg::kOnRequest ), plRefFlags::kActiveRef );
// hsgResMgr::ResMgr()->SendRef( newCI->GetKey(), new plIntRefMsg( parent->GetKey(), plRefMsg::kOnCreate, 0, plIntRefMsg::kChild ), plRefFlags::kActiveRef );
hsgResMgr::ResMgr()->SendRef( newCI->GetKey(), new plAttachMsg( parent->GetKey(), nil, plRefMsg::kOnRequest ), plRefFlags::kActiveRef );
newObj->SetSceneNode( snKey );
@ -289,7 +289,7 @@ pfGUIButtonMod *pfGUICtrlGenerator::GenerateRectButton( const char *title, floa
pfGUIButtonMod *but = CreateRectButton( dlgToAddTo, title, x, y, width, height, material );
if( but != nil )
but->SetHandler( TRACKED_NEW pfGUIConsoleCmdProc( consoleCmd ) );
but->SetHandler( new pfGUIConsoleCmdProc( consoleCmd ) );
return but;
}
@ -329,11 +329,11 @@ pfGUIButtonMod *pfGUICtrlGenerator::CreateRectButton( pfGUIDialogMod *parent, c
plSceneObject *newObj = IGenSceneObject( parent, myDraw );
pfGUIButtonMod *newBtn = asMenuItem ? TRACKED_NEW pfGUIMenuItem : TRACKED_NEW pfGUIButtonMod;
pfGUIButtonMod *newBtn = asMenuItem ? new pfGUIMenuItem : new pfGUIButtonMod;
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 );
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;
}
@ -373,10 +373,10 @@ pfGUIButtonMod *pfGUICtrlGenerator::GenerateSphereButton( float x, float y, flo
plSceneObject *newObj = IGenSceneObject( dlgToAddTo, myDraw );//, nil, &l2w, &w2l );
pfGUIButtonMod *newBtn = TRACKED_NEW pfGUIButtonMod;
pfGUIButtonMod *newBtn = new pfGUIButtonMod;
IAddKey( newBtn, "GUIButton" );
newBtn->SetHandler( TRACKED_NEW pfGUIConsoleCmdProc( consoleCmd ) );
hsgResMgr::ResMgr()->AddViaNotify( newBtn->GetKey(), TRACKED_NEW plObjRefMsg( newObj->GetKey(), plRefMsg::kOnCreate, 0, plObjRefMsg::kModifier ), plRefFlags::kActiveRef );
newBtn->SetHandler( new pfGUIConsoleCmdProc( consoleCmd ) );
hsgResMgr::ResMgr()->AddViaNotify( newBtn->GetKey(), new plObjRefMsg( newObj->GetKey(), plRefMsg::kOnCreate, 0, plObjRefMsg::kModifier ), plRefFlags::kActiveRef );
dlgToAddTo->AddControl( newBtn );
return newBtn;
@ -420,9 +420,9 @@ pfGUIDragBarCtrl *pfGUICtrlGenerator::GenerateDragBar( float x, float y, float w
fDynDragBars[ fDynDragBars.GetCount() - 1 ] = newObj;
pfGUIDragBarCtrl *newBtn = TRACKED_NEW pfGUIDragBarCtrl;
pfGUIDragBarCtrl *newBtn = new pfGUIDragBarCtrl;
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 );
/* vec.Set( -x, y, 100 );
@ -456,7 +456,7 @@ pfGUIDialogMod *pfGUICtrlGenerator::IGenerateDialog( const char *name, float sc
// Create the rendermod
plPostEffectMod *renderMod = TRACKED_NEW plPostEffectMod;
plPostEffectMod *renderMod = new plPostEffectMod;
IAddKey( renderMod, "GUIRenderMod" );
renderMod->SetHither( 0.5f );
@ -470,27 +470,27 @@ pfGUIDialogMod *pfGUICtrlGenerator::IGenerateDialog( const char *name, float sc
renderMod->SetFovY( fovY * 180.f / M_PI );
// Create the sceneNode to go with it
node = TRACKED_NEW plSceneNode;
node = new plSceneNode;
IAddKey( node, "GUISceneNode" );
node->GetKey()->RefObject();
fDynDlgNodes.Append( node );
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
dialog = TRACKED_NEW pfGUIDialogMod;
dialog = new pfGUIDialogMod;
IAddKey( dialog, "GUIDialog" );
dialog->SetRenderMod( renderMod );
dialog->SetName( name );
// Create the dummy scene object to hold the dialog
plSceneObject *newObj = TRACKED_NEW plSceneObject;
plSceneObject *newObj = new plSceneObject;
IAddKey( newObj, "GUISceneObject" );
// *#&$(*@&#$ need a coordIface...
plCoordinateInterface *newCI = TRACKED_NEW plCoordinateInterface;
plCoordinateInterface *newCI = new plCoordinateInterface;
IAddKey( newCI, "GUICoordIFace" );
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
// 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( renderMod->GetKey(), TRACKED_NEW plObjRefMsg( newObj->GetKey(), plRefMsg::kOnCreate, 0, plObjRefMsg::kModifier ), plRefFlags::kActiveRef );
hsgResMgr::ResMgr()->AddViaNotify( newCI->GetKey(), new plObjRefMsg( newObj->GetKey(), plRefMsg::kOnCreate, 0, plObjRefMsg::kInterface ), 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
plGenRefMsg *refMsg = TRACKED_NEW plGenRefMsg( pfGameGUIMgr::GetInstance()->GetKey(),
plGenRefMsg *refMsg = new plGenRefMsg( pfGameGUIMgr::GetInstance()->GetKey(),
plRefMsg::kOnCreate, 0, pfGameGUIMgr::kDlgModRef );
hsgResMgr::ResMgr()->AddViaNotify( dialog->GetKey(), refMsg, plRefFlags::kActiveRef );

View File

@ -88,7 +88,7 @@ pfGUIDialogMod::pfGUIDialogMod() : fRenderMod( nil ), fNext( nil ), fPrevPtr( ni
fDragTarget = nil;
fProcReceiver = nil;
fColorScheme = TRACKED_NEW pfGUIColorScheme();
fColorScheme = new pfGUIColorScheme();
}
pfGUIDialogMod::~pfGUIDialogMod()
@ -102,7 +102,7 @@ pfGUIDialogMod::~pfGUIDialogMod()
plKey mgrKey = hsgResMgr::ResMgr()->FindKey( lu );
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 );
plgDispatch::MsgSend( refMsg );
}
@ -163,14 +163,14 @@ hsBool pfGUIDialogMod::MsgReceive( plMessage *msg )
if( fEnabled )
{
plAnimCmdMsg *animMsg = TRACKED_NEW plAnimCmdMsg( GetKey(), fRenderMod->GetKey(), nil );
plAnimCmdMsg *animMsg = new plAnimCmdMsg( GetKey(), fRenderMod->GetKey(), nil );
animMsg->SetCmd( plAnimCmdMsg::kContinue );
plgDispatch::MsgSend( animMsg );
}
}
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 );
plgDispatch::MsgSend( animMsg );
@ -235,7 +235,7 @@ void pfGUIDialogMod::AddControl( pfGUIControlMod *ctrl )
void pfGUIDialogMod::AddControlOnExport( pfGUIControlMod *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 //////////////////////////////////////////////////////////////
@ -271,7 +271,7 @@ void pfGUIDialogMod::SetEnabled( hsBool e )
if( fRenderMod != nil )
{
plAnimCmdMsg *animMsg = TRACKED_NEW plAnimCmdMsg( GetKey(), fRenderMod->GetKey(), nil );
plAnimCmdMsg *animMsg = new plAnimCmdMsg( GetKey(), fRenderMod->GetKey(), nil );
if( fEnabled )
{
animMsg->SetCmd( plAnimCmdMsg::kContinue );
@ -292,21 +292,21 @@ void pfGUIDialogMod::Read( hsStream *s, hsResMgr *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 );
uint32_t i, count = s->ReadLE32();
fControls.SetCountAndZero( count );
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
plUoid lu( kGameGUIMgr_KEY );
plKey mgrKey = hsgResMgr::ResMgr()->FindKey( lu );
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 );
}
@ -314,7 +314,7 @@ void pfGUIDialogMod::Read( hsStream *s, hsResMgr *mgr )
fProcReceiver = mgr->ReadKey( s );
if( fProcReceiver != nil )
SetHandler( TRACKED_NEW pfGUIDialogNotifyProc( fProcReceiver ) );
SetHandler( new pfGUIDialogNotifyProc( fProcReceiver ) );
s->ReadLE( &fVersion );

View File

@ -75,7 +75,7 @@ pfGUIDialogNotifyProc::pfGUIDialogNotifyProc( plKey &r )
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 );
plgDispatch::MsgSend( notify );
}

View File

@ -124,17 +124,17 @@ void pfGUIDynDisplayCtrl::Read( hsStream *s, hsResMgr *mgr )
count = s->ReadLE32();
fTextMaps.SetCountAndZero( count );
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();
fLayers.SetCountAndZero( count );
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();
fMaterials.SetCountAndZero( count );
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 )
@ -163,7 +163,7 @@ void pfGUIDynDisplayCtrl::Write( hsStream *s, hsResMgr *mgr )
void pfGUIDynDisplayCtrl::AddMap( plDynamicTextMap *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 ////////////////////////////////////////////////////////////////
@ -172,7 +172,7 @@ void pfGUIDynDisplayCtrl::AddMap( plDynamicTextMap *map )
void pfGUIDynDisplayCtrl::AddLayer( plLayerInterface *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 /////////////////////////////////////////////////////////////
@ -181,5 +181,5 @@ void pfGUIDynDisplayCtrl::AddLayer( plLayerInterface *layer )
void pfGUIDynDisplayCtrl::AddMaterial( hsGMaterial *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 );
}

View File

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

View File

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

View File

@ -516,9 +516,9 @@ void pfGUIListBoxMod::Read( hsStream *s, hsResMgr *mgr )
fScrollControl = nil;
if( s->ReadBool() )
{
fScrollProc = TRACKED_NEW pfScrollProc( this );
fScrollProc = new pfScrollProc( this );
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 ) )
@ -1154,12 +1154,12 @@ void pfGUIListBoxMod::ClearAllElements( void )
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 )
{
return AddElement( TRACKED_NEW pfGUIListText( string ) );
return AddElement( new pfGUIListText( string ) );
}
int16_t pfGUIListBoxMod::FindString( const char *toCompareTo )

View File

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

View File

@ -89,7 +89,7 @@ void pfGUIMenuItem::SetName( const wchar_t *name )
delete [] fName;
if (name != nil)
{
fName = TRACKED_NEW wchar_t[wcslen(name)+1];
fName = new wchar_t[wcslen(name)+1];
wcscpy(fName,name);
}
else
@ -107,7 +107,7 @@ void pfGUIMenuItem::SetSkin( pfGUISkin *skin, HowToSkin s )
GetKey()->Release( fSkin->GetKey() );
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;

View File

@ -649,9 +649,9 @@ void pfGUIMultiLineEditCtrl::Read( hsStream *s, hsResMgr *mgr )
fScrollControl = nil;
if( s->ReadBool() )
{
fScrollProc = TRACKED_NEW pfMLScrollProc( this );
fScrollProc = new pfMLScrollProc( this );
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...
string = TRACKED_NEW wchar_t[ stringSize + 1 ];
string = new wchar_t[ stringSize + 1 ];
// Now actually copy the characters
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 )
{
// 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++ )
convertedText[ curChar ] = (uint16_t)codedText[ curChar ];
SetBuffer(convertedText,length);
@ -1584,7 +1584,7 @@ uint8_t *pfGUIMultiLineEditCtrl::GetCodedBuffer( uint32_t &length ) const
length = fBuffer.GetCount() - 1;
// 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++)
{
@ -1609,7 +1609,7 @@ uint16_t *pfGUIMultiLineEditCtrl::GetCodedBufferW( uint32_t &length ) const
{
length = fBuffer.GetCount() - 1;
uint16_t *buffer = TRACKED_NEW uint16_t[ length ];
uint16_t *buffer = new uint16_t[ length ];
// AcquireArray() isn't const...
memcpy( buffer, &fBuffer[ 0 ], length * sizeof(uint16_t) );

View File

@ -236,7 +236,7 @@ void pfGUIPopUpMenu::Read( hsStream *s, hsResMgr *mgr )
pfGUIDialogMod::Read( s, mgr );
// In case we need it...
fKeyGen = TRACKED_NEW pfPopUpKeyGenerator( GetName(), GetKey()->GetUoid().GetLocation() );
fKeyGen = new pfPopUpKeyGenerator( GetName(), GetKey()->GetUoid().GetLocation() );
fOriginX = fOriginY = -1.f;
@ -254,12 +254,12 @@ void pfGUIPopUpMenu::Read( hsStream *s, hsResMgr *mgr )
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, TRACKED_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, kRefSkin ), plRefFlags::kActiveRef );
mgr->ReadKeyNotifyMe( s, new plGenRefMsg( GetKey(), plRefMsg::kOnCreate, -1, kRefOriginAnchor ), plRefFlags::kPassiveRef );
mgr->ReadKeyNotifyMe( s, new plGenRefMsg( GetKey(), plRefMsg::kOnCreate, -1, kRefOriginContext ), plRefFlags::kPassiveRef );
fAlignment = (Alignment)s->ReadByte();
@ -306,8 +306,8 @@ void pfGUIPopUpMenu::SetOriginAnchor( plSceneObject *anchor, pfGUIDialogMod *
{
fOriginAnchor = anchor;
fOriginContext = context;
hsgResMgr::ResMgr()->AddViaNotify( fOriginAnchor->GetKey(), TRACKED_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( fOriginAnchor->GetKey(), new plGenRefMsg( GetKey(), plRefMsg::kOnCreate, -1, kRefOriginAnchor ), plRefFlags::kPassiveRef );
hsgResMgr::ResMgr()->AddViaNotify( fOriginContext->GetKey(), new plGenRefMsg( GetKey(), plRefMsg::kOnCreate, -1, kRefOriginContext ), plRefFlags::kPassiveRef );
}
//// SetEnabled //////////////////////////////////////////////////////////////
@ -438,7 +438,7 @@ hsBool pfGUIPopUpMenu::IBuildMenu( void )
if( fWaitingForSkin && fSkin == nil )
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->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
// 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
plDynamicTextMap *scratch = TRACKED_NEW plDynamicTextMap( 8, 8, false );
plDynamicTextMap *scratch = new plDynamicTextMap( 8, 8, false );
scratch->SetFont( scheme->fFontFace, scheme->fFontSize, scheme->fFontFlags, true );
for( i = 0; i < fMenuItems.GetCount(); i++ )
{
@ -561,7 +561,7 @@ hsBool pfGUIPopUpMenu::IBuildMenu( void )
{
button->SetColorScheme( scheme );
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
button->SetTagID(i);
button->SetDynTextMap( mat->GetLayer( 0 ), plDynamicTextMap::ConvertNoRef( mat->GetLayer( 0 )->GetTexture() ) );
@ -704,11 +704,11 @@ hsGMaterial *pfGUIPopUpMenu::ICreateDynMaterial( void )
// Create the new dynTextMap
plDynamicTextMap *textMap = TRACKED_NEW plDynamicTextMap();
plDynamicTextMap *textMap = new plDynamicTextMap();
fKeyGen->CreateKey( textMap );
// Create the material
hsGMaterial *material = TRACKED_NEW hsGMaterial;
hsGMaterial *material = new hsGMaterial;
fKeyGen->CreateKey( material );
// Create the layer and attach
@ -722,7 +722,7 @@ hsGMaterial *pfGUIPopUpMenu::ICreateDynMaterial( void )
lay->SetClampFlags( hsGMatState::kClampTexture );
// 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;
@ -739,8 +739,8 @@ pfGUIPopUpMenu *pfGUIPopUpMenu::Build( const char *name, pfGUIDialogMod *parent
// Create the menu and give it a key gen
pfGUIPopUpMenu *menu = TRACKED_NEW pfGUIPopUpMenu();
menu->fKeyGen = TRACKED_NEW pfPopUpKeyGenerator( name, destLoc );
pfGUIPopUpMenu *menu = new pfGUIPopUpMenu();
menu->fKeyGen = new pfPopUpKeyGenerator( name, destLoc );
menu->fKeyGen->CreateKey( menu );
menu->fOriginX = x;
@ -750,7 +750,7 @@ pfGUIPopUpMenu *pfGUIPopUpMenu::Build( const char *name, pfGUIDialogMod *parent
if( parent != nil && ( (pfGUIPopUpMenu *)parent )->fSkin != nil )
{
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
@ -761,12 +761,12 @@ pfGUIPopUpMenu *pfGUIPopUpMenu::Build( const char *name, pfGUIDialogMod *parent
loc.Set( 0x1425 );
plKey skinKey = hsgResMgr::ResMgr()->FindKey( plUoid( loc, pfGUISkin::Index(), "GUISkin01_GUISkin" ) );
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
plPostEffectMod *renderMod = TRACKED_NEW plPostEffectMod;
plPostEffectMod *renderMod = new plPostEffectMod;
menu->fKeyGen->CreateKey( renderMod );
renderMod->SetHither( 0.5f );
@ -782,22 +782,22 @@ pfGUIPopUpMenu *pfGUIPopUpMenu::Build( const char *name, pfGUIDialogMod *parent
renderMod->SetFovY( fovY * 180.f / M_PI );
// Create the sceneNode to go with it
menu->fParentNode= TRACKED_NEW plSceneNode;
menu->fParentNode= new plSceneNode;
menu->fKeyGen->CreateKey( menu->fParentNode );
// 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->SetName( name );
// Create the dummy scene object to hold the menu
plSceneObject *newObj = TRACKED_NEW plSceneObject;
plSceneObject *newObj = new plSceneObject;
menu->fKeyGen->CreateKey( newObj );
// *#&$(*@&#$ need a coordIface...
plCoordinateInterface *newCI = TRACKED_NEW plCoordinateInterface;
plCoordinateInterface *newCI = new plCoordinateInterface;
menu->fKeyGen->CreateKey( newCI );
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
// 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( renderMod->GetKey(), TRACKED_NEW plObjRefMsg( newObj->GetKey(), plRefMsg::kOnCreate, 0, plObjRefMsg::kModifier ), plRefFlags::kActiveRef );
hsgResMgr::ResMgr()->SendRef( newCI->GetKey(), new plObjRefMsg( newObj->GetKey(), plRefMsg::kOnCreate, 0, plObjRefMsg::kInterface ), plRefFlags::kActiveRef );
hsgResMgr::ResMgr()->SendRef( renderMod->GetKey(), new plObjRefMsg( newObj->GetKey(), plRefMsg::kOnCreate, 0, plObjRefMsg::kModifier ), plRefFlags::kActiveRef );
newObj->SetSceneNode( menu->fParentNode->GetKey() );
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
plGenRefMsg *refMsg = TRACKED_NEW plGenRefMsg( pfGameGUIMgr::GetInstance()->GetKey(),
plGenRefMsg *refMsg = new plGenRefMsg( pfGameGUIMgr::GetInstance()->GetKey(),
plRefMsg::kOnCreate, 0, pfGameGUIMgr::kDlgModRef );
hsgResMgr::ResMgr()->AddViaNotify( menu->GetKey(), refMsg, plRefFlags::kActiveRef );
@ -833,7 +833,7 @@ void pfGUIPopUpMenu::SetSkin( pfGUISkin *skin )
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;
}
else
@ -904,7 +904,7 @@ void pfGUISkin::Read( hsStream *s, hsResMgr *mgr )
for( ; i < kNumElements; i++ )
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 )

View File

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

View File

@ -124,7 +124,7 @@ class pfGroupProc : public pfGUICtrlProcObject
pfGUIRadioGroupCtrl::pfGUIRadioGroupCtrl()
{
fButtonProc = TRACKED_NEW pfGroupProc( this );
fButtonProc = new pfGroupProc( this );
fButtonProc->IncRef();
SetFlag( kIntangible );
}
@ -180,7 +180,7 @@ void pfGUIRadioGroupCtrl::Read( hsStream *s, hsResMgr *mgr )
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();

View File

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

View File

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

View File

@ -324,7 +324,7 @@ void pfGameGUIMgr::LoadDialog( const char *name, plKey recvrKey, const char *
}
if (!alreadyLoaded)
{
pfDialogNameSetKey* pDNSK = TRACKED_NEW pfDialogNameSetKey(name,recvrKey);
pfDialogNameSetKey* pDNSK = new pfDialogNameSetKey(name,recvrKey);
fDialogToSetKeyOf.Append(pDNSK);
}
}
@ -333,13 +333,13 @@ void pfGameGUIMgr::LoadDialog( const char *name, plKey recvrKey, const char *
plKey clientKey = hsgResMgr::ResMgr()->FindKey( kClient_KEY );
plClientMsg *msg = TRACKED_NEW plClientMsg( plClientMsg::kLoadRoomHold );
plClientMsg *msg = new plClientMsg( plClientMsg::kLoadRoomHold );
msg->AddReceiver( clientKey );
msg->AddRoomLoc(plKeyFinder::Instance().FindLocation(ageName ? ageName : "GUI", name));
msg->Send();
// 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 /////////////////////////////////////////////////////////////
@ -434,7 +434,7 @@ void pfGameGUIMgr::UnloadDialog( pfGUIDialogMod *dlg )
// IRemoveDlgFromList( dlg );
// 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();
if( sceneNodeKey == nil )
@ -448,7 +448,7 @@ void pfGameGUIMgr::UnloadDialog( pfGUIDialogMod *dlg )
{
plKey clientKey = hsgResMgr::ResMgr()->FindKey( kClient_KEY );
plClientMsg *msg = TRACKED_NEW plClientMsg( plClientMsg::kUnloadRoom );
plClientMsg *msg = new plClientMsg( plClientMsg::kUnloadRoom );
msg->AddReceiver( clientKey );
// msg->SetProgressBarSuppression( true );
msg->AddRoomLoc(sceneNodeKey->GetUoid().GetLocation());
@ -523,7 +523,7 @@ void pfGameGUIMgr::SetDialogToNotify(const char *name, plKey recvrKey)
//
void pfGameGUIMgr::SetDialogToNotify(pfGUIDialogMod *dlg, plKey recvrKey)
{
pfGUIDialogNotifyProc* handler = TRACKED_NEW pfGUIDialogNotifyProc(recvrKey);
pfGUIDialogNotifyProc* handler = new pfGUIDialogNotifyProc(recvrKey);
dlg->SetHandler(handler);
handler->OnInit();
}
@ -540,14 +540,14 @@ void pfGameGUIMgr::IActivateGUI( hsBool activate )
if( activate )
{
fInputConfig = TRACKED_NEW pfGameUIInputInterface( this );
plInputIfaceMgrMsg *msg = TRACKED_NEW plInputIfaceMgrMsg( plInputIfaceMgrMsg::kAddInterface );
fInputConfig = new pfGameUIInputInterface( this );
plInputIfaceMgrMsg *msg = new plInputIfaceMgrMsg( plInputIfaceMgrMsg::kAddInterface );
msg->SetIFace( fInputConfig );
plgDispatch::MsgSend( msg );
}
else
{
plInputIfaceMgrMsg *msg = TRACKED_NEW plInputIfaceMgrMsg( plInputIfaceMgrMsg::kRemoveInterface );
plInputIfaceMgrMsg *msg = new plInputIfaceMgrMsg( plInputIfaceMgrMsg::kRemoveInterface );
msg->SetIFace( fInputConfig );
plgDispatch::MsgSend( msg );