mirror of
https://github.com/love2d/love.git
synced 2026-08-14 01:20:56 +02:00
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:
@@ -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 },
|
||||
|
||||
Reference in New Issue
Block a user