Added Source:setRelativePosition and Source:hasRelativePosition, if enabled the Source's position will always be relative to the listener instead of absolute.

This commit is contained in:
Alex Szpakowski
2013-10-11 02:25:48 -03:00
parent 2710c6c488
commit 7f3cd7f044
7 changed files with 54 additions and 0 deletions
+17
View File
@@ -190,6 +190,20 @@ int w_Source_getDirection(lua_State *L)
return 3;
}
int w_Source_setRelativePosition(lua_State *L)
{
Source *t = luax_checksource(L, 1);
t->setRelativePosition(luax_toboolean(L, 2));
return 0;
}
int w_Source_hasRelativePosition(lua_State *L)
{
Source *t = luax_checksource(L, 1);
luax_pushboolean(L, t->hasRelativePosition());
return 1;
}
int w_Source_setLooping(lua_State *L)
{
Source *t = luax_checksource(L, 1);
@@ -323,6 +337,9 @@ static const luaL_Reg functions[] =
{ "setDirection", w_Source_setDirection },
{ "getDirection", w_Source_getDirection },
{ "setRelativePosition", w_Source_setRelativePosition },
{ "hasRelativePosition", w_Source_hasRelativePosition },
{ "setLooping", w_Source_setLooping },
{ "isLooping", w_Source_isLooping },
{ "isStopped", w_Source_isStopped },