Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Aug 18, 2009, 11:14:25 AM (15 years ago)
Author:
rgrieder
Message:

Fixed two bugs:

  • Incomplete exception safety in Core::loadGraphics
  • When shutting down, Game would load the GraphicsManager again (due to the unloadGraphics call). Suppressed this for faster shutdown.

Resolved a little issue:

  • Finally figured out a way to handle exceptions caught with catch (…) generically and implemented this function in Game::getExceptionMessage()
  • Also removes the exception translation in the GUIManager and made Game catch CEGUI::Exception as well.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/resource2/src/core/GUIManager.cc

    r5654 r5658  
    109109        COUT(3) << "Initialising CEGUI." << std::endl;
    110110
    111         try
    112         {
    113             // Note: No SceneManager specified yet
    114             guiRenderer_.reset(new OgreCEGUIRenderer(renderWindow_, Ogre::RENDER_QUEUE_OVERLAY, false, 3000));
    115             resourceProvider_ = guiRenderer_->createResourceProvider();
    116             resourceProvider_->setDefaultResourceGroup("GUI");
    117 
    118             // setup scripting
    119             scriptModule_.reset(new LuaScriptModule());
    120             luaState_ = scriptModule_->getLuaState();
    121 
    122             // Create our own logger to specify the filepath
    123             std::auto_ptr<CEGUILogger> ceguiLogger(new CEGUILogger());
    124             ceguiLogger->setLogFilename(Core::getLogPathString() + "cegui.log");
    125             // set the log level according to ours (translate by subtracting 1)
    126             ceguiLogger->setLoggingLevel(
    127                 static_cast<LoggingLevel>(Core::getSoftDebugLevel(OutputHandler::LD_Logfile) - 1));
    128             this->ceguiLogger_ = ceguiLogger.release();
    129 
    130             // create the CEGUI system singleton
    131             guiSystem_.reset(new System(guiRenderer_.get(), resourceProvider_, 0, scriptModule_.get()));
    132 
    133             // do this after 'new CEGUI::Sytem' because that creates the lua state in the first place
    134             LuaState::openToluaInterfaces(this->luaState_);
    135 
    136             // initialise the basic lua code
    137             this->loadLuaCode();
    138         }
    139         catch (CEGUI::Exception& ex)
    140         {
    141 #if CEGUI_VERSION_MAJOR == 0 && CEGUI_VERSION_MINOR < 6
    142             throw GeneralException(ex.getMessage().c_str());
    143 #else
    144             throw GeneralException(ex.getMessage().c_str(), ex.getLine(),
    145                 ex.getFileName().c_str(), ex.getName().c_str());
    146 #endif
    147         }
     111        // Note: No SceneManager specified yet
     112        guiRenderer_.reset(new OgreCEGUIRenderer(renderWindow_, Ogre::RENDER_QUEUE_OVERLAY, false, 3000));
     113        resourceProvider_ = guiRenderer_->createResourceProvider();
     114        resourceProvider_->setDefaultResourceGroup("GUI");
     115
     116        // setup scripting
     117        scriptModule_.reset(new LuaScriptModule());
     118        luaState_ = scriptModule_->getLuaState();
     119
     120        // Create our own logger to specify the filepath
     121        std::auto_ptr<CEGUILogger> ceguiLogger(new CEGUILogger());
     122        ceguiLogger->setLogFilename(Core::getLogPathString() + "cegui.log");
     123        // set the log level according to ours (translate by subtracting 1)
     124        ceguiLogger->setLoggingLevel(
     125            static_cast<LoggingLevel>(Core::getSoftDebugLevel(OutputHandler::LD_Logfile) - 1));
     126        this->ceguiLogger_ = ceguiLogger.release();
     127
     128        // create the CEGUI system singleton
     129        guiSystem_.reset(new System(guiRenderer_.get(), resourceProvider_, 0, scriptModule_.get()));
     130
     131        // do this after 'new CEGUI::Sytem' because that creates the lua state in the first place
     132        LuaState::openToluaInterfaces(this->luaState_);
     133
     134        // initialise the basic lua code
     135        this->loadLuaCode();
    148136    }
    149137
Note: See TracChangeset for help on using the changeset viewer.