MCPcopy Create free account
hub / github.com/BohemiaInteractive/CWR / QueryProfileAction

Function QueryProfileAction

engine/Poseidon/Input/InputSubsystem.cpp:406–446  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

404}
405
406static float QueryProfileAction(const Input& in, const InputProfile& profile, UserAction action, bool checkFocus)
407{
408 float sum = 0.0f;
409 for (const InputBinding& binding : profile.GetBindingEntries(action))
410 {
411 if (!ProfileModifierHeld(in, binding.modifier, checkFocus))
412 continue;
413 const float value = QueryProfileCode(in, binding.code, checkFocus) * binding.scale;
414 switch (action)
415 {
416 case UAMoveForward:
417 case UAMoveBack:
418 case UATurnLeft:
419 case UATurnRight:
420 case UAMoveUp:
421 case UAMoveDown:
422 case UAMoveFastForward:
423 case UAMoveSlowForward:
424 case UAMoveLeft:
425 case UAMoveRight:
426 case UALookLeftDown:
427 case UALookDown:
428 case UALookRightDown:
429 case UALookLeft:
430 case UALookRight:
431 case UALookLeftUp:
432 case UALookUp:
433 case UALookRightUp:
434 case UAAimUp:
435 case UAAimDown:
436 case UAAimLeft:
437 case UAAimRight:
438 sum += std::max(0.0f, value);
439 break;
440 default:
441 sum += value;
442 break;
443 }
444 }
445 return sum;
446}
447
448static bool QueryProfileActionToDo(Input& in, const InputProfile& profile, UserAction action, bool& actionDone,
449 bool reset, bool checkFocus)

Callers 1

GetActionMethod · 0.85

Calls 2

ProfileModifierHeldFunction · 0.85
QueryProfileCodeFunction · 0.85

Tested by

no test coverage detected