Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions Core/Tools/W3DView/AdvancedAnimSheet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ CAdvancedAnimSheet::~CAdvancedAnimSheet()
{
for (int i = 0; i < AnimCount; i++)
{
MEMBER_RELEASE(Anims[i]);
REF_PTR_RELEASE(Anims[i]);
}
AnimsValid = false;
AnimCount = 0;
Expand Down Expand Up @@ -162,7 +162,7 @@ void CAdvancedAnimSheet::LoadAnims (void)
// Add this Anims pointer to the array.
if (AnimCount < MAX_REPORT_ANIMS)
{
MEMBER_ADD(Anims[AnimCount], pHierarchyAnim);
REF_PTR_SET(Anims[AnimCount], pHierarchyAnim);
AnimCount++;
}
else
Expand All @@ -176,7 +176,7 @@ void CAdvancedAnimSheet::LoadAnims (void)
}

// Release our hold on this animation.
MEMBER_RELEASE(pHierarchyAnim);
REF_PTR_RELEASE(pHierarchyAnim);
}
}

Expand Down
5 changes: 3 additions & 2 deletions Core/Tools/W3DView/AssetInfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,8 @@ AssetInfoClass::Initialize (void)

// Assume we are wrapping an instance as apposed to an asset 'name'.
RenderObjClass *prender_obj = m_pRenderObj;
SAFE_ADD_REF (prender_obj);
if (prender_obj)
prender_obj->Add_Ref();

// If we are wrapping an asset name, then create an instance of it.
if (prender_obj == NULL) {
Expand All @@ -72,7 +73,7 @@ AssetInfoClass::Initialize (void)
}

// Release our hold on the temporary object
MEMBER_RELEASE (prender_obj);
REF_PTR_RELEASE (prender_obj);
}

return ;
Expand Down
8 changes: 4 additions & 4 deletions Core/Tools/W3DView/AssetInfo.h
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,9 @@ class AssetInfoClass
: m_Name (passet_name),
m_AssetType (type),
m_dwUserData (user_data),
m_pRenderObj (NULL) { MEMBER_ADD (m_pRenderObj, prender_obj); Initialize (); }
m_pRenderObj (NULL) { REF_PTR_SET (m_pRenderObj, prender_obj); Initialize (); }

virtual ~AssetInfoClass (void) { MEMBER_RELEASE (m_pRenderObj); }
virtual ~AssetInfoClass (void) { REF_PTR_RELEASE (m_pRenderObj); }

//////////////////////////////////////////////////////////////
//
Expand All @@ -83,14 +83,14 @@ class AssetInfoClass
ASSET_TYPE Get_Type (void) const { return m_AssetType; }
DWORD Get_User_Number (void) const { return m_dwUserData; }
const CString & Get_User_String (void) const { return m_UserString; }
RenderObjClass * Get_Render_Obj (void) const { SAFE_ADD_REF (m_pRenderObj); return m_pRenderObj; }
RenderObjClass * Get_Render_Obj (void) const { if (m_pRenderObj) m_pRenderObj->Add_Ref(); return m_pRenderObj; }
RenderObjClass * Peek_Render_Obj (void) const { return m_pRenderObj; }
void Set_Name (LPCTSTR pname) { m_Name = pname; }
void Set_Hierarchy_Name (LPCTSTR pname) { m_HierarchyName = pname; }
void Set_Type (ASSET_TYPE type) { m_AssetType = type; }
void Set_User_Number (DWORD user_data) { m_dwUserData = user_data; }
void Set_User_String (LPCTSTR string) { m_UserString = string; }
void Set_Render_Obj (RenderObjClass *pobj) { MEMBER_ADD (m_pRenderObj, pobj); }
void Set_Render_Obj (RenderObjClass *pobj) { REF_PTR_SET (m_pRenderObj, pobj); }

//
// Information methods
Expand Down
12 changes: 6 additions & 6 deletions Core/Tools/W3DView/BoneMgrDialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -222,15 +222,15 @@ BoneMgrDialogClass::Fill_Bone_Item

// Free our hold on the render objs in the original node list
for (index = 0; index < orig_node_list.Count (); index ++) {
MEMBER_RELEASE (orig_node_list[index]);
REF_PTR_RELEASE (orig_node_list[index]);
}

// Free our hold on the render objs in the node list
for (index = 0; index < node_list.Count (); index ++) {
MEMBER_RELEASE (node_list[index]);
REF_PTR_RELEASE (node_list[index]);
}

