[Orxonox-commit 5848] r10508 - in code/branches/core7/src: libraries/core orxonox orxonox/gamestates
landauf at orxonox.net
landauf at orxonox.net
Sat May 30 10:18:07 CEST 2015
Author: landauf
Date: 2015-05-30 10:18:07 +0200 (Sat, 30 May 2015)
New Revision: 10508
Modified:
code/branches/core7/src/libraries/core/GraphicsManager.cc
code/branches/core7/src/libraries/core/Loader.cc
code/branches/core7/src/libraries/core/Loader.h
code/branches/core7/src/orxonox/Level.cc
code/branches/core7/src/orxonox/gamestates/GSLevel.cc
Log:
removed unused code from Loader
Modified: code/branches/core7/src/libraries/core/GraphicsManager.cc
===================================================================
--- code/branches/core7/src/libraries/core/GraphicsManager.cc 2015-05-28 09:39:26 UTC (rev 10507)
+++ code/branches/core7/src/libraries/core/GraphicsManager.cc 2015-05-30 08:18:07 UTC (rev 10508)
@@ -116,7 +116,7 @@
// Load resources
resources_.reset(new XMLFile("DefaultResources.oxr"));
resources_->setLuaSupport(false);
- Loader::getInstance().open(resources_.get(), ClassTreeMask(), false);
+ Loader::getInstance().load(resources_.get(), ClassTreeMask(), false);
// Only for runs in the build directory (not installed)
if (PathConfig::buildDirectoryRun())
@@ -124,7 +124,7 @@
extResources_.reset(new XMLFile("resources.oxr"));
extResources_->setLuaSupport(false);
- Loader::getInstance().open(extResources_.get(), ClassTreeMask(), false);
+ Loader::getInstance().load(extResources_.get(), ClassTreeMask(), false);
if (bLoadRenderer)
{
@@ -329,7 +329,7 @@
// Load debug overlay to show info about fps and tick time
orxout(internal_info) << "Loading Debug Overlay..." << endl;
debugOverlay_.reset(new XMLFile("debug.oxo"));
- Loader::getInstance().open(debugOverlay_.get(), ClassTreeMask(), false);
+ Loader::getInstance().load(debugOverlay_.get(), ClassTreeMask(), false);
}
/**
Modified: code/branches/core7/src/libraries/core/Loader.cc
===================================================================
--- code/branches/core7/src/libraries/core/Loader.cc 2015-05-28 09:39:26 UTC (rev 10507)
+++ code/branches/core7/src/libraries/core/Loader.cc 2015-05-30 08:18:07 UTC (rev 10508)
@@ -49,94 +49,8 @@
{
Loader* Loader::singletonPtr_s = 0;
- bool Loader::open(const XMLFile* file, const ClassTreeMask& mask, bool bVerbose)
- {
- this->add(file, mask);
- return this->load(file, mask, bVerbose);
- }
-
- void Loader::close()
- {
- this->unload();
- this->files_.clear();
- }
-
- void Loader::close(const XMLFile* file)
- {
- this->unload(file);
- this->remove(file);
- }
-
- void Loader::add(const XMLFile* file, const ClassTreeMask& mask)
- {
- if (!file)
- return;
- this->files_.insert(this->files_.end(), std::pair<const XMLFile*, ClassTreeMask>(file, mask));
- }
-
- void Loader::remove(const XMLFile* file)
- {
- if (!file)
- return;
- for (std::vector<std::pair<const XMLFile*, ClassTreeMask> >::iterator it = this->files_.begin(); it != this->files_.end(); ++it)
- {
- if (it->first == file)
- {
- this->files_.erase(it);
- break;
- }
- }
- }
-
/**
@brief
- Loads all opened files, while conforming to the restrictions given by the input ClassTreeMask.
- @param mask
- A ClassTreeMask, which defines which types of classes are loaded and which aren't.
- @param bVerbose
- Whether the loader is verbose (prints its progress in a low output level) or not.
- @return
- Returns true if successful.
- */
- bool Loader::load(const ClassTreeMask& mask, bool bVerbose)
- {
- bool success = true;
- for (std::vector<std::pair<const XMLFile*, ClassTreeMask> >::iterator it = this->files_.begin(); it != this->files_.end(); ++it)
- if (!this->load(it->first, it->second * mask, bVerbose))
- success = false;
-
- return success;
- }
-
- void Loader::unload(const ClassTreeMask& mask)
- {
- for (ObjectList<BaseObject>::iterator it = ObjectList<BaseObject>::begin(); it != ObjectList<BaseObject>::end(); )
- {
- if (mask.isIncluded(it->getIdentifier()))
- (it++)->destroy();
- else
- ++it;
- }
- }
-
- /**
- @brief
- Reloads all opened files, while conforming to the restrictions given by the input ClassTreeMask.
- @param mask
- A ClassTreeMask, which defines which types of classes are reloaded and which aren't.
- @param bVerbose
- Whether the loader is verbose (prints its progress in a low output level) or not.
- @return
- Returns true if successful.
- */
- bool Loader::reload(const ClassTreeMask& mask, bool bVerbose)
- {
- this->unload(mask);
- return this->load(mask, bVerbose);
- }
-
- /**
- @brief
Loads the input file, while conforming to the restrictions given by the input ClassTreeMask.
@param file
The file to be loaded.
@@ -303,24 +217,6 @@
}
}
- /**
- @brief
- Reloads the input file, while conforming to the restrictions given by the input ClassTreeMask.
- @param file
- The file to be reloaded.
- @param mask
- A ClassTreeMask, which defines which types of classes are reloaded and which aren't.
- @param bVerbose
- Whether the loader is verbose (prints its progress in a low output level) or not.
- @return
- Returns true if successful.
- */
- bool Loader::reload(const XMLFile* file, const ClassTreeMask& mask, bool bVerbose)
- {
- this->unload(file, mask);
- return this->load(file, mask, bVerbose);
- }
-
bool Loader::getLuaTags(const std::string& text, std::map<size_t, bool>& luaTags)
{
// fill map with all Lua tags
Modified: code/branches/core7/src/libraries/core/Loader.h
===================================================================
--- code/branches/core7/src/libraries/core/Loader.h 2015-05-28 09:39:26 UTC (rev 10507)
+++ code/branches/core7/src/libraries/core/Loader.h 2015-05-30 08:18:07 UTC (rev 10508)
@@ -54,21 +54,9 @@
friend class Singleton<Loader>;
public:
- bool open(const XMLFile* file, const ClassTreeMask& mask = ClassTreeMask(), bool bVerbose = true);
- void close();
- void close(const XMLFile* file);
-
- void add(const XMLFile* file, const ClassTreeMask& mask = ClassTreeMask());
- void remove(const XMLFile* file);
-
- bool load(const ClassTreeMask& mask = ClassTreeMask(), bool bVerbose = true);
- void unload(const ClassTreeMask& mask = ClassTreeMask());
- bool reload(const ClassTreeMask& mask = ClassTreeMask(), bool bVerbose = true);
-
bool load(const XMLFile* file, const ClassTreeMask& mask = ClassTreeMask(),
bool bVerbose = true, bool bRemoveLuaTags = false);
void unload(const XMLFile* file, const ClassTreeMask& mask = ClassTreeMask());
- bool reload(const XMLFile* file, const ClassTreeMask& mask = ClassTreeMask(), bool bVerbose = true);
static std::string replaceLuaTags(const std::string& text);
static std::string removeLuaTags(const std::string& text);
Modified: code/branches/core7/src/orxonox/Level.cc
===================================================================
--- code/branches/core7/src/orxonox/Level.cc 2015-05-28 09:39:26 UTC (rev 10507)
+++ code/branches/core7/src/orxonox/Level.cc 2015-05-30 08:18:07 UTC (rev 10508)
@@ -94,7 +94,7 @@
this->xmlfile_ = new XMLFile(mask, this->xmlfilename_);
- Loader::getInstance().open(this->xmlfile_);
+ Loader::getInstance().load(this->xmlfile_);
}
void Level::networkCallbackTemplatesChanged()
Modified: code/branches/core7/src/orxonox/gamestates/GSLevel.cc
===================================================================
--- code/branches/core7/src/orxonox/gamestates/GSLevel.cc 2015-05-28 09:39:26 UTC (rev 10507)
+++ code/branches/core7/src/orxonox/gamestates/GSLevel.cc 2015-05-30 08:18:07 UTC (rev 10508)
@@ -167,7 +167,7 @@
// call the loader
startFile_ = new XMLFile(LevelManager::getInstance().getDefaultLevel());
- bool loaded = Loader::getInstance().open(startFile_);
+ bool loaded = Loader::getInstance().load(startFile_);
Core::getInstance().getConfig()->updateLastLevelTimestamp();
if(!loaded)
More information about the Orxonox-commit
mailing list