summaryrefslogtreecommitdiff
path: root/src/main.c
diff options
context:
space:
mode:
authorSimon Robertshaw <simon@hardwired.org.uk>2011-05-31 17:38:13 (GMT)
committer Simon Robertshaw <simon@hardwired.org.uk>2011-05-31 17:38:13 (GMT)
commit2c8c4bc567b09996ee69584a7229356cd411c51a (patch)
tree3298c14e85fb4bf7c0741851c0cdd6068b59c843 /src/main.c
parent2327d9678d5b75f1fcf6133966de8f4d754b0476 (diff)
downloadpowder-2c8c4bc567b09996ee69584a7229356cd411c51a.zip
powder-2c8c4bc567b09996ee69584a7229356cd411c51a.tar.gz
Pass mouse coordinates (mousex, mousey, mouseb, mousebq) and Lua click handling
Diffstat (limited to 'src/main.c')
-rw-r--r--src/main.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/src/main.c b/src/main.c
index c7e325d91..bbaee68 100644
--- a/src/main.c
+++ b/src/main.c
@@ -2372,9 +2372,9 @@ int main(int argc, char *argv[])
}
}
}
-#ifdef LUACONSOLE
- luacon_keypress(sdl_key);
-#endif
+//#ifdef LUACONSOLE
+ //luacon_keypress(sdl_key);
+//#endif
#ifdef PYCONSOLE
if (pyready==1 && pygood==1)
if (pkey!=NULL && sdl_key!=NULL)
@@ -2466,6 +2466,11 @@ int main(int argc, char *argv[])
bq = b; // bq is previous mouse state
b = SDL_GetMouseState(&x, &y); // b is current mouse state
+#ifdef LUACONSOLE
+ if(luacon_step(x, y, b, bq, sdl_key))
+ b = 0; //Mouse click was handled by Lua step
+#endif
+
for (i=0; i<SC_TOTAL; i++)//draw all the menu sections
{
draw_menu(vid_buf, i, active_menu);
@@ -3372,9 +3377,6 @@ int main(int argc, char *argv[])
}
//execute python step hook
-#ifdef LUACONSOLE
- luacon_step();
-#endif
#ifdef PYCONSOLE
if (pyready==1 && pygood==1)
if (pstep!=NULL)