MEMBER_RELEASE (porig_model);
REF_PTR_RELEASE (porig_model);
return ;
}

Expand Down Expand Up @@ -405,7 +405,7 @@ void
BoneMgrDialogClass::OnOK (void)
{
// Simply forget about the backup we made
MEMBER_RELEASE (m_pBackupModel);
REF_PTR_RELEASE (m_pBackupModel);

// Update the hierarchy's cached information to reflect the new settings
CW3DViewDoc *pdoc = (CW3DViewDoc *)((CMainFrame *)::AfxGetMainWnd())->GetActiveDocument ();
Expand Down Expand Up @@ -459,7 +459,7 @@ BoneMgrDialogClass::OnAttachButton (void)
if (prender_obj != NULL) {
m_pBaseModel->Add_Sub_Object_To_Bone (prender_obj, m_BoneName);
m_BoneTree.InsertItem (name, 1, 1, hbone_item);
MEMBER_RELEASE (prender_obj);
REF_PTR_RELEASE (prender_obj);
}

} else {
Expand All @@ -481,7 +481,7 @@ BoneMgrDialogClass::OnAttachButton (void)
}

// Release our hold on this pointer
MEMBER_RELEASE (psub_obj);
REF_PTR_RELEASE (psub_obj);
}

// Remove the object from our UI
Expand Down
12 changes: 6 additions & 6 deletions Core/Tools/W3DView/DataTreeView.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -521,7 +521,7 @@ CDataTreeView::LoadAnimationsIntoTree (void)
}

// Release our hold on this animation...
MEMBER_RELEASE (pHierarchyAnim);
REF_PTR_RELEASE (pHierarchyAnim);
}
}

Expand Down Expand Up @@ -583,7 +583,7 @@ CDataTreeView::LoadAnimationsIntoTree (HTREEITEM hItem)
}

// Release our hold on the animation object
MEMBER_RELEASE (pHierarchyAnim);
REF_PTR_RELEASE (pHierarchyAnim);
}
}

Expand Down Expand Up @@ -1009,7 +1009,7 @@ CDataTreeView::Display_Asset (HTREEITEM htree_item)
RenderObjClass *prender_obj = Create_Render_Obj_To_Display (hParentItem);
pdoc->PlayAnimation (prender_obj,
asset_info->Get_Name ());
MEMBER_RELEASE (prender_obj);
REF_PTR_RELEASE (prender_obj);
}
}
break;
Expand All @@ -1019,7 +1019,7 @@ CDataTreeView::Display_Asset (HTREEITEM htree_item)
// Ask the document to display this object
ParticleEmitterClass *emitter = (ParticleEmitterClass *)Create_Render_Obj_To_Display (htree_item);
pdoc->Display_Emitter (emitter);
MEMBER_RELEASE (emitter);
REF_PTR_RELEASE (emitter);
}
break;

Expand All @@ -1035,7 +1035,7 @@ CDataTreeView::Display_Asset (HTREEITEM htree_item)
// Ask the document to display this object
RenderObjClass *prender_obj = Create_Render_Obj_To_Display (htree_item);
pdoc->DisplayObject (prender_obj);
MEMBER_RELEASE (prender_obj);
REF_PTR_RELEASE (prender_obj);
}
break;
}
Expand Down Expand Up @@ -1478,7 +1478,7 @@ Set_Highest_LOD (RenderObjClass *render_obj)
if (sub_obj != NULL) {
Set_Highest_LOD (sub_obj);
}
MEMBER_RELEASE (sub_obj);
REF_PTR_RELEASE (sub_obj);
}

//
Expand Down
4 changes: 2 additions & 2 deletions Core/Tools/W3DView/EditLODDialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ CEditLODDialog::OnInitDialog (void)
RenderObjClass *pfirst_subobj = pLOD->Get_Sub_Object (0);
if (pfirst_subobj != NULL) {
m_spinIncrement = pfirst_subobj->Get_Bounding_Sphere ().Radius / 5.0F;
MEMBER_RELEASE (pfirst_subobj);
REF_PTR_RELEASE (pfirst_subobj);
}

// Loop through all the subobjects
Expand All @@ -142,7 +142,7 @@ CEditLODDialog::OnInitDialog (void)
m_hierarchyListCtrl.SetItemText (iIndex, COL_SWITCH_DN, stringTemp);

// Free this object
MEMBER_RELEASE (pCSubObject);
REF_PTR_RELEASE (pCSubObject);
}
}

