| 636 | } |
| 637 | |
| 638 | void FeedbackXBOBT::EffectProc( void *params ) |
| 639 | { |
| 640 | FeedbackXBOBT *cThis = (FeedbackXBOBT *)params; |
| 641 | |
| 642 | LONG LeftLevel = 0; |
| 643 | LONG RightLevel = 0; |
| 644 | LONG ltLevel = 0; |
| 645 | LONG rtLevel = 0; |
| 646 | LONG Gain = cThis->Gain; |
| 647 | LONG CalcResult = 0; |
| 648 | |
| 649 | if (cThis->Actuator == true) |
| 650 | { |
| 651 | for (FeedbackXBOEffectIterator effectIterator = cThis->EffectList.begin(); effectIterator != cThis->EffectList.end(); ++effectIterator) |
| 652 | { |
| 653 | if(((CurrentTimeUsingMach() - cThis->LastTime)*1000*1000) >= effectIterator->DiEffect.dwSamplePeriod) { |
| 654 | CalcResult = effectIterator->Calc(&LeftLevel, &RightLevel, <Level, &rtLevel); |
| 655 | } |
| 656 | } |
| 657 | } |
| 658 | |
| 659 | if ((cThis->PrvLeftLevel != LeftLevel || cThis->PrvRightLevel != RightLevel) && (CalcResult != -1)) |
| 660 | { |
| 661 | //fprintf(stderr, "PL: %d, PR: %d; L: %d, R: %d; \n", cThis->PrvLeftLevel, cThis->PrvRightLevel, LeftLevel, RightLevel); |
| 662 | cThis->SetForce((unsigned char)min(SCALE_MAX, LeftLevel * Gain / 10000),(unsigned char)min(SCALE_MAX, RightLevel * Gain / 10000 ), (unsigned char)min(SCALE_MAX, ltLevel * Gain / 10000), (unsigned char)min(SCALE_MAX, rtLevel * Gain / 10000)); |
| 663 | |
| 664 | cThis->PrvLeftLevel = LeftLevel; |
| 665 | cThis->PrvRightLevel = RightLevel; |
| 666 | } |
| 667 | } |
| 668 | |
| 669 | HRESULT FeedbackXBOBT::GetEffectStatus(FFEffectDownloadID EffectHandle, FFEffectStatusFlag *Status) |
| 670 | { |
nothing calls this directly
no test coverage detected