Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Oct 4, 2015, 9:12:21 PM (9 years ago)
Author:
landauf
Message:

merged branch core7 back to trunk

Location:
code/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • code/trunk

  • code/trunk/src/libraries/core/GraphicsManager.cc

    r10295 r10624  
    5959#include "GUIManager.h"
    6060#include "Loader.h"
    61 #include "PathConfig.h"
     61#include "ApplicationPaths.h"
     62#include "ConfigurablePaths.h"
    6263#include "ViewportEventListener.h"
    6364#include "WindowEventListener.h"
    6465#include "XMLFile.h"
    65 #include "command/ConsoleCommand.h"
     66#include "command/ConsoleCommandIncludes.h"
    6667#include "input/InputManager.h"
    6768
     
    9495    GraphicsManager* GraphicsManager::singletonPtr_s = 0;
    9596
     97    RegisterAbstractClass(GraphicsManager).inheritsFrom<Configurable>();
     98
    9699    GraphicsManager::GraphicsManager(bool bLoadRenderer)
    97100        : ogreWindowEventListener_(new OgreWindowEventListener())
     
    111114
    112115        // At first, add the root paths of the data directories as resource locations
    113         Ogre::ResourceGroupManager::getSingleton().addResourceLocation(PathConfig::getDataPathString(), "FileSystem");
     116        Ogre::ResourceGroupManager::getSingleton().addResourceLocation(ConfigurablePaths::getDataPathString(), "FileSystem");
    114117        // Load resources
    115118        resources_.reset(new XMLFile("DefaultResources.oxr"));
    116119        resources_->setLuaSupport(false);
    117         Loader::open(resources_.get(), ClassTreeMask(), false);
     120        Loader::getInstance().load(resources_.get(), ClassTreeMask(), false);
    118121
    119122        // Only for runs in the build directory (not installed)
    120         if (PathConfig::buildDirectoryRun())
    121             Ogre::ResourceGroupManager::getSingleton().addResourceLocation(PathConfig::getExternalDataPathString(), "FileSystem");
     123        if (ApplicationPaths::buildDirectoryRun())
     124            Ogre::ResourceGroupManager::getSingleton().addResourceLocation(ConfigurablePaths::getExternalDataPathString(), "FileSystem");
    122125
    123126        extResources_.reset(new XMLFile("resources.oxr"));
    124127        extResources_->setLuaSupport(false);
    125         Loader::open(extResources_.get(), ClassTreeMask(), false);
     128        Loader::getInstance().load(extResources_.get(), ClassTreeMask(), false);
    126129
    127130        if (bLoadRenderer)
     
    137140    {
    138141        orxout(internal_status) << "destroying GraphicsManager..." << endl;
    139 
    140         Loader::unload(debugOverlay_.get());
    141142
    142143        Ogre::WindowEventUtilities::removeWindowEventListener(renderWindow_, ogreWindowEventListener_);
     
    147148
    148149        // Undeclare the resources
    149         Loader::unload(resources_.get());
    150         Loader::unload(extResources_.get());
     150        Loader::getInstance().unload(resources_.get());
     151        Loader::getInstance().unload(extResources_.get());
    151152
    152153        safeObjectDelete(&ogreRoot_);
     
    218219        }
    219220
    220         boost::filesystem::path ogreConfigFilepath(PathConfig::getConfigPath() / this->ogreConfigFile_);
    221         boost::filesystem::path ogreLogFilepath(PathConfig::getLogPath() / this->ogreLogFile_);
     221        boost::filesystem::path ogreConfigFilepath(ConfigurablePaths::getConfigPath() / this->ogreConfigFile_);
     222        boost::filesystem::path ogreLogFilepath(ConfigurablePaths::getLogPath() / this->ogreLogFile_);
    222223
    223224        // create a new logManager
     
    258259        std::string pluginPath = specialConfig::ogrePluginsDirectory;
    259260#ifdef DEPENDENCY_PACKAGE_ENABLE
    260         if (!PathConfig::buildDirectoryRun())
     261        if (!ApplicationPaths::buildDirectoryRun())
    261262        {
    262263#  if defined(ORXONOX_PLATFORM_WINDOWS)
    263             pluginPath = PathConfig::getExecutablePathString();
     264            pluginPath = ApplicationPaths::getExecutablePathString();
    264265#  elif defined(ORXONOX_PLATFORM_APPLE)
    265266            // TODO: Where are the plugins being installed to?
    266             pluginPath = PathConfig::getExecutablePathString();
     267            pluginPath = ApplicationPaths::getExecutablePathString();
    267268#  endif
    268269        }
     
    279280        orxout(internal_info) << "GraphicsManager: Configuring Renderer" << endl;
    280281
    281         bool updatedConfig = Core::getInstance().getOgreConfigTimestamp() > Core::getInstance().getLastLevelTimestamp();
     282        bool updatedConfig = Core::getInstance().getConfig()->getOgreConfigTimestamp() > Core::getInstance().getConfig()->getLastLevelTimestamp();
    282283        if (updatedConfig)
    283284            orxout(user_info)<< "Ogre config file has changed, but no level was started since then. Displaying config dialogue again to verify the changes." << endl;
     
    288289                ThrowException(InitialisationFailed, "OGRE graphics configuration dialogue canceled.");
    289290            else
    290                 Core::getInstance().updateOgreConfigTimestamp();
     291                Core::getInstance().getConfig()->updateOgreConfigTimestamp();
    291292        }
    292293
     
    328329        orxout(internal_info) << "Loading Debug Overlay..." << endl;
    329330        debugOverlay_.reset(new XMLFile("debug.oxo"));
    330         Loader::open(debugOverlay_.get(), ClassTreeMask(), false);
     331        Loader::getInstance().load(debugOverlay_.get(), ClassTreeMask(), false);
     332    }
     333
     334    void GraphicsManager::unloadDebugOverlay()
     335    {
     336        Loader::getInstance().unload(debugOverlay_.get());
    331337    }
    332338
     
    514520            GraphicsManager::getInstance().getRenderWindow()->setFullscreen(fullscreen, width, height);
    515521            this->ogreRoot_->saveConfig();
    516             Core::getInstance().updateOgreConfigTimestamp();
     522            Core::getInstance().getConfig()->updateOgreConfigTimestamp();
    517523            // Also reload the input devices
    518524            InputManager::getInstance().reload();
     
    532538            //this->ogreRoot_->getRenderSystem()->reinitialise(); // can't use this that easily, because it recreates the render window, invalidating renderWindow_
    533539            this->ogreRoot_->saveConfig();
    534             Core::getInstance().updateOgreConfigTimestamp();
     540            Core::getInstance().getConfig()->updateOgreConfigTimestamp();
    535541        }
    536542
     
    548554            //this->ogreRoot_->getRenderSystem()->reinitialise(); // can't use this that easily, because it recreates the render window, invalidating renderWindow_
    549555            this->ogreRoot_->saveConfig();
    550             Core::getInstance().updateOgreConfigTimestamp();
     556            Core::getInstance().getConfig()->updateOgreConfigTimestamp();
    551557        }
    552558
     
    557563    {
    558564        assert(this->renderWindow_);
    559         this->renderWindow_->writeContentsToTimestampedFile(PathConfig::getLogPathString() + "screenShot_", ".png");
     565        this->renderWindow_->writeContentsToTimestampedFile(ConfigurablePaths::getLogPathString() + "screenShot_", ".png");
    560566    }
    561567}
Note: See TracChangeset for help on using the changeset viewer.