00001 00012 /*************************************************************************** 00013 * Copyright (C) 2007 by Jan Koci * 00014 * honza.koci@email.cz * 00015 * http://kengine.sourceforge.net/tutorial/ 00016 * * 00017 * This program is free software; you can redistribute it and/or modify * 00018 * it under the terms of the GNU General Public License as published by * 00019 * the Free Software Foundation; either version 2 of the License, or * 00020 * (at your option) any later version. * 00021 * * 00022 * This program is distributed in the hope that it will be useful, * 00023 * but WITHOUT ANY WARRANTY; without even the implied warranty of * 00024 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 00025 * GNU General Public License for more details. * 00026 * * 00027 * You should have received a copy of the GNU General Public License * 00028 * along with this program; if not, write to the * 00029 * Free Software Foundation, Inc., * 00030 * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * 00031 ***************************************************************************/ 00032 00033 #include "K3dVorLeafBuild.h" 00034 00038 K3dVorLeafBuild::K3dVorLeafBuild(K3dGameData *_pGameData) 00039 { 00040 m_pGameData = _pGameData; 00041 // Set this pointer to the game data 00042 m_pGameData->SetVorLeafBuild(this); 00043 } 00044 00045 K3dVorLeafBuild::~K3dVorLeafBuild(void) 00046 { 00047 DeleteVorLeafs(); 00048 } 00049 00052 K3dVorLeafObj *K3dVorLeafBuild::CreateNewVorLeafObj() 00053 { 00054 K3dVorLeafObj *pVorLeaf= m_pGameData->GetVorLeafObjSP().New(); 00055 //pVorLeaf->SetPlane(m_pGameData->GetPlaneBuild()->CreateNewPlaneObj()); 00056 //pVorLeaf->SetPoly(m_pGameData->GetPolyBuild()->CreateNewPolyObj()); 00057 pVorLeaf->GetId() = m_pGameData->GetVorLeafObjSP().GetNum()-1; 00058 return pVorLeaf; 00059 } 00060 00061 00063 void K3dVorLeafBuild::DeleteVorLeafs() 00064 { 00065 std::cout << "void K3dVorLeafBuild::DeleteVorLeafs()" << endl; 00066 while(m_pGameData->GetVorLeafObjSP().GetNum()) 00067 { 00068 K3dVorLeafObj *p = m_pGameData->GetVorLeafObjSP().Get(0); 00069 p = m_pGameData->GetVorLeafObjSP().Delete(p); 00070 } 00071 } 00072