MCPcopy Create free account
hub / github.com/axmolengine/axmol / handleCommonEvent

Method handleCommonEvent

extensions/scripting/lua-bindings/manual/LuaEngine.cpp:390–414  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

388}
389
390int LuaEngine::handleCommonEvent(void* data)
391{
392 if (NULL == data)
393 return 0;
394
395 CommonScriptData* commonInfo = static_cast<CommonScriptData*>(data);
396 if (0 == commonInfo->handler)
397 return 0;
398
399 _stack->pushString(commonInfo->eventName);
400 if (NULL != commonInfo->eventSource)
401 {
402 if (strlen(commonInfo->eventSourceClassName) > 0)
403 {
404 _stack->pushObject(commonInfo->eventSource, commonInfo->eventSourceClassName);
405 }
406 else
407 {
408 _stack->pushObject(commonInfo->eventSource, "ax.Object");
409 }
410 }
411 int ret = _stack->executeFunctionByHandler(commonInfo->handler, commonInfo->eventSource ? 2 : 1);
412 _stack->clean();
413 return ret;
414}
415
416int LuaEngine::handleTouchEvent(void* data)
417{

Callers

nothing calls this directly

Calls 4

pushStringMethod · 0.80
pushObjectMethod · 0.80
cleanMethod · 0.45

Tested by

no test coverage detected