From 19513d9b25bae4a1bca48b3a126566550d77e406 Mon Sep 17 00:00:00 2001 From: Alexander Date: Sat, 19 Jan 2019 15:18:49 -0500 Subject: Refactored callback handler Callback handler now calls the callMouse() function instead of duplicating the code in that function. --- src/client/callbackhandeler.cpp | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) (limited to 'src') diff --git a/src/client/callbackhandeler.cpp b/src/client/callbackhandeler.cpp index e24763d..133635c 100644 --- a/src/client/callbackhandeler.cpp +++ b/src/client/callbackhandeler.cpp @@ -128,17 +128,7 @@ bool GlobalEventReceiver::OnEvent(const SEvent& e){ switch(se.Event){ case EMIE_MOUSE_MOVED:{ - //printf("Mouse moved...\n"); - lua_getglobal(L,"GAME");//{} - lua_getfield(L,-1,"onMouseMove");//{},onMouseMove() - if(!lua_isnil(L,-1)){ - lua_pushnumber(L,se.X);//{},onMouseMove(),X - lua_pushnumber(L,se.Y);//{},onMouseMove(),Y - lua_call(L,2,0);//{} - lua_pop(L,1);// - }else{ - lua_pop(L,2); - } + callMouse(L,"onMouseMove",se.X,se.Y,se.Event); } break; case EMIE_LMOUSE_PRESSED_DOWN: -- cgit v1.2.3-70-g09d2