//--------------------------------------------------------------// Win32ForceFeedback::~Win32ForceFeedback() { //Get the effect - if it exists for(EffectList::iterator i = mEffectList.begin(); i != mEffectList.end(); ++i ) { LPDIRECTINPUTEFFECT dxEffect = i->second; if( dxEffect ) dxEffect->Unload(); } mEffectList.clear(); }
//--------------------------------------------------------------// void Win32ForceFeedback::remove( const Effect* eff ) { //Get the effect - if it exists EffectList::iterator i = mEffectList.find(eff->_handle); if( i != mEffectList.end() ) { LPDIRECTINPUTEFFECT dxEffect = i->second; if( dxEffect ) { dxEffect->Stop(); //We care about the return value - as the effect might not //have been unlaoded if( SUCCEEDED(dxEffect->Unload()) ) mEffectList.erase(i); } else mEffectList.erase(i); } }