Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 1824 for code/trunk


Ignore:
Timestamp:
Sep 22, 2008, 9:45:37 PM (16 years ago)
Author:
rgrieder
Message:

Added some more Ogre shutdown code. Does not yet work properly if you wish to reload GSGraphics.

Location:
code/trunk/src
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • code/trunk/src/core/RootGameState.cc

    r1802 r1824  
    132132    void RootGameState::start(int argc, char** argv)
    133133    {
     134#ifdef NDEBUG
    134135        try
    135136        {
     137#endif
    136138            // start global orxonox time
    137139            Clock clock;
     
    160162
    161163            this->deactivate();
     164#ifdef NDEBUG
    162165        }
    163166        // Note: These are all unhandled exceptions that should not have made its way here!
     
    175178            abort();
    176179        }
     180#endif
    177181    }
    178182
  • code/trunk/src/orxonox/gamestates/GSGraphics.cc

    r1820 r1824  
    137137    void GSGraphics::leave()
    138138    {
     139        using namespace Ogre;
     140
    139141        delete this->guiManager_;
    140142
     
    145147        delete this->inputManager_;
    146148
    147         this->ogreRoot_->detachRenderTarget(this->renderWindow_);
    148         delete this->renderWindow_;
    149         //this->ogreRoot_->shutdown
    150         // TODO: destroy render window
     149        // destroy render window
     150        this->renderWindow_->removeAllViewports();
     151        this->renderWindow_->removeAllListeners();
     152        RenderSystem* renderer = this->ogreRoot_->getRenderSystem();
     153        renderer->destroyRenderWindow("Orxonox");
     154
     155        // Does the opposite of initialise()
     156        ogreRoot_->shutdown();
     157
     158        // Remove all resources and resource groups
     159        StringVector groups = ResourceGroupManager::getSingleton().getResourceGroups();
     160        for (StringVector::iterator it = groups.begin(); it != groups.end(); ++it)
     161        {
     162            ResourceGroupManager::getSingleton().destroyResourceGroup(*it);
     163        }
     164
     165        ParticleSystemManager::getSingleton().removeAllTemplates();
     166
     167        // Shutdown the render system
     168        this->ogreRoot_->setRenderSystem(0);
    151169
    152170        Settings::_getInstance().bShowsGraphics_ = false;
     
    277295        CCOUT(4) << "Creating render window" << std::endl;
    278296
    279         this->renderWindow_ = ogreRoot_->initialise(true, "OrxonoxV2");
     297        this->renderWindow_ = ogreRoot_->initialise(true, "Orxonox");
    280298
    281299        Ogre::WindowEventUtilities::addWindowEventListener(this->renderWindow_, this);
     
    291309        CCOUT(4) << "Initialising resources" << std::endl;
    292310        //TODO: Do NOT load all the groups, why are we doing that? And do we really do that? initialise != load...
    293         try
    294         {
     311        //try
     312        //{
    295313            Ogre::ResourceGroupManager::getSingleton().initialiseAllResourceGroups();
    296314            /*Ogre::StringVector str = Ogre::ResourceGroupManager::getSingleton().getResourceGroups();
     
    299317            Ogre::ResourceGroupManager::getSingleton().loadResourceGroup(str[i]);
    300318            }*/
    301         }
    302         catch (...)
    303         {
    304             CCOUT(2) << "Error: There was a serious error when initialising the resources." << std::endl;
    305             throw;
    306         }
     319        //}
     320        //catch (...)
     321        //{
     322        //    CCOUT(2) << "Error: There was a serious error when initialising the resources." << std::endl;
     323        //    throw;
     324        //}
    307325    }
    308326
  • code/trunk/src/orxonox/objects/Projectile.cc

    r1822 r1824  
    5454        this->smokeTemplateName_ = "Orxonox/smoke4";
    5555
    56         this->setStatic(false);
    57         this->translate(Vector3(55, 0, 0), Ogre::Node::TS_LOCAL);
     56        this->setStatic(false);
     57        this->translate(Vector3(55, 0, 0), Ogre::Node::TS_LOCAL);
    5858
    5959        if (this->owner_)
Note: See TracChangeset for help on using the changeset viewer.