mirror of https://github.com/bjornbytes/lovr.git
Source pitchable flag defaults to true;
This commit is contained in:
parent
74325d81a1
commit
5210d474b8
|
@ -239,7 +239,7 @@ static int l_lovrAudioNewSource(lua_State* L) {
|
||||||
Sound* sound = luax_totype(L, 1, Sound);
|
Sound* sound = luax_totype(L, 1, Sound);
|
||||||
|
|
||||||
bool decode = false;
|
bool decode = false;
|
||||||
bool pitchable = false;
|
bool pitchable = true;
|
||||||
bool spatial = true;
|
bool spatial = true;
|
||||||
uint32_t effects = ~0u;
|
uint32_t effects = ~0u;
|
||||||
if (lua_gettop(L) >= 2) {
|
if (lua_gettop(L) >= 2) {
|
||||||
|
@ -250,7 +250,7 @@ static int l_lovrAudioNewSource(lua_State* L) {
|
||||||
lua_pop(L, 1);
|
lua_pop(L, 1);
|
||||||
|
|
||||||
lua_getfield(L, 2, "pitchable");
|
lua_getfield(L, 2, "pitchable");
|
||||||
pitchable = lua_toboolean(L, -1);
|
if (!lua_isnil(L, -1)) pitchable = lua_toboolean(L, -1);
|
||||||
lua_pop(L, 1);
|
lua_pop(L, 1);
|
||||||
|
|
||||||
lua_getfield(L, 2, "effects");
|
lua_getfield(L, 2, "effects");
|
||||||
|
@ -273,7 +273,7 @@ static int l_lovrAudioNewSource(lua_State* L) {
|
||||||
lua_pop(L, 1);
|
lua_pop(L, 1);
|
||||||
|
|
||||||
lua_getfield(L, 2, "spatial");
|
lua_getfield(L, 2, "spatial");
|
||||||
spatial = lua_isnil(L, -1) ? true : lua_toboolean(L, -1);
|
if (!lua_isnil(L, -1)) spatial = lua_toboolean(L, -1);
|
||||||
lua_pop(L, 1);
|
lua_pop(L, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue