MCPcopy Create free account
hub / github.com/defold/defold / CopyGamepadTrigger

Function CopyGamepadTrigger

engine/input/src/input.cpp:268–282  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

266 }
267
268 static dmInputDDF::GamepadTrigger* CopyGamepadTrigger(const dmInputDDF::GamepadTrigger* orig, uint32_t count)
269 {
270 dmInputDDF::GamepadTrigger* copy = new dmInputDDF::GamepadTrigger[count];
271
272 for (uint32_t i = 0; i < count; ++i)
273 {
274 copy[i].m_Input = orig[i].m_Input;
275 size_t str_len = strlen(orig[i].m_Action) + 1;
276 copy[i].m_Action = new char[str_len];
277 dmStrlCpy((char*)copy[i].m_Action, orig[i].m_Action, str_len);
278 ((char*)copy[i].m_Action)[str_len-1] = '\0';
279 }
280
281 return copy;
282 }
283
284 static void DeleteGamepadTrigger(dmInputDDF::GamepadTrigger* triggers, uint32_t count)
285 {

Callers 1

SetBindingFunction · 0.85

Calls 1

dmStrlCpyFunction · 0.85

Tested by

no test coverage detected