----------------------------------------------------------------- ForceEffectsPlay Purpose: Plays an effect -----------------------------------------------------------------
| 360 | // Plays an effect |
| 361 | // ----------------------------------------------------------------- |
| 362 | void ForceEffectsPlay(int id, float *scale, int *direction) { |
| 363 | if (!D3Force_init || !D3Use_force_feedback) |
| 364 | return; |
| 365 | |
| 366 | if (id < 0 || id >= DDIO_FF_MAXEFFECTS) |
| 367 | return; |
| 368 | |
| 369 | int low_id = Force_hi_to_low_map[id]; |
| 370 | if (low_id == -1) |
| 371 | return; |
| 372 | |
| 373 | if (scale || direction) { |
| 374 | uint32_t *ns = NULL; |
| 375 | uint32_t new_gain; |
| 376 | |
| 377 | if (scale) { |
| 378 | new_gain = (uint32_t)(10000.0f * (*scale)); |
| 379 | ns = &new_gain; |
| 380 | } |
| 381 | |
| 382 | ddio_ffb_effectModify(low_id, direction, NULL, ns, NULL, NULL, NULL); |
| 383 | } |
| 384 | |
| 385 | ddio_ffb_effectPlay(low_id); |
| 386 | } |
| 387 | void ForceEffectsPlay(int id, float *scale, vector *direction) { |
| 388 | if (!D3Force_init || !D3Use_force_feedback) |
| 389 | return; |
no test coverage detected