refactor: complete 'lua' namespace use

This commit is contained in:
MihailRis
2024-06-11 13:51:11 +03:00
parent 90bc86408b
commit 913e5983b1
26 changed files with 370 additions and 359 deletions
+5 -5
View File
@@ -13,17 +13,17 @@ namespace scripting {
}
using namespace scripting;
static int l_keycode(lua_State* L) {
static int l_keycode(lua::State* L) {
auto name = lua::require_string(L, 1);
return lua::pushinteger(L, static_cast<int>(input_util::keycode_from(name)));
}
static int l_mousecode(lua_State* L) {
static int l_mousecode(lua::State* L) {
auto name = lua::require_string(L, 1);
return lua::pushinteger(L, static_cast<int>(input_util::mousecode_from(name)));
}
static int l_add_callback(lua_State* L) {
static int l_add_callback(lua::State* L) {
auto bindname = lua::require_string(L, 1);
const auto& bind = Events::bindings.find(bindname);
if (bind == Events::bindings.end()) {
@@ -44,11 +44,11 @@ static int l_add_callback(lua_State* L) {
return 0;
}
static int l_get_mouse_pos(lua_State* L) {
static int l_get_mouse_pos(lua::State* L) {
return lua::pushvec2_arr(L, Events::cursor);
}
static int l_get_bindings(lua_State* L) {
static int l_get_bindings(lua::State* L) {
auto& bindings = Events::bindings;
lua::createtable(L, bindings.size(), 0);