MCPcopy Create free account
hub / github.com/NVIDIAGameWorks/PhysX / inputMoveInfoMsg

Method inputMoveInfoMsg

physx/samples/samplebase/PhysXSampleApplication.cpp:398–490  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

396
397
398const char* PhysXSampleApplication::inputMoveInfoMsg(const char* firstPart,const char* secondPart, PxI32 inputEventId1, PxI32 inputEventId2,PxI32 inputEventId3,PxI32 inputEventId4)
399{
400 const char* keyNames1[5];
401 const char* keyNames2[5];
402 const char* keyNames3[5];
403 const char* keyNames4[5];
404
405 PxU32 inputMask = 0;
406 if(m_platform->getSampleUserInput()->gamepadSupported() && m_platform->getSampleUserInput()->keyboardSupported())
407 {
408 inputMask = KEYBOARD_INPUT | GAMEPAD_INPUT | TOUCH_PAD_INPUT | MOUSE_INPUT;
409 }
410 else
411 {
412 if(m_platform->getSampleUserInput()->gamepadSupported())
413 {
414 inputMask = GAMEPAD_INPUT | TOUCH_PAD_INPUT | MOUSE_INPUT;
415 }
416
417 if(m_platform->getSampleUserInput()->keyboardSupported())
418 {
419 inputMask = KEYBOARD_INPUT | TOUCH_PAD_INPUT | MOUSE_INPUT;
420 }
421 }
422
423 PxU16 numNames1 = getPlatform()->getSampleUserInput()->getUserInputKeys(inputEventId1,keyNames1,5,inputMask);
424 PxU16 numNames2 = getPlatform()->getSampleUserInput()->getUserInputKeys(inputEventId2,keyNames2,5,inputMask);
425 PxU16 numNames3 = getPlatform()->getSampleUserInput()->getUserInputKeys(inputEventId3,keyNames3,5,inputMask);
426 PxU16 numNames4 = getPlatform()->getSampleUserInput()->getUserInputKeys(inputEventId4,keyNames4,5,inputMask);
427
428
429 if(!numNames1 && !numNames2 && !numNames3 && !numNames4)
430 return NULL;
431
432 bool firstVal = true;
433
434 strcpy(m_Msg, firstPart);
435 if(numNames1)
436 {
437 for (PxU16 i = 0 ; i < numNames1; i++)
438 {
439 if(!firstVal)
440 {
441 strcat(m_Msg, ",");
442 }
443
444 firstVal = false;
445 strcat(m_Msg, keyNames1[i]);
446 }
447 }
448 if(numNames2)
449 {
450 for (PxU16 i = 0 ; i < numNames2; i++)
451 {
452 if(!firstVal)
453 {
454 strcat(m_Msg, ",");
455 }

Callers 6

helpRenderMethod · 0.80
helpRenderMethod · 0.80
helpRenderMethod · 0.80
helpRenderMethod · 0.80
helpRenderMethod · 0.80
helpRenderMethod · 0.80

Calls 4

getSampleUserInputMethod · 0.80
getUserInputKeysMethod · 0.80
gamepadSupportedMethod · 0.45
keyboardSupportedMethod · 0.45

Tested by

no test coverage detected