Input Mapping suport for Gamepad Axis (multiply SourceCallback)

Apply the ControlValue as a multiplyer to the Callback. UI with indication bars for gamepad axis.
This commit is contained in:
Bruno Herbelin
2022-02-07 13:27:05 +01:00
parent 886305ec13
commit 6cf86d80e2
7 changed files with 157 additions and 6 deletions

View File

@@ -746,6 +746,8 @@ void Source::updateCallbacks(float dt)
delete k->second.reverse_;
// generate a new callback from the model
SourceCallback *C = k->second.model_->clone();
// apply value multiplyer from input
C->multiply( Control::inputValue(k->first) );
// add callback to the source (force override)
call( C, true );
// get the reverse if the callback, and remember it (can be null)