mirror of
https://github.com/nucular/sfxrlua.git
synced 2024-12-24 18:44:20 +00:00
optimize iterating over samples a little bit
This commit is contained in:
parent
c01399d1f3
commit
5828ed7d09
4
sfxr.lua
4
sfxr.lua
@ -870,8 +870,8 @@ function sfxr.Sound:generateSoundData(rate, depth, sounddata)
|
|||||||
|
|
||||||
local data = sounddata or love.sound.newSoundData(count, freq, bits, 1)
|
local data = sounddata or love.sound.newSoundData(count, freq, bits, 1)
|
||||||
|
|
||||||
for i = 0, #tab - 1 do
|
for i = 1, count do
|
||||||
data:setSample(i, tab[i + 1])
|
data:setSample(i - 1, tab[i])
|
||||||
end
|
end
|
||||||
|
|
||||||
return data, count
|
return data, count
|
||||||
|
Loading…
Reference in New Issue
Block a user