Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Dec 25, 2009, 10:23:58 PM (15 years ago)
Author:
rgrieder
Message:

Merged presentation2 branch back to trunk.
Major new features:

  • Actual GUI with settings, etc.
  • Improved space ship steering (human interaction)
  • Rocket fire and more particle effects
  • Advanced sound framework
Location:
code/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • code/trunk

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

    r6105 r6417  
    100100
    101101        // At first, add the root paths of the data directories as resource locations
    102         Ogre::ResourceGroupManager::getSingleton().addResourceLocation(PathConfig::getDataPathString(), "FileSystem", "dataRoot", false);
     102        Ogre::ResourceGroupManager::getSingleton().addResourceLocation(PathConfig::getDataPathString(), "FileSystem");
    103103        // Load resources
    104         resources_.reset(new XMLFile("resources.oxr", "dataRoot"));
     104        resources_.reset(new XMLFile("DefaultResources.oxr"));
    105105        resources_->setLuaSupport(false);
    106106        Loader::open(resources_.get());
     
    109109        if (PathConfig::isDevelopmentRun())
    110110        {
    111             Ogre::ResourceGroupManager::getSingleton().addResourceLocation(PathConfig::getExternalDataPathString(), "FileSystem", "externalDataRoot", false);
    112             extResources_.reset(new XMLFile("resources.oxr", "externalDataRoot"));
     111            Ogre::ResourceGroupManager::getSingleton().addResourceLocation(PathConfig::getExternalDataPathString(), "FileSystem");
     112            extResources_.reset(new XMLFile("resources.oxr"));
    113113            extResources_->setLuaSupport(false);
    114114            Loader::open(extResources_.get());
     
    208208                shared_array<char> data(new char[output.str().size()]);
    209209                // Debug optimisations
    210                 const std::string outputStr = output.str();
     210                const std::string& outputStr = output.str();
    211211                char* rawData = data.get();
    212212                for (unsigned i = 0; i < outputStr.size(); ++i)
     
    238238        COUT(3) << "Setting up Ogre..." << std::endl;
    239239
    240         if (ogreConfigFile_ == "")
     240        if (ogreConfigFile_.empty())
    241241        {
    242242            COUT(2) << "Warning: Ogre config file set to \"\". Defaulting to config.cfg" << std::endl;
    243243            ModifyConfigValue(ogreConfigFile_, tset, "config.cfg");
    244244        }
    245         if (ogreLogFile_ == "")
     245        if (ogreLogFile_.empty())
    246246        {
    247247            COUT(2) << "Warning: Ogre log file set to \"\". Defaulting to ogre.log" << std::endl;
     
    285285    {
    286286        // just to make sure the next statement doesn't segfault
    287         if (ogrePluginsDirectory_ == "")
    288             ogrePluginsDirectory_ = ".";
     287        if (ogrePluginsDirectory_.empty())
     288            ogrePluginsDirectory_ = '.';
    289289
    290290        boost::filesystem::path folder(ogrePluginsDirectory_);
     
    341341        need the time. So we shouldn't run into problems.
    342342    */
    343     void GraphicsManager::update(const Clock& time)
     343    void GraphicsManager::postUpdate(const Clock& time)
    344344    {
    345345        Ogre::FrameEvent evt;
     
    395395    {
    396396        int orxonoxLevel;
    397         switch (lml)
    398         {
    399         case Ogre::LML_TRIVIAL:
    400             orxonoxLevel = this->ogreLogLevelTrivial_;
    401             break;
    402         case Ogre::LML_NORMAL:
    403             orxonoxLevel = this->ogreLogLevelNormal_;
    404             break;
    405         case Ogre::LML_CRITICAL:
    406             orxonoxLevel = this->ogreLogLevelCritical_;
    407             break;
    408         default:
    409             orxonoxLevel = 0;
     397        std::string introduction;
     398        // Do not show caught OGRE exceptions in front
     399        if (message.find("EXCEPTION") != std::string::npos)
     400        {
     401            orxonoxLevel = OutputLevel::Debug;
     402            introduction = "Ogre, caught exception: ";
     403        }
     404        else
     405        {
     406            switch (lml)
     407            {
     408            case Ogre::LML_TRIVIAL:
     409                orxonoxLevel = this->ogreLogLevelTrivial_;
     410                break;
     411            case Ogre::LML_NORMAL:
     412                orxonoxLevel = this->ogreLogLevelNormal_;
     413                break;
     414            case Ogre::LML_CRITICAL:
     415                orxonoxLevel = this->ogreLogLevelCritical_;
     416                break;
     417            default:
     418                orxonoxLevel = 0;
     419            }
     420            introduction = "Ogre: ";
    410421        }
    411422        OutputHandler::getOutStream(orxonoxLevel)
    412             << "Ogre: " << message << std::endl;
     423            << introduction << message << std::endl;
    413424    }
    414425
     
    440451    {
    441452        assert(this->renderWindow_);
    442        
    443         this->renderWindow_->writeContentsToTimestampedFile(PathConfig::getLogPathString() + "screenShot_", ".jpg");
     453        this->renderWindow_->writeContentsToTimestampedFile(PathConfig::getLogPathString() + "screenShot_", ".png");
    444454    }
    445455}
Note: See TracChangeset for help on using the changeset viewer.