aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander <alex@cogarr.net>2019-01-19 15:18:49 -0500
committerAlexander <alex@cogarr.net>2019-01-19 15:18:49 -0500
commit19513d9b25bae4a1bca48b3a126566550d77e406 (patch)
tree397a335c93037f3e5b83a63c27a4763559af0b40
parent5051152632ab561b40a60b46c75ab05aa375ebb9 (diff)
downloadbrokengine-19513d9b25bae4a1bca48b3a126566550d77e406.tar.gz
brokengine-19513d9b25bae4a1bca48b3a126566550d77e406.tar.bz2
brokengine-19513d9b25bae4a1bca48b3a126566550d77e406.zip
Refactored callback handler
Callback handler now calls the callMouse() function instead of duplicating the code in that function.
-rw-r--r--src/client/callbackhandeler.cpp12
1 files changed, 1 insertions, 11 deletions
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: