140 else |
140 else |
141 lua_pushinteger(L, not lua_tointeger(L, 1)); |
141 lua_pushinteger(L, not lua_tointeger(L, 1)); |
142 lc_bnot := 1; |
142 lc_bnot := 1; |
143 end; |
143 end; |
144 |
144 |
|
145 function lc_div(L: PLua_State): LongInt; Cdecl; |
|
146 begin |
|
147 if lua_gettop(L) <> 2 then |
|
148 begin |
|
149 LuaError('Lua: Wrong number of parameters passed to div!'); |
|
150 lua_pushnil(L); |
|
151 end |
|
152 else |
|
153 lua_pushinteger(L, lua_tointeger(L, 2) div lua_tointeger(L, 1)); |
|
154 lc_div := 1; |
|
155 end; |
|
156 |
145 function lc_getinputmask(L : Plua_State) : LongInt; Cdecl; |
157 function lc_getinputmask(L : Plua_State) : LongInt; Cdecl; |
146 begin |
158 begin |
147 if lua_gettop(L) <> 0 then |
159 if lua_gettop(L) <> 0 then |
148 LuaError('Lua: Wrong number of parameters passed to GetInputMask!') |
160 LuaError('Lua: Wrong number of parameters passed to GetInputMask!') |
149 else |
161 else |
2131 |
2143 |
2132 // register functions |
2144 // register functions |
2133 lua_register(luaState, 'band', @lc_band); |
2145 lua_register(luaState, 'band', @lc_band); |
2134 lua_register(luaState, 'bor', @lc_bor); |
2146 lua_register(luaState, 'bor', @lc_bor); |
2135 lua_register(luaState, 'bnot', @lc_bnot); |
2147 lua_register(luaState, 'bnot', @lc_bnot); |
|
2148 lua_register(luaState, 'div', @lc_div); |
2136 lua_register(luaState, 'GetInputMask', @lc_getinputmask); |
2149 lua_register(luaState, 'GetInputMask', @lc_getinputmask); |
2137 lua_register(luaState, 'SetInputMask', @lc_setinputmask); |
2150 lua_register(luaState, 'SetInputMask', @lc_setinputmask); |
2138 lua_register(luaState, 'AddGear', @lc_addgear); |
2151 lua_register(luaState, 'AddGear', @lc_addgear); |
2139 lua_register(luaState, 'DeleteGear', @lc_deletegear); |
2152 lua_register(luaState, 'DeleteGear', @lc_deletegear); |
2140 lua_register(luaState, 'AddVisualGear', @lc_addvisualgear); |
2153 lua_register(luaState, 'AddVisualGear', @lc_addvisualgear); |