Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 5868


Ignore:
Timestamp:
Oct 4, 2009, 12:03:14 AM (15 years ago)
Author:
rgrieder
Message:

Fixed a possible issue in Game and a build system bug with PCH.

Location:
code/branches/core5
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • code/branches/core5/cmake/PrecompiledHeaderFiles.cmake

    r3251 r5868  
    110110    GET_GCC_COMPILER_FLAGS(${_target_name} _pch_gcc_flags)
    111111    # Make sure we recompile the pch file even if only the flags change
    112     IF(NOT "${_pch_gcc_flags}" STREQUAL "${_INTERNAL_${_target_name}_PCH_GCC_FLAGS}")
     112    IF(NOT "${_pch_gcc_flags}" STREQUAL "${_INTERNAL_${_target_name}_PCH_GCC_FLAGS}" OR NOT EXISTS "${_pch_dep_helper_file}")
    113113      SET(_INTERNAL_${_target_name}_PCH_GCC_FLAGS "${_pch_gcc_flags}" CACHE INTERNAL "")
    114114      FILE(WRITE ${_pch_dep_helper_file} "/* ${_pch_gcc_flags} */")
  • code/branches/core5/src/libraries/core/Game.cc

    r5855 r5868  
    117117    Game::Game(const std::string& cmdLine)
    118118        // Destroy factories before the Core!
    119         : gsFactoryDestroyer_(Game::GameStateFactory::factories_s, &std::map<std::string, shared_ptr<GameStateFactory> >::clear)
     119        : gsFactoryDestroyer_(Game::GameStateFactory::getFactories(), &std::map<std::string, shared_ptr<GameStateFactory> >::clear)
    120120    {
    121121        this->bAbort_ = false;
     
    624624    }
    625625
    626     std::map<std::string, shared_ptr<Game::GameStateFactory> > Game::GameStateFactory::factories_s;
     626    /*static*/ std::map<std::string, shared_ptr<Game::GameStateFactory> >& Game::GameStateFactory::getFactories()
     627    {
     628        static std::map<std::string, shared_ptr<GameStateFactory> > factories;
     629        return factories;
     630    }
    627631
    628632    /*static*/ shared_ptr<GameState> Game::GameStateFactory::fabricate(const GameStateInfo& info)
    629633    {
    630         std::map<std::string, shared_ptr<Game::GameStateFactory> >::const_iterator it = factories_s.find(info.className);
    631         assert(it != factories_s.end());
     634        std::map<std::string, shared_ptr<Game::GameStateFactory> >::const_iterator it = getFactories().find(info.className);
     635        assert(it != getFactories().end());
    632636        return it->second->fabricateInternal(info);
    633637    }
  • code/branches/core5/src/libraries/core/Game.h

    r5843 r5868  
    117117            template <class T>
    118118            static void createFactory(const std::string& className)
    119                 { factories_s[className].reset(new TemplateGameStateFactory<T>()); }
     119                { getFactories()[className].reset(new TemplateGameStateFactory<T>()); }
    120120
    121121            virtual shared_ptr<GameState> fabricateInternal(const GameStateInfo& info) = 0;
    122             static std::map<std::string, shared_ptr<GameStateFactory> > factories_s;
     122            static std::map<std::string, shared_ptr<GameStateFactory> >& getFactories();
    123123        };
    124124        template <class T>
Note: See TracChangeset for help on using the changeset viewer.