Changeset 513 for code/branches/FICN/src/loader
- Timestamp:
- Dec 13, 2007, 5:58:14 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/FICN/src/loader/LevelLoader.cc
r507 r513 1 /* 2 * ORXONOX - the hottest 3D action shooter ever to exist 3 * 4 * 5 * License notice: 6 * 7 * This program is free software; you can redistribute it and/or 8 * modify it under the terms of the GNU General Public License 9 * as published by the Free Software Foundation; either version 2 10 * of the License, or (at your option) any later version. 11 * 12 * This program is distributed in the hope that it will be useful, 13 * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 * GNU General Public License for more details. 16 * 17 * You should have received a copy of the GNU General Public License 18 * along with this program; if not, write to the Free Software 19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 20 * 21 * Author: 22 * ... 23 * Co-authors: 24 * ... 25 * 26 */ 27 1 28 #include <string> 2 29 #include <vector> … … 19 46 { 20 47 valid_ = false; 21 48 22 49 // Load XML level file 23 50 path.append("/"); 24 path.append(file); 25 51 path.append(file); 52 26 53 // Open xml file 27 54 doc.LoadFile(path); … … 31 58 { 32 59 TiXmlHandle hDoc(&doc); 33 TiXmlHandle hRoot(0); 60 TiXmlHandle hRoot(0); 34 61 TiXmlElement* pElem; 35 62 … … 46 73 if (pElem) 47 74 { 48 description_ = pElem->GetText(); 75 description_ = pElem->GetText(); 49 76 } 50 77 51 78 // Set level name 52 79 name_ = rootElement->Attribute("name"); 53 80 image_ = rootElement->Attribute("image"); 54 81 55 82 valid_ = true; 56 83 } … … 58 85 { 59 86 orxonox::Error("Level file has no valid root node"); 60 } 87 } 61 88 } 62 89 else 63 90 { 64 91 orxonox::Error("Could not load level file "); 65 } 92 } 66 93 } 67 94 … … 74 101 TiXmlElement* tElem; 75 102 TiXmlNode* tNode; 76 77 103 104 78 105 // Set loading screen 79 106 loadElem = rootElement->FirstChildElement("loading"); … … 99 126 showLoadingScreen(); 100 127 } 101 128 102 129 // Load audio 103 130 // TODO 104 131 105 132 // Load scripts 106 133 // TODO 107 134 108 135 // Load world 109 136 worldElem = rootElement->FirstChildElement("world"); 110 137 if (worldElem) 111 { 138 { 112 139 tNode = 0; 113 140 while( tNode = worldElem->IterateChildren( tNode ) ) … … 116 143 orxonox::BaseObject* obj = ID(tElem->Value())->fabricate(); 117 144 obj->loadParams(tElem); 118 } 145 } 119 146 } 120 121 std::cout << "Loading finished!\n\n\n\n\n"; 147 148 std::cout << "Loading finished!\n\n\n\n\n"; 122 149 } 123 150 } 124 151 125 152 void LevelLoader::showLoadingScreen() 126 153 { … … 129 156 std::cout << "Backgroundcolor: " << loadingBackgroundColor_ << "\nBackgroundimage:" << loadingBackgroundImage_ << "\n\n\n"; 130 157 } 131 158 132 159 LevelLoader::~LevelLoader() 133 160 { 134 161 135 162 } 136 137 163 164 138 165 string LevelLoader::name() 139 166 { 140 167 return this->name_; 141 168 } 142 169 143 170 string LevelLoader::description() 144 171 { 145 172 return this->description_; 146 173 } 147 174 148 175 string LevelLoader::image() 149 176 {
Note: See TracChangeset
for help on using the changeset viewer.