mirror of
https://github.com/love2d/love.git
synced 2026-08-16 00:02:12 +02:00
Renamed Source:setRelativePosition and Source:hasRelativePosition to Source:setRelative and Source:isRelative. Updated changelog.
This commit is contained in:
@@ -83,8 +83,8 @@ public:
|
||||
virtual void setCone(float innerAngle, float outerAngle, float outerVolume) = 0;
|
||||
virtual void getCone(float &innerAngle, float &outerAngle, float &outerVolume) const = 0;
|
||||
|
||||
virtual void setRelativePosition(bool relative) = 0;
|
||||
virtual bool hasRelativePosition() const = 0;
|
||||
virtual void setRelative(bool enable) = 0;
|
||||
virtual bool isRelative() const = 0;
|
||||
|
||||
virtual void setLooping(bool looping) = 0;
|
||||
virtual bool isLooping() const = 0;
|
||||
|
||||
@@ -149,14 +149,14 @@ void Source::getCone(float &innerAngle, float &outerAngle, float &outerVolume) c
|
||||
outerVolume = coneOuterVolume;
|
||||
}
|
||||
|
||||
void Source::setRelativePosition(bool relative)
|
||||
void Source::setRelative(bool enable)
|
||||
{
|
||||
relativePosition = relative;
|
||||
relative = enable;
|
||||
}
|
||||
|
||||
bool Source::hasRelativePosition() const
|
||||
bool Source::isRelative() const
|
||||
{
|
||||
return relativePosition;
|
||||
return relative;
|
||||
}
|
||||
|
||||
void Source::setLooping(bool looping)
|
||||
|
||||
@@ -62,8 +62,8 @@ public:
|
||||
virtual void getDirection(float *v) const;
|
||||
virtual void setCone(float innerAngle, float outerAngle, float outerVolume);
|
||||
virtual void getCone(float &innerAngle, float &outerAngle, float &outerVolume) const;
|
||||
virtual void setRelativePosition(bool relative);
|
||||
virtual bool hasRelativePosition() const;
|
||||
virtual void setRelative(bool enable);
|
||||
virtual bool isRelative() const;
|
||||
void setLooping(bool looping);
|
||||
bool isLooping() const;
|
||||
bool isStatic() const;
|
||||
@@ -86,7 +86,7 @@ private:
|
||||
float coneInnerAngle;
|
||||
float coneOuterAngle;
|
||||
float coneOuterVolume;
|
||||
bool relativePosition;
|
||||
bool relative;
|
||||
bool looping;
|
||||
float minVolume;
|
||||
float maxVolume;
|
||||
|
||||
@@ -39,7 +39,7 @@ Source::Source(Pool *pool, love::sound::SoundData *soundData)
|
||||
, valid(false)
|
||||
, pitch(1.0f)
|
||||
, volume(1.0f)
|
||||
, relativePosition(false)
|
||||
, relative(false)
|
||||
, looping(false)
|
||||
, paused(false)
|
||||
, minVolume(0.0f)
|
||||
@@ -71,7 +71,7 @@ Source::Source(Pool *pool, love::sound::Decoder *decoder)
|
||||
, valid(false)
|
||||
, pitch(1.0f)
|
||||
, volume(1.0f)
|
||||
, relativePosition(false)
|
||||
, relative(false)
|
||||
, looping(false)
|
||||
, paused(false)
|
||||
, minVolume(0.0f)
|
||||
@@ -429,17 +429,17 @@ void Source::getCone(float &innerAngle, float &outerAngle, float &outerVolume) c
|
||||
outerVolume = cone.outerVolume;
|
||||
}
|
||||
|
||||
void Source::setRelativePosition(bool relative)
|
||||
void Source::setRelative(bool enable)
|
||||
{
|
||||
if (valid)
|
||||
alSourcei(source, AL_SOURCE_RELATIVE, relative ? AL_TRUE : AL_FALSE);
|
||||
|
||||
relativePosition = relative;
|
||||
relative = enable;
|
||||
}
|
||||
|
||||
bool Source::hasRelativePosition() const
|
||||
bool Source::isRelative() const
|
||||
{
|
||||
return relativePosition;
|
||||
return relative;
|
||||
}
|
||||
|
||||
void Source::setLooping(bool looping)
|
||||
@@ -575,7 +575,7 @@ void Source::reset()
|
||||
alSourcef(source, AL_ROLLOFF_FACTOR, rolloffFactor);
|
||||
alSourcef(source, AL_MAX_DISTANCE, maxDistance);
|
||||
alSourcei(source, AL_LOOPING, isStatic() && isLooping() ? AL_TRUE : AL_FALSE);
|
||||
alSourcei(source, AL_SOURCE_RELATIVE, relativePosition ? AL_TRUE : AL_FALSE);
|
||||
alSourcei(source, AL_SOURCE_RELATIVE, relative ? AL_TRUE : AL_FALSE);
|
||||
alSourcei(source, AL_CONE_INNER_ANGLE, cone.innerAngle);
|
||||
alSourcei(source, AL_CONE_OUTER_ANGLE, cone.outerAngle);
|
||||
alSourcef(source, AL_CONE_OUTER_GAIN, cone.outerVolume);
|
||||
|
||||
@@ -80,8 +80,8 @@ public:
|
||||
virtual void getDirection(float *v) const;
|
||||
virtual void setCone(float innerAngle, float outerAngle, float outerVolume);
|
||||
virtual void getCone(float &innerAngle, float &outerAngle, float &outerVolume) const;
|
||||
virtual void setRelativePosition(bool relative);
|
||||
virtual bool hasRelativePosition() const;
|
||||
virtual void setRelative(bool enable);
|
||||
virtual bool isRelative() const;
|
||||
void setLooping(bool looping);
|
||||
bool isLooping() const;
|
||||
bool isStatic() const;
|
||||
@@ -131,7 +131,7 @@ private:
|
||||
float position[3];
|
||||
float velocity[3];
|
||||
float direction[3];
|
||||
bool relativePosition;
|
||||
bool relative;
|
||||
bool looping;
|
||||
bool paused;
|
||||
float minVolume;
|
||||
|
||||
@@ -211,17 +211,17 @@ int w_Source_getCone(lua_State *L)
|
||||
return 3;
|
||||
}
|
||||
|
||||
int w_Source_setRelativePosition(lua_State *L)
|
||||
int w_Source_setRelative(lua_State *L)
|
||||
{
|
||||
Source *t = luax_checksource(L, 1);
|
||||
t->setRelativePosition(luax_toboolean(L, 2));
|
||||
t->setRelative(luax_toboolean(L, 2));
|
||||
return 0;
|
||||
}
|
||||
|
||||
int w_Source_hasRelativePosition(lua_State *L)
|
||||
int w_Source_isRelative(lua_State *L)
|
||||
{
|
||||
Source *t = luax_checksource(L, 1);
|
||||
luax_pushboolean(L, t->hasRelativePosition());
|
||||
luax_pushboolean(L, t->isRelative());
|
||||
return 1;
|
||||
}
|
||||
|
||||
@@ -367,8 +367,8 @@ static const luaL_Reg functions[] =
|
||||
{ "setCone", w_Source_setCone },
|
||||
{ "getCone", w_Source_getCone },
|
||||
|
||||
{ "setRelativePosition", w_Source_setRelativePosition },
|
||||
{ "hasRelativePosition", w_Source_hasRelativePosition },
|
||||
{ "setRelative", w_Source_setRelative },
|
||||
{ "isRelative", w_Source_isRelative },
|
||||
|
||||
{ "setLooping", w_Source_setLooping },
|
||||
{ "isLooping", w_Source_isLooping },
|
||||
|
||||
@@ -49,8 +49,8 @@ int w_Source_setDirection(lua_State *L);
|
||||
int w_Source_getDirection(lua_State *L);
|
||||
int w_Source_setCone(lua_State *L);
|
||||
int w_Source_getCone(lua_State *L);
|
||||
int w_Source_setRelativePosition(lua_State *L);
|
||||
int w_Source_hasRelativePosition(lua_State *L);
|
||||
int w_Source_setRelative(lua_State *L);
|
||||
int w_Source_isRelative(lua_State *L);
|
||||
int w_Source_setLooping(lua_State *L);
|
||||
int w_Source_isLooping(lua_State *L);
|
||||
int w_Source_isStopped(lua_State *L);
|
||||
|
||||
Reference in New Issue
Block a user