mirror of https://github.com/bjornbytes/lovr.git
parent
7f5e46ad0b
commit
84bfac984c
|
@ -89,7 +89,6 @@ static int l_lovrAudioGetDevices(lua_State *L) {
|
||||||
int listOfDevicesIdx = lua_gettop(L);
|
int listOfDevicesIdx = lua_gettop(L);
|
||||||
for(int i = 0; i < devices->length; i++) {
|
for(int i = 0; i < devices->length; i++) {
|
||||||
AudioDevice *device = &devices->data[i];
|
AudioDevice *device = &devices->data[i];
|
||||||
lua_pushinteger(L, i+1); // key in listOfDevicesIdx, for the bottom settable
|
|
||||||
lua_newtable(L);
|
lua_newtable(L);
|
||||||
luax_pushenum(L, AudioType, device->type);
|
luax_pushenum(L, AudioType, device->type);
|
||||||
lua_setfield(L, -2, "type");
|
lua_setfield(L, -2, "type");
|
||||||
|
@ -98,7 +97,7 @@ static int l_lovrAudioGetDevices(lua_State *L) {
|
||||||
lua_pushboolean(L, device->isDefault);
|
lua_pushboolean(L, device->isDefault);
|
||||||
lua_setfield(L, -2, "isDefault");
|
lua_setfield(L, -2, "isDefault");
|
||||||
|
|
||||||
lua_settable(L, listOfDevicesIdx);
|
lua_rawseti(L, listOfDevicesIdx, i + 1);
|
||||||
}
|
}
|
||||||
lovrAudioFreeDevices(devices);
|
lovrAudioFreeDevices(devices);
|
||||||
return 1;
|
return 1;
|
||||||
|
|
Loading…
Reference in New Issue