mirror of https://github.com/bjornbytes/lovr.git
Allow lovr.audio.setDevice(type, nil);
This commit is contained in:
parent
0c3351331e
commit
058700f970
|
@ -77,9 +77,8 @@ static int l_lovrAudioGetDevices(lua_State *L) {
|
|||
|
||||
static int l_lovrAudioSetDevice(lua_State *L) {
|
||||
AudioType type = luax_checkenum(L, 1, AudioType, "playback");
|
||||
luaL_checkany(L, 2);
|
||||
void* id = lua_touserdata(L, 2);
|
||||
size_t size = luax_len(L, 2);
|
||||
size_t size = id ? luax_len(L, 2) : 0;
|
||||
Sound* sink = lua_isnoneornil(L, 3) ? NULL : luax_checktype(L, 3, Sound);
|
||||
AudioShareMode shareMode = luax_checkenum(L, 4, AudioShareMode, "shared");
|
||||
bool success = lovrAudioSetDevice(type, id, size, sink, shareMode);
|
||||
|
|
Loading…
Reference in New Issue