MCPcopy Create free account
hub / github.com/TombEngine/TombEngine / SetDiscreteAxisValues

Function SetDiscreteAxisValues

TombEngine/Specific/Input/Input.cpp:279–301  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

277 }
278
279 static void SetDiscreteAxisValues(unsigned int keyID)
280 {
281 for (int i = 0; i < (int)BindingProfileID::Count; i++)
282 {
283 auto profileID = (BindingProfileID)i;
284 if (g_Bindings.GetBoundKeyID(profileID, In::Forward) == keyID)
285 {
286 AxisMap[AxisID::Move].y = 1.0f;
287 }
288 else if (g_Bindings.GetBoundKeyID(profileID, In::Back) == keyID)
289 {
290 AxisMap[AxisID::Move].y = -1.0f;
291 }
292 else if (g_Bindings.GetBoundKeyID(profileID, In::Left) == keyID)
293 {
294 AxisMap[AxisID::Move].x = -1.0f;
295 }
296 else if (g_Bindings.GetBoundKeyID(profileID, In::Right) == keyID)
297 {
298 AxisMap[AxisID::Move].x = 1.0f;
299 }
300 }
301 }
302
303 static void ReadKeyboard()
304 {

Callers 3

ReadKeyboardFunction · 0.85
ReadMouseFunction · 0.85
ReadGamepadFunction · 0.85

Calls 1

GetBoundKeyIDMethod · 0.80

Tested by

no test coverage detected