mirror of
https://github.com/TangentFoxy/slam.git
synced 2024-11-14 10:24:21 +00:00
Fix Source:isStatic(). Load SoundData only once.
Source:isStatic() was missing `self.' Static sources now load the SoundData only once, unless the `what' argument is a decoder.
This commit is contained in:
parent
18df87baf6
commit
bb0eaeb0e2
@ -97,7 +97,7 @@ function Source:removeTags(tag, ...)
|
|||||||
end
|
end
|
||||||
|
|
||||||
function Source:isStatic()
|
function Source:isStatic()
|
||||||
return how ~= "stream"
|
return self.how ~= "stream"
|
||||||
end
|
end
|
||||||
|
|
||||||
-- getter/setter for looping, pitch and volume
|
-- getter/setter for looping, pitch and volume
|
||||||
@ -128,6 +128,9 @@ function love.audio.newSource(what, how)
|
|||||||
pitch = 1,
|
pitch = 1,
|
||||||
volume = 1,
|
volume = 1,
|
||||||
}
|
}
|
||||||
|
if how == 'static' and type(what) == 'string' then
|
||||||
|
s.what = love.sound.newSoundData(what)
|
||||||
|
end
|
||||||
love.audio.tags.all[s] = s
|
love.audio.tags.all[s] = s
|
||||||
return setmetatable(s, Source)
|
return setmetatable(s, Source)
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user