Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Oct 4, 2009, 11:05:17 PM (15 years ago)
Author:
rgrieder
Message:

Fixed an issue that could occur when singletons associated with ScopeID::Graphics (indirectly) asked for GameMode::showsGraphics.

Location:
code/branches/core5/src/libraries/core
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • code/branches/core5/src/libraries/core/Core.cc

    r5869 r5875  
    293293            inputManager_->getMousePosition(), graphicsManager_->isFullScreen()));
    294294
     295        bGraphicsLoaded_ = true;
     296        GameMode::bShowsGraphics_s = true;
     297
    295298        // Create singletons associated with graphics (in other libraries)
    296299        graphicsScope_.reset(new Scope<ScopeID::Graphics>());
    297300
    298301        unloader.Dismiss();
    299 
    300         bGraphicsLoaded_ = true;
    301302    }
    302303
     
    320321
    321322        bGraphicsLoaded_ = false;
     323        GameMode::bShowsGraphics_s = false;
    322324    }
    323325
  • code/branches/core5/src/libraries/core/Game.cc

    r5868 r5875  
    523523    void Game::loadGraphics()
    524524    {
    525         if (!GameMode::bShowsGraphics_s)
     525        if (!GameMode::showsGraphics())
    526526        {
    527527            core_->loadGraphics();
    528528            Loki::ScopeGuard graphicsUnloader = Loki::MakeObjGuard(*this, &Game::unloadGraphics);
    529             GameMode::bShowsGraphics_s = true;
    530529
    531530            // Construct all the GameStates that require graphics
     
    548547    void Game::unloadGraphics()
    549548    {
    550         if (GameMode::bShowsGraphics_s)
     549        if (GameMode::showsGraphics())
    551550        {
    552551            // Destroy all the GameStates that require graphics
     
    560559
    561560            core_->unloadGraphics();
    562             GameMode::bShowsGraphics_s = false;
    563561        }
    564562    }
  • code/branches/core5/src/libraries/core/GameMode.h

    r5738 r5875  
    4141    class _CoreExport GameMode
    4242    {
    43         friend class Game;
     43        friend class Core;
    4444
    4545        public:
Note: See TracChangeset for help on using the changeset viewer.