define lua stylus functions with DEFINE_LUA_FUNCTION

This commit is contained in:
gocha 2012-07-27 08:38:18 +00:00
parent 2e9eadd1de
commit 49eb575ccb
1 changed files with 5 additions and 3 deletions

View File

@ -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...)