Expand Down
5 changes: 3 additions & 2 deletions Core/Tools/W3DView/EmitterInstanceList.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ EmitterInstanceListClass::Free_List (void)
// Release our hold on each of the emitter pointers
//
for (int index = 0; index < m_List.Count (); index ++) {
MEMBER_RELEASE (m_List[index]);
REF_PTR_RELEASE (m_List[index]);
}

m_List.Delete_All ();
Expand Down Expand Up @@ -93,7 +93,8 @@ EmitterInstanceListClass::Add_Emitter (ParticleEmitterClass *emitter)
//
// Add this emitter to the list and put a hold on its reference
//
SAFE_ADD_REF (emitter);
if (emitter)
emitter->Add_Ref();
m_List.Add (emitter);
}

Expand Down
4 changes: 2 additions & 2 deletions Core/Tools/W3DView/EmitterPropertySheet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@ EmitterPropertySheetClass::Update_Emitter (void)
//
// Use this emitter as the edited emitter from here on out
//
MEMBER_RELEASE (m_pEmitter);
REF_PTR_RELEASE (m_pEmitter);
m_pEmitter = pemitter;*/

// Pass the emitter along to the pages
Expand Down Expand Up @@ -501,7 +501,7 @@ EmitterPropertySheetClass::Create_New_Emitter (void)
// Display the new emitter
//
::GetCurrentDocument ()->Display_Emitter (emitter);
MEMBER_RELEASE (emitter);
REF_PTR_RELEASE (emitter);

