From 49eb575ccb267381b69528be060779e51c3035ec Mon Sep 17 00:00:00 2001 From: gocha Date: Fri, 27 Jul 2012 08:38:18 +0000 Subject: [PATCH] define lua stylus functions with DEFINE_LUA_FUNCTION --- desmume/src/lua-engine.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/desmume/src/lua-engine.cpp b/desmume/src/lua-engine.cpp index af3e9e433..ee47480fe 100644 --- a/desmume/src/lua-engine.cpp +++ b/desmume/src/lua-engine.cpp @@ -4421,7 +4421,8 @@ static int gui_osdtext(lua_State *L) return 0; } -static int stylus_read(lua_State *L){ +DEFINE_LUA_FUNCTION(stylus_read, "") +{ lua_newtable(L); @@ -4434,7 +4435,8 @@ static int stylus_read(lua_State *L){ return 1; } -static int stylus_peek(lua_State *L){ +DEFINE_LUA_FUNCTION(stylus_peek, "") +{ lua_newtable(L); @@ -4452,7 +4454,7 @@ static int toTouchValue(int pixCoord, int maximum) pixCoord = std::min(std::max(pixCoord, 0), maximum-1); return (pixCoord << 4) & 0x0FF0; } -static int stylus_write(lua_State *L) +DEFINE_LUA_FUNCTION(stylus_write, "table") { if(movieMode == MOVIEMODE_PLAY) // don't allow tampering with a playing movie's input return 0; // (although it might be useful sometimes...)