MCPcopy Create free account
hub / github.com/DescentDevelopers/Descent3 / ForceEffectsPlay

Function ForceEffectsPlay

Descent3/D3ForceFeedback.cpp:362–386  ·  view source on GitHub ↗

----------------------------------------------------------------- ForceEffectsPlay Purpose: Plays an effect -----------------------------------------------------------------

Source from the content-addressed store, hash-verified

360// Plays an effect
361// -----------------------------------------------------------------
362void 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}
387void ForceEffectsPlay(int id, float *scale, vector *direction) {
388 if (!D3Force_init || !D3Use_force_feedback)
389 return;

Callers 5

phys_apply_forceFunction · 0.85
DoForceForWeaponFunction · 0.85
DoForceForWallFunction · 0.85
DoForceForRecoilFunction · 0.85
DoForceForShakeFunction · 0.85

Calls 4

ddio_ffb_effectModifyFunction · 0.85
ddio_ffb_effectPlayFunction · 0.85
vm_VectorToMatrixFunction · 0.50

Tested by

no test coverage detected