diff options
author | chai <chaifix@163.com> | 2019-09-13 15:08:43 +0800 |
---|---|---|
committer | chai <chaifix@163.com> | 2019-09-13 15:08:43 +0800 |
commit | 20535cb86266d7a4828009f3ddca42e35269b9e2 (patch) | |
tree | 796e77e4a34ed52b6c92fb58ec432c69ed4232e1 /src/libjin-lua/modules/mouse/l_mouse.cpp | |
parent | 695eadc9d2a6d2f499b24ee6858325f6e22da077 (diff) |
*格式化代码
Diffstat (limited to 'src/libjin-lua/modules/mouse/l_mouse.cpp')
-rw-r--r-- | src/libjin-lua/modules/mouse/l_mouse.cpp | 60 |
1 files changed, 30 insertions, 30 deletions
diff --git a/src/libjin-lua/modules/mouse/l_mouse.cpp b/src/libjin-lua/modules/mouse/l_mouse.cpp index f6864ee..2f0dfb4 100644 --- a/src/libjin-lua/modules/mouse/l_mouse.cpp +++ b/src/libjin-lua/modules/mouse/l_mouse.cpp @@ -6,37 +6,37 @@ using namespace JinEngine::Input; namespace JinEngine { - namespace Lua - { + namespace Lua + { - LUA_IMPLEMENT int l_pos(lua_State* L) - { - static Mouse* mouse = Mouse::get(); - int x, y; - mouse->getState(&x, &y); - luax_pushnumber(L, x); - luax_pushnumber(L, y); - return 2; - } + LUA_IMPLEMENT int l_pos(lua_State* L) + { + static Mouse* mouse = Mouse::get(); + int x, y; + mouse->getState(&x, &y); + luax_pushnumber(L, x); + luax_pushnumber(L, y); + return 2; + } - LUA_IMPLEMENT int l_setVisible(lua_State* L) - { - bool visible = luax_checkbool(L, 1); - Mouse* mouse = Mouse::get(); - mouse->setVisible(visible); - return 0; - } - - LUA_EXPORT int luaopen_mouse(lua_State* L) - { - luaL_Reg methods[] = { - { "getPosition", l_pos }, - { "setVisible", l_setVisible }, - { 0, 0 } - }; - luax_newlib(L, methods); - return 1; - } + LUA_IMPLEMENT int l_setVisible(lua_State* L) + { + bool visible = luax_checkbool(L, 1); + Mouse* mouse = Mouse::get(); + mouse->setVisible(visible); + return 0; + } + + LUA_EXPORT int luaopen_mouse(lua_State* L) + { + luaL_Reg methods[] = { + { "getPosition", l_pos }, + { "setVisible", l_setVisible }, + { 0, 0 } + }; + luax_newlib(L, methods); + return 1; + } - } // namespace Lua + } // namespace Lua } // namespace JinEngine
\ No newline at end of file |