Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 6373 for code/branches


Ignore:
Timestamp:
Dec 17, 2009, 11:27:00 PM (15 years ago)
Author:
rgrieder
Message:

Added config value to disable sound entirely.
Also added InitialisationAbortedException to be used by singletons in order not to be constructed, but nicely telling the user (only for those singletons who are allowed to fail!).

Location:
code/branches/presentation2/src
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • code/branches/presentation2/src/libraries/core/ScopedSingletonManager.h

    r6183 r6373  
    162162            try
    163163                { singletonPtr_ = new T(); }
     164            catch (const InitialisationAbortedException& ex)
     165                { COUT(3) << ex.getDescription() << std::endl; }
    164166            catch (...)
    165167                { COUT(1) << "Singleton creation failed: " << Exception::handleMessage() << std::endl; }
  • code/branches/presentation2/src/libraries/util/Exception.h

    r5747 r6373  
    131131    CREATE_ORXONOX_EXCEPTION(PluginsNotFound);
    132132    CREATE_ORXONOX_EXCEPTION(InitialisationFailed);
     133    CREATE_ORXONOX_EXCEPTION(InitialisationAborted);
    133134    CREATE_ORXONOX_EXCEPTION(NotImplemented);
    134135    CREATE_ORXONOX_EXCEPTION(GameState);
  • code/branches/presentation2/src/orxonox/sound/SoundManager.cc

    r6370 r6373  
    6969    {
    7070        RegisterRootObject(SoundManager);
     71
     72        // See whether we even want to load
     73        bool bDisableSound_ = false;
     74        SetConfigValue(bDisableSound_, false);
     75        if (bDisableSound_)
     76            ThrowException(InitialisationAborted, "Sound: Not loading at all");
    7177
    7278        if (!alutInitWithoutContext(NULL, NULL))
Note: See TracChangeset for help on using the changeset viewer.