| 265 | } |
| 266 | |
| 267 | const char* PhysXSampleApplication::inputInfoMsg(const char* firstPart,const char* secondPart, PxI32 inputEventId1, PxI32 inputEventId2) |
| 268 | { |
| 269 | const char* keyNames1[5]; |
| 270 | |
| 271 | PxU32 inputMask = 0; |
| 272 | if(m_platform->getSampleUserInput()->gamepadSupported() && m_platform->getSampleUserInput()->keyboardSupported()) |
| 273 | { |
| 274 | inputMask = KEYBOARD_INPUT | GAMEPAD_INPUT | TOUCH_PAD_INPUT | MOUSE_INPUT; |
| 275 | } |
| 276 | else |
| 277 | { |
| 278 | if(m_platform->getSampleUserInput()->gamepadSupported()) |
| 279 | { |
| 280 | inputMask = GAMEPAD_INPUT | TOUCH_PAD_INPUT | MOUSE_INPUT; |
| 281 | } |
| 282 | |
| 283 | if(m_platform->getSampleUserInput()->keyboardSupported()) |
| 284 | { |
| 285 | inputMask = KEYBOARD_INPUT | TOUCH_PAD_INPUT | MOUSE_INPUT; |
| 286 | } |
| 287 | } |
| 288 | |
| 289 | PxU16 numNames1 = getPlatform()->getSampleUserInput()->getUserInputKeys(inputEventId1,keyNames1,5,inputMask); |
| 290 | |
| 291 | const char* keyNames2[5]; |
| 292 | PxU16 numNames2 = getPlatform()->getSampleUserInput()->getUserInputKeys(inputEventId2,keyNames2,5,inputMask); |
| 293 | |
| 294 | if(!numNames1 && !numNames2) |
| 295 | return NULL; |
| 296 | |
| 297 | strcpy(m_Msg, firstPart); |
| 298 | if(numNames1 && numNames2) |
| 299 | { |
| 300 | for (PxU16 i = 0; i < numNames1; i++) |
| 301 | { |
| 302 | strcat(m_Msg, keyNames1[i]); |
| 303 | strcat(m_Msg, " or "); |
| 304 | } |
| 305 | |
| 306 | for (PxU16 i = 0; i < numNames2; i++) |
| 307 | { |
| 308 | strcat(m_Msg, keyNames2[i]); |
| 309 | if(i != numNames2 - 1) |
| 310 | strcat(m_Msg, " or "); |
| 311 | } |
| 312 | } |
| 313 | else |
| 314 | { |
| 315 | if(numNames1) |
| 316 | { |
| 317 | for (PxU16 i = 0; i < numNames1; i++) |
| 318 | { |
| 319 | strcat(m_Msg, keyNames1[i]); |
| 320 | if(i != numNames1 - 1) |
| 321 | strcat(m_Msg, " or "); |
| 322 | } |
| 323 | } |
| 324 | else |
no test coverage detected