00001 /* 00002 * ExNihilo 3D Engine 00003 * 00004 * This program is free software; you can redistribute it and/or modify 00005 * it under the terms of the GNU General Public License as published by 00006 * the Free Software Foundation; either version 2 of the License, or 00007 * (at your option) any later version. 00008 * 00009 * This program is distributed in the hope that it will be useful, 00010 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00011 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00012 * GNU Library General Public License for more details. 00013 * 00014 * You should have received a copy of the GNU General Public License 00015 * along with this program; if not, write to the Free Software 00016 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 00017 * 00018 * Please read AUTHORS file !!! 00019 * 00020 * $Id: ExManagerMap.cpp,v 1.9 2002/09/22 15:54:04 data Exp $ 00021 * 00022 */ 00023 00024 #include "ExManagerMap.h" 00025 00026 bool ExManagerMap::m_flag = false; 00027 ExManagerMap* ExManagerMap::m_instance = NULL; 00028 00029 ExManagerMap* ExManagerMap::CreateSingleton(void){ 00030 Guard(ExManagerMap* ExManagerMap::CreateSingleton(void)) 00031 if(!m_flag) 00032 { 00033 m_flag = true; // We are creating the error log now, so set flag to true 00034 m_instance = new ExManagerMap; // Create the error log 00035 }else 00036 { 00037 std::cout<<"Error singleton already created"<<std::endl; 00038 } 00039 return m_instance; 00040 UnGuard 00041 } 00042 00043 ExManagerMap::ExManagerMap(void) 00044 { 00045 MapLoaded=false; 00046 } 00047 00048 ExManagerMap::~ExManagerMap(void) 00049 { 00050 } 00051 00052 void ExManagerMap::Reset(void) 00053 { 00054 MapLoaded=false; 00055 } 00056 00057 void ExManagerMap::LoadMap(const char * FileName) 00058 { 00059 Guard(ExManagerMap::LoadMap(const char * )) 00060 Map=new ExCMap(); 00061 Map->SetManagerTexture(ManagerTexture); 00062 Map->Consol=Consol; 00063 Map->LoadMap(FileName); 00064 MapLoaded=true; 00065 UnGuard 00066 } 00067 00068 void ExManagerMap::Draw(void) 00069 { 00070 Guard(void ExManagerMap::Draw(void)) 00071 if(MapLoaded) 00072 { 00073 Map->Draw(); 00074 } 00075 UnGuard 00076 } 00077 00078 ExCAction ExManagerMap::InputCommand(ExCCommand Command) 00079 { 00080 Guard(ExCAction ExManagerMap::InputCommand(ExCCommand Command)) 00081 return NOTHING; 00082 UnGuard 00083 } 00084 00085 ExCAction ExManagerMap::InputAction(ExCAction Action) 00086 { 00087 Guard(ExCAction ExManagerMap::InputAction(ExCAction Action)) 00088 switch(Action.m_Action) 00089 { 00090 case SHOW_MAP_SKY_BOX:ShowSkybox();break; 00091 case HIDE_MAP_SKY_BOX:HideSkybox();break; 00092 case SHOW_MAP_MESH:ShowMesh();break; 00093 case HIDE_MAP_MESH:HideMesh();break; 00094 case ENABLE_MAP_OCTREE:EnableOctree();break; 00095 case DISABLE_MAP_OCTREE:DisableOctree();break; 00096 case SHOW_MAP_OCTREE_SUBDIVISON:ShowOctreeSubdivision();break; 00097 case HIDE_MAP_OCTREE_SUBDIVISON:HideOctreeSubdivision();break; 00098 00099 default: 00100 *Consol<<"Can not file action in MAP_ACTION_MAP"<<std::endl; 00101 break; 00102 } 00103 if(Action.m_NextAction){return *Action.m_NextAction;} 00104 else{return NOTHING;} 00105 UnGuard 00106 } 00107