Changeset 10392 for code/branches/core7/src/libraries/core/Loader.cc
- Timestamp:
- Apr 23, 2015, 10:44:57 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/core7/src/libraries/core/Loader.cc
r10278 r10392 48 48 namespace orxonox 49 49 { 50 std::vector<std::pair<const XMLFile*, ClassTreeMask> > Loader::files_s; 51 ClassTreeMask Loader::currentMask_s; 50 Loader* Loader::singletonPtr_s = 0; 52 51 53 52 bool Loader::open(const XMLFile* file, const ClassTreeMask& mask, bool bVerbose) 54 53 { 55 Loader::add(file, mask);56 return Loader::load(file, mask, bVerbose);54 this->add(file, mask); 55 return this->load(file, mask, bVerbose); 57 56 } 58 57 59 58 void Loader::close() 60 59 { 61 Loader::unload();62 Loader::files_s.clear();60 this->unload(); 61 this->files_.clear(); 63 62 } 64 63 65 64 void Loader::close(const XMLFile* file) 66 65 { 67 Loader::unload(file);68 Loader::remove(file);66 this->unload(file); 67 this->remove(file); 69 68 } 70 69 … … 73 72 if (!file) 74 73 return; 75 Loader::files_s.insert(Loader::files_s.end(), std::pair<const XMLFile*, ClassTreeMask>(file, mask));74 this->files_.insert(this->files_.end(), std::pair<const XMLFile*, ClassTreeMask>(file, mask)); 76 75 } 77 76 … … 80 79 if (!file) 81 80 return; 82 for (std::vector<std::pair<const XMLFile*, ClassTreeMask> >::iterator it = Loader::files_s.begin(); it != Loader::files_s.end(); ++it)81 for (std::vector<std::pair<const XMLFile*, ClassTreeMask> >::iterator it = this->files_.begin(); it != this->files_.end(); ++it) 83 82 { 84 83 if (it->first == file) 85 84 { 86 Loader::files_s.erase(it);85 this->files_.erase(it); 87 86 break; 88 87 } … … 103 102 { 104 103 bool success = true; 105 for (std::vector<std::pair<const XMLFile*, ClassTreeMask> >::iterator it = Loader::files_s.begin(); it != Loader::files_s.end(); ++it)106 if (! Loader::load(it->first, it->second * mask, bVerbose))104 for (std::vector<std::pair<const XMLFile*, ClassTreeMask> >::iterator it = this->files_.begin(); it != this->files_.end(); ++it) 105 if (!this->load(it->first, it->second * mask, bVerbose)) 107 106 success = false; 108 107 … … 133 132 bool Loader::reload(const ClassTreeMask& mask, bool bVerbose) 134 133 { 135 Loader::unload(mask);136 return Loader::load(mask, bVerbose);134 this->unload(mask); 135 return this->load(mask, bVerbose); 137 136 } 138 137 … … 156 155 return false; 157 156 158 Loader::currentMask_s= file->getMask() * mask;157 this->currentMask_ = file->getMask() * mask; 159 158 160 159 std::string xmlInput; … … 189 188 // start of the program. 190 189 // Assumption: the LevelInfo tag does not use Lua scripting 191 xmlInput = removeLuaTags(xmlInput);190 xmlInput = Loader::removeLuaTags(xmlInput); 192 191 } 193 192 } … … 198 197 { 199 198 orxout(user_info) << "Start loading " << file->getFilename() << "..." << endl; 200 orxout(internal_info, context::loader) << "Mask: " << Loader::currentMask_s<< endl;199 orxout(internal_info, context::loader) << "Mask: " << this->currentMask_ << endl; 201 200 } 202 201 else 203 202 { 204 203 orxout(verbose, context::loader) << "Start loading " << file->getFilename() << "..." << endl; 205 orxout(verbose_more, context::loader) << "Mask: " << Loader::currentMask_s<< endl;204 orxout(verbose_more, context::loader) << "Mask: " << this->currentMask_ << endl; 206 205 } 207 206 … … 319 318 bool Loader::reload(const XMLFile* file, const ClassTreeMask& mask, bool bVerbose) 320 319 { 321 Loader::unload(file, mask);322 return Loader::load(file, mask, bVerbose);320 this->unload(file, mask); 321 return this->load(file, mask, bVerbose); 323 322 } 324 323
Note: See TracChangeset
for help on using the changeset viewer.