Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Aug 22, 2009, 11:16:34 PM (15 years ago)
Author:
rgrieder
Message:

Updated OIS library (still 1.2, but CVS version).
There have been some little fixes and support for force feedback on Linux (but this doesn't concern us for now…)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/resource2/src/ois/OISForceFeedback.cpp

    r1505 r5668  
    2727
    2828//-------------------------------------------------------------//
    29 void ForceFeedback::_addEffectTypes( Effect::EForce force, Effect::EType type )
     29ForceFeedback::ForceFeedback() : mSetGainSupport(false), mSetAutoCenterSupport(false)
    3030{
    31         if( force == Effect::UnknownForce || type == Effect::Unknown )
    32                 OIS_EXCEPT( E_General, "Unknown Force||Type was added too effect list..." );
    33 
    34         mSupportedEffects[force] = type;
    3531}
    3632
    3733//-------------------------------------------------------------//
    38 const ForceFeedback::SupportedEffectList&
    39                                                 ForceFeedback::getSupportedEffects() const
     34void ForceFeedback::_addEffectTypes( Effect::EForce force, Effect::EType type )
     35{
     36        if( force <= Effect::UnknownForce || force >= Effect::_ForcesNumber
     37                || type <= Effect::Unknown || type >= Effect::_TypesNumber )
     38                OIS_EXCEPT( E_General, "Can't add unknown effect Force/Type to the supported list" );
     39
     40        mSupportedEffects.insert(std::pair<Effect::EForce, Effect::EType>(force, type));
     41}
     42
     43//-------------------------------------------------------------//
     44void ForceFeedback::_setGainSupport( bool on )
     45{
     46        mSetGainSupport = on;
     47}
     48
     49//-------------------------------------------------------------//
     50void ForceFeedback::_setAutoCenterSupport( bool on )
     51{
     52        mSetAutoCenterSupport = on;
     53}
     54
     55//-------------------------------------------------------------//
     56const ForceFeedback::SupportedEffectList& ForceFeedback::getSupportedEffects() const
    4057{
    4158        return mSupportedEffects;
    4259}
     60
     61//-------------------------------------------------------------//
     62bool ForceFeedback::supportsEffect(Effect::EForce force, Effect::EType type) const
     63{
     64    const std::pair<SupportedEffectList::const_iterator, SupportedEffectList::const_iterator>
     65            iterRange = mSupportedEffects.equal_range(force);
     66        SupportedEffectList::const_iterator iter;
     67        for (iter = iterRange.first; iter != iterRange.second; iter++)
     68        {
     69          if ((*iter).second == type)
     70                return true;
     71        }
     72
     73        return false;
     74}
Note: See TracChangeset for help on using the changeset viewer.