From b57256b3e5fe4a0a137950aed8bacc78b5374240 Mon Sep 17 00:00:00 2001 From: Alex Szpakowski Date: Fri, 25 Oct 2013 17:05:29 -0300 Subject: [PATCH] Renamed Source:setRelativePosition and Source:hasRelativePosition to Source:setRelative and Source:isRelative. Updated changelog. --- changes.txt | 6 +++++- src/modules/audio/Source.h | 4 ++-- src/modules/audio/null/Source.cpp | 8 ++++---- src/modules/audio/null/Source.h | 6 +++--- src/modules/audio/openal/Source.cpp | 14 +++++++------- src/modules/audio/openal/Source.h | 6 +++--- src/modules/audio/wrap_Source.cpp | 12 ++++++------ src/modules/audio/wrap_Source.h | 4 ++-- 8 files changed, 32 insertions(+), 28 deletions(-) diff --git a/changes.txt b/changes.txt index 6cab4e2a8..a590b840a 100644 --- a/changes.txt +++ b/changes.txt @@ -51,7 +51,7 @@ LOVE 0.9.0 [Baby Inspector] * Added Image:getData. * Added SoundData:getDuration and SoundData:getSampleCount. * Added Source:isPlaying. - * Added Source:setRelativePosition and Source:hasRelativePosition. + * Added Source:setRelative and Source:isRelative. * Added Source:setCone and Source:getCone. * Added Source:getChannels. * Added new Channels API for love.thread. @@ -136,6 +136,7 @@ LOVE 0.9.0 [Baby Inspector] * Fixed looping support in tracker music formats. * Fixed skipping/looping issues when playing streaming audio Sources. * Fixed race condition in Source:play. + * Fixed WAVE sound playback. * Moved love's startup to modules/love. * Moved window-related functions from love.graphics to love.window. @@ -145,6 +146,8 @@ LOVE 0.9.0 [Baby Inspector] * Renamed love.filesystem.enumerate to love.filesystem.getDirectoryItems. * Renamed World:setAllowSleeping to World:setSleepingAllowed. * Renamed ChainShape:setPrevVertex to ChainShape:setPreviousVertex. + * Renamed Joint:enableMotor to Joint:setMotorEnabled. + * Renamed Joint:enableLimit and Joint:isLimitEnabled to Joint:setLimitsEnabled and Joint:hasLimitsEnabled. * Renamed t.screen to t.window in love.conf. * Renamed love.graphics.setCaption to love.window.setTitle. * Renamed PixelEffect to Shader (but now with vertex shaders). @@ -167,6 +170,7 @@ LOVE 0.9.0 [Baby Inspector] * Removed love.graphics.setLine/setPoint. * Removed love.graphics.drawq (functionality is merged into love.graphics.draw). * Removed SpriteBatch:addq/setq (functionality is merged into SpriteBatch:add/set). + * Removed Quad:flip. * Removed ParticleSystem:isFull/isEmpty. * Removed ParticleSystem:getX/getY. * Removed love.graphics.checkMode. diff --git a/src/modules/audio/Source.h b/src/modules/audio/Source.h index 085d18395..93fbd4720 100644 --- a/src/modules/audio/Source.h +++ b/src/modules/audio/Source.h @@ -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; diff --git a/src/modules/audio/null/Source.cpp b/src/modules/audio/null/Source.cpp index cbd31c779..1d543a940 100644 --- a/src/modules/audio/null/Source.cpp +++ b/src/modules/audio/null/Source.cpp @@ -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) diff --git a/src/modules/audio/null/Source.h b/src/modules/audio/null/Source.h index d7608f5d8..969c019ab 100644 --- a/src/modules/audio/null/Source.h +++ b/src/modules/audio/null/Source.h @@ -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; diff --git a/src/modules/audio/openal/Source.cpp b/src/modules/audio/openal/Source.cpp index 078c80abe..465d2516d 100644 --- a/src/modules/audio/openal/Source.cpp +++ b/src/modules/audio/openal/Source.cpp @@ -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); diff --git a/src/modules/audio/openal/Source.h b/src/modules/audio/openal/Source.h index 669c777ca..93824be41 100644 --- a/src/modules/audio/openal/Source.h +++ b/src/modules/audio/openal/Source.h @@ -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; diff --git a/src/modules/audio/wrap_Source.cpp b/src/modules/audio/wrap_Source.cpp index 1dfd38c40..2253aee09 100644 --- a/src/modules/audio/wrap_Source.cpp +++ b/src/modules/audio/wrap_Source.cpp @@ -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 }, diff --git a/src/modules/audio/wrap_Source.h b/src/modules/audio/wrap_Source.h index 3228f2a6a..b7fb58fbf 100644 --- a/src/modules/audio/wrap_Source.h +++ b/src/modules/audio/wrap_Source.h @@ -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);