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