Merge branch 'MihailRis:main' into fix
This commit is contained in:
@@ -247,6 +247,14 @@ const char* lua::LuaState::tostring(int idx) {
|
||||
return lua_tostring(L, idx);
|
||||
}
|
||||
|
||||
bool lua::LuaState::isstring(int idx) {
|
||||
return lua_isstring(L, idx);
|
||||
}
|
||||
|
||||
bool lua::LuaState::isfunction(int idx) {
|
||||
return lua_isfunction(L, idx);
|
||||
}
|
||||
|
||||
void lua::LuaState::openlib(const std::string& name, const luaL_Reg* libfuncs, int nup) {
|
||||
lua_newtable(L);
|
||||
luaL_setfuncs(L, libfuncs, nup);
|
||||
|
||||
@@ -45,6 +45,8 @@ namespace lua {
|
||||
luaint tointeger(int idx);
|
||||
luanumber tonumber(int idx);
|
||||
const char* tostring(int idx);
|
||||
bool isstring(int idx);
|
||||
bool isfunction(int idx);
|
||||
int call(int argc);
|
||||
int callNoThrow(int argc);
|
||||
int execute(int env, const std::string& src, const std::string& file="<string>");
|
||||
|
||||
@@ -391,6 +391,18 @@ static int l_audio_get_velocity(lua_State* L) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
// @brief audio.count_speakers() -> integer
|
||||
static int l_audio_count_speakers(lua_State* L) {
|
||||
lua_pushinteger(L, audio::count_speakers());
|
||||
return 1;
|
||||
}
|
||||
|
||||
// @brief audio.count_streams() -> integer
|
||||
static int l_audio_count_streams(lua_State* L) {
|
||||
lua_pushinteger(L, audio::count_streams());
|
||||
return 1;
|
||||
}
|
||||
|
||||
const luaL_Reg audiolib [] = {
|
||||
{"play_sound", lua_wrap_errors<l_audio_play_sound>},
|
||||
{"play_sound_2d", lua_wrap_errors<l_audio_play_sound_2d>},
|
||||
@@ -414,5 +426,7 @@ const luaL_Reg audiolib [] = {
|
||||
{"get_duration", lua_wrap_errors<l_audio_get_duration>},
|
||||
{"get_position", lua_wrap_errors<l_audio_get_position>},
|
||||
{"get_velocity", lua_wrap_errors<l_audio_get_velocity>},
|
||||
{"count_speakers", lua_wrap_errors<l_audio_count_speakers>},
|
||||
{"count_streams", lua_wrap_errors<l_audio_count_streams>},
|
||||
{NULL, NULL}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user