[Orxonox-commit 3394] r8081 - in code/branches/kicklib/src: libraries/core libraries/tools modules/designtools
rgrieder at orxonox.net
rgrieder at orxonox.net
Thu Mar 17 02:28:24 CET 2011
Author: rgrieder
Date: 2011-03-17 02:28:23 +0100 (Thu, 17 Mar 2011)
New Revision: 8081
Modified:
code/branches/kicklib/src/libraries/core/Resource.cc
code/branches/kicklib/src/libraries/core/Resource.h
code/branches/kicklib/src/libraries/tools/ResourceCollection.cc
code/branches/kicklib/src/modules/designtools/ScreenshotManager.cc
Log:
Fixed serious static initialisation problem. And I thought we caught them all...
Also replaced remaining references to Ogre::ResourceGroupManager::DEFAULT_RESOURCE_GROUP with our own code.
Modified: code/branches/kicklib/src/libraries/core/Resource.cc
===================================================================
--- code/branches/kicklib/src/libraries/core/Resource.cc 2011-03-16 04:28:30 UTC (rev 8080)
+++ code/branches/kicklib/src/libraries/core/Resource.cc 2011-03-17 01:28:23 UTC (rev 8081)
@@ -35,12 +35,15 @@
namespace orxonox
{
- std::string Resource::DEFAULT_GROUP(Ogre::ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME);
+ const std::string& Resource::getDefaultResourceGroup()
+ {
+ return Ogre::ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME;
+ }
DataStreamPtr Resource::open(const std::string& name)
{
return Ogre::ResourceGroupManager::getSingleton().openResource(name,
- Ogre::ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME, true);
+ getDefaultResourceGroup(), true);
}
DataStreamListPtr Resource::openMulti(const std::string& pattern)
Modified: code/branches/kicklib/src/libraries/core/Resource.h
===================================================================
--- code/branches/kicklib/src/libraries/core/Resource.h 2011-03-16 04:28:30 UTC (rev 8080)
+++ code/branches/kicklib/src/libraries/core/Resource.h 2011-03-17 01:28:23 UTC (rev 8081)
@@ -136,7 +136,7 @@
static StringVectorPtr findResourceNames(const std::string& pattern);
//! Name of the default resource group (usually "General")
- static std::string DEFAULT_GROUP;
+ static const std::string& getDefaultResourceGroup();
private:
Resource();
Modified: code/branches/kicklib/src/libraries/tools/ResourceCollection.cc
===================================================================
--- code/branches/kicklib/src/libraries/tools/ResourceCollection.cc 2011-03-16 04:28:30 UTC (rev 8080)
+++ code/branches/kicklib/src/libraries/tools/ResourceCollection.cc 2011-03-17 01:28:23 UTC (rev 8081)
@@ -44,7 +44,7 @@
RegisterObject(ResourceCollection);
// Default group is "General"
- this->setResourceGroup(Resource::DEFAULT_GROUP);
+ this->setResourceGroup(Resource::getDefaultResourceGroup());
}
ResourceCollection::~ResourceCollection()
Modified: code/branches/kicklib/src/modules/designtools/ScreenshotManager.cc
===================================================================
--- code/branches/kicklib/src/modules/designtools/ScreenshotManager.cc 2011-03-16 04:28:30 UTC (rev 8080)
+++ code/branches/kicklib/src/modules/designtools/ScreenshotManager.cc 2011-03-17 01:28:23 UTC (rev 8081)
@@ -11,6 +11,7 @@
#include "util/ScopedSingletonManager.h"
#include "core/GraphicsManager.h"
#include "core/PathConfig.h"
+#include "core/Resource.h"
#include "core/command/ConsoleCommand.h"
#include "CameraManager.h"
@@ -39,8 +40,8 @@
mWindowHeight = pRenderWindow->getHeight();
//create temporary texture
mTempTex = Ogre::TextureManager::getSingleton().createManual("ScreenShotTex",
- Ogre::ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME, Ogre::TEX_TYPE_2D,
- mWindowWidth, mWindowHeight,0, Ogre::PF_B8G8R8, Ogre::TU_RENDERTARGET);
+ Resource::getDefaultResourceGroup(), Ogre::TEX_TYPE_2D,
+ mWindowWidth, mWindowHeight,0, Ogre::PF_B8G8R8, Ogre::TU_RENDERTARGET);
//get The current Render Target of the temp Texture
mRT = mTempTex->getBuffer()->getRenderTarget();
More information about the Orxonox-commit
mailing list