void CMenuMission::Term() { //take anything we've cached out of the list, so that we // don't try to delete them twice RemoveObjectives(); //delete our cache ControlArray::iterator iter = m_Objectives.begin(); while (iter != m_Objectives.end()) { debug_delete(*iter); iter++; } m_Objectives.clear(); if (m_pObjLabel) { debug_delete(m_pObjLabel); m_pObjLabel = LTNULL; } if (m_pParameters) { debug_delete(m_pParameters); m_pParameters = LTNULL; } CBaseMenu::Term(); }
void CHUDMessageQueue::Term() { MessageArray::iterator iter = m_ActiveMsgs.begin(); while (iter != m_ActiveMsgs.end()) { CHUDMessage *pMsg = (*iter); pMsg->Destroy(); debug_delete(pMsg); iter++; } iter = m_HistoryMsgs.begin(); while (iter != m_HistoryMsgs.end()) { CHUDMessage *pMsg = (*iter); pMsg->Destroy(); debug_delete(pMsg); iter++; } MCArray::iterator mcIter = m_History.begin(); while (mcIter != m_History.end()) { debug_delete((*mcIter)); mcIter++; } }
// Creation LTBOOL CListCtrl::Create ( int nHeight, LTBOOL bUseArrows, int nArrowOffset) { m_nHeight=nHeight; m_bCreated=LTTRUE; if (bUseArrows) { m_bArrows = LTTRUE; m_nArrowOffset = nArrowOffset; //Add Server Arrows m_pUp = debug_new(CBitmapCtrl); if (!m_pUp->Create(g_pLTClient,"interface\\ListArrowUp.pcx","interface\\ListArrowUpH.pcx","interface\\ListArrowUpD.pcx")) { debug_delete(m_pUp); m_pUp = LTNULL; } m_pDown = debug_new(CBitmapCtrl); if (!m_pDown->Create(g_pLTClient,"interface\\ListArrowDn.pcx","interface\\ListArrowDnH.pcx","interface\\ListArrowDnD.pcx")) { debug_delete(m_pDown); m_pDown = LTNULL; } } return LTTRUE; }
LTBOOL CHUDMessageQueue::Init() { UpdateLayout(); g_pLTClient->RegisterConsoleProgram("SimulateChat", SimulateChatFn); ASSERT(m_nMaxActiveMsgs); if (!m_nMaxActiveMsgs) return LTFALSE; m_ActiveMsgs.reserve(m_nMaxActiveMsgs); m_HistoryMsgs.reserve(m_nMaxHistoryMsgs); m_History.reserve(32); MsgCreate fmt = m_MsgFormat; fmt.sString = ""; fmt.fDuration = 0.0f; for (int i = 0; i < m_nMaxActiveMsgs; i++) { CHUDMessage *pMsg = debug_new(CHUDMessage); if (pMsg->Create(fmt)) { pMsg->Show(LTFALSE); m_ActiveMsgs.push_back(pMsg); } else { debug_delete(pMsg); } } for (i = 0; i < m_nMaxHistoryMsgs; i++) { CHUDMessage *pMsg = debug_new(CHUDMessage); if (pMsg->Create(fmt)) { pMsg->Show(LTFALSE); m_HistoryMsgs.push_back(pMsg); } else { debug_delete(pMsg); } } return LTTRUE; }
uint16 CBaseMenu::AddControl (char *pString, uint32 commandID, LTBOOL bStatic) { CUIFont* pFont = g_pInterfaceResMgr->GetFont(m_FontFace); if (!pFont) return -1; CLTGUITextCtrl* pCtrl=debug_new(CLTGUITextCtrl); if (!pCtrl->Create(pString, commandID, LTNULL, pFont, m_FontSize, this)) { debug_delete(pCtrl); return -1; } pCtrl->SetBasePos(m_nextPos); if (bStatic) { pCtrl->SetColors(m_NonSelectedColor,m_NonSelectedColor,m_NonSelectedColor); pCtrl->Enable(LTFALSE); } else pCtrl->SetColors(m_SelectedColor,m_NonSelectedColor,m_DisabledColor); pCtrl->SetScale(g_pInterfaceResMgr->GetXRatio()); return m_List.AddControl(pCtrl); }
CAnimationTreePacked* CAnimationTreePackedMgr::CreateAnimationTreePacked( const char* pszFilename ) { // Create a new tree. CAnimationTreePacked* pTree = debug_new( CAnimationTreePacked ); // Bail if we fail to load the specified packed anim tree file. CAnimationTreePackedLoader Loader; if( !Loader.LoadAnimationTreePacked( pTree, pszFilename ) ) { debug_delete( pTree ); return NULL; } // Assign the new tree a unique ID. pTree->m_eTreeID = (AT_TREE_ID)m_iNextTreeID; ++m_iNextTreeID; // Assign global transition IDs. // These IDs allow searching for transitions across multiple trees. AssignGlobalTransitionIDs( pTree ); // Add the new tree to the list. m_lstAnimTrees.push_back( pTree ); return pTree; }
void CClientFXDB::Term() { //empty out our types debug_deletea(m_pEffectTypes); m_pEffectTypes = NULL; m_nNumEffectTypes = 0; // Delete all the FX groups CLinkListNode<FX_GROUP *> *pGroupNode = m_collGroupFX.GetHead(); while (pGroupNode) { //delete all the key property lists for(uint32 nCurrKey = 0; nCurrKey < pGroupNode->m_Data->m_nNumKeys; nCurrKey++) { if(m_pfnFreePropList) { m_pfnFreePropList(pGroupNode->m_Data->m_pKeys[nCurrKey].m_pProps); pGroupNode->m_Data->m_pKeys[nCurrKey].m_pProps = NULL; } } debug_delete( pGroupNode->m_Data ); pGroupNode = pGroupNode->m_pNext; } m_collGroupFX.RemoveAll(); UnloadFxDll(); }
Prop::~Prop() { ClearTouchSoundIfDone( LTTRUE ); ClearHitSoundIfDone( LTTRUE ); debug_delete(m_pDisturb); }
CScreenSprite * CScreenSpriteMgr::CreateScreenSprite(char * pFile, bool bExpires, ScreenSpriteLayer eLayer) { // Make sure the ScreenSpriteMgr is operational if (!m_bInitialized) Init(); CScreenSprite * pSpr = debug_new(CScreenSprite); pSpr->Init(); bool bResult = GiveSpriteResources(pSpr, pFile); if (!bResult) { debug_delete(pSpr); return LTNULL; } pSpr->SetExpiration(bExpires); pSpr->m_eLayer = eLayer; // determine the draw-order with the layer number // m_SpriteArray.push_back(pSpr); ScreenSpriteArray::iterator iter = m_SpriteArray.begin(); while (iter != m_SpriteArray.end()) { if (pSpr->m_eLayer <= (*iter)->m_eLayer) { m_SpriteArray.insert(iter, pSpr); return pSpr; } iter++; } // pSpr didn't come before anything in the array, or the array is empty. Add it m_SpriteArray.push_back(pSpr); return pSpr; }
// Destroy the control void CListCtrl::Destroy ( ) { m_controlArray.RemoveAll(); if (m_pUp) { debug_delete(m_pUp); m_pUp = LTNULL; } if (m_pDown) { debug_delete(m_pDown); m_pDown = LTNULL; } m_bCreated=LTFALSE; }
CTeamPlayer* CTeam::AddPlayer(uint32 dwPlayerID, uint32 dwFlags) { // Make sure this player doesn't already exist... if (GetPlayer(dwPlayerID)) { return(NULL); } // Create and init a new player... CTeamPlayer* pPlayer = debug_new(CTeamPlayer); if (!pPlayer) return(NULL); if (!pPlayer->Init(dwPlayerID, dwFlags)) { debug_delete(pPlayer); return(LTFALSE); } // Add the new player to our list... if (!AddPlayer(pPlayer)) { return(LTFALSE); } // All done... return(pPlayer); }
LTBOOL BuildPolyDebrisFXList(PolyDebrisFXList & list, CButeMgr & buteMgr, char* pTagBase) { if (!pTagBase) return LTFALSE; int nNum = 0; sprintf(s_aTagName, "%s%d", pTagBase, nNum); // Read in the properties for each scale fx... while (buteMgr.Exist(s_aTagName)) { CPolyDebrisFX* pFX = debug_new(CPolyDebrisFX); if (pFX && pFX->Init(buteMgr, s_aTagName)) { pFX->nId = nNum; list.AddTail(pFX); } else { debug_delete(pFX); return LTFALSE; } nNum++; sprintf(s_aTagName, "%s%d", pTagBase, nNum); } return LTTRUE; }
void CMenuMgr::Term() { //term menus MenuArray::iterator iter = m_MenuArray.begin(); while (iter != m_MenuArray.end()) { (*iter)->Term(); iter++; } //clear menu array m_MenuArray.clear(); //term menus KeyArray::iterator kiter = m_HotKeys.begin(); while (kiter != m_HotKeys.end()) { debug_delete(*kiter); kiter++; } //clear menu array m_HotKeys.clear(); }
CClientInfoMgr::~CClientInfoMgr() { CLIENT_INFO* ptr = LTNULL; while (m_pClients) { ptr = m_pClients->pNext; g_pLTClient->FreeString (m_pClients->hstrName); debug_delete(m_pClients); m_pClients = ptr; } if (m_hFragString) { g_pLTClient->FreeString(m_hFragString); m_hFragString = LTNULL; } if (m_hTeamScore) { g_pLTClient->FreeString(m_hTeamScore); m_hTeamScore = LTNULL; } if (m_hOppScore) { g_pLTClient->FreeString(m_hOppScore); m_hOppScore = LTNULL; } }
void CClientInfoMgr::RemoveClient (uint32 nID) { if (!m_pClients) return; m_nLocalID = 0; g_pLTClient->GetLocalClientID (&m_nLocalID); // find the client CLIENT_INFO* ptr = m_pClients; while (ptr) { if (ptr->nID == nID) break; ptr = ptr->pNext; } if (!ptr) return; // remove the client from the list if (ptr->pNext) ptr->pNext->pPrev = ptr->pPrev; if (ptr->pPrev) ptr->pPrev->pNext = ptr->pNext; if (m_pClients == ptr) m_pClients = ptr->pNext; g_pLTClient->FreeString (ptr->hstrName); debug_delete(ptr); }
LTBOOL CSoundFilterMgr::Init(const char* szAttributeFile) { if (g_pSoundFilterMgr || !szAttributeFile) return LTFALSE; if (!Parse(szAttributeFile)) return LTFALSE; g_pSoundFilterMgr = this; // Read in the properties for each sound filter record... int nNum = 0; sprintf(s_aTagName, "%s%d", SFM_TAG, nNum); while (m_buteMgr.Exist(s_aTagName)) { SOUNDFILTER* pFilter = debug_new(SOUNDFILTER); if (pFilter && pFilter->Init(m_buteMgr, s_aTagName)) { pFilter->nId = nNum; m_FilterList.AddTail(pFilter); } else { debug_delete(pFilter); return LTFALSE; } nNum++; sprintf(s_aTagName, "%s%d", SFM_TAG, nNum); } return LTTRUE; }
void CLoadingScreen::CreateScaleFX(char *szFXName) { if( m_pRenderScreen ) return; CScaleFX* pScaleFX = g_pFXButeMgr->GetScaleFX(szFXName); if (pScaleFX) { CBaseScaleFX *pSFX = debug_new(CBaseScaleFX); if (!g_pFXButeMgr->CreateScaleFX(pScaleFX,m_vPos, m_vF, LTNULL, &m_rRot, pSFX)) { debug_delete(pSFX); return; } m_SFXArray.Add(pSFX); g_pInterfaceMgr->AddInterfaceSFX(pSFX, IFX_NORMAL); //adjust the object's position based on screen res HOBJECT hSFX = pSFX->GetObject(); if (hSFX) { LTVector vNewPos; g_pLTClient->GetObjectPos(hSFX, &vNewPos); vNewPos.z; g_pLTClient->SetObjectPos(hSFX, &vNewPos); } } }
LTBOOL CPropTypeMgr::Init(const char* szAttributeFile) { if (g_pPropTypeMgr || !szAttributeFile) return LTFALSE; if (!Parse(szAttributeFile)) return LTFALSE; g_pPropTypeMgr = this; // Read in the properties for each prop type record... int nNum = 0; sprintf(s_aTagName, "%s%d", PTMGR_TAG, nNum); while (m_buteMgr.Exist(s_aTagName)) { PROPTYPE* pPropType = debug_new(PROPTYPE); if (pPropType && pPropType->Init(m_buteMgr, s_aTagName, nNum)) { pPropType->nId = nNum; m_PropTypeList.AddTail(pPropType); } else { debug_delete(pPropType); return LTFALSE; } nNum++; sprintf(s_aTagName, "%s%d", PTMGR_TAG, nNum); } return LTTRUE; }
void CClientInfoMgr::RemoveClient (uint32 nID) { if (!m_pClients) return; m_nLocalID = 0; g_pLTClient->GetLocalClientID (&m_nLocalID); // find the client CLIENT_INFO* ptr = GetClientByID(nID, false); if (!ptr) return; if( g_pGameClientShell->ShouldUseRadar() ) { g_pRadar->UpdatePlayerName( nID, "", 0); } // remove the client from the list if (ptr->pNext) ptr->pNext->pPrev = ptr->pPrev; if (ptr->pPrev) ptr->pPrev->pNext = ptr->pNext; if (m_pClients == ptr) m_pClients = ptr->pNext; debug_delete(ptr); }
// ----------------------------------------------------------------------- // // // ROUTINE: CLightCycleMgr::RemoveCyclist // // PURPOSE: Completely removes a light cycle from the manager // // ----------------------------------------------------------------------- // bool CLightCycleMgr::RemoveCyclist(HOBJECT hObj) { // Since we're removing from the list, we need to walk it manually std::vector<LIGHT_CYCLIST*>::iterator iter; for(iter=m_collCyclists.begin();iter!=m_collCyclists.end();iter++) { if((*iter)->hObject == hObj) { // We found him. Killlllll! KIIIILLLLLLLLL! LIGHT_CYCLIST* pCyclist = (*iter); debug_delete(pCyclist); // Remove from list m_collCyclists.erase(iter); // Notify the client CAutoMessage cMsg; cMsg.WriteByte(LCI_REMOVE_CYCLIST); cMsg.WriteObject(hObj); g_pLTServer->SendToClient(cMsg, MID_LIGHT_CYCLE_INFO, NULL, MESSAGE_GUARANTEED); return true; } } return false; }
CTeam* CTeamMgr::AddTeam(uint32 dwTeamID, char* sTeamName, uint32 dwFlags) { // Make sure this team doesn't already exist... if (GetTeam(dwTeamID)) return(NULL); if (GetTeam(sTeamName)) return(NULL); // Create and init a new team... CTeam* pTeam = debug_new(CTeam); if (!pTeam) return(NULL); if (!pTeam->Init(dwTeamID, sTeamName, dwFlags)) { debug_delete(pTeam); return(NULL); } // Add the new team to our list... m_lsTeams.InsertLast(pTeam); // All done... return(pTeam); }
CLTGUIColumnCtrl* CMenuPlayer::AddColumnCtrl(uint32 nCommand) { CUIFont* pFont = g_pInterfaceResMgr->GetFont(m_FontFace); CLTGUIColumnCtrl* pCtrl=debug_new(CLTGUIColumnCtrl); if (!pCtrl->Create(nCommand,LTNULL,pFont,m_FontSize, this)) { debug_delete(pCtrl); return LTFALSE; } pCtrl->SetBasePos(m_nextPos); if (nCommand > 0) { pCtrl->SetColors(m_SelectedColor,m_NonSelectedColor,m_DisabledColor); pCtrl->Enable(LTTRUE); } else { pCtrl->SetColors(m_NonSelectedColor,m_NonSelectedColor,m_NonSelectedColor); pCtrl->Enable(LTFALSE); } pCtrl->SetScale(g_pInterfaceResMgr->GetXRatio()); m_List.AddControl(pCtrl); return pCtrl; }
LTBOOL CDebrisMgr::Init(const char* szAttributeFile) { if (g_pDebrisMgr || !szAttributeFile) return LTFALSE; if (!Parse(szAttributeFile)) return LTFALSE; g_pDebrisMgr = this; // Read in the properties for each debis record... int nNum = 0; sprintf(s_aTagName, "%s%d", DEBRISMGR_DEBRIS_TAG, nNum); while (m_buteMgr.Exist(s_aTagName)) { DEBRIS* pDebris = debug_new(DEBRIS); if (pDebris && pDebris->Init(m_buteMgr, s_aTagName)) { pDebris->nId = nNum; m_DebrisList.AddTail(pDebris); } else { debug_delete(pDebris); return LTFALSE; } nNum++; sprintf(s_aTagName, "%s%d", DEBRISMGR_DEBRIS_TAG, nNum); } return LTTRUE; }
LTBOOL CIntelMgr::Init(ILTCSBase *pInterface, const char* szAttributeFile) { if (g_pIntelMgr || !szAttributeFile) return LTFALSE; if (!Parse(pInterface, szAttributeFile)) return LTFALSE; g_pIntelMgr = this; // Read in the properties for each prop type record... int nNum = 0; sprintf(s_aTagName, "%s%d", INTELMGR_TAG, nNum); while (m_buteMgr.Exist(s_aTagName)) { INTEL* pIntel = debug_new(INTEL); if (pIntel && pIntel->Init(m_buteMgr, s_aTagName)) { pIntel->nId = nNum; m_IntelList.AddTail(pIntel); } else { debug_delete(pIntel); return LTFALSE; } nNum++; sprintf(s_aTagName, "%s%d", INTELMGR_TAG, nNum); } return LTTRUE; }
//---------------------------------------------------------------------------- // // ROUTINE: CRelationMgr::Term() // // PURPOSE: Cleans up the RelationMgr instance // //---------------------------------------------------------------------------- void CRelationMgr::Term() { FreeAllResources(); // Clean up the Singleton instance debug_delete( m_pSingleInstance ); m_pSingleInstance = NULL; }
CAISenseRecorderAbstract::~CAISenseRecorderAbstract() { AISENSE_RECORD_MAP::iterator it; for(it = m_mapSenseRecords.begin(); it != m_mapSenseRecords.end(); ++it) { debug_delete(it->second); } }
CDeathScene::~CDeathScene() { if ( m_pObjectRelationMgr != NULL ) { debug_delete( m_pObjectRelationMgr ); m_pObjectRelationMgr = NULL; } }
void CScreenMgr::Term() { // Term the screens for (uint16 i=0; i < m_screenArray.size(); ++i) { m_screenArray[i]->Term(); debug_delete(m_screenArray[i]); } m_screenArray.clear(); if(m_pTransitionFXMgr) { m_pTransitionFXMgr->Term(); debug_delete(m_pTransitionFXMgr); m_pTransitionFXMgr = LTNULL; } }
// ----------------------------------------------------------------------- // // // ROUTINE: LIGHT_CYCLIST::~LIGHT_CYCLIST // // PURPOSE: Destructor // // ----------------------------------------------------------------------- // LIGHT_CYCLIST::~LIGHT_CYCLIST() { std::vector<LIGHT_CYCLE_TRAIL*>::iterator iter; for(iter=collTrails.begin();iter!=collTrails.end();iter++) { debug_delete(*iter); } }
CServerNonPointSoundPlugin::~CServerNonPointSoundPlugin() { if (m_pSoundFilterDBPlugin) { debug_delete(m_pSoundFilterDBPlugin); m_pSoundFilterDBPlugin = NULL; } }