/*SAFE_DELETE_ARRAY (color.Values);
SAFE_DELETE_ARRAY (color.KeyTimes);
Expand Down
6 changes: 3 additions & 3 deletions Core/Tools/W3DView/GraphicView.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -329,8 +329,8 @@ CGraphicView::OnDestroy (void)
//
// Free the camera object
//
MEMBER_RELEASE (m_pCamera);
MEMBER_RELEASE (m_pLightMesh);
REF_PTR_RELEASE (m_pCamera);
REF_PTR_RELEASE (m_pLightMesh);

// Is there an update thread running?
if (m_TimerID == 0) {
Expand Down Expand Up @@ -388,7 +388,7 @@ Set_Lowest_LOD (RenderObjClass *render_obj)
if (psub_obj != NULL) {
Set_Lowest_LOD (psub_obj);
}
MEMBER_RELEASE (psub_obj);
REF_PTR_RELEASE (psub_obj);
}

//
Expand Down
2 changes: 1 addition & 1 deletion Core/Tools/W3DView/PlaySoundDialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ void
PlaySoundDialogClass::OnCancel (void)
{
SoundObj->Stop ();
MEMBER_RELEASE (SoundObj);
REF_PTR_RELEASE (SoundObj);

CDialog::OnCancel ();
return ;
Expand Down
8 changes: 4 additions & 4 deletions Core/Tools/W3DView/RingPropertySheet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ RingPropertySheetClass::RingPropertySheetClass
: m_RenderObj (NULL),
CPropertySheet(nIDCaption, pParentWnd, iSelectPage)
{
MEMBER_ADD (m_RenderObj, ring);
REF_PTR_SET (m_RenderObj, ring);
Initialize ();
return ;
}
Expand All @@ -72,7 +72,7 @@ RingPropertySheetClass::RingPropertySheetClass
: m_RenderObj (NULL),
CPropertySheet(pszCaption, pParentWnd, iSelectPage)
{
MEMBER_ADD (m_RenderObj, ring);
REF_PTR_SET (m_RenderObj, ring);
Initialize ();
return ;
}
Expand All @@ -85,7 +85,7 @@ RingPropertySheetClass::RingPropertySheetClass
/////////////////////////////////////////////////////////////////////////////
RingPropertySheetClass::~RingPropertySheetClass (void)
{
MEMBER_RELEASE (m_RenderObj);
REF_PTR_RELEASE (m_RenderObj);
return ;
}

Expand Down Expand Up @@ -204,7 +204,7 @@ RingPropertySheetClass::Add_Object_To_Viewer (void)
//
doc->Reload_Displayed_Object ();
m_LastSavedName = m_RenderObj->Get_Name ();
MEMBER_ADD (m_RenderObj, (RingRenderObjClass *)doc->GetDisplayedObject ());
REF_PTR_SET (m_RenderObj, (RingRenderObjClass *)doc->GetDisplayedObject ());

//
// Pass the object along to the pages
Expand Down
2 changes: 1 addition & 1 deletion Core/Tools/W3DView/ScreenCursor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ ScreenCursorClass::Initialize (void)
void
ScreenCursorClass::Set_Texture (TextureClass *texture)
{
MEMBER_ADD (m_pTexture, texture);
REF_PTR_SET (m_pTexture, texture);

// Find the dimensions of the texture:
if (m_pTexture != NULL) {
Expand Down
8 changes: 4 additions & 4 deletions Core/Tools/W3DView/SpherePropertySheet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ SpherePropertySheetClass::SpherePropertySheetClass
: m_RenderObj (NULL),
CPropertySheet(nIDCaption, pParentWnd, iSelectPage)
{
MEMBER_ADD (m_RenderObj, sphere);
REF_PTR_SET (m_RenderObj, sphere);
Initialize ();
return ;
}
Expand All @@ -72,7 +72,7 @@ SpherePropertySheetClass::SpherePropertySheetClass
: m_RenderObj (NULL),
CPropertySheet(pszCaption, pParentWnd, iSelectPage)
{
MEMBER_ADD (m_RenderObj, sphere);
REF_PTR_SET (m_RenderObj, sphere);
Initialize ();
return ;
}
Expand All @@ -85,7 +85,7 @@ SpherePropertySheetClass::SpherePropertySheetClass
/////////////////////////////////////////////////////////////////////////////
SpherePropertySheetClass::~SpherePropertySheetClass (void)
{
MEMBER_RELEASE (m_RenderObj);
REF_PTR_RELEASE (m_RenderObj);
return ;
}

Expand Down Expand Up @@ -204,7 +204,7 @@ SpherePropertySheetClass::Add_Object_To_Viewer (void)
//
doc->Reload_Displayed_Object ();
m_LastSavedName = m_RenderObj->Get_Name ();
MEMBER_ADD (m_RenderObj, (SphereRenderObjClass *)doc->GetDisplayedObject ());
REF_PTR_SET (m_RenderObj, (SphereRenderObjClass *)doc->GetDisplayedObject ());

//
// Pass the object along to the pages
Expand Down
6 changes: 3 additions & 3 deletions Core/Tools/W3DView/TextureMgrDialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,7 @@ TextureMgrDialogClass::Add_Subobjs_To_List (RenderObjClass *prender_obj)

// Recursively add subobjs to the list
Add_Subobjs_To_List (psubobj);
MEMBER_RELEASE (psubobj);
REF_PTR_RELEASE (psubobj);
}
}

Expand Down Expand Up @@ -336,7 +336,7 @@ TextureMgrDialogClass::Add_Textures_To_Node
}

// Release our hold on this pointer
MEMBER_RELEASE (pmat_info);
REF_PTR_RELEASE (pmat_info);
}

return ;
Expand Down Expand Up @@ -438,7 +438,7 @@ TextureMgrDialogClass::OnDblclkMeshTextureListCtrl
SR_RELEASE (poriginal_texture);
}

MEMBER_RELEASE (pmat_info);
REF_PTR_RELEASE (pmat_info);
}
}

Expand Down
6 changes: 3 additions & 3 deletions Core/Tools/W3DView/TextureMgrDialog.h
Original file line number Diff line number Diff line change
Expand Up @@ -91,9 +91,9 @@ class TextureListNodeClass
m_pParent (NULL),
m_Name (name),
m_TextureIndex (0),
m_IconIndex (ICON_DEF_TEXTURE) { MEMBER_ADD (m_pTexture, ptexture); }
m_IconIndex (ICON_DEF_TEXTURE) { REF_PTR_SET (m_pTexture, ptexture); }

~TextureListNodeClass (void) { MEMBER_RELEASE (m_pTexture); Free_Subobj_List (); }
~TextureListNodeClass (void) { REF_PTR_RELEASE (m_pTexture); Free_Subobj_List (); }


////////////////////////////////////////////////////////////
Expand All @@ -107,7 +107,7 @@ class TextureListNodeClass
void Set_Type (NODE_TYPE type) { m_Type = type; }

TextureClass * Peek_Texture (void) const { return m_pTexture; }
void Set_Texture (TextureClass *ptex) { MEMBER_ADD (m_pTexture, ptex); }
void Set_Texture (TextureClass *ptex) { REF_PTR_SET (m_pTexture, ptex); }

TEXTURE_NODE_LIST & Get_Subobj_List (void) { return m_SubObjectList; }

Expand Down
Loading
